From 2ab32b6fa7c1e7f48badb347e5f5e74604428bbc Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 21 Jul 2018 07:31:44 -0700 Subject: Inital commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..7bbbf9df --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Tools +Command line tools and MSBuild integration -- cgit v1.2.3-55-g6feb From 6fc54af07b10742e883f3a39ef0114e55e6a36a0 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 21 Jul 2018 07:32:28 -0700 Subject: Initialize repo --- .gitattributes | 2 + .gitignore | 305 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE.TXT | 28 ++++++ 3 files changed, 335 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE.TXT diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..dfe07704 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..77c2dccf --- /dev/null +++ b/.gitignore @@ -0,0 +1,305 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# VSCode +.vscode/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Typescript v1 declaration files +typings/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ \ No newline at end of file diff --git a/LICENSE.TXT b/LICENSE.TXT new file mode 100644 index 00000000..d4d316ef --- /dev/null +++ b/LICENSE.TXT @@ -0,0 +1,28 @@ +Copyright (c) .NET Foundation and contributors. +This software is released under the Microsoft Reciprocal License (MS-RL) (the "License"); you may not use the software except in compliance with the License. + +The text of the Microsoft Reciprocal License (MS-RL) can be found online at: + http://opensource.org/licenses/ms-rl + + +Microsoft Reciprocal License (MS-RL) + +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. + +1. Definitions + The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + A "contribution" is the original software, or any additions or changes to the software. + A "contributor" is any person that distributes its contribution under this license. + "Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights + (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations + (A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose. + (B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + (C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + (D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + (E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + (F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. -- cgit v1.2.3-55-g6feb From 306f1d0c528cb6c151594ff96a41b5c01a5c4d9b Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 21 Jul 2018 07:36:34 -0700 Subject: Integrate tools from Core project --- Tools.sln | 49 + appveyor.cmd | 21 + appveyor.yml | 29 + nuget.config | 13 + src/Directory.Build.props | 22 + src/WixToolset.BuildTasks/AssemblyInfo.cs | 7 + src/WixToolset.BuildTasks/BuildException.cs | 26 + src/WixToolset.BuildTasks/Candle.cs | 199 +++ src/WixToolset.BuildTasks/Common.cs | 41 + src/WixToolset.BuildTasks/ConvertReferences.cs | 93 ++ .../CreateItemAvoidingInference.cs | 60 + .../CreateProjectReferenceDefineConstants.cs | 271 ++++ src/WixToolset.BuildTasks/DoIt-Compile.cs | 192 +++ src/WixToolset.BuildTasks/DoIt.cs | 342 +++++ .../FileSearchHelperMethods.cs | 60 + .../GenerateCompileWithObjectPath.cs | 146 +++ src/WixToolset.BuildTasks/GetCabList.cs | 87 ++ src/WixToolset.BuildTasks/GetLooseFileList.cs | 230 ++++ src/WixToolset.BuildTasks/GlobalSuppressions.cs | 8 + src/WixToolset.BuildTasks/HeatDirectory.cs | 103 ++ src/WixToolset.BuildTasks/HeatFile.cs | 95 ++ src/WixToolset.BuildTasks/HeatProject.cs | 108 ++ src/WixToolset.BuildTasks/HeatTask.cs | 121 ++ src/WixToolset.BuildTasks/Insignia.cs | 118 ++ src/WixToolset.BuildTasks/Light.cs | 488 +++++++ src/WixToolset.BuildTasks/Lit.cs | 178 +++ src/WixToolset.BuildTasks/Pyro.cs | 140 ++ .../RefreshBundleGeneratedFile.cs | 132 ++ src/WixToolset.BuildTasks/RefreshGeneratedFile.cs | 118 ++ src/WixToolset.BuildTasks/ReplaceString.cs | 54 + src/WixToolset.BuildTasks/ResolveWixReferences.cs | 212 +++ src/WixToolset.BuildTasks/TaskBase.cs | 65 + src/WixToolset.BuildTasks/Torch.cs | 159 +++ src/WixToolset.BuildTasks/WixAssignCulture.cs | 229 ++++ src/WixToolset.BuildTasks/WixCommandLineBuilder.cs | 177 +++ src/WixToolset.BuildTasks/WixToolTask.cs | 403 ++++++ .../WixToolset.BuildTasks.csproj | 51 + src/WixToolset.BuildTasks/redirects/wix.ca.targets | 10 + src/WixToolset.BuildTasks/redirects/wix.targets | 10 + src/WixToolset.BuildTasks/wix.ca.targets | 123 ++ src/WixToolset.BuildTasks/wix.harvest.targets | 511 ++++++++ src/WixToolset.BuildTasks/wix.signing.targets | 378 ++++++ src/WixToolset.BuildTasks/wix.targets | 1356 ++++++++++++++++++++ .../WixToolset.Core.InternalPackage.csproj | 28 + .../WixToolset.Core.InternalPackage.nuspec | 20 + .../WixToolset.Core.InternalPackage.props | 8 + src/WixToolset.MSBuild/WixToolset.MSBuild.csproj | 28 + src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 21 + src/WixToolset.MSBuild/WixToolset.MSBuild.props | 9 + src/dotnet-wix/DotnetToolSettings.xml | 6 + src/dotnet-wix/dotnet-wix.csproj | 28 + src/dotnet-wix/dotnet-wix.nuspec | 24 + .../WixToolsetTest.BuildTasks/FakeBuildEngine.cs | 33 + .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 64 + .../MsiPackage/MsiPackage.wixproj | 57 + .../MsiPackage/Package.de-de.wxl | 11 + .../MsiPackage/Package.en-us.wxl | 11 + .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 21 + .../MsiPackage/PackageComponents.wxs | 10 + .../MsiPackage/data/test.txt | 1 + .../MultiCulturalMsiPackage.sln | 31 + .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 55 + .../SimpleMsiPackage/MsiPackage/Package.en-us.wxl | 11 + .../SimpleMsiPackage/MsiPackage/Package.wxs | 21 + .../MsiPackage/PackageComponents.wxs | 10 + .../SimpleMsiPackage/MsiPackage/data/test.txt | 1 + .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 31 + .../WixToolsetTest.BuildTasks.csproj | 32 + src/wix/Program.cs | 123 ++ src/wix/wix.csproj | 34 + version.json | 11 + 71 files changed, 7975 insertions(+) create mode 100644 Tools.sln create mode 100644 appveyor.cmd create mode 100644 appveyor.yml create mode 100644 nuget.config create mode 100644 src/Directory.Build.props create mode 100644 src/WixToolset.BuildTasks/AssemblyInfo.cs create mode 100644 src/WixToolset.BuildTasks/BuildException.cs create mode 100644 src/WixToolset.BuildTasks/Candle.cs create mode 100644 src/WixToolset.BuildTasks/Common.cs create mode 100644 src/WixToolset.BuildTasks/ConvertReferences.cs create mode 100644 src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs create mode 100644 src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs create mode 100644 src/WixToolset.BuildTasks/DoIt-Compile.cs create mode 100644 src/WixToolset.BuildTasks/DoIt.cs create mode 100644 src/WixToolset.BuildTasks/FileSearchHelperMethods.cs create mode 100644 src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs create mode 100644 src/WixToolset.BuildTasks/GetCabList.cs create mode 100644 src/WixToolset.BuildTasks/GetLooseFileList.cs create mode 100644 src/WixToolset.BuildTasks/GlobalSuppressions.cs create mode 100644 src/WixToolset.BuildTasks/HeatDirectory.cs create mode 100644 src/WixToolset.BuildTasks/HeatFile.cs create mode 100644 src/WixToolset.BuildTasks/HeatProject.cs create mode 100644 src/WixToolset.BuildTasks/HeatTask.cs create mode 100644 src/WixToolset.BuildTasks/Insignia.cs create mode 100644 src/WixToolset.BuildTasks/Light.cs create mode 100644 src/WixToolset.BuildTasks/Lit.cs create mode 100644 src/WixToolset.BuildTasks/Pyro.cs create mode 100644 src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs create mode 100644 src/WixToolset.BuildTasks/RefreshGeneratedFile.cs create mode 100644 src/WixToolset.BuildTasks/ReplaceString.cs create mode 100644 src/WixToolset.BuildTasks/ResolveWixReferences.cs create mode 100644 src/WixToolset.BuildTasks/TaskBase.cs create mode 100644 src/WixToolset.BuildTasks/Torch.cs create mode 100644 src/WixToolset.BuildTasks/WixAssignCulture.cs create mode 100644 src/WixToolset.BuildTasks/WixCommandLineBuilder.cs create mode 100644 src/WixToolset.BuildTasks/WixToolTask.cs create mode 100644 src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj create mode 100644 src/WixToolset.BuildTasks/redirects/wix.ca.targets create mode 100644 src/WixToolset.BuildTasks/redirects/wix.targets create mode 100644 src/WixToolset.BuildTasks/wix.ca.targets create mode 100644 src/WixToolset.BuildTasks/wix.harvest.targets create mode 100644 src/WixToolset.BuildTasks/wix.signing.targets create mode 100644 src/WixToolset.BuildTasks/wix.targets create mode 100644 src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj create mode 100644 src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec create mode 100644 src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props create mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.csproj create mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec create mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.props create mode 100644 src/dotnet-wix/DotnetToolSettings.xml create mode 100644 src/dotnet-wix/dotnet-wix.csproj create mode 100644 src/dotnet-wix/dotnet-wix.nuspec create mode 100644 src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs create mode 100644 src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln create mode 100644 src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj create mode 100644 src/wix/Program.cs create mode 100644 src/wix/wix.csproj create mode 100644 version.json diff --git a/Tools.sln b/Tools.sln new file mode 100644 index 00000000..1c8e1f84 --- /dev/null +++ b/Tools.sln @@ -0,0 +1,49 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.BuildTasks", "src\test\WixToolsetTest.BuildTasks\WixToolsetTest.BuildTasks.csproj", "{4B0098A4-B581-4D04-BA1E-6DC2370A7D43}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wix", "src\wix\wix.csproj", "{DA5CA026-6165-48C4-BDA5-BB4B17D56A18}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.BuildTasks", "src\WixToolset.BuildTasks\WixToolset.BuildTasks.csproj", "{65141CE1-0BDD-41EF-8043-35B96C423CB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-wix", "src\dotnet-wix\dotnet-wix.csproj", "{938BCA04-610B-4B99-9CB7-02BF7397A972}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.MSBuild", "src\WixToolset.MSBuild\WixToolset.MSBuild.csproj", "{0DF5D4CF-8457-469D-8288-13775E984F70}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.Build.0 = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.Build.0 = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.Build.0 = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.Build.0 = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.ActiveCfg = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.Build.0 = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AEB88B8C-8C84-4E97-9886-30CBDD32B34B} + EndGlobalSection +EndGlobal diff --git a/appveyor.cmd b/appveyor.cmd new file mode 100644 index 00000000..25481c45 --- /dev/null +++ b/appveyor.cmd @@ -0,0 +1,21 @@ +@setlocal +@pushd %~dp0 +@set _P=%~dp0build\Release\publish + +@rem Disable this test until publishing of native assets is worked out +@rem dotnet build -c Release src\test\WixToolsetTest.BuildTasks + +dotnet publish -c Release -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix +dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net461\ -f net461 src\WixToolset.BuildTasks +dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks + +@rem dotnet publish -c Release -o %_P%\netcoreapp2.1 -r win-x86 src\wix +@rem dotnet publish -c Release -o %_P%\net461 -r win-x86 src\light +@rem dotnet publish -c Release -o %_P%\net461 -r win-x86 src\WixToolset.BuildTasks + +dotnet pack -c Release src\dotnet-wix +dotnet pack -c Release src\WixToolset.MSBuild +@rem dotnet pack -c Release src\WixToolset.Core.InternalPackage + +@popd +@endlocal diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..49a9f928 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,29 @@ +image: Visual Studio 2017 + +version: 0.0.0.{build} +configuration: Release + +environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + NUGET_XMLDOC_MODE: skip + +build_script: +- appveyor.cmd + +pull_requests: + do_not_increment_build_number: true + +nuget: + disable_publish_on_pr: true + +skip_tags: true + +artifacts: +- path: build\Release\**\*.nupkg + name: nuget + +notifications: +- provider: Slack + incoming_webhook: + secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA= diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..e8a0cc92 --- /dev/null +++ b/nuget.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..7cd6767f --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,22 @@ + + + + + + Debug + $(MSBuildThisFileDirectory)..\build\obj\$(MSBuildProjectName)\ + $(MSBuildThisFileDirectory)..\build\$(Configuration)\ + $(BaseOutputPath) + + WiX Toolset Team + WiX Toolset + Copyright (c) .NET Foundation and contributors. All rights reserved. + WiX Toolset + + + + $(MSBuildThisFileDirectory)..\..\ + + + + diff --git a/src/WixToolset.BuildTasks/AssemblyInfo.cs b/src/WixToolset.BuildTasks/AssemblyInfo.cs new file mode 100644 index 00000000..ae52fce8 --- /dev/null +++ b/src/WixToolset.BuildTasks/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] diff --git a/src/WixToolset.BuildTasks/BuildException.cs b/src/WixToolset.BuildTasks/BuildException.cs new file mode 100644 index 00000000..953134ba --- /dev/null +++ b/src/WixToolset.BuildTasks/BuildException.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Globalization; + + class BuildException : Exception + { + public BuildException() + { + } + + public BuildException(string message) : base(message) + { + } + + public BuildException(string message, Exception innerException) : base(message, innerException) + { + } + + public BuildException(string format, params string[] args) : this(String.Format(CultureInfo.CurrentCulture, format, args)) + { + } + } +} diff --git a/src/WixToolset.BuildTasks/Candle.cs b/src/WixToolset.BuildTasks/Candle.cs new file mode 100644 index 00000000..82b15838 --- /dev/null +++ b/src/WixToolset.BuildTasks/Candle.cs @@ -0,0 +1,199 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Text; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// An MSBuild task to run the WiX compiler. + /// + public sealed class CandleOld : WixToolTask + { + private const string CandleToolName = "candle.exe"; + + private string[] defineConstants; + private ITaskItem[] extensions; + private string[] includeSearchPaths; + private ITaskItem outputFile; + private bool pedantic; + private string installerPlatform; + private string preprocessToFile; + private bool preprocessToStdOut; + private ITaskItem[] sourceFiles; + private string extensionDirectory; + private string[] referencePaths; + + public string[] DefineConstants + { + get { return this.defineConstants; } + set { this.defineConstants = value; } + } + + public ITaskItem[] Extensions + { + get { return this.extensions; } + set { this.extensions = value; } + } + + public string[] IncludeSearchPaths + { + get { return this.includeSearchPaths; } + set { this.includeSearchPaths = value; } + } + + public string InstallerPlatform + { + get { return this.installerPlatform; } + set { this.installerPlatform = value; } + } + + [Output] + [Required] + public ITaskItem OutputFile + { + get { return this.outputFile; } + set { this.outputFile = value; } + } + + public bool Pedantic + { + get { return this.pedantic; } + set { this.pedantic = value; } + } + + public string PreprocessToFile + { + get { return this.preprocessToFile; } + set { this.preprocessToFile = value; } + } + + public bool PreprocessToStdOut + { + get { return this.preprocessToStdOut; } + set { this.preprocessToStdOut = value; } + } + + [Required] + public ITaskItem[] SourceFiles + { + get { return this.sourceFiles; } + set { this.sourceFiles = value; } + } + + public string ExtensionDirectory + { + get { return this.extensionDirectory; } + set { this.extensionDirectory = value; } + } + + public string[] ReferencePaths + { + get { return this.referencePaths; } + set { this.referencePaths = value; } + } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of candle.exe. + /// The name of the executable. + protected override string ToolName + { + get { return CandleToolName; } + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply candle.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return CandleToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), CandleToolName); + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendIfTrue("-p", this.PreprocessToStdOut); + commandLineBuilder.AppendSwitchIfNotNull("-p", this.PreprocessToFile); + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendArrayIfNotNull("-d", this.DefineConstants); + commandLineBuilder.AppendArrayIfNotNull("-I", this.IncludeSearchPaths); + commandLineBuilder.AppendIfTrue("-pedantic", this.Pedantic); + commandLineBuilder.AppendSwitchIfNotNull("-arch ", this.InstallerPlatform); + commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.referencePaths); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + + // Support per-source-file output by looking at the SourceFiles items to + // see if there is any "CandleOutput" metadata. If there is, we do our own + // appending, otherwise we fall back to the built-in "append file names" code. + // Note also that the wix.targets "Compile" target does *not* automagically + // fix the "@(CompileObjOutput)" list to include these new output names. + // If you really want to use this, you're going to have to clone the target + // in your own .targets file and create the output list yourself. + bool usePerSourceOutput = false; + if (this.SourceFiles != null) + { + foreach (ITaskItem item in this.SourceFiles) + { + if (!String.IsNullOrEmpty(item.GetMetadata("CandleOutput"))) + { + usePerSourceOutput = true; + break; + } + } + } + + if (usePerSourceOutput) + { + string[] newSourceNames = new string[this.SourceFiles.Length]; + for (int iSource = 0; iSource < this.SourceFiles.Length; ++iSource) + { + ITaskItem item = this.SourceFiles[iSource]; + if (null == item) + { + newSourceNames[iSource] = null; + } + else + { + string output = item.GetMetadata("CandleOutput"); + + if (!String.IsNullOrEmpty(output)) + { + newSourceNames[iSource] = String.Concat(item.ItemSpec, ";", output); + } + else + { + newSourceNames[iSource] = item.ItemSpec; + } + } + } + + commandLineBuilder.AppendFileNamesIfNotNull(newSourceNames, " "); + } + else + { + commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); + } + } + } +} diff --git a/src/WixToolset.BuildTasks/Common.cs b/src/WixToolset.BuildTasks/Common.cs new file mode 100644 index 00000000..803e9d14 --- /dev/null +++ b/src/WixToolset.BuildTasks/Common.cs @@ -0,0 +1,41 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset +{ + using System; + using System.Globalization; + using System.Text; + using System.Text.RegularExpressions; + + /// + /// Common WixTasks utility methods and types. + /// + internal static class Common + { + /// Metadata key name to turn off harvesting of project references. + public const string DoNotHarvest = "DoNotHarvest"; + + private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); + private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters + + /// + /// Return an identifier based on passed file/directory name + /// + /// File/directory name to generate identifer from + /// A version of the name that is a legal identifier. + /// This is duplicated from WiX's Common class. + internal static string GetIdentifierFromName(string name) + { + string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". + + // MSI identifiers must begin with an alphabetic character or an + // underscore. Prefix all other values with an underscore. + if (AddPrefix.IsMatch(name)) + { + result = String.Concat("_", result); + } + + return result; + } + } +} diff --git a/src/WixToolset.BuildTasks/ConvertReferences.cs b/src/WixToolset.BuildTasks/ConvertReferences.cs new file mode 100644 index 00000000..fe137633 --- /dev/null +++ b/src/WixToolset.BuildTasks/ConvertReferences.cs @@ -0,0 +1,93 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class ConvertReferences : Task + { + private string projectOutputGroups; + private ITaskItem[] projectReferences; + private ITaskItem[] harvestItems; + + /// + /// The total list of cabs in this database + /// + [Output] + public ITaskItem[] HarvestItems + { + get { return this.harvestItems; } + } + + /// + /// The project output groups to harvest. + /// + [Required] + public string ProjectOutputGroups + { + get { return this.projectOutputGroups; } + set { this.projectOutputGroups = value; } + } + + /// + /// All the project references in the project. + /// + [Required] + public ITaskItem[] ProjectReferences + { + get { return this.projectReferences; } + set { this.projectReferences = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + List newItems = new List(); + + foreach(ITaskItem item in this.ProjectReferences) + { + Dictionary newItemMetadeta = new Dictionary(); + + if (!String.IsNullOrEmpty(item.GetMetadata(Common.DoNotHarvest))) + { + continue; + } + + string refTargetDir = item.GetMetadata("RefTargetDir"); + if (!String.IsNullOrEmpty(refTargetDir)) + { + newItemMetadeta.Add("DirectoryIds", refTargetDir); + } + + string refName = item.GetMetadata("Name"); + if (!String.IsNullOrEmpty(refName)) + { + newItemMetadeta.Add("ProjectName", refName); + } + + newItemMetadeta.Add("ProjectOutputGroups", this.ProjectOutputGroups); + + ITaskItem newItem = new TaskItem(item.ItemSpec, newItemMetadeta); + newItems.Add(newItem); + } + + this.harvestItems = newItems.ToArray(); + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs b/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs new file mode 100644 index 00000000..84816cac --- /dev/null +++ b/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs @@ -0,0 +1,60 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class CreateItemAvoidingInference : Task + { + private string inputProperties; + private ITaskItem[] outputItems; + + /// + /// The output items. + /// + [Output] + public ITaskItem[] OuputItems + { + get { return this.outputItems; } + } + + /// + /// The properties to converty to items. + /// + [Required] + public string InputProperties + { + get { return this.inputProperties; } + set { this.inputProperties = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + List newItems = new List(); + + foreach (string property in this.inputProperties.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + { + newItems.Add(new TaskItem(property)); + } + + this.outputItems = newItems.ToArray(); + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs b/src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs new file mode 100644 index 00000000..7cda6b01 --- /dev/null +++ b/src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs @@ -0,0 +1,271 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// An MSBuild task to create a list of preprocessor defines to be passed to candle from the + /// list of referenced projects. + /// + public sealed class CreateProjectReferenceDefineConstants : Task + { + private ITaskItem[] defineConstants; + private ITaskItem[] projectConfigurations; + private ITaskItem[] projectReferencePaths; + + [Output] + public ITaskItem[] DefineConstants + { + get { return this.defineConstants; } + } + + [Required] + public ITaskItem[] ProjectReferencePaths + { + get { return this.projectReferencePaths; } + set { this.projectReferencePaths = value; } + } + + public ITaskItem[] ProjectConfigurations + { + get { return this.projectConfigurations; } + set { this.projectConfigurations = value; } + } + + public override bool Execute() + { + List outputItems = new List(); + Dictionary defineConstants = new Dictionary(); + + for (int i = 0; i < this.ProjectReferencePaths.Length; i++) + { + ITaskItem item = this.ProjectReferencePaths[i]; + + string configuration = item.GetMetadata("Configuration"); + string fullConfiguration = item.GetMetadata("FullConfiguration"); + string platform = item.GetMetadata("Platform"); + + string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); + string projectDir = Path.GetDirectoryName(projectPath) + Path.DirectorySeparatorChar; + string projectExt = Path.GetExtension(projectPath); + string projectFileName = Path.GetFileName(projectPath); + string projectName = Path.GetFileNameWithoutExtension(projectPath); + + string referenceName = CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName); + + string targetPath = item.GetMetadata("FullPath"); + string targetDir = Path.GetDirectoryName(targetPath) + Path.DirectorySeparatorChar; + string targetExt = Path.GetExtension(targetPath); + string targetFileName = Path.GetFileName(targetPath); + string targetName = Path.GetFileNameWithoutExtension(targetPath); + + // If there is no configuration metadata on the project reference task item, + // check for any additional configuration data provided in the optional task property. + if (String.IsNullOrEmpty(fullConfiguration)) + { + fullConfiguration = this.FindProjectConfiguration(projectName); + if (!String.IsNullOrEmpty(fullConfiguration)) + { + string[] typeAndPlatform = fullConfiguration.Split('|'); + configuration = typeAndPlatform[0]; + platform = (typeAndPlatform.Length > 1 ? typeAndPlatform[1] : String.Empty); + } + } + + // write out the platform/configuration defines + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.Configuration", referenceName)] = configuration; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.FullConfiguration", referenceName)] = fullConfiguration; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.Platform", referenceName)] = platform; + + // write out the ProjectX defines + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectDir", referenceName)] = projectDir; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectExt", referenceName)] = projectExt; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectFileName", referenceName)] = projectFileName; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectName", referenceName)] = projectName; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectPath", referenceName)] = projectPath; + + // write out the TargetX defines + string targetDirDefine = String.Format(CultureInfo.InvariantCulture, "{0}.TargetDir", referenceName); + if (defineConstants.ContainsKey(targetDirDefine)) + { + //if target dir was already defined, redefine it as the common root shared by multiple references from the same project + string commonDir = FindCommonRoot(targetDir, defineConstants[targetDirDefine]); + if (!String.IsNullOrEmpty(commonDir)) + { + targetDir = commonDir; + } + } + defineConstants[targetDirDefine] = CreateProjectReferenceDefineConstants.EnsureEndsWithBackslash(targetDir); + + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetExt", referenceName)] = targetExt; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetFileName", referenceName)] = targetFileName; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetName", referenceName)] = targetName; + + //if target path was already defined, append to it creating a list of multiple references from the same project + string targetPathDefine = String.Format(CultureInfo.InvariantCulture, "{0}.TargetPath", referenceName); + if (defineConstants.ContainsKey(targetPathDefine)) + { + string oldTargetPath = defineConstants[targetPathDefine]; + if (!targetPath.Equals(oldTargetPath, StringComparison.OrdinalIgnoreCase)) + { + defineConstants[targetPathDefine] += ";" + targetPath; + } + + //If there was only one targetpath we need to create its culture specific define + if (!oldTargetPath.Contains(";")) + { + string oldSubFolder = FindSubfolder(oldTargetPath, targetDir, targetFileName); + if (!String.IsNullOrEmpty(oldSubFolder)) + { + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.{1}.TargetPath", referenceName, oldSubFolder.Replace('\\', '_'))] = oldTargetPath; + } + } + + // Create a culture specific define + string subFolder = FindSubfolder(targetPath, targetDir, targetFileName); + if (!String.IsNullOrEmpty(subFolder)) + { + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.{1}.TargetPath", referenceName, subFolder.Replace('\\', '_'))] = targetPath; + } + + } + else + { + defineConstants[targetPathDefine] = targetPath; + } + } + + foreach (KeyValuePair define in defineConstants) + { + outputItems.Add(new TaskItem(String.Format(CultureInfo.InvariantCulture, "{0}={1}", define.Key, define.Value))); + } + + this.defineConstants = outputItems.ToArray(); + + return true; + } + + public static string GetProjectPath(ITaskItem[] projectReferencePaths, int i) + { + return projectReferencePaths[i].GetMetadata("MSBuildSourceProjectFile"); + } + + public static string GetReferenceName(ITaskItem item, string projectName) + { + string referenceName = item.GetMetadata("Name"); + if (String.IsNullOrEmpty(referenceName)) + { + referenceName = projectName; + } + + // We cannot have an equals sign in the variable name because it + // messes with the preprocessor definitions on the command line. + referenceName = referenceName.Replace('=', '_'); + + // We cannot have a double quote on the command line because it + // there is no way to escape it on the command line. + referenceName = referenceName.Replace('\"', '_'); + + // We cannot have parens in the variable name because the WiX + // preprocessor will not be able to parse it. + referenceName = referenceName.Replace('(', '_'); + referenceName = referenceName.Replace(')', '_'); + + return referenceName; + } + + /// + /// Look through the configuration data in the ProjectConfigurations property + /// to find the configuration for a project, if available. + /// + /// Name of the project that is being searched for. + /// Full configuration spec, for example "Release|Win32". + private string FindProjectConfiguration(string projectName) + { + string configuration = String.Empty; + + if (this.ProjectConfigurations != null) + { + foreach (ITaskItem configItem in this.ProjectConfigurations) + { + string configProject = configItem.ItemSpec; + if (configProject.Length > projectName.Length && + configProject.StartsWith(projectName) && + configProject[projectName.Length] == '=') + { + configuration = configProject.Substring(projectName.Length + 1); + break; + } + } + } + + return configuration; + } + + /// + /// Finds the common root between two paths + /// + /// + /// + /// common root on success, empty string on failure + private static string FindCommonRoot(string path1, string path2) + { + path1 = path1.TrimEnd(Path.DirectorySeparatorChar); + path2 = path2.TrimEnd(Path.DirectorySeparatorChar); + + while (!String.IsNullOrEmpty(path1)) + { + for (string searchPath = path2; !String.IsNullOrEmpty(searchPath); searchPath = Path.GetDirectoryName(searchPath)) + { + if (path1.Equals(searchPath, StringComparison.OrdinalIgnoreCase)) + { + return searchPath; + } + } + + path1 = Path.GetDirectoryName(path1); + } + + return path1; + } + + /// + /// Finds the subfolder of a path, excluding a root and filename. + /// + /// Path to examine + /// Root that must be present + /// + /// + private static string FindSubfolder(string path, string rootPath, string fileName) + { + if (Path.GetFileName(path).Equals(fileName, StringComparison.OrdinalIgnoreCase)) + { + path = Path.GetDirectoryName(path); + } + + if (path.StartsWith(rootPath, StringComparison.OrdinalIgnoreCase)) + { + // cut out the root and return the subpath + return path.Substring(rootPath.Length).Trim(Path.DirectorySeparatorChar); + } + + return String.Empty; + } + + private static string EnsureEndsWithBackslash(string dir) + { + if (dir[dir.Length - 1] != Path.DirectorySeparatorChar) + { + dir += Path.DirectorySeparatorChar; + } + + return dir; + } + } +} diff --git a/src/WixToolset.BuildTasks/DoIt-Compile.cs b/src/WixToolset.BuildTasks/DoIt-Compile.cs new file mode 100644 index 00000000..f89078fe --- /dev/null +++ b/src/WixToolset.BuildTasks/DoIt-Compile.cs @@ -0,0 +1,192 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#if false +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.IO; + using Microsoft.Build.Framework; + using WixToolset.Data; + + /// + /// An MSBuild task to run the WiX compiler. + /// + public sealed class Candle : TaskBase + { + public string[] DefineConstants { get; set; } + + public ITaskItem[] Extensions { get; set; } + + public string[] IncludeSearchPaths { get; set; } + + public string InstallerPlatform { get; set; } + + [Output] + [Required] + public ITaskItem OutputFile { get; set; } + + public bool Pedantic { get; set; } + + public string PreprocessToFile { get; set; } + + public bool PreprocessToStdOut { get; set; } + + [Required] + public ITaskItem IntermediateDirectory { get; set; } + + [Required] + public ITaskItem[] SourceFiles { get; set; } + + public string ExtensionDirectory { get; set; } + + public string[] ReferencePaths { get; set; } + + protected override void ExecuteCore() + { + Messaging.Instance.InitializeAppName("WIX", "wix.exe"); + + Messaging.Instance.Display += this.DisplayMessage; + + var preprocessor = new Preprocessor(); + + var compiler = new Compiler(); + + var sourceFiles = this.GatherSourceFiles(); + + var preprocessorVariables = this.GatherPreprocessorVariables(); + + foreach (var sourceFile in sourceFiles) + { + var document = preprocessor.Process(sourceFile.SourcePath, preprocessorVariables); + + var intermediate = compiler.Compile(document); + + intermediate.Save(sourceFile.OutputPath); + } + } + + private void DisplayMessage(object sender, DisplayEventArgs e) + { + this.Log.LogMessageFromText(e.Message, MessageImportance.Normal); + } + + private IEnumerable GatherSourceFiles() + { + var files = new List(); + + foreach (var item in this.SourceFiles) + { + var sourcePath = item.ItemSpec; + var outputPath = item.GetMetadata("CandleOutput") ?? this.OutputFile?.ItemSpec; + + if (String.IsNullOrEmpty(outputPath)) + { + outputPath = Path.Combine(this.IntermediateDirectory.ItemSpec, Path.GetFileNameWithoutExtension(sourcePath) + ".wir"); + } + + files.Add(new SourceFile(sourcePath, outputPath)); + } + + return files; + } + + private IDictionary GatherPreprocessorVariables() + { + var variables = new Dictionary(); + + foreach (var pair in this.DefineConstants) + { + string[] value = pair.Split(new[] { '=' }, 2); + + if (variables.ContainsKey(value[0])) + { + //Messaging.Instance.OnMessage(WixErrors.DuplicateVariableDefinition(value[0], (1 == value.Length) ? String.Empty : value[1], this.PreprocessorVariables[value[0]])); + break; + } + + if (1 == value.Length) + { + variables.Add(value[0], String.Empty); + } + else + { + variables.Add(value[0], value[1]); + } + } + + return variables; + } + + ///// + ///// Builds a command line from options in this task. + ///// + //protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + //{ + // base.BuildCommandLine(commandLineBuilder); + + // commandLineBuilder.AppendIfTrue("-p", this.PreprocessToStdOut); + // commandLineBuilder.AppendSwitchIfNotNull("-p", this.PreprocessToFile); + // commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + // commandLineBuilder.AppendArrayIfNotNull("-d", this.DefineConstants); + // commandLineBuilder.AppendArrayIfNotNull("-I", this.IncludeSearchPaths); + // commandLineBuilder.AppendIfTrue("-pedantic", this.Pedantic); + // commandLineBuilder.AppendSwitchIfNotNull("-arch ", this.InstallerPlatform); + // commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.referencePaths); + // commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + + // // Support per-source-file output by looking at the SourceFiles items to + // // see if there is any "CandleOutput" metadata. If there is, we do our own + // // appending, otherwise we fall back to the built-in "append file names" code. + // // Note also that the wix.targets "Compile" target does *not* automagically + // // fix the "@(CompileObjOutput)" list to include these new output names. + // // If you really want to use this, you're going to have to clone the target + // // in your own .targets file and create the output list yourself. + // bool usePerSourceOutput = false; + // if (this.SourceFiles != null) + // { + // foreach (ITaskItem item in this.SourceFiles) + // { + // if (!String.IsNullOrEmpty(item.GetMetadata("CandleOutput"))) + // { + // usePerSourceOutput = true; + // break; + // } + // } + // } + + // if (usePerSourceOutput) + // { + // string[] newSourceNames = new string[this.SourceFiles.Length]; + // for (int iSource = 0; iSource < this.SourceFiles.Length; ++iSource) + // { + // ITaskItem item = this.SourceFiles[iSource]; + // if (null == item) + // { + // newSourceNames[iSource] = null; + // } + // else + // { + // string output = item.GetMetadata("CandleOutput"); + + // if (!String.IsNullOrEmpty(output)) + // { + // newSourceNames[iSource] = String.Concat(item.ItemSpec, ";", output); + // } + // else + // { + // newSourceNames[iSource] = item.ItemSpec; + // } + // } + // } + + // commandLineBuilder.AppendFileNamesIfNotNull(newSourceNames, " "); + // } + // else + // { + // commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); + // } + //} + } +} +#endif diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs new file mode 100644 index 00000000..02b33522 --- /dev/null +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -0,0 +1,342 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Runtime.InteropServices; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Core; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + /// + /// An MSBuild task to run the WiX compiler. + /// + public sealed class DoIt : Task + { + public string AdditionalOptions { get; set; } + + public string[] Cultures { get; set; } + + public string[] DefineConstants { get; set; } + + public ITaskItem[] Extensions { get; set; } + + public string ExtensionDirectory { get; set; } + + public string[] IncludeSearchPaths { get; set; } + + public string InstallerPlatform { get; set; } + + [Required] + public ITaskItem IntermediateDirectory { get; set; } + + public ITaskItem[] LocalizationFiles { get; set; } + + public bool NoLogo { get; set; } + + public ITaskItem[] LibraryFiles { get; set; } + + [Output] + [Required] + public ITaskItem OutputFile { get; set; } + + public string OutputType { get; set; } + + public string PdbOutputFile { get; set; } + + public bool Pedantic { get; set; } + + [Required] + public ITaskItem[] SourceFiles { get; set; } + + public string[] ReferencePaths { get; set; } + + + /// + /// Gets or sets whether all warnings should be suppressed. + /// + public bool SuppressAllWarnings { get; set; } + + /// + /// Gets or sets a list of specific warnings to be suppressed. + /// + public string[] SuppressSpecificWarnings { get; set; } + + /// + /// Gets or sets whether all warnings should be treated as errors. + /// + public bool TreatWarningsAsErrors { get; set; } + + /// + /// Gets or sets a list of specific warnings to treat as errors. + /// + public string[] TreatSpecificWarningsAsErrors { get; set; } + + /// + /// Gets or sets whether to display verbose output. + /// + public bool VerboseOutput { get; set; } + + + public ITaskItem[] BindInputPaths { get; set; } + + public bool BindFiles { get; set; } + + public ITaskItem BindContentsFile { get; set; } + + public ITaskItem BindOutputsFile { get; set; } + + public ITaskItem BindBuiltOutputsFile { get; set; } + + public string CabinetCachePath { get; set; } + public int CabinetCreationThreadCount { get; set; } + public string DefaultCompressionLevel { get; set; } + + [Output] + public ITaskItem UnreferencedSymbolsFile { get; set; } + + public ITaskItem WixProjectFile { get; set; } + public string[] WixVariables { get; set; } + + public bool SuppressValidation { get; set; } + public string[] SuppressIces { get; set; } + public string AdditionalCub { get; set; } + + public override bool Execute() + { + try + { + this.ExecuteCore(); + } + catch (Exception e) + { + this.Log.LogErrorFromException(e); + + if (e is NullReferenceException || e is SEHException) + { + throw; + } + } + + return !this.Log.HasLoggedErrors; + } + + private void ExecuteCore() + { + var listener = new MsbuildMessageListener(this.Log, "WIX", this.BuildEngine.ProjectFileOfTaskNode); + + var commandLineBuilder = new WixCommandLineBuilder(); + + commandLineBuilder.AppendTextUnquoted("build"); + + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); + commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); + commandLineBuilder.AppendArrayIfNotNull("-culture ", this.Cultures); + commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); + commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); + commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); + commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); + commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); + commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); + commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); + commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); + commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile); + commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile); + commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile); + + commandLineBuilder.AppendIfTrue("-bindFiles", this.BindFiles); + commandLineBuilder.AppendArrayIfNotNull("-bindPath ", this.CalculateBindPathStrings()); + commandLineBuilder.AppendArrayIfNotNull("-loc ", this.LocalizationFiles); + commandLineBuilder.AppendArrayIfNotNull("-lib ", this.LibraryFiles); + commandLineBuilder.AppendTextIfNotWhitespace(this.AdditionalOptions); + commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); + + var commandLineString = commandLineBuilder.ToString(); + + this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); + + var serviceProvider = new WixToolsetServiceProvider(); + + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var arguments = serviceProvider.GetService(); + arguments.Populate(commandLineString); + + var context = serviceProvider.GetService(); + context.Messaging = messaging; + context.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); + context.Arguments = arguments; + + var commandLine = serviceProvider.GetService(); + var command = commandLine.ParseStandardCommandLine(context); + command?.Execute(); + } + + private IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, string[] extensions) + { + var extensionManager = serviceProvider.GetService(); + + foreach (var type in new[] { typeof(WixToolset.Core.Burn.WixToolsetStandardBackend), typeof(WixToolset.Core.WindowsInstaller.WixToolsetStandardBackend) }) + { + extensionManager.Add(type.Assembly); + } + + foreach (var extension in extensions) + { + extensionManager.Load(extension); + } + + return extensionManager; + } + + private void DisplayMessage(object sender, DisplayEventArgs e) + { + this.Log.LogMessageFromText(e.Message, MessageImportance.Normal); + } + + private IEnumerable CalculateBindPathStrings() + { + if (null != this.BindInputPaths) + { + foreach (var item in this.BindInputPaths) + { + var path = item.GetMetadata("FullPath"); + + var bindName = item.GetMetadata("BindName"); + if (!String.IsNullOrEmpty(bindName)) + { + yield return String.Concat(bindName, "=", path); + } + else + { + yield return path; + } + } + } + } + + ///// + ///// Builds a command line from options in this task. + ///// + //protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + //{ + // base.BuildCommandLine(commandLineBuilder); + + // commandLineBuilder.AppendIfTrue("-p", this.PreprocessToStdOut); + // commandLineBuilder.AppendSwitchIfNotNull("-p", this.PreprocessToFile); + // commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + // commandLineBuilder.AppendArrayIfNotNull("-d", this.DefineConstants); + // commandLineBuilder.AppendArrayIfNotNull("-I", this.IncludeSearchPaths); + // commandLineBuilder.AppendIfTrue("-pedantic", this.Pedantic); + // commandLineBuilder.AppendSwitchIfNotNull("-arch ", this.InstallerPlatform); + // commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.referencePaths); + // commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + + // // Support per-source-file output by looking at the SourceFiles items to + // // see if there is any "CandleOutput" metadata. If there is, we do our own + // // appending, otherwise we fall back to the built-in "append file names" code. + // // Note also that the wix.targets "Compile" target does *not* automagically + // // fix the "@(CompileObjOutput)" list to include these new output names. + // // If you really want to use this, you're going to have to clone the target + // // in your own .targets file and create the output list yourself. + // bool usePerSourceOutput = false; + // if (this.SourceFiles != null) + // { + // foreach (ITaskItem item in this.SourceFiles) + // { + // if (!String.IsNullOrEmpty(item.GetMetadata("CandleOutput"))) + // { + // usePerSourceOutput = true; + // break; + // } + // } + // } + + // if (usePerSourceOutput) + // { + // string[] newSourceNames = new string[this.SourceFiles.Length]; + // for (int iSource = 0; iSource < this.SourceFiles.Length; ++iSource) + // { + // ITaskItem item = this.SourceFiles[iSource]; + // if (null == item) + // { + // newSourceNames[iSource] = null; + // } + // else + // { + // string output = item.GetMetadata("CandleOutput"); + + // if (!String.IsNullOrEmpty(output)) + // { + // newSourceNames[iSource] = String.Concat(item.ItemSpec, ";", output); + // } + // else + // { + // newSourceNames[iSource] = item.ItemSpec; + // } + // } + // } + + // commandLineBuilder.AppendFileNamesIfNotNull(newSourceNames, " "); + // } + // else + // { + // commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); + // } + //} + + private class MsbuildMessageListener : IMessageListener + { + public MsbuildMessageListener(TaskLoggingHelper logger, string shortName, string longName) + { + this.Logger = logger; + this.ShortAppName = shortName; + this.LongAppName = longName; + } + + public string ShortAppName { get; } + + public string LongAppName { get; } + + private TaskLoggingHelper Logger { get; } + + public void Write(Message message) + { + switch (message.Level) + { + case MessageLevel.Error: + this.Logger.LogError(null, this.ShortAppName + message.Id.ToString(), null, message.SourceLineNumbers?.FileName ?? this.LongAppName, message.SourceLineNumbers?.LineNumber ?? 0, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); + break; + + case MessageLevel.Warning: + this.Logger.LogWarning(null, this.ShortAppName + message.Id.ToString(), null, message.SourceLineNumbers?.FileName ?? this.LongAppName, message.SourceLineNumbers?.LineNumber ?? 0, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); + break; + + default: + // TODO: Revisit this because something is going horribly awry. The commented out LogMessage call is crashing saying that the "message" parameter is null. When you look at the call stack, the code + // is in the wrong LogMessage override and the "null" subcategory was passed in as the message. Not clear why it is picking the wrong overload. + //if (message.Id > 0) + //{ + // this.Logger.LogMessage(null, code, null, message.SourceLineNumber?.FileName, message.SourceLineNumber?.LineNumber ?? 0, 0, 0, 0, MessageImportance.Normal, message.Format, message.FormatData); + //} + //else + //{ + this.Logger.LogMessage(MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs); + //} + break; + } + } + + public void Write(string message) + { + this.Logger.LogMessage(MessageImportance.Low, message); + } + } + } +} diff --git a/src/WixToolset.BuildTasks/FileSearchHelperMethods.cs b/src/WixToolset.BuildTasks/FileSearchHelperMethods.cs new file mode 100644 index 00000000..6cc804eb --- /dev/null +++ b/src/WixToolset.BuildTasks/FileSearchHelperMethods.cs @@ -0,0 +1,60 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; + using System.IO; + using System.Text; + using Microsoft.Build.Framework; + + /// + /// Contains helper methods on searching for files + /// + public static class FileSearchHelperMethods + { + /// + /// Searches for the existence of a file in multiple directories. + /// Search is satisfied if default file path is valid and exists. If not, + /// file name is extracted from default path and combined with each of the directories + /// looking to see if it exists. If not found, input default path is returned. + /// + /// Array of directories to look in, without filenames in them + /// Default path - to use if not found + /// File path if file found. Empty string if not found + public static string SearchFilePaths(string[] directories, string defaultFullPath) + { + if (String.IsNullOrEmpty(defaultFullPath)) + { + return String.Empty; + } + + if (File.Exists(defaultFullPath)) + { + return defaultFullPath; + } + + if (directories == null) + { + return string.Empty; + } + + string fileName = Path.GetFileName(defaultFullPath); + foreach (string currentPath in directories) + { + if (String.IsNullOrEmpty(currentPath) || String.IsNullOrEmpty(currentPath.Trim())) + { + continue; + } + + if (File.Exists(Path.Combine(currentPath, fileName))) + { + return Path.Combine(currentPath, fileName); + } + } + + return String.Empty; + } + } +} diff --git a/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs b/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs new file mode 100644 index 00000000..06c8b98a --- /dev/null +++ b/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs @@ -0,0 +1,146 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.IO; + using System.Security.Cryptography; + using System.Text; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task generates metadata on the for compile output objects. + /// + public class GenerateCompileWithObjectPath : Task + { + /// + /// The list of files to generate outputs for. + /// + [Required] + public ITaskItem[] Compile + { + get; + set; + } + + /// + /// The list of files with ObjectPath metadata. + /// + [Output] + public ITaskItem[] CompileWithObjectPath + { + get; + private set; + } + + /// + /// The folder under which all ObjectPaths should reside. + /// + [Required] + public string IntermediateOutputPath + { + get; + set; + } + + /// + /// Generate an identifier by hashing data from the row. + /// + /// Three letter or less prefix for generated row identifier. + /// Information to hash. + /// The generated identifier. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + public static string GenerateIdentifier(string prefix, params string[] args) + { + string stringData = String.Join("|", args); + byte[] data = Encoding.Unicode.GetBytes(stringData); + + // hash the data + byte[] hash; + + using (MD5 md5 = new MD5CryptoServiceProvider()) + { + hash = md5.ComputeHash(data); + } + + // build up the identifier + StringBuilder identifier = new StringBuilder(35, 35); + identifier.Append(prefix); + + // hard coded to 16 as that is the most bytes that can be used to meet the length requirements. SHA1 is 20 bytes. + for (int i = 0; i < 16; i++) + { + identifier.Append(hash[i].ToString("X2", CultureInfo.InvariantCulture.NumberFormat)); + } + + return identifier.ToString(); + } + + /// + /// Gets the full path of the directory in which the file is found. + /// + /// The file from which to extract the directory. + /// The generated identifier. + private static string GetDirectory(ITaskItem file) + { + return file.GetMetadata("RootDir") + file.GetMetadata("Directory"); + } + + /// + /// Sets the object path to use for the file. + /// + /// The file on which to set the ObjectPath metadata. + /// + /// For the same input path it will return the same ObjectPath. Case is not ignored, however that isn't a problem. + /// + private void SetObjectPath(ITaskItem file) + { + // If the source file is in the project directory or in the intermediate directory, use the intermediate directory. + if (string.IsNullOrEmpty(file.GetMetadata("RelativeDir")) || string.Compare(file.GetMetadata("RelativeDir"), this.IntermediateOutputPath, StringComparison.OrdinalIgnoreCase) == 0) + { + file.SetMetadata("ObjectPath", this.IntermediateOutputPath); + } + // Otherwise use a subdirectory of the intermediate directory. The subfolder's name is based on the full path of the folder containing the source file. + else + { + file.SetMetadata("ObjectPath", Path.Combine(this.IntermediateOutputPath, GenerateIdentifier("pth", GetDirectory(file))) + Path.DirectorySeparatorChar); + } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + if (string.IsNullOrEmpty(this.IntermediateOutputPath)) + { + this.Log.LogError("IntermediateOutputPath parameter is required and cannot be empty"); + return false; + } + + if (this.Compile == null || this.Compile.Length == 0) + { + return true; + } + + this.CompileWithObjectPath = new ITaskItem[this.Compile.Length]; + for (int i = 0; i < this.Compile.Length; ++i) + { + this.CompileWithObjectPath[i] = new TaskItem(this.Compile[i].ItemSpec, this.Compile[i].CloneCustomMetadata()); + + // Do not overwrite the ObjectPath metadata if it already was set. + if (string.IsNullOrEmpty(this.CompileWithObjectPath[i].GetMetadata("ObjectPath"))) + { + SetObjectPath(this.CompileWithObjectPath[i]); + } + } + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/GetCabList.cs b/src/WixToolset.BuildTasks/GetCabList.cs new file mode 100644 index 00000000..e97538af --- /dev/null +++ b/src/WixToolset.BuildTasks/GetCabList.cs @@ -0,0 +1,87 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Diagnostics; + using System.IO; + using System.Reflection; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Dtf.WindowsInstaller; + using Microsoft.Win32; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class GetCabList : Task + { + private ITaskItem database; + private ITaskItem[] cabList; + + /// + /// The list of database files to find cabs in + /// + [Required] + public ITaskItem Database + { + get { return this.database; } + set { this.database = value; } + } + + /// + /// The total list of cabs in this database + /// + [Output] + public ITaskItem[] CabList + { + get { return this.cabList; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + string databaseFile = this.database.ItemSpec; + Object []args = { }; + System.Collections.Generic.List cabNames = new System.Collections.Generic.List(); + + // If the file doesn't exist, no cabs to return, so exit now + if (!File.Exists(databaseFile)) + { + return true; + } + + using (Database database = new Database(databaseFile)) + { + // If the media table doesn't exist, no cabs to return, so exit now + if (null == database.Tables["Media"]) + { + return true; + } + + System.Collections.IList records = database.ExecuteQuery("SELECT `Cabinet` FROM `Media`", args); + + foreach (string cabName in records) + { + if (String.IsNullOrEmpty(cabName) || cabName.StartsWith("#", StringComparison.Ordinal)) + { + continue; + } + + cabNames.Add(new TaskItem(Path.Combine(Path.GetDirectoryName(databaseFile), cabName))); + } + } + + this.cabList = cabNames.ToArray(); + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/GetLooseFileList.cs b/src/WixToolset.BuildTasks/GetLooseFileList.cs new file mode 100644 index 00000000..bd403426 --- /dev/null +++ b/src/WixToolset.BuildTasks/GetLooseFileList.cs @@ -0,0 +1,230 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Diagnostics; + using System.IO; + using System.Reflection; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Dtf.WindowsInstaller; + using Microsoft.Win32; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class GetLooseFileList : Task + { + private ITaskItem database; + private ITaskItem[] looseFileList; + + internal const int MsidbFileAttributesNoncompressed = 8192; + internal const int MsidbFileAttributesCompressed = 16384; + + /// + /// The list of database files to find Loose Files in + /// + [Required] + public ITaskItem Database + { + get { return this.database; } + set { this.database = value; } + } + + /// + /// The total list of Loose Files in this database + /// + [Output] + public ITaskItem[] LooseFileList + { + get { return this.looseFileList; } + } + + /// + /// Takes the "defaultDir" column + /// + /// Returns the corresponding sourceDir. + public string SourceDirFromDefaultDir(string defaultDir) + { + string sourceDir; + + string[] splitted = defaultDir.Split(':'); + + if (1 == splitted.Length) + { + sourceDir = splitted[0]; + } + else + { + sourceDir = splitted[1]; + } + + splitted = sourceDir.Split('|'); + + if (1 == splitted.Length) + { + sourceDir = splitted[0]; + } + else + { + sourceDir = splitted[1]; + } + + return sourceDir; + } + + /// + /// Takes the "FileName" column + /// + /// Returns the corresponding source file name. + public string SourceFileFromFileName(string fileName) + { + string sourceFile; + + string[] splitted = fileName.Split('|'); + + if (1 == splitted.Length) + { + sourceFile = splitted[0]; + } + else + { + sourceFile = splitted[1]; + } + + return sourceFile; + } + + /// + /// Gets a complete list of external Loose Files referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + string databaseFile = this.database.ItemSpec; + Object []emptyArgs = { }; + System.Collections.Generic.List looseFileNames = new System.Collections.Generic.List(); + Dictionary ComponentFullDirectory = new Dictionary(); + Dictionary DirectoryIdDefaultDir = new Dictionary(); + Dictionary DirectoryIdParent = new Dictionary(); + Dictionary DirectoryIdFullSource = new Dictionary(); + int i; + string databaseDir = Path.GetDirectoryName(databaseFile); + + // If the file doesn't exist, no Loose Files to return, so exit now + if (!File.Exists(databaseFile)) + { + return true; + } + + using (Database database = new Database(databaseFile)) + { + bool compressed = false; + if (2 == (database.SummaryInfo.WordCount & 2)) + { + compressed = true; + } + + // If the media table doesn't exist, no Loose Files to return, so exit now + if (null == database.Tables["File"]) + { + return true; + } + + // Only setup all these helpful indexes if the database is marked as uncompressed. If it's marked as compressed, files are stored at the root, + // so none of these indexes will be used + if (!compressed) + { + if (null == database.Tables["Directory"] || null == database.Tables["Component"]) + { + return true; + } + + System.Collections.IList directoryRecords = database.ExecuteQuery("SELECT `Directory`,`Directory_Parent`,`DefaultDir` FROM `Directory`", emptyArgs); + + // First setup a simple index from DirectoryId to DefaultDir + for (i = 0; i < directoryRecords.Count; i += 3) + { + string directoryId = (string)(directoryRecords[i]); + string directoryParent = (string)(directoryRecords[i + 1]); + string defaultDir = (string)(directoryRecords[i + 2]); + + string sourceDir = SourceDirFromDefaultDir(defaultDir); + + DirectoryIdDefaultDir[directoryId] = sourceDir; + DirectoryIdParent[directoryId] = directoryParent; + } + + // Setup an index from directory Id to the full source path + for (i = 0; i < directoryRecords.Count; i += 3) + { + string directoryId = (string)(directoryRecords[i]); + string directoryParent = (string)(directoryRecords[i + 1]); + string defaultDir = (string)(directoryRecords[i + 2]); + + string sourceDir = DirectoryIdDefaultDir[directoryId]; + + // The TARGETDIR case + if (String.IsNullOrEmpty(directoryParent)) + { + DirectoryIdFullSource[directoryId] = databaseDir; + } + else + { + string tempDirectoryParent = directoryParent; + + while (!String.IsNullOrEmpty(tempDirectoryParent) && !String.IsNullOrEmpty(DirectoryIdParent[tempDirectoryParent])) + { + sourceDir = Path.Combine(DirectoryIdDefaultDir[tempDirectoryParent], sourceDir); + + tempDirectoryParent = DirectoryIdParent[tempDirectoryParent]; + } + + DirectoryIdFullSource[directoryId] = Path.Combine(databaseDir, sourceDir); + } + } + + // Setup an index from component Id to full directory path + System.Collections.IList componentRecords = database.ExecuteQuery("SELECT `Component`,`Directory_` FROM `Component`", emptyArgs); + + for (i = 0; i < componentRecords.Count; i += 2) + { + string componentId = (string)(componentRecords[i]); + string componentDir = (string)(componentRecords[i + 1]); + + ComponentFullDirectory[componentId] = DirectoryIdFullSource[componentDir]; + } + } + + System.Collections.IList fileRecords = database.ExecuteQuery("SELECT `Component_`,`FileName`,`Attributes` FROM `File`", emptyArgs); + + for (i = 0; i < fileRecords.Count; i += 3) + { + string componentId = (string)(fileRecords[i]); + string fileName = SourceFileFromFileName((string)(fileRecords[i + 1])); + int attributes = (int)(fileRecords[i + 2]); + + // If the whole database is marked uncompressed, use the directory layout made above + if ((!compressed && MsidbFileAttributesCompressed != (attributes & MsidbFileAttributesCompressed))) + { + looseFileNames.Add(new TaskItem(Path.GetFullPath(Path.Combine(ComponentFullDirectory[componentId], fileName)))); + } + // If the database is marked as compressed, put files at the root + else if (compressed && (MsidbFileAttributesNoncompressed == (attributes & MsidbFileAttributesNoncompressed))) + { + looseFileNames.Add(new TaskItem(Path.GetFullPath(Path.Combine(databaseDir, fileName)))); + } + } + } + + this.looseFileList = looseFileNames.ToArray(); + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/GlobalSuppressions.cs b/src/WixToolset.BuildTasks/GlobalSuppressions.cs new file mode 100644 index 00000000..65c34c13 --- /dev/null +++ b/src/WixToolset.BuildTasks/GlobalSuppressions.cs @@ -0,0 +1,8 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "WixToolset")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Msi", Scope = "namespace", Target = "WixToolset.BuildTasks")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "wix")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Wix")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "wix")] diff --git a/src/WixToolset.BuildTasks/HeatDirectory.cs b/src/WixToolset.BuildTasks/HeatDirectory.cs new file mode 100644 index 00000000..1d5f104a --- /dev/null +++ b/src/WixToolset.BuildTasks/HeatDirectory.cs @@ -0,0 +1,103 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Framework; + + public sealed class HeatDirectory : HeatTask + { + private string directory; + private bool keepEmptyDirectories; + private bool suppressCom; + private bool suppressRootDirectory; + private bool suppressRegistry; + private string template; + private string componentGroupName; + private string directoryRefId; + private string preprocessorVariable; + + public string ComponentGroupName + { + get { return this.componentGroupName; } + set { this.componentGroupName = value; } + } + + [Required] + public string Directory + { + get { return this.directory; } + set { this.directory = value; } + } + + public string DirectoryRefId + { + get { return this.directoryRefId; } + set { this.directoryRefId = value; } + } + + public bool KeepEmptyDirectories + { + get { return this.keepEmptyDirectories; } + set { this.keepEmptyDirectories = value; } + } + + public string PreprocessorVariable + { + get { return this.preprocessorVariable; } + set { this.preprocessorVariable = value; } + } + + public bool SuppressCom + { + get { return this.suppressCom; } + set { this.suppressCom = value; } + } + + public bool SuppressRootDirectory + { + get { return this.suppressRootDirectory; } + set { this.suppressRootDirectory = value; } + } + + public bool SuppressRegistry + { + get { return this.suppressRegistry; } + set { this.suppressRegistry = value; } + } + + public string Template + { + get { return this.template; } + set { this.template = value; } + } + + protected override string OperationName + { + get { return "dir"; } + } + + /// + /// Generate the command line arguments to write to the response file from the properties. + /// + /// Command line string. + protected override string GenerateResponseFileCommands() + { + WixCommandLineBuilder commandLineBuilder = new WixCommandLineBuilder(); + + commandLineBuilder.AppendSwitch(this.OperationName); + commandLineBuilder.AppendFileNameIfNotNull(this.Directory); + + commandLineBuilder.AppendSwitchIfNotNull("-cg ", this.ComponentGroupName); + commandLineBuilder.AppendSwitchIfNotNull("-dr ", this.DirectoryRefId); + commandLineBuilder.AppendIfTrue("-ke", this.KeepEmptyDirectories); + commandLineBuilder.AppendIfTrue("-scom", this.SuppressCom); + commandLineBuilder.AppendIfTrue("-sreg", this.SuppressRegistry); + commandLineBuilder.AppendIfTrue("-srd", this.SuppressRootDirectory); + commandLineBuilder.AppendSwitchIfNotNull("-template ", this.Template); + commandLineBuilder.AppendSwitchIfNotNull("-var ", this.PreprocessorVariable); + + base.BuildCommandLine(commandLineBuilder); + return commandLineBuilder.ToString(); + } + } +} diff --git a/src/WixToolset.BuildTasks/HeatFile.cs b/src/WixToolset.BuildTasks/HeatFile.cs new file mode 100644 index 00000000..69e11b88 --- /dev/null +++ b/src/WixToolset.BuildTasks/HeatFile.cs @@ -0,0 +1,95 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Framework; + + public sealed class HeatFile : HeatTask + { + private string file; + private bool suppressCom; + private bool suppressRegistry; + private bool suppressRootDirectory; + private string template; + private string componentGroupName; + private string directoryRefId; + private string preprocessorVariable; + + public string ComponentGroupName + { + get { return this.componentGroupName; } + set { this.componentGroupName = value; } + } + + public string DirectoryRefId + { + get { return this.directoryRefId; } + set { this.directoryRefId = value; } + } + + [Required] + public string File + { + get { return this.file; } + set { this.file = value; } + } + + public string PreprocessorVariable + { + get { return this.preprocessorVariable; } + set { this.preprocessorVariable = value; } + } + + public bool SuppressCom + { + get { return this.suppressCom; } + set { this.suppressCom = value; } + } + + public bool SuppressRegistry + { + get { return this.suppressRegistry; } + set { this.suppressRegistry = value; } + } + + public bool SuppressRootDirectory + { + get { return this.suppressRootDirectory; } + set { this.suppressRootDirectory = value; } + } + + public string Template + { + get { return this.template; } + set { this.template = value; } + } + + protected override string OperationName + { + get { return "file"; } + } + + /// + /// Generate the command line arguments to write to the response file from the properties. + /// + /// Command line string. + protected override string GenerateResponseFileCommands() + { + WixCommandLineBuilder commandLineBuilder = new WixCommandLineBuilder(); + + commandLineBuilder.AppendSwitch(this.OperationName); + commandLineBuilder.AppendFileNameIfNotNull(this.File); + + commandLineBuilder.AppendSwitchIfNotNull("-cg ", this.ComponentGroupName); + commandLineBuilder.AppendSwitchIfNotNull("-dr ", this.DirectoryRefId); + commandLineBuilder.AppendIfTrue("-scom", this.SuppressCom); + commandLineBuilder.AppendIfTrue("-srd", this.SuppressRootDirectory); + commandLineBuilder.AppendIfTrue("-sreg", this.SuppressRegistry); + commandLineBuilder.AppendSwitchIfNotNull("-template ", this.Template); + commandLineBuilder.AppendSwitchIfNotNull("-var ", this.PreprocessorVariable); + + base.BuildCommandLine(commandLineBuilder); + return commandLineBuilder.ToString(); + } + } +} diff --git a/src/WixToolset.BuildTasks/HeatProject.cs b/src/WixToolset.BuildTasks/HeatProject.cs new file mode 100644 index 00000000..8620ffa3 --- /dev/null +++ b/src/WixToolset.BuildTasks/HeatProject.cs @@ -0,0 +1,108 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Framework; + + public sealed class HeatProject : HeatTask + { + private string configuration; + private string directoryIds; + private string generateType; + private bool generateWixVariables; + private string platform; + private string project; + private string projectName; + private string[] projectOutputGroups; + + public string Configuration + { + get { return this.configuration; } + set { this.configuration = value; } + } + + public string DirectoryIds + { + get { return this.directoryIds; } + set { this.directoryIds = value; } + } + + public bool GenerateWixVariables + { + get { return this.generateWixVariables; } + set { this.generateWixVariables = value; } + } + + public string GenerateType + { + get { return this.generateType; } + set { this.generateType = value; } + } + + public string Platform + { + get { return this.platform; } + set { this.platform = value; } + } + + [Required] + public string Project + { + get { return this.project; } + set { this.project = value; } + } + + public string ProjectName + { + get { return this.projectName; } + set { this.projectName = value; } + } + + public string[] ProjectOutputGroups + { + get + { + return this.projectOutputGroups; + } + set + { + this.projectOutputGroups = value; + + // If it's just one string and it contains semicolons, let's + // split it into separate items. + if (this.projectOutputGroups.Length == 1) + { + this.projectOutputGroups = this.projectOutputGroups[0].Split(new char[] { ';' }); + } + } + } + + protected override string OperationName + { + get { return "project"; } + } + + /// + /// Generate the command line arguments to write to the response file from the properties. + /// + /// Command line string. + protected override string GenerateResponseFileCommands() + { + WixCommandLineBuilder commandLineBuilder = new WixCommandLineBuilder(); + + commandLineBuilder.AppendSwitch(this.OperationName); + commandLineBuilder.AppendFileNameIfNotNull(this.Project); + + commandLineBuilder.AppendSwitchIfNotNull("-configuration ", this.Configuration); + commandLineBuilder.AppendSwitchIfNotNull("-directoryid ", this.DirectoryIds); + commandLineBuilder.AppendSwitchIfNotNull("-generate ", this.GenerateType); + commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.Platform); + commandLineBuilder.AppendArrayIfNotNull("-pog ", this.ProjectOutputGroups); + commandLineBuilder.AppendSwitchIfNotNull("-projectname ", this.ProjectName); + commandLineBuilder.AppendIfTrue("-wixvar", this.GenerateWixVariables); + + base.BuildCommandLine(commandLineBuilder); + return commandLineBuilder.ToString(); + } + } +} diff --git a/src/WixToolset.BuildTasks/HeatTask.cs b/src/WixToolset.BuildTasks/HeatTask.cs new file mode 100644 index 00000000..bf0a2ad3 --- /dev/null +++ b/src/WixToolset.BuildTasks/HeatTask.cs @@ -0,0 +1,121 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Text; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// A base MSBuild task to run the WiX harvester. + /// Specific harvester tasks should extend this class. + /// + public abstract class HeatTask : WixToolTask + { + private const string HeatToolName = "Heat.exe"; + + private bool autogenerageGuids; + private bool generateGuidsNow; + private ITaskItem outputFile; + private bool suppressFragments; + private bool suppressUniqueIds; + private string[] transforms; + + public bool AutogenerateGuids + { + get { return this.autogenerageGuids; } + set { this.autogenerageGuids = value; } + } + + public bool GenerateGuidsNow + { + get { return this.generateGuidsNow; } + set { this.generateGuidsNow = value; } + } + + [Required] + [Output] + public ITaskItem OutputFile + { + get { return this.outputFile; } + set { this.outputFile = value; } + } + + public bool SuppressFragments + { + get { return this.suppressFragments; } + set { this.suppressFragments = value; } + } + + public bool SuppressUniqueIds + { + get { return this.suppressUniqueIds; } + set { this.suppressUniqueIds = value; } + } + + public string[] Transforms + { + get { return this.transforms; } + set { this.transforms = value; } + } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of heat.exe. + /// The name of the executable. + protected override string ToolName + { + get { return HeatToolName; } + } + + /// + /// Gets the name of the heat operation performed by the task. + /// + /// This is the first parameter passed on the heat.exe command-line. + /// The name of the heat operation performed by the task. + protected abstract string OperationName + { + get; + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply heat.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return HeatToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), HeatToolName); + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendIfTrue("-ag", this.AutogenerateGuids); + commandLineBuilder.AppendIfTrue("-gg", this.GenerateGuidsNow); + commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); + commandLineBuilder.AppendIfTrue("-sfrag", this.SuppressFragments); + commandLineBuilder.AppendIfTrue("-suid", this.SuppressUniqueIds); + commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); + commandLineBuilder.AppendArrayIfNotNull("-t ", this.Transforms); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + } + } +} diff --git a/src/WixToolset.BuildTasks/Insignia.cs b/src/WixToolset.BuildTasks/Insignia.cs new file mode 100644 index 00000000..ba30963a --- /dev/null +++ b/src/WixToolset.BuildTasks/Insignia.cs @@ -0,0 +1,118 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Text; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// An MSBuild task to run the WiX transform generator. + /// + public sealed class Insignia : WixToolTask + { + private const string InsigniaToolName = "insignia.exe"; + + /// + /// Gets or sets the path to the database to inscribe. + /// + public ITaskItem DatabaseFile { get; set; } + + /// + /// Gets or sets the path to the bundle to inscribe. + /// + public ITaskItem BundleFile { get; set; } + + /// + /// Gets or sets the path to the original bundle that contains the attached container. + /// + public ITaskItem OriginalBundleFile { get; set; } + + /// + /// Gets or sets the path to output the inscribed result. + /// + [Required] + public ITaskItem OutputFile { get; set; } + + /// + /// Gets or sets the output. Only set if insignia does work. + /// + [Output] + public ITaskItem Output { get; set; } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of Insignia.exe. + /// The name of the executable. + protected override string ToolName + { + get { return InsigniaToolName; } + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply Insignia.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return InsigniaToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), InsigniaToolName); + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendSwitchIfNotNull("-im ", this.DatabaseFile); + if (null != this.OriginalBundleFile) + { + commandLineBuilder.AppendSwitchIfNotNull("-ab ", this.BundleFile); + commandLineBuilder.AppendFileNameIfNotNull(this.OriginalBundleFile); + } + else + { + commandLineBuilder.AppendSwitchIfNotNull("-ib ", this.BundleFile); + } + + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + } + + /// + /// Executes a tool in-process by loading the tool assembly and invoking its entrypoint. + /// + /// Path to the tool to be executed; must be a managed executable. + /// Commands to be written to a response file. + /// Commands to be passed directly on the command-line. + /// The tool exit code. + protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) + { + int returnCode = base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); + if (0 == returnCode) // successfully did work. + { + this.Output = this.OutputFile; + } + else if (-1 == returnCode) // no work done. + { + returnCode = 0; + } + + return returnCode; + } + } +} diff --git a/src/WixToolset.BuildTasks/Light.cs b/src/WixToolset.BuildTasks/Light.cs new file mode 100644 index 00000000..b7d0b4f7 --- /dev/null +++ b/src/WixToolset.BuildTasks/Light.cs @@ -0,0 +1,488 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.IO; + using System.Text; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// An MSBuild task to run the WiX linker. + /// + public sealed class Light : WixToolTask + { + private const string LightToolName = "Light.exe"; + + private string additionalCub; + private bool allowIdenticalRows; + private bool allowUnresolvedReferences; + private string[] baseInputPaths; + private ITaskItem[] bindInputPaths; + private bool backwardsCompatibleGuidGeneration; + private bool bindFiles; + private ITaskItem builtOutputsFile; + private string cabinetCachePath; + private int cabinetCreationThreadCount = WixCommandLineBuilder.Unspecified; + private ITaskItem contentsFile; + private string cultures; + private string customBinder; + private string defaultCompressionLevel; + private ITaskItem[] extensions; + private string[] ices; + private bool leaveTemporaryFiles; + private ITaskItem[] localizationFiles; + private ITaskItem[] objectFiles; + private bool outputAsXml; + private ITaskItem outputsFile; + private ITaskItem outputFile; + private ITaskItem pdbOutputFile; + private ITaskItem wixProjectFile; + private bool pedantic; + private bool reuseCabinetCache; + private bool suppressAclReset; + private bool suppressAssemblies; + private bool suppressDefaultAdminSequenceActions; + private bool suppressDefaultAdvSequenceActions; + private bool suppressDefaultUISequenceActions; + private bool dropUnrealTables; + private bool exactAssemblyVersions; + private bool suppressFileHashAndInfo; + private bool suppressFiles; + private bool suppressIntermediateFileVersionMatching; + private string[] suppressIces; + private bool suppressLayout; + private bool suppressLocalization; + private bool suppressMsiAssemblyTableProcessing; + private bool suppressPdbOutput; + private bool suppressSchemaValidation; + private bool suppressValidation; + private bool suppressTagSectionIdAttributeOnTuples; + private ITaskItem unreferencedSymbolsFile; + private string[] wixVariables; + private string extensionDirectory; + private string[] referencePaths; + + /// + /// Creates a new light task. + /// + /// + /// Defaults to running the task as a separate process, instead of in-proc + /// which is the default for WixToolTasks. This allows the Win32 manifest file + /// embedded in light.exe to enable reg-free COM interop with mergemod.dll. + /// + public Light() + { + } + + public string AdditionalCub + { + get { return this.additionalCub; } + set { this.additionalCub = value; } + } + + public bool AllowIdenticalRows + { + get { return this.allowIdenticalRows; } + set { this.allowIdenticalRows = value; } + } + + public bool AllowUnresolvedReferences + { + get { return this.allowUnresolvedReferences; } + set { this.allowUnresolvedReferences = value; } + } + + // TODO: remove this property entirely in v4.0 + [Obsolete("Use BindInputPaths instead of BaseInputPaths.")] + public string[] BaseInputPaths + { + get { return this.baseInputPaths; } + set { this.baseInputPaths = value; } + } + + public ITaskItem[] BindInputPaths + { + get { return this.bindInputPaths; } + set { this.bindInputPaths = value; } + } + + public bool BackwardsCompatibleGuidGeneration + { + get { return this.backwardsCompatibleGuidGeneration; } + set { this.backwardsCompatibleGuidGeneration = value; } + } + + public bool BindFiles + { + get { return this.bindFiles; } + set { this.bindFiles = value; } + } + + public string CabinetCachePath + { + get { return this.cabinetCachePath; } + set { this.cabinetCachePath = value; } + } + + public int CabinetCreationThreadCount + { + get { return this.cabinetCreationThreadCount; } + set { this.cabinetCreationThreadCount = value; } + } + + public ITaskItem BindBuiltOutputsFile + { + get { return this.builtOutputsFile; } + set { this.builtOutputsFile = value; } + } + + public ITaskItem BindContentsFile + { + get { return this.contentsFile; } + set { this.contentsFile = value; } + } + + public ITaskItem BindOutputsFile + { + get { return this.outputsFile; } + set { this.outputsFile = value; } + } + + public string Cultures + { + get { return this.cultures; } + set { this.cultures = value; } + } + + public string CustomBinder + { + get { return this.customBinder; } + set { this.customBinder = value; } + } + + public string DefaultCompressionLevel + { + get { return this.defaultCompressionLevel; } + set { this.defaultCompressionLevel = value; } + } + + public bool DropUnrealTables + { + get { return this.dropUnrealTables; } + set { this.dropUnrealTables = value; } + } + + public bool ExactAssemblyVersions + { + get { return this.exactAssemblyVersions; } + set { this.exactAssemblyVersions = value; } + } + + public ITaskItem[] Extensions + { + get { return this.extensions; } + set { this.extensions = value; } + } + + public string[] Ices + { + get { return this.ices; } + set { this.ices = value; } + } + + public bool LeaveTemporaryFiles + { + get { return this.leaveTemporaryFiles; } + set { this.leaveTemporaryFiles = value; } + } + + public ITaskItem[] LocalizationFiles + { + get { return this.localizationFiles; } + set { this.localizationFiles = value; } + } + + [Required] + public ITaskItem[] ObjectFiles + { + get { return this.objectFiles; } + set { this.objectFiles = value; } + } + + public bool OutputAsXml + { + get { return this.outputAsXml; } + set { this.outputAsXml = value; } + } + + [Required] + [Output] + public ITaskItem OutputFile + { + get { return this.outputFile; } + set { this.outputFile = value; } + } + + [Output] + public ITaskItem PdbOutputFile + { + get { return this.pdbOutputFile; } + set { this.pdbOutputFile = value; } + } + + public bool Pedantic + { + get { return this.pedantic; } + set { this.pedantic = value; } + } + + public bool ReuseCabinetCache + { + get { return this.reuseCabinetCache; } + set { this.reuseCabinetCache = value; } + } + + public bool SuppressAclReset + { + get { return this.suppressAclReset; } + set { this.suppressAclReset = value; } + } + + public bool SuppressAssemblies + { + get { return this.suppressAssemblies; } + set { this.suppressAssemblies = value; } + } + + public bool SuppressDefaultAdminSequenceActions + { + get { return this.suppressDefaultAdminSequenceActions; } + set { this.suppressDefaultAdminSequenceActions = value; } + } + + public bool SuppressDefaultAdvSequenceActions + { + get { return this.suppressDefaultAdvSequenceActions; } + set { this.suppressDefaultAdvSequenceActions = value; } + } + + public bool SuppressDefaultUISequenceActions + { + get { return this.suppressDefaultUISequenceActions; } + set { this.suppressDefaultUISequenceActions = value; } + } + + public bool SuppressFileHashAndInfo + { + get { return this.suppressFileHashAndInfo; } + set { this.suppressFileHashAndInfo = value; } + } + + public bool SuppressFiles + { + get { return this.suppressFiles; } + set { this.suppressFiles = value; } + } + + public bool SuppressIntermediateFileVersionMatching + { + get { return this.suppressIntermediateFileVersionMatching; } + set { this.suppressIntermediateFileVersionMatching = value; } + } + + public string[] SuppressIces + { + get { return this.suppressIces; } + set { this.suppressIces = value; } + } + + public bool SuppressLayout + { + get { return this.suppressLayout; } + set { this.suppressLayout = value; } + } + + public bool SuppressLocalization + { + get { return this.suppressLocalization; } + set { this.suppressLocalization = value; } + } + + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] + public bool SuppressMsiAssemblyTableProcessing + { + get { return this.suppressMsiAssemblyTableProcessing; } + set { this.suppressMsiAssemblyTableProcessing = value; } + } + + public bool SuppressPdbOutput + { + get { return this.suppressPdbOutput; } + set { this.suppressPdbOutput = value; } + } + + public bool SuppressSchemaValidation + { + get { return this.suppressSchemaValidation; } + set { this.suppressSchemaValidation = value; } + } + + public bool SuppressValidation + { + get { return this.suppressValidation; } + set { this.suppressValidation = value; } + } + + public bool SuppressTagSectionIdAttributeOnTuples + { + get { return this.suppressTagSectionIdAttributeOnTuples; } + set { this.suppressTagSectionIdAttributeOnTuples = value; } + } + + [Output] + public ITaskItem UnreferencedSymbolsFile + { + get { return this.unreferencedSymbolsFile; } + set { this.unreferencedSymbolsFile = value; } + } + + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] + public ITaskItem WixProjectFile + { + get { return this.wixProjectFile; } + set { this.wixProjectFile = value; } + } + + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] + public string[] WixVariables + { + get { return this.wixVariables; } + set { this.wixVariables = value; } + } + + public string ExtensionDirectory + { + get { return this.extensionDirectory; } + set { this.extensionDirectory = value; } + } + + public string[] ReferencePaths + { + get { return this.referencePaths; } + set { this.referencePaths = value; } + } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of light.exe. + /// The name of the executable. + protected override string ToolName + { + get { return LightToolName; } + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply light.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return LightToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), LightToolName); + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + // Always put the output first so it is easy to find in the log. + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendSwitchIfNotNull("-pdbout ", this.PdbOutputFile); + + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendIfTrue("-ai", this.AllowIdenticalRows); + commandLineBuilder.AppendIfTrue("-au", this.AllowUnresolvedReferences); + commandLineBuilder.AppendArrayIfNotNull("-b ", this.baseInputPaths); + + if (null != this.BindInputPaths) + { + Queue formattedBindInputPaths = new Queue(); + foreach (ITaskItem item in this.BindInputPaths) + { + String formattedPath = string.Empty; + String bindName = item.GetMetadata("BindName"); + if (!String.IsNullOrEmpty(bindName)) + { + formattedPath = String.Concat(bindName, "=", item.GetMetadata("FullPath")); + } + else + { + formattedPath = item.GetMetadata("FullPath"); + } + formattedBindInputPaths.Enqueue(formattedPath); + } + commandLineBuilder.AppendArrayIfNotNull("-b ", formattedBindInputPaths.ToArray()); + } + + commandLineBuilder.AppendIfTrue("-bcgg", this.BackwardsCompatibleGuidGeneration); + commandLineBuilder.AppendIfTrue("-bf", this.BindFiles); + commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); + commandLineBuilder.AppendIfSpecified("-ct ", this.CabinetCreationThreadCount); + commandLineBuilder.AppendSwitchIfNotNull("-cub ", this.AdditionalCub); + commandLineBuilder.AppendSwitchIfNotNull("-cultures:", this.Cultures); + commandLineBuilder.AppendSwitchIfNotNull("-binder ", this.CustomBinder); + commandLineBuilder.AppendArrayIfNotNull("-d", this.WixVariables); + commandLineBuilder.AppendSwitchIfNotNull("-dcl:", this.DefaultCompressionLevel); + commandLineBuilder.AppendIfTrue("-dut", this.DropUnrealTables); + commandLineBuilder.AppendIfTrue("-eav", this.ExactAssemblyVersions); + commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.referencePaths); + commandLineBuilder.AppendArrayIfNotNull("-ice:", this.Ices); + commandLineBuilder.AppendArrayIfNotNull("-loc ", this.LocalizationFiles); + commandLineBuilder.AppendIfTrue("-notidy", this.LeaveTemporaryFiles); + commandLineBuilder.AppendIfTrue("-pedantic", this.Pedantic); + commandLineBuilder.AppendIfTrue("-reusecab", this.ReuseCabinetCache); + commandLineBuilder.AppendIfTrue("-sa", this.SuppressAssemblies); + commandLineBuilder.AppendIfTrue("-sacl", this.SuppressAclReset); + commandLineBuilder.AppendIfTrue("-sadmin", this.SuppressDefaultAdminSequenceActions); + commandLineBuilder.AppendIfTrue("-sadv", this.SuppressDefaultAdvSequenceActions); + commandLineBuilder.AppendArrayIfNotNull("-sice:", this.SuppressIces); + commandLineBuilder.AppendIfTrue("-sma", this.SuppressMsiAssemblyTableProcessing); + commandLineBuilder.AppendIfTrue("-sf", this.SuppressFiles); + commandLineBuilder.AppendIfTrue("-sh", this.SuppressFileHashAndInfo); + commandLineBuilder.AppendIfTrue("-sl", this.SuppressLayout); + commandLineBuilder.AppendIfTrue("-sloc", this.SuppressLocalization); + commandLineBuilder.AppendIfTrue("-spdb", this.SuppressPdbOutput); + commandLineBuilder.AppendIfTrue("-ss", this.SuppressSchemaValidation); + commandLineBuilder.AppendIfTrue("-sts", this.SuppressTagSectionIdAttributeOnTuples); + commandLineBuilder.AppendIfTrue("-sui", this.SuppressDefaultUISequenceActions); + commandLineBuilder.AppendIfTrue("-sv", this.SuppressIntermediateFileVersionMatching); + commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); + commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); + commandLineBuilder.AppendIfTrue("-xo", this.OutputAsXml); + commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile); + commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile); + commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile); + commandLineBuilder.AppendSwitchIfNotNull("-wixprojectfile ", this.WixProjectFile); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + + List objectFilePaths = AdjustFilePaths(this.objectFiles, this.ReferencePaths); + commandLineBuilder.AppendFileNamesIfNotNull(objectFilePaths.ToArray(), " "); + } + } +} diff --git a/src/WixToolset.BuildTasks/Lit.cs b/src/WixToolset.BuildTasks/Lit.cs new file mode 100644 index 00000000..1df964ae --- /dev/null +++ b/src/WixToolset.BuildTasks/Lit.cs @@ -0,0 +1,178 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Text; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// An MSBuild task to run the WiX lib tool. + /// + public sealed class Lit : WixToolTask + { + private const string LitToolName = "lit.exe"; + + private string[] baseInputPaths; + private ITaskItem[] bindInputPaths; + private bool bindFiles; + private ITaskItem[] extensions; + private ITaskItem[] localizationFiles; + private ITaskItem[] objectFiles; + private ITaskItem outputFile; + private bool pedantic; + private bool suppressIntermediateFileVersionMatching; + private bool suppressSchemaValidation; + private string extensionDirectory; + private string[] referencePaths; + + // TODO: remove this property entirely in v4.0 + [Obsolete("Use BindInputPaths instead of BaseInputPaths.")] + public string[] BaseInputPaths + { + get { return this.baseInputPaths; } + set { this.baseInputPaths = value; } + } + + public ITaskItem[] BindInputPaths + { + get { return this.bindInputPaths; } + set { this.bindInputPaths = value; } + } + + public bool BindFiles + { + get { return this.bindFiles; } + set { this.bindFiles = value; } + } + + public ITaskItem[] Extensions + { + get { return this.extensions; } + set { this.extensions = value; } + } + + public ITaskItem[] LocalizationFiles + { + get { return this.localizationFiles; } + set { this.localizationFiles = value; } + } + + [Required] + public ITaskItem[] ObjectFiles + { + get { return this.objectFiles; } + set { this.objectFiles = value; } + } + + [Required] + [Output] + public ITaskItem OutputFile + { + get { return this.outputFile; } + set { this.outputFile = value; } + } + + public bool Pedantic + { + get { return this.pedantic; } + set { this.pedantic = value; } + } + + public bool SuppressIntermediateFileVersionMatching + { + get { return this.suppressIntermediateFileVersionMatching; } + set { this.suppressIntermediateFileVersionMatching = value; } + } + + public bool SuppressSchemaValidation + { + get { return this.suppressSchemaValidation; } + set { this.suppressSchemaValidation = value; } + } + + public string ExtensionDirectory + { + get { return this.extensionDirectory; } + set { this.extensionDirectory = value; } + } + + public string[] ReferencePaths + { + get { return this.referencePaths; } + set { this.referencePaths = value; } + } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of lit.exe + /// The name of the executable. + protected override string ToolName + { + get { return LitToolName; } + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply lit.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return LitToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), LitToolName); + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendArrayIfNotNull("-b ", this.baseInputPaths); + if (null != this.BindInputPaths) + { + Queue formattedBindInputPaths = new Queue(); + foreach (ITaskItem item in this.BindInputPaths) + { + String formattedPath = string.Empty; + String bindName = item.GetMetadata("BindName"); + if (!String.IsNullOrEmpty(item.GetMetadata("BindName"))) + { + formattedPath = String.Concat(bindName, "=", item.GetMetadata("FullPath")); + } + else + { + formattedPath = item.GetMetadata("FullPath"); + } + formattedBindInputPaths.Enqueue(formattedPath); + } + commandLineBuilder.AppendArrayIfNotNull("-b ", formattedBindInputPaths.ToArray()); + } + commandLineBuilder.AppendIfTrue("-bf", this.BindFiles); + commandLineBuilder.AppendExtensions(this.extensions, this.ExtensionDirectory, this.referencePaths); + commandLineBuilder.AppendArrayIfNotNull("-loc ", this.LocalizationFiles); + commandLineBuilder.AppendIfTrue("-pedantic", this.Pedantic); + commandLineBuilder.AppendIfTrue("-ss", this.SuppressSchemaValidation); + commandLineBuilder.AppendIfTrue("-sv", this.SuppressIntermediateFileVersionMatching); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + + List objectFilePaths = AdjustFilePaths(this.objectFiles, this.ReferencePaths); + commandLineBuilder.AppendFileNamesIfNotNull(objectFilePaths.ToArray(), " "); + } + } +} diff --git a/src/WixToolset.BuildTasks/Pyro.cs b/src/WixToolset.BuildTasks/Pyro.cs new file mode 100644 index 00000000..f6b069da --- /dev/null +++ b/src/WixToolset.BuildTasks/Pyro.cs @@ -0,0 +1,140 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.IO; + using Microsoft.Build.Framework; + + /// + /// An MSBuild task to run the WiX patch builder. + /// + public sealed class Pyro : WixToolTask + { + private const string PyroToolName = "pyro.exe"; + + public bool BinaryDeltaPatch { get; set; } + public string CabinetCachePath { get; set; } + public string ExtensionDirectory { get; set; } + public ITaskItem[] Extensions { get; set; } + public bool LeaveTemporaryFiles { get; set; } + public string[] ReferencePaths { get; set; } + public bool ReuseCabinetCache { get; set; } + public bool SuppressAssemblies { get; set; } + public bool SuppressFiles { get; set; } + public bool SuppressFileHashAndInfo { get; set; } + public bool SuppressPdbOutput { get; set; } + + [Required] + public string DefaultBaselineId { get; set; } + + public ITaskItem[] BindInputPathsForTarget { get; set; } + public ITaskItem[] BindInputPathsForUpdated { get; set; } + + [Required] + public ITaskItem InputFile { get; set; } + + [Required] + [Output] + public ITaskItem OutputFile { get; set; } + + [Output] + public ITaskItem PdbOutputFile { get; set; } + + [Required] + public ITaskItem[] Transforms { get; set; } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of pyro.exe. + /// The name of the executable. + protected override string ToolName + { + get { return PyroToolName; } + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply torch.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return PyroToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), PyroToolName); + } + + /// + /// Builds a command line for bind-input paths (-bt and -bu switches). + /// + private void AppendBindInputPaths(WixCommandLineBuilder commandLineBuilder, IEnumerable bindInputPaths, string switchName) + { + if (null != bindInputPaths) + { + Queue formattedBindInputPaths = new Queue(); + foreach (ITaskItem item in bindInputPaths) + { + String formattedPath = string.Empty; + String bindName = item.GetMetadata("BindName"); + if (!String.IsNullOrEmpty(bindName)) + { + formattedPath = String.Concat(bindName, "=", item.GetMetadata("FullPath")); + } + else + { + formattedPath = item.GetMetadata("FullPath"); + } + formattedBindInputPaths.Enqueue(formattedPath); + } + + commandLineBuilder.AppendArrayIfNotNull(switchName, formattedBindInputPaths.ToArray()); + } + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + // Always put the output first so it is easy to find in the log. + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendSwitchIfNotNull("-pdbout ", this.PdbOutputFile); + + base.BuildCommandLine(commandLineBuilder); + + this.AppendBindInputPaths(commandLineBuilder, this.BindInputPathsForTarget, "-bt "); + this.AppendBindInputPaths(commandLineBuilder, this.BindInputPathsForUpdated, "-bu "); + + commandLineBuilder.AppendFileNameIfNotNull(this.InputFile); + commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); + commandLineBuilder.AppendIfTrue("-delta", this.BinaryDeltaPatch); + commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); + commandLineBuilder.AppendIfTrue("-notidy", this.LeaveTemporaryFiles); + commandLineBuilder.AppendIfTrue("-reusecab", this.ReuseCabinetCache); + commandLineBuilder.AppendIfTrue("-sa", this.SuppressAssemblies); + commandLineBuilder.AppendIfTrue("-sf", this.SuppressFiles); + commandLineBuilder.AppendIfTrue("-sh", this.SuppressFileHashAndInfo); + commandLineBuilder.AppendIfTrue("-spdb", this.SuppressPdbOutput); + foreach (ITaskItem transform in this.Transforms) + { + string transformPath = transform.ItemSpec; + string baselineId = transform.GetMetadata("OverrideBaselineId"); + if (String.IsNullOrEmpty(baselineId)) + { + baselineId = this.DefaultBaselineId; + } + + commandLineBuilder.AppendTextIfNotNull(String.Format("-t {0} {1}", baselineId, transformPath)); + } + + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + } + } +} diff --git a/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs b/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs new file mode 100644 index 00000000..5445e0cd --- /dev/null +++ b/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs @@ -0,0 +1,132 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Globalization; + using System.IO; + using System.Text.RegularExpressions; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task refreshes the generated file for bundle projects. + /// + public class RefreshBundleGeneratedFile : Task + { + private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); + private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters + + private ITaskItem[] generatedFiles; + private ITaskItem[] projectReferencePaths; + + /// + /// The list of files to generate. + /// + [Required] + public ITaskItem[] GeneratedFiles + { + get { return this.generatedFiles; } + set { this.generatedFiles = value; } + } + + /// + /// All the project references in the project. + /// + [Required] + public ITaskItem[] ProjectReferencePaths + { + get { return this.projectReferencePaths; } + set { this.projectReferencePaths = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + ArrayList payloadGroupRefs = new ArrayList(); + ArrayList packageGroupRefs = new ArrayList(); + for (int i = 0; i < this.ProjectReferencePaths.Length; i++) + { + ITaskItem item = this.ProjectReferencePaths[i]; + + if (!String.IsNullOrEmpty(item.GetMetadata(Common.DoNotHarvest))) + { + continue; + } + + string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); + string projectName = Path.GetFileNameWithoutExtension(projectPath); + string referenceName = Common.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); + + string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); + foreach (string pog in pogs) + { + if (!String.IsNullOrEmpty(pog)) + { + // TODO: Add payload group references and package group references once heat is generating them + ////payloadGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); + packageGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); + } + } + } + + XmlDocument doc = new XmlDocument(); + + XmlProcessingInstruction head = doc.CreateProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); + doc.AppendChild(head); + + XmlElement rootElement = doc.CreateElement("Wix"); + rootElement.SetAttribute("xmlns", "http://wixtoolset.org/schemas/v4/wxs"); + doc.AppendChild(rootElement); + + XmlElement fragment = doc.CreateElement("Fragment"); + rootElement.AppendChild(fragment); + + XmlElement payloadGroup = doc.CreateElement("PayloadGroup"); + payloadGroup.SetAttribute("Id", "Bundle.Generated.Payloads"); + fragment.AppendChild(payloadGroup); + + XmlElement packageGroup = doc.CreateElement("PackageGroup"); + packageGroup.SetAttribute("Id", "Bundle.Generated.Packages"); + fragment.AppendChild(packageGroup); + + foreach (string payloadGroupRef in payloadGroupRefs) + { + XmlElement payloadGroupRefElement = doc.CreateElement("PayloadGroupRef"); + payloadGroupRefElement.SetAttribute("Id", payloadGroupRef); + payloadGroup.AppendChild(payloadGroupRefElement); + } + + foreach (string packageGroupRef in packageGroupRefs) + { + XmlElement packageGroupRefElement = doc.CreateElement("PackageGroupRef"); + packageGroupRefElement.SetAttribute("Id", packageGroupRef); + packageGroup.AppendChild(packageGroupRefElement); + } + + foreach (ITaskItem item in this.GeneratedFiles) + { + string fullPath = item.GetMetadata("FullPath"); + + payloadGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath) + ".Payloads"); + packageGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath) + ".Packages"); + try + { + doc.Save(fullPath); + } + catch (Exception e) + { + // e.Message will be something like: "Access to the path 'fullPath' is denied." + this.Log.LogMessage(MessageImportance.High, "Unable to save generated file to '{0}'. {1}", fullPath, e.Message); + } + } + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs b/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs new file mode 100644 index 00000000..fdfc4774 --- /dev/null +++ b/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs @@ -0,0 +1,118 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Globalization; + using System.IO; + using System.Text.RegularExpressions; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task refreshes the generated file that contains ComponentGroupRefs + /// to harvested output. + /// + public class RefreshGeneratedFile : Task + { + private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); + private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters + + private ITaskItem[] generatedFiles; + private ITaskItem[] projectReferencePaths; + + /// + /// The list of files to generate. + /// + [Required] + public ITaskItem[] GeneratedFiles + { + get { return this.generatedFiles; } + set { this.generatedFiles = value; } + } + + /// + /// All the project references in the project. + /// + [Required] + public ITaskItem[] ProjectReferencePaths + { + get { return this.projectReferencePaths; } + set { this.projectReferencePaths = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + ArrayList componentGroupRefs = new ArrayList(); + for (int i = 0; i < this.ProjectReferencePaths.Length; i++) + { + ITaskItem item = this.ProjectReferencePaths[i]; + + if (!String.IsNullOrEmpty(item.GetMetadata(Common.DoNotHarvest))) + { + continue; + } + + string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); + string projectName = Path.GetFileNameWithoutExtension(projectPath); + string referenceName = Common.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); + + string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); + foreach (string pog in pogs) + { + if (!String.IsNullOrEmpty(pog)) + { + componentGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); + } + } + } + + XmlDocument doc = new XmlDocument(); + + XmlProcessingInstruction head = doc.CreateProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); + doc.AppendChild(head); + + XmlElement rootElement = doc.CreateElement("Wix"); + rootElement.SetAttribute("xmlns", "http://wixtoolset.org/schemas/v4/wxs"); + doc.AppendChild(rootElement); + + XmlElement fragment = doc.CreateElement("Fragment"); + rootElement.AppendChild(fragment); + + XmlElement componentGroup = doc.CreateElement("ComponentGroup"); + componentGroup.SetAttribute("Id", "Product.Generated"); + fragment.AppendChild(componentGroup); + + foreach (string componentGroupRef in componentGroupRefs) + { + XmlElement componentGroupRefElement = doc.CreateElement("ComponentGroupRef"); + componentGroupRefElement.SetAttribute("Id", componentGroupRef); + componentGroup.AppendChild(componentGroupRefElement); + } + + foreach (ITaskItem item in this.GeneratedFiles) + { + string fullPath = item.GetMetadata("FullPath"); + + componentGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath)); + try + { + doc.Save(fullPath); + } + catch (Exception e) + { + // e.Message will be something like: "Access to the path 'fullPath' is denied." + this.Log.LogMessage(MessageImportance.High, "Unable to save generated file to '{0}'. {1}", fullPath, e.Message); + } + } + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/ReplaceString.cs b/src/WixToolset.BuildTasks/ReplaceString.cs new file mode 100644 index 00000000..e5041923 --- /dev/null +++ b/src/WixToolset.BuildTasks/ReplaceString.cs @@ -0,0 +1,54 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// Replaces occurances of OldValues with NewValues in String. + /// + public class ReplaceString : Task + { + /// + /// Text to operate on. + /// + [Output] + [Required] + public string Text { get; set; } + + /// + /// List of old values to replace. + /// + [Required] + public string OldValue { get; set; } + + /// + /// List of new values to replace old values with. If not specified, occurances of OldValue will be removed. + /// + public string NewValue { get; set; } + + /// + /// Does the string replacement. + /// + /// + public override bool Execute() + { + if (String.IsNullOrEmpty(this.Text)) + { + return true; + } + + if (String.IsNullOrEmpty(this.OldValue)) + { + Log.LogError("OldValue must be specified"); + return false; + } + + this.Text = this.Text.Replace(this.OldValue, this.NewValue); + + return true; + } + } +} diff --git a/src/WixToolset.BuildTasks/ResolveWixReferences.cs b/src/WixToolset.BuildTasks/ResolveWixReferences.cs new file mode 100644 index 00000000..9b8cfe6f --- /dev/null +++ b/src/WixToolset.BuildTasks/ResolveWixReferences.cs @@ -0,0 +1,212 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using Microsoft.Build.Utilities; + using Microsoft.Build.Framework; + using System.IO; + + /// + /// This task searches for paths to references using the order specified in SearchPaths. + /// + public class ResolveWixReferences : Task + { + /// + /// Token value used in SearchPaths to indicate that the item's HintPath metadata should + /// be searched as a full file path to resolve the reference. + /// Must match wix.targets, case sensitive. + /// + private const string HintPathToken = "{HintPathFromItem}"; + + /// + /// Token value used in SearchPaths to indicate that the item's Identity should + /// be searched as a full file path to resolve the reference. + /// Must match wix.targets, case sensitive. + /// + private const string RawFileNameToken = "{RawFileName}"; + + /// + /// The list of references to resolve. + /// + [Required] + public ITaskItem[] WixReferences + { + get; + set; + } + + /// + /// The directories or special locations that are searched to find the files + /// on disk that represent the references. The order in which the search paths are listed + /// is important. For each reference, the list of paths is searched from left to right. + /// When a file that represents the reference is found, that search stops and the search + /// for the next reference starts. + /// + /// This parameter accepts the following types of values: + /// A directory path. + /// {HintPathFromItem}: Specifies that the task will examine the HintPath metadata + /// of the base item. + /// TODO : {CandidateAssemblyFiles}: Specifies that the task will examine the files + /// passed in through the CandidateAssemblyFiles parameter. + /// TODO : {Registry:_AssemblyFoldersBase_, _RuntimeVersion_, _AssemblyFoldersSuffix_}: + /// TODO : {AssemblyFolders}: Specifies the task will use the Visual Studio.NET 2003 + /// finding-assemblies-from-registry scheme. + /// TODO : {GAC}: Specifies the task will search in the GAC. + /// {RawFileName}: Specifies the task will consider the Include value of the item to be + /// an exact path and file name. + /// + public string[] SearchPaths + { + get; + set; + } + + /// + /// The filename extension(s) to be checked when searching. + /// + public string[] SearchFilenameExtensions + { + get; + set; + } + + /// + /// Output items that contain the same metadata as input references and have been resolved to full paths. + /// + [Output] + public ITaskItem[] ResolvedWixReferences + { + get; + private set; + } + + /// + /// Resolves reference paths by searching for referenced items using the specified SearchPaths. + /// + /// True on success, or throws an exception on failure. + public override bool Execute() + { + List resolvedReferences = new List(); + + foreach (ITaskItem reference in this.WixReferences) + { + ITaskItem resolvedReference = ResolveWixReferences.ResolveReference(reference, this.SearchPaths, this.SearchFilenameExtensions, this.Log); + + this.Log.LogMessage(MessageImportance.Low, "Resolved path {0}", resolvedReference.ItemSpec); + resolvedReferences.Add(resolvedReference); + } + + this.ResolvedWixReferences = resolvedReferences.ToArray(); + return true; + } + + /// + /// Resolves a single reference item by searcheing for referenced items using the specified SearchPaths. + /// This method is made public so the resolution logic can be reused by other tasks. + /// + /// The referenced item. + /// The paths to search. + /// Filename extensions to check. + /// Logging helper. + /// The resolved reference item, or the original reference if it could not be resolved. + public static ITaskItem ResolveReference(ITaskItem reference, string[] searchPaths, string[] searchFilenameExtensions, TaskLoggingHelper log) + { + if (reference == null) + { + throw new ArgumentNullException("reference"); + } + + if (searchPaths == null) + { + // Nothing to search, so just return the original reference item. + return reference; + } + + if (searchFilenameExtensions == null) + { + searchFilenameExtensions = new string[] { }; + } + + // Copy all the metadata from the source + TaskItem resolvedReference = new TaskItem(reference); + log.LogMessage(MessageImportance.Low, "WixReference: {0}", reference.ItemSpec); + + // Now find the resolved path based on our order of precedence + foreach (string searchPath in searchPaths) + { + log.LogMessage(MessageImportance.Low, "Trying {0}", searchPath); + if (searchPath.Equals(HintPathToken, StringComparison.Ordinal)) + { + string path = reference.GetMetadata("HintPath"); + log.LogMessage(MessageImportance.Low, "Trying path {0}", path); + if (File.Exists(path)) + { + resolvedReference.ItemSpec = path; + break; + } + } + else if (searchPath.Equals(RawFileNameToken, StringComparison.Ordinal)) + { + log.LogMessage(MessageImportance.Low, "Trying path {0}", resolvedReference.ItemSpec); + if (File.Exists(resolvedReference.ItemSpec)) + { + break; + } + + if (ResolveWixReferences.ResolveFilenameExtensions(resolvedReference, + resolvedReference.ItemSpec, searchFilenameExtensions, log)) + { + break; + } + } + else + { + string path = Path.Combine(searchPath, Path.GetFileName(reference.ItemSpec)); + log.LogMessage(MessageImportance.Low, "Trying path {0}", path); + if (File.Exists(path)) + { + resolvedReference.ItemSpec = path; + break; + } + + if (ResolveWixReferences.ResolveFilenameExtensions(resolvedReference, + path, searchFilenameExtensions, log)) + { + break; + } + } + } + + // Normalize the item path + resolvedReference.ItemSpec = resolvedReference.GetMetadata("FullPath"); + + return resolvedReference; + } + + /// + /// Helper method for checking filename extensions when resolving references. + /// + /// The reference being resolved. + /// Full filename path without extension. + /// Filename extensions to check. + /// Logging helper. + /// True if the item was resolved, else false. + private static bool ResolveFilenameExtensions(ITaskItem reference, string basePath, string[] filenameExtensions, TaskLoggingHelper log) + { + foreach (string filenameExtension in filenameExtensions) + { + string path = basePath + filenameExtension; + log.LogMessage(MessageImportance.Low, "Trying path {0}", path); + if (File.Exists(path)) + { + reference.ItemSpec = path; + return true; + } + } + + return false; + } + } +} diff --git a/src/WixToolset.BuildTasks/TaskBase.cs b/src/WixToolset.BuildTasks/TaskBase.cs new file mode 100644 index 00000000..3d58fc06 --- /dev/null +++ b/src/WixToolset.BuildTasks/TaskBase.cs @@ -0,0 +1,65 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Utilities; + + public abstract class TaskBase : Task + { + public string ToolPath { get; set; } + + public string AdditionalOptions { get; set; } + + public bool RunAsSeparateProcess { get; set; } + + /// + /// Gets or sets whether all warnings should be suppressed. + /// + public bool SuppressAllWarnings { get; set; } + + /// + /// Gets or sets a list of specific warnings to be suppressed. + /// + public string[] SuppressSpecificWarnings { get; set; } + + /// + /// Gets or sets whether all warnings should be treated as errors. + /// + public bool TreatWarningsAsErrors { get; set; } + + /// + /// Gets or sets a list of specific warnings to treat as errors. + /// + public string[] TreatSpecificWarningsAsErrors { get; set; } + + /// + /// Gets or sets whether to display verbose output. + /// + public bool VerboseOutput { get; set; } + + /// + /// Gets or sets whether to display the logo. + /// + public bool NoLogo { get; set; } + + public override bool Execute() + { + try + { + this.ExecuteCore(); + } + catch (BuildException e) + { + this.Log.LogErrorFromException(e); + } + catch (Data.WixException e) + { + this.Log.LogErrorFromException(e); + } + + return !this.Log.HasLoggedErrors; + } + + protected abstract void ExecuteCore(); + } +} diff --git a/src/WixToolset.BuildTasks/Torch.cs b/src/WixToolset.BuildTasks/Torch.cs new file mode 100644 index 00000000..e18ed315 --- /dev/null +++ b/src/WixToolset.BuildTasks/Torch.cs @@ -0,0 +1,159 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Text; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// An MSBuild task to run the WiX transform generator. + /// + public sealed class Torch : WixToolTask + { + private const string TorchToolName = "Torch.exe"; + + private bool adminImage; + private ITaskItem baselineFile; + private string binaryExtractionPath; + private bool inputIsXml; + private bool leaveTemporaryFiles; + private bool outputAsXml; + private ITaskItem outputFile; + private bool preserveUnmodifiedContent; + private string suppressTransformErrorFlags; + private string transformValidationFlags; + private string transformValidationType; + private ITaskItem updateFile; + + public bool AdminImage + { + get { return this.adminImage; } + set { this.adminImage = value; } + } + + + [Required] + public ITaskItem BaselineFile + { + get { return this.baselineFile; } + set { this.baselineFile = value; } + } + + public string BinaryExtractionPath + { + get { return this.binaryExtractionPath; } + set { this.binaryExtractionPath = value; } + } + + public bool LeaveTemporaryFiles + { + get { return this.leaveTemporaryFiles; } + set { this.leaveTemporaryFiles = value; } + } + + public bool InputIsXml + { + get { return this.inputIsXml; } + set { this.inputIsXml = value; } + } + + public bool OutputAsXml + { + get { return this.outputAsXml; } + set { this.outputAsXml = value; } + } + + public bool PreserveUnmodifiedContent + { + get { return this.preserveUnmodifiedContent; } + set { this.preserveUnmodifiedContent = value; } + } + + [Required] + [Output] + public ITaskItem OutputFile + { + get { return this.outputFile; } + set { this.outputFile = value; } + } + + public string SuppressTransformErrorFlags + { + get { return this.suppressTransformErrorFlags; } + set { this.suppressTransformErrorFlags = value; } + } + + public string TransformValidationType + { + get { return this.transformValidationType; } + set { this.transformValidationType = value; } + } + + public string TransformValidationFlags + { + get { return this.transformValidationFlags; } + set { this.transformValidationFlags = value; } + } + + [Required] + public ITaskItem UpdateFile + { + get { return this.updateFile; } + set { this.updateFile = value; } + } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of torch.exe. + /// The name of the executable. + protected override string ToolName + { + get { return TorchToolName; } + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply torch.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return TorchToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), TorchToolName); + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendIfTrue("-notidy", this.LeaveTemporaryFiles); + commandLineBuilder.AppendIfTrue("-xo", this.OutputAsXml); + commandLineBuilder.AppendIfTrue("-xi", this.InputIsXml); + commandLineBuilder.AppendIfTrue("-p", this.PreserveUnmodifiedContent); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + commandLineBuilder.AppendFileNameIfNotNull(this.BaselineFile); + commandLineBuilder.AppendFileNameIfNotNull(this.UpdateFile); + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendIfTrue("-a", this.adminImage); + commandLineBuilder.AppendSwitchIfNotNull("-x ", this.BinaryExtractionPath); + commandLineBuilder.AppendSwitchIfNotNull("-serr ", this.SuppressTransformErrorFlags); + commandLineBuilder.AppendSwitchIfNotNull("-t ", this.TransformValidationType); + commandLineBuilder.AppendSwitchIfNotNull("-val ", this.TransformValidationFlags); + } + } +} diff --git a/src/WixToolset.BuildTasks/WixAssignCulture.cs b/src/WixToolset.BuildTasks/WixAssignCulture.cs new file mode 100644 index 00000000..a8baa62f --- /dev/null +++ b/src/WixToolset.BuildTasks/WixAssignCulture.cs @@ -0,0 +1,229 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.IO; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class WixAssignCulture : Task + { + private const string CultureAttributeName = "Culture"; + private const string OutputFolderMetadataName = "OutputFolder"; + private const string InvariantCultureIdentifier = "neutral"; + private const string NullCultureIdentifier = "null"; + + /// + /// The list of cultures to build. Cultures are specified in the following form: + /// primary culture,first fallback culture, second fallback culture;... + /// Culture groups are seperated by semi-colons + /// Culture precedence within a culture group is evaluated from left to right where fallback cultures are + /// separated with commas. + /// The first (primary) culture in a culture group will be used as the output sub-folder. + /// + public string Cultures { get; set; } + + /// + /// The list of files to apply culture information to. + /// + [Required] + public ITaskItem[] Files + { + get; + set; + } + + /// + /// The files that had culture information applied + /// + [Output] + public ITaskItem[] CultureGroups + { + get; + private set; + } + + /// + /// Applies culture information to the files specified by the Files property. + /// This task intentionally does not validate that strings are valid Cultures so that we can support + /// psuedo-loc. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + // First, process the culture group list the user specified in the cultures property + List cultureGroups = new List(); + + if (!String.IsNullOrEmpty(this.Cultures)) + { + // Get rid of extra quotes + this.Cultures = this.Cultures.Trim('\"'); + + foreach (string cultureGroupString in this.Cultures.Split(';')) + { + if (0 == cultureGroupString.Length) + { + // MSBuild v2.0.50727 cannnot handle "" items + // for the invariant culture we require the neutral keyword + continue; + } + CultureGroup cultureGroup = new CultureGroup(cultureGroupString); + cultureGroups.Add(cultureGroup); + } + } + else + { + // Only process the EmbeddedResource items if cultures was unspecified + foreach (ITaskItem file in this.Files) + { + // Ignore non-wxls + if (!String.Equals(file.GetMetadata("Extension"), ".wxl", StringComparison.OrdinalIgnoreCase)) + { + Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}. The file type is not supported.", file.ItemSpec); + return false; + } + XmlDocument wxlFile = new XmlDocument(); + + try + { + wxlFile.Load(file.ItemSpec); + } + catch (FileNotFoundException) + { + Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}. The file was not found.", file.ItemSpec); + return false; + } + catch (Exception e) + { + Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}: {1}", file.ItemSpec, e.Message); + return false; + } + + // Take the culture value and try using it to create a culture. + XmlAttribute cultureAttr = wxlFile.DocumentElement.Attributes[WixAssignCulture.CultureAttributeName]; + string wxlCulture = null == cultureAttr ? String.Empty : cultureAttr.Value; + if (0 == wxlCulture.Length) + { + // We use a keyword for the invariant culture because MSBuild v2.0.50727 cannnot handle "" items + wxlCulture = InvariantCultureIdentifier; + } + + // We found the culture for the WXL, we now need to determine if it maps to a culture group specified + // in the Cultures property or if we need to create a new one. + Log.LogMessage(MessageImportance.Low, "Culture \"{0}\" from EmbeddedResource {1}.", wxlCulture, file.ItemSpec); + + bool cultureGroupExists = false; + foreach (CultureGroup cultureGroup in cultureGroups) + { + foreach (string culture in cultureGroup.Cultures) + { + if (String.Equals(wxlCulture, culture, StringComparison.OrdinalIgnoreCase)) + { + cultureGroupExists = true; + break; + } + } + } + + // The WXL didn't match a culture group we already have so create a new one. + if (!cultureGroupExists) + { + cultureGroups.Add(new CultureGroup(wxlCulture)); + } + } + } + + // If we didn't create any culture groups the culture was unspecificed and no WXLs were included + // Build an unlocalized target in the output folder + if (cultureGroups.Count == 0) + { + cultureGroups.Add(new CultureGroup()); + } + + List cultureGroupItems = new List(); + + if (1 == cultureGroups.Count && 0 == this.Files.Length) + { + // Maintain old behavior, if only one culturegroup is specified and no WXL, output to the default folder + TaskItem cultureGroupItem = new TaskItem(cultureGroups[0].ToString()); + cultureGroupItem.SetMetadata(OutputFolderMetadataName, CultureGroup.DefaultFolder); + cultureGroupItems.Add(cultureGroupItem); + } + else + { + foreach (CultureGroup cultureGroup in cultureGroups) + { + TaskItem cultureGroupItem = new TaskItem(cultureGroup.ToString()); + cultureGroupItem.SetMetadata(OutputFolderMetadataName, cultureGroup.OutputFolder); + cultureGroupItems.Add(cultureGroupItem); + Log.LogMessage("Culture: {0}", cultureGroup.ToString()); + } + } + + this.CultureGroups = cultureGroupItems.ToArray(); + return true; + } + + private class CultureGroup + { + /// + /// TargetPath already has a '\', do not double it! + /// + public const string DefaultFolder = ""; + + /// + /// Initialize a null culture group + /// + public CultureGroup() + { + } + + public CultureGroup(string cultureGroupString) + { + Debug.Assert(!String.IsNullOrEmpty(cultureGroupString)); + foreach (string cultureString in cultureGroupString.Split(',')) + { + this.Cultures.Add(cultureString); + } + } + + public List Cultures { get; } = new List(); + + public string OutputFolder + { + get + { + string result = DefaultFolder; + if (this.Cultures.Count > 0 && + !this.Cultures[0].Equals(InvariantCultureIdentifier, StringComparison.OrdinalIgnoreCase)) + { + result = this.Cultures[0] + "\\"; + } + + return result; + } + } + + public override string ToString() + { + if (this.Cultures.Count > 0) + { + return String.Join(";", this.Cultures); + } + + // We use a keyword for a null culture because MSBuild cannnot handle "" items + // Null is different from neutral. For neutral we still want to do WXL + // filtering in Light. + return NullCultureIdentifier; + } + } + } +} diff --git a/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs b/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs new file mode 100644 index 00000000..a979dbb0 --- /dev/null +++ b/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs @@ -0,0 +1,177 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// Helper class for appending the command line arguments. + /// + public class WixCommandLineBuilder : CommandLineBuilder + { + internal const int Unspecified = -1; + + /// + /// Append a switch to the command line if the value has been specified. + /// + /// Switch to append. + /// Value specified by the user. + public void AppendIfSpecified(string switchName, int value) + { + if (value != Unspecified) + { + this.AppendSwitchIfNotNull(switchName, value.ToString(CultureInfo.InvariantCulture)); + } + } + + /// + /// Append a switch to the command line if the condition is true. + /// + /// Switch to append. + /// Condition specified by the user. + public void AppendIfTrue(string switchName, bool condition) + { + if (condition) + { + this.AppendSwitch(switchName); + } + } + + /// + /// Append a switch to the command line if any values in the array have been specified. + /// + /// Switch to append. + /// Values specified by the user. + public void AppendArrayIfNotNull(string switchName, IEnumerable values) + { + if (values != null) + { + foreach (ITaskItem value in values) + { + this.AppendSwitchIfNotNull(switchName, value); + } + } + } + + /// + /// Append a switch to the command line if any values in the array have been specified. + /// + /// Switch to append. + /// Values specified by the user. + public void AppendArrayIfNotNull(string switchName, IEnumerable values) + { + if (values != null) + { + foreach (string value in values) + { + this.AppendSwitchIfNotNull(switchName, value); + } + } + } + + /// + /// Build the extensions argument. Each extension is searched in the current folder, user defined search + /// directories (ReferencePath), HintPath, and under Wix Extension Directory in that order. + /// The order of precedence is based off of that described in Microsoft.Common.Targets's SearchPaths + /// property for the ResolveAssemblyReferences task. + /// + /// The list of extensions to include. + /// Evaluated default folder for Wix Extensions + /// User defined reference directories to search in + public void AppendExtensions(ITaskItem[] extensions, string wixExtensionDirectory, string [] referencePaths) + { + if (extensions == null) + { + return; + } + + foreach (ITaskItem extension in extensions) + { + string className = extension.GetMetadata("Class"); + + string fileName = Path.GetFileName(extension.ItemSpec); + + if (String.IsNullOrEmpty(Path.GetExtension(fileName))) + { + fileName += ".dll"; + } + + // First try reference paths + var resolvedPath = FileSearchHelperMethods.SearchFilePaths(referencePaths, fileName); + + if (String.IsNullOrEmpty(resolvedPath)) + { + // Now try HintPath + resolvedPath = extension.GetMetadata("HintPath"); + + if (!File.Exists(resolvedPath)) + { + // Now try the item itself + resolvedPath = extension.ItemSpec; + + if (String.IsNullOrEmpty(Path.GetExtension(resolvedPath))) + { + resolvedPath += ".dll"; + } + + if (!File.Exists(resolvedPath)) + { + if (!String.IsNullOrEmpty(wixExtensionDirectory)) + { + // Now try the extension directory + resolvedPath = Path.Combine(wixExtensionDirectory, Path.GetFileName(resolvedPath)); + } + + if (!File.Exists(resolvedPath)) + { + // Extension wasn't found, just set it to the extension name passed in + resolvedPath = extension.ItemSpec; + } + } + } + } + + if (String.IsNullOrEmpty(className)) + { + this.AppendSwitchIfNotNull("-ext ", resolvedPath); + } + else + { + this.AppendSwitchIfNotNull("-ext ", className + ", " + resolvedPath); + } + } + } + + /// + /// Append arbitrary text to the command-line if specified. + /// + /// Text to append. + public void AppendTextIfNotNull(string textToAppend) + { + if (!String.IsNullOrEmpty(textToAppend)) + { + this.AppendSpaceIfNotEmpty(); + this.AppendTextUnquoted(textToAppend); + } + } + + /// + /// Append arbitrary text to the command-line if specified. + /// + /// Text to append. + public void AppendTextIfNotWhitespace(string textToAppend) + { + if (!String.IsNullOrWhiteSpace(textToAppend)) + { + this.AppendSpaceIfNotEmpty(); + this.AppendTextUnquoted(textToAppend); + } + } + } +} diff --git a/src/WixToolset.BuildTasks/WixToolTask.cs b/src/WixToolset.BuildTasks/WixToolTask.cs new file mode 100644 index 00000000..60305e00 --- /dev/null +++ b/src/WixToolset.BuildTasks/WixToolTask.cs @@ -0,0 +1,403 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.IO; + using System.Reflection; + using System.Text; + using System.Threading; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Core.CommandLine; + + /// + /// Base class for WiX tool tasks; executes tools in-process + /// so that repeated invocations are much faster. + /// + public abstract class WixToolTask : ToolTask, IDisposable + { + private string additionalOptions; + private bool disposed; + private bool noLogo; + private bool runAsSeparateProcess; + private bool suppressAllWarnings; + private string[] suppressSpecificWarnings; + private string[] treatSpecificWarningsAsErrors; + private bool treatWarningsAsErrors; + private bool verboseOutput; + private Queue messageQueue; + private ManualResetEvent messagesAvailable; + private ManualResetEvent toolExited; + private int exitCode; + + /// + /// Gets or sets additional options that are appended the the tool command-line. + /// + /// + /// This allows the task to support extended options in the tool which are not + /// explicitly implemented as properties on the task. + /// + public string AdditionalOptions + { + get { return this.additionalOptions; } + set { this.additionalOptions = value; } + } + + /// + /// Gets or sets a flag indicating whether the task should be run as separate + /// process instead of in-proc with MSBuild which is the default. + /// + public bool RunAsSeparateProcess + { + get { return this.runAsSeparateProcess; } + set { this.runAsSeparateProcess = value; } + } + +#region Common Options + /// + /// Gets or sets whether all warnings should be suppressed. + /// + public bool SuppressAllWarnings + { + get { return this.suppressAllWarnings; } + set { this.suppressAllWarnings = value; } + } + + /// + /// Gets or sets a list of specific warnings to be suppressed. + /// + public string[] SuppressSpecificWarnings + { + get { return this.suppressSpecificWarnings; } + set { this.suppressSpecificWarnings = value; } + } + + /// + /// Gets or sets whether all warnings should be treated as errors. + /// + public bool TreatWarningsAsErrors + { + get { return this.treatWarningsAsErrors; } + set { this.treatWarningsAsErrors = value; } + } + + /// + /// Gets or sets a list of specific warnings to treat as errors. + /// + public string[] TreatSpecificWarningsAsErrors + { + get { return this.treatSpecificWarningsAsErrors; } + set { this.treatSpecificWarningsAsErrors = value; } + } + + /// + /// Gets or sets whether to display verbose output. + /// + public bool VerboseOutput + { + get { return this.verboseOutput; } + set { this.verboseOutput = value; } + } + + /// + /// Gets or sets whether to display the logo. + /// + public bool NoLogo + { + get { return this.noLogo; } + set { this.noLogo = value; } + } +#endregion + + /// + /// Cleans up the ManualResetEvent members + /// + public void Dispose() + { + if (!this.disposed) + { + this.Dispose(true); + GC.SuppressFinalize(this); + disposed = true; + } + } + + /// + /// Cleans up the ManualResetEvent members + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + messagesAvailable.Close(); + toolExited.Close(); + } + } + + /// + /// Generate the command line arguments to write to the response file from the properties. + /// + /// Command line string. + protected override string GenerateResponseFileCommands() + { + WixCommandLineBuilder commandLineBuilder = new WixCommandLineBuilder(); + this.BuildCommandLine(commandLineBuilder); + return commandLineBuilder.ToString(); + } + + /// + /// Builds a command line from options in this and derivative tasks. + /// + /// + /// Derivative classes should call BuildCommandLine() on the base class to ensure that common command line options are added to the command. + /// + protected virtual void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); + commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); + commandLineBuilder.AppendIfTrue("-sw", this.SuppressAllWarnings); + commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput); + commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors); + commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); + } + + /// + /// Executes a tool in-process by loading the tool assembly and invoking its entrypoint. + /// + /// Path to the tool to be executed; must be a managed executable. + /// Commands to be written to a response file. + /// Commands to be passed directly on the command-line. + /// The tool exit code. + protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) + { + if (this.RunAsSeparateProcess) + { + return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); + } + + this.messageQueue = new Queue(); + this.messagesAvailable = new ManualResetEvent(false); + this.toolExited = new ManualResetEvent(false); + + WixToolTaskLogger logger = new WixToolTaskLogger(this.messageQueue, this.messagesAvailable); + TextWriter saveConsoleOut = Console.Out; + TextWriter saveConsoleError = Console.Error; + Console.SetOut(logger); + Console.SetError(logger); + + string responseFile = null; + try + { + responseFile = this.GetTemporaryResponseFile(responseFileCommands, out var responseFileSwitch); + if (!String.IsNullOrEmpty(responseFileSwitch)) + { + commandLineCommands = commandLineCommands + " " + responseFileSwitch; + } + + string[] arguments = CommandLineResponseFile.ParseArgumentsToArray(commandLineCommands); + + Thread toolThread = new Thread(new ParameterizedThreadStart(this.ExecuteToolThread)); + toolThread.Start(new object[] { pathToTool, arguments }); + + this.HandleToolMessages(); + + if (this.exitCode == 0 && this.Log.HasLoggedErrors) + { + this.exitCode = -1; + } + + return this.exitCode; + } + finally + { + if (responseFile != null) + { + File.Delete(responseFile); + } + + Console.SetOut(saveConsoleOut); + Console.SetError(saveConsoleError); + } + } + + /// + /// Called by a new thread to execute the tool in that thread. + /// + /// Tool path and arguments array. + private void ExecuteToolThread(object parameters) + { + try + { + object[] pathAndArguments = (object[])parameters; + Assembly toolAssembly = Assembly.LoadFrom((string)pathAndArguments[0]); + this.exitCode = (int)toolAssembly.EntryPoint.Invoke(null, new object[] { pathAndArguments[1] }); + } + catch (FileNotFoundException fnfe) + { + Log.LogError("Unable to load tool from path {0}. Consider setting the ToolPath parameter to $(WixToolPath).", fnfe.FileName); + this.exitCode = -1; + } + catch (Exception ex) + { + this.exitCode = -1; + this.LogEventsFromTextOutput(ex.Message, MessageImportance.High); + foreach (string stackTraceLine in ex.StackTrace.Split('\n')) + { + this.LogEventsFromTextOutput(stackTraceLine.TrimEnd(), MessageImportance.High); + } + + throw; + } + finally + { + this.toolExited.Set(); + } + } + + /// + /// Waits for messages from the tool thread and sends them to the MSBuild logger on the original thread. + /// Returns when the tool thread exits. + /// + private void HandleToolMessages() + { + WaitHandle[] waitHandles = new WaitHandle[] { this.messagesAvailable, this.toolExited }; + while (WaitHandle.WaitAny(waitHandles) == 0) + { + lock (this.messageQueue) + { + while (this.messageQueue.Count > 0) + { + this.LogEventsFromTextOutput(messageQueue.Dequeue(), MessageImportance.Normal); + } + + this.messagesAvailable.Reset(); + } + } + } + + /// + /// Creates a temporary response file for tool execution. + /// + /// Path to the response file. + /// + /// The temporary file should be deleted after the tool execution is finished. + /// + private string GetTemporaryResponseFile(string responseFileCommands, out string responseFileSwitch) + { + string responseFile = null; + responseFileSwitch = null; + + if (!String.IsNullOrEmpty(responseFileCommands)) + { + responseFile = Path.GetTempFileName(); + using (StreamWriter writer = new StreamWriter(responseFile, false, this.ResponseFileEncoding)) + { + writer.Write(responseFileCommands); + } + responseFileSwitch = this.GetResponseFileSwitch(responseFile); + } + return responseFile; + } + + /// + /// Cycles thru each task to find correct path of the file in question. + /// Looks at item spec, hintpath and then in user defined Reference Paths + /// + /// Input task array + /// SemiColon delimited directories to search + /// List of task item file paths + [SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists")] + protected static List AdjustFilePaths(ITaskItem[] tasks, string[] referencePaths) + { + List sourceFilePaths = new List(); + + if (tasks == null) + { + return sourceFilePaths; + } + + foreach (ITaskItem task in tasks) + { + string filePath = task.ItemSpec; + if (!File.Exists(filePath)) + { + filePath = task.GetMetadata("HintPath"); + if (!File.Exists(filePath)) + { + string searchPath = FileSearchHelperMethods.SearchFilePaths(referencePaths, filePath); + if (!String.IsNullOrEmpty(searchPath)) + { + filePath = searchPath; + } + } + } + sourceFilePaths.Add(filePath); + } + + return sourceFilePaths; + } + + /// + /// Used as a replacement for Console.Out to capture output from a tool + /// and redirect it to the MSBuild logging system. + /// + private class WixToolTaskLogger : TextWriter + { + private StringBuilder buffer; + private Queue messageQueue; + private ManualResetEvent messagesAvailable; + + /// + /// Creates a new logger that sends tool output to the tool task's log handler. + /// + public WixToolTaskLogger(Queue messageQueue, ManualResetEvent messagesAvailable) : base(CultureInfo.CurrentCulture) + { + this.messageQueue = messageQueue; + this.messagesAvailable = messagesAvailable; + this.buffer = new StringBuilder(); + } + + /// + /// Gets the encoding of the logger. + /// + public override Encoding Encoding + { + get { return Encoding.Unicode; } + } + + /// + /// Redirects output to a buffer; watches for newlines and sends each line to the + /// MSBuild logging system. + /// + /// Character being written. + /// All other Write() variants eventually call into this one. + public override void Write(char value) + { + lock (this.messageQueue) + { + if (value == '\n') + { + if (this.buffer.Length > 0 && this.buffer[this.buffer.Length - 1] == '\r') + { + this.buffer.Length = this.buffer.Length - 1; + } + + this.messageQueue.Enqueue(this.buffer.ToString()); + this.messagesAvailable.Set(); + + this.buffer.Length = 0; + } + else + { + this.buffer.Append(value); + } + } + } + } + } +} diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj new file mode 100644 index 00000000..ec16f8b1 --- /dev/null +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -0,0 +1,51 @@ + + + + + + net461;netcoreapp2.1 + + WiX Toolset MSBuild Tasks + embedded + true + + + + NU1701 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.BuildTasks/redirects/wix.ca.targets b/src/WixToolset.BuildTasks/redirects/wix.ca.targets new file mode 100644 index 00000000..ecb6e09f --- /dev/null +++ b/src/WixToolset.BuildTasks/redirects/wix.ca.targets @@ -0,0 +1,10 @@ + + + + + + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WiX Toolset\v4', 'InstallFolder', null, RegistryView.Registry32)) + + + + diff --git a/src/WixToolset.BuildTasks/redirects/wix.targets b/src/WixToolset.BuildTasks/redirects/wix.targets new file mode 100644 index 00000000..ba354b65 --- /dev/null +++ b/src/WixToolset.BuildTasks/redirects/wix.targets @@ -0,0 +1,10 @@ + + + + + + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WiX Toolset\v4', 'InstallFolder', null, RegistryView.Registry32)) + + + + diff --git a/src/WixToolset.BuildTasks/wix.ca.targets b/src/WixToolset.BuildTasks/wix.ca.targets new file mode 100644 index 00000000..4578c2d8 --- /dev/null +++ b/src/WixToolset.BuildTasks/wix.ca.targets @@ -0,0 +1,123 @@ + + + + + + + + + + true + + $(TargetName).CA$(TargetExt) + + $(MSBuildThisFileDirectory) + $(WixSdkPath)x86\ + $(WixSdkPath)x64\ + + $(WixSdkPath)MakeSfxCA.exe + $(WixSdkX64Path)SfxCA.dll + $(WixSdkX86Path)SfxCA.dll + + + + + + + + + + + + + + + + + + + @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.BuildTasks/wix.harvest.targets b/src/WixToolset.BuildTasks/wix.harvest.targets new file mode 100644 index 00000000..e94dfcea --- /dev/null +++ b/src/WixToolset.BuildTasks/wix.harvest.targets @@ -0,0 +1,511 @@ + + + + + + + + + $(MSBuildThisFileFullPath) + $(WixTargetsPath)WixTasks.dll + + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + true + false + true + false + + + + + + false + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + $(IntermediateOutputPath)Product.Generated.wxs + $(IntermediateOutputPath)Bundle.Generated.wxs + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + + ConvertReferences; + ConvertBundleReferences; + HarvestProjects; + HarvestDirectory; + HarvestFile; + GenerateCode; + + + + + + + + RefreshGeneratedFile; + RefreshBundleGeneratedFile + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + %(_MSBuildProjectReferenceExistent.RefTargetDir) + Binaries;Symbols;Sources;Content;Satellites;Documents + %(_MSBuildProjectReferenceExistent.Name) + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + Binaries;Symbols;Sources;Content;Satellites;Documents + payloadgroup + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + + + CombineHarvestProjects + + + + + + + + + + + + + + + + + $(HarvestDirectoryTransforms) + $(HarvestDirectoryComponentGroupName) + $(HarvestDirectoryDirectoryRefId) + $(HarvestDirectoryKeepEmptyDirectories) + $(HarvestDirectoryPreprocessorVariable) + $(HarvestDirectorySuppressCom) + $(HarvestDirectorySuppressRootDirectory) + $(HarvestDirectorySuppressRegistry) + + + + + + GetHarvestDirectoryContent + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestFileTransforms) + $(HarvestFileComponentGroupName) + $(HarvestFileDirectoryRefId) + $(HarvestFilePreprocessorVariable) + $(HarvestFileSuppressCom) + $(HarvestFileSuppressRegistry) + $(HarvestFileSuppressRootDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.BuildTasks/wix.signing.targets b/src/WixToolset.BuildTasks/wix.signing.targets new file mode 100644 index 00000000..6351cc8b --- /dev/null +++ b/src/WixToolset.BuildTasks/wix.signing.targets @@ -0,0 +1,378 @@ + + + + + + + + + $(MSBuildThisFileFullPath) + $(WixTargetsPath)WixTasks.dll + + $(MSBuildProjectFile).Signed.txt + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + GetMsmsToSign; + InternalSignMsm; + + + GetCabsToSign; + GetMsiToSign; + InternalSignCabs; + InscribeMsi; + InternalSignMsi; + + + GetContainersToSign; + InternalSignContainers; + InscribeBundleEngine; + InternalSignBundleEngine; + InscribeBundle; + InternalSignBundle; + + + + CompileAndLink; + BeforeSigning; + $(InternalSignDependsOn); + AfterSigning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PrepareForBuild; + ResolveWixExtensionReferences; + CompileAndLink; + InternalSignCabs + + + + + + + + + + + PrepareForBuild; + ResolveWixExtensionReferences; + CompileAndLink; + InternalSignContainers + + + + + + + + + + + + + + + + + + + PrepareForBuild; + ResolveWixExtensionReferences; + CompileAndLink; + InternalSignBundleEngine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets new file mode 100644 index 00000000..c9704094 --- /dev/null +++ b/src/WixToolset.BuildTasks/wix.targets @@ -0,0 +1,1356 @@ + + + + + + + true + + + + + + + + + + $(MSBuildThisFileDirectory) + $(WixBinDir)WixToolset.BuildTasks.dll + $(WixBinDir)wix.harvest.targets + $(WixBinDir)wix.signing.targets + $(WixBinDir)lux.targets + $(WixBinDir)LuxTasks.dll + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildAllProjects);$(WixHarvestTargetsPath) + $(MSBuildAllProjects);$(WixSigningTargetsPath) + $(MSBuildAllProjects);$(LuxTargetsPath) + $(MSBuildAllProjects);$(CustomBeforeWixTargets) + $(MSBuildAllProjects);$(CustomAfterWixTargets) + + + + + + .wxs + wix + Managed + + + $(MSBuildProjectName) + $(OutputName) + + + <_OriginalOutputType>$(OutputType) + Package + + + + + .msi + .msm + .pcp + .wixlib + .exe + + + + + <_DebugSymbolsIntermediatePath Include="$(PdbOutputDir)$(TargetPdbName)" Condition=" '@(_DebugSymbolsIntermediatePath)' == '' " /> + + + + + + + $(IntermediateOutputPath) + $(PdbOutputDir)\ + + + $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) + + + $(TargetName).wixpdb + + + $(TargetPdbDir)$(TargetPdbName) + + + + + + + + + + + + + + + + + + + + + + + + true + + + + $(MSBuildProjectFile).BindContentsFileList.txt + $(MSBuildProjectFile).BindOutputsFileList.txt + $(MSBuildProjectFile).BindBuiltOutputsFileList.txt + + + + $(IntermediateOutputPath)cabcache\ + + + + $(WixBinDir) + $(WixToolDir) + + + + + + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + $(Platform) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + + + + + + + + + + + + + <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. + <_OutputTypeDescription>The OutputType defines whether a Windows Installer package (.msi), PatchCreation (.pcp), merge module (.msm), wix library (.wixlib), or self-extracting executable (.exe) is being built. $(_PleaseSetThisInProjectFile) Possible values are 'Package', 'Module', 'Library', and 'Bundle'. + + + + + + + + + + + + + + + + + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + ResolveReferences; + + + DoIt; + Signing; + + GetTargetPath; + PrepareForRun; + IncrementalClean; + PostBuildEvent + + + + + + + + + + BeforeResolveReferences; + AssignProjectConfiguration; + ResolveProjectReferences; + ResolveWixLibraryReferences; + ResolveWixExtensionReferences; + AfterResolveReferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssignCultures + + + + + + + + + PrepareForBuild; + ResolveReferences; + BeforeCompile; + _TimeStampBeforeCompile; + Harvest; + + CalculateDefineConstants; + GenerateCompileWithObjectPath; + + AssignCultures; + ReadPreviousBindInputsAndBuiltOutputs; + + ActuallyDoIt; + + UpdateLinkFileWrites; + _TimeStampAfterCompile; + AfterCompile + + + + + + + + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt))) + $(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName) + + + + + + + + + + + + + + + ResolveReferences; + BeforeCompile; + _TimeStampBeforeCompile; + Harvest; + Compile; + Lib; + Link; + UpdateLinkFileWrites; + _TimeStampAfterCompile; + AfterCompile + + + + + + + ResolveReferences + + + + + + Configuration=$(ConfigurationName); + OutDir=$(OutDir); + Platform=$(PlatformName); + ProjectDir=$(ProjectDir); + ProjectExt=$(ProjectExt); + ProjectFileName=$(ProjectFileName); + ProjectName=$(ProjectName); + ProjectPath=$(ProjectPath); + TargetDir=$(TargetDir); + TargetExt=$(TargetExt); + TargetFileName=$(TargetFileName); + TargetName=$(TargetName); + TargetPath=$(TargetPath); + + + + + $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) + $(SolutionDefineConstants);SolutionDir=$(SolutionDir) + $(SolutionDefineConstants);SolutionExt=$(SolutionExt) + $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) + $(SolutionDefineConstants);SolutionName=$(SolutionName) + $(SolutionDefineConstants);SolutionPath=$(SolutionPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + PrepareForBuild; + ResolveReferences; + CalculateDefineConstants; + GenerateCompileWithObjectPath + + + + + + + + + + + + + + + + + + PrepareForBuild; + ResolveReferences + + + + + + + + + + + + + + + + + + <_TargetPathItems Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)" /> + <_TargetPdbPathItems Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)" /> + + + + + @(_TargetPathItems) + @(_TargetPdbPathItems) + + + + + + + + + + + + + + + + + + + + + + + + + + + PrepareForBuild; + ResolveReferences; + AssignCultures; + ReadPreviousBindInputsAndBuiltOutputs; + + + + + + $(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(TargetPath) + $(TargetFileName) + + + + + + PrepareForBuild;AssignCultures + + + + + + + + + + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> + + + + + + + %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) + + + + + + + AssignCultures + + + + + + + + + + + + + + + + true + + + + true + true + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) + + + + + + + + + <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> + <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj new file mode 100644 index 00000000..73f331ff --- /dev/null +++ b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj @@ -0,0 +1,28 @@ + + + + + + netstandard2.0 + false + Internal WiX Toolset Tools + $(MSBuildThisFileName).nuspec + $(OutputPath)publish + Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) + + + + + + + + $(GenerateNuspecDependsOn);SetNuspecVersion + + + + + + $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) + + + diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec new file mode 100644 index 00000000..a461557a --- /dev/null +++ b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec @@ -0,0 +1,20 @@ + + + + $id$ + $version$ + $authors$ + $authors$ + false + $description$ + $copyright$ + + + + + + + + + + diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props new file mode 100644 index 00000000..8d71aa66 --- /dev/null +++ b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props @@ -0,0 +1,8 @@ + + + + + + $(MSBuildThisFileDirectory)..\tools\net461\wix.targets + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj new file mode 100644 index 00000000..76e42911 --- /dev/null +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj @@ -0,0 +1,28 @@ + + + + + + netstandard2.0 + false + WiX Toolset MSBuild integration + $(MSBuildThisFileName).nuspec + $(OutputPath)publish\WixToolset.MSBuild\ + Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) + + + + + + + + $(GenerateNuspecDependsOn);SetNuspecVersion + + + + + + $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) + + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec new file mode 100644 index 00000000..1a21315a --- /dev/null +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -0,0 +1,21 @@ + + + + $id$ + $version$ + $authors$ + $authors$ + false + $description$ + $copyright$ + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/WixToolset.MSBuild.props new file mode 100644 index 00000000..b1d207f4 --- /dev/null +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.props @@ -0,0 +1,9 @@ + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\netcoreapp2.1\wix.targets')) + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\net461\wix.targets')) + + diff --git a/src/dotnet-wix/DotnetToolSettings.xml b/src/dotnet-wix/DotnetToolSettings.xml new file mode 100644 index 00000000..a7a87fb2 --- /dev/null +++ b/src/dotnet-wix/DotnetToolSettings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/dotnet-wix/dotnet-wix.csproj b/src/dotnet-wix/dotnet-wix.csproj new file mode 100644 index 00000000..08fa9530 --- /dev/null +++ b/src/dotnet-wix/dotnet-wix.csproj @@ -0,0 +1,28 @@ + + + + + + netstandard2.0 + false + WiX Toolset Command-line interface + $(MSBuildThisFileName).nuspec + $(OutputPath)publish\dotnet-wix\ + Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) + + + + + + + + $(GenerateNuspecDependsOn);SetNuspecVersion + + + + + + $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) + + + diff --git a/src/dotnet-wix/dotnet-wix.nuspec b/src/dotnet-wix/dotnet-wix.nuspec new file mode 100644 index 00000000..53a8dc9e --- /dev/null +++ b/src/dotnet-wix/dotnet-wix.nuspec @@ -0,0 +1,24 @@ + + + + $id$ + $version$ + $authors$ + $authors$ + false + $description$ + $copyright$ + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs new file mode 100644 index 00000000..8fd69414 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs @@ -0,0 +1,33 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.BuildTasks +{ + using System.Collections; + using System.Text; + using Microsoft.Build.Framework; + + internal class FakeBuildEngine : IBuildEngine + { + private StringBuilder output = new StringBuilder(); + + public int ColumnNumberOfTaskNode => 0; + + public bool ContinueOnError => false; + + public int LineNumberOfTaskNode => 0; + + public string ProjectFileOfTaskNode => "fake_wix.targets"; + + public string Output => this.output.ToString(); + + public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) => throw new System.NotImplementedException(); + + public void LogCustomEvent(CustomBuildEventArgs e) => this.output.AppendLine(e.Message); + + public void LogErrorEvent(BuildErrorEventArgs e) => this.output.AppendLine(e.Message); + + public void LogMessageEvent(BuildMessageEventArgs e) => this.output.AppendLine(e.Message); + + public void LogWarningEvent(BuildWarningEventArgs e) => this.output.AppendLine(e.Message); + } +} diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs new file mode 100644 index 00000000..a27928d5 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -0,0 +1,64 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.BuildTasks +{ + using System.IO; + using System.Linq; + using Microsoft.Build.Utilities; + using WixBuildTools.TestSupport; + using WixToolset.BuildTasks; + using WixToolset.Data; + using WixToolset.Data.Tuples; + using Xunit; + + public partial class MsbuildFixture + { + [Fact] + public void CanBuildSimpleMsiPackage() + { + var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + + var engine = new FakeBuildEngine(); + + var task = new DoIt + { + BuildEngine = engine, + SourceFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.wxs")), + new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), + }, + LocalizationFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), + }, + BindInputPaths = new[] + { + new TaskItem(Path.Combine(folder, "data")), + }, + IntermediateDirectory = new TaskItem(intermediateFolder), + OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), + }; + + var result = task.Execute(); + Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}"); + + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); + + var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir")); + var section = intermediate.Sections.Single(); + + var wixFile = section.Tuples.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); + } + } + } +} diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..e04ea43d --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,57 @@ + + + + Debug + x86 + 0.9 + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + MsiPackage + Package + MsiPackage + MsiPackage + en-US,en;de-DE + + + + ..\..\..\..\..\..\build\Release\publish\net461\wix.targets + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl new file mode 100644 index 00000000..23493ace --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl @@ -0,0 +1,11 @@ + + + + + + German DowngradeError + German FeatureTitle + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..d5a5a40d --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln new file mode 100644 index 00000000..2c88704e --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..31c3ec9c --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,55 @@ + + + + Debug + x86 + 0.9 + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + MsiPackage + Package + MsiPackage + MsiPackage + + + + ..\..\..\..\..\..\build\Release\publish\wix.targets + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..d5a5a40d --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln new file mode 100644 index 00000000..2c88704e --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj new file mode 100644 index 00000000..5ec5b7fd --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -0,0 +1,32 @@ + + + + + + net461 + false + embedded + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/Program.cs b/src/wix/Program.cs new file mode 100644 index 00000000..134900e9 --- /dev/null +++ b/src/wix/Program.cs @@ -0,0 +1,123 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools +{ + using System; + using System.Globalization; + using System.Text; + using System.Threading; + using WixToolset.Core; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + /// + /// Wix Toolset Command-Line Interface. + /// + public sealed class Program + { + /// + /// The main entry point for wix command-line interface. + /// + /// Commandline arguments for the application. + /// Returns the application error code. + [MTAThread] + public static int Main(string[] args) + { + var serviceProvider = new WixToolsetServiceProvider(); + + var listener = new ConsoleMessageListener("WIX", "wix.exe"); + + var program = new Program(); + return program.Run(serviceProvider, listener, args); + } + + /// + /// Executes the wix command-line interface. + /// + /// Service provider to use throughout this execution. + /// Command-line arguments to execute. + /// Returns the application error code. + public int Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args) + { + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var arguments = serviceProvider.GetService(); + arguments.Populate(args); + + var context = serviceProvider.GetService(); + context.Messaging = messaging; + context.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); + context.Arguments = arguments; + + var commandLine = serviceProvider.GetService(); + var command = commandLine.ParseStandardCommandLine(context); + return command?.Execute() ?? 1; + } + + private static IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, string[] extensions) + { + var extensionManager = serviceProvider.GetService(); + + foreach (var type in new[] { typeof(WixToolset.Core.Burn.WixToolsetStandardBackend), typeof(WixToolset.Core.WindowsInstaller.WixToolsetStandardBackend) }) + { + extensionManager.Add(type.Assembly); + } + + foreach (var extension in extensions) + { + extensionManager.Load(extension); + } + + return extensionManager; + } + + private class ConsoleMessageListener : IMessageListener + { + public ConsoleMessageListener(string shortName, string longName) + { + this.ShortAppName = shortName; + this.LongAppName = longName; + + PrepareConsoleForLocalization(); + } + + public string LongAppName { get; } + + public string ShortAppName { get; } + + public void Write(Message message) + { + var filename = message.SourceLineNumbers?.FileName ?? this.LongAppName; + var line = message.SourceLineNumbers?.LineNumber ?? -1; + var type = message.Level.ToString().ToLowerInvariant(); + var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; + + if (line > 0) + { + filename = String.Concat(filename, "(", line, ")"); + } + + output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.ShortAppName, message.Id, message.ToString()); + } + + public void Write(string message) + { + Console.Out.WriteLine(message); + } + + private static void PrepareConsoleForLocalization() + { + Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); + + if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) + { + Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); + } + } + } + } +} diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj new file mode 100644 index 00000000..fbb8a0f5 --- /dev/null +++ b/src/wix/wix.csproj @@ -0,0 +1,34 @@ + + + + + + netcoreapp2.1 + Exe + Compiler + WiX Toolset Compiler + embedded + true + + + + + NU1701 + + + + + + + + + + + + + + + + + + diff --git a/version.json b/version.json new file mode 100644 index 00000000..eaeb2c79 --- /dev/null +++ b/version.json @@ -0,0 +1,11 @@ +{ + "version": "4.0.0-build.{height}", + "publicReleaseRefSpec": [ + "^refs/heads/master$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +} -- cgit v1.2.3-55-g6feb From 54225eca5faab731a209303f56c0149492852167 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 23 Jul 2018 14:42:38 -0700 Subject: Integrate Extensibility.Data namespace change --- src/WixToolset.BuildTasks/DoIt.cs | 12 +++++------- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 4 ++-- .../WixToolsetTest.BuildTasks.csproj | 8 ++++---- src/wix/Program.cs | 12 +++++------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 02b33522..33842e44 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -10,6 +10,7 @@ namespace WixToolset.BuildTasks using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; /// @@ -168,13 +169,10 @@ namespace WixToolset.BuildTasks var arguments = serviceProvider.GetService(); arguments.Populate(commandLineString); - var context = serviceProvider.GetService(); - context.Messaging = messaging; - context.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); - context.Arguments = arguments; - - var commandLine = serviceProvider.GetService(); - var command = commandLine.ParseStandardCommandLine(context); + var commandLine = serviceProvider.GetService(); + commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); + commandLine.Arguments = arguments; + var command = commandLine.ParseStandardCommandLine(); command?.Execute(); } diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index ec16f8b1..8a5c388d 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -40,12 +40,12 @@ - + - + diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 5ec5b7fd..99da83cd 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -7,7 +7,7 @@ false embedded - + @@ -25,8 +25,8 @@ - - - + + + diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 134900e9..2a092ffc 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -9,6 +9,7 @@ namespace WixToolset.Tools using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; /// @@ -46,13 +47,10 @@ namespace WixToolset.Tools var arguments = serviceProvider.GetService(); arguments.Populate(args); - var context = serviceProvider.GetService(); - context.Messaging = messaging; - context.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); - context.Arguments = arguments; - - var commandLine = serviceProvider.GetService(); - var command = commandLine.ParseStandardCommandLine(context); + var commandLine = serviceProvider.GetService(); + commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); + commandLine.Arguments = arguments; + var command = commandLine.ParseStandardCommandLine(); return command?.Execute() ?? 1; } -- cgit v1.2.3-55-g6feb From 63ebed98f610c9f6ae722d6a12678593c262ba3e Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 27 Jul 2018 11:41:55 -0700 Subject: WIP: wix.targets cleanup --- src/WixToolset.BuildTasks/wix.targets | 248 +++------------------------------- 1 file changed, 19 insertions(+), 229 deletions(-) diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets index c9704094..2edd44c4 100644 --- a/src/WixToolset.BuildTasks/wix.targets +++ b/src/WixToolset.BuildTasks/wix.targets @@ -1,7 +1,6 @@ - true @@ -120,11 +119,6 @@ - - - true - - $(MSBuildProjectFile).BindContentsFileList.txt $(MSBuildProjectFile).BindOutputsFileList.txt @@ -284,8 +278,7 @@ PreBuildEvent; ResolveReferences; - - DoIt; + WixBuild; Signing; GetTargetPath; @@ -598,43 +591,43 @@ - - PrepareForBuild; + ResolveReferences; - BeforeCompile; - _TimeStampBeforeCompile; - Harvest; + BeforeWixBuild; + _TimeStampBeforeWixBuild; CalculateDefineConstants; + Harvest; + GenerateCompileWithObjectPath; AssignCultures; ReadPreviousBindInputsAndBuiltOutputs; - ActuallyDoIt; + CoreWixBuild; UpdateLinkFileWrites; - _TimeStampAfterCompile; - AfterCompile - + _TimeStampAfterWixBuild; + AfterWixBuild + + Name="WixBuild" + DependsOnTargets="$(WixBuildDependsOn)" /> + - - - - - - - - - ResolveReferences; - BeforeCompile; - _TimeStampBeforeCompile; - Harvest; - Compile; - Lib; - Link; - UpdateLinkFileWrites; - _TimeStampAfterCompile; - AfterCompile - - - - - - PrepareForBuild; - ResolveReferences; - CalculateDefineConstants; - GenerateCompileWithObjectPath - - - - - - - - - - - - - - - PrepareForBuild; - ResolveReferences; - AssignCultures; - ReadPreviousBindInputsAndBuiltOutputs; - - - - - - $(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName) - - - - - - - - - - @@ -782,63 +778,6 @@ - - - - PrepareForBuild; - ResolveReferences - - - - - - - - - - - $(MSBuildThisFileFullPath) - $(WixTargetsPath)WixTasks.dll - - $(MSBuildProjectFile).Signed.txt + $(MSBuildProjectFile).Signed.txt + $(IntermediateOutputPath)$(SignedFileName) + + @@ -51,49 +48,57 @@ - CompileAndLink; + WixBuild; + CalculateSignTargetFiles; BeforeSigning; $(InternalSignDependsOn); AfterSigning + Name="Signing" + DependsOnTargets="$(SigningDependsOn)" + Inputs="$(TargetPath)" + Outputs="$(SignedFilePath)" + Condition=" '$(SignOutput)' == 'true' "> - - - + + + + File="$(SignedFilePath)" + Lines="^$(MSBuildProjectFullPath);@(SignMsm);@(SignCabs);@(SignMsi);@(SignContainers);@(SignBundleEngine);@(SignBundle)" + Overwrite="true" /> + + + + + + - - - - + Outputs="$(SignedFilePath)"> + + + + + Name="InternalSignMsm" + DependsOnTargets="SignMsm" + Condition=" '@(SignMsm)' != '' " /> + Outputs="$(SignedFilePath)"> @@ -101,14 +106,14 @@ + Name="InternalSignCabs" + DependsOnTargets="SignCabs" + Condition=" '@(SignCabs)' != '' " /> + Outputs="$(SignedFilePath)"> @@ -116,33 +121,33 @@ + Name="InternalSignMsi" + DependsOnTargets="SignMsi" + Inputs="@(SignTargetPath)" + Outputs="$(SignedFilePath)" + Condition=" '@(SignMsi)' != '' " /> + Outputs="$(SignedFilePath)"> + Name="InternalSignContainers" + DependsOnTargets="SignContainers" + Condition=" '@(SignContainers)' != '' " /> + Name="InternalSignBundleEngine" + DependsOnTargets="SignBundleEngine" + Condition=" '@(SignBundleEngine)' != '' " /> + Name="InternalSignBundle" + DependsOnTargets="SignBundle" + Condition=" '@(SignBundle)' != '' " /> - PrepareForBuild; - ResolveWixExtensionReferences; - CompileAndLink; - InternalSignCabs - PrepareForBuild; - ResolveWixExtensionReferences; - CompileAndLink; - InternalSignContainers + Outputs="$(SignedFilePath)"> - - - - - + + + + - PrepareForBuild; - ResolveWixExtensionReferences; - CompileAndLink; - InternalSignBundleEngine + Outputs="$(SignedFilePath)"> .wxs wix - Managed + wix $(MSBuildProjectName) $(OutputName) - - <_OriginalOutputType>$(OutputType) + Package @@ -70,28 +69,24 @@ .pcp .wixlib .exe + .wixipl - - - <_DebugSymbolsIntermediatePath Include="$(PdbOutputDir)$(TargetPdbName)" Condition=" '@(_DebugSymbolsIntermediatePath)' == '' " /> - - - $(IntermediateOutputPath) - $(PdbOutputDir)\ + $(TargetDir) + $(PdbOutputDir)\ $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) - $(TargetName).wixpdb + $(TargetName).wixpdb - $(TargetPdbDir)$(TargetPdbName) + $(TargetPdbDir)$(TargetPdbFileName) - - - - <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. - <_OutputTypeDescription>The OutputType defines whether a Windows Installer package (.msi), PatchCreation (.pcp), merge module (.msm), wix library (.wixlib), or self-extracting executable (.exe) is being built. $(_PleaseSetThisInProjectFile) Possible values are 'Package', 'Module', 'Library', and 'Bundle'. + <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) - - @@ -272,7 +252,6 @@ BuildOnlySettings; PrepareForBuild; PreBuildEvent; - ResolveReferences; WixBuild; Signing; @@ -580,7 +559,7 @@ ================================================================================================ --> - AssignCultures + AssignTargetPaths @@ -600,22 +579,22 @@ ResolveReferences; - BeforeWixBuild; - _TimeStampBeforeWixBuild; + BeforeCompile; + _TimeStampBeforeCompile; CalculateDefineConstants; Harvest; GenerateCompileWithObjectPath; - AssignCultures; + AssignTargetPaths; ReadPreviousBindInputsAndBuiltOutputs; CoreWixBuild; UpdateLinkFileWrites; - _TimeStampAfterWixBuild; - AfterWixBuild + _TimeStampAfterCompile; + AfterCompile + Name="CoreWixBuild" + Inputs="@(Compile); + @(Content); + @(EmbeddedResource); + @(WixObject); + @(_ResolvedProjectReferencePaths); + @(_ResolvedWixLibraryPaths); + @(_ResolvedWixExtensionPaths); + @(_BindInputs); + $(MSBuildAllProjects)" + Outputs="$(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(BindBuiltOutputsFile);@(_BindBuiltOutputs)" + Condition=" '@(Compile)' != '' "> - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt))) - $(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName) + + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) + + $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) - - + - + - <_TargetPathItems Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetName)$(TargetExt)" /> - <_TargetPdbPathItems Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbName)" /> + <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> + <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> - - @(_TargetPathItems) - @(_TargetPdbPathItems) + @(_CulturedTargetPath) + @(_CulturedTargetPdbPath) - - - - - - PrepareForBuild;AssignCultures + PrepareForBuild;AssignTargetPaths - + @@ -993,14 +963,14 @@ ================================================================================================== --> - AssignCultures + AssignTargetPaths - + @@ -1029,7 +999,7 @@ - + diff --git a/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs b/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs deleted file mode 100644 index 8fd69414..00000000 --- a/src/test/WixToolsetTest.BuildTasks/FakeBuildEngine.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.BuildTasks -{ - using System.Collections; - using System.Text; - using Microsoft.Build.Framework; - - internal class FakeBuildEngine : IBuildEngine - { - private StringBuilder output = new StringBuilder(); - - public int ColumnNumberOfTaskNode => 0; - - public bool ContinueOnError => false; - - public int LineNumberOfTaskNode => 0; - - public string ProjectFileOfTaskNode => "fake_wix.targets"; - - public string Output => this.output.ToString(); - - public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) => throw new System.NotImplementedException(); - - public void LogCustomEvent(CustomBuildEventArgs e) => this.output.AppendLine(e.Message); - - public void LogErrorEvent(BuildErrorEventArgs e) => this.output.AppendLine(e.Message); - - public void LogMessageEvent(BuildMessageEventArgs e) => this.output.AppendLine(e.Message); - - public void LogWarningEvent(BuildWarningEventArgs e) => this.output.AppendLine(e.Message); - } -} diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index a27928d5..95b727ad 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -2,62 +2,103 @@ namespace WixToolsetTest.BuildTasks { + using System; using System.IO; using System.Linq; - using Microsoft.Build.Utilities; using WixBuildTools.TestSupport; using WixToolset.BuildTasks; - using WixToolset.Data; - using WixToolset.Data.Tuples; using Xunit; - public partial class MsbuildFixture + public class MsbuildFixture { + private static readonly string WixTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(DoIt).Assembly.CodeBase).AbsolutePath), "wix.targets"); + + public MsbuildFixture() + { + this.MsbuildRunner = new MsbuildRunner(); + } + + private MsbuildRunner MsbuildRunner { get; } + [Fact] public void CanBuildSimpleMsiPackage() { - var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); using (var fs = new DisposableFileSystem()) { var baseFolder = fs.GetFolder(); - var intermediateFolder = Path.Combine(baseFolder, "obj"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var engine = new FakeBuildEngine(); + var result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}" + }); + result.AssertSuccess(); - var task = new DoIt + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] { - BuildEngine = engine, - SourceFiles = new[] - { - new TaskItem(Path.Combine(folder, "Package.wxs")), - new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), - }, - LocalizationFiles = new[] - { - new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), - }, - BindInputPaths = new[] - { - new TaskItem(Path.Combine(folder, "data")), - }, - IntermediateDirectory = new TaskItem(intermediateFolder), - OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), - }; - - var result = task.Execute(); - Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}"); - - Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); - Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); - Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); - - var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wir")); - var section = intermediate.Sections.Single(); - - var wixFile = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); + @"bin\en-US\cab1.cab", + @"bin\en-US\MsiPackage.msi", + @"bin\en-US\MsiPackage.wixpdb", + }, paths); + } + } + + [Fact] + public void CanBuildAndCleanSimpleMsiPackage() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + // Build + var result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-v:diag" + }); + result.AssertSuccess(); + + var buildOutput = String.Join("\r\n", result.Output); + + var createdPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.NotEmpty(createdPaths); + + // Clean + result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-t:Clean", + "-v:diag" + }); + result.AssertSuccess(); + + var cleanOutput = String.Join("\r\n", result.Output); + + var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Empty(remainingPaths); } } } diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj index 31c3ec9c..d5cac8d8 100644 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj @@ -1,18 +1,12 @@ - + Debug x86 - 0.9 - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - MsiPackage - Package - MsiPackage - MsiPackage - ..\..\..\..\..\..\build\Release\publish\wix.targets + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba @@ -48,8 +42,8 @@ - + - + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs new file mode 100644 index 00000000..c4a69cdd --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -0,0 +1,64 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.BuildTasks +{ + using System.IO; + using System.Linq; + using Microsoft.Build.Utilities; + using WixBuildTools.TestSupport; + using WixToolset.BuildTasks; + using WixToolset.Data; + using WixToolset.Data.Tuples; + using Xunit; + + public class WixBuildTaskFixture + { + [Fact] + public void CanBuildSimpleMsiPackage() + { + var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + + var engine = new FakeBuildEngine(); + + var task = new DoIt + { + BuildEngine = engine, + SourceFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.wxs")), + new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), + }, + LocalizationFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), + }, + BindInputPaths = new[] + { + new TaskItem(Path.Combine(folder, "data")), + }, + IntermediateDirectory = new TaskItem(intermediateFolder), + OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), + }; + + var result = task.Execute(); + Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}"); + + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); + + var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); + var section = intermediate.Sections.Single(); + + var wixFile = section.Tuples.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); + } + } + } +} diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 99da83cd..edab8a67 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -9,6 +9,7 @@ + -- cgit v1.2.3-55-g6feb From ce9ac1ddffd46daabc61ff4ba0069af576865bd1 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 22 Aug 2018 14:21:31 -0400 Subject: Log details when extension assembly types can't be loaded. --- src/WixToolset.BuildTasks/DoIt.cs | 15 ++++++++++++--- src/wix/Program.cs | 15 ++++++++++++--- src/wix/wix.csproj | 2 +- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 33842e44..01938ed6 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -4,6 +4,8 @@ namespace WixToolset.BuildTasks { using System; using System.Collections.Generic; + using System.Linq; + using System.Reflection; using System.Runtime.InteropServices; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -170,13 +172,13 @@ namespace WixToolset.BuildTasks arguments.Populate(commandLineString); var commandLine = serviceProvider.GetService(); - commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); + commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); commandLine.Arguments = arguments; var command = commandLine.ParseStandardCommandLine(); command?.Execute(); } - private IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, string[] extensions) + private IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, IMessaging messaging, string[] extensions) { var extensionManager = serviceProvider.GetService(); @@ -187,7 +189,14 @@ namespace WixToolset.BuildTasks foreach (var extension in extensions) { - extensionManager.Load(extension); + try + { + extensionManager.Load(extension); + } + catch (ReflectionTypeLoadException e) + { + messaging.Write(ErrorMessages.InvalidExtension(extension, String.Join(Environment.NewLine, e.LoaderExceptions.Select(le => le.ToString())))); + } } return extensionManager; diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 2a092ffc..a95851ee 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -4,6 +4,8 @@ namespace WixToolset.Tools { using System; using System.Globalization; + using System.Linq; + using System.Reflection; using System.Text; using System.Threading; using WixToolset.Core; @@ -48,13 +50,13 @@ namespace WixToolset.Tools arguments.Populate(args); var commandLine = serviceProvider.GetService(); - commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, arguments.Extensions); + commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); commandLine.Arguments = arguments; var command = commandLine.ParseStandardCommandLine(); return command?.Execute() ?? 1; } - private static IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, string[] extensions) + private static IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, IMessaging messaging, string[] extensions) { var extensionManager = serviceProvider.GetService(); @@ -65,7 +67,14 @@ namespace WixToolset.Tools foreach (var extension in extensions) { - extensionManager.Load(extension); + try + { + extensionManager.Load(extension); + } + catch (ReflectionTypeLoadException e) + { + messaging.Write(ErrorMessages.InvalidExtension(extension, String.Join(Environment.NewLine, e.LoaderExceptions.Select(le => le.ToString())))); + } } return extensionManager; diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index fbb8a0f5..6ec22ec0 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -3,7 +3,7 @@ - netcoreapp2.1 + net461;netcoreapp2.1 Exe Compiler WiX Toolset Compiler -- cgit v1.2.3-55-g6feb From 05d08282f620bd0813b867e4ce28d474f91adb8e Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 23 Aug 2018 18:29:26 -0400 Subject: Requesting build with new version number, please. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 31f384f1629da03582dcfd8248ab435959cd1e0d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 23 Aug 2018 20:16:48 -0400 Subject: Requesting build with new version number, please. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 8a20ec988b05b9fe6312bf3d39098a00c6b46ef1 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 28 Aug 2018 17:14:27 -0400 Subject: Support warning suppression. --- src/WixToolset.BuildTasks/DoIt.cs | 1 + .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 30 +++++++++++++++++++++- .../SimpleMsiPackage/MsiPackage/Package.wxs | 4 +++ .../MsiPackage/PackageComponents.wxs | 2 +- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 01938ed6..0c8d261c 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -145,6 +145,7 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); + commandLineBuilder.AppendArrayIfNotNull("-sw ", this.SuppressSpecificWarnings); commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 95b727ad..119c3ba5 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -31,7 +31,7 @@ namespace WixToolsetTest.BuildTasks var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var result = this.MsbuildRunner.Execute(projectPath, new[] + var result = this.MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", @@ -39,6 +39,9 @@ namespace WixToolsetTest.BuildTasks }); result.AssertSuccess(); + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Equal(4, warnings.Count()); + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) .Select(s => s.Substring(baseFolder.Length + 1)) .OrderBy(s => s) @@ -52,6 +55,31 @@ namespace WixToolsetTest.BuildTasks } } + [Fact] + public void CanBuildSimpleMsiPackageWithWarningSuppressions() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-p:SuppressSpecificWarnings=\"1118;1102\"" + }); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + } + } + [Fact] public void CanBuildAndCleanSimpleMsiPackage() { diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs index d5a5a40d..a02b766a 100644 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -1,4 +1,8 @@ + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs index e26c4509..ddb95faf 100644 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs @@ -3,7 +3,7 @@ - + -- cgit v1.2.3-55-g6feb From 75c33403c482d0670dd7b9ca425d34a153e40d89 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 3 Sep 2018 18:31:46 -0400 Subject: Update test now that Core now ignores equal variable redefinitions. Depends on https://github.com/wixtoolset/Core/pull/2 --- .../TestData/SimpleMsiPackage/MsiPackage/Package.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs index a02b766a..f7998fff 100644 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -1,7 +1,7 @@ - + -- cgit v1.2.3-55-g6feb From 9174c74948e8b7e20816af791aec06033f2c1738 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 6 Sep 2018 20:38:13 -0400 Subject: Add .wixipl output MSBuild test. --- .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 119c3ba5..96f39318 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -80,6 +80,33 @@ namespace WixToolsetTest.BuildTasks } } + [Fact] + public void CanBuildSimpleMsiPackageAsWixipl() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-p:OutputType=IntermediatePostLink" + }); + result.AssertSuccess(); + + var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .Single(); + Assert.Equal(@"bin\MsiPackage.wixipl", path); + } + } + [Fact] public void CanBuildAndCleanSimpleMsiPackage() { -- cgit v1.2.3-55-g6feb From 244b46cf7f3252d6dc3884ce184be901d1d173e5 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 2 Sep 2018 16:12:29 -0500 Subject: Migrate WixCop into Tools from wix4. --- Tools.sln | 18 + src/WixToolset.BuildTasks/Common.cs | 41 -- src/WixToolset.BuildTasks/ConvertReferences.cs | 7 +- .../RefreshBundleGeneratedFile.cs | 9 +- src/WixToolset.BuildTasks/RefreshGeneratedFile.cs | 9 +- .../WixToolset.BuildTasks.csproj | 4 + .../ConsoleMessageListener.cs | 56 ++ .../WixToolset.Tools.Core.csproj | 28 + src/Wixtoolset.Tools.Core/ToolsCommon.cs | 39 ++ src/test/wixcop/ConverterFixture.cs | 418 ++++++++++++++ .../TestData/SingleFile/ConvertedSingleFile.wxs | 60 ++ src/test/wixcop/TestData/SingleFile/SingleFile.wxs | 61 ++ src/test/wixcop/WixCopFixture.cs | 107 ++++ src/test/wixcop/WixCopTests.csproj | 41 ++ src/wix/Program.cs | 48 +- src/wix/wix.csproj | 4 + src/wixcop/CommandLine/ConvertCommand.cs | 212 +++++++ src/wixcop/CommandLine/HelpCommand.cs | 25 + src/wixcop/CommandLine/WixCopCommandLineParser.cs | 132 +++++ src/wixcop/Converter.cs | 633 +++++++++++++++++++++ src/wixcop/Interfaces/IWixCopCommandLineParser.cs | 11 + src/wixcop/Program.cs | 67 +++ src/wixcop/WixCop.csproj | 32 ++ 23 files changed, 1957 insertions(+), 105 deletions(-) delete mode 100644 src/WixToolset.BuildTasks/Common.cs create mode 100644 src/WixToolset.Tools.Core/ConsoleMessageListener.cs create mode 100644 src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj create mode 100644 src/Wixtoolset.Tools.Core/ToolsCommon.cs create mode 100644 src/test/wixcop/ConverterFixture.cs create mode 100644 src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs create mode 100644 src/test/wixcop/TestData/SingleFile/SingleFile.wxs create mode 100644 src/test/wixcop/WixCopFixture.cs create mode 100644 src/test/wixcop/WixCopTests.csproj create mode 100644 src/wixcop/CommandLine/ConvertCommand.cs create mode 100644 src/wixcop/CommandLine/HelpCommand.cs create mode 100644 src/wixcop/CommandLine/WixCopCommandLineParser.cs create mode 100644 src/wixcop/Converter.cs create mode 100644 src/wixcop/Interfaces/IWixCopCommandLineParser.cs create mode 100644 src/wixcop/Program.cs create mode 100644 src/wixcop/WixCop.csproj diff --git a/Tools.sln b/Tools.sln index 63c7ea4e..ca2e23d6 100644 --- a/Tools.sln +++ b/Tools.sln @@ -18,6 +18,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixCop", "src\wixcop\WixCop.csproj", "{2E54120B-8958-40B1-A7FC-851446994CD8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Tools.Core", "src\WixToolset.Tools.Core\WixToolset.Tools.Core.csproj", "{9C3B486F-AE0E-43BA-823A-30808B73C6B4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixCopTests", "src\test\wixcop\WixCopTests.csproj", "{F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -44,6 +50,18 @@ Global {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.Build.0 = Debug|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.Build.0 = Release|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|Any CPU.Build.0 = Release|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Release|Any CPU.Build.0 = Release|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/WixToolset.BuildTasks/Common.cs b/src/WixToolset.BuildTasks/Common.cs deleted file mode 100644 index 803e9d14..00000000 --- a/src/WixToolset.BuildTasks/Common.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset -{ - using System; - using System.Globalization; - using System.Text; - using System.Text.RegularExpressions; - - /// - /// Common WixTasks utility methods and types. - /// - internal static class Common - { - /// Metadata key name to turn off harvesting of project references. - public const string DoNotHarvest = "DoNotHarvest"; - - private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); - private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters - - /// - /// Return an identifier based on passed file/directory name - /// - /// File/directory name to generate identifer from - /// A version of the name that is a legal identifier. - /// This is duplicated from WiX's Common class. - internal static string GetIdentifierFromName(string name) - { - string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". - - // MSI identifiers must begin with an alphabetic character or an - // underscore. Prefix all other values with an underscore. - if (AddPrefix.IsMatch(name)) - { - result = String.Concat("_", result); - } - - return result; - } - } -} diff --git a/src/WixToolset.BuildTasks/ConvertReferences.cs b/src/WixToolset.BuildTasks/ConvertReferences.cs index fe137633..ef50c918 100644 --- a/src/WixToolset.BuildTasks/ConvertReferences.cs +++ b/src/WixToolset.BuildTasks/ConvertReferences.cs @@ -3,13 +3,10 @@ namespace WixToolset.BuildTasks { using System; - using System.Collections; using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Xml; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; + using WixToolset.Tools.Core; /// /// This task assigns Culture metadata to files based on the value of the Culture attribute on the @@ -62,7 +59,7 @@ namespace WixToolset.BuildTasks { Dictionary newItemMetadeta = new Dictionary(); - if (!String.IsNullOrEmpty(item.GetMetadata(Common.DoNotHarvest))) + if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) { continue; } diff --git a/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs b/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs index 5445e0cd..80305f59 100644 --- a/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs +++ b/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs @@ -6,19 +6,16 @@ namespace WixToolset.BuildTasks using System.Collections; using System.Globalization; using System.IO; - using System.Text.RegularExpressions; using System.Xml; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; + using WixToolset.Tools.Core; /// /// This task refreshes the generated file for bundle projects. /// public class RefreshBundleGeneratedFile : Task { - private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); - private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters - private ITaskItem[] generatedFiles; private ITaskItem[] projectReferencePaths; @@ -54,14 +51,14 @@ namespace WixToolset.BuildTasks { ITaskItem item = this.ProjectReferencePaths[i]; - if (!String.IsNullOrEmpty(item.GetMetadata(Common.DoNotHarvest))) + if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) { continue; } string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); string projectName = Path.GetFileNameWithoutExtension(projectPath); - string referenceName = Common.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); + string referenceName = ToolsCommon.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); foreach (string pog in pogs) diff --git a/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs b/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs index fdfc4774..101b5363 100644 --- a/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs +++ b/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs @@ -6,10 +6,10 @@ namespace WixToolset.BuildTasks using System.Collections; using System.Globalization; using System.IO; - using System.Text.RegularExpressions; using System.Xml; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; + using WixToolset.Tools.Core; /// /// This task refreshes the generated file that contains ComponentGroupRefs @@ -17,9 +17,6 @@ namespace WixToolset.BuildTasks /// public class RefreshGeneratedFile : Task { - private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); - private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters - private ITaskItem[] generatedFiles; private ITaskItem[] projectReferencePaths; @@ -54,14 +51,14 @@ namespace WixToolset.BuildTasks { ITaskItem item = this.ProjectReferencePaths[i]; - if (!String.IsNullOrEmpty(item.GetMetadata(Common.DoNotHarvest))) + if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) { continue; } string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); string projectName = Path.GetFileNameWithoutExtension(projectPath); - string referenceName = Common.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); + string referenceName = ToolsCommon.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); foreach (string pog in pogs) diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 8a5c388d..39c8824c 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -27,6 +27,10 @@ + + + + diff --git a/src/WixToolset.Tools.Core/ConsoleMessageListener.cs b/src/WixToolset.Tools.Core/ConsoleMessageListener.cs new file mode 100644 index 00000000..5b1fb988 --- /dev/null +++ b/src/WixToolset.Tools.Core/ConsoleMessageListener.cs @@ -0,0 +1,56 @@ +using System; +using System.Globalization; +using System.Text; +using System.Threading; +using WixToolset.Data; +using WixToolset.Extensibility; + +namespace WixToolset.Tools.Core +{ + public sealed class ConsoleMessageListener : IMessageListener + { + public ConsoleMessageListener(string shortName, string longName) + { + this.ShortAppName = shortName; + this.LongAppName = longName; + + PrepareConsoleForLocalization(); + } + + public string LongAppName { get; } + + public string ShortAppName { get; } + + public void Write(Message message) + { + var filename = message.SourceLineNumbers?.FileName ?? this.LongAppName; + var line = message.SourceLineNumbers?.LineNumber ?? -1; + var type = message.Level.ToString().ToLowerInvariant(); + var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; + + if (line > 0) + { + filename = String.Concat(filename, "(", line, ")"); + } + + output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.ShortAppName, message.Id, message.ToString()); + } + + public void Write(string message) + { + Console.Out.WriteLine(message); + } + + private static void PrepareConsoleForLocalization() + { + Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); + + if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) + { + Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); + } + } + } +} diff --git a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj new file mode 100644 index 00000000..8be70e6b --- /dev/null +++ b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj @@ -0,0 +1,28 @@ + + + + + + netstandard2.0 + Tools Core + WiX Toolset Tools Core + embedded + true + + + + + + + + + + + + + + + + + + diff --git a/src/Wixtoolset.Tools.Core/ToolsCommon.cs b/src/Wixtoolset.Tools.Core/ToolsCommon.cs new file mode 100644 index 00000000..37d89f3c --- /dev/null +++ b/src/Wixtoolset.Tools.Core/ToolsCommon.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools.Core +{ + using System; + using System.Text.RegularExpressions; + + /// + /// Common WixTasks utility methods and types. + /// + public static class ToolsCommon + { + /// Metadata key name to turn off harvesting of project references. + public const string DoNotHarvest = "DoNotHarvest"; + + private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); + private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters + + /// + /// Return an identifier based on passed file/directory name + /// + /// File/directory name to generate identifer from + /// A version of the name that is a legal identifier. + /// This is duplicated from WiX's Common class. + public static string GetIdentifierFromName(string name) + { + string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". + + // MSI identifiers must begin with an alphabetic character or an + // underscore. Prefix all other values with an underscore. + if (AddPrefix.IsMatch(name)) + { + result = String.Concat("_", result); + } + + return result; + } + } +} diff --git a/src/test/wixcop/ConverterFixture.cs b/src/test/wixcop/ConverterFixture.cs new file mode 100644 index 00000000..45ccc33e --- /dev/null +++ b/src/test/wixcop/ConverterFixture.cs @@ -0,0 +1,418 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixTest.WixUnitTest +{ + using System; + using System.IO; + using System.Text; + using System.Xml.Linq; + using WixCop; + using WixToolset; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + using Xunit; + + public class ConverterFixture + { + private static readonly XNamespace Wix4Namespace = "http://wixtoolset.org/schemas/v4/wxs"; + + [Fact] + public void EnsuresDeclaration() + { + string parse = String.Join(Environment.NewLine, + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void EnsuresUtf8Declaration() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 4, null, null); + + int errors = converter.ConvertDocument(document); + + Assert.Equal(1, errors); + Assert.Equal("1.0", document.Declaration.Version); + Assert.Equal("utf-8", document.Declaration.Encoding); + } + + [Fact] + public void CanFixWhitespace() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 4, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(4, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanFixCdataWhitespace() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + " ", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(2, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertMainNamespace() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + //Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertNamedMainNamespace() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); + } + + [Fact] + public void CanConvertNonWixDefaultNamespace() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(2, errors); + Assert.Equal(expected, actual); + Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); + Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace()); + } + + [Fact] + public void CanConvertExtensionNamespace() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(2, errors); + Assert.Equal(expected, actual); + Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); + } + + [Fact] + public void CanConvertMissingNamespace() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); + } + + [Fact] + public void CanConvertAnonymousFile() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertSuppressSignatureValidationNo() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertSuppressSignatureValidationYes() + { + string parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + string expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + Converter converter = new Converter(messaging, 2, null, null); + + int errors = converter.ConvertDocument(document); + + string actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + private static string UnformattedDocumentString(XDocument document) + { + StringBuilder sb = new StringBuilder(); + + using (StringWriter writer = new StringWriter(sb)) + { + document.Save(writer, SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces); + } + + return sb.ToString(); + } + + private class DummyMessaging : IMessaging + { + public bool EncounteredError { get; set; } + + public int LastErrorNumber { get; set; } + + public bool ShowVerboseMessages { get; set; } + public bool SuppressAllWarnings { get; set; } + public bool WarningsAsError { get; set; } + + public void ElevateWarningMessage(int warningNumber) + { + } + + public string FormatMessage(Message message) + { + return ""; + } + + public void SetListener(IMessageListener listener) + { + } + + public void SuppressWarningMessage(int warningNumber) + { + } + + public void Write(Message message) + { + } + + public void Write(string message, bool verbose = false) + { + } + } + } +} diff --git a/src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs b/src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs new file mode 100644 index 00000000..aacb68fa --- /dev/null +++ b/src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/wixcop/TestData/SingleFile/SingleFile.wxs b/src/test/wixcop/TestData/SingleFile/SingleFile.wxs new file mode 100644 index 00000000..310ae811 --- /dev/null +++ b/src/test/wixcop/TestData/SingleFile/SingleFile.wxs @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/wixcop/WixCopFixture.cs b/src/test/wixcop/WixCopFixture.cs new file mode 100644 index 00000000..12863959 --- /dev/null +++ b/src/test/wixcop/WixCopFixture.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using WixBuildTools.TestSupport; +using WixCop.CommandLine; +using WixCop.Interfaces; +using WixToolset.Core; +using WixToolset.Core.TestPackage; +using WixToolset.Extensibility; +using WixToolset.Extensibility.Services; +using Xunit; + +namespace WixCopTests +{ + public class WixCopFixture + { + [Fact] + public void CanConvertSingleFile() + { + const string beforeFileName = "SingleFile.wxs"; + const string afterFileName = "ConvertedSingleFile.wxs"; + var folder = TestData.Get(@"TestData\SingleFile"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(true); + var targetFile = Path.Combine(baseFolder, beforeFileName); + File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); + + var runner = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result = runner.Execute(out var messages); + + Assert.Equal(2, result); + + var actualLines = File.ReadAllLines(targetFile); + var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); + Assert.Equal(expectedLines, actualLines); + + var runner2 = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result2 = runner2.Execute(out var messages2); + + Assert.Equal(0, result2); + } + } + + private class WixCopRunner + { + public bool FixErrors { get; set; } + + public List SearchPatterns { get; } = new List(); + + public int Execute(out List messages) + { + var argList = new List(); + if (this.FixErrors) + { + argList.Add("-f"); + } + + foreach (string searchPattern in this.SearchPatterns) + { + argList.Add(searchPattern); + } + + return WixCopRunner.Execute(argList.ToArray(), out messages); + } + + public static int Execute(string[] args, out List messages) + { + var listener = new TestMessageListener(); + + var serviceProvider = new WixToolsetServiceProvider(); + serviceProvider.AddService((x, y) => listener); + serviceProvider.AddService((x, y) => new WixCopCommandLineParser(x)); + + var result = Execute(serviceProvider, args); + + var messaging = serviceProvider.GetService(); + messages = listener.Messages.Select(x => messaging.FormatMessage(x)).ToList(); + return result; + } + + public static int Execute(IServiceProvider serviceProvider, string[] args) + { + var wixcop = new WixCop.Program(); + return wixcop.Run(serviceProvider, args); + } + } + } +} diff --git a/src/test/wixcop/WixCopTests.csproj b/src/test/wixcop/WixCopTests.csproj new file mode 100644 index 00000000..0ae50dc8 --- /dev/null +++ b/src/test/wixcop/WixCopTests.csproj @@ -0,0 +1,41 @@ + + + + + + net461 + false + embedded + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/Program.cs b/src/wix/Program.cs index a95851ee..b0e3bb73 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -13,6 +13,7 @@ namespace WixToolset.Tools using WixToolset.Extensibility; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; + using WixToolset.Tools.Core; /// /// Wix Toolset Command-Line Interface. @@ -79,52 +80,5 @@ namespace WixToolset.Tools return extensionManager; } - - private class ConsoleMessageListener : IMessageListener - { - public ConsoleMessageListener(string shortName, string longName) - { - this.ShortAppName = shortName; - this.LongAppName = longName; - - PrepareConsoleForLocalization(); - } - - public string LongAppName { get; } - - public string ShortAppName { get; } - - public void Write(Message message) - { - var filename = message.SourceLineNumbers?.FileName ?? this.LongAppName; - var line = message.SourceLineNumbers?.LineNumber ?? -1; - var type = message.Level.ToString().ToLowerInvariant(); - var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; - - if (line > 0) - { - filename = String.Concat(filename, "(", line, ")"); - } - - output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.ShortAppName, message.Id, message.ToString()); - } - - public void Write(string message) - { - Console.Out.WriteLine(message); - } - - private static void PrepareConsoleForLocalization() - { - Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); - - if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && - Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && - Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) - { - Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); - } - } - } } } diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 6ec22ec0..2cbcdf3a 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -16,6 +16,10 @@ NU1701 + + + + diff --git a/src/wixcop/CommandLine/ConvertCommand.cs b/src/wixcop/CommandLine/ConvertCommand.cs new file mode 100644 index 00000000..6af7d4ca --- /dev/null +++ b/src/wixcop/CommandLine/ConvertCommand.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Xml; +using WixToolset.Extensibility.Data; +using WixToolset.Extensibility.Services; + +namespace WixCop.CommandLine +{ + internal class ConvertCommand : ICommandLineCommand + { + private const string SettingsFileDefault = "wixcop.settings.xml"; + + public ConvertCommand(IServiceProvider serviceProvider, bool fixErrors, int indentationAmount, List searchPatterns, bool subDirectories, string settingsFile1, string settingsFile2) + { + this.ErrorsAsWarnings = new HashSet(); + this.ExemptFiles = new HashSet(); + this.FixErrors = fixErrors; + this.IndentationAmount = indentationAmount; + this.IgnoreErrors = new HashSet(); + this.SearchPatternResults = new HashSet(); + this.SearchPatterns = searchPatterns; + this.ServiceProvider = serviceProvider; + this.SettingsFile1 = settingsFile1; + this.SettingsFile2 = settingsFile2; + this.SubDirectories = subDirectories; + } + + private HashSet ErrorsAsWarnings { get; } + + private HashSet ExemptFiles { get; } + + private bool FixErrors { get; } + + private int IndentationAmount { get; } + + private HashSet IgnoreErrors { get; } + + private HashSet SearchPatternResults { get; } + + private List SearchPatterns { get; } + + private IServiceProvider ServiceProvider { get; } + + private string SettingsFile1 { get; } + + private string SettingsFile2 { get; } + + private bool SubDirectories { get; } + + public int Execute() + { + // parse the settings if any were specified + if (null != this.SettingsFile1 || null != this.SettingsFile2) + { + this.ParseSettingsFiles(this.SettingsFile1, this.SettingsFile2); + } + else + { + if (File.Exists(ConvertCommand.SettingsFileDefault)) + { + this.ParseSettingsFiles(ConvertCommand.SettingsFileDefault, null); + } + } + + var messaging = this.ServiceProvider.GetService(); + var converter = new Converter(messaging, this.IndentationAmount, this.ErrorsAsWarnings, this.IgnoreErrors); + + var errors = this.InspectSubDirectories(converter, Path.GetFullPath(".")); + + foreach (string searchPattern in this.SearchPatterns) + { + if (!this.SearchPatternResults.Contains(searchPattern)) + { + Console.Error.WriteLine("Could not find file \"{0}\"", searchPattern); + errors++; + } + } + + return errors != 0 ? 2 : 0; + } + + /// + /// Get the files that match a search path pattern. + /// + /// The base directory at which to begin the search. + /// The search path pattern. + /// The files matching the pattern. + private static string[] GetFiles(string baseDir, string searchPath) + { + // convert alternate directory separators to the standard one + var filePath = searchPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); + var lastSeparator = filePath.LastIndexOf(Path.DirectorySeparatorChar); + string[] files = null; + + try + { + if (0 > lastSeparator) + { + files = Directory.GetFiles(baseDir, filePath); + } + else // found directory separator + { + var searchPattern = filePath.Substring(lastSeparator + 1); + + files = Directory.GetFiles(filePath.Substring(0, lastSeparator + 1), searchPattern); + } + } + catch (DirectoryNotFoundException) + { + // don't let this function throw the DirectoryNotFoundException. (this exception + // occurs for non-existant directories and invalid characters in the searchPattern) + } + + return files; + } + + /// + /// Inspect sub-directories. + /// + /// The directory whose sub-directories will be inspected. + /// The number of errors that were found. + private int InspectSubDirectories(Converter converter, string directory) + { + var errors = 0; + + foreach (var searchPattern in this.SearchPatterns) + { + foreach (var sourceFilePath in GetFiles(directory, searchPattern)) + { + var file = new FileInfo(sourceFilePath); + + if (!this.ExemptFiles.Contains(file.Name.ToUpperInvariant())) + { + this.SearchPatternResults.Add(searchPattern); + errors += converter.ConvertFile(file.FullName, this.FixErrors); + } + } + } + + if (this.SubDirectories) + { + foreach (var childDirectoryPath in Directory.GetDirectories(directory)) + { + errors += this.InspectSubDirectories(converter, childDirectoryPath); + } + } + + return errors; + } + + /// + /// Parse the primary and secondary settings files. + /// + /// The primary settings file. + /// The secondary settings file. + private void ParseSettingsFiles(string localSettingsFile1, string localSettingsFile2) + { + if (null == localSettingsFile1 && null != localSettingsFile2) + { + throw new ArgumentException("Cannot specify a secondary settings file (set2) without a primary settings file (set1).", "localSettingsFile2"); + } + + var settingsFile = localSettingsFile1; + while (null != settingsFile) + { + XmlTextReader reader = null; + try + { + reader = new XmlTextReader(settingsFile); + var doc = new XmlDocument(); + doc.Load(reader); + + // get the types of tests that will have their errors displayed as warnings + var testsIgnoredElements = doc.SelectNodes("/Settings/IgnoreErrors/Test"); + foreach (XmlElement test in testsIgnoredElements) + { + var key = test.GetAttribute("Id"); + this.IgnoreErrors.Add(key); + } + + // get the types of tests that will have their errors displayed as warnings + var testsAsWarningsElements = doc.SelectNodes("/Settings/ErrorsAsWarnings/Test"); + foreach (XmlElement test in testsAsWarningsElements) + { + var key = test.GetAttribute("Id"); + this.ErrorsAsWarnings.Add(key); + } + + // get the exempt files + var localExemptFiles = doc.SelectNodes("/Settings/ExemptFiles/File"); + foreach (XmlElement file in localExemptFiles) + { + var key = file.GetAttribute("Name").ToUpperInvariant(); + this.ExemptFiles.Add(key); + } + } + finally + { + if (null != reader) + { + reader.Close(); + } + } + + settingsFile = localSettingsFile2; + localSettingsFile2 = null; + } + } + } +} diff --git a/src/wixcop/CommandLine/HelpCommand.cs b/src/wixcop/CommandLine/HelpCommand.cs new file mode 100644 index 00000000..a75dac5c --- /dev/null +++ b/src/wixcop/CommandLine/HelpCommand.cs @@ -0,0 +1,25 @@ +using System; +using WixToolset.Extensibility.Data; + +namespace WixCop.CommandLine +{ + internal class HelpCommand : ICommandLineCommand + { + public int Execute() + { + Console.WriteLine(" usage: wixcop.exe sourceFile [sourceFile ...]"); + Console.WriteLine(); + Console.WriteLine(" -f fix errors automatically for writable files"); + Console.WriteLine(" -nologo suppress displaying the logo information"); + Console.WriteLine(" -s search for matching files in current dir and subdirs"); + Console.WriteLine(" -set1 primary settings file"); + Console.WriteLine(" -set2 secondary settings file (overrides primary)"); + Console.WriteLine(" -indent: indentation multiple (overrides default of 4)"); + Console.WriteLine(" -? this help information"); + Console.WriteLine(); + Console.WriteLine(" sourceFile may use wildcards like *.wxs"); + + return 0; + } + } +} diff --git a/src/wixcop/CommandLine/WixCopCommandLineParser.cs b/src/wixcop/CommandLine/WixCopCommandLineParser.cs new file mode 100644 index 00000000..53012cfd --- /dev/null +++ b/src/wixcop/CommandLine/WixCopCommandLineParser.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using WixCop.Interfaces; +using WixToolset.Core; +using WixToolset.Extensibility.Data; +using WixToolset.Extensibility.Services; + +namespace WixCop.CommandLine +{ + public sealed class WixCopCommandLineParser : IWixCopCommandLineParser + { + private bool fixErrors; + private int indentationAmount; + private readonly List searchPatterns; + private readonly IServiceProvider serviceProvider; + private string settingsFile1; + private string settingsFile2; + private bool showHelp; + private bool showLogo; + private bool subDirectories; + + public WixCopCommandLineParser(IServiceProvider serviceProvider) + { + this.serviceProvider = serviceProvider; + + this.indentationAmount = 4; + this.searchPatterns = new List(); + this.showLogo = true; + } + + public ICommandLineArguments Arguments { get; set; } + + public ICommandLineCommand ParseWixCopCommandLine() + { + this.Parse(); + + if (this.showLogo) + { + AppCommon.DisplayToolHeader(); + Console.WriteLine(); + } + + if (this.showHelp) + { + return new HelpCommand(); + } + + return new ConvertCommand( + this.serviceProvider, + this.fixErrors, + this.indentationAmount, + this.searchPatterns, + this.subDirectories, + this.settingsFile1, + this.settingsFile2); + } + + private void Parse() + { + this.showHelp = 0 == this.Arguments.Arguments.Length; + var parser = this.Arguments.Parse(); + + while (!this.showHelp && + String.IsNullOrEmpty(parser.ErrorArgument) && + parser.TryGetNextSwitchOrArgument(out var arg)) + { + if (String.IsNullOrWhiteSpace(arg)) // skip blank arguments. + { + continue; + } + + if (parser.IsSwitch(arg)) + { + if (!this.ParseArgument(parser, arg)) + { + parser.ErrorArgument = arg; + } + } + else + { + this.searchPatterns.Add(arg); + } + } + } + + private bool ParseArgument(IParseCommandLine parser, string arg) + { + var parameter = arg.Substring(1); + + switch (parameter.ToLowerInvariant()) + { + case "?": + this.showHelp = true; + return true; + case "f": + this.fixErrors = true; + return true; + case "nologo": + this.showLogo = false; + return true; + case "s": + this.subDirectories = true; + return true; + default: // other parameters + if (parameter.StartsWith("set1", StringComparison.Ordinal)) + { + this.settingsFile1 = parameter.Substring(4); + } + else if (parameter.StartsWith("set2", StringComparison.Ordinal)) + { + this.settingsFile2 = parameter.Substring(4); + } + else if (parameter.StartsWith("indent:", StringComparison.Ordinal)) + { + try + { + this.indentationAmount = Convert.ToInt32(parameter.Substring(7)); + } + catch + { + throw new ArgumentException("Invalid numeric argument.", parameter); + } + } + else + { + throw new ArgumentException("Invalid argument.", parameter); + } + return true; + } + } + } +} diff --git a/src/wixcop/Converter.cs b/src/wixcop/Converter.cs new file mode 100644 index 00000000..a204ebe0 --- /dev/null +++ b/src/wixcop/Converter.cs @@ -0,0 +1,633 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixCop +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Linq; + using System.Xml; + using System.Xml.Linq; + using WixToolset.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Tools.Core; + + /// + /// WiX source code converter. + /// + public class Converter + { + private const string XDocumentNewLine = "\n"; // XDocument normlizes "\r\n" to just "\n". + private static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; + + private static readonly XName FileElementName = WixNamespace + "File"; + private static readonly XName ExePackageElementName = WixNamespace + "ExePackage"; + private static readonly XName MsiPackageElementName = WixNamespace + "MsiPackage"; + private static readonly XName MspPackageElementName = WixNamespace + "MspPackage"; + private static readonly XName MsuPackageElementName = WixNamespace + "MsuPackage"; + private static readonly XName PayloadElementName = WixNamespace + "Payload"; + private static readonly XName WixElementWithoutNamespaceName = XNamespace.None + "Wix"; + + private static readonly Dictionary OldToNewNamespaceMapping = new Dictionary() + { + { "http://schemas.microsoft.com/wix/BalExtension", "http://wixtoolset.org/schemas/v4/wxs/bal" }, + { "http://schemas.microsoft.com/wix/ComPlusExtension", "http://wixtoolset.org/schemas/v4/wxs/complus" }, + { "http://schemas.microsoft.com/wix/DependencyExtension", "http://wixtoolset.org/schemas/v4/wxs/dependency" }, + { "http://schemas.microsoft.com/wix/DifxAppExtension", "http://wixtoolset.org/schemas/v4/wxs/difxapp" }, + { "http://schemas.microsoft.com/wix/FirewallExtension", "http://wixtoolset.org/schemas/v4/wxs/firewall" }, + { "http://schemas.microsoft.com/wix/GamingExtension", "http://wixtoolset.org/schemas/v4/wxs/gaming" }, + { "http://schemas.microsoft.com/wix/IIsExtension", "http://wixtoolset.org/schemas/v4/wxs/iis" }, + { "http://schemas.microsoft.com/wix/MsmqExtension", "http://wixtoolset.org/schemas/v4/wxs/msmq" }, + { "http://schemas.microsoft.com/wix/NetFxExtension", "http://wixtoolset.org/schemas/v4/wxs/netfx" }, + { "http://schemas.microsoft.com/wix/PSExtension", "http://wixtoolset.org/schemas/v4/wxs/powershell" }, + { "http://schemas.microsoft.com/wix/SqlExtension", "http://wixtoolset.org/schemas/v4/wxs/sql" }, + { "http://schemas.microsoft.com/wix/TagExtension", "http://wixtoolset.org/schemas/v4/wxs/tag" }, + { "http://schemas.microsoft.com/wix/UtilExtension", "http://wixtoolset.org/schemas/v4/wxs/util" }, + { "http://schemas.microsoft.com/wix/VSExtension", "http://wixtoolset.org/schemas/v4/wxs/vs" }, + { "http://wixtoolset.org/schemas/thmutil/2010", "http://wixtoolset.org/schemas/v4/thmutil" }, + { "http://schemas.microsoft.com/wix/2009/Lux", "http://wixtoolset.org/schemas/v4/lux" }, + { "http://schemas.microsoft.com/wix/2006/wi", "http://wixtoolset.org/schemas/v4/wxs" }, + { "http://schemas.microsoft.com/wix/2006/localization", "http://wixtoolset.org/schemas/v4/wxl" }, + { "http://schemas.microsoft.com/wix/2006/libraries", "http://wixtoolset.org/schemas/v4/wixlib" }, + { "http://schemas.microsoft.com/wix/2006/objects", "http://wixtoolset.org/schemas/v4/wixobj" }, + { "http://schemas.microsoft.com/wix/2006/outputs", "http://wixtoolset.org/schemas/v4/wixout" }, + { "http://schemas.microsoft.com/wix/2007/pdbs", "http://wixtoolset.org/schemas/v4/wixpdb" }, + { "http://schemas.microsoft.com/wix/2003/04/actions", "http://wixtoolset.org/schemas/v4/wi/actions" }, + { "http://schemas.microsoft.com/wix/2006/tables", "http://wixtoolset.org/schemas/v4/wi/tables" }, + { "http://schemas.microsoft.com/wix/2006/WixUnit", "http://wixtoolset.org/schemas/v4/wixunit" }, + }; + + private Dictionary> ConvertElementMapping; + + /// + /// Instantiate a new Converter class. + /// + /// Indentation value to use when validating leading whitespace. + /// Test errors to display as warnings. + /// Test errors to ignore. + public Converter(IMessaging messaging, int indentationAmount, IEnumerable errorsAsWarnings = null, IEnumerable ignoreErrors = null) + { + // workaround IDE0009 bug + /*this.ConvertElementMapping = new Dictionary>() + { + { Converter.FileElementName, this.ConvertFileElement }, + { Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, + { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace }, + };*/ + this.ConvertElementMapping = new Dictionary>(); + this.ConvertElementMapping.Add(Converter.FileElementName, this.ConvertFileElement); + this.ConvertElementMapping.Add(Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation); + this.ConvertElementMapping.Add(Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation); + this.ConvertElementMapping.Add(Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation); + this.ConvertElementMapping.Add(Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation); + this.ConvertElementMapping.Add(Converter.PayloadElementName, this.ConvertSuppressSignatureValidation); + this.ConvertElementMapping.Add(Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace); + + this.Messaging = messaging; + + this.IndentationAmount = indentationAmount; + + this.ErrorsAsWarnings = new HashSet(this.YieldConverterTypes(errorsAsWarnings)); + + this.IgnoreErrors = new HashSet(this.YieldConverterTypes(ignoreErrors)); + } + + private int Errors { get; set; } + + private HashSet ErrorsAsWarnings { get; set; } + + private HashSet IgnoreErrors { get; set; } + + private IMessaging Messaging { get; } + + private int IndentationAmount { get; set; } + + private string SourceFile { get; set; } + + /// + /// Convert a file. + /// + /// The file to convert. + /// Option to save the converted errors that are found. + /// The number of errors found. + public int ConvertFile(string sourceFile, bool saveConvertedFile) + { + XDocument document; + + // Set the instance info. + this.Errors = 0; + this.SourceFile = sourceFile; + + try + { + document = XDocument.Load(this.SourceFile, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + } + catch (XmlException e) + { + this.OnError(ConverterTestType.XmlException, (XObject)null, "The xml is invalid. Detail: '{0}'", e.Message); + + return this.Errors; + } + + this.ConvertDocument(document); + + // Fix errors if requested and necessary. + if (saveConvertedFile && 0 < this.Errors) + { + try + { + using (StreamWriter writer = File.CreateText(this.SourceFile)) + { + document.Save(writer, SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces); + } + } + catch (UnauthorizedAccessException) + { + this.OnError(ConverterTestType.UnauthorizedAccessException, (XObject)null, "Could not write to file."); + } + } + + return this.Errors; + } + + /// + /// Convert a document. + /// + /// The document to convert. + /// The number of errors found. + public int ConvertDocument(XDocument document) + { + XDeclaration declaration = document.Declaration; + + // Convert the declaration. + if (null != declaration) + { + if (!String.Equals("utf-8", declaration.Encoding, StringComparison.OrdinalIgnoreCase)) + { + if (this.OnError(ConverterTestType.DeclarationEncodingWrong, document.Root, "The XML declaration encoding is not properly set to 'utf-8'.")) + { + declaration.Encoding = "utf-8"; + } + } + } + else // missing declaration + { + if (this.OnError(ConverterTestType.DeclarationMissing, (XNode)null, "This file is missing an XML declaration on the first line.")) + { + document.Declaration = new XDeclaration("1.0", "utf-8", null); + document.Root.AddBeforeSelf(new XText(XDocumentNewLine)); + } + } + + // Start converting the nodes at the top. + this.ConvertNode(document.Root, 0); + + return this.Errors; + } + + /// + /// Convert a single xml node. + /// + /// The node to convert. + /// The depth level of the node. + /// The converted node. + private void ConvertNode(XNode node, int level) + { + // Convert this node's whitespace. + if ((XmlNodeType.Comment == node.NodeType && 0 > ((XComment)node).Value.IndexOf(XDocumentNewLine, StringComparison.Ordinal)) || + XmlNodeType.CDATA == node.NodeType || XmlNodeType.Element == node.NodeType || XmlNodeType.ProcessingInstruction == node.NodeType) + { + this.ConvertWhitespace(node, level); + } + + // Convert this node if it is an element. + XElement element = node as XElement; + + if (null != element) + { + this.ConvertElement(element); + + // Convert all children of this element. + IEnumerable children = element.Nodes().ToList(); + + foreach (XNode child in children) + { + this.ConvertNode(child, level + 1); + } + } + } + + private void ConvertElement(XElement element) + { + // Gather any deprecated namespaces, then update this element tree based on those deprecations. + Dictionary deprecatedToUpdatedNamespaces = new Dictionary(); + + foreach (XAttribute declaration in element.Attributes().Where(a => a.IsNamespaceDeclaration)) + { + XNamespace ns; + + if (Converter.OldToNewNamespaceMapping.TryGetValue(declaration.Value, out ns)) + { + if (this.OnError(ConverterTestType.XmlnsValueWrong, declaration, "The namespace '{0}' is out of date. It must be '{1}'.", declaration.Value, ns.NamespaceName)) + { + deprecatedToUpdatedNamespaces.Add(declaration.Value, ns); + } + } + } + + if (deprecatedToUpdatedNamespaces.Any()) + { + Converter.UpdateElementsWithDeprecatedNamespaces(element.DescendantsAndSelf(), deprecatedToUpdatedNamespaces); + } + + // Convert the node in much greater detail. + Action convert; + + if (this.ConvertElementMapping.TryGetValue(element.Name, out convert)) + { + convert(element); + } + } + + private void ConvertFileElement(XElement element) + { + if (null == element.Attribute("Id")) + { + XAttribute attribute = element.Attribute("Name"); + + if (null == attribute) + { + attribute = element.Attribute("Source"); + } + + if (null != attribute) + { + string name = Path.GetFileName(attribute.Value); + + if (this.OnError(ConverterTestType.AssignAnonymousFileId, element, "The file id is being updated to '{0}' to ensure it remains the same as the default", name)) + { + IEnumerable attributes = element.Attributes().ToList(); + element.RemoveAttributes(); + element.Add(new XAttribute("Id", ToolsCommon.GetIdentifierFromName(name))); + element.Add(attributes); + } + } + } + } + + private void ConvertSuppressSignatureValidation(XElement element) + { + XAttribute suppressSignatureValidation = element.Attribute("SuppressSignatureValidation"); + + if (null != suppressSignatureValidation) + { + if (this.OnError(ConverterTestType.SuppressSignatureValidationDeprecated, element, "The chain package element contains deprecated '{0}' attribute. Use the 'EnableSignatureValidation' instead.", suppressSignatureValidation)) + { + if ("no" == suppressSignatureValidation.Value) + { + element.Add(new XAttribute("EnableSignatureValidation", "yes")); + } + } + + suppressSignatureValidation.Remove(); + } + } + + /// + /// Converts a Wix element. + /// + /// The Wix element to convert. + /// The converted element. + private void ConvertWixElementWithoutNamespace(XElement element) + { + if (this.OnError(ConverterTestType.XmlnsMissing, element, "The xmlns attribute is missing. It must be present with a value of '{0}'.", WixNamespace.NamespaceName)) + { + element.Name = WixNamespace.GetName(element.Name.LocalName); + + element.Add(new XAttribute("xmlns", WixNamespace.NamespaceName)); // set the default namespace. + + foreach (XElement elementWithoutNamespace in element.Elements().Where(e => XNamespace.None == e.Name.Namespace)) + { + elementWithoutNamespace.Name = WixNamespace.GetName(elementWithoutNamespace.Name.LocalName); + } + } + } + + /// + /// Convert the whitespace adjacent to a node. + /// + /// The node to convert. + /// The depth level of the node. + private void ConvertWhitespace(XNode node, int level) + { + // Fix the whitespace before this node. + XText whitespace = node.PreviousNode as XText; + + if (null != whitespace) + { + if (XmlNodeType.CDATA == node.NodeType) + { + if (this.OnError(ConverterTestType.WhitespacePrecedingCDATAWrong, node, "There should be no whitespace preceding a CDATA node.")) + { + whitespace.Remove(); + } + } + else + { + // TODO: this code complains about whitespace even after the file has been fixed. + if (!Converter.IsLegalWhitespace(this.IndentationAmount, level, whitespace.Value)) + { + if (this.OnError(ConverterTestType.WhitespacePrecedingNodeWrong, node, "The whitespace preceding this node is incorrect.")) + { + Converter.FixWhitespace(this.IndentationAmount, level, whitespace); + } + } + } + } + + // Fix the whitespace after CDATA nodes. + XCData cdata = node as XCData; + + if (null != cdata) + { + whitespace = cdata.NextNode as XText; + + if (null != whitespace) + { + if (this.OnError(ConverterTestType.WhitespaceFollowingCDATAWrong, node, "There should be no whitespace following a CDATA node.")) + { + whitespace.Remove(); + } + } + } + else + { + // Fix the whitespace inside and after this node (except for Error which may contain just whitespace). + XElement element = node as XElement; + + if (null != element && "Error" != element.Name.LocalName) + { + if (!element.HasElements && !element.IsEmpty && String.IsNullOrEmpty(element.Value.Trim())) + { + if (this.OnError(ConverterTestType.NotEmptyElement, element, "This should be an empty element since it contains nothing but whitespace.")) + { + element.RemoveNodes(); + } + } + + whitespace = node.NextNode as XText; + + if (null != whitespace) + { + // TODO: this code crashes when level is 0, + // complains about whitespace even after the file has been fixed, + // and the error text doesn't match the error. + if (!Converter.IsLegalWhitespace(this.IndentationAmount, level - 1, whitespace.Value)) + { + if (this.OnError(ConverterTestType.WhitespacePrecedingEndElementWrong, whitespace, "The whitespace preceding this end element is incorrect.")) + { + Converter.FixWhitespace(this.IndentationAmount, level - 1, whitespace); + } + } + } + } + } + } + + private IEnumerable YieldConverterTypes(IEnumerable types) + { + if (null != types) + { + foreach (string type in types) + { + ConverterTestType itt; + + if (Enum.TryParse(type, true, out itt)) + { + yield return itt; + } + else // not a known ConverterTestType + { + this.OnError(ConverterTestType.ConverterTestTypeUnknown, (XObject)null, "Unknown error type: '{0}'.", type); + } + } + } + } + + private static void UpdateElementsWithDeprecatedNamespaces(IEnumerable elements, Dictionary deprecatedToUpdatedNamespaces) + { + foreach (XElement element in elements) + { + XNamespace ns; + + if (deprecatedToUpdatedNamespaces.TryGetValue(element.Name.Namespace, out ns)) + { + element.Name = ns.GetName(element.Name.LocalName); + } + + // Remove all the attributes and add them back to with their namespace updated (as necessary). + IEnumerable attributes = element.Attributes().ToList(); + element.RemoveAttributes(); + + foreach (XAttribute attribute in attributes) + { + XAttribute convertedAttribute = attribute; + + if (attribute.IsNamespaceDeclaration) + { + if (deprecatedToUpdatedNamespaces.TryGetValue(attribute.Value, out ns)) + { + convertedAttribute = ("xmlns" == attribute.Name.LocalName) ? new XAttribute(attribute.Name.LocalName, ns.NamespaceName) : new XAttribute(XNamespace.Xmlns + attribute.Name.LocalName, ns.NamespaceName); + } + } + else if (deprecatedToUpdatedNamespaces.TryGetValue(attribute.Name.Namespace, out ns)) + { + convertedAttribute = new XAttribute(ns.GetName(attribute.Name.LocalName), attribute.Value); + } + + element.Add(convertedAttribute); + } + } + } + + /// + /// Determine if the whitespace preceding a node is appropriate for its depth level. + /// + /// Indentation value to use when validating leading whitespace. + /// The depth level that should match this whitespace. + /// The whitespace to validate. + /// true if the whitespace is legal; false otherwise. + private static bool IsLegalWhitespace(int indentationAmount, int level, string whitespace) + { + // strip off leading newlines; there can be an arbitrary number of these + while (whitespace.StartsWith(XDocumentNewLine, StringComparison.Ordinal)) + { + whitespace = whitespace.Substring(XDocumentNewLine.Length); + } + + // check the length + if (whitespace.Length != level * indentationAmount) + { + return false; + } + + // check the spaces + foreach (char character in whitespace) + { + if (' ' != character) + { + return false; + } + } + + return true; + } + + /// + /// Fix the whitespace in a Whitespace node. + /// + /// Indentation value to use when validating leading whitespace. + /// The depth level of the desired whitespace. + /// The whitespace node to fix. + private static void FixWhitespace(int indentationAmount, int level, XText whitespace) + { + int newLineCount = 0; + + for (int i = 0; i + 1 < whitespace.Value.Length; ++i) + { + if (XDocumentNewLine == whitespace.Value.Substring(i, 2)) + { + ++i; // skip an extra character + ++newLineCount; + } + } + + if (0 == newLineCount) + { + newLineCount = 1; + } + + // reset the whitespace value + whitespace.Value = String.Empty; + + // add the correct number of newlines + for (int i = 0; i < newLineCount; ++i) + { + whitespace.Value = String.Concat(whitespace.Value, XDocumentNewLine); + } + + // add the correct number of spaces based on configured indentation amount + whitespace.Value = String.Concat(whitespace.Value, new string(' ', level * indentationAmount)); + } + + /// + /// Output an error message to the console. + /// + /// The type of converter test. + /// The node that caused the error. + /// Detailed error message. + /// Additional formatted string arguments. + /// Returns true indicating that action should be taken on this error, and false if it should be ignored. + private bool OnError(ConverterTestType converterTestType, XObject node, string message, params object[] args) + { + if (this.IgnoreErrors.Contains(converterTestType)) // ignore the error + { + return false; + } + + // Increase the error count. + this.Errors++; + + SourceLineNumber sourceLine = (null == node) ? new SourceLineNumber(this.SourceFile ?? "wixcop.exe") : new SourceLineNumber(this.SourceFile, ((IXmlLineInfo)node).LineNumber); + bool warning = this.ErrorsAsWarnings.Contains(converterTestType); + string display = String.Format(CultureInfo.CurrentCulture, message, args); + + var msg = new Message(sourceLine, warning ? MessageLevel.Warning : MessageLevel.Error, (int)converterTestType, "{0} ({1})", display, converterTestType.ToString()); + + this.Messaging.Write(msg); + + return true; + } + + /// + /// Converter test types. These are used to condition error messages down to warnings. + /// + private enum ConverterTestType + { + /// + /// Internal-only: displayed when a string cannot be converted to an ConverterTestType. + /// + ConverterTestTypeUnknown, + + /// + /// Displayed when an XML loading exception has occurred. + /// + XmlException, + + /// + /// Displayed when a file cannot be accessed; typically when trying to save back a fixed file. + /// + UnauthorizedAccessException, + + /// + /// Displayed when the encoding attribute in the XML declaration is not 'UTF-8'. + /// + DeclarationEncodingWrong, + + /// + /// Displayed when the XML declaration is missing from the source file. + /// + DeclarationMissing, + + /// + /// Displayed when the whitespace preceding a CDATA node is wrong. + /// + WhitespacePrecedingCDATAWrong, + + /// + /// Displayed when the whitespace preceding a node is wrong. + /// + WhitespacePrecedingNodeWrong, + + /// + /// Displayed when an element is not empty as it should be. + /// + NotEmptyElement, + + /// + /// Displayed when the whitespace following a CDATA node is wrong. + /// + WhitespaceFollowingCDATAWrong, + + /// + /// Displayed when the whitespace preceding an end element is wrong. + /// + WhitespacePrecedingEndElementWrong, + + /// + /// Displayed when the xmlns attribute is missing from the document element. + /// + XmlnsMissing, + + /// + /// Displayed when the xmlns attribute on the document element is wrong. + /// + XmlnsValueWrong, + + /// + /// Assign an identifier to a File element when on Id attribute is specified. + /// + AssignAnonymousFileId, + + /// + /// SuppressSignatureValidation attribute is deprecated and replaced with EnableSignatureValidation. + /// + SuppressSignatureValidationDeprecated, + } + } +} diff --git a/src/wixcop/Interfaces/IWixCopCommandLineParser.cs b/src/wixcop/Interfaces/IWixCopCommandLineParser.cs new file mode 100644 index 00000000..2093f5d8 --- /dev/null +++ b/src/wixcop/Interfaces/IWixCopCommandLineParser.cs @@ -0,0 +1,11 @@ +using WixToolset.Extensibility.Data; + +namespace WixCop.Interfaces +{ + public interface IWixCopCommandLineParser + { + ICommandLineArguments Arguments { get; set; } + + ICommandLineCommand ParseWixCopCommandLine(); + } +} diff --git a/src/wixcop/Program.cs b/src/wixcop/Program.cs new file mode 100644 index 00000000..b26bd6c9 --- /dev/null +++ b/src/wixcop/Program.cs @@ -0,0 +1,67 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixCop +{ + using System; + using WixCop.CommandLine; + using WixCop.Interfaces; + using WixToolset.Core; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Tools.Core; + + /// + /// Wix source code style inspector and converter. + /// + public sealed class Program + { + /// + /// The main entry point for the application. + /// + /// The commandline arguments. + /// The number of errors that were found. + [STAThread] + public static int Main(string[] args) + { + var serviceProvider = new WixToolsetServiceProvider(); + var listener = new ConsoleMessageListener("WXCP", "wixcop.exe"); + + serviceProvider.AddService((x, y) => listener); + serviceProvider.AddService((x, y) => new WixCopCommandLineParser(x)); + + var program = new Program(); + return program.Run(serviceProvider, args); + } + + /// + /// Run the application with the given arguments. + /// + /// Service provider to use throughout this execution. + /// The commandline arguments. + /// The number of errors that were found. + public int Run(IServiceProvider serviceProvider, string[] args) + { + try + { + var listener = serviceProvider.GetService(); + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var arguments = serviceProvider.GetService(); + arguments.Populate(args); + + var commandLine = serviceProvider.GetService(); + commandLine.Arguments = arguments; + var command = commandLine.ParseWixCopCommandLine(); + return command?.Execute() ?? 1; + } + catch (Exception e) + { + Console.Error.WriteLine("wixcop.exe : fatal error WXCP0001 : {0}\r\n\n\nStack Trace:\r\n{1}", e.Message, e.StackTrace); + + return 1; + } + } + } +} diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj new file mode 100644 index 00000000..9bcae177 --- /dev/null +++ b/src/wixcop/WixCop.csproj @@ -0,0 +1,32 @@ + + + + + + net461;netcoreapp2.1 + Exe + Converter + WiX Error Correction Tool + embedded + true + + + + + NU1701 + + + + + + + + + + + + + + + + -- cgit v1.2.3-55-g6feb From ecd80705e46c0bdd6fd2f80b2fd5c54d9b2ea3f6 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 18 Sep 2018 19:01:39 -0400 Subject: Test is failing atm and requesting build with new version number, please. --- src/test/wixcop/WixCopFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/wixcop/WixCopFixture.cs b/src/test/wixcop/WixCopFixture.cs index 12863959..d11865f1 100644 --- a/src/test/wixcop/WixCopFixture.cs +++ b/src/test/wixcop/WixCopFixture.cs @@ -15,7 +15,7 @@ namespace WixCopTests { public class WixCopFixture { - [Fact] + [Fact(Skip = "Problematic at the moment.")] public void CanConvertSingleFile() { const string beforeFileName = "SingleFile.wxs"; -- cgit v1.2.3-55-g6feb From f5e72516531c889af57023b7164606498632e9fc Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 20 Sep 2018 14:12:04 -0400 Subject: Requesting build with new version number, please. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 39aa251742e7d75992bdad01ebd52fad3ed45195 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 27 Sep 2018 21:42:52 -0400 Subject: Requesting build with new version number, please. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From f6a736c4cbb800904c216ce5730ab02ab7fd4373 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 1 Oct 2018 15:52:53 -0400 Subject: Add failing test for wixtoolset/issues#5883. --- .../Preprocessor/ConvertedPreprocessor.wxs | 62 +++++++++++++++++++++ .../wixcop/TestData/Preprocessor/Preprocessor.wxs | 63 ++++++++++++++++++++++ .../TestData/Preprocessor/wixcop.settings.xml | 9 ++++ src/test/wixcop/WixCopFixture.cs | 59 +++++++++++++++++++- src/test/wixcop/WixCopTests.csproj | 11 ++-- 5 files changed, 196 insertions(+), 8 deletions(-) create mode 100644 src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs create mode 100644 src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs create mode 100644 src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml diff --git a/src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs b/src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs new file mode 100644 index 00000000..d6280185 --- /dev/null +++ b/src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs b/src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs new file mode 100644 index 00000000..2eb908c2 --- /dev/null +++ b/src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml b/src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml new file mode 100644 index 00000000..9d3ad496 --- /dev/null +++ b/src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/test/wixcop/WixCopFixture.cs b/src/test/wixcop/WixCopFixture.cs index d11865f1..1fa49be9 100644 --- a/src/test/wixcop/WixCopFixture.cs +++ b/src/test/wixcop/WixCopFixture.cs @@ -15,7 +15,7 @@ namespace WixCopTests { public class WixCopFixture { - [Fact(Skip = "Problematic at the moment.")] + [Fact] public void CanConvertSingleFile() { const string beforeFileName = "SingleFile.wxs"; @@ -38,7 +38,53 @@ namespace WixCopTests }; var result = runner.Execute(out var messages); - + + Assert.Equal(2, result); + + var actualLines = File.ReadAllLines(targetFile); + var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); + Assert.Equal(expectedLines, actualLines); + + var runner2 = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result2 = runner2.Execute(out var messages2); + + Assert.Equal(0, result2); + } + } + + [Fact] + public void RetainsPreprocessorInstructions() + { + const string beforeFileName = "Preprocessor.wxs"; + const string afterFileName = "ConvertedPreprocessor.wxs"; + var folder = TestData.Get(@"TestData\Preprocessor"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(true); + var targetFile = Path.Combine(baseFolder, beforeFileName); + File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); + + var runner = new WixCopRunner + { + FixErrors = true, + SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), + SearchPatterns = + { + targetFile, + }, + }; + + var result = runner.Execute(out var messages); + Assert.Equal(2, result); var actualLines = File.ReadAllLines(targetFile); @@ -48,6 +94,7 @@ namespace WixCopTests var runner2 = new WixCopRunner { FixErrors = true, + SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), SearchPatterns = { targetFile, @@ -66,14 +113,22 @@ namespace WixCopTests public List SearchPatterns { get; } = new List(); + public string SettingFile1 { get; set; } + public int Execute(out List messages) { var argList = new List(); + if (this.FixErrors) { argList.Add("-f"); } + if (!String.IsNullOrEmpty(this.SettingFile1)) + { + argList.Add($"-set1{this.SettingFile1}"); + } + foreach (string searchPattern in this.SearchPatterns) { argList.Add(searchPattern); diff --git a/src/test/wixcop/WixCopTests.csproj b/src/test/wixcop/WixCopTests.csproj index 0ae50dc8..012ef4db 100644 --- a/src/test/wixcop/WixCopTests.csproj +++ b/src/test/wixcop/WixCopTests.csproj @@ -12,12 +12,11 @@ - - PreserveNewest - - - PreserveNewest - + + + + + -- cgit v1.2.3-55-g6feb From 36a0bfb5a30a8786794cb41db46ee206435981d3 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 11 Aug 2018 01:15:50 -0700 Subject: Enable NCrunch support --- src/Directory.Build.props | 15 +++++++++++---- .../WixToolsetTest.BuildTasks.v3.ncrunchproject | 5 +++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 7cd6767f..9eacf3f5 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,12 +1,18 @@ - + Debug - $(MSBuildThisFileDirectory)..\build\obj\$(MSBuildProjectName)\ - $(MSBuildThisFileDirectory)..\build\$(Configuration)\ - $(BaseOutputPath) + false + + $(MSBuildProjectName) + $(MSBuildThisFileDirectory)..\build\ + $(BaseOutputPath)obj\$(ProjectName)\ + $(BaseOutputPath)$(Configuration)\ WiX Toolset Team WiX Toolset @@ -18,5 +24,6 @@ $(MSBuildThisFileDirectory)..\..\ + diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject new file mode 100644 index 00000000..7b5b2139 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + True + + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 917bfd43985af3afaac0b3a1d97a89a58bde1f2f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Oct 2018 13:55:44 -0700 Subject: Skip some MSBuild tests until we can execute tests with out of proc MSBuild --- src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | 8 ++++---- src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 96f39318..db76a119 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -20,7 +20,7 @@ namespace WixToolsetTest.BuildTasks private MsbuildRunner MsbuildRunner { get; } - [Fact] + [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] public void CanBuildSimpleMsiPackage() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); @@ -55,7 +55,7 @@ namespace WixToolsetTest.BuildTasks } } - [Fact] + [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] public void CanBuildSimpleMsiPackageWithWarningSuppressions() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); @@ -80,7 +80,7 @@ namespace WixToolsetTest.BuildTasks } } - [Fact] + [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] public void CanBuildSimpleMsiPackageAsWixipl() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); @@ -107,7 +107,7 @@ namespace WixToolsetTest.BuildTasks } } - [Fact] + [Fact(Skip ="Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] public void CanBuildAndCleanSimpleMsiPackage() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index c4a69cdd..93a65ea1 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -13,7 +13,7 @@ namespace WixToolsetTest.BuildTasks public class WixBuildTaskFixture { - [Fact] + [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] public void CanBuildSimpleMsiPackage() { var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); -- cgit v1.2.3-55-g6feb From 240f3594db6f633ece6818afd28dde1e1ef6b36c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Oct 2018 13:33:08 -0700 Subject: Fix WixCop namespaces and some C# modernization --- src/test/WixToolsetTest.WixCop/ConverterFixture.cs | 452 +++++++++++++++++++++ .../Preprocessor/ConvertedPreprocessor.wxs | 62 +++ .../TestData/Preprocessor/Preprocessor.wxs | 63 +++ .../TestData/Preprocessor/wixcop.settings.xml | 9 + .../TestData/SingleFile/ConvertedSingleFile.wxs | 60 +++ .../TestData/SingleFile/SingleFile.wxs | 61 +++ src/test/WixToolsetTest.WixCop/WixCopFixture.cs | 108 +++++ src/test/WixToolsetTest.WixCop/WixCopRunner.cs | 67 +++ .../WixToolsetTest.WixCop/WixCopRunnerResult.cs | 22 + .../WixToolsetTest.WixCop.csproj | 41 ++ src/test/wixcop/ConverterFixture.cs | 418 ------------------- .../Preprocessor/ConvertedPreprocessor.wxs | 62 --- .../wixcop/TestData/Preprocessor/Preprocessor.wxs | 63 --- .../TestData/Preprocessor/wixcop.settings.xml | 9 - .../TestData/SingleFile/ConvertedSingleFile.wxs | 60 --- src/test/wixcop/TestData/SingleFile/SingleFile.wxs | 61 --- src/test/wixcop/WixCopFixture.cs | 162 -------- src/test/wixcop/WixCopTests.csproj | 40 -- src/wixcop/CommandLine/ConvertCommand.cs | 21 +- src/wixcop/CommandLine/HelpCommand.cs | 8 +- src/wixcop/CommandLine/WixCopCommandLineParser.cs | 82 ++-- src/wixcop/Converter.cs | 56 ++- src/wixcop/Interfaces/IWixCopCommandLineParser.cs | 6 +- src/wixcop/Program.cs | 6 +- 24 files changed, 1035 insertions(+), 964 deletions(-) create mode 100644 src/test/WixToolsetTest.WixCop/ConverterFixture.cs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml create mode 100644 src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs create mode 100644 src/test/WixToolsetTest.WixCop/WixCopFixture.cs create mode 100644 src/test/WixToolsetTest.WixCop/WixCopRunner.cs create mode 100644 src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs create mode 100644 src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj delete mode 100644 src/test/wixcop/ConverterFixture.cs delete mode 100644 src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs delete mode 100644 src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs delete mode 100644 src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml delete mode 100644 src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs delete mode 100644 src/test/wixcop/TestData/SingleFile/SingleFile.wxs delete mode 100644 src/test/wixcop/WixCopFixture.cs delete mode 100644 src/test/wixcop/WixCopTests.csproj diff --git a/src/test/WixToolsetTest.WixCop/ConverterFixture.cs b/src/test/WixToolsetTest.WixCop/ConverterFixture.cs new file mode 100644 index 00000000..86931d5a --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/ConverterFixture.cs @@ -0,0 +1,452 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.WixCop +{ + using System; + using System.IO; + using System.Text; + using System.Xml.Linq; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + using WixToolset.Tools.WixCop; + using Xunit; + + public class ConverterFixture + { + private static readonly XNamespace Wix4Namespace = "http://wixtoolset.org/schemas/v4/wxs"; + + [Fact] + public void EnsuresDeclaration() + { + var parse = String.Join(Environment.NewLine, + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void EnsuresUtf8Declaration() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 4, null, null); + + var errors = converter.ConvertDocument(document); + + Assert.Equal(1, errors); + Assert.Equal("1.0", document.Declaration.Version); + Assert.Equal("utf-8", document.Declaration.Encoding); + } + + [Fact] + public void CanFixWhitespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 4, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(4, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanFixCdataWhitespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + " ", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(expected, actual); + Assert.Equal(2, errors); + } + + [Fact] + public void CanFixCdataWithWhitespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + " ", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(expected, actual); + Assert.Equal(2, errors); + } + + [Fact] + public void CanConvertMainNamespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + //Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertNamedMainNamespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); + } + + [Fact] + public void CanConvertNonWixDefaultNamespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(expected, actual); + Assert.Equal(2, errors); + Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); + Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace()); + } + + [Fact] + public void CanConvertExtensionNamespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(2, errors); + Assert.Equal(expected, actual); + Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); + } + + [Fact] + public void CanConvertMissingNamespace() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); + } + + [Fact] + public void CanConvertAnonymousFile() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertSuppressSignatureValidationNo() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + [Fact] + public void CanConvertSuppressSignatureValidationYes() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + + private static string UnformattedDocumentString(XDocument document) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + document.Save(writer, SaveOptions.DisableFormatting); + } + + return sb.ToString(); + } + + private class DummyMessaging : IMessaging + { + public bool EncounteredError { get; set; } + + public int LastErrorNumber { get; set; } + + public bool ShowVerboseMessages { get; set; } + + public bool SuppressAllWarnings { get; set; } + + public bool WarningsAsError { get; set; } + + public void ElevateWarningMessage(int warningNumber) + { + } + + public string FormatMessage(Message message) => String.Empty; + + public void SetListener(IMessageListener listener) + { + } + + public void SuppressWarningMessage(int warningNumber) + { + } + + public void Write(Message message) + { + } + + public void Write(string message, bool verbose = false) + { + } + } + } +} diff --git a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs new file mode 100644 index 00000000..d6280185 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs new file mode 100644 index 00000000..2eb908c2 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml new file mode 100644 index 00000000..9d3ad496 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs b/src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs new file mode 100644 index 00000000..aacb68fa --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs b/src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs new file mode 100644 index 00000000..310ae811 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs new file mode 100644 index 00000000..1025eac8 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs @@ -0,0 +1,108 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.WixCop +{ + using System.IO; + using WixBuildTools.TestSupport; + using Xunit; + + public class WixCopFixture + { + [Fact] + public void CanConvertSingleFile() + { + const string beforeFileName = "SingleFile.wxs"; + const string afterFileName = "ConvertedSingleFile.wxs"; + var folder = TestData.Get(@"TestData\SingleFile"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(true); + var targetFile = Path.Combine(baseFolder, beforeFileName); + File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); + + var runner = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result = runner.Execute(); + + Assert.Equal(2, result.ExitCode); + + var actualLines = File.ReadAllLines(targetFile); + var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); + + for (var i = 0; i < actualLines.Length && i < expectedLines.Length; ++i) + { + Assert.Equal(expectedLines[i], actualLines[i]); + } + Assert.Equal(expectedLines.Length, actualLines.Length); + + var runner2 = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result2 = runner2.Execute(); + + Assert.Equal(0, result2.ExitCode); + } + } + + [Fact] + public void RetainsPreprocessorInstructions() + { + const string beforeFileName = "Preprocessor.wxs"; + const string afterFileName = "ConvertedPreprocessor.wxs"; + var folder = TestData.Get(@"TestData\Preprocessor"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(true); + var targetFile = Path.Combine(baseFolder, beforeFileName); + File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); + + var runner = new WixCopRunner + { + FixErrors = true, + SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), + SearchPatterns = + { + targetFile, + }, + }; + + var result = runner.Execute(); + + Assert.Equal(2, result.ExitCode); + + var actualLines = File.ReadAllLines(targetFile); + var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); + Assert.Equal(expectedLines, actualLines); + + var runner2 = new WixCopRunner + { + FixErrors = true, + SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), + SearchPatterns = + { + targetFile, + }, + }; + + var result2 = runner2.Execute(); + + Assert.Equal(0, result2.ExitCode); + } + } + } +} diff --git a/src/test/WixToolsetTest.WixCop/WixCopRunner.cs b/src/test/WixToolsetTest.WixCop/WixCopRunner.cs new file mode 100644 index 00000000..b831baa7 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/WixCopRunner.cs @@ -0,0 +1,67 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.WixCop +{ + using System; + using System.Collections.Generic; + using WixToolset.Core; + using WixToolset.Core.TestPackage; + using WixToolset.Extensibility; + using WixToolset.Tools.WixCop; + using WixToolset.Tools.WixCop.CommandLine; + using WixToolset.Tools.WixCop.Interfaces; + + public class WixCopRunner + { + public bool FixErrors { get; set; } + + public List SearchPatterns { get; } = new List(); + + public string SettingFile1 { get; set; } + + public WixCopRunnerResult Execute() + { + var argList = new List(); + + if (this.FixErrors) + { + argList.Add("-f"); + } + + if (!String.IsNullOrEmpty(this.SettingFile1)) + { + argList.Add($"-set1{this.SettingFile1}"); + } + + foreach (var searchPattern in this.SearchPatterns) + { + argList.Add(searchPattern); + } + + return WixCopRunner.Execute(argList.ToArray()); + } + + public static WixCopRunnerResult Execute(string[] args) + { + var listener = new TestMessageListener(); + + var serviceProvider = new WixToolsetServiceProvider(); + serviceProvider.AddService((x, y) => listener); + serviceProvider.AddService((x, y) => new WixCopCommandLineParser(x)); + + var exitCode = Execute(serviceProvider, args); + + return new WixCopRunnerResult + { + ExitCode = exitCode, + Messages = listener.Messages.ToArray() + }; + } + + public static int Execute(IServiceProvider serviceProvider, string[] args) + { + var wixcop = new Program(); + return wixcop.Run(serviceProvider, args); + } + } +} diff --git a/src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs b/src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs new file mode 100644 index 00000000..1b35e491 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.WixCop +{ + using System; + using System.Linq; + using WixToolset.Data; + using Xunit; + + public class WixCopRunnerResult + { + public int ExitCode { get; set; } + + public Message[] Messages { get; set; } + + public WixCopRunnerResult AssertSuccess() + { + Assert.True(0 == this.ExitCode, $"WixCop failed unexpectedly. Output:\r\n{String.Join("\r\n", this.Messages.Select(m => m.ToString()).ToArray())}"); + return this; + } + } +} diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj new file mode 100644 index 00000000..6b41b6b6 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj @@ -0,0 +1,41 @@ + + + + + + net461 + false + embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/wixcop/ConverterFixture.cs b/src/test/wixcop/ConverterFixture.cs deleted file mode 100644 index 45ccc33e..00000000 --- a/src/test/wixcop/ConverterFixture.cs +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixTest.WixUnitTest -{ - using System; - using System.IO; - using System.Text; - using System.Xml.Linq; - using WixCop; - using WixToolset; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - using Xunit; - - public class ConverterFixture - { - private static readonly XNamespace Wix4Namespace = "http://wixtoolset.org/schemas/v4/wxs"; - - [Fact] - public void EnsuresDeclaration() - { - string parse = String.Join(Environment.NewLine, - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void EnsuresUtf8Declaration() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 4, null, null); - - int errors = converter.ConvertDocument(document); - - Assert.Equal(1, errors); - Assert.Equal("1.0", document.Declaration.Version); - Assert.Equal("utf-8", document.Declaration.Encoding); - } - - [Fact] - public void CanFixWhitespace() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 4, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(4, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanFixCdataWhitespace() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - " ", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertMainNamespace() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - //Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertNamedMainNamespace() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); - } - - [Fact] - public void CanConvertNonWixDefaultNamespace() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); - Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace()); - } - - [Fact] - public void CanConvertExtensionNamespace() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); - } - - [Fact] - public void CanConvertMissingNamespace() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); - } - - [Fact] - public void CanConvertAnonymousFile() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertSuppressSignatureValidationNo() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertSuppressSignatureValidationYes() - { - string parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - string expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - XDocument document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - Converter converter = new Converter(messaging, 2, null, null); - - int errors = converter.ConvertDocument(document); - - string actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - private static string UnformattedDocumentString(XDocument document) - { - StringBuilder sb = new StringBuilder(); - - using (StringWriter writer = new StringWriter(sb)) - { - document.Save(writer, SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces); - } - - return sb.ToString(); - } - - private class DummyMessaging : IMessaging - { - public bool EncounteredError { get; set; } - - public int LastErrorNumber { get; set; } - - public bool ShowVerboseMessages { get; set; } - public bool SuppressAllWarnings { get; set; } - public bool WarningsAsError { get; set; } - - public void ElevateWarningMessage(int warningNumber) - { - } - - public string FormatMessage(Message message) - { - return ""; - } - - public void SetListener(IMessageListener listener) - { - } - - public void SuppressWarningMessage(int warningNumber) - { - } - - public void Write(Message message) - { - } - - public void Write(string message, bool verbose = false) - { - } - } - } -} diff --git a/src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs b/src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs deleted file mode 100644 index d6280185..00000000 --- a/src/test/wixcop/TestData/Preprocessor/ConvertedPreprocessor.wxs +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs b/src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs deleted file mode 100644 index 2eb908c2..00000000 --- a/src/test/wixcop/TestData/Preprocessor/Preprocessor.wxs +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml b/src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml deleted file mode 100644 index 9d3ad496..00000000 --- a/src/test/wixcop/TestData/Preprocessor/wixcop.settings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs b/src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs deleted file mode 100644 index aacb68fa..00000000 --- a/src/test/wixcop/TestData/SingleFile/ConvertedSingleFile.wxs +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/wixcop/TestData/SingleFile/SingleFile.wxs b/src/test/wixcop/TestData/SingleFile/SingleFile.wxs deleted file mode 100644 index 310ae811..00000000 --- a/src/test/wixcop/TestData/SingleFile/SingleFile.wxs +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/wixcop/WixCopFixture.cs b/src/test/wixcop/WixCopFixture.cs deleted file mode 100644 index 1fa49be9..00000000 --- a/src/test/wixcop/WixCopFixture.cs +++ /dev/null @@ -1,162 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using WixBuildTools.TestSupport; -using WixCop.CommandLine; -using WixCop.Interfaces; -using WixToolset.Core; -using WixToolset.Core.TestPackage; -using WixToolset.Extensibility; -using WixToolset.Extensibility.Services; -using Xunit; - -namespace WixCopTests -{ - public class WixCopFixture - { - [Fact] - public void CanConvertSingleFile() - { - const string beforeFileName = "SingleFile.wxs"; - const string afterFileName = "ConvertedSingleFile.wxs"; - var folder = TestData.Get(@"TestData\SingleFile"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(true); - var targetFile = Path.Combine(baseFolder, beforeFileName); - File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); - - var runner = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result = runner.Execute(out var messages); - - Assert.Equal(2, result); - - var actualLines = File.ReadAllLines(targetFile); - var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); - Assert.Equal(expectedLines, actualLines); - - var runner2 = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result2 = runner2.Execute(out var messages2); - - Assert.Equal(0, result2); - } - } - - [Fact] - public void RetainsPreprocessorInstructions() - { - const string beforeFileName = "Preprocessor.wxs"; - const string afterFileName = "ConvertedPreprocessor.wxs"; - var folder = TestData.Get(@"TestData\Preprocessor"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(true); - var targetFile = Path.Combine(baseFolder, beforeFileName); - File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); - - var runner = new WixCopRunner - { - FixErrors = true, - SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), - SearchPatterns = - { - targetFile, - }, - }; - - var result = runner.Execute(out var messages); - - Assert.Equal(2, result); - - var actualLines = File.ReadAllLines(targetFile); - var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); - Assert.Equal(expectedLines, actualLines); - - var runner2 = new WixCopRunner - { - FixErrors = true, - SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), - SearchPatterns = - { - targetFile, - }, - }; - - var result2 = runner2.Execute(out var messages2); - - Assert.Equal(0, result2); - } - } - - private class WixCopRunner - { - public bool FixErrors { get; set; } - - public List SearchPatterns { get; } = new List(); - - public string SettingFile1 { get; set; } - - public int Execute(out List messages) - { - var argList = new List(); - - if (this.FixErrors) - { - argList.Add("-f"); - } - - if (!String.IsNullOrEmpty(this.SettingFile1)) - { - argList.Add($"-set1{this.SettingFile1}"); - } - - foreach (string searchPattern in this.SearchPatterns) - { - argList.Add(searchPattern); - } - - return WixCopRunner.Execute(argList.ToArray(), out messages); - } - - public static int Execute(string[] args, out List messages) - { - var listener = new TestMessageListener(); - - var serviceProvider = new WixToolsetServiceProvider(); - serviceProvider.AddService((x, y) => listener); - serviceProvider.AddService((x, y) => new WixCopCommandLineParser(x)); - - var result = Execute(serviceProvider, args); - - var messaging = serviceProvider.GetService(); - messages = listener.Messages.Select(x => messaging.FormatMessage(x)).ToList(); - return result; - } - - public static int Execute(IServiceProvider serviceProvider, string[] args) - { - var wixcop = new WixCop.Program(); - return wixcop.Run(serviceProvider, args); - } - } - } -} diff --git a/src/test/wixcop/WixCopTests.csproj b/src/test/wixcop/WixCopTests.csproj deleted file mode 100644 index 012ef4db..00000000 --- a/src/test/wixcop/WixCopTests.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - net461 - false - embedded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/wixcop/CommandLine/ConvertCommand.cs b/src/wixcop/CommandLine/ConvertCommand.cs index 6af7d4ca..ab7cd359 100644 --- a/src/wixcop/CommandLine/ConvertCommand.cs +++ b/src/wixcop/CommandLine/ConvertCommand.cs @@ -1,13 +1,14 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Xml; -using WixToolset.Extensibility.Data; -using WixToolset.Extensibility.Services; - -namespace WixCop.CommandLine +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools.WixCop.CommandLine { + using System; + using System.Collections.Generic; + using System.IO; + using System.Xml; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + internal class ConvertCommand : ICommandLineCommand { private const string SettingsFileDefault = "wixcop.settings.xml"; @@ -69,7 +70,7 @@ namespace WixCop.CommandLine var errors = this.InspectSubDirectories(converter, Path.GetFullPath(".")); - foreach (string searchPattern in this.SearchPatterns) + foreach (var searchPattern in this.SearchPatterns) { if (!this.SearchPatternResults.Contains(searchPattern)) { diff --git a/src/wixcop/CommandLine/HelpCommand.cs b/src/wixcop/CommandLine/HelpCommand.cs index a75dac5c..bfb784b0 100644 --- a/src/wixcop/CommandLine/HelpCommand.cs +++ b/src/wixcop/CommandLine/HelpCommand.cs @@ -1,8 +1,10 @@ -using System; -using WixToolset.Extensibility.Data; +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixCop.CommandLine +namespace WixToolset.Tools.WixCop.CommandLine { + using System; + using WixToolset.Extensibility.Data; + internal class HelpCommand : ICommandLineCommand { public int Execute() diff --git a/src/wixcop/CommandLine/WixCopCommandLineParser.cs b/src/wixcop/CommandLine/WixCopCommandLineParser.cs index 53012cfd..ae826d4f 100644 --- a/src/wixcop/CommandLine/WixCopCommandLineParser.cs +++ b/src/wixcop/CommandLine/WixCopCommandLineParser.cs @@ -1,12 +1,14 @@ -using System; -using System.Collections.Generic; -using WixCop.Interfaces; -using WixToolset.Core; -using WixToolset.Extensibility.Data; -using WixToolset.Extensibility.Services; +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixCop.CommandLine +namespace WixToolset.Tools.WixCop.CommandLine { + using System; + using System.Collections.Generic; + using WixToolset.Core; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Tools.WixCop.Interfaces; + public sealed class WixCopCommandLineParser : IWixCopCommandLineParser { private bool fixErrors; @@ -89,43 +91,43 @@ namespace WixCop.CommandLine switch (parameter.ToLowerInvariant()) { - case "?": - this.showHelp = true; - return true; - case "f": - this.fixErrors = true; - return true; - case "nologo": - this.showLogo = false; - return true; - case "s": - this.subDirectories = true; - return true; - default: // other parameters - if (parameter.StartsWith("set1", StringComparison.Ordinal)) - { - this.settingsFile1 = parameter.Substring(4); - } - else if (parameter.StartsWith("set2", StringComparison.Ordinal)) - { - this.settingsFile2 = parameter.Substring(4); - } - else if (parameter.StartsWith("indent:", StringComparison.Ordinal)) + case "?": + this.showHelp = true; + return true; + case "f": + this.fixErrors = true; + return true; + case "nologo": + this.showLogo = false; + return true; + case "s": + this.subDirectories = true; + return true; + default: // other parameters + if (parameter.StartsWith("set1", StringComparison.Ordinal)) + { + this.settingsFile1 = parameter.Substring(4); + } + else if (parameter.StartsWith("set2", StringComparison.Ordinal)) + { + this.settingsFile2 = parameter.Substring(4); + } + else if (parameter.StartsWith("indent:", StringComparison.Ordinal)) + { + try { - try - { - this.indentationAmount = Convert.ToInt32(parameter.Substring(7)); - } - catch - { - throw new ArgumentException("Invalid numeric argument.", parameter); - } + this.indentationAmount = Convert.ToInt32(parameter.Substring(7)); } - else + catch { - throw new ArgumentException("Invalid argument.", parameter); + throw new ArgumentException("Invalid numeric argument.", parameter); } - return true; + } + else + { + throw new ArgumentException("Invalid argument.", parameter); + } + return true; } } } diff --git a/src/wixcop/Converter.cs b/src/wixcop/Converter.cs index a204ebe0..7e8486ab 100644 --- a/src/wixcop/Converter.cs +++ b/src/wixcop/Converter.cs @@ -1,6 +1,6 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixCop +namespace WixToolset.Tools.WixCop { using System; using System.Collections.Generic; @@ -141,7 +141,7 @@ namespace WixCop { try { - using (StreamWriter writer = File.CreateText(this.SourceFile)) + using (var writer = File.CreateText(this.SourceFile)) { document.Save(writer, SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces); } @@ -162,7 +162,7 @@ namespace WixCop /// The number of errors found. public int ConvertDocument(XDocument document) { - XDeclaration declaration = document.Declaration; + var declaration = document.Declaration; // Convert the declaration. if (null != declaration) @@ -206,7 +206,7 @@ namespace WixCop } // Convert this node if it is an element. - XElement element = node as XElement; + var element = node as XElement; if (null != element) { @@ -215,7 +215,7 @@ namespace WixCop // Convert all children of this element. IEnumerable children = element.Nodes().ToList(); - foreach (XNode child in children) + foreach (var child in children) { this.ConvertNode(child, level + 1); } @@ -225,9 +225,9 @@ namespace WixCop private void ConvertElement(XElement element) { // Gather any deprecated namespaces, then update this element tree based on those deprecations. - Dictionary deprecatedToUpdatedNamespaces = new Dictionary(); + var deprecatedToUpdatedNamespaces = new Dictionary(); - foreach (XAttribute declaration in element.Attributes().Where(a => a.IsNamespaceDeclaration)) + foreach (var declaration in element.Attributes().Where(a => a.IsNamespaceDeclaration)) { XNamespace ns; @@ -258,7 +258,7 @@ namespace WixCop { if (null == element.Attribute("Id")) { - XAttribute attribute = element.Attribute("Name"); + var attribute = element.Attribute("Name"); if (null == attribute) { @@ -267,7 +267,7 @@ namespace WixCop if (null != attribute) { - string name = Path.GetFileName(attribute.Value); + var name = Path.GetFileName(attribute.Value); if (this.OnError(ConverterTestType.AssignAnonymousFileId, element, "The file id is being updated to '{0}' to ensure it remains the same as the default", name)) { @@ -282,7 +282,7 @@ namespace WixCop private void ConvertSuppressSignatureValidation(XElement element) { - XAttribute suppressSignatureValidation = element.Attribute("SuppressSignatureValidation"); + var suppressSignatureValidation = element.Attribute("SuppressSignatureValidation"); if (null != suppressSignatureValidation) { @@ -311,7 +311,7 @@ namespace WixCop element.Add(new XAttribute("xmlns", WixNamespace.NamespaceName)); // set the default namespace. - foreach (XElement elementWithoutNamespace in element.Elements().Where(e => XNamespace.None == e.Name.Namespace)) + foreach (var elementWithoutNamespace in element.Elements().Where(e => XNamespace.None == e.Name.Namespace)) { elementWithoutNamespace.Name = WixNamespace.GetName(elementWithoutNamespace.Name.LocalName); } @@ -326,9 +326,7 @@ namespace WixCop private void ConvertWhitespace(XNode node, int level) { // Fix the whitespace before this node. - XText whitespace = node.PreviousNode as XText; - - if (null != whitespace) + if (node.PreviousNode is XText whitespace) { if (XmlNodeType.CDATA == node.NodeType) { @@ -351,9 +349,7 @@ namespace WixCop } // Fix the whitespace after CDATA nodes. - XCData cdata = node as XCData; - - if (null != cdata) + if (node is XCData cdata) { whitespace = cdata.NextNode as XText; @@ -368,9 +364,7 @@ namespace WixCop else { // Fix the whitespace inside and after this node (except for Error which may contain just whitespace). - XElement element = node as XElement; - - if (null != element && "Error" != element.Name.LocalName) + if (node is XElement element && "Error" != element.Name.LocalName) { if (!element.HasElements && !element.IsEmpty && String.IsNullOrEmpty(element.Value.Trim())) { @@ -403,7 +397,7 @@ namespace WixCop { if (null != types) { - foreach (string type in types) + foreach (var type in types) { ConverterTestType itt; @@ -421,7 +415,7 @@ namespace WixCop private static void UpdateElementsWithDeprecatedNamespaces(IEnumerable elements, Dictionary deprecatedToUpdatedNamespaces) { - foreach (XElement element in elements) + foreach (var element in elements) { XNamespace ns; @@ -434,9 +428,9 @@ namespace WixCop IEnumerable attributes = element.Attributes().ToList(); element.RemoveAttributes(); - foreach (XAttribute attribute in attributes) + foreach (var attribute in attributes) { - XAttribute convertedAttribute = attribute; + var convertedAttribute = attribute; if (attribute.IsNamespaceDeclaration) { @@ -477,7 +471,7 @@ namespace WixCop } // check the spaces - foreach (char character in whitespace) + foreach (var character in whitespace) { if (' ' != character) { @@ -496,9 +490,9 @@ namespace WixCop /// The whitespace node to fix. private static void FixWhitespace(int indentationAmount, int level, XText whitespace) { - int newLineCount = 0; + var newLineCount = 0; - for (int i = 0; i + 1 < whitespace.Value.Length; ++i) + for (var i = 0; i + 1 < whitespace.Value.Length; ++i) { if (XDocumentNewLine == whitespace.Value.Substring(i, 2)) { @@ -516,7 +510,7 @@ namespace WixCop whitespace.Value = String.Empty; // add the correct number of newlines - for (int i = 0; i < newLineCount; ++i) + for (var i = 0; i < newLineCount; ++i) { whitespace.Value = String.Concat(whitespace.Value, XDocumentNewLine); } @@ -543,9 +537,9 @@ namespace WixCop // Increase the error count. this.Errors++; - SourceLineNumber sourceLine = (null == node) ? new SourceLineNumber(this.SourceFile ?? "wixcop.exe") : new SourceLineNumber(this.SourceFile, ((IXmlLineInfo)node).LineNumber); - bool warning = this.ErrorsAsWarnings.Contains(converterTestType); - string display = String.Format(CultureInfo.CurrentCulture, message, args); + var sourceLine = (null == node) ? new SourceLineNumber(this.SourceFile ?? "wixcop.exe") : new SourceLineNumber(this.SourceFile, ((IXmlLineInfo)node).LineNumber); + var warning = this.ErrorsAsWarnings.Contains(converterTestType); + var display = String.Format(CultureInfo.CurrentCulture, message, args); var msg = new Message(sourceLine, warning ? MessageLevel.Warning : MessageLevel.Error, (int)converterTestType, "{0} ({1})", display, converterTestType.ToString()); diff --git a/src/wixcop/Interfaces/IWixCopCommandLineParser.cs b/src/wixcop/Interfaces/IWixCopCommandLineParser.cs index 2093f5d8..44c75289 100644 --- a/src/wixcop/Interfaces/IWixCopCommandLineParser.cs +++ b/src/wixcop/Interfaces/IWixCopCommandLineParser.cs @@ -1,7 +1,9 @@ -using WixToolset.Extensibility.Data; +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixCop.Interfaces +namespace WixToolset.Tools.WixCop.Interfaces { + using WixToolset.Extensibility.Data; + public interface IWixCopCommandLineParser { ICommandLineArguments Arguments { get; set; } diff --git a/src/wixcop/Program.cs b/src/wixcop/Program.cs index b26bd6c9..8e9534f6 100644 --- a/src/wixcop/Program.cs +++ b/src/wixcop/Program.cs @@ -1,15 +1,15 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -namespace WixCop +namespace WixToolset.Tools.WixCop { using System; - using WixCop.CommandLine; - using WixCop.Interfaces; using WixToolset.Core; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; using WixToolset.Tools.Core; + using WixToolset.Tools.WixCop.CommandLine; + using WixToolset.Tools.WixCop.Interfaces; /// /// Wix source code style inspector and converter. -- cgit v1.2.3-55-g6feb From eb4e0c543148f70a0c442d829848a3e3e1d33a91 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Oct 2018 14:08:33 -0700 Subject: Update test to respect new WiX v4 public Id behavior --- .../TestData/Preprocessor/ConvertedPreprocessor.wxs | 2 +- src/test/WixToolsetTest.WixCop/WixCopFixture.cs | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs index d6280185..dcd43e35 100644 --- a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs +++ b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs @@ -41,7 +41,7 @@ - + diff --git a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs index 1025eac8..2bbc3d9f 100644 --- a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs +++ b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs @@ -34,14 +34,9 @@ namespace WixToolsetTest.WixCop Assert.Equal(2, result.ExitCode); - var actualLines = File.ReadAllLines(targetFile); - var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); - - for (var i = 0; i < actualLines.Length && i < expectedLines.Length; ++i) - { - Assert.Equal(expectedLines[i], actualLines[i]); - } - Assert.Equal(expectedLines.Length, actualLines.Length); + var expected = File.ReadAllText(Path.Combine(folder, afterFileName)); + var actual = File.ReadAllText(targetFile); + Assert.Equal(expected, actual); var runner2 = new WixCopRunner { @@ -85,9 +80,9 @@ namespace WixToolsetTest.WixCop Assert.Equal(2, result.ExitCode); - var actualLines = File.ReadAllLines(targetFile); - var expectedLines = File.ReadAllLines(Path.Combine(folder, afterFileName)); - Assert.Equal(expectedLines, actualLines); + var expected = File.ReadAllText(Path.Combine(folder, afterFileName)); + var actual = File.ReadAllText(targetFile); + Assert.Equal(expected, actual); var runner2 = new WixCopRunner { -- cgit v1.2.3-55-g6feb From 784208bd46ce05025d8ccaef8542328350038d90 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Oct 2018 13:54:59 -0700 Subject: Simplify whitespace handling and fix some long standing bugs in it Fixes wixtoolset/issues#5883 --- src/test/WixToolsetTest.WixCop/ConverterFixture.cs | 74 ++++++ src/wixcop/Converter.cs | 267 ++++++++------------- 2 files changed, 171 insertions(+), 170 deletions(-) diff --git a/src/test/WixToolsetTest.WixCop/ConverterFixture.cs b/src/test/WixToolsetTest.WixCop/ConverterFixture.cs index 86931d5a..863a781a 100644 --- a/src/test/WixToolsetTest.WixCop/ConverterFixture.cs +++ b/src/test/WixToolsetTest.WixCop/ConverterFixture.cs @@ -94,8 +94,82 @@ namespace WixToolsetTest.WixCop var actual = UnformattedDocumentString(document); + Assert.Equal(expected, actual); Assert.Equal(4, errors); + } + + [Fact] + public void CanPreserveNewLines() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + "", + " ", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + "", + " ", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 4, null, null); + + var conversions = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(expected, actual); + Assert.Equal(3, conversions); + } + + [Fact] + public void CanConvertWithNewLineAtEndOfFile() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + "", + " ", + "", + " ", + "", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + "", + " ", + "", + " ", + "", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 4, null, null); + + var conversions = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + Assert.Equal(expected, actual); + Assert.Equal(3, conversions); } [Fact] diff --git a/src/wixcop/Converter.cs b/src/wixcop/Converter.cs index 7e8486ab..e125b39c 100644 --- a/src/wixcop/Converter.cs +++ b/src/wixcop/Converter.cs @@ -7,6 +7,7 @@ namespace WixToolset.Tools.WixCop using System.Globalization; using System.IO; using System.Linq; + using System.Text; using System.Xml; using System.Xml.Linq; using WixToolset.Data; @@ -18,7 +19,7 @@ namespace WixToolset.Tools.WixCop /// public class Converter { - private const string XDocumentNewLine = "\n"; // XDocument normlizes "\r\n" to just "\n". + private const char XDocumentNewLine = '\n'; // XDocument normalizes "\r\n" to just "\n". private static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; private static readonly XName FileElementName = WixNamespace + "File"; @@ -58,7 +59,7 @@ namespace WixToolset.Tools.WixCop { "http://schemas.microsoft.com/wix/2006/WixUnit", "http://wixtoolset.org/schemas/v4/wixunit" }, }; - private Dictionary> ConvertElementMapping; + private readonly Dictionary> ConvertElementMapping; /// /// Instantiate a new Converter class. @@ -79,14 +80,16 @@ namespace WixToolset.Tools.WixCop { Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace }, };*/ - this.ConvertElementMapping = new Dictionary>(); - this.ConvertElementMapping.Add(Converter.FileElementName, this.ConvertFileElement); - this.ConvertElementMapping.Add(Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation); - this.ConvertElementMapping.Add(Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation); - this.ConvertElementMapping.Add(Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation); - this.ConvertElementMapping.Add(Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation); - this.ConvertElementMapping.Add(Converter.PayloadElementName, this.ConvertSuppressSignatureValidation); - this.ConvertElementMapping.Add(Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace); + this.ConvertElementMapping = new Dictionary> + { + { Converter.FileElementName, this.ConvertFileElement }, + { Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation }, + { Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, + { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace } + }; this.Messaging = messaging; @@ -129,7 +132,7 @@ namespace WixToolset.Tools.WixCop } catch (XmlException e) { - this.OnError(ConverterTestType.XmlException, (XObject)null, "The xml is invalid. Detail: '{0}'", e.Message); + this.OnError(ConverterTestType.XmlException, null, "The xml is invalid. Detail: '{0}'", e.Message); return this.Errors; } @@ -148,7 +151,7 @@ namespace WixToolset.Tools.WixCop } catch (UnauthorizedAccessException) { - this.OnError(ConverterTestType.UnauthorizedAccessException, (XObject)null, "Could not write to file."); + this.OnError(ConverterTestType.UnauthorizedAccessException, null, "Could not write to file."); } } @@ -177,51 +180,90 @@ namespace WixToolset.Tools.WixCop } else // missing declaration { - if (this.OnError(ConverterTestType.DeclarationMissing, (XNode)null, "This file is missing an XML declaration on the first line.")) + if (this.OnError(ConverterTestType.DeclarationMissing, null, "This file is missing an XML declaration on the first line.")) { document.Declaration = new XDeclaration("1.0", "utf-8", null); - document.Root.AddBeforeSelf(new XText(XDocumentNewLine)); + document.Root.AddBeforeSelf(new XText(XDocumentNewLine.ToString())); } } // Start converting the nodes at the top. - this.ConvertNode(document.Root, 0); + this.ConvertNodes(document.Nodes(), 0); return this.Errors; } - /// - /// Convert a single xml node. - /// - /// The node to convert. - /// The depth level of the node. - /// The converted node. - private void ConvertNode(XNode node, int level) + private void ConvertNodes(IEnumerable nodes, int level) { - // Convert this node's whitespace. - if ((XmlNodeType.Comment == node.NodeType && 0 > ((XComment)node).Value.IndexOf(XDocumentNewLine, StringComparison.Ordinal)) || - XmlNodeType.CDATA == node.NodeType || XmlNodeType.Element == node.NodeType || XmlNodeType.ProcessingInstruction == node.NodeType) + // Note we operate on a copy of the node list since we may + // remove some whitespace nodes during this processing. + foreach (var node in nodes.ToList()) { - this.ConvertWhitespace(node, level); - } + if (node is XText text) + { + if (!String.IsNullOrWhiteSpace(text.Value)) + { + text.Value = text.Value.Trim(); + } + else if (node.NextNode is XCData cdata) + { + this.EnsurePrecedingWhitespaceRemoved(text, node, ConverterTestType.WhitespacePrecedingNodeWrong); + } + else if (node.NextNode is XElement element) + { + this.EnsurePrecedingWhitespaceCorrect(text, node, level, ConverterTestType.WhitespacePrecedingNodeWrong); + } + else if (node.NextNode is null) // this is the space before the close element + { + if (node.PreviousNode is null || node.PreviousNode is XCData) + { + this.EnsurePrecedingWhitespaceRemoved(text, node.Parent, ConverterTestType.WhitespacePrecedingEndElementWrong); + } + else if (level == 0) // root element's close tag + { + this.EnsurePrecedingWhitespaceCorrect(text, node, 0, ConverterTestType.WhitespacePrecedingEndElementWrong); + } + else + { + this.EnsurePrecedingWhitespaceCorrect(text, node, level - 1, ConverterTestType.WhitespacePrecedingEndElementWrong); + } + } + } + else if (node is XElement element) + { + this.ConvertElement(element); - // Convert this node if it is an element. - var element = node as XElement; + this.ConvertNodes(element.Nodes(), level + 1); + } + } + } - if (null != element) + private void EnsurePrecedingWhitespaceCorrect(XText whitespace, XNode node, int level, ConverterTestType testType) + { + if (!Converter.LeadingWhitespaceValid(this.IndentationAmount, level, whitespace.Value)) { - this.ConvertElement(element); - - // Convert all children of this element. - IEnumerable children = element.Nodes().ToList(); + var message = testType == ConverterTestType.WhitespacePrecedingEndElementWrong ? "The whitespace preceding this end element is incorrect." : "The whitespace preceding this node is incorrect."; - foreach (var child in children) + if (this.OnError(testType, node, message)) { - this.ConvertNode(child, level + 1); + Converter.FixupWhitespace(this.IndentationAmount, level, whitespace); } } } + private void EnsurePrecedingWhitespaceRemoved(XText whitespace, XNode node, ConverterTestType testType) + { + if (!String.IsNullOrEmpty(whitespace.Value)) + { + var message = testType == ConverterTestType.WhitespacePrecedingEndElementWrong ? "The whitespace preceding this end element is incorrect." : "The whitespace preceding this node is incorrect."; + + if (this.OnError(testType, node, message)) + { + whitespace.Remove(); + } + } + } + private void ConvertElement(XElement element) { // Gather any deprecated namespaces, then update this element tree based on those deprecations. @@ -229,9 +271,7 @@ namespace WixToolset.Tools.WixCop foreach (var declaration in element.Attributes().Where(a => a.IsNamespaceDeclaration)) { - XNamespace ns; - - if (Converter.OldToNewNamespaceMapping.TryGetValue(declaration.Value, out ns)) + if (Converter.OldToNewNamespaceMapping.TryGetValue(declaration.Value, out var ns)) { if (this.OnError(ConverterTestType.XmlnsValueWrong, declaration, "The namespace '{0}' is out of date. It must be '{1}'.", declaration.Value, ns.NamespaceName)) { @@ -245,10 +285,8 @@ namespace WixToolset.Tools.WixCop Converter.UpdateElementsWithDeprecatedNamespaces(element.DescendantsAndSelf(), deprecatedToUpdatedNamespaces); } - // Convert the node in much greater detail. - Action convert; - - if (this.ConvertElementMapping.TryGetValue(element.Name, out convert)) + // Apply any specialized conversion actions. + if (this.ConvertElementMapping.TryGetValue(element.Name, out var convert)) { convert(element); } @@ -318,96 +356,20 @@ namespace WixToolset.Tools.WixCop } } - /// - /// Convert the whitespace adjacent to a node. - /// - /// The node to convert. - /// The depth level of the node. - private void ConvertWhitespace(XNode node, int level) - { - // Fix the whitespace before this node. - if (node.PreviousNode is XText whitespace) - { - if (XmlNodeType.CDATA == node.NodeType) - { - if (this.OnError(ConverterTestType.WhitespacePrecedingCDATAWrong, node, "There should be no whitespace preceding a CDATA node.")) - { - whitespace.Remove(); - } - } - else - { - // TODO: this code complains about whitespace even after the file has been fixed. - if (!Converter.IsLegalWhitespace(this.IndentationAmount, level, whitespace.Value)) - { - if (this.OnError(ConverterTestType.WhitespacePrecedingNodeWrong, node, "The whitespace preceding this node is incorrect.")) - { - Converter.FixWhitespace(this.IndentationAmount, level, whitespace); - } - } - } - } - - // Fix the whitespace after CDATA nodes. - if (node is XCData cdata) - { - whitespace = cdata.NextNode as XText; - - if (null != whitespace) - { - if (this.OnError(ConverterTestType.WhitespaceFollowingCDATAWrong, node, "There should be no whitespace following a CDATA node.")) - { - whitespace.Remove(); - } - } - } - else - { - // Fix the whitespace inside and after this node (except for Error which may contain just whitespace). - if (node is XElement element && "Error" != element.Name.LocalName) - { - if (!element.HasElements && !element.IsEmpty && String.IsNullOrEmpty(element.Value.Trim())) - { - if (this.OnError(ConverterTestType.NotEmptyElement, element, "This should be an empty element since it contains nothing but whitespace.")) - { - element.RemoveNodes(); - } - } - - whitespace = node.NextNode as XText; - - if (null != whitespace) - { - // TODO: this code crashes when level is 0, - // complains about whitespace even after the file has been fixed, - // and the error text doesn't match the error. - if (!Converter.IsLegalWhitespace(this.IndentationAmount, level - 1, whitespace.Value)) - { - if (this.OnError(ConverterTestType.WhitespacePrecedingEndElementWrong, whitespace, "The whitespace preceding this end element is incorrect.")) - { - Converter.FixWhitespace(this.IndentationAmount, level - 1, whitespace); - } - } - } - } - } - } - private IEnumerable YieldConverterTypes(IEnumerable types) { if (null != types) { foreach (var type in types) { - ConverterTestType itt; - if (Enum.TryParse(type, true, out itt)) + if (Enum.TryParse(type, true, out var itt)) { yield return itt; } else // not a known ConverterTestType { - this.OnError(ConverterTestType.ConverterTestTypeUnknown, (XObject)null, "Unknown error type: '{0}'.", type); + this.OnError(ConverterTestType.ConverterTestTypeUnknown, null, "Unknown error type: '{0}'.", type); } } } @@ -417,9 +379,8 @@ namespace WixToolset.Tools.WixCop { foreach (var element in elements) { - XNamespace ns; - if (deprecatedToUpdatedNamespaces.TryGetValue(element.Name.Namespace, out ns)) + if (deprecatedToUpdatedNamespaces.TryGetValue(element.Name.Namespace, out var ns)) { element.Name = ns.GetName(element.Name.LocalName); } @@ -456,67 +417,33 @@ namespace WixToolset.Tools.WixCop /// The depth level that should match this whitespace. /// The whitespace to validate. /// true if the whitespace is legal; false otherwise. - private static bool IsLegalWhitespace(int indentationAmount, int level, string whitespace) + private static bool LeadingWhitespaceValid(int indentationAmount, int level, string whitespace) { - // strip off leading newlines; there can be an arbitrary number of these - while (whitespace.StartsWith(XDocumentNewLine, StringComparison.Ordinal)) - { - whitespace = whitespace.Substring(XDocumentNewLine.Length); - } + // Strip off leading newlines; there can be an arbitrary number of these. + whitespace = whitespace.TrimStart(XDocumentNewLine); - // check the length - if (whitespace.Length != level * indentationAmount) - { - return false; - } + var indentation = new string(' ', level * indentationAmount); - // check the spaces - foreach (var character in whitespace) - { - if (' ' != character) - { - return false; - } - } - - return true; + return whitespace == indentation; } /// - /// Fix the whitespace in a Whitespace node. + /// Fix the whitespace in a whitespace node. /// /// Indentation value to use when validating leading whitespace. /// The depth level of the desired whitespace. /// The whitespace node to fix. - private static void FixWhitespace(int indentationAmount, int level, XText whitespace) + private static void FixupWhitespace(int indentationAmount, int level, XText whitespace) { - var newLineCount = 0; - - for (var i = 0; i + 1 < whitespace.Value.Length; ++i) - { - if (XDocumentNewLine == whitespace.Value.Substring(i, 2)) - { - ++i; // skip an extra character - ++newLineCount; - } - } - - if (0 == newLineCount) - { - newLineCount = 1; - } + var value = new StringBuilder(whitespace.Value.Length); - // reset the whitespace value - whitespace.Value = String.Empty; + // Keep any previous preceeding new lines. + var newlines = whitespace.Value.TakeWhile(c => c == XDocumentNewLine).Count(); - // add the correct number of newlines - for (var i = 0; i < newLineCount; ++i) - { - whitespace.Value = String.Concat(whitespace.Value, XDocumentNewLine); - } + // Ensure there is always at least one new line before the indentation. + value.Append(XDocumentNewLine, newlines == 0 ? 1 : newlines); - // add the correct number of spaces based on configured indentation amount - whitespace.Value = String.Concat(whitespace.Value, new string(' ', level * indentationAmount)); + whitespace.Value = value.Append(' ', level * indentationAmount).ToString(); } /// -- cgit v1.2.3-55-g6feb From 12488939d9756d8d537bca7645ce3524488066b3 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Oct 2018 14:53:40 -0700 Subject: Build test code --- appveyor.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 25481c45..d18c8df8 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -2,8 +2,8 @@ @pushd %~dp0 @set _P=%~dp0build\Release\publish -@rem Disable this test until publishing of native assets is worked out -@rem dotnet build -c Release src\test\WixToolsetTest.BuildTasks +dotnet build -c Release src\test\WixToolsetTest.BuildTasks +dotnet build -c Release src\test\WixToolsetTest.WixCop dotnet publish -c Release -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net461\ -f net461 src\WixToolset.BuildTasks -- cgit v1.2.3-55-g6feb From b1dd80289ef7ba52adeb1a501d637f0399e2710d Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Oct 2018 14:54:49 -0700 Subject: AppVeyor experiment to only build when updating or PR updates master --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 49a9f928..6df37135 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,6 +8,10 @@ environment: DOTNET_CLI_TELEMETRY_OPTOUT: 1 NUGET_XMLDOC_MODE: skip +branches: + only: + - master + build_script: - appveyor.cmd -- cgit v1.2.3-55-g6feb From 34e49f5515995ec30d899879900473bbf07aeda1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 4 Oct 2018 15:15:50 -0700 Subject: Normalize text files line endings because Git isn't being consistent --- src/test/WixToolsetTest.WixCop/WixCopFixture.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs index 2bbc3d9f..9877f9c8 100644 --- a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs +++ b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs @@ -34,8 +34,8 @@ namespace WixToolsetTest.WixCop Assert.Equal(2, result.ExitCode); - var expected = File.ReadAllText(Path.Combine(folder, afterFileName)); - var actual = File.ReadAllText(targetFile); + var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); + var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); Assert.Equal(expected, actual); var runner2 = new WixCopRunner @@ -80,8 +80,8 @@ namespace WixToolsetTest.WixCop Assert.Equal(2, result.ExitCode); - var expected = File.ReadAllText(Path.Combine(folder, afterFileName)); - var actual = File.ReadAllText(targetFile); + var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); + var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); Assert.Equal(expected, actual); var runner2 = new WixCopRunner -- cgit v1.2.3-55-g6feb From 008a6fd58bfb40ed58a184aff40c3f01bb26391b Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 8 Oct 2018 20:16:59 -0400 Subject: Handle the rename of WixCA and QtExec* binary, custom action, and property ids. Fixed wixtoolset/issues#5887. --- .../TestData/QtExec.bad/v3.wxs | 65 +++++++++++++++ .../TestData/QtExec.bad/v4_expected.wxs | 64 +++++++++++++++ .../WixToolsetTest.WixCop/TestData/QtExec/v3.wxs | 64 +++++++++++++++ .../TestData/QtExec/v4_expected.wxs | 63 +++++++++++++++ src/test/WixToolsetTest.WixCop/WixCopFixture.cs | 94 ++++++++++++++++++++++ .../WixToolsetTest.WixCop.csproj | 4 + src/wixcop/Converter.cs | 66 ++++++++++++++- 7 files changed, 418 insertions(+), 2 deletions(-) create mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs new file mode 100644 index 00000000..b0630f65 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs new file mode 100644 index 00000000..be487147 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs new file mode 100644 index 00000000..8d81a758 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs new file mode 100644 index 00000000..22a961b2 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs index 9877f9c8..207782b7 100644 --- a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs +++ b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs @@ -3,6 +3,7 @@ namespace WixToolsetTest.WixCop { using System.IO; + using System.Linq; using WixBuildTools.TestSupport; using Xunit; @@ -99,5 +100,98 @@ namespace WixToolsetTest.WixCop Assert.Equal(0, result2.ExitCode); } } + + [Fact] + public void CanConvertQtExec() + { + const string beforeFileName = "v3.wxs"; + const string afterFileName = "v4_expected.wxs"; + var folder = TestData.Get(@"TestData\QtExec"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(true); + var targetFile = Path.Combine(baseFolder, beforeFileName); + File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); + + var runner = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result = runner.Execute(); + + Assert.Equal(2, result.ExitCode); + + var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); + var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); + Assert.Equal(expected, actual); + + var runner2 = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result2 = runner2.Execute(); + + Assert.Equal(0, result2.ExitCode); + } + } + + [Fact] + public void DetectUnconvertableQtExecCmdTimeout() + { + const string beforeFileName = "v3.wxs"; + const string afterFileName = "v4_expected.wxs"; + var folder = TestData.Get(@"TestData\QtExec.bad"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(true); + var targetFile = Path.Combine(baseFolder, beforeFileName); + File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); + + var runner = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result = runner.Execute(); + + Assert.Equal(2, result.ExitCode); + + Assert.Single(result.Messages.Where(message => message.ToString().EndsWith("(QtExecCmdTimeoutAmbiguous)"))); + + var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); + var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); + Assert.Equal(expected, actual); + + // still fails because QtExecCmdTimeoutAmbiguous is unfixable + var runner2 = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result2 = runner2.Execute(); + + Assert.Equal(2, result2.ExitCode); + } + } } } diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj index 6b41b6b6..57de5a74 100644 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj @@ -18,6 +18,10 @@ + + + + diff --git a/src/wixcop/Converter.cs b/src/wixcop/Converter.cs index e125b39c..5408d370 100644 --- a/src/wixcop/Converter.cs +++ b/src/wixcop/Converter.cs @@ -28,6 +28,8 @@ namespace WixToolset.Tools.WixCop private static readonly XName MspPackageElementName = WixNamespace + "MspPackage"; private static readonly XName MsuPackageElementName = WixNamespace + "MsuPackage"; private static readonly XName PayloadElementName = WixNamespace + "Payload"; + private static readonly XName CustomActionElementName = WixNamespace + "CustomAction"; + private static readonly XName PropertyElementName = WixNamespace + "Property"; private static readonly XName WixElementWithoutNamespaceName = XNamespace.None + "Wix"; private static readonly Dictionary OldToNewNamespaceMapping = new Dictionary() @@ -88,6 +90,8 @@ namespace WixToolset.Tools.WixCop { Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation }, { Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation }, { Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, + { Converter.CustomActionElementName, this.ConvertCustomActionElement }, + { Converter.PropertyElementName, this.ConvertPropertyElement }, { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace } }; @@ -263,7 +267,7 @@ namespace WixToolset.Tools.WixCop } } } - + private void ConvertElement(XElement element) { // Gather any deprecated namespaces, then update this element tree based on those deprecations. @@ -324,7 +328,7 @@ namespace WixToolset.Tools.WixCop if (null != suppressSignatureValidation) { - if (this.OnError(ConverterTestType.SuppressSignatureValidationDeprecated, element, "The chain package element contains deprecated '{0}' attribute. Use the 'EnableSignatureValidation' instead.", suppressSignatureValidation)) + if (this.OnError(ConverterTestType.SuppressSignatureValidationDeprecated, element, "The chain package element contains deprecated '{0}' attribute. Use the 'EnableSignatureValidation' attribute instead.", suppressSignatureValidation)) { if ("no" == suppressSignatureValidation.Value) { @@ -336,6 +340,49 @@ namespace WixToolset.Tools.WixCop } } + private void ConvertCustomActionElement(XElement xCustomAction) + { + var xBinaryKey = xCustomAction.Attribute("BinaryKey"); + + if (xBinaryKey?.Value == "WixCA") + { + if (this.OnError(ConverterTestType.WixCABinaryIdRenamed, xCustomAction, "The WixCA custom action DLL Binary table id has been renamed. Use the id 'UtilCA' instead.")) + { + xBinaryKey.Value = "UtilCA"; + } + } + + var xDllEntry = xCustomAction.Attribute("DllEntry"); + + if (xDllEntry?.Value == "CAQuietExec" || xDllEntry?.Value == "CAQuietExec64") + { + if (this.OnError(ConverterTestType.QuietExecCustomActionsRenamed, xCustomAction, "The CAQuietExec and CAQuietExec64 custom action ids have been renamed. Use the ids 'WixQuietExec' and 'WixQuietExec64' instead.")) + { + xDllEntry.Value = xDllEntry.Value.Replace("CAQuietExec", "WixQuietExec"); + } + } + + var xProperty = xCustomAction.Attribute("Property"); + + if (xProperty?.Value == "QtExecCmdLine" || xProperty?.Value == "QtExec64CmdLine") + { + if (this.OnError(ConverterTestType.QuietExecCustomActionsRenamed, xCustomAction, "The QtExecCmdLine and QtExec64CmdLine property ids have been renamed. Use the ids 'WixQuietExecCmdLine' and 'WixQuietExec64CmdLine' instead.")) + { + xProperty.Value = xProperty.Value.Replace("QtExec", "WixQuietExec"); + } + } + } + + private void ConvertPropertyElement(XElement xProperty) + { + var xId = xProperty.Attribute("Id"); + + if (xId.Value == "QtExecCmdTimeout") + { + this.OnError(ConverterTestType.QtExecCmdTimeoutAmbiguous, xProperty, "QtExecCmdTimeout was previously used for both CAQuietExec and CAQuietExec64. For WixQuietExec, use WixQuietExecCmdTimeout. For WixQuietExec64, use WixQuietExec64CmdTimeout."); + } + } + /// /// Converts a Wix element. /// @@ -549,6 +596,21 @@ namespace WixToolset.Tools.WixCop /// SuppressSignatureValidation attribute is deprecated and replaced with EnableSignatureValidation. /// SuppressSignatureValidationDeprecated, + + /// + /// WixCA Binary/@Id has been renamed to UtilCA. + /// + WixCABinaryIdRenamed, + + /// + /// QtExec custom actions have been renamed. + /// + QuietExecCustomActionsRenamed, + + /// + /// QtExecCmdTimeout was previously used for both CAQuietExec and CAQuietExec64. For WixQuietExec, use WixQuietExecCmdTimeout. For WixQuietExec64, use WixQuietExec64CmdTimeout. + /// + QtExecCmdTimeoutAmbiguous, } } } -- cgit v1.2.3-55-g6feb From b66ea2e10a1b4be642e58319de85d2ca54991b47 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 24 Oct 2018 14:41:48 -0700 Subject: Add .editorconfig --- .editorconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.editorconfig b/.editorconfig index 4ceaca17..2ebba4b3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,6 +16,12 @@ csharp_indent_case_contents = true : error csharp_indent_switch_labels = true : error csharp_new_line_before_open_brace = all csharp_prefer_braces = true : error +csharp_style_expression_bodied_methods = when_on_single_line : suggestion +csharp_style_expression_bodied_constructors = when_on_single_line : suggestion +csharp_style_expression_bodied_operators = when_on_single_line : suggestion +csharp_style_expression_bodied_properties = when_on_single_line : suggestion +csharp_style_expression_bodied_indexers = when_on_single_line : suggestion +csharp_style_expression_bodied_accessors = when_on_single_line : suggestion csharp_style_var_elsewhere = true : suggestion csharp_style_var_for_built_in_types = true : suggestion csharp_style_var_when_type_is_apparent = true : suggestion -- cgit v1.2.3-55-g6feb From 85fc7be678248a0a5873c08d48941021eb0959e6 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 24 Oct 2018 21:07:56 -0700 Subject: Update to changes to reorganize command-line processing --- src/WixToolset.BuildTasks/DoIt.cs | 2 +- src/wix/Program.cs | 5 +---- src/wixcop/CommandLine/ConvertCommand.cs | 9 +++++++++ src/wixcop/CommandLine/HelpCommand.cs | 10 ++++++++++ src/wixcop/CommandLine/WixCopCommandLineParser.cs | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 0c8d261c..aeeb428b 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -172,7 +172,7 @@ namespace WixToolset.BuildTasks var arguments = serviceProvider.GetService(); arguments.Populate(commandLineString); - var commandLine = serviceProvider.GetService(); + var commandLine = serviceProvider.GetService(); commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); commandLine.Arguments = arguments; var command = commandLine.ParseStandardCommandLine(); diff --git a/src/wix/Program.cs b/src/wix/Program.cs index b0e3bb73..276eba53 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -3,11 +3,8 @@ namespace WixToolset.Tools { using System; - using System.Globalization; using System.Linq; using System.Reflection; - using System.Text; - using System.Threading; using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; @@ -50,7 +47,7 @@ namespace WixToolset.Tools var arguments = serviceProvider.GetService(); arguments.Populate(args); - var commandLine = serviceProvider.GetService(); + var commandLine = serviceProvider.GetService(); commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); commandLine.Arguments = arguments; var command = commandLine.ParseStandardCommandLine(); diff --git a/src/wixcop/CommandLine/ConvertCommand.cs b/src/wixcop/CommandLine/ConvertCommand.cs index ab7cd359..c65652ab 100644 --- a/src/wixcop/CommandLine/ConvertCommand.cs +++ b/src/wixcop/CommandLine/ConvertCommand.cs @@ -50,6 +50,15 @@ namespace WixToolset.Tools.WixCop.CommandLine private bool SubDirectories { get; } + public bool ShowLogo => throw new NotImplementedException(); + + public bool StopParsing => throw new NotImplementedException(); + + public bool TryParseArgument(ICommandLineParser parser, string argument) + { + throw new NotImplementedException(); + } + public int Execute() { // parse the settings if any were specified diff --git a/src/wixcop/CommandLine/HelpCommand.cs b/src/wixcop/CommandLine/HelpCommand.cs index bfb784b0..1505dc59 100644 --- a/src/wixcop/CommandLine/HelpCommand.cs +++ b/src/wixcop/CommandLine/HelpCommand.cs @@ -4,9 +4,14 @@ namespace WixToolset.Tools.WixCop.CommandLine { using System; using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; internal class HelpCommand : ICommandLineCommand { + public bool ShowLogo => false; + + public bool StopParsing => true; + public int Execute() { Console.WriteLine(" usage: wixcop.exe sourceFile [sourceFile ...]"); @@ -23,5 +28,10 @@ namespace WixToolset.Tools.WixCop.CommandLine return 0; } + + public bool TryParseArgument(ICommandLineParser parser, string argument) + { + return true; + } } } diff --git a/src/wixcop/CommandLine/WixCopCommandLineParser.cs b/src/wixcop/CommandLine/WixCopCommandLineParser.cs index ae826d4f..73247dae 100644 --- a/src/wixcop/CommandLine/WixCopCommandLineParser.cs +++ b/src/wixcop/CommandLine/WixCopCommandLineParser.cs @@ -85,7 +85,7 @@ namespace WixToolset.Tools.WixCop.CommandLine } } - private bool ParseArgument(IParseCommandLine parser, string arg) + private bool ParseArgument(ICommandLineParser parser, string arg) { var parameter = arg.Substring(1); -- cgit v1.2.3-55-g6feb From 06a7caade34cba18629024ea2ccce567d85898d7 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 20 Nov 2018 19:23:08 -0500 Subject: Requesting build with new version number, please. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From db8641b5ab125679b028848d1747d7a4cef6fc37 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 10 Dec 2018 22:52:03 -0600 Subject: Make WixCop move Directory/@ShortName to @Name. (#7) Fixes wixtoolset/issues#5652. --- Tools.sln | 2 +- src/test/WixToolsetTest.WixCop/ConverterFixture.cs | 28 ++++++++++++++++ src/wixcop/Converter.cs | 37 +++++++++++++++------- 3 files changed, 54 insertions(+), 13 deletions(-) diff --git a/Tools.sln b/Tools.sln index ca2e23d6..75f52adc 100644 --- a/Tools.sln +++ b/Tools.sln @@ -22,7 +22,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixCop", "src\wixcop\WixCop EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Tools.Core", "src\WixToolset.Tools.Core\WixToolset.Tools.Core.csproj", "{9C3B486F-AE0E-43BA-823A-30808B73C6B4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixCopTests", "src\test\wixcop\WixCopTests.csproj", "{F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.WixCop", "src\test\WixToolsetTest.WixCop\WixToolsetTest.WixCop.csproj", "{F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/test/WixToolsetTest.WixCop/ConverterFixture.cs b/src/test/WixToolsetTest.WixCop/ConverterFixture.cs index 863a781a..ceac07d6 100644 --- a/src/test/WixToolsetTest.WixCop/ConverterFixture.cs +++ b/src/test/WixToolsetTest.WixCop/ConverterFixture.cs @@ -420,6 +420,34 @@ namespace WixToolsetTest.WixCop Assert.Equal(expected, actual); } + [Fact] + public void CanConvertShortNameDirectoryWithoutName() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var expected = String.Join(Environment.NewLine, + "", + "", + " ", + ""); + + var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); + + var messaging = new DummyMessaging(); + var converter = new Converter(messaging, 2, null, null); + + var errors = converter.ConvertDocument(document); + + var actual = UnformattedDocumentString(document); + + Assert.Equal(1, errors); + Assert.Equal(expected, actual); + } + [Fact] public void CanConvertSuppressSignatureValidationNo() { diff --git a/src/wixcop/Converter.cs b/src/wixcop/Converter.cs index 5408d370..37016c19 100644 --- a/src/wixcop/Converter.cs +++ b/src/wixcop/Converter.cs @@ -22,6 +22,7 @@ namespace WixToolset.Tools.WixCop private const char XDocumentNewLine = '\n'; // XDocument normalizes "\r\n" to just "\n". private static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; + private static readonly XName DirectoryElementName = WixNamespace + "Directory"; private static readonly XName FileElementName = WixNamespace + "File"; private static readonly XName ExePackageElementName = WixNamespace + "ExePackage"; private static readonly XName MsiPackageElementName = WixNamespace + "MsiPackage"; @@ -71,19 +72,9 @@ namespace WixToolset.Tools.WixCop /// Test errors to ignore. public Converter(IMessaging messaging, int indentationAmount, IEnumerable errorsAsWarnings = null, IEnumerable ignoreErrors = null) { - // workaround IDE0009 bug - /*this.ConvertElementMapping = new Dictionary>() - { - { Converter.FileElementName, this.ConvertFileElement }, - { Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, - { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace }, - };*/ this.ConvertElementMapping = new Dictionary> { + { Converter.DirectoryElementName, this.ConvertDirectoryElement }, { Converter.FileElementName, this.ConvertFileElement }, { Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation }, { Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation }, @@ -92,7 +83,7 @@ namespace WixToolset.Tools.WixCop { Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, { Converter.CustomActionElementName, this.ConvertCustomActionElement }, { Converter.PropertyElementName, this.ConvertPropertyElement }, - { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace } + { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace }, }; this.Messaging = messaging; @@ -296,6 +287,23 @@ namespace WixToolset.Tools.WixCop } } + private void ConvertDirectoryElement(XElement element) + { + if (null == element.Attribute("Name")) + { + var attribute = element.Attribute("ShortName"); + if (null != attribute) + { + var shortName = attribute.Value; + if (this.OnError(ConverterTestType.AssignDirectoryNameFromShortName, element, "The directory ShortName attribute is being renamed to Name since Name wasn't specified for value '{0}'", shortName)) + { + element.Add(new XAttribute("Name", shortName)); + attribute.Remove(); + } + } + } + } + private void ConvertFileElement(XElement element) { if (null == element.Attribute("Id")) @@ -611,6 +619,11 @@ namespace WixToolset.Tools.WixCop /// QtExecCmdTimeout was previously used for both CAQuietExec and CAQuietExec64. For WixQuietExec, use WixQuietExecCmdTimeout. For WixQuietExec64, use WixQuietExec64CmdTimeout. /// QtExecCmdTimeoutAmbiguous, + + /// + /// Directory/@ShortName may only be specified with Directory/@Name. + /// + AssignDirectoryNameFromShortName, } } } -- cgit v1.2.3-55-g6feb From 6135ca6f532668ae953a738a3925f4da32b3ae25 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 22 Dec 2018 10:44:17 -0800 Subject: Update to latest Home\repo-template --- .editorconfig | 3 + .gitignore | 68 +++++++++++++++++----- Tools.v3.ncrunchsolution | 6 ++ appveyor.yml | 12 ++-- src/Directory.Build.props | 9 +-- src/Directory.Build.targets | 48 +++++++++++++++ .../WixToolset.BuildTasks.csproj | 11 +--- .../WixToolset.Tools.Core.csproj | 11 +--- .../WixToolsetTest.WixCop.csproj | 3 +- src/wix/wix.csproj | 11 +--- src/wixcop/WixCop.csproj | 3 +- 11 files changed, 130 insertions(+), 55 deletions(-) create mode 100644 Tools.v3.ncrunchsolution create mode 100644 src/Directory.Build.targets diff --git a/.editorconfig b/.editorconfig index 2ebba4b3..1d72e683 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,7 @@ # Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig +# then update all of the repos. root = true diff --git a/.gitignore b/.gitignore index 77c2dccf..3e8a1553 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files +*.rsuser *.suo *.user *.userosscache @@ -19,19 +20,21 @@ [Rr]eleases/ x64/ x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ -# VSCode -.vscode/ - -# Visual Studio 2015 cache/options directory +# Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ +# Visual Studio 2017 auto generated files +Generated\ Files/ + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* @@ -52,16 +55,21 @@ BenchmarkDotNet.Artifacts/ project.lock.json project.fragment.lock.json artifacts/ -**/Properties/launchSettings.json +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio *_i.c *_p.c -*_i.h +*_h.h *.ilk *.meta *.obj +*.iobj *.pch *.pdb +*.ipdb *.pgc *.pgd *.rsp @@ -71,6 +79,7 @@ artifacts/ *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log *.vspscc *.vssscc @@ -99,6 +108,9 @@ ipch/ *.vspx *.sap +# Visual Studio Trace Files +*.e2e + # TFS 2012 Local Workspace $tf/ @@ -171,11 +183,11 @@ PublishScripts/ # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore -**/packages/* +**/[Pp]ackages/* # except build/, which is used as an MSBuild target. -!**/packages/build/ +!**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config +#!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets @@ -199,7 +211,7 @@ _pkginfo.txt # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ +!?*.[Cc]ache/ # Others ClientBin/ @@ -212,9 +224,15 @@ ClientBin/ *.publishsettings orleans.codegen.cs +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ +# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true +**/wwwroot/lib/ # RIA/Silverlight projects Generated_Code/ @@ -226,6 +244,8 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak # SQL Server files *.mdf @@ -236,6 +256,7 @@ UpgradeLog*.htm *.rdl.data *.bim.layout *.bim_*.settings +*.rptproj.rsuser # Microsoft Fakes FakesAssemblies/ @@ -247,9 +268,6 @@ FakesAssemblies/ .ntvs_analysis.dat node_modules/ -# Typescript v1 declaration files -typings/ - # Visual Studio 6 build log *.plg @@ -278,8 +296,8 @@ paket-files/ .idea/ *.sln.iml -# CodeRush -.cr/ +# CodeRush personal settings +.cr/personal # Python Tools for Visual Studio (PTVS) __pycache__/ @@ -302,4 +320,22 @@ __pycache__/ *.xsd.cs # OpenCover UI analysis results -OpenCover/ \ No newline at end of file +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb diff --git a/Tools.v3.ncrunchsolution b/Tools.v3.ncrunchsolution new file mode 100644 index 00000000..10420ac9 --- /dev/null +++ b/Tools.v3.ncrunchsolution @@ -0,0 +1,6 @@ + + + True + True + + \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 6df37135..d55322da 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,8 @@ +# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml +# then update all of the repos. + image: Visual Studio 2017 version: 0.0.0.{build} @@ -8,12 +13,8 @@ environment: DOTNET_CLI_TELEMETRY_OPTOUT: 1 NUGET_XMLDOC_MODE: skip -branches: - only: - - master - build_script: -- appveyor.cmd + - appveyor.cmd pull_requests: do_not_increment_build_number: true @@ -21,6 +22,7 @@ pull_requests: nuget: disable_publish_on_pr: true +skip_branch_with_pr: true skip_tags: true artifacts: diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 9eacf3f5..e853e22d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ @@ -10,20 +10,17 @@ false $(MSBuildProjectName) - $(MSBuildThisFileDirectory)..\build\ + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) $(BaseOutputPath)obj\$(ProjectName)\ $(BaseOutputPath)$(Configuration)\ WiX Toolset Team WiX Toolset Copyright (c) .NET Foundation and contributors. All rights reserved. + MS-RL WiX Toolset - - $(MSBuildThisFileDirectory)..\..\ - - diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000..dac7452a --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,48 @@ + + + + + + + true + $(SolutionPath) + $(NCrunchOriginalSolutionPath) + + + + + + + $([System.IO.File]::ReadAllText($(TheSolutionPath))) + $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) + (?<="[PackageName]", ")(.*)(?=", ") + + + + + + %(Identity) + $(SolutionFileContent.Contains('\%(Identity).csproj')) + + + + + $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) + $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) + + + + + + + + + + + diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 39c8824c..10a3f057 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -32,14 +32,9 @@ - - - - - - - - + + + diff --git a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj index 8be70e6b..996258cc 100644 --- a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj +++ b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj @@ -11,14 +11,9 @@ - - - - - - - - + + + diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj index 57de5a74..f399760f 100644 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj @@ -29,8 +29,7 @@ - - + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 2cbcdf3a..a923c66f 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -21,14 +21,9 @@ - - - - - - - - + + + diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 9bcae177..be10524d 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -21,8 +21,7 @@ - - + -- cgit v1.2.3-55-g6feb From c82991d4af4ce7fa7330e99e18840ecff4f3fabd Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 22 Dec 2018 13:50:44 -0800 Subject: Re-enable tests and NCrunch with fixes to Core.Native --- .../WixToolset.BuildTasks.net461.v3.ncrunchproject | 5 +++++ .../WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject | 5 +++++ src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject | 5 +++++ src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject | 5 +++++ src/dotnet-wix/dotnet-wix.v3.ncrunchproject | 5 +++++ src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | 8 ++++---- src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs | 2 +- .../WixToolsetTest.BuildTasks.v3.ncrunchproject | 1 + .../WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject | 5 +++++ src/wix/wix.net461.v3.ncrunchproject | 5 +++++ src/wix/wix.netcoreapp2.1.v3.ncrunchproject | 5 +++++ src/wixcop/WixCop.net461.v3.ncrunchproject | 5 +++++ src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject | 5 +++++ 13 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject create mode 100644 src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject create mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject create mode 100644 src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject create mode 100644 src/dotnet-wix/dotnet-wix.v3.ncrunchproject create mode 100644 src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject create mode 100644 src/wix/wix.net461.v3.ncrunchproject create mode 100644 src/wix/wix.netcoreapp2.1.v3.ncrunchproject create mode 100644 src/wixcop/WixCop.net461.v3.ncrunchproject create mode 100644 src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject b/src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/dotnet-wix/dotnet-wix.v3.ncrunchproject b/src/dotnet-wix/dotnet-wix.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/dotnet-wix/dotnet-wix.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index db76a119..96f39318 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -20,7 +20,7 @@ namespace WixToolsetTest.BuildTasks private MsbuildRunner MsbuildRunner { get; } - [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] + [Fact] public void CanBuildSimpleMsiPackage() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); @@ -55,7 +55,7 @@ namespace WixToolsetTest.BuildTasks } } - [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] + [Fact] public void CanBuildSimpleMsiPackageWithWarningSuppressions() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); @@ -80,7 +80,7 @@ namespace WixToolsetTest.BuildTasks } } - [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] + [Fact] public void CanBuildSimpleMsiPackageAsWixipl() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); @@ -107,7 +107,7 @@ namespace WixToolsetTest.BuildTasks } } - [Fact(Skip ="Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] + [Fact] public void CanBuildAndCleanSimpleMsiPackage() { var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index 93a65ea1..c4a69cdd 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -13,7 +13,7 @@ namespace WixToolsetTest.BuildTasks public class WixBuildTaskFixture { - [Fact(Skip = "Re-enable when our assemblies are correctly copied together so they can be loaded by MSBuild via wix.targets")] + [Fact] public void CanBuildSimpleMsiPackage() { var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject index 7b5b2139..8f3624cb 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject @@ -1,5 +1,6 @@  True + \ No newline at end of file diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/wix.net461.v3.ncrunchproject b/src/wix/wix.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/wix.net461.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/wix.netcoreapp2.1.v3.ncrunchproject b/src/wix/wix.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/wix.netcoreapp2.1.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wixcop/WixCop.net461.v3.ncrunchproject b/src/wixcop/WixCop.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wixcop/WixCop.net461.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject b/src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb From c6da3f6d1c9b571d8f58745560332c3e0531a5c5 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 27 Dec 2018 11:07:13 -0800 Subject: Catch unhandled exceptions at the top to provide useful debug info Fixes wixtoolset/issues#5884 --- src/WixToolset.BuildTasks/DoIt.cs | 22 ++++++++------- .../WixToolset.BuildTasks.csproj | 1 - .../WixToolset.Tools.Core.csproj | 2 -- src/wix/Program.cs | 31 +++++++++++++++++----- src/wix/wix.csproj | 1 - 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index aeeb428b..07bf05e5 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -4,8 +4,6 @@ namespace WixToolset.BuildTasks { using System; using System.Collections.Generic; - using System.Linq; - using System.Reflection; using System.Runtime.InteropServices; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -111,9 +109,17 @@ namespace WixToolset.BuildTasks public override bool Execute() { + var serviceProvider = new WixToolsetServiceProvider(); + + var listener = new MsbuildMessageListener(this.Log, "WIX", this.BuildEngine.ProjectFileOfTaskNode); + try { - this.ExecuteCore(); + this.ExecuteCore(serviceProvider, listener); + } + catch (WixException e) + { + listener.Write(e.Error); } catch (Exception e) { @@ -128,10 +134,8 @@ namespace WixToolset.BuildTasks return !this.Log.HasLoggedErrors; } - private void ExecuteCore() + private void ExecuteCore(IServiceProvider serviceProvider, IMessageListener listener) { - var listener = new MsbuildMessageListener(this.Log, "WIX", this.BuildEngine.ProjectFileOfTaskNode); - var commandLineBuilder = new WixCommandLineBuilder(); commandLineBuilder.AppendTextUnquoted("build"); @@ -164,8 +168,6 @@ namespace WixToolset.BuildTasks this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); - var serviceProvider = new WixToolsetServiceProvider(); - var messaging = serviceProvider.GetService(); messaging.SetListener(listener); @@ -194,9 +196,9 @@ namespace WixToolset.BuildTasks { extensionManager.Load(extension); } - catch (ReflectionTypeLoadException e) + catch (WixException e) { - messaging.Write(ErrorMessages.InvalidExtension(extension, String.Join(Environment.NewLine, e.LoaderExceptions.Select(le => le.ToString())))); + messaging.Write(e.Error); } } diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 10a3f057..5020f891 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -32,7 +32,6 @@ - diff --git a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj index 996258cc..92111c61 100644 --- a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj +++ b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj @@ -11,8 +11,6 @@ - - diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 276eba53..a3251f84 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -3,8 +3,7 @@ namespace WixToolset.Tools { using System; - using System.Linq; - using System.Reflection; + using System.Runtime.InteropServices; using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; @@ -29,8 +28,28 @@ namespace WixToolset.Tools var listener = new ConsoleMessageListener("WIX", "wix.exe"); - var program = new Program(); - return program.Run(serviceProvider, listener, args); + try + { + var program = new Program(); + return program.Run(serviceProvider, listener, args); + } + catch (WixException e) + { + listener.Write(e.Error); + + return e.Error.Id; + } + catch (Exception e) + { + listener.Write(ErrorMessages.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace)); + + if (e is NullReferenceException || e is SEHException) + { + throw; + } + + return e.HResult; + } } /// @@ -69,9 +88,9 @@ namespace WixToolset.Tools { extensionManager.Load(extension); } - catch (ReflectionTypeLoadException e) + catch (WixException e) { - messaging.Write(ErrorMessages.InvalidExtension(extension, String.Join(Environment.NewLine, e.LoaderExceptions.Select(le => le.ToString())))); + messaging.Write(e.Error); } } diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index a923c66f..9cb5658f 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -21,7 +21,6 @@ - -- cgit v1.2.3-55-g6feb From 05c1b41651afced8b3f3629668ef1b32bcc04e6d Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 27 Dec 2018 11:07:45 -0800 Subject: Minor code clean up in build task --- src/WixToolset.BuildTasks/DoIt.cs | 110 +++++++------------------------------- 1 file changed, 20 insertions(+), 90 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 07bf05e5..ac0f895c 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -135,6 +135,25 @@ namespace WixToolset.BuildTasks } private void ExecuteCore(IServiceProvider serviceProvider, IMessageListener listener) + { + var commandLineString = this.BuildCommandLine(); + + this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); + + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var arguments = serviceProvider.GetService(); + arguments.Populate(commandLineString); + + var commandLine = serviceProvider.GetService(); + commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); + commandLine.Arguments = arguments; + var command = commandLine.ParseStandardCommandLine(); + command?.Execute(); + } + + private string BuildCommandLine() { var commandLineBuilder = new WixCommandLineBuilder(); @@ -164,21 +183,7 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendTextIfNotWhitespace(this.AdditionalOptions); commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); - var commandLineString = commandLineBuilder.ToString(); - - this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); - - var messaging = serviceProvider.GetService(); - messaging.SetListener(listener); - - var arguments = serviceProvider.GetService(); - arguments.Populate(commandLineString); - - var commandLine = serviceProvider.GetService(); - commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); - commandLine.Arguments = arguments; - var command = commandLine.ParseStandardCommandLine(); - command?.Execute(); + return commandLineBuilder.ToString(); } private IExtensionManager CreateExtensionManagerWithStandardBackends(IServiceProvider serviceProvider, IMessaging messaging, string[] extensions) @@ -205,11 +210,6 @@ namespace WixToolset.BuildTasks return extensionManager; } - private void DisplayMessage(object sender, DisplayEventArgs e) - { - this.Log.LogMessageFromText(e.Message, MessageImportance.Normal); - } - private IEnumerable CalculateBindPathStrings() { if (null != this.BindInputPaths) @@ -231,76 +231,6 @@ namespace WixToolset.BuildTasks } } - ///// - ///// Builds a command line from options in this task. - ///// - //protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - //{ - // base.BuildCommandLine(commandLineBuilder); - - // commandLineBuilder.AppendIfTrue("-p", this.PreprocessToStdOut); - // commandLineBuilder.AppendSwitchIfNotNull("-p", this.PreprocessToFile); - // commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); - // commandLineBuilder.AppendArrayIfNotNull("-d", this.DefineConstants); - // commandLineBuilder.AppendArrayIfNotNull("-I", this.IncludeSearchPaths); - // commandLineBuilder.AppendIfTrue("-pedantic", this.Pedantic); - // commandLineBuilder.AppendSwitchIfNotNull("-arch ", this.InstallerPlatform); - // commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.referencePaths); - // commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); - - // // Support per-source-file output by looking at the SourceFiles items to - // // see if there is any "CandleOutput" metadata. If there is, we do our own - // // appending, otherwise we fall back to the built-in "append file names" code. - // // Note also that the wix.targets "Compile" target does *not* automagically - // // fix the "@(CompileObjOutput)" list to include these new output names. - // // If you really want to use this, you're going to have to clone the target - // // in your own .targets file and create the output list yourself. - // bool usePerSourceOutput = false; - // if (this.SourceFiles != null) - // { - // foreach (ITaskItem item in this.SourceFiles) - // { - // if (!String.IsNullOrEmpty(item.GetMetadata("CandleOutput"))) - // { - // usePerSourceOutput = true; - // break; - // } - // } - // } - - // if (usePerSourceOutput) - // { - // string[] newSourceNames = new string[this.SourceFiles.Length]; - // for (int iSource = 0; iSource < this.SourceFiles.Length; ++iSource) - // { - // ITaskItem item = this.SourceFiles[iSource]; - // if (null == item) - // { - // newSourceNames[iSource] = null; - // } - // else - // { - // string output = item.GetMetadata("CandleOutput"); - - // if (!String.IsNullOrEmpty(output)) - // { - // newSourceNames[iSource] = String.Concat(item.ItemSpec, ";", output); - // } - // else - // { - // newSourceNames[iSource] = item.ItemSpec; - // } - // } - // } - - // commandLineBuilder.AppendFileNamesIfNotNull(newSourceNames, " "); - // } - // else - // { - // commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); - // } - //} - private class MsbuildMessageListener : IMessageListener { public MsbuildMessageListener(TaskLoggingHelper logger, string shortName, string longName) -- cgit v1.2.3-55-g6feb From 61c89b0fbe9d2946d8303c08384af7b2bb1844a8 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 27 Dec 2018 18:56:07 -0800 Subject: Reduce extra appveyor builds by targeting only master and develop branches --- appveyor.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index d55322da..c1df03cc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,11 @@ # Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml # then update all of the repos. +branches: + only: + - master + - develop + image: Visual Studio 2017 version: 0.0.0.{build} -- cgit v1.2.3-55-g6feb From 51044df46896ee17d62f2036b76546a0fdcee9bc Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 27 Dec 2018 20:52:57 -0800 Subject: Fix double inclusion of wixnative.*.exe --- src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 2 -- src/dotnet-wix/dotnet-wix.nuspec | 1 - 2 files changed, 3 deletions(-) diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index 1a21315a..6bca928a 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -13,9 +13,7 @@ - - diff --git a/src/dotnet-wix/dotnet-wix.nuspec b/src/dotnet-wix/dotnet-wix.nuspec index 53a8dc9e..c2a4c8f4 100644 --- a/src/dotnet-wix/dotnet-wix.nuspec +++ b/src/dotnet-wix/dotnet-wix.nuspec @@ -19,6 +19,5 @@ - -- cgit v1.2.3-55-g6feb From 37585df55516573844b7bea2be29eceef072389e Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 2 Jan 2019 13:15:31 -0500 Subject: Group WiX Toolset references together so we can see them. Oh and get a Tools build too to pick up all the Core work. --- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 5020f891..8713709e 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -34,12 +34,12 @@ + - -- cgit v1.2.3-55-g6feb From dcdfcc0a364da00739be65d514020c4eeda2aeff Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 3 Jan 2019 15:08:31 -0500 Subject: Build me a new version with latest Core, please. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 3f651c19830feb468ad7bb65ad208ffda5a346e5 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 9 Jan 2019 21:25:10 -0500 Subject: Build me a new version with latest Core, please. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 873134cf54b1f67d5b0607ef32ef422f90d24b67 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 12 Jan 2019 16:44:48 -0600 Subject: Add failing test for SuppressIces. --- .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 96f39318..3b96f0ba 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -55,6 +55,28 @@ namespace WixToolsetTest.BuildTasks } } + [Fact(Skip = "Currently fails")] + public void CanBuildSimpleMsiPackageWithIceSuppressions() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-p:SuppressIces=\"ICE45;ICE46\"" + }); + result.AssertSuccess(); + } + } + [Fact] public void CanBuildSimpleMsiPackageWithWarningSuppressions() { -- cgit v1.2.3-55-g6feb From 7d174960818d9d13b244ee3e7342588a2f71df63 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 16 Jan 2019 16:37:12 -0500 Subject: Build me a new version with latest Core, please. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 28779cbbaa5fcba61009d416654345d50a96fa91 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 16 Jan 2019 22:53:19 -0500 Subject: Plumb InstallerPlatform through MSBuild task. --- src/WixToolset.BuildTasks/DoIt.cs | 1 + .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 28 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index ac0f895c..7089ff12 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -159,6 +159,7 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendTextUnquoted("build"); + commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform); commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 3b96f0ba..74978322 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -39,6 +39,9 @@ namespace WixToolsetTest.BuildTasks }); result.AssertSuccess(); + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); + Assert.Single(platformSwitches); + var warnings = result.Output.Where(line => line.Contains(": warning")); Assert.Equal(4, warnings.Count()); @@ -55,6 +58,31 @@ namespace WixToolsetTest.BuildTasks } } + [Fact] + public void CanBuild64BitMsiPackage() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = this.MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + $"-p:InstallerPlatform=x64", + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64")); + Assert.Single(platformSwitches); + } + } + [Fact(Skip = "Currently fails")] public void CanBuildSimpleMsiPackageWithIceSuppressions() { -- cgit v1.2.3-55-g6feb From e8d9c70934d8cae0d2769ab6ca5ad40d5f506968 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 1 Feb 2019 14:32:57 -0800 Subject: Integrate thmviewer.exe and thmviewer.msi Cannot build MSI until a few fixes are made to WixToolset.Core. Will enable this later. --- Tools.sln | 42 +++ appveyor.cmd | 6 +- appveyor.yml | 2 + src/Cpp.Build.props | 104 ++++++ src/Directory.Build.props | 2 + src/ThmViewerPackage/Package.wxs | 36 ++ src/ThmViewerPackage/ThmViewerPackage.wixproj | 35 ++ src/ThmViewerPackage/packages.config | 4 + src/Wix.Build.props | 12 + src/thmviewer/Resources/LoremIpsum.rtf | Bin 0 -> 4870 bytes src/thmviewer/Resources/thm.xml | 11 + src/thmviewer/display.cpp | 353 +++++++++++++++++++ src/thmviewer/load.cpp | 219 ++++++++++++ src/thmviewer/packages.config | 5 + src/thmviewer/precomp.cpp | 3 + src/thmviewer/precomp.h | 69 ++++ src/thmviewer/resource.h | 16 + src/thmviewer/thmviewer.cpp | 465 ++++++++++++++++++++++++++ src/thmviewer/thmviewer.manifest | 11 + src/thmviewer/thmviewer.rc | 12 + src/thmviewer/thmviewer.vcxproj | 73 ++++ src/thmviewer/thmviewer.vcxproj.filters | 53 +++ 22 files changed, 1532 insertions(+), 1 deletion(-) create mode 100644 src/Cpp.Build.props create mode 100644 src/ThmViewerPackage/Package.wxs create mode 100644 src/ThmViewerPackage/ThmViewerPackage.wixproj create mode 100644 src/ThmViewerPackage/packages.config create mode 100644 src/Wix.Build.props create mode 100644 src/thmviewer/Resources/LoremIpsum.rtf create mode 100644 src/thmviewer/Resources/thm.xml create mode 100644 src/thmviewer/display.cpp create mode 100644 src/thmviewer/load.cpp create mode 100644 src/thmviewer/packages.config create mode 100644 src/thmviewer/precomp.cpp create mode 100644 src/thmviewer/precomp.h create mode 100644 src/thmviewer/resource.h create mode 100644 src/thmviewer/thmviewer.cpp create mode 100644 src/thmviewer/thmviewer.manifest create mode 100644 src/thmviewer/thmviewer.rc create mode 100644 src/thmviewer/thmviewer.vcxproj create mode 100644 src/thmviewer/thmviewer.vcxproj.filters diff --git a/Tools.sln b/Tools.sln index 75f52adc..45deb3c5 100644 --- a/Tools.sln +++ b/Tools.sln @@ -24,44 +24,86 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Tools.Core", "sr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.WixCop", "src\test\WixToolsetTest.WixCop\WixToolsetTest.WixCop.csproj", "{F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thmviewer", "src\thmviewer\thmviewer.vcxproj", "{95228C13-97F5-484A-B4A2-ECF4618B0881}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|x86.ActiveCfg = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|x86.Build.0 = Debug|Any CPU {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.Build.0 = Release|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|x86.ActiveCfg = Release|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|x86.Build.0 = Release|Any CPU {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|x86.ActiveCfg = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|x86.Build.0 = Debug|Any CPU {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.ActiveCfg = Release|Any CPU {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.Build.0 = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|x86.ActiveCfg = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|x86.Build.0 = Release|Any CPU {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|x86.ActiveCfg = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|x86.Build.0 = Debug|Any CPU {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.ActiveCfg = Release|Any CPU {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.Build.0 = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|x86.ActiveCfg = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|x86.Build.0 = Release|Any CPU {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.Build.0 = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|x86.ActiveCfg = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|x86.Build.0 = Debug|Any CPU {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.ActiveCfg = Release|Any CPU {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.Build.0 = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|x86.ActiveCfg = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|x86.Build.0 = Release|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|x86.ActiveCfg = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|x86.Build.0 = Debug|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.Build.0 = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.ActiveCfg = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.Build.0 = Release|Any CPU {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|x86.ActiveCfg = Debug|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|x86.Build.0 = Debug|Any CPU {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|Any CPU.Build.0 = Release|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|x86.ActiveCfg = Release|Any CPU + {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|x86.Build.0 = Release|Any CPU {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Debug|x86.ActiveCfg = Debug|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Debug|x86.Build.0 = Debug|Any CPU {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Release|Any CPU.ActiveCfg = Release|Any CPU {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Release|Any CPU.Build.0 = Release|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Release|x86.ActiveCfg = Release|Any CPU + {9C3B486F-AE0E-43BA-823A-30808B73C6B4}.Release|x86.Build.0 = Release|Any CPU {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|x86.ActiveCfg = Debug|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|x86.Build.0 = Debug|Any CPU {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|Any CPU.ActiveCfg = Release|Any CPU {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|Any CPU.Build.0 = Release|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|x86.ActiveCfg = Release|Any CPU + {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|x86.Build.0 = Release|Any CPU + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.ActiveCfg = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.Build.0 = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|Any CPU.ActiveCfg = Release|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.ActiveCfg = Release|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/appveyor.cmd b/appveyor.cmd index d18c8df8..ec97f0b6 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -2,6 +2,8 @@ @pushd %~dp0 @set _P=%~dp0build\Release\publish +nuget restore + dotnet build -c Release src\test\WixToolsetTest.BuildTasks dotnet build -c Release src\test\WixToolsetTest.WixCop @@ -15,7 +17,9 @@ dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netcoreapp2.1\ -f netcoreap dotnet pack -c Release src\dotnet-wix dotnet pack -c Release src\WixToolset.MSBuild -@rem dotnet pack -c Release src\WixToolset.Core.InternalPackage + +@rem Enable this build when WixToolset.Core is fixed to build the setup code correctly. +@rem msbuild -p:Configuration=Release .\src\ThmViewerPackage\ThmViewerPackage.wixproj @popd @endlocal diff --git a/appveyor.yml b/appveyor.yml index c1df03cc..8d80c6af 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,6 +33,8 @@ skip_tags: true artifacts: - path: build\Release\**\*.nupkg name: nuget +- path: build\Release\**\*.msi + name: msi notifications: - provider: Slack diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props new file mode 100644 index 00000000..0e00132b --- /dev/null +++ b/src/Cpp.Build.props @@ -0,0 +1,104 @@ + + + + + + Win32 + $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ + $(OutputPath)$(Platform)\ + + + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + + + + + $(DisableSpecificCompilerWarnings) + Level4 + $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + Use + precomp.h + StdCall + true + false + -YlprecompDefine + /Zc:threadSafeInit- %(AdditionalOptions) + true + + + $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) + $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) + + + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) + + + $(ProjectSubSystem) + $(ProjectModuleDefinitionFile) + $(ResourceOnlyDll) + true + $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) + /IGNORE:4099 %(AdditionalOptions) + + + + + + NoExtensions + + + + + CDecl + + + + + OldStyle + true + true + + + + + Disabled + EnableFastChecks + _DEBUG;DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + + MultiThreadedDebugDll + + + + + MinSpace + NDEBUG;%(PreprocessorDefinitions) + true + true + MultiThreaded + + + true + true + + + + + + MultiThreadedDll + + + + + $(LinkKeyFile) + $(LinkDelaySign) + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e853e22d..30ce4e48 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -8,6 +8,7 @@ Debug false + MSB3246 $(MSBuildProjectName) $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) @@ -22,5 +23,6 @@ + diff --git a/src/ThmViewerPackage/Package.wxs b/src/ThmViewerPackage/Package.wxs new file mode 100644 index 00000000..cfa041ba --- /dev/null +++ b/src/ThmViewerPackage/Package.wxs @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ThmViewerPackage/ThmViewerPackage.wixproj b/src/ThmViewerPackage/ThmViewerPackage.wixproj new file mode 100644 index 00000000..ec2400bd --- /dev/null +++ b/src/ThmViewerPackage/ThmViewerPackage.wixproj @@ -0,0 +1,35 @@ + + + + + + 59c4b122-5167-445b-8fc4-09dcd4eced89 + thmviewer + Package + + + + + + + + + + + + + thmviewer + {95228C13-97F5-484A-B4A2-ECF4618B0881} + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + diff --git a/src/ThmViewerPackage/packages.config b/src/ThmViewerPackage/packages.config new file mode 100644 index 00000000..d69ed11e --- /dev/null +++ b/src/ThmViewerPackage/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/src/Wix.Build.props b/src/Wix.Build.props new file mode 100644 index 00000000..936126e3 --- /dev/null +++ b/src/Wix.Build.props @@ -0,0 +1,12 @@ + + + + + + $(DefineConstants);CompanyName=$(Company) + + + + + + diff --git a/src/thmviewer/Resources/LoremIpsum.rtf b/src/thmviewer/Resources/LoremIpsum.rtf new file mode 100644 index 00000000..1ab0e65b Binary files /dev/null and b/src/thmviewer/Resources/LoremIpsum.rtf differ diff --git a/src/thmviewer/Resources/thm.xml b/src/thmviewer/Resources/thm.xml new file mode 100644 index 00000000..6394f0f1 --- /dev/null +++ b/src/thmviewer/Resources/thm.xml @@ -0,0 +1,11 @@ + + + + + + Consolas + Consolas + + + + diff --git a/src/thmviewer/display.cpp b/src/thmviewer/display.cpp new file mode 100644 index 00000000..cfd1c6b7 --- /dev/null +++ b/src/thmviewer/display.cpp @@ -0,0 +1,353 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +static const LPCWSTR THMVWR_WINDOW_CLASS_DISPLAY = L"ThmViewerDisplay"; + +struct DISPLAY_THREAD_CONTEXT +{ + HWND hWnd; + HINSTANCE hInstance; + + HANDLE hInit; +}; + +static DWORD WINAPI DisplayThreadProc( + __in LPVOID pvContext + ); +static LRESULT CALLBACK DisplayWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ); +static BOOL DisplayOnCreate( + __in THEME* pTheme, + __in HWND hWnd + ); + + +extern "C" HRESULT DisplayStart( + __in HINSTANCE hInstance, + __in HWND hWnd, + __out HANDLE *phThread, + __out DWORD* pdwThreadId + ) +{ + HRESULT hr = S_OK; + HANDLE rgHandles[2] = { }; + DISPLAY_THREAD_CONTEXT context = { }; + + rgHandles[0] = ::CreateEventW(NULL, TRUE, FALSE, NULL); + ExitOnNullWithLastError(rgHandles[0], hr, "Failed to create load init event."); + + context.hWnd = hWnd; + context.hInstance = hInstance; + context.hInit = rgHandles[0]; + + rgHandles[1] = ::CreateThread(NULL, 0, DisplayThreadProc, reinterpret_cast(&context), 0, pdwThreadId); + ExitOnNullWithLastError(rgHandles[1], hr, "Failed to create display thread."); + + ::WaitForMultipleObjects(countof(rgHandles), rgHandles, FALSE, INFINITE); + + *phThread = rgHandles[1]; + rgHandles[1] = NULL; + +LExit: + ReleaseHandle(rgHandles[1]); + ReleaseHandle(rgHandles[0]); + return hr; +} + +static DWORD WINAPI DisplayThreadProc( + __in LPVOID pvContext + ) +{ + HRESULT hr = S_OK; + + DISPLAY_THREAD_CONTEXT* pContext = static_cast(pvContext); + HINSTANCE hInstance = pContext->hInstance; + HWND hwndParent = pContext->hWnd; + + // We can signal the initialization event as soon as we have copied the context + // values into local variables. + ::SetEvent(pContext->hInit); + + BOOL fComInitialized = FALSE; + + HANDLE_THEME* pCurrentHandle = NULL; + ATOM atomWc = 0; + WNDCLASSW wc = { }; // the following are constant for the display window class. + wc.lpfnWndProc = DisplayWndProc; + wc.hInstance = hInstance; + wc.lpszClassName = THMVWR_WINDOW_CLASS_DISPLAY; + + HWND hWnd = NULL; + RECT rc = { }; + int x = CW_USEDEFAULT; + int y = CW_USEDEFAULT; + + BOOL fRedoMsg = FALSE; + BOOL fRet = FALSE; + MSG msg = { }; + + BOOL fCreateIfNecessary = FALSE; + + hr = ::CoInitialize(NULL); + ExitOnFailure(hr, "Failed to initialize COM on display thread."); + fComInitialized = TRUE; + + // As long as the parent window is alive and kicking, keep this thread going (with or without a theme to display ). + while (::IsWindow(hwndParent)) + { + if (pCurrentHandle && fCreateIfNecessary) + { + THEME* pTheme = pCurrentHandle->pTheme; + + if (CW_USEDEFAULT == x && CW_USEDEFAULT == y && ::GetWindowRect(hwndParent, &rc)) + { + x = rc.left; + y = rc.bottom + 20; + } + + hWnd = ::CreateWindowExW(0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, pTheme->nWidth, pTheme->nHeight, hwndParent, NULL, hInstance, pCurrentHandle); + ExitOnNullWithLastError(hWnd, hr, "Failed to create display window."); + + fCreateIfNecessary = FALSE; + } + + // message pump + while (fRedoMsg || 0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0))) + { + if (fRedoMsg) + { + fRedoMsg = FALSE; + } + + if (-1 == fRet) + { + hr = E_UNEXPECTED; + ExitOnFailure(hr, "Unexpected return value from display message pump."); + } + else if (NULL == msg.hwnd) // Thread message. + { + if (WM_THMVWR_NEW_THEME == msg.message) + { + // If there is already a handle, release it. + if (pCurrentHandle) + { + DecrementHandleTheme(pCurrentHandle); + pCurrentHandle = NULL; + } + + // If the window was created, remember its window location before we destroy + // it so so we can open the new window in the same place. + if (::IsWindow(hWnd)) + { + ::GetWindowRect(hWnd, &rc); + x = rc.left; + y = rc.top; + + ::DestroyWindow(hWnd); + } + + // If the display window class was registered, unregister it so we can + // reuse the same window class name for the new theme. + if (atomWc) + { + if (!::UnregisterClassW(reinterpret_cast(atomWc), hInstance)) + { + DWORD er = ::GetLastError(); + er = er; + } + + atomWc = 0; + } + + // If we were provided a new theme handle, create a new window class to + // support it. + pCurrentHandle = reinterpret_cast(msg.lParam); + if (pCurrentHandle) + { + wc.hIcon = reinterpret_cast(pCurrentHandle->pTheme->hIcon); + wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); + if (0 < pCurrentHandle->pTheme->cFonts) + { + wc.hbrBackground = pCurrentHandle->pTheme->rgFonts[pCurrentHandle->pTheme->dwFontId].hBackground; + } + atomWc = ::RegisterClassW(&wc); + if (!atomWc) + { + ExitWithLastError(hr, "Failed to register display window class."); + } + } + } + else if (WM_THMVWR_SHOWPAGE == msg.message) + { + if (pCurrentHandle && ::IsWindow(hWnd) && pCurrentHandle->pTheme->hwndParent == hWnd) + { + DWORD dwPageId = static_cast(msg.lParam); + int nCmdShow = static_cast(msg.wParam); + + // First show/hide the controls not associated with a page. + for (DWORD i = 0; i < pCurrentHandle->pTheme->cControls; ++i) + { + THEME_CONTROL* pControl = pCurrentHandle->pTheme->rgControls + i; + if (!pControl->wPageId) + { + ThemeShowControl(pCurrentHandle->pTheme, pControl->wId, nCmdShow); + } + } + + // If a page id was provided also, show/hide those controls + if (dwPageId) + { + // Ignore error since we aren't using variables and it can only fail when using variables. + ThemeShowPage(pCurrentHandle->pTheme, dwPageId, nCmdShow); + } + } + else // display window isn't visible or it doesn't match the current handle. + { + // Keep the current message around to try again after we break out of this loop + // and create the window. + fRedoMsg = TRUE; + fCreateIfNecessary = TRUE; + break; + } + } + } + else if (!ThemeHandleKeyboardMessage(pCurrentHandle->pTheme, hwndParent, &msg)) // Window message. + { + ::TranslateMessage(&msg); + ::DispatchMessageW(&msg); + } + } + } + +LExit: + if (::IsWindow(hWnd)) + { + ::DestroyWindow(hWnd); + } + + if (atomWc) + { + if (!::UnregisterClassW(THMVWR_WINDOW_CLASS_DISPLAY, hInstance)) + { + DWORD er = ::GetLastError(); + er = er; + } + } + + DecrementHandleTheme(pCurrentHandle); + + if (fComInitialized) + { + ::CoUninitialize(); + } + + return hr; +} + +static LRESULT CALLBACK DisplayWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ) +{ + static DWORD dwProgress = 0; + HANDLE_THEME* pHandleTheme = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); + + switch (uMsg) + { + case WM_NCCREATE: + { + LPCREATESTRUCT lpcs = reinterpret_cast(lParam); + IncrementHandleTheme(reinterpret_cast(lpcs->lpCreateParams)); + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(lpcs->lpCreateParams)); + } + break; + + case WM_CREATE: + if (!DisplayOnCreate(pHandleTheme->pTheme, hWnd)) + { + return -1; + } + break; + + case WM_TIMER: + if (!lParam && SUCCEEDED(ThemeSetProgressControl(pHandleTheme->pTheme, wParam, dwProgress))) + { + dwProgress += rand() % 10 + 1; + if (dwProgress > 100) + { + dwProgress = 0; + } + + return 0; + } + break; + + case WM_COMMAND: + { + WCHAR wzText[1024]; + ::StringCchPrintfW(wzText, countof(wzText), L"Command %u\r\n", LOWORD(wParam)); + OutputDebugStringW(wzText); + //::MessageBoxW(hWnd, wzText, L"Command fired", MB_OK); + } + break; + + case WM_SYSCOMMAND: + { + WCHAR wzText[1024]; + ::StringCchPrintfW(wzText, countof(wzText), L"SysCommand %u\r\n", LOWORD(wParam)); + OutputDebugStringW(wzText); + //::MessageBoxW(hWnd, wzText, L"Command fired", MB_OK); + } + break; + + case WM_DESTROY: + ThemeUnloadControls(pHandleTheme->pTheme); + ::PostQuitMessage(0); + break; + + case WM_NCDESTROY: + DecrementHandleTheme(pHandleTheme); + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, 0); + break; + } + + return ThemeDefWindowProc(pHandleTheme ? pHandleTheme->pTheme : NULL, hWnd, uMsg, wParam, lParam); +} + +static BOOL DisplayOnCreate( + __in THEME* pTheme, + __in HWND hWnd + ) +{ + HRESULT hr = S_OK; + + hr = ThemeLoadControls(pTheme, hWnd, NULL, 0); + ExitOnFailure(hr, "Failed to load theme controls"); + + // Pre-populate some control types with data. + for (DWORD i = 0; i < pTheme->cControls; ++i) + { + THEME_CONTROL* pControl = pTheme->rgControls + i; + if (THEME_CONTROL_TYPE_RICHEDIT == pControl->type) + { + hr = ThemeLoadRichEditFromResource(pTheme, pControl->wId, MAKEINTRESOURCEA(THMVWR_RES_RICHEDIT_FILE), ::GetModuleHandleW(NULL)); + ExitOnFailure(hr, "Failed to load richedit text."); + } + else if (THEME_CONTROL_TYPE_PROGRESSBAR == pControl->type) + { + DWORD dwId = ::SetTimer(hWnd, pControl->wId, 500, NULL); + dwId = dwId; // prevents warning in "ship" build. + Assert(dwId == pControl->wId); + } + } + +LExit: + return SUCCEEDED(hr); +} diff --git a/src/thmviewer/load.cpp b/src/thmviewer/load.cpp new file mode 100644 index 00000000..cd48caff --- /dev/null +++ b/src/thmviewer/load.cpp @@ -0,0 +1,219 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +struct LOAD_THREAD_CONTEXT +{ + HWND hWnd; + LPCWSTR wzThemePath; + LPCWSTR wzWxlPath; + + HANDLE hInit; +}; + +static DWORD WINAPI LoadThreadProc( + __in LPVOID pvContext + ); + + +extern "C" HRESULT LoadStart( + __in_z LPCWSTR wzThemePath, + __in_z_opt LPCWSTR wzWxlPath, + __in HWND hWnd, + __out HANDLE* phThread + ) +{ + HRESULT hr = S_OK; + HANDLE rgHandles[2] = { }; + LOAD_THREAD_CONTEXT context = { }; + + rgHandles[0] = ::CreateEventW(NULL, TRUE, FALSE, NULL); + ExitOnNullWithLastError(rgHandles[0], hr, "Failed to create load init event."); + + context.hWnd = hWnd; + context.wzThemePath = wzThemePath; + context.wzWxlPath = wzWxlPath; + context.hInit = rgHandles[0]; + + rgHandles[1] = ::CreateThread(NULL, 0, LoadThreadProc, &context, 0, NULL); + ExitOnNullWithLastError(rgHandles[1], hr, "Failed to create load thread."); + + ::WaitForMultipleObjects(countof(rgHandles), rgHandles, FALSE, INFINITE); + + *phThread = rgHandles[1]; + rgHandles[1] = NULL; + +LExit: + ReleaseHandle(rgHandles[1]); + ReleaseHandle(rgHandles[0]); + return hr; +} + + +static DWORD WINAPI LoadThreadProc( + __in LPVOID pvContext + ) +{ + HRESULT hr = S_OK; + WIX_LOCALIZATION* pWixLoc = NULL; + LPWSTR sczThemePath = NULL; + LPWSTR sczWxlPath = NULL; + BOOL fComInitialized = FALSE; + HANDLE hDirectory = INVALID_HANDLE_VALUE; + LPWSTR sczDirectory = NULL; + LPWSTR wzFileName = NULL; + + THEME* pTheme = NULL; + HANDLE_THEME* pHandle = NULL; + + LOAD_THREAD_CONTEXT* pContext = static_cast(pvContext); + HWND hWnd = pContext->hWnd; + + hr = StrAllocString(&sczThemePath, pContext->wzThemePath, 0); + ExitOnFailure(hr, "Failed to copy path to initial theme file."); + + if (pContext->wzWxlPath) + { + hr = StrAllocString(&sczWxlPath, pContext->wzWxlPath, 0); + ExitOnFailure(hr, "Failed to copy .wxl path to initial file."); + } + + // We can signal the initialization event as soon as we have copied the context + // values into local variables. + ::SetEvent(pContext->hInit); + + hr = ::CoInitialize(NULL); + ExitOnFailure(hr, "Failed to initialize COM on load thread."); + fComInitialized = TRUE; + + // Open a handle to the directory so we can put a notification on it. + hr = PathGetDirectory(sczThemePath, &sczDirectory); + ExitOnFailure(hr, "Failed to get path directory."); + + wzFileName = PathFile(sczThemePath); + + hDirectory = ::CreateFileW(sczDirectory, FILE_LIST_DIRECTORY, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + if (INVALID_HANDLE_VALUE == hDirectory) + { + ExitWithLastError(hr, "Failed to open directory: %ls", sczDirectory); + } + + BOOL fUpdated = FALSE; + do + { + // Get the last modified time on the file we're loading for verification that the + // file actually gets changed down below. + FILETIME ftModified = { }; + FileGetTime(sczThemePath, NULL, NULL, &ftModified); + + // Try to load the theme file. + hr = ThemeLoadFromFile(sczThemePath, &pTheme); + if (FAILED(hr)) + { + ::SendMessageW(hWnd, WM_THMVWR_THEME_LOAD_ERROR, 0, hr); + } + else + { + if (sczWxlPath) + { + hr = LocLoadFromFile(sczWxlPath, &pWixLoc); + ExitOnFailure(hr, "Failed to load loc file from path: %ls", sczWxlPath); + + hr = ThemeLocalize(pTheme, pWixLoc); + ExitOnFailure(hr, "Failed to localize theme: %ls", sczWxlPath); + } + + hr = AllocHandleTheme(pTheme, &pHandle); + ExitOnFailure(hr, "Failed to allocate handle to theme"); + + ::SendMessageW(hWnd, WM_THMVWR_NEW_THEME, 0, reinterpret_cast(pHandle)); + pHandle = NULL; + } + + fUpdated = FALSE; + do + { + DWORD rgbNotifications[1024]; + DWORD cbRead = 0; + if (!::ReadDirectoryChangesW(hDirectory, rgbNotifications, sizeof(rgbNotifications), FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE, &cbRead, NULL, NULL)) + { + ExitWithLastError(hr, "Failed while watching directory: %ls", sczDirectory); + } + + // Wait for half a second to let all the file handles get closed to minimize access + // denied errors. + ::Sleep(500); + + FILE_NOTIFY_INFORMATION* pNotification = reinterpret_cast(rgbNotifications); + while (pNotification) + { + // If our file was updated, check to see if the modified time really changed. The notifications + // are often trigger happy thinking the file changed two or three times in a row. Maybe it's AV + // software creating the problems but actually checking the modified date works well. + if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pNotification->FileName, pNotification->FileNameLength / sizeof(WCHAR), wzFileName, -1)) + { + FILETIME ft = { }; + FileGetTime(sczThemePath, NULL, NULL, &ft); + + fUpdated = (ftModified.dwHighDateTime < ft.dwHighDateTime) || (ftModified.dwHighDateTime == ft.dwHighDateTime && ftModified.dwLowDateTime < ft.dwLowDateTime); + break; + } + + pNotification = pNotification->NextEntryOffset ? reinterpret_cast(reinterpret_cast(pNotification) + pNotification->NextEntryOffset) : NULL; + } + } while (!fUpdated); + } while(fUpdated); + +LExit: + if (fComInitialized) + { + ::CoUninitialize(); + } + + LocFree(pWixLoc); + ReleaseFileHandle(hDirectory); + ReleaseStr(sczDirectory); + ReleaseStr(sczThemePath); + ReleaseStr(sczWxlPath); + return hr; +} + +extern "C" HRESULT AllocHandleTheme( + __in THEME* pTheme, + __out HANDLE_THEME** ppHandle + ) +{ + HRESULT hr = S_OK; + HANDLE_THEME* pHandle = NULL; + + pHandle = static_cast(MemAlloc(sizeof(HANDLE_THEME), TRUE)); + ExitOnNull(pHandle, hr, E_OUTOFMEMORY, "Failed to allocate theme handle."); + + pHandle->cReferences = 1; + pHandle->pTheme = pTheme; + + *ppHandle = pHandle; + pHandle = NULL; + +LExit: + ReleaseMem(pHandle); + return hr; +} + +extern "C" void IncrementHandleTheme( + __in HANDLE_THEME* pHandle + ) +{ + ::InterlockedIncrement(reinterpret_cast(&pHandle->cReferences)); +} + +extern "C" void DecrementHandleTheme( + __in HANDLE_THEME* pHandle + ) +{ + if (pHandle && 0 == ::InterlockedDecrement(reinterpret_cast(&pHandle->cReferences))) + { + ThemeFree(pHandle->pTheme); + MemFree(pHandle); + } +} diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config new file mode 100644 index 00000000..05bd6cc6 --- /dev/null +++ b/src/thmviewer/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/thmviewer/precomp.cpp b/src/thmviewer/precomp.cpp new file mode 100644 index 00000000..37664a1c --- /dev/null +++ b/src/thmviewer/precomp.cpp @@ -0,0 +1,3 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" diff --git a/src/thmviewer/precomp.h b/src/thmviewer/precomp.h new file mode 100644 index 00000000..1d186cf4 --- /dev/null +++ b/src/thmviewer/precomp.h @@ -0,0 +1,69 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + + +#include +#include +#include +#include +#include +#include +#include + +#pragma warning(push) +#pragma warning(disable:4458) +#include +#pragma warning(pop) + +#include "dutil.h" +#include "apputil.h" +#include "memutil.h" +#include "dirutil.h" +#include "fileutil.h" +#include "locutil.h" +#include "logutil.h" +#include "pathutil.h" +#include "resrutil.h" +#include "shelutil.h" +#include "strutil.h" +#include "thmutil.h" + +#include "resource.h" + +struct HANDLE_THEME +{ + DWORD cReferences; + THEME* pTheme; +}; + +enum WM_THMVWR +{ + WM_THMVWR_SHOWPAGE = WM_APP, + WM_THMVWR_PARSE_FILE, + WM_THMVWR_NEW_THEME, + WM_THMVWR_THEME_LOAD_ERROR, +}; + +extern "C" HRESULT DisplayStart( + __in HINSTANCE hInstance, + __in HWND hWnd, + __out HANDLE *phThread, + __out DWORD* pdwThreadId + ); +extern "C" HRESULT LoadStart( + __in_z LPCWSTR wzThemePath, + __in_z LPCWSTR wzWxlPath, + __in HWND hWnd, + __out HANDLE* phThread + ); + +extern "C" HRESULT AllocHandleTheme( + __in THEME* pTheme, + __out HANDLE_THEME** ppHandle + ); +extern "C" void IncrementHandleTheme( + __in HANDLE_THEME* pHandle + ); +extern "C" void DecrementHandleTheme( + __in HANDLE_THEME* pHandle + ); diff --git a/src/thmviewer/resource.h b/src/thmviewer/resource.h new file mode 100644 index 00000000..4acc32cc --- /dev/null +++ b/src/thmviewer/resource.h @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#define IDC_STATIC -1 +#define THMVWR_RES_THEME_FILE 1 +#define THMVWR_RES_RICHEDIT_FILE 2 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1003 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/thmviewer/thmviewer.cpp b/src/thmviewer/thmviewer.cpp new file mode 100644 index 00000000..511272a9 --- /dev/null +++ b/src/thmviewer/thmviewer.cpp @@ -0,0 +1,465 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +static const LPCWSTR THMVWR_WINDOW_CLASS_MAIN = L"ThmViewerMain"; + +static THEME* vpTheme = NULL; +static DWORD vdwDisplayThreadId = 0; + +enum THMVWR_CONTROL +{ + // Non-paged controls + THMVWR_CONTROL_TREE = THEME_FIRST_ASSIGN_CONTROL_ID, +}; + +static THEME_ASSIGN_CONTROL_ID vrgInitControls[] = { + { THMVWR_CONTROL_TREE, L"Tree" }, +}; + +// Internal functions + +static HRESULT ProcessCommandLine( + __in_z_opt LPCWSTR wzCommandLine, + __out_z LPWSTR* psczThemeFile, + __out_z LPWSTR* psczWxlFile + ); +static HRESULT CreateTheme( + __in HINSTANCE hInstance, + __out THEME** ppTheme + ); +static HRESULT CreateMainWindowClass( + __in HINSTANCE hInstance, + __in THEME* pTheme, + __out ATOM* pAtom + ); +static LRESULT CALLBACK MainWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ); +static void OnThemeLoadError( + __in THEME* pTheme, + __in HRESULT hrFailure + ); +static void OnNewTheme( + __in THEME* pTheme, + __in HWND hWnd, + __in HANDLE_THEME* pHandle + ); + + +int WINAPI wWinMain( + __in HINSTANCE hInstance, + __in_opt HINSTANCE /* hPrevInstance */, + __in_z LPWSTR lpCmdLine, + __in int /*nCmdShow*/ + ) +{ + ::HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); + + HRESULT hr = S_OK; + BOOL fComInitialized = FALSE; + LPWSTR sczThemeFile = NULL; + LPWSTR sczWxlFile = NULL; + ATOM atom = 0; + HWND hWnd = NULL; + + HANDLE hDisplayThread = NULL; + HANDLE hLoadThread = NULL; + + BOOL fRet = FALSE; + MSG msg = { }; + + hr = ::CoInitialize(NULL); + ExitOnFailure(hr, "Failed to initialize COM."); + fComInitialized = TRUE; + + hr = ProcessCommandLine(lpCmdLine, &sczThemeFile, &sczWxlFile); + ExitOnFailure(hr, "Failed to process command line."); + + hr = CreateTheme(hInstance, &vpTheme); + ExitOnFailure(hr, "Failed to create theme."); + + hr = CreateMainWindowClass(hInstance, vpTheme, &atom); + ExitOnFailure(hr, "Failed to create main window."); + + hWnd = ::CreateWindowExW(0, reinterpret_cast(atom), vpTheme->sczCaption, vpTheme->dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, vpTheme->nWidth, vpTheme->nHeight, HWND_DESKTOP, NULL, hInstance, NULL); + ExitOnNullWithLastError(hWnd, hr, "Failed to create window."); + + if (!sczThemeFile) + { + // Prompt for a path to the theme file. + OPENFILENAMEW ofn = { }; + WCHAR wzFile[MAX_PATH] = { }; + + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = hWnd; + ofn.lpstrFile = wzFile; + ofn.nMaxFile = countof(wzFile); + ofn.lpstrFilter = L"Theme Files\0*.thm\0XML Files\0*.xml\0All Files\0*.*\0"; + ofn.nFilterIndex = 1; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + ofn.lpstrTitle = vpTheme->sczCaption; + + if (::GetOpenFileNameW(&ofn)) + { + hr = StrAllocString(&sczThemeFile, wzFile, 0); + ExitOnFailure(hr, "Failed to copy opened file to theme file."); + } + else + { + ::MessageBoxW(hWnd, L"Must specify a path to theme file.", vpTheme->sczCaption, MB_OK | MB_ICONERROR); + ExitFunction1(hr = E_INVALIDARG); + } + } + + hr = DisplayStart(hInstance, hWnd, &hDisplayThread, &vdwDisplayThreadId); + ExitOnFailure(hr, "Failed to start display."); + + hr = LoadStart(sczThemeFile, sczWxlFile, hWnd, &hLoadThread); + ExitOnFailure(hr, "Failed to start load."); + + // message pump + while (0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0))) + { + if (-1 == fRet) + { + hr = E_UNEXPECTED; + ExitOnFailure(hr, "Unexpected return value from message pump."); + } + else if (!ThemeHandleKeyboardMessage(vpTheme, msg.hwnd, &msg)) + { + ::TranslateMessage(&msg); + ::DispatchMessageW(&msg); + } + } + +LExit: + if (::IsWindow(hWnd)) + { + ::DestroyWindow(hWnd); + } + + if (hDisplayThread) + { + ::PostThreadMessageW(vdwDisplayThreadId, WM_QUIT, 0, 0); + ::WaitForSingleObject(hDisplayThread, 10000); + ::CloseHandle(hDisplayThread); + } + + // TODO: come up with a good way to kill the load thread, probably need to switch + // the ReadDirectoryW() to overlapped mode. + ReleaseHandle(hLoadThread); + + if (atom && !::UnregisterClassW(reinterpret_cast(atom), hInstance)) + { + DWORD er = ::GetLastError(); + er = er; + } + + ThemeFree(vpTheme); + ThemeUninitialize(); + + // uninitialize COM + if (fComInitialized) + { + ::CoUninitialize(); + } + + ReleaseStr(sczThemeFile); + ReleaseStr(sczWxlFile); + return hr; +} + + +// +// ProcessCommandLine - process the provided command line arguments. +// +static HRESULT ProcessCommandLine( + __in_z_opt LPCWSTR wzCommandLine, + __out_z LPWSTR* psczThemeFile, + __out_z LPWSTR* psczWxlFile + ) +{ + HRESULT hr = S_OK; + int argc = 0; + LPWSTR* argv = NULL; + + if (wzCommandLine && *wzCommandLine) + { + hr = AppParseCommandLine(wzCommandLine, &argc, &argv); + ExitOnFailure(hr, "Failed to parse command line."); + + for (int i = 0; i < argc; ++i) + { + if (argv[i][0] == L'-' || argv[i][0] == L'/') + { + if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"lang", -1)) + { + if (i + 1 >= argc) + { + ExitOnRootFailure(hr = E_INVALIDARG, "Must specify a language."); + } + + ++i; + } + } + else + { + LPCWSTR wzExtension = PathExtension(argv[i]); + if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, wzExtension, -1, L".wxl", -1)) + { + hr = StrAllocString(psczWxlFile, argv[i], 0); + } + else + { + hr = StrAllocString(psczThemeFile, argv[i], 0); + } + ExitOnFailure(hr, "Failed to copy path to file."); + } + } + } + +LExit: + if (argv) + { + AppFreeCommandLineArgs(argv); + } + + return hr; +} + +static HRESULT CreateTheme( + __in HINSTANCE hInstance, + __out THEME** ppTheme + ) +{ + HRESULT hr = S_OK; + + hr = ThemeInitialize(hInstance); + ExitOnFailure(hr, "Failed to initialize theme manager."); + + hr = ThemeLoadFromResource(hInstance, MAKEINTRESOURCEA(THMVWR_RES_THEME_FILE), ppTheme); + ExitOnFailure(hr, "Failed to load theme from thmviewer.thm."); + +LExit: + return hr; +} + +static HRESULT CreateMainWindowClass( + __in HINSTANCE hInstance, + __in THEME* pTheme, + __out ATOM* pAtom + ) +{ + HRESULT hr = S_OK; + ATOM atom = 0; + WNDCLASSW wc = { }; + + wc.lpfnWndProc = MainWndProc; + wc.hInstance = hInstance; + wc.hIcon = reinterpret_cast(pTheme->hIcon); + wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); + wc.hbrBackground = pTheme->rgFonts[pTheme->dwFontId].hBackground; + wc.lpszMenuName = NULL; + wc.lpszClassName = THMVWR_WINDOW_CLASS_MAIN; + atom = ::RegisterClassW(&wc); + if (!atom) + { + ExitWithLastError(hr, "Failed to register main windowclass ."); + } + + *pAtom = atom; + +LExit: + return hr; +} + +static LRESULT CALLBACK MainWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ) +{ + HANDLE_THEME* pHandleTheme = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); + + switch (uMsg) + { + case WM_NCCREATE: + { + //LPCREATESTRUCT lpcs = reinterpret_cast(lParam); + //pBA = reinterpret_cast(lpcs->lpCreateParams); + //::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pBA)); + } + break; + + case WM_NCDESTROY: + DecrementHandleTheme(pHandleTheme); + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, 0); + break; + + case WM_CREATE: + { + HRESULT hr = ThemeLoadControls(vpTheme, hWnd, vrgInitControls, countof(vrgInitControls)); + if (FAILED(hr)) + { + return -1; + } + } + break; + + case WM_THMVWR_THEME_LOAD_ERROR: + OnThemeLoadError(vpTheme, lParam); + return 0; + + case WM_THMVWR_NEW_THEME: + OnNewTheme(vpTheme, hWnd, reinterpret_cast(lParam)); + return 0; + + case WM_DESTROY: + ::PostQuitMessage(0); + break; + + case WM_NOTIFY: + { + NMHDR* pnmhdr = reinterpret_cast(lParam); + switch (pnmhdr->code) + { + case TVN_SELCHANGEDW: + { + NMTREEVIEWW* ptv = reinterpret_cast(lParam); + ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_HIDE, ptv->itemOld.lParam); + ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_SHOW, ptv->itemNew.lParam); + } + break; + + //case NM_DBLCLK: + // TVITEM item = { }; + // item.mask = TVIF_PARAM; + // item.hItem = TreeView_GetSelection(pnmhdr->hwndFrom); + // TreeView_GetItem(pnmhdr->hwndFrom, &item); + // ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_SHOW, item.lParam); + // return 1; + } + } + break; + } + + return ThemeDefWindowProc(vpTheme, hWnd, uMsg, wParam, lParam); +} + +static void OnThemeLoadError( + __in THEME* pTheme, + __in HRESULT hrFailure + ) +{ + HRESULT hr = S_OK; + LPWSTR sczMessage = NULL; + TVINSERTSTRUCTW tvi = { }; + + // Add the application node. + tvi.hParent = NULL; + tvi.hInsertAfter = TVI_ROOT; + tvi.item.mask = TVIF_TEXT | TVIF_PARAM; + tvi.item.lParam = 0; + tvi.item.pszText = L"Failed to load theme."; + tvi.hParent = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); + + hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x.", hrFailure); + ExitOnFailure(hr, "Failed to format error message."); + + tvi.item.pszText = sczMessage; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + + hr = StrAllocFromError(&sczMessage, hrFailure, NULL); + ExitOnFailure(hr, "Failed to format error message text."); + + tvi.item.pszText = sczMessage; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_EXPAND, TVE_EXPAND, reinterpret_cast(tvi.hParent)); + +LExit: + ReleaseStr(sczMessage); +} + + +static void OnNewTheme( + __in THEME* pTheme, + __in HWND hWnd, + __in HANDLE_THEME* pHandle + ) +{ + HANDLE_THEME* pOldHandle = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); + THEME* pNewTheme = pHandle->pTheme; + + WCHAR wzSelectedPage[MAX_PATH] = { }; + HTREEITEM htiSelected = NULL; + TVINSERTSTRUCTW tvi = { }; + TVITEMW item = { }; + + if (pOldHandle) + { + DecrementHandleTheme(pOldHandle); + pOldHandle = NULL; + } + + // Pass the new theme handle to the display thread so it can get the display window prepared + // to show the new theme. + IncrementHandleTheme(pHandle); + ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_NEW_THEME, 0, reinterpret_cast(pHandle)); + + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pHandle)); + + // Remember the currently selected item by name so we can try to automatically select it later. + // Otherwise, the user would see their window destroyed after every save of their theme file and + // have to click to get the window back. + item.mask = TVIF_TEXT; + item.pszText = wzSelectedPage; + item.cchTextMax = countof(wzSelectedPage); + item.hItem = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_GETNEXTITEM, TVGN_CARET, NULL)); + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_GETITEM, 0, reinterpret_cast(&item)); + + // Remove the previous items in the tree. + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_DELETEITEM, 0, reinterpret_cast(TVI_ROOT)); + + // Add the application node. + tvi.hParent = NULL; + tvi.hInsertAfter = TVI_ROOT; + tvi.item.mask = TVIF_TEXT | TVIF_PARAM; + tvi.item.lParam = 0; + tvi.item.pszText = pHandle && pHandle->pTheme && pHandle->pTheme->sczCaption ? pHandle->pTheme->sczCaption : L"Window"; + + // Add the pages. + tvi.hParent = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); + tvi.hInsertAfter = TVI_SORT; + for (DWORD i = 0; i < pNewTheme->cPages; ++i) + { + THEME_PAGE* pPage = pNewTheme->rgPages + i; + if (pPage->sczName && *pPage->sczName) + { + tvi.item.pszText = pPage->sczName; + tvi.item.lParam = i + 1; //prgdwPageIds[i]; - TODO: do the right thing here by calling ThemeGetPageIds(), should not assume we know how the page ids will be calculated. + + HTREEITEM hti = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); + if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pPage->sczName, -1, wzSelectedPage, -1)) + { + htiSelected = hti; + } + } + } + + if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, L"Application", -1, wzSelectedPage, -1)) + { + htiSelected = tvi.hParent; + } + + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_EXPAND, TVE_EXPAND, reinterpret_cast(tvi.hParent)); + if (htiSelected) + { + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_SELECTITEM, TVGN_CARET, reinterpret_cast(htiSelected)); + } +} diff --git a/src/thmviewer/thmviewer.manifest b/src/thmviewer/thmviewer.manifest new file mode 100644 index 00000000..6bd63a5e --- /dev/null +++ b/src/thmviewer/thmviewer.manifest @@ -0,0 +1,11 @@ + + + + + + + WiX Toolset Theme Viewer + + + + diff --git a/src/thmviewer/thmviewer.rc b/src/thmviewer/thmviewer.rc new file mode 100644 index 00000000..dc6d7242 --- /dev/null +++ b/src/thmviewer/thmviewer.rc @@ -0,0 +1,12 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include +#include +#include "resource.h" + +//#define MANIFEST_RESOURCE_ID 1 +//MANIFEST_RESOURCE_ID RT_MANIFEST "thmviewer.manifest" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +THMVWR_RES_THEME_FILE RCDATA "Resources\\thm.xml" +THMVWR_RES_RICHEDIT_FILE RCDATA "Resources\\LoremIpsum.rtf" diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj new file mode 100644 index 00000000..0c4612f2 --- /dev/null +++ b/src/thmviewer/thmviewer.vcxproj @@ -0,0 +1,73 @@ + + + + + + + + + Debug + Win32 + + + Release + Win32 + + + + + {95228C13-97F5-484A-B4A2-ECF4618B0881} + Win32Proj + Application + v141 + Unicode + WiX Toolset Theme Viewer + + + + + + + + + + + + + + comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib + + + + + + + Create + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + diff --git a/src/thmviewer/thmviewer.vcxproj.filters b/src/thmviewer/thmviewer.vcxproj.filters new file mode 100644 index 00000000..79e08275 --- /dev/null +++ b/src/thmviewer/thmviewer.vcxproj.filters @@ -0,0 +1,53 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + + + + Resource Files + + + Resource Files + + + + + Header Files + + + Header Files + + + + + Resource Files + + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 14fdc9113bdc7270fb33e06990081988eb099ba9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 9 May 2019 08:43:08 -0700 Subject: Update to latest Core changes plus other minor fixes --- src/Directory.Build.props | 4 ++-- .../WixToolset.BuildTasks.csproj | 2 +- .../WixToolset.Tools.Core.csproj | 2 +- .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 21 +++++++-------------- .../WixToolsetTest.BuildTasks.csproj | 4 ++-- .../WixToolsetTest.BuildTasks.v3.ncrunchproject | 1 - .../WixToolsetTest.WixCop.csproj | 4 ++-- .../WixToolsetTest.WixCop.v3.ncrunchproject | 1 + src/thmviewer/thmviewer.cpp | 2 +- src/thmviewer/thmviewer.v3.ncrunchproject | 7 +++++++ src/thmviewer/thmviewer.vcxproj.filters | 4 +++- src/wix/wix.csproj | 2 +- src/wixcop/WixCop.csproj | 2 +- 13 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 src/thmviewer/thmviewer.v3.ncrunchproject diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 30ce4e48..a22f4470 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -22,7 +22,7 @@ WiX Toolset - - + + diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 8713709e..c5b609c6 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj index 92111c61..0f67db73 100644 --- a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj +++ b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 74978322..9f761c32 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -13,13 +13,6 @@ namespace WixToolsetTest.BuildTasks { private static readonly string WixTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(DoIt).Assembly.CodeBase).AbsolutePath), "wix.targets"); - public MsbuildFixture() - { - this.MsbuildRunner = new MsbuildRunner(); - } - - private MsbuildRunner MsbuildRunner { get; } - [Fact] public void CanBuildSimpleMsiPackage() { @@ -31,7 +24,7 @@ namespace WixToolsetTest.BuildTasks var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var result = this.MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", @@ -69,7 +62,7 @@ namespace WixToolsetTest.BuildTasks var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var result = this.MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", @@ -94,7 +87,7 @@ namespace WixToolsetTest.BuildTasks var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var result = this.MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", @@ -116,7 +109,7 @@ namespace WixToolsetTest.BuildTasks var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var result = this.MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", @@ -141,7 +134,7 @@ namespace WixToolsetTest.BuildTasks var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var result = this.MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", @@ -169,7 +162,7 @@ namespace WixToolsetTest.BuildTasks var intermediateFolder = Path.Combine(baseFolder, @"obj\"); // Build - var result = this.MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", @@ -187,7 +180,7 @@ namespace WixToolsetTest.BuildTasks Assert.NotEmpty(createdPaths); // Clean - result = this.MsbuildRunner.Execute(projectPath, new[] + result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", $"-p:IntermediateOutputPath={intermediateFolder}", diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index edab8a67..c5498de4 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -27,7 +27,7 @@ - - + + diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject index 8f3624cb..cf22dfa9 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject @@ -1,6 +1,5 @@  - True \ No newline at end of file diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj index f399760f..45f8c57d 100644 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj @@ -38,7 +38,7 @@ - - + + diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject index cf22dfa9..8f3624cb 100644 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject @@ -1,5 +1,6 @@  + True \ No newline at end of file diff --git a/src/thmviewer/thmviewer.cpp b/src/thmviewer/thmviewer.cpp index 511272a9..425cdf43 100644 --- a/src/thmviewer/thmviewer.cpp +++ b/src/thmviewer/thmviewer.cpp @@ -98,7 +98,7 @@ int WINAPI wWinMain( ofn.hwndOwner = hWnd; ofn.lpstrFile = wzFile; ofn.nMaxFile = countof(wzFile); - ofn.lpstrFilter = L"Theme Files\0*.thm\0XML Files\0*.xml\0All Files\0*.*\0"; + ofn.lpstrFilter = L"Theme Files (*.thm)\0*.thm\0XML Files (*.xml)\0*.xml\0All Files (*.*)\0*.*\0"; ofn.nFilterIndex = 1; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; ofn.lpstrTitle = vpTheme->sczCaption; diff --git a/src/thmviewer/thmviewer.v3.ncrunchproject b/src/thmviewer/thmviewer.v3.ncrunchproject new file mode 100644 index 00000000..3cffd6ce --- /dev/null +++ b/src/thmviewer/thmviewer.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + thmviewer.manifest + + + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj.filters b/src/thmviewer/thmviewer.vcxproj.filters index 79e08275..9a1eff3f 100644 --- a/src/thmviewer/thmviewer.vcxproj.filters +++ b/src/thmviewer/thmviewer.vcxproj.filters @@ -24,9 +24,11 @@ Source Files + + Source Files + - Resource Files diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 9cb5658f..398952af 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -26,7 +26,7 @@ - + diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index be10524d..7a17caf1 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -25,7 +25,7 @@ - + -- cgit v1.2.3-55-g6feb From 70d459c39d1716b2d26ffcbd2c4037d646b9ec37 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 15 May 2019 16:21:14 -0700 Subject: Extract common converters code to Converters repo and use that instead --- nuget.config | 1 + src/test/WixToolsetTest.WixCop/ConverterFixture.cs | 554 ------------------ src/wixcop/CommandLine/ConvertCommand.cs | 5 +- src/wixcop/Converter.cs | 629 --------------------- src/wixcop/WixCop.csproj | 2 +- 5 files changed, 5 insertions(+), 1186 deletions(-) delete mode 100644 src/test/WixToolsetTest.WixCop/ConverterFixture.cs delete mode 100644 src/wixcop/Converter.cs diff --git a/nuget.config b/nuget.config index e8a0cc92..3fb7b617 100644 --- a/nuget.config +++ b/nuget.config @@ -2,6 +2,7 @@ + diff --git a/src/test/WixToolsetTest.WixCop/ConverterFixture.cs b/src/test/WixToolsetTest.WixCop/ConverterFixture.cs deleted file mode 100644 index ceac07d6..00000000 --- a/src/test/WixToolsetTest.WixCop/ConverterFixture.cs +++ /dev/null @@ -1,554 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.WixCop -{ - using System; - using System.IO; - using System.Text; - using System.Xml.Linq; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - using WixToolset.Tools.WixCop; - using Xunit; - - public class ConverterFixture - { - private static readonly XNamespace Wix4Namespace = "http://wixtoolset.org/schemas/v4/wxs"; - - [Fact] - public void EnsuresDeclaration() - { - var parse = String.Join(Environment.NewLine, - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void EnsuresUtf8Declaration() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 4, null, null); - - var errors = converter.ConvertDocument(document); - - Assert.Equal(1, errors); - Assert.Equal("1.0", document.Declaration.Version); - Assert.Equal("utf-8", document.Declaration.Encoding); - } - - [Fact] - public void CanFixWhitespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 4, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(expected, actual); - Assert.Equal(4, errors); - } - - [Fact] - public void CanPreserveNewLines() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - "", - " ", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - "", - " ", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 4, null, null); - - var conversions = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(expected, actual); - Assert.Equal(3, conversions); - } - - [Fact] - public void CanConvertWithNewLineAtEndOfFile() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - "", - " ", - "", - " ", - "", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - "", - " ", - "", - " ", - "", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 4, null, null); - - var conversions = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(expected, actual); - Assert.Equal(3, conversions); - } - - [Fact] - public void CanFixCdataWhitespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(expected, actual); - Assert.Equal(2, errors); - } - - [Fact] - public void CanFixCdataWithWhitespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(expected, actual); - Assert.Equal(2, errors); - } - - [Fact] - public void CanConvertMainNamespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - //Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertNamedMainNamespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); - } - - [Fact] - public void CanConvertNonWixDefaultNamespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - " ", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(expected, actual); - Assert.Equal(2, errors); - Assert.Equal(Wix4Namespace, document.Root.GetNamespaceOfPrefix("w")); - Assert.Equal("http://wixtoolset.org/schemas/v4/wxs/util", document.Root.GetDefaultNamespace()); - } - - [Fact] - public void CanConvertExtensionNamespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(2, errors); - Assert.Equal(expected, actual); - Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); - } - - [Fact] - public void CanConvertMissingNamespace() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - Assert.Equal(Wix4Namespace, document.Root.GetDefaultNamespace()); - } - - [Fact] - public void CanConvertAnonymousFile() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertShortNameDirectoryWithoutName() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertSuppressSignatureValidationNo() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - [Fact] - public void CanConvertSuppressSignatureValidationYes() - { - var parse = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var expected = String.Join(Environment.NewLine, - "", - "", - " ", - ""); - - var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - - var messaging = new DummyMessaging(); - var converter = new Converter(messaging, 2, null, null); - - var errors = converter.ConvertDocument(document); - - var actual = UnformattedDocumentString(document); - - Assert.Equal(1, errors); - Assert.Equal(expected, actual); - } - - private static string UnformattedDocumentString(XDocument document) - { - var sb = new StringBuilder(); - - using (var writer = new StringWriter(sb)) - { - document.Save(writer, SaveOptions.DisableFormatting); - } - - return sb.ToString(); - } - - private class DummyMessaging : IMessaging - { - public bool EncounteredError { get; set; } - - public int LastErrorNumber { get; set; } - - public bool ShowVerboseMessages { get; set; } - - public bool SuppressAllWarnings { get; set; } - - public bool WarningsAsError { get; set; } - - public void ElevateWarningMessage(int warningNumber) - { - } - - public string FormatMessage(Message message) => String.Empty; - - public void SetListener(IMessageListener listener) - { - } - - public void SuppressWarningMessage(int warningNumber) - { - } - - public void Write(Message message) - { - } - - public void Write(string message, bool verbose = false) - { - } - } - } -} diff --git a/src/wixcop/CommandLine/ConvertCommand.cs b/src/wixcop/CommandLine/ConvertCommand.cs index c65652ab..a9a110fe 100644 --- a/src/wixcop/CommandLine/ConvertCommand.cs +++ b/src/wixcop/CommandLine/ConvertCommand.cs @@ -6,6 +6,7 @@ namespace WixToolset.Tools.WixCop.CommandLine using System.Collections.Generic; using System.IO; using System.Xml; + using WixToolset.Converters; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; @@ -75,7 +76,7 @@ namespace WixToolset.Tools.WixCop.CommandLine } var messaging = this.ServiceProvider.GetService(); - var converter = new Converter(messaging, this.IndentationAmount, this.ErrorsAsWarnings, this.IgnoreErrors); + var converter = new Wix3Converter(messaging, this.IndentationAmount, this.ErrorsAsWarnings, this.IgnoreErrors); var errors = this.InspectSubDirectories(converter, Path.GetFullPath(".")); @@ -131,7 +132,7 @@ namespace WixToolset.Tools.WixCop.CommandLine /// /// The directory whose sub-directories will be inspected. /// The number of errors that were found. - private int InspectSubDirectories(Converter converter, string directory) + private int InspectSubDirectories(Wix3Converter converter, string directory) { var errors = 0; diff --git a/src/wixcop/Converter.cs b/src/wixcop/Converter.cs deleted file mode 100644 index 37016c19..00000000 --- a/src/wixcop/Converter.cs +++ /dev/null @@ -1,629 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.WixCop -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Text; - using System.Xml; - using System.Xml.Linq; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Tools.Core; - - /// - /// WiX source code converter. - /// - public class Converter - { - private const char XDocumentNewLine = '\n'; // XDocument normalizes "\r\n" to just "\n". - private static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; - - private static readonly XName DirectoryElementName = WixNamespace + "Directory"; - private static readonly XName FileElementName = WixNamespace + "File"; - private static readonly XName ExePackageElementName = WixNamespace + "ExePackage"; - private static readonly XName MsiPackageElementName = WixNamespace + "MsiPackage"; - private static readonly XName MspPackageElementName = WixNamespace + "MspPackage"; - private static readonly XName MsuPackageElementName = WixNamespace + "MsuPackage"; - private static readonly XName PayloadElementName = WixNamespace + "Payload"; - private static readonly XName CustomActionElementName = WixNamespace + "CustomAction"; - private static readonly XName PropertyElementName = WixNamespace + "Property"; - private static readonly XName WixElementWithoutNamespaceName = XNamespace.None + "Wix"; - - private static readonly Dictionary OldToNewNamespaceMapping = new Dictionary() - { - { "http://schemas.microsoft.com/wix/BalExtension", "http://wixtoolset.org/schemas/v4/wxs/bal" }, - { "http://schemas.microsoft.com/wix/ComPlusExtension", "http://wixtoolset.org/schemas/v4/wxs/complus" }, - { "http://schemas.microsoft.com/wix/DependencyExtension", "http://wixtoolset.org/schemas/v4/wxs/dependency" }, - { "http://schemas.microsoft.com/wix/DifxAppExtension", "http://wixtoolset.org/schemas/v4/wxs/difxapp" }, - { "http://schemas.microsoft.com/wix/FirewallExtension", "http://wixtoolset.org/schemas/v4/wxs/firewall" }, - { "http://schemas.microsoft.com/wix/GamingExtension", "http://wixtoolset.org/schemas/v4/wxs/gaming" }, - { "http://schemas.microsoft.com/wix/IIsExtension", "http://wixtoolset.org/schemas/v4/wxs/iis" }, - { "http://schemas.microsoft.com/wix/MsmqExtension", "http://wixtoolset.org/schemas/v4/wxs/msmq" }, - { "http://schemas.microsoft.com/wix/NetFxExtension", "http://wixtoolset.org/schemas/v4/wxs/netfx" }, - { "http://schemas.microsoft.com/wix/PSExtension", "http://wixtoolset.org/schemas/v4/wxs/powershell" }, - { "http://schemas.microsoft.com/wix/SqlExtension", "http://wixtoolset.org/schemas/v4/wxs/sql" }, - { "http://schemas.microsoft.com/wix/TagExtension", "http://wixtoolset.org/schemas/v4/wxs/tag" }, - { "http://schemas.microsoft.com/wix/UtilExtension", "http://wixtoolset.org/schemas/v4/wxs/util" }, - { "http://schemas.microsoft.com/wix/VSExtension", "http://wixtoolset.org/schemas/v4/wxs/vs" }, - { "http://wixtoolset.org/schemas/thmutil/2010", "http://wixtoolset.org/schemas/v4/thmutil" }, - { "http://schemas.microsoft.com/wix/2009/Lux", "http://wixtoolset.org/schemas/v4/lux" }, - { "http://schemas.microsoft.com/wix/2006/wi", "http://wixtoolset.org/schemas/v4/wxs" }, - { "http://schemas.microsoft.com/wix/2006/localization", "http://wixtoolset.org/schemas/v4/wxl" }, - { "http://schemas.microsoft.com/wix/2006/libraries", "http://wixtoolset.org/schemas/v4/wixlib" }, - { "http://schemas.microsoft.com/wix/2006/objects", "http://wixtoolset.org/schemas/v4/wixobj" }, - { "http://schemas.microsoft.com/wix/2006/outputs", "http://wixtoolset.org/schemas/v4/wixout" }, - { "http://schemas.microsoft.com/wix/2007/pdbs", "http://wixtoolset.org/schemas/v4/wixpdb" }, - { "http://schemas.microsoft.com/wix/2003/04/actions", "http://wixtoolset.org/schemas/v4/wi/actions" }, - { "http://schemas.microsoft.com/wix/2006/tables", "http://wixtoolset.org/schemas/v4/wi/tables" }, - { "http://schemas.microsoft.com/wix/2006/WixUnit", "http://wixtoolset.org/schemas/v4/wixunit" }, - }; - - private readonly Dictionary> ConvertElementMapping; - - /// - /// Instantiate a new Converter class. - /// - /// Indentation value to use when validating leading whitespace. - /// Test errors to display as warnings. - /// Test errors to ignore. - public Converter(IMessaging messaging, int indentationAmount, IEnumerable errorsAsWarnings = null, IEnumerable ignoreErrors = null) - { - this.ConvertElementMapping = new Dictionary> - { - { Converter.DirectoryElementName, this.ConvertDirectoryElement }, - { Converter.FileElementName, this.ConvertFileElement }, - { Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation }, - { Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, - { Converter.CustomActionElementName, this.ConvertCustomActionElement }, - { Converter.PropertyElementName, this.ConvertPropertyElement }, - { Converter.WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace }, - }; - - this.Messaging = messaging; - - this.IndentationAmount = indentationAmount; - - this.ErrorsAsWarnings = new HashSet(this.YieldConverterTypes(errorsAsWarnings)); - - this.IgnoreErrors = new HashSet(this.YieldConverterTypes(ignoreErrors)); - } - - private int Errors { get; set; } - - private HashSet ErrorsAsWarnings { get; set; } - - private HashSet IgnoreErrors { get; set; } - - private IMessaging Messaging { get; } - - private int IndentationAmount { get; set; } - - private string SourceFile { get; set; } - - /// - /// Convert a file. - /// - /// The file to convert. - /// Option to save the converted errors that are found. - /// The number of errors found. - public int ConvertFile(string sourceFile, bool saveConvertedFile) - { - XDocument document; - - // Set the instance info. - this.Errors = 0; - this.SourceFile = sourceFile; - - try - { - document = XDocument.Load(this.SourceFile, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); - } - catch (XmlException e) - { - this.OnError(ConverterTestType.XmlException, null, "The xml is invalid. Detail: '{0}'", e.Message); - - return this.Errors; - } - - this.ConvertDocument(document); - - // Fix errors if requested and necessary. - if (saveConvertedFile && 0 < this.Errors) - { - try - { - using (var writer = File.CreateText(this.SourceFile)) - { - document.Save(writer, SaveOptions.DisableFormatting | SaveOptions.OmitDuplicateNamespaces); - } - } - catch (UnauthorizedAccessException) - { - this.OnError(ConverterTestType.UnauthorizedAccessException, null, "Could not write to file."); - } - } - - return this.Errors; - } - - /// - /// Convert a document. - /// - /// The document to convert. - /// The number of errors found. - public int ConvertDocument(XDocument document) - { - var declaration = document.Declaration; - - // Convert the declaration. - if (null != declaration) - { - if (!String.Equals("utf-8", declaration.Encoding, StringComparison.OrdinalIgnoreCase)) - { - if (this.OnError(ConverterTestType.DeclarationEncodingWrong, document.Root, "The XML declaration encoding is not properly set to 'utf-8'.")) - { - declaration.Encoding = "utf-8"; - } - } - } - else // missing declaration - { - if (this.OnError(ConverterTestType.DeclarationMissing, null, "This file is missing an XML declaration on the first line.")) - { - document.Declaration = new XDeclaration("1.0", "utf-8", null); - document.Root.AddBeforeSelf(new XText(XDocumentNewLine.ToString())); - } - } - - // Start converting the nodes at the top. - this.ConvertNodes(document.Nodes(), 0); - - return this.Errors; - } - - private void ConvertNodes(IEnumerable nodes, int level) - { - // Note we operate on a copy of the node list since we may - // remove some whitespace nodes during this processing. - foreach (var node in nodes.ToList()) - { - if (node is XText text) - { - if (!String.IsNullOrWhiteSpace(text.Value)) - { - text.Value = text.Value.Trim(); - } - else if (node.NextNode is XCData cdata) - { - this.EnsurePrecedingWhitespaceRemoved(text, node, ConverterTestType.WhitespacePrecedingNodeWrong); - } - else if (node.NextNode is XElement element) - { - this.EnsurePrecedingWhitespaceCorrect(text, node, level, ConverterTestType.WhitespacePrecedingNodeWrong); - } - else if (node.NextNode is null) // this is the space before the close element - { - if (node.PreviousNode is null || node.PreviousNode is XCData) - { - this.EnsurePrecedingWhitespaceRemoved(text, node.Parent, ConverterTestType.WhitespacePrecedingEndElementWrong); - } - else if (level == 0) // root element's close tag - { - this.EnsurePrecedingWhitespaceCorrect(text, node, 0, ConverterTestType.WhitespacePrecedingEndElementWrong); - } - else - { - this.EnsurePrecedingWhitespaceCorrect(text, node, level - 1, ConverterTestType.WhitespacePrecedingEndElementWrong); - } - } - } - else if (node is XElement element) - { - this.ConvertElement(element); - - this.ConvertNodes(element.Nodes(), level + 1); - } - } - } - - private void EnsurePrecedingWhitespaceCorrect(XText whitespace, XNode node, int level, ConverterTestType testType) - { - if (!Converter.LeadingWhitespaceValid(this.IndentationAmount, level, whitespace.Value)) - { - var message = testType == ConverterTestType.WhitespacePrecedingEndElementWrong ? "The whitespace preceding this end element is incorrect." : "The whitespace preceding this node is incorrect."; - - if (this.OnError(testType, node, message)) - { - Converter.FixupWhitespace(this.IndentationAmount, level, whitespace); - } - } - } - - private void EnsurePrecedingWhitespaceRemoved(XText whitespace, XNode node, ConverterTestType testType) - { - if (!String.IsNullOrEmpty(whitespace.Value)) - { - var message = testType == ConverterTestType.WhitespacePrecedingEndElementWrong ? "The whitespace preceding this end element is incorrect." : "The whitespace preceding this node is incorrect."; - - if (this.OnError(testType, node, message)) - { - whitespace.Remove(); - } - } - } - - private void ConvertElement(XElement element) - { - // Gather any deprecated namespaces, then update this element tree based on those deprecations. - var deprecatedToUpdatedNamespaces = new Dictionary(); - - foreach (var declaration in element.Attributes().Where(a => a.IsNamespaceDeclaration)) - { - if (Converter.OldToNewNamespaceMapping.TryGetValue(declaration.Value, out var ns)) - { - if (this.OnError(ConverterTestType.XmlnsValueWrong, declaration, "The namespace '{0}' is out of date. It must be '{1}'.", declaration.Value, ns.NamespaceName)) - { - deprecatedToUpdatedNamespaces.Add(declaration.Value, ns); - } - } - } - - if (deprecatedToUpdatedNamespaces.Any()) - { - Converter.UpdateElementsWithDeprecatedNamespaces(element.DescendantsAndSelf(), deprecatedToUpdatedNamespaces); - } - - // Apply any specialized conversion actions. - if (this.ConvertElementMapping.TryGetValue(element.Name, out var convert)) - { - convert(element); - } - } - - private void ConvertDirectoryElement(XElement element) - { - if (null == element.Attribute("Name")) - { - var attribute = element.Attribute("ShortName"); - if (null != attribute) - { - var shortName = attribute.Value; - if (this.OnError(ConverterTestType.AssignDirectoryNameFromShortName, element, "The directory ShortName attribute is being renamed to Name since Name wasn't specified for value '{0}'", shortName)) - { - element.Add(new XAttribute("Name", shortName)); - attribute.Remove(); - } - } - } - } - - private void ConvertFileElement(XElement element) - { - if (null == element.Attribute("Id")) - { - var attribute = element.Attribute("Name"); - - if (null == attribute) - { - attribute = element.Attribute("Source"); - } - - if (null != attribute) - { - var name = Path.GetFileName(attribute.Value); - - if (this.OnError(ConverterTestType.AssignAnonymousFileId, element, "The file id is being updated to '{0}' to ensure it remains the same as the default", name)) - { - IEnumerable attributes = element.Attributes().ToList(); - element.RemoveAttributes(); - element.Add(new XAttribute("Id", ToolsCommon.GetIdentifierFromName(name))); - element.Add(attributes); - } - } - } - } - - private void ConvertSuppressSignatureValidation(XElement element) - { - var suppressSignatureValidation = element.Attribute("SuppressSignatureValidation"); - - if (null != suppressSignatureValidation) - { - if (this.OnError(ConverterTestType.SuppressSignatureValidationDeprecated, element, "The chain package element contains deprecated '{0}' attribute. Use the 'EnableSignatureValidation' attribute instead.", suppressSignatureValidation)) - { - if ("no" == suppressSignatureValidation.Value) - { - element.Add(new XAttribute("EnableSignatureValidation", "yes")); - } - } - - suppressSignatureValidation.Remove(); - } - } - - private void ConvertCustomActionElement(XElement xCustomAction) - { - var xBinaryKey = xCustomAction.Attribute("BinaryKey"); - - if (xBinaryKey?.Value == "WixCA") - { - if (this.OnError(ConverterTestType.WixCABinaryIdRenamed, xCustomAction, "The WixCA custom action DLL Binary table id has been renamed. Use the id 'UtilCA' instead.")) - { - xBinaryKey.Value = "UtilCA"; - } - } - - var xDllEntry = xCustomAction.Attribute("DllEntry"); - - if (xDllEntry?.Value == "CAQuietExec" || xDllEntry?.Value == "CAQuietExec64") - { - if (this.OnError(ConverterTestType.QuietExecCustomActionsRenamed, xCustomAction, "The CAQuietExec and CAQuietExec64 custom action ids have been renamed. Use the ids 'WixQuietExec' and 'WixQuietExec64' instead.")) - { - xDllEntry.Value = xDllEntry.Value.Replace("CAQuietExec", "WixQuietExec"); - } - } - - var xProperty = xCustomAction.Attribute("Property"); - - if (xProperty?.Value == "QtExecCmdLine" || xProperty?.Value == "QtExec64CmdLine") - { - if (this.OnError(ConverterTestType.QuietExecCustomActionsRenamed, xCustomAction, "The QtExecCmdLine and QtExec64CmdLine property ids have been renamed. Use the ids 'WixQuietExecCmdLine' and 'WixQuietExec64CmdLine' instead.")) - { - xProperty.Value = xProperty.Value.Replace("QtExec", "WixQuietExec"); - } - } - } - - private void ConvertPropertyElement(XElement xProperty) - { - var xId = xProperty.Attribute("Id"); - - if (xId.Value == "QtExecCmdTimeout") - { - this.OnError(ConverterTestType.QtExecCmdTimeoutAmbiguous, xProperty, "QtExecCmdTimeout was previously used for both CAQuietExec and CAQuietExec64. For WixQuietExec, use WixQuietExecCmdTimeout. For WixQuietExec64, use WixQuietExec64CmdTimeout."); - } - } - - /// - /// Converts a Wix element. - /// - /// The Wix element to convert. - /// The converted element. - private void ConvertWixElementWithoutNamespace(XElement element) - { - if (this.OnError(ConverterTestType.XmlnsMissing, element, "The xmlns attribute is missing. It must be present with a value of '{0}'.", WixNamespace.NamespaceName)) - { - element.Name = WixNamespace.GetName(element.Name.LocalName); - - element.Add(new XAttribute("xmlns", WixNamespace.NamespaceName)); // set the default namespace. - - foreach (var elementWithoutNamespace in element.Elements().Where(e => XNamespace.None == e.Name.Namespace)) - { - elementWithoutNamespace.Name = WixNamespace.GetName(elementWithoutNamespace.Name.LocalName); - } - } - } - - private IEnumerable YieldConverterTypes(IEnumerable types) - { - if (null != types) - { - foreach (var type in types) - { - - if (Enum.TryParse(type, true, out var itt)) - { - yield return itt; - } - else // not a known ConverterTestType - { - this.OnError(ConverterTestType.ConverterTestTypeUnknown, null, "Unknown error type: '{0}'.", type); - } - } - } - } - - private static void UpdateElementsWithDeprecatedNamespaces(IEnumerable elements, Dictionary deprecatedToUpdatedNamespaces) - { - foreach (var element in elements) - { - - if (deprecatedToUpdatedNamespaces.TryGetValue(element.Name.Namespace, out var ns)) - { - element.Name = ns.GetName(element.Name.LocalName); - } - - // Remove all the attributes and add them back to with their namespace updated (as necessary). - IEnumerable attributes = element.Attributes().ToList(); - element.RemoveAttributes(); - - foreach (var attribute in attributes) - { - var convertedAttribute = attribute; - - if (attribute.IsNamespaceDeclaration) - { - if (deprecatedToUpdatedNamespaces.TryGetValue(attribute.Value, out ns)) - { - convertedAttribute = ("xmlns" == attribute.Name.LocalName) ? new XAttribute(attribute.Name.LocalName, ns.NamespaceName) : new XAttribute(XNamespace.Xmlns + attribute.Name.LocalName, ns.NamespaceName); - } - } - else if (deprecatedToUpdatedNamespaces.TryGetValue(attribute.Name.Namespace, out ns)) - { - convertedAttribute = new XAttribute(ns.GetName(attribute.Name.LocalName), attribute.Value); - } - - element.Add(convertedAttribute); - } - } - } - - /// - /// Determine if the whitespace preceding a node is appropriate for its depth level. - /// - /// Indentation value to use when validating leading whitespace. - /// The depth level that should match this whitespace. - /// The whitespace to validate. - /// true if the whitespace is legal; false otherwise. - private static bool LeadingWhitespaceValid(int indentationAmount, int level, string whitespace) - { - // Strip off leading newlines; there can be an arbitrary number of these. - whitespace = whitespace.TrimStart(XDocumentNewLine); - - var indentation = new string(' ', level * indentationAmount); - - return whitespace == indentation; - } - - /// - /// Fix the whitespace in a whitespace node. - /// - /// Indentation value to use when validating leading whitespace. - /// The depth level of the desired whitespace. - /// The whitespace node to fix. - private static void FixupWhitespace(int indentationAmount, int level, XText whitespace) - { - var value = new StringBuilder(whitespace.Value.Length); - - // Keep any previous preceeding new lines. - var newlines = whitespace.Value.TakeWhile(c => c == XDocumentNewLine).Count(); - - // Ensure there is always at least one new line before the indentation. - value.Append(XDocumentNewLine, newlines == 0 ? 1 : newlines); - - whitespace.Value = value.Append(' ', level * indentationAmount).ToString(); - } - - /// - /// Output an error message to the console. - /// - /// The type of converter test. - /// The node that caused the error. - /// Detailed error message. - /// Additional formatted string arguments. - /// Returns true indicating that action should be taken on this error, and false if it should be ignored. - private bool OnError(ConverterTestType converterTestType, XObject node, string message, params object[] args) - { - if (this.IgnoreErrors.Contains(converterTestType)) // ignore the error - { - return false; - } - - // Increase the error count. - this.Errors++; - - var sourceLine = (null == node) ? new SourceLineNumber(this.SourceFile ?? "wixcop.exe") : new SourceLineNumber(this.SourceFile, ((IXmlLineInfo)node).LineNumber); - var warning = this.ErrorsAsWarnings.Contains(converterTestType); - var display = String.Format(CultureInfo.CurrentCulture, message, args); - - var msg = new Message(sourceLine, warning ? MessageLevel.Warning : MessageLevel.Error, (int)converterTestType, "{0} ({1})", display, converterTestType.ToString()); - - this.Messaging.Write(msg); - - return true; - } - - /// - /// Converter test types. These are used to condition error messages down to warnings. - /// - private enum ConverterTestType - { - /// - /// Internal-only: displayed when a string cannot be converted to an ConverterTestType. - /// - ConverterTestTypeUnknown, - - /// - /// Displayed when an XML loading exception has occurred. - /// - XmlException, - - /// - /// Displayed when a file cannot be accessed; typically when trying to save back a fixed file. - /// - UnauthorizedAccessException, - - /// - /// Displayed when the encoding attribute in the XML declaration is not 'UTF-8'. - /// - DeclarationEncodingWrong, - - /// - /// Displayed when the XML declaration is missing from the source file. - /// - DeclarationMissing, - - /// - /// Displayed when the whitespace preceding a CDATA node is wrong. - /// - WhitespacePrecedingCDATAWrong, - - /// - /// Displayed when the whitespace preceding a node is wrong. - /// - WhitespacePrecedingNodeWrong, - - /// - /// Displayed when an element is not empty as it should be. - /// - NotEmptyElement, - - /// - /// Displayed when the whitespace following a CDATA node is wrong. - /// - WhitespaceFollowingCDATAWrong, - - /// - /// Displayed when the whitespace preceding an end element is wrong. - /// - WhitespacePrecedingEndElementWrong, - - /// - /// Displayed when the xmlns attribute is missing from the document element. - /// - XmlnsMissing, - - /// - /// Displayed when the xmlns attribute on the document element is wrong. - /// - XmlnsValueWrong, - - /// - /// Assign an identifier to a File element when on Id attribute is specified. - /// - AssignAnonymousFileId, - - /// - /// SuppressSignatureValidation attribute is deprecated and replaced with EnableSignatureValidation. - /// - SuppressSignatureValidationDeprecated, - - /// - /// WixCA Binary/@Id has been renamed to UtilCA. - /// - WixCABinaryIdRenamed, - - /// - /// QtExec custom actions have been renamed. - /// - QuietExecCustomActionsRenamed, - - /// - /// QtExecCmdTimeout was previously used for both CAQuietExec and CAQuietExec64. For WixQuietExec, use WixQuietExecCmdTimeout. For WixQuietExec64, use WixQuietExec64CmdTimeout. - /// - QtExecCmdTimeoutAmbiguous, - - /// - /// Directory/@ShortName may only be specified with Directory/@Name. - /// - AssignDirectoryNameFromShortName, - } - } -} diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 7a17caf1..4c0d9a16 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -21,7 +21,7 @@ - + -- cgit v1.2.3-55-g6feb From c8c22de1957f8eeb2c9fc03df12db6af41613ca9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 23 May 2019 22:52:24 -0700 Subject: Fix versioning of thmviewer and include MSI package in build --- appveyor.cmd | 3 +-- nuget.config | 1 + src/ThmViewerPackage/Package.wxs | 2 +- src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs | 6 +++--- src/thmviewer/thmviewer.vcxproj | 4 +++- src/wix/wix.csproj | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index ec97f0b6..a41f8c19 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -18,8 +18,7 @@ dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netcoreapp2.1\ -f netcoreap dotnet pack -c Release src\dotnet-wix dotnet pack -c Release src\WixToolset.MSBuild -@rem Enable this build when WixToolset.Core is fixed to build the setup code correctly. -@rem msbuild -p:Configuration=Release .\src\ThmViewerPackage\ThmViewerPackage.wixproj +msbuild -p:Configuration=Release .\src\ThmViewerPackage\ThmViewerPackage.wixproj @popd @endlocal diff --git a/nuget.config b/nuget.config index 3fb7b617..d3a7e3d8 100644 --- a/nuget.config +++ b/nuget.config @@ -7,6 +7,7 @@ + diff --git a/src/ThmViewerPackage/Package.wxs b/src/ThmViewerPackage/Package.wxs index cfa041ba..6609dbed 100644 --- a/src/ThmViewerPackage/Package.wxs +++ b/src/ThmViewerPackage/Package.wxs @@ -6,7 +6,7 @@ - + diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index c4a69cdd..cb839011 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -55,9 +55,9 @@ namespace WixToolsetTest.BuildTasks var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); var section = intermediate.Sections.Single(); - var wixFile = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); + var fileTuple = section.Tuples.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); } } } diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index 0c4612f2..ea589b4c 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -31,7 +31,6 @@ - @@ -62,6 +61,9 @@ + + + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 398952af..1f2c61e0 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -26,7 +26,7 @@ - + -- cgit v1.2.3-55-g6feb From cef6ac5735e9cf47fb51746f136d6703f2d45de6 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 20 Oct 2019 01:00:05 -0700 Subject: Better support all .NETs and fix-up integration tests --- appveyor.cmd | 6 +++--- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 10 +++------- src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 3 +-- src/WixToolset.MSBuild/WixToolset.MSBuild.props | 2 +- src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj | 2 +- .../WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj | 3 ++- src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj | 6 +++++- src/wix/wix.csproj | 2 +- src/wixcop/WixCop.csproj | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index a41f8c19..5d738995 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -4,12 +4,12 @@ nuget restore -dotnet build -c Release src\test\WixToolsetTest.BuildTasks -dotnet build -c Release src\test\WixToolsetTest.WixCop +dotnet test -c Release src\test\WixToolsetTest.BuildTasks +dotnet test -c Release src\test\WixToolsetTest.WixCop dotnet publish -c Release -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net461\ -f net461 src\WixToolset.BuildTasks -dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks +dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netstandard2.0\ -f netstandard2.0 src\WixToolset.BuildTasks @rem dotnet publish -c Release -o %_P%\netcoreapp2.1 -r win-x86 src\wix @rem dotnet publish -c Release -o %_P%\net461 -r win-x86 src\light diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index c5b609c6..f8983121 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -3,7 +3,7 @@ - net461;netcoreapp2.1 + netstandard2.0;net461;net472 WiX Toolset MSBuild Tasks embedded @@ -14,10 +14,6 @@ NU1701 - - - - @@ -38,8 +34,8 @@ - - + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index 6bca928a..c49efff0 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -13,7 +13,6 @@ - - + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/WixToolset.MSBuild.props index b1d207f4..b0b7e7e3 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.props +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.props @@ -3,7 +3,7 @@ - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\netcoreapp2.1\wix.targets')) + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\netstandard2.0\wix.targets')) $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\net461\wix.targets')) diff --git a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj index 0f67db73..04869f00 100644 --- a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj +++ b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.csproj @@ -3,7 +3,7 @@ - netstandard2.0 + netstandard2.0;net461;net472 Tools Core WiX Toolset Tools Core embedded diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index c5498de4..eba81c0c 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -21,7 +21,8 @@ - + + diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj index 45f8c57d..c58b6091 100644 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj @@ -3,11 +3,15 @@ - net461 + netcoreapp2.1 false embedded + + NU1603 + + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 1f2c61e0..ea820230 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -3,7 +3,7 @@ - net461;netcoreapp2.1 + netcoreapp2.1;net461;net472 Exe Compiler WiX Toolset Compiler diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 4c0d9a16..858d3b52 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -3,7 +3,7 @@ - net461;netcoreapp2.1 + netcoreapp2.1;net461;net472 Exe Converter WiX Error Correction Tool -- cgit v1.2.3-55-g6feb From 3b77f4a04af567fe8144324a3520d50de97c6263 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 22 Oct 2019 18:22:22 -0400 Subject: Yeah, can I get one build for takeout, please? --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 7c9fdfbd5fb8703eb82eab74c7f4c0735f2ad1e6 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 23 Oct 2019 20:15:35 -0400 Subject: Tickle the build machine. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From ea0ae676623154e6a9293de1564750d539dcdf86 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 24 Oct 2019 17:05:36 -0400 Subject: Do a build, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 9057039f7bd9794b08428308af78540e2551be03 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 28 Oct 2019 13:38:13 -0400 Subject: Do a build, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 8a1ac9f7a870128e1d42fa50e5fe53d6ec60af53 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 28 Oct 2019 11:00:20 -0700 Subject: Update to latest Core to use .wixpdb for test validation purposes --- src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index cb839011..41cf8e64 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -52,7 +52,7 @@ namespace WixToolsetTest.BuildTasks Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); - var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); + var intermediate = Intermediate.Load(Path.Combine(baseFolder, @"bin\test.wixpdb")); var section = intermediate.Sections.Single(); var fileTuple = section.Tuples.OfType().Single(); -- cgit v1.2.3-55-g6feb From d7da30300aef1a6dc2eddb6ab835413631780116 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 1 Nov 2019 19:40:29 -0400 Subject: One build, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From a9f42e79762b4d11f1814389145e66d740451605 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 4 Nov 2019 13:30:11 -0500 Subject: Another build, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From c87585d8eae99f042af68a824bf48d08e286d6fc Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 4 Nov 2019 15:07:24 -0500 Subject: Another build, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 2e3d7558ecc26ff51b5ffe096f066ceb7461c692 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 5 Nov 2019 19:37:19 -0500 Subject: Another build, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 12023cb84b1b53ecaaaeec13bbbf763d65f09298 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 8 Nov 2019 15:09:44 -0500 Subject: Another build, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 2fa21139bfd2989b6f6866bf47a2592ea5cb1713 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 11 Nov 2019 12:16:25 +1000 Subject: Another build, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From b7a06a072e5765d6ad0d4ef1df71a15dc5dd7512 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 14 Nov 2019 18:17:53 -0500 Subject: Another build, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 87446442ddb5e22fda28b708ee74e75dcc9f5ef5 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 14 Nov 2019 18:20:17 -0500 Subject: Another build, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 40f00152273239b4f77808903b18829afa1c4401 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 3 Jan 2020 14:27:32 -0500 Subject: Support overriding output extension. --- src/WixToolset.BuildTasks/wix.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets index da90226d..a3787309 100644 --- a/src/WixToolset.BuildTasks/wix.targets +++ b/src/WixToolset.BuildTasks/wix.targets @@ -63,7 +63,7 @@ The following properties are 'macros' that are available via IDE for pre and post build steps. All of them should be added to WixBuildMacroCollection to ensure that they are shown in the UI. --> - + .msi .msm .pcp -- cgit v1.2.3-55-g6feb From f2b0bec9efce06d851232e8dca17ba0011c8fe0d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 6 Jan 2020 17:50:03 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 8a6725ecd90da93e063e57f79f2910936ec16133 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 6 Jan 2020 20:55:07 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 487f0f8afcb3431420e2106819cb7fd0afe4e118 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 17 Jan 2020 21:51:39 -0500 Subject: Let listeners adjust message levels; general messaging cleanup. --- src/WixToolset.BuildTasks/DoIt.cs | 2 + .../ConsoleMessageListener.cs | 72 +++++++++++++++++----- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 7089ff12..6af2a50a 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -278,6 +278,8 @@ namespace WixToolset.BuildTasks { this.Logger.LogMessage(MessageImportance.Low, message); } + + public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; } } } diff --git a/src/WixToolset.Tools.Core/ConsoleMessageListener.cs b/src/WixToolset.Tools.Core/ConsoleMessageListener.cs index 5b1fb988..709fb576 100644 --- a/src/WixToolset.Tools.Core/ConsoleMessageListener.cs +++ b/src/WixToolset.Tools.Core/ConsoleMessageListener.cs @@ -1,39 +1,54 @@ -using System; -using System.Globalization; -using System.Text; -using System.Threading; -using WixToolset.Data; -using WixToolset.Extensibility; +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. namespace WixToolset.Tools.Core { + using System; + using System.Collections.Generic; + using System.Linq; + using System.Globalization; + using System.Text; + using System.Threading; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + public sealed class ConsoleMessageListener : IMessageListener { - public ConsoleMessageListener(string shortName, string longName) + public ConsoleMessageListener(string prefix, string appName) { - this.ShortAppName = shortName; - this.LongAppName = longName; + this.Prefix = prefix; + this.AppName = appName; PrepareConsoleForLocalization(); } - public string LongAppName { get; } + public string AppName { get; } - public string ShortAppName { get; } + public string Prefix { get; } public void Write(Message message) { - var filename = message.SourceLineNumbers?.FileName ?? this.LongAppName; - var line = message.SourceLineNumbers?.LineNumber ?? -1; + var filename = message.SourceLineNumbers?.FileName ?? this.AppName; var type = message.Level.ToString().ToLowerInvariant(); var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; - if (line > 0) + if (message.SourceLineNumbers?.LineNumber.HasValue == true) { - filename = String.Concat(filename, "(", line, ")"); + filename = String.Concat(filename, "(", message.SourceLineNumbers?.LineNumber.Value, ")"); } - output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.ShortAppName, message.Id, message.ToString()); + output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.Prefix, message.Id, message.ToString()); + + var fileNames = GetFileNames(message.SourceLineNumbers); + if (fileNames.Any()) + { + output.WriteLine("Source trace:"); + + foreach (var fileName in fileNames) + { + output.WriteLine("Source trace: {0}", fileName); + } + } } public void Write(string message) @@ -41,6 +56,31 @@ namespace WixToolset.Tools.Core Console.Out.WriteLine(message); } + public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; + + private static IList GetFileNames(SourceLineNumber sourceLineNumbers) + { + var fileNames = new List(); + + for (var sln = sourceLineNumbers; null != sln; sln = sln.Parent) + { + if (String.IsNullOrEmpty(sln.FileName)) + { + continue; + } + else if (sln.LineNumber.HasValue) + { + fileNames.Add(String.Format(CultureInfo.CurrentUICulture, "{0}: line {1}", sln.FileName, sln.LineNumber)); + } + else + { + fileNames.Add(sln.FileName); + } + } + + return fileNames; + } + private static void PrepareConsoleForLocalization() { Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); -- cgit v1.2.3-55-g6feb From 3e6f27a01d7f18d49c5e6bfdf657a7822d1ef4be Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 23 Jan 2020 18:38:54 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From a4fd4277b05c4fb9a23ddfbd28c4fcc0bbb0a929 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 29 Jan 2020 15:48:44 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 4f9dac7c48206d8bd1c5c27f4e0b34d90a094cc3 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 11 Feb 2020 20:27:25 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From c1e32d7d9970e99491373b6ab771be00138baa21 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 24 Feb 2020 14:24:16 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 1af7cae944a62574cb74bbcbe4adaae783de779d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 24 Feb 2020 14:38:36 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From d7d7f4f3bbcde99d3bbcea3d9410f1c6933a86a3 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 24 Feb 2020 15:06:15 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From f30a041627a9c43919bcbe5e96a1cfe55ef11c7c Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 26 Feb 2020 15:00:07 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 708d7a342330a10e07fb473745e9156c05049b7f Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 27 Feb 2020 14:04:12 -0500 Subject: Log more data from exceptions. Add net472 MSBuild tasks. --- appveyor.cmd | 1 + src/WixToolset.BuildTasks/DoIt.cs | 2 +- src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.cmd b/appveyor.cmd index 5d738995..9335ca5a 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -9,6 +9,7 @@ dotnet test -c Release src\test\WixToolsetTest.WixCop dotnet publish -c Release -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net461\ -f net461 src\WixToolset.BuildTasks +dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net472\ -f net472 src\WixToolset.BuildTasks dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netstandard2.0\ -f netstandard2.0 src\WixToolset.BuildTasks @rem dotnet publish -c Release -o %_P%\netcoreapp2.1 -r win-x86 src\wix diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 6af2a50a..5faf163c 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -123,7 +123,7 @@ namespace WixToolset.BuildTasks } catch (Exception e) { - this.Log.LogErrorFromException(e); + this.Log.LogErrorFromException(e, showStackTrace: true, showDetail: true, null); if (e is NullReferenceException || e is SEHException) { diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index c49efff0..ba16aa92 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -13,6 +13,7 @@ + -- cgit v1.2.3-55-g6feb From 1fc7ee285b111661195247f0e7aafd43f2ba36de Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 28 Feb 2020 17:07:56 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 291cf40c5f0578fbd76fc3150d54f98b50066dcf Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 5 Mar 2020 21:40:55 -0500 Subject: Update WixCop tests for versioned extension id changes. --- src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs | 2 +- src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs index be487147..b28c94e4 100644 --- a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs +++ b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs @@ -16,7 +16,7 @@ - + diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs index 22a961b2..99cc2151 100644 --- a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs +++ b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs @@ -15,7 +15,7 @@ - + -- cgit v1.2.3-55-g6feb From 203b0efbb9a7c80a2f8f6e8dcd6bd10371f7f9ab Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 12 Mar 2020 17:54:34 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 70e654a39f544473c5809bea64c9f728deaa55e8 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 12 Mar 2020 21:36:03 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 60085dfd1ac4a673d295f96a62196a2cf16dec8b Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 13 Mar 2020 20:42:33 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From fe77cae987ea2bfc43d2ffec660bf773e922709d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 17 Mar 2020 21:28:12 -0400 Subject: Partial WixPdbs stop the backend before binding. --- src/WixToolset.BuildTasks/DoIt.cs | 6 ++- src/WixToolset.BuildTasks/wix.targets | 13 ++++- .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 60 ++++++++++++++++++++++ .../WixBuildTaskFixture.cs | 8 +-- 4 files changed, 81 insertions(+), 6 deletions(-) diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index 5faf163c..3aa9f5a3 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -47,7 +47,9 @@ namespace WixToolset.BuildTasks public string OutputType { get; set; } - public string PdbOutputFile { get; set; } + public ITaskItem PdbFile { get; set; } + + public string PdbType { get; set; } public bool Pedantic { get; set; } @@ -162,6 +164,8 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform); commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); + commandLineBuilder.AppendSwitchIfNotNull("-pdb ", this.PdbFile); + commandLineBuilder.AppendSwitchIfNotNull("-pdbType ", this.PdbType); commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); commandLineBuilder.AppendArrayIfNotNull("-culture ", this.Cultures); commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets index a3787309..4f8b9999 100644 --- a/src/WixToolset.BuildTasks/wix.targets +++ b/src/WixToolset.BuildTasks/wix.targets @@ -54,8 +54,11 @@ $(MSBuildProjectName) $(OutputName) - + Package + + + full $(MSBuildThisFileFullPath) - $(WixTargetsPath)WixTasks.dll + $(WixTargetsPath)WixToolset.BuildTasks.dll @@ -260,10 +260,9 @@ Condition=" $(EnableProjectHarvesting) and ('@(HeatProject)' != '' or '@(HarvestProject)' != '') "> @@ -347,10 +345,9 @@ Condition=" '@(HarvestDirectory)' != '' "> - $(WixBinDir) - $(WixToolDir) + $(WixBinDir) + win-x86 diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 0e6be055..7021d9d7 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -10,6 +10,7 @@ embedded true + win-x86 -- cgit v1.2.3-55-g6feb From a5f59cb11a6372a6da8540bd1bebf6dec20e92e3 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 10 May 2020 13:49:09 +1000 Subject: Remove x86 restriction (introduced from previous commit) from published contents. Remove unused net472 BuildTasks. Make BuildTasks target netcoreapp instead of netstandard since publishing isn't supported for netstandard. --- appveyor.cmd | 3 +-- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 9 +++++---- src/WixToolset.MSBuild/WixToolset.MSBuild.csproj | 2 +- src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 3 +-- src/WixToolset.MSBuild/WixToolset.MSBuild.props | 2 +- src/dotnet-wix/dotnet-wix.csproj | 3 +-- src/wix/wix.csproj | 3 ++- src/wixcop/WixCop.csproj | 3 ++- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 9335ca5a..d0dcee83 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -9,8 +9,7 @@ dotnet test -c Release src\test\WixToolsetTest.WixCop dotnet publish -c Release -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net461\ -f net461 src\WixToolset.BuildTasks -dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net472\ -f net472 src\WixToolset.BuildTasks -dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netstandard2.0\ -f netstandard2.0 src\WixToolset.BuildTasks +dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks @rem dotnet publish -c Release -o %_P%\netcoreapp2.1 -r win-x86 src\wix @rem dotnet publish -c Release -o %_P%\net461 -r win-x86 src\light diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index cfa0b1d8..8724f2fc 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -3,12 +3,13 @@ - netstandard2.0;net461;net472 + netcoreapp2.1;net461 WiX Toolset MSBuild Tasks embedded true - win-x86 + win-x86 + AnyCPU @@ -36,8 +37,8 @@ - - + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj index 76e42911..5a9633ae 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj @@ -3,7 +3,7 @@ - netstandard2.0 + netcoreapp2.1 false WiX Toolset MSBuild integration $(MSBuildThisFileName).nuspec diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index ba16aa92..c9e5cdf2 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -13,7 +13,6 @@ - - + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/WixToolset.MSBuild.props index b0b7e7e3..b1d207f4 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.props +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.props @@ -3,7 +3,7 @@ - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\netstandard2.0\wix.targets')) + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\netcoreapp2.1\wix.targets')) $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\net461\wix.targets')) diff --git a/src/dotnet-wix/dotnet-wix.csproj b/src/dotnet-wix/dotnet-wix.csproj index a9c766a3..88010875 100644 --- a/src/dotnet-wix/dotnet-wix.csproj +++ b/src/dotnet-wix/dotnet-wix.csproj @@ -3,13 +3,12 @@ - netstandard2.0 + netcoreapp2.1 false WiX Toolset Command-line interface $(MSBuildThisFileName).nuspec $(OutputPath)publish\dotnet-wix\ Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) - win-x86 diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index c74cf006..ef007849 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -10,7 +10,8 @@ embedded true - win-x86 + win-x86 + AnyCPU diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 7021d9d7..8b3acf44 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -10,7 +10,8 @@ embedded true - win-x86 + win-x86 + AnyCPU -- cgit v1.2.3-55-g6feb From 43b794567dacd6b11dd508dca4aff29650139946 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 10 May 2020 14:18:29 +1000 Subject: Add test for building a bundle from .wixproj. --- appveyor.yml | 2 +- nuget.config | 1 + .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 37 ++++++++++++++++++ .../SimpleMsiPackage/SimpleBundle/Bundle.wxs | 10 +++++ .../SimpleBundle/SimpleBundle.wixproj | 45 ++++++++++++++++++++++ .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 12 +++++- .../WixToolsetTest.BuildTasks.csproj | 2 + 7 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj diff --git a/appveyor.yml b/appveyor.yml index 8d80c6af..522e5af3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ branches: - master - develop -image: Visual Studio 2017 +image: Visual Studio 2019 version: 0.0.0.{build} configuration: Release diff --git a/nuget.config b/nuget.config index 6e1e8f4a..81117c3d 100644 --- a/nuget.config +++ b/nuget.config @@ -2,6 +2,7 @@ + diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index c6e260be..f1874743 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -13,6 +13,43 @@ namespace WixToolsetTest.BuildTasks { private static readonly string WixTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(DoIt).Assembly.CodeBase).AbsolutePath), "wix.targets"); + [Fact] + public void CanBuildSimpleBundle() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\SimpleBundle\SimpleBundle.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}" + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); + Assert.Single(platformSwitches); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + //@"bin\SimpleBundle.exe", + @"bin\SimpleBundle.wixpdb", + }, paths); + } + } + [Fact] public void CanBuildSimpleMsiPackage() { diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs new file mode 100644 index 00000000..6cd04712 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj new file mode 100644 index 00000000..4c837936 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj @@ -0,0 +1,45 @@ + + + + Debug + x86 + + + + 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d + Bundle + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln index 2c88704e..dd21489d 100644 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln +++ b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln @@ -1,10 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SimpleBundle", "SimpleBundle\SimpleBundle.wixproj", "{6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -21,6 +23,12 @@ Global {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x64.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.Build.0 = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x64.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index b48f5477..3909cc79 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -23,6 +23,8 @@ + + -- cgit v1.2.3-55-g6feb From a8a55469fe60068625b64797de36ecb51b473b6b Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 10 May 2020 14:38:52 +1000 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 0b6ca95f98549cab0951320a254b4df759af4b58 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 10 May 2020 19:33:10 +1000 Subject: Fix test. --- src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index f1874743..17a669ef 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -44,7 +44,7 @@ namespace WixToolsetTest.BuildTasks .ToArray(); Assert.Equal(new[] { - //@"bin\SimpleBundle.exe", + @"bin\SimpleBundle.exe", @"bin\SimpleBundle.wixpdb", }, paths); } -- cgit v1.2.3-55-g6feb From e292e1373c17473923e83d79744c89c79d1b4d2a Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 12 May 2020 13:28:29 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From b1b1028efeaf1e0bb3b56c4006450a60ff8e699d Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 13 May 2020 14:50:54 +1000 Subject: Ensure inner exceptions from unexpected exceptions get logged. --- .../WixBuildTaskFixture.cs | 43 ++++++++++++++++++++++ src/wix/Program.cs | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index d572a91a..aa44ba81 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -62,5 +62,48 @@ namespace WixToolsetTest.BuildTasks Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); } } + + [Fact(Skip = "Requires deleting wixnative.exe from output folder after build but before running the test.")] + public void ReportsInnerExceptionForUnexpectedExceptions() + { + var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var pdbPath = Path.Combine(baseFolder, @"bin\testpackage.wixpdb"); + var engine = new FakeBuildEngine(); + + var task = new DoIt + { + BuildEngine = engine, + SourceFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.wxs")), + new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), + }, + LocalizationFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), + }, + BindInputPaths = new[] + { + new TaskItem(Path.Combine(folder, "data")), + }, + IntermediateDirectory = new TaskItem(intermediateFolder), + OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), + PdbType = "Full", + PdbFile = new TaskItem(pdbPath), + }; + + var result = task.Execute(); + Assert.False(result, $"MSBuild task succeeded unexpectedly. Output:\r\n{engine.Output}"); + + Assert.Contains( + "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from", + engine.Output); + } + } } } diff --git a/src/wix/Program.cs b/src/wix/Program.cs index e2012ad2..7e302078 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -41,7 +41,7 @@ namespace WixToolset.Tools } catch (Exception e) { - listener.Write(ErrorMessages.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace)); + listener.Write(ErrorMessages.UnexpectedException(e)); if (e is NullReferenceException || e is SEHException) { -- cgit v1.2.3-55-g6feb From dc7d97d77b61b17c06de0645dce986a93b892340 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 14 May 2020 19:53:15 +1000 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 36ed678790b0eb9d39848bf6b384733e57a37b6d Mon Sep 17 00:00:00 2001 From: Herohtar Date: Tue, 23 Jul 2019 23:10:43 -0500 Subject: Use SHA1 instead of MD5 --- src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs b/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs index 06c8b98a..c4a5cefe 100644 --- a/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs +++ b/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs @@ -62,9 +62,9 @@ namespace WixToolset.BuildTasks // hash the data byte[] hash; - using (MD5 md5 = new MD5CryptoServiceProvider()) + using (SHA1 sha1 = new SHA1CryptoServiceProvider()) { - hash = md5.ComputeHash(data); + hash = sha1.ComputeHash(data); } // build up the identifier -- cgit v1.2.3-55-g6feb From 929f43b2d48f9d35803064774e357c7a2cf76713 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 22 May 2020 20:09:02 +1000 Subject: Add heat.exe --- Tools.sln | 14 ++++- appveyor.cmd | 3 ++ src/heat/Program.cs | 74 +++++++++++++++++++++++++++ src/heat/heat.csproj | 34 ++++++++++++ src/heat/heat.net461.v3.ncrunchproject | 5 ++ src/heat/heat.netcoreapp2.1.v3.ncrunchproject | 5 ++ 6 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 src/heat/Program.cs create mode 100644 src/heat/heat.csproj create mode 100644 src/heat/heat.net461.v3.ncrunchproject create mode 100644 src/heat/heat.netcoreapp2.1.v3.ncrunchproject diff --git a/Tools.sln b/Tools.sln index 45deb3c5..5a108710 100644 --- a/Tools.sln +++ b/Tools.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.BuildTasks", "src\test\WixToolsetTest.BuildTasks\WixToolsetTest.BuildTasks.csproj", "{4B0098A4-B581-4D04-BA1E-6DC2370A7D43}" EndProject @@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.WixCop", "sr EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thmviewer", "src\thmviewer\thmviewer.vcxproj", "{95228C13-97F5-484A-B4A2-ECF4618B0881}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "heat", "src\heat\heat.csproj", "{B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -104,6 +106,14 @@ Global {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|Any CPU.ActiveCfg = Release|Win32 {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.ActiveCfg = Release|Win32 {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.Build.0 = Release|Win32 + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|x86.ActiveCfg = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|x86.Build.0 = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|Any CPU.Build.0 = Release|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.ActiveCfg = Release|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/appveyor.cmd b/appveyor.cmd index d0dcee83..0071045f 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -8,6 +8,9 @@ dotnet test -c Release src\test\WixToolsetTest.BuildTasks dotnet test -c Release src\test\WixToolsetTest.WixCop dotnet publish -c Release -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix +@rem dotnet publish -c Release -o %_P%\netfx-heat\ -f net461 src\heat +@rem dotnet publish -c Release -o %_P%\netfx-wix\ -f net461 src\wix +@rem dotnet publish -c Release -o %_P%\netfx-wixcop\ -f net461 src\wixcop dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net461\ -f net461 src\WixToolset.BuildTasks dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks diff --git a/src/heat/Program.cs b/src/heat/Program.cs new file mode 100644 index 00000000..38d6d401 --- /dev/null +++ b/src/heat/Program.cs @@ -0,0 +1,74 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools.Heat +{ + using System; + using System.Runtime.InteropServices; + using WixToolset.Core; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters; + using WixToolset.Tools.Core; + + /// + /// Wix Toolset Harvester. + /// + public sealed class Program + { + /// + /// The main entry point for the application. + /// + /// Commandline arguments for the application. + /// Returns the application error code. + [MTAThread] + public static int Main(string[] args) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var listener = new ConsoleMessageListener("HEAT", "heat.exe"); + + try + { + var program = new Program(); + return program.Run(serviceProvider, listener, args); + } + catch (WixException e) + { + listener.Write(e.Error); + + return e.Error.Id; + } + catch (Exception e) + { + listener.Write(ErrorMessages.UnexpectedException(e)); + + if (e is NullReferenceException || e is SEHException) + { + throw; + } + + return e.HResult; + } + } + + /// + /// Run the application with the given arguments. + /// + /// Service provider to use throughout this execution. + /// The commandline arguments. + /// Returns the application error code. + public int Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) + { + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var arguments = serviceProvider.GetService(); + arguments.Populate(args); + + var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider); + var command = commandLine.ParseStandardCommandLine(arguments); + return command?.Execute() ?? 1; + } + } +} diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj new file mode 100644 index 00000000..fd56c6c8 --- /dev/null +++ b/src/heat/heat.csproj @@ -0,0 +1,34 @@ + + + + + + netcoreapp2.1;net461;net472 + Exe + Harvester + WiX Harvester + embedded + true + + win-x86 + AnyCPU + + + + NU1701 + + + + + + + + + + + + + + + + diff --git a/src/heat/heat.net461.v3.ncrunchproject b/src/heat/heat.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/heat/heat.net461.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/heat/heat.netcoreapp2.1.v3.ncrunchproject b/src/heat/heat.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/heat/heat.netcoreapp2.1.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 049a5c80b1af9612c8484db177323be4444e7c8a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 22 May 2020 20:10:06 +1000 Subject: Enable long path support for heat, wix, and wixcop. --- src/heat/app.config | 10 ++++++++++ src/heat/heat.csproj | 2 ++ src/heat/heat.exe.manifest | 20 ++++++++++++++++++++ src/wix/app.config | 10 ++++++++++ src/wix/wix.csproj | 2 ++ src/wix/wix.exe.manifest | 20 ++++++++++++++++++++ src/wixcop/WixCop.csproj | 2 ++ src/wixcop/app.config | 10 ++++++++++ src/wixcop/wixcop.exe.manifest | 20 ++++++++++++++++++++ 9 files changed, 96 insertions(+) create mode 100644 src/heat/app.config create mode 100644 src/heat/heat.exe.manifest create mode 100644 src/wix/app.config create mode 100644 src/wix/wix.exe.manifest create mode 100644 src/wixcop/app.config create mode 100644 src/wixcop/wixcop.exe.manifest diff --git a/src/heat/app.config b/src/heat/app.config new file mode 100644 index 00000000..65d3d6c3 --- /dev/null +++ b/src/heat/app.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index fd56c6c8..f6548e65 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -12,6 +12,8 @@ win-x86 AnyCPU + app.config + heat.exe.manifest diff --git a/src/heat/heat.exe.manifest b/src/heat/heat.exe.manifest new file mode 100644 index 00000000..b4adfbb7 --- /dev/null +++ b/src/heat/heat.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + WiX Toolset Harvester + + + + + + + + + + true + + + diff --git a/src/wix/app.config b/src/wix/app.config new file mode 100644 index 00000000..65d3d6c3 --- /dev/null +++ b/src/wix/app.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index ef007849..8fd45631 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -12,6 +12,8 @@ win-x86 AnyCPU + app.config + wix.exe.manifest diff --git a/src/wix/wix.exe.manifest b/src/wix/wix.exe.manifest new file mode 100644 index 00000000..49d90508 --- /dev/null +++ b/src/wix/wix.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + WiX Toolset Compiler + + + + + + + + + + true + + + diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 8b3acf44..63e1aa06 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -12,6 +12,8 @@ win-x86 AnyCPU + app.config + wixcop.exe.manifest diff --git a/src/wixcop/app.config b/src/wixcop/app.config new file mode 100644 index 00000000..65d3d6c3 --- /dev/null +++ b/src/wixcop/app.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/wixcop/wixcop.exe.manifest b/src/wixcop/wixcop.exe.manifest new file mode 100644 index 00000000..bf4a93b0 --- /dev/null +++ b/src/wixcop/wixcop.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + WiX Toolset Correction Tool + + + + + + + + + + true + + + -- cgit v1.2.3-55-g6feb From 2480d0ad4bf4f0dd841697d6d607bb35a0fd8161 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 23 May 2020 22:02:15 +1000 Subject: Add test for wixcop handling util:PermissionEx/@Inheritable. --- .../TestData/PermissionEx/v3.wxs | 27 +++++++++++++ .../TestData/PermissionEx/v4_expected.wxs | 27 +++++++++++++ src/test/WixToolsetTest.WixCop/WixCopFixture.cs | 45 ++++++++++++++++++++++ .../WixToolsetTest.WixCop.csproj | 6 ++- 4 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs create mode 100644 src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs diff --git a/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs b/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs new file mode 100644 index 00000000..0e241544 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs new file mode 100644 index 00000000..375b70d3 --- /dev/null +++ b/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs index 207782b7..72a36dd6 100644 --- a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs +++ b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs @@ -9,6 +9,51 @@ namespace WixToolsetTest.WixCop public class WixCopFixture { + [Fact] + public void CanConvertPermissionExFile() + { + const string beforeFileName = "v3.wxs"; + const string afterFileName = "v4_expected.wxs"; + var folder = TestData.Get(@"TestData\PermissionEx"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(true); + var targetFile = Path.Combine(baseFolder, beforeFileName); + File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); + + var runner = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result = runner.Execute(); + + Assert.Equal(2, result.ExitCode); + + var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); + var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); + Assert.Equal(expected, actual); + + var runner2 = new WixCopRunner + { + FixErrors = true, + SearchPatterns = + { + targetFile, + }, + }; + + var result2 = runner2.Execute(); + + Assert.Equal(0, result2.ExitCode); + } + } + [Fact] public void CanConvertSingleFile() { diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj index 787b8ca1..3ea4dae5 100644 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj +++ b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj @@ -18,8 +18,8 @@ - - + + @@ -27,6 +27,8 @@ + + -- cgit v1.2.3-55-g6feb From 0b9fd5ae84460d943e685b9821473f356a66bd3b Mon Sep 17 00:00:00 2001 From: paulomorgado <470455+paulomorgado@users.noreply.github.com> Date: Mon, 25 May 2020 13:13:25 +0100 Subject: Allow more than one harvested file and files differing by extension add component and directory for more disambiguation Fix HarvestFile Ouput added unit tests --- src/WixToolset.BuildTasks/wix.harvest.targets | 4 +- .../MsbuildHeatFixture.cs | 79 +++++++++++++++++++++- .../HeatFileMultpleFilesSameFileName.wixproj | 61 +++++++++++++++++ .../MyProgram.json | 1 + .../HeatFileMultpleFilesSameFileName/MyProgram.txt | 1 + .../HeatFileMultpleFilesSameFileName/Package.wxs | 22 ++++++ .../WixToolsetTest.BuildTasks.csproj | 6 +- 7 files changed, 170 insertions(+), 4 deletions(-) create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt create mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs diff --git a/src/WixToolset.BuildTasks/wix.harvest.targets b/src/WixToolset.BuildTasks/wix.harvest.targets index a8be17df..5dd2f729 100644 --- a/src/WixToolset.BuildTasks/wix.harvest.targets +++ b/src/WixToolset.BuildTasks/wix.harvest.targets @@ -415,7 +415,7 @@ line.Contains(": warning")); Assert.Empty(warnings); - var generatedFilePath = Path.Combine(intermediateFolder, @"_HeatFilePackage_file.wxs"); + var generatedFilePath = Path.Combine(intermediateFolder, @"_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); Assert.True(File.Exists(generatedFilePath)); var generatedContents = File.ReadAllText(generatedFilePath); @@ -71,5 +71,82 @@ namespace WixToolsetTest.BuildTasks Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); } } + + [Fact] + public void CanBuildHeatFileWithMultipleFilesPackage() + { + var projectPath = TestData.Get(@"TestData\HeatFileMultpleFilesSameFileName\HeatFileMultpleFilesSameFileName.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}" + }); + result.AssertSuccess(); + + var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); + Assert.Equal(2, heatCommandLines.Count()); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, @"_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + generatedFilePath = Path.Combine(intermediateFolder, @"_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + generatedContents = File.ReadAllText(generatedFilePath); + testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "HeatFileMultpleFilesSameFileName.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileTuples = section.Tuples.OfType().ToArray(); + Assert.Equal(@"SourceDir\MyProgram.txt", fileTuples[0][FileTupleFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(@"SourceDir\MyProgram.json", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path); + } + } } } diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj new file mode 100644 index 00000000..860fc2dd --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj @@ -0,0 +1,61 @@ + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + + + + + TxtProductComponents + INSTALLFOLDER + true + + + JsonProductComponents + INSTALLFOLDER + true + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs new file mode 100644 index 00000000..884da274 --- /dev/null +++ b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 3909cc79..333c7c79 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -1,4 +1,4 @@ - + @@ -12,6 +12,10 @@ + + + + -- cgit v1.2.3-55-g6feb From 551f2a43de0465202e3a3aca24379481cc35733e Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 28 May 2020 21:21:24 +1000 Subject: Rename DoIt to WixBuild. --- src/WixToolset.BuildTasks/DoIt.cs | 178 --------------------- src/WixToolset.BuildTasks/WixBuild.cs | 178 +++++++++++++++++++++ src/WixToolset.BuildTasks/wix.targets | 4 +- .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 2 +- .../WixBuildTaskFixture.cs | 4 +- 5 files changed, 183 insertions(+), 183 deletions(-) delete mode 100644 src/WixToolset.BuildTasks/DoIt.cs create mode 100644 src/WixToolset.BuildTasks/WixBuild.cs diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs deleted file mode 100644 index d95d6e3c..00000000 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using System.Runtime.InteropServices; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - using WixToolset.Core; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - - /// - /// An MSBuild task to run the WiX compiler. - /// - public sealed class DoIt : ToolsetTask - { - public string[] Cultures { get; set; } - - public string[] DefineConstants { get; set; } - - public ITaskItem[] Extensions { get; set; } - - public string ExtensionDirectory { get; set; } - - public string[] IncludeSearchPaths { get; set; } - - public string InstallerPlatform { get; set; } - - [Required] - public ITaskItem IntermediateDirectory { get; set; } - - public ITaskItem[] LocalizationFiles { get; set; } - - public ITaskItem[] LibraryFiles { get; set; } - - [Output] - [Required] - public ITaskItem OutputFile { get; set; } - - public string OutputType { get; set; } - - public ITaskItem PdbFile { get; set; } - - public string PdbType { get; set; } - - public bool Pedantic { get; set; } - - [Required] - public ITaskItem[] SourceFiles { get; set; } - - public string[] ReferencePaths { get; set; } - - - public ITaskItem[] BindInputPaths { get; set; } - - public bool BindFiles { get; set; } - - public ITaskItem BindContentsFile { get; set; } - - public ITaskItem BindOutputsFile { get; set; } - - public ITaskItem BindBuiltOutputsFile { get; set; } - - public string CabinetCachePath { get; set; } - public int CabinetCreationThreadCount { get; set; } - public string DefaultCompressionLevel { get; set; } - - [Output] - public ITaskItem UnreferencedSymbolsFile { get; set; } - - public ITaskItem WixProjectFile { get; set; } - public string[] WixVariables { get; set; } - - public bool SuppressValidation { get; set; } - public string[] SuppressIces { get; set; } - public string AdditionalCub { get; set; } - - protected override string TaskShortName => "WIX"; - - protected override void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) - { - this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); - - var messaging = serviceProvider.GetService(); - messaging.SetListener(listener); - - var arguments = serviceProvider.GetService(); - arguments.Populate(commandLineString); - - var commandLine = serviceProvider.GetService(); - commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); - commandLine.Arguments = arguments; - var command = commandLine.ParseStandardCommandLine(); - command?.Execute(); - } - - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - commandLineBuilder.AppendTextUnquoted("build"); - - commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform); - commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); - commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); - commandLineBuilder.AppendSwitchIfNotNull("-pdb ", this.PdbFile); - commandLineBuilder.AppendSwitchIfNotNull("-pdbType ", this.PdbType); - commandLineBuilder.AppendArrayIfNotNull("-culture ", this.Cultures); - commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); - commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); - commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); - commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); - commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); - commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); - commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); - commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); - commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile); - commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile); - commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile); - - base.BuildCommandLine(commandLineBuilder); - - commandLineBuilder.AppendIfTrue("-bindFiles", this.BindFiles); - commandLineBuilder.AppendArrayIfNotNull("-bindPath ", this.CalculateBindPathStrings()); - commandLineBuilder.AppendArrayIfNotNull("-loc ", this.LocalizationFiles); - commandLineBuilder.AppendArrayIfNotNull("-lib ", this.LibraryFiles); - commandLineBuilder.AppendTextIfNotWhitespace(this.AdditionalOptions); - commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); - } - - private IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) - { - var extensionManager = serviceProvider.GetService(); - - foreach (var type in new[] { typeof(WixToolset.Core.Burn.WixToolsetStandardBackend), typeof(WixToolset.Core.WindowsInstaller.WixToolsetStandardBackend) }) - { - extensionManager.Add(type.Assembly); - } - - foreach (var extension in extensions) - { - try - { - extensionManager.Load(extension); - } - catch (WixException e) - { - messaging.Write(e.Error); - } - } - - return extensionManager; - } - - private IEnumerable CalculateBindPathStrings() - { - if (null != this.BindInputPaths) - { - foreach (var item in this.BindInputPaths) - { - var path = item.GetMetadata("FullPath"); - - var bindName = item.GetMetadata("BindName"); - if (!String.IsNullOrEmpty(bindName)) - { - yield return String.Concat(bindName, "=", path); - } - else - { - yield return path; - } - } - } - } - } -} diff --git a/src/WixToolset.BuildTasks/WixBuild.cs b/src/WixToolset.BuildTasks/WixBuild.cs new file mode 100644 index 00000000..b8fb4136 --- /dev/null +++ b/src/WixToolset.BuildTasks/WixBuild.cs @@ -0,0 +1,178 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Runtime.InteropServices; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Core; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + + /// + /// An MSBuild task to run the WiX compiler. + /// + public sealed class WixBuild : ToolsetTask + { + public string[] Cultures { get; set; } + + public string[] DefineConstants { get; set; } + + public ITaskItem[] Extensions { get; set; } + + public string ExtensionDirectory { get; set; } + + public string[] IncludeSearchPaths { get; set; } + + public string InstallerPlatform { get; set; } + + [Required] + public ITaskItem IntermediateDirectory { get; set; } + + public ITaskItem[] LocalizationFiles { get; set; } + + public ITaskItem[] LibraryFiles { get; set; } + + [Output] + [Required] + public ITaskItem OutputFile { get; set; } + + public string OutputType { get; set; } + + public ITaskItem PdbFile { get; set; } + + public string PdbType { get; set; } + + public bool Pedantic { get; set; } + + [Required] + public ITaskItem[] SourceFiles { get; set; } + + public string[] ReferencePaths { get; set; } + + + public ITaskItem[] BindInputPaths { get; set; } + + public bool BindFiles { get; set; } + + public ITaskItem BindContentsFile { get; set; } + + public ITaskItem BindOutputsFile { get; set; } + + public ITaskItem BindBuiltOutputsFile { get; set; } + + public string CabinetCachePath { get; set; } + public int CabinetCreationThreadCount { get; set; } + public string DefaultCompressionLevel { get; set; } + + [Output] + public ITaskItem UnreferencedSymbolsFile { get; set; } + + public ITaskItem WixProjectFile { get; set; } + public string[] WixVariables { get; set; } + + public bool SuppressValidation { get; set; } + public string[] SuppressIces { get; set; } + public string AdditionalCub { get; set; } + + protected override string TaskShortName => "WIX"; + + protected override void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) + { + this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); + + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var arguments = serviceProvider.GetService(); + arguments.Populate(commandLineString); + + var commandLine = serviceProvider.GetService(); + commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); + commandLine.Arguments = arguments; + var command = commandLine.ParseStandardCommandLine(); + command?.Execute(); + } + + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendTextUnquoted("build"); + + commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform); + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); + commandLineBuilder.AppendSwitchIfNotNull("-pdb ", this.PdbFile); + commandLineBuilder.AppendSwitchIfNotNull("-pdbType ", this.PdbType); + commandLineBuilder.AppendArrayIfNotNull("-culture ", this.Cultures); + commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); + commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); + commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); + commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); + commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); + commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); + commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); + commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); + commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile); + commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile); + commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile); + + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendIfTrue("-bindFiles", this.BindFiles); + commandLineBuilder.AppendArrayIfNotNull("-bindPath ", this.CalculateBindPathStrings()); + commandLineBuilder.AppendArrayIfNotNull("-loc ", this.LocalizationFiles); + commandLineBuilder.AppendArrayIfNotNull("-lib ", this.LibraryFiles); + commandLineBuilder.AppendTextIfNotWhitespace(this.AdditionalOptions); + commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); + } + + private IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) + { + var extensionManager = serviceProvider.GetService(); + + foreach (var type in new[] { typeof(WixToolset.Core.Burn.WixToolsetStandardBackend), typeof(WixToolset.Core.WindowsInstaller.WixToolsetStandardBackend) }) + { + extensionManager.Add(type.Assembly); + } + + foreach (var extension in extensions) + { + try + { + extensionManager.Load(extension); + } + catch (WixException e) + { + messaging.Write(e.Error); + } + } + + return extensionManager; + } + + private IEnumerable CalculateBindPathStrings() + { + if (null != this.BindInputPaths) + { + foreach (var item in this.BindInputPaths) + { + var path = item.GetMetadata("FullPath"); + + var bindName = item.GetMetadata("BindName"); + if (!String.IsNullOrEmpty(bindName)) + { + yield return String.Concat(bindName, "=", path); + } + else + { + yield return path; + } + } + } + } + } +} diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets index eb0f815a..b8d6bb34 100644 --- a/src/WixToolset.BuildTasks/wix.targets +++ b/src/WixToolset.BuildTasks/wix.targets @@ -101,7 +101,7 @@ --> - + @@ -629,7 +629,7 @@ $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) - Date: Thu, 28 May 2020 23:00:05 +1000 Subject: Move the targets files into the top-level tools folder. --- src/ThmViewerPackage/ThmViewerPackage.wixproj | 3 +- .../WixToolset.BuildTasks.csproj | 9 - src/WixToolset.BuildTasks/redirects/wix.ca.targets | 10 - src/WixToolset.BuildTasks/redirects/wix.targets | 10 - src/WixToolset.BuildTasks/wix.ca.targets | 123 --- src/WixToolset.BuildTasks/wix.harvest.targets | 505 ---------- src/WixToolset.BuildTasks/wix.signing.targets | 370 ------- src/WixToolset.BuildTasks/wix.targets | 1063 -------------------- src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 4 + src/WixToolset.MSBuild/WixToolset.MSBuild.props | 3 +- src/WixToolset.MSBuild/wix.ca.targets | 123 +++ src/WixToolset.MSBuild/wix.harvest.targets | 499 +++++++++ src/WixToolset.MSBuild/wix.signing.targets | 370 +++++++ src/WixToolset.MSBuild/wix.targets | 1060 +++++++++++++++++++ .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 12 +- .../MsbuildHeatFixture.cs | 5 +- .../WixToolsetTest.BuildTasks.csproj | 6 + 17 files changed, 2080 insertions(+), 2095 deletions(-) delete mode 100644 src/WixToolset.BuildTasks/redirects/wix.ca.targets delete mode 100644 src/WixToolset.BuildTasks/redirects/wix.targets delete mode 100644 src/WixToolset.BuildTasks/wix.ca.targets delete mode 100644 src/WixToolset.BuildTasks/wix.harvest.targets delete mode 100644 src/WixToolset.BuildTasks/wix.signing.targets delete mode 100644 src/WixToolset.BuildTasks/wix.targets create mode 100644 src/WixToolset.MSBuild/wix.ca.targets create mode 100644 src/WixToolset.MSBuild/wix.harvest.targets create mode 100644 src/WixToolset.MSBuild/wix.signing.targets create mode 100644 src/WixToolset.MSBuild/wix.targets diff --git a/src/ThmViewerPackage/ThmViewerPackage.wixproj b/src/ThmViewerPackage/ThmViewerPackage.wixproj index a0351aca..07014065 100644 --- a/src/ThmViewerPackage/ThmViewerPackage.wixproj +++ b/src/ThmViewerPackage/ThmViewerPackage.wixproj @@ -6,6 +6,7 @@ 59c4b122-5167-445b-8fc4-09dcd4eced89 thmviewer Package + $(OutputPath)\net461\win-x86\ @@ -23,7 +24,7 @@ - + diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 8724f2fc..a8363e7b 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -16,15 +16,6 @@ NU1701 - - - - - - - - - diff --git a/src/WixToolset.BuildTasks/redirects/wix.ca.targets b/src/WixToolset.BuildTasks/redirects/wix.ca.targets deleted file mode 100644 index ecb6e09f..00000000 --- a/src/WixToolset.BuildTasks/redirects/wix.ca.targets +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WiX Toolset\v4', 'InstallFolder', null, RegistryView.Registry32)) - - - - diff --git a/src/WixToolset.BuildTasks/redirects/wix.targets b/src/WixToolset.BuildTasks/redirects/wix.targets deleted file mode 100644 index ba354b65..00000000 --- a/src/WixToolset.BuildTasks/redirects/wix.targets +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WiX Toolset\v4', 'InstallFolder', null, RegistryView.Registry32)) - - - - diff --git a/src/WixToolset.BuildTasks/wix.ca.targets b/src/WixToolset.BuildTasks/wix.ca.targets deleted file mode 100644 index 4578c2d8..00000000 --- a/src/WixToolset.BuildTasks/wix.ca.targets +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - true - - $(TargetName).CA$(TargetExt) - - $(MSBuildThisFileDirectory) - $(WixSdkPath)x86\ - $(WixSdkPath)x64\ - - $(WixSdkPath)MakeSfxCA.exe - $(WixSdkX64Path)SfxCA.dll - $(WixSdkX86Path)SfxCA.dll - - - - - - - - - - - - - - - - - - - @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.BuildTasks/wix.harvest.targets b/src/WixToolset.BuildTasks/wix.harvest.targets deleted file mode 100644 index 5dd2f729..00000000 --- a/src/WixToolset.BuildTasks/wix.harvest.targets +++ /dev/null @@ -1,505 +0,0 @@ - - - - - - - - - $(MSBuildThisFileFullPath) - $(WixTargetsPath)WixToolset.BuildTasks.dll - - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - true - false - true - false - - - - - - false - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - $(IntermediateOutputPath)Product.Generated.wxs - $(IntermediateOutputPath)Bundle.Generated.wxs - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - - ConvertReferences; - ConvertBundleReferences; - HarvestProjects; - HarvestDirectory; - HarvestFile; - GenerateCode; - - - - - - - - RefreshGeneratedFile; - RefreshBundleGeneratedFile - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - %(_MSBuildProjectReferenceExistent.RefTargetDir) - Binaries;Symbols;Sources;Content;Satellites;Documents - %(_MSBuildProjectReferenceExistent.Name) - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - Binaries;Symbols;Sources;Content;Satellites;Documents - payloadgroup - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - - - CombineHarvestProjects - - - - - - - - - - - - - - - - - $(HarvestDirectoryTransforms) - $(HarvestDirectoryComponentGroupName) - $(HarvestDirectoryDirectoryRefId) - $(HarvestDirectoryKeepEmptyDirectories) - $(HarvestDirectoryPreprocessorVariable) - $(HarvestDirectorySuppressCom) - $(HarvestDirectorySuppressRootDirectory) - $(HarvestDirectorySuppressRegistry) - - - - - - GetHarvestDirectoryContent - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestFileTransforms) - $(HarvestFileComponentGroupName) - $(HarvestFileDirectoryRefId) - $(HarvestFilePreprocessorVariable) - $(HarvestFileSuppressCom) - $(HarvestFileSuppressRegistry) - $(HarvestFileSuppressRootDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.BuildTasks/wix.signing.targets b/src/WixToolset.BuildTasks/wix.signing.targets deleted file mode 100644 index 7c25175f..00000000 --- a/src/WixToolset.BuildTasks/wix.signing.targets +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - $(MSBuildProjectFile).Signed.txt - $(IntermediateOutputPath)$(SignedFileName) - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - GetMsmsToSign; - InternalSignMsm; - - - GetCabsToSign; - GetMsiToSign; - InternalSignCabs; - InscribeMsi; - InternalSignMsi; - - - GetContainersToSign; - InternalSignContainers; - InscribeBundleEngine; - InternalSignBundleEngine; - InscribeBundle; - InternalSignBundle; - - - - WixBuild; - CalculateSignTargetFiles; - BeforeSigning; - $(InternalSignDependsOn); - AfterSigning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.BuildTasks/wix.targets b/src/WixToolset.BuildTasks/wix.targets deleted file mode 100644 index b8d6bb34..00000000 --- a/src/WixToolset.BuildTasks/wix.targets +++ /dev/null @@ -1,1063 +0,0 @@ - - - - - - true - - - - - - - - - - $(MSBuildThisFileDirectory) - $(WixBinDir)WixToolset.BuildTasks.dll - $(WixBinDir)wix.harvest.targets - $(WixBinDir)wix.signing.targets - $(WixBinDir)lux.targets - $(WixBinDir)LuxTasks.dll - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildAllProjects);$(WixHarvestTargetsPath) - $(MSBuildAllProjects);$(WixSigningTargetsPath) - $(MSBuildAllProjects);$(LuxTargetsPath) - $(MSBuildAllProjects);$(CustomBeforeWixTargets) - $(MSBuildAllProjects);$(CustomAfterWixTargets) - - - - - - .wxs - wix - wix - - - $(MSBuildProjectName) - $(OutputName) - - - Package - - - full - - - - - .msi - .msm - .pcp - .wixlib - .exe - .wixipl - - - - - - - $(TargetDir) - $(PdbOutputDir)\ - - - $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) - - - $(TargetName).wixpdb - - - $(TargetPdbDir)$(TargetPdbFileName) - - - - - - - - - - - - - - - - - $(MSBuildProjectFile).BindContentsFileList.txt - $(MSBuildProjectFile).BindOutputsFileList.txt - $(MSBuildProjectFile).BindBuiltOutputsFileList.txt - - - - $(IntermediateOutputPath)cabcache\ - - - - $(WixBinDir) - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - $(Platform) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - - - - - - - - - - - - - <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. - <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) - - - - - - - - - - - - - - - - - - - BuildOnlySettings; - PrepareForBuild; - PreBuildEvent; - - WixBuild; - Signing; - - GetTargetPath; - PrepareForRun; - IncrementalClean; - PostBuildEvent - - - - - - - - - - BeforeResolveReferences; - AssignProjectConfiguration; - ResolveProjectReferences; - ResolveWixLibraryReferences; - ResolveWixExtensionReferences; - AfterResolveReferences - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AssignTargetPaths - - - - - - - - - ResolveReferences; - BeforeCompile; - _TimeStampBeforeCompile; - - CalculateDefineConstants; - Harvest; - - GenerateCompileWithObjectPath; - - AssignTargetPaths; - ReadPreviousBindInputsAndBuiltOutputs; - - CoreWixBuild; - - UpdateLinkFileWrites; - _TimeStampAfterCompile; - AfterCompile - - - - - - - - - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) - - $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) - - - - - - - - - - - ResolveReferences - - - - - - Configuration=$(ConfigurationName); - OutDir=$(OutDir); - Platform=$(PlatformName); - ProjectDir=$(ProjectDir); - ProjectExt=$(ProjectExt); - ProjectFileName=$(ProjectFileName); - ProjectName=$(ProjectName); - ProjectPath=$(ProjectPath); - TargetDir=$(TargetDir); - TargetExt=$(TargetExt); - TargetFileName=$(TargetFileName); - TargetName=$(TargetName); - TargetPath=$(TargetPath); - - - - - $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) - $(SolutionDefineConstants);SolutionDir=$(SolutionDir) - $(SolutionDefineConstants);SolutionExt=$(SolutionExt) - $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) - $(SolutionDefineConstants);SolutionName=$(SolutionName) - $(SolutionDefineConstants);SolutionPath=$(SolutionPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> - <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> - - - - @(_CulturedTargetPath) - @(_CulturedTargetPdbPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(TargetPath) - $(TargetFileName) - - - - - - PrepareForBuild;AssignTargetPaths - - - - - - - - - - - - - <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> - - - - - - - %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) - - - - - - - AssignTargetPaths - - - - - - - - - - - - - - - - true - - - - true - true - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) - - - - - - - - - <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> - <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index c9e5cdf2..00cf440b 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -12,6 +12,10 @@ + + + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/WixToolset.MSBuild.props index b1d207f4..b453361b 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.props +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.props @@ -3,7 +3,6 @@ - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\netcoreapp2.1\wix.targets')) - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\net461\wix.targets')) + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) diff --git a/src/WixToolset.MSBuild/wix.ca.targets b/src/WixToolset.MSBuild/wix.ca.targets new file mode 100644 index 00000000..4578c2d8 --- /dev/null +++ b/src/WixToolset.MSBuild/wix.ca.targets @@ -0,0 +1,123 @@ + + + + + + + + + + true + + $(TargetName).CA$(TargetExt) + + $(MSBuildThisFileDirectory) + $(WixSdkPath)x86\ + $(WixSdkPath)x64\ + + $(WixSdkPath)MakeSfxCA.exe + $(WixSdkX64Path)SfxCA.dll + $(WixSdkX86Path)SfxCA.dll + + + + + + + + + + + + + + + + + + + @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/wix.harvest.targets b/src/WixToolset.MSBuild/wix.harvest.targets new file mode 100644 index 00000000..e4d866ea --- /dev/null +++ b/src/WixToolset.MSBuild/wix.harvest.targets @@ -0,0 +1,499 @@ + + + + + + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + true + false + true + false + + + + + + false + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + $(IntermediateOutputPath)Product.Generated.wxs + $(IntermediateOutputPath)Bundle.Generated.wxs + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + + ConvertReferences; + ConvertBundleReferences; + HarvestProjects; + HarvestDirectory; + HarvestFile; + GenerateCode; + + + + + + + + RefreshGeneratedFile; + RefreshBundleGeneratedFile + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + %(_MSBuildProjectReferenceExistent.RefTargetDir) + Binaries;Symbols;Sources;Content;Satellites;Documents + %(_MSBuildProjectReferenceExistent.Name) + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + Binaries;Symbols;Sources;Content;Satellites;Documents + payloadgroup + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + + + CombineHarvestProjects + + + + + + + + + + + + + + + + + $(HarvestDirectoryTransforms) + $(HarvestDirectoryComponentGroupName) + $(HarvestDirectoryDirectoryRefId) + $(HarvestDirectoryKeepEmptyDirectories) + $(HarvestDirectoryPreprocessorVariable) + $(HarvestDirectorySuppressCom) + $(HarvestDirectorySuppressRootDirectory) + $(HarvestDirectorySuppressRegistry) + + + + + + GetHarvestDirectoryContent + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestFileTransforms) + $(HarvestFileComponentGroupName) + $(HarvestFileDirectoryRefId) + $(HarvestFilePreprocessorVariable) + $(HarvestFileSuppressCom) + $(HarvestFileSuppressRegistry) + $(HarvestFileSuppressRootDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/wix.signing.targets b/src/WixToolset.MSBuild/wix.signing.targets new file mode 100644 index 00000000..7c25175f --- /dev/null +++ b/src/WixToolset.MSBuild/wix.signing.targets @@ -0,0 +1,370 @@ + + + + + + $(MSBuildProjectFile).Signed.txt + $(IntermediateOutputPath)$(SignedFileName) + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + GetMsmsToSign; + InternalSignMsm; + + + GetCabsToSign; + GetMsiToSign; + InternalSignCabs; + InscribeMsi; + InternalSignMsi; + + + GetContainersToSign; + InternalSignContainers; + InscribeBundleEngine; + InternalSignBundleEngine; + InscribeBundle; + InternalSignBundle; + + + + WixBuild; + CalculateSignTargetFiles; + BeforeSigning; + $(InternalSignDependsOn); + AfterSigning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/wix.targets b/src/WixToolset.MSBuild/wix.targets new file mode 100644 index 00000000..b35d18c7 --- /dev/null +++ b/src/WixToolset.MSBuild/wix.targets @@ -0,0 +1,1060 @@ + + + + + + true + + + + + + + + + + $(MSBuildThisFileDirectory)netcoreapp2.1\ + $(MSBuildThisFileDirectory)net461\ + $(WixBinDir)WixToolset.BuildTasks.dll + $(MSBuildThisFileDirectory)wix.harvest.targets + $(MSBuildThisFileDirectory)wix.signing.targets + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildAllProjects);$(WixHarvestTargetsPath) + $(MSBuildAllProjects);$(WixSigningTargetsPath) + $(MSBuildAllProjects);$(CustomBeforeWixTargets) + $(MSBuildAllProjects);$(CustomAfterWixTargets) + + + + + + .wxs + wix + wix + + + $(MSBuildProjectName) + $(OutputName) + + + Package + + + full + + + + + .msi + .msm + .pcp + .wixlib + .exe + .wixipl + + + + + + + $(TargetDir) + $(PdbOutputDir)\ + + + $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) + + + $(TargetName).wixpdb + + + $(TargetPdbDir)$(TargetPdbFileName) + + + + + + + + + + + + + + + + + $(MSBuildProjectFile).BindContentsFileList.txt + $(MSBuildProjectFile).BindOutputsFileList.txt + $(MSBuildProjectFile).BindBuiltOutputsFileList.txt + + + + $(IntermediateOutputPath)cabcache\ + + + + $(WixBinDir) + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + $(Platform) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + + + + + + + + + + + + + <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. + <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) + + + + + + + + + + + + + + + + + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + + WixBuild; + Signing; + + GetTargetPath; + PrepareForRun; + IncrementalClean; + PostBuildEvent + + + + + + + + + + BeforeResolveReferences; + AssignProjectConfiguration; + ResolveProjectReferences; + ResolveWixLibraryReferences; + ResolveWixExtensionReferences; + AfterResolveReferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssignTargetPaths + + + + + + + + + ResolveReferences; + BeforeCompile; + _TimeStampBeforeCompile; + + CalculateDefineConstants; + Harvest; + + GenerateCompileWithObjectPath; + + AssignTargetPaths; + ReadPreviousBindInputsAndBuiltOutputs; + + CoreWixBuild; + + UpdateLinkFileWrites; + _TimeStampAfterCompile; + AfterCompile + + + + + + + + + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) + + $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) + + + + + + + + + + + ResolveReferences + + + + + + Configuration=$(ConfigurationName); + OutDir=$(OutDir); + Platform=$(PlatformName); + ProjectDir=$(ProjectDir); + ProjectExt=$(ProjectExt); + ProjectFileName=$(ProjectFileName); + ProjectName=$(ProjectName); + ProjectPath=$(ProjectPath); + TargetDir=$(TargetDir); + TargetExt=$(TargetExt); + TargetFileName=$(TargetFileName); + TargetName=$(TargetName); + TargetPath=$(TargetPath); + + + + + $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) + $(SolutionDefineConstants);SolutionDir=$(SolutionDir) + $(SolutionDefineConstants);SolutionExt=$(SolutionExt) + $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) + $(SolutionDefineConstants);SolutionName=$(SolutionName) + $(SolutionDefineConstants);SolutionPath=$(SolutionPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> + <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> + + + + @(_CulturedTargetPath) + @(_CulturedTargetPdbPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(TargetPath) + $(TargetFileName) + + + + + + PrepareForBuild;AssignTargetPaths + + + + + + + + + + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> + + + + + + + %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) + + + + + + + AssignTargetPaths + + + + + + + + + + + + + + + + true + + + + true + true + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) + + + + + + + + + <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> + <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs index 0c225390..0768f863 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs @@ -11,7 +11,8 @@ namespace WixToolsetTest.BuildTasks public class MsbuildFixture { - private static readonly string WixTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(WixBuild).Assembly.CodeBase).AbsolutePath), "wix.targets"); + private static readonly string WixBinPath = Path.GetDirectoryName(new Uri(typeof(WixBuild).Assembly.CodeBase).AbsolutePath) + "\\"; + private static readonly string WixTargetsPath = Path.Combine(WixBinPath, "wix.targets"); [Fact] public void CanBuildSimpleBundle() @@ -27,6 +28,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}" }); @@ -64,6 +66,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}" }); @@ -126,6 +129,7 @@ namespace WixToolsetTest.BuildTasks { wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}", }); @@ -153,6 +157,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}", $"-p:InstallerPlatform=x64", @@ -178,6 +183,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}", "-p:SuppressIces=\"ICE45;ICE46\"" @@ -200,6 +206,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}", "-p:SuppressSpecificWarnings=\"1118;1102\"" @@ -225,6 +232,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}", "-p:OutputType=IntermediatePostLink" @@ -253,6 +261,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}", "-v:diag" @@ -271,6 +280,7 @@ namespace WixToolsetTest.BuildTasks result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}", "-t:Clean", diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs index 13dd0160..95805658 100644 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs @@ -14,7 +14,8 @@ namespace WixToolsetTest.BuildTasks public class MsbuildHeatFixture { - private static readonly string WixTargetsPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(HeatTask).Assembly.CodeBase).AbsolutePath), "wix.targets"); + private static readonly string WixBinPath = Path.GetDirectoryName(new Uri(typeof(WixBuild).Assembly.CodeBase).AbsolutePath) + "\\"; + private static readonly string WixTargetsPath = Path.Combine(WixBinPath, "wix.targets"); [Fact] public void CanBuildHeatFilePackage() @@ -30,6 +31,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}" }); @@ -86,6 +88,7 @@ namespace WixToolsetTest.BuildTasks var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixBinDir={WixBinPath}", $"-p:IntermediateOutputPath={intermediateFolder}", $"-p:OutputPath={binFolder}" }); diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 333c7c79..9fb2bc82 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -31,6 +31,12 @@ + + + + + + -- cgit v1.2.3-55-g6feb From 2b9f1c20452b582af1962449e0b662d6ec942728 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 28 May 2020 23:04:25 +1000 Subject: Include all subfolders for the build tasks. --- src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index 00cf440b..6171a911 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -16,7 +16,7 @@ - - + + -- cgit v1.2.3-55-g6feb From 64fe8bccc329ac5dc0d510bfbd73054d478ddc37 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 30 May 2020 18:55:10 +1000 Subject: Move most tests into the new WixToolsetTest.MSBuild project. This project relies on all of the projects being published in order to properly test wix.targets. --- Tools.sln | 10 + appveyor.cmd | 30 +- src/ThmViewerPackage/ThmViewerPackage.wixproj | 3 +- src/WixToolset.MSBuild/WixToolset.MSBuild.csproj | 7 + src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 7 +- src/WixToolset.MSBuild/tools/wix.ca.targets | 123 +++ src/WixToolset.MSBuild/tools/wix.harvest.targets | 499 +++++++++ src/WixToolset.MSBuild/tools/wix.signing.targets | 370 +++++++ src/WixToolset.MSBuild/tools/wix.targets | 1060 ++++++++++++++++++++ src/WixToolset.MSBuild/wix.ca.targets | 123 --- src/WixToolset.MSBuild/wix.harvest.targets | 499 --------- src/WixToolset.MSBuild/wix.signing.targets | 370 ------- src/WixToolset.MSBuild/wix.targets | 1060 -------------------- .../WixToolsetTest.BuildTasks/MsbuildFixture.cs | 304 ------ .../MsbuildHeatFixture.cs | 155 --- .../HeatFileMultpleFilesSameFileName.wixproj | 61 -- .../MyProgram.json | 1 - .../HeatFileMultpleFilesSameFileName/MyProgram.txt | 1 - .../HeatFileMultpleFilesSameFileName/Package.wxs | 22 - .../HeatFilePackage/HeatFilePackage.wixproj | 56 -- .../TestData/HeatFilePackage/Package.wxs | 21 - .../MsiPackage/MsiPackage.wixproj | 57 -- .../MsiPackage/Package.de-de.wxl | 11 - .../MsiPackage/Package.en-us.wxl | 11 - .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 21 - .../MsiPackage/PackageComponents.wxs | 10 - .../MsiPackage/data/test.txt | 1 - .../MultiCulturalMsiPackage.sln | 31 - .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 49 - .../SimpleMsiPackage/MsiPackage/Package.en-us.wxl | 11 - .../SimpleMsiPackage/MsiPackage/Package.wxs | 25 - .../MsiPackage/PackageComponents.wxs | 10 - .../SimpleMsiPackage/MsiPackage/data/test.txt | 1 - .../SimpleMsiPackage/SimpleBundle/Bundle.wxs | 10 - .../SimpleBundle/SimpleBundle.wixproj | 45 - .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 39 - .../WixToolsetTest.BuildTasks.csproj | 29 +- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 293 ++++++ .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 151 +++ src/test/WixToolsetTest.MSBuild/README.md | 5 + .../HeatFileMultipleFilesSameFileName.wixproj | 61 ++ .../MyProgram.json | 1 + .../MyProgram.txt | 1 + .../HeatFileMultipleFilesSameFileName/Package.wxs | 22 + .../HeatFilePackage/HeatFilePackage.wixproj | 56 ++ .../TestData/HeatFilePackage/Package.wxs | 21 + .../MsiPackage/MsiPackage.wixproj | 57 ++ .../MsiPackage/Package.de-de.wxl | 11 + .../MsiPackage/Package.en-us.wxl | 11 + .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 21 + .../MsiPackage/PackageComponents.wxs | 10 + .../MsiPackage/data/test.txt | 1 + .../MultiCulturalMsiPackage.sln | 31 + .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 49 + .../SimpleMsiPackage/MsiPackage/Package.en-us.wxl | 11 + .../SimpleMsiPackage/MsiPackage/Package.wxs | 25 + .../MsiPackage/PackageComponents.wxs | 10 + .../SimpleMsiPackage/MsiPackage/data/test.txt | 1 + .../SimpleMsiPackage/SimpleBundle/Bundle.wxs | 10 + .../SimpleBundle/SimpleBundle.wixproj | 45 + .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 39 + .../WixToolsetTest.MSBuild.csproj | 43 + .../WixToolsetTest.MSBuild.v3.ncrunchproject | 5 + 63 files changed, 3084 insertions(+), 3050 deletions(-) create mode 100644 src/WixToolset.MSBuild/tools/wix.ca.targets create mode 100644 src/WixToolset.MSBuild/tools/wix.harvest.targets create mode 100644 src/WixToolset.MSBuild/tools/wix.signing.targets create mode 100644 src/WixToolset.MSBuild/tools/wix.targets delete mode 100644 src/WixToolset.MSBuild/wix.ca.targets delete mode 100644 src/WixToolset.MSBuild/wix.harvest.targets delete mode 100644 src/WixToolset.MSBuild/wix.signing.targets delete mode 100644 src/WixToolset.MSBuild/wix.targets delete mode 100644 src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs delete mode 100644 src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/HeatFilePackage.wixproj delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj delete mode 100644 src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln create mode 100644 src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs create mode 100644 src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs create mode 100644 src/test/WixToolsetTest.MSBuild/README.md create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln create mode 100644 src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj create mode 100644 src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject diff --git a/Tools.sln b/Tools.sln index 5a108710..c9bf5a38 100644 --- a/Tools.sln +++ b/Tools.sln @@ -28,6 +28,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thmviewer", "src\thmviewer\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "heat", "src\heat\heat.csproj", "{B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.MSBuild", "src\test\WixToolsetTest.MSBuild\WixToolsetTest.MSBuild.csproj", "{7B610B7B-C69D-4A4C-9D65-F304C44479E7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -114,6 +116,14 @@ Global {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|Any CPU.Build.0 = Release|Any CPU {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.ActiveCfg = Release|Any CPU {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.Build.0 = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|x86.ActiveCfg = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|x86.Build.0 = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|Any CPU.Build.0 = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|x86.ActiveCfg = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/appveyor.cmd b/appveyor.cmd index 0071045f..e04f0de2 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -1,27 +1,27 @@ @setlocal @pushd %~dp0 -@set _P=%~dp0build\Release\publish +@set _C=Release +@set _P=%~dp0build\%_C%\publish nuget restore -dotnet test -c Release src\test\WixToolsetTest.BuildTasks -dotnet test -c Release src\test\WixToolsetTest.WixCop +dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks +dotnet test -c %_C% src\test\WixToolsetTest.WixCop -dotnet publish -c Release -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix -@rem dotnet publish -c Release -o %_P%\netfx-heat\ -f net461 src\heat -@rem dotnet publish -c Release -o %_P%\netfx-wix\ -f net461 src\wix -@rem dotnet publish -c Release -o %_P%\netfx-wixcop\ -f net461 src\wixcop -dotnet publish -c Release -o %_P%\WixToolset.MSBuild\net461\ -f net461 src\WixToolset.BuildTasks -dotnet publish -c Release -o %_P%\WixToolset.MSBuild\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix +@rem dotnet publish -c %_C% -o %_P%\netfx-heat\ -f net461 src\heat +@rem dotnet publish -c %_C% -o %_P%\netfx-wix\ -f net461 src\wix +@rem dotnet publish -c %_C% -o %_P%\netfx-wixcop\ -f net461 src\wixcop +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\ -f net461 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild -@rem dotnet publish -c Release -o %_P%\netcoreapp2.1 -r win-x86 src\wix -@rem dotnet publish -c Release -o %_P%\net461 -r win-x86 src\light -@rem dotnet publish -c Release -o %_P%\net461 -r win-x86 src\WixToolset.BuildTasks +dotnet pack -c %_C% src\dotnet-wix +dotnet pack -c %_C% src\WixToolset.MSBuild -dotnet pack -c Release src\dotnet-wix -dotnet pack -c Release src\WixToolset.MSBuild +dotnet test -c %_C% src\test\WixToolsetTest.MSBuild -msbuild -p:Configuration=Release .\src\ThmViewerPackage\ThmViewerPackage.wixproj +msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj @popd @endlocal diff --git a/src/ThmViewerPackage/ThmViewerPackage.wixproj b/src/ThmViewerPackage/ThmViewerPackage.wixproj index 07014065..212d1bae 100644 --- a/src/ThmViewerPackage/ThmViewerPackage.wixproj +++ b/src/ThmViewerPackage/ThmViewerPackage.wixproj @@ -6,7 +6,6 @@ 59c4b122-5167-445b-8fc4-09dcd4eced89 thmviewer Package - $(OutputPath)\net461\win-x86\ @@ -24,7 +23,7 @@ - + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj index 5a9633ae..2d5ea01b 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj @@ -11,6 +11,13 @@ Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) + + + + + + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index 6171a911..ff0d74ee 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -12,11 +12,6 @@ - - - - - - + diff --git a/src/WixToolset.MSBuild/tools/wix.ca.targets b/src/WixToolset.MSBuild/tools/wix.ca.targets new file mode 100644 index 00000000..4578c2d8 --- /dev/null +++ b/src/WixToolset.MSBuild/tools/wix.ca.targets @@ -0,0 +1,123 @@ + + + + + + + + + + true + + $(TargetName).CA$(TargetExt) + + $(MSBuildThisFileDirectory) + $(WixSdkPath)x86\ + $(WixSdkPath)x64\ + + $(WixSdkPath)MakeSfxCA.exe + $(WixSdkX64Path)SfxCA.dll + $(WixSdkX86Path)SfxCA.dll + + + + + + + + + + + + + + + + + + + @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/tools/wix.harvest.targets b/src/WixToolset.MSBuild/tools/wix.harvest.targets new file mode 100644 index 00000000..e4d866ea --- /dev/null +++ b/src/WixToolset.MSBuild/tools/wix.harvest.targets @@ -0,0 +1,499 @@ + + + + + + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + true + false + true + false + + + + + + false + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + $(IntermediateOutputPath)Product.Generated.wxs + $(IntermediateOutputPath)Bundle.Generated.wxs + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + + ConvertReferences; + ConvertBundleReferences; + HarvestProjects; + HarvestDirectory; + HarvestFile; + GenerateCode; + + + + + + + + RefreshGeneratedFile; + RefreshBundleGeneratedFile + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + %(_MSBuildProjectReferenceExistent.RefTargetDir) + Binaries;Symbols;Sources;Content;Satellites;Documents + %(_MSBuildProjectReferenceExistent.Name) + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + Binaries;Symbols;Sources;Content;Satellites;Documents + payloadgroup + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + + + CombineHarvestProjects + + + + + + + + + + + + + + + + + $(HarvestDirectoryTransforms) + $(HarvestDirectoryComponentGroupName) + $(HarvestDirectoryDirectoryRefId) + $(HarvestDirectoryKeepEmptyDirectories) + $(HarvestDirectoryPreprocessorVariable) + $(HarvestDirectorySuppressCom) + $(HarvestDirectorySuppressRootDirectory) + $(HarvestDirectorySuppressRegistry) + + + + + + GetHarvestDirectoryContent + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestFileTransforms) + $(HarvestFileComponentGroupName) + $(HarvestFileDirectoryRefId) + $(HarvestFilePreprocessorVariable) + $(HarvestFileSuppressCom) + $(HarvestFileSuppressRegistry) + $(HarvestFileSuppressRootDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/tools/wix.signing.targets b/src/WixToolset.MSBuild/tools/wix.signing.targets new file mode 100644 index 00000000..7c25175f --- /dev/null +++ b/src/WixToolset.MSBuild/tools/wix.signing.targets @@ -0,0 +1,370 @@ + + + + + + $(MSBuildProjectFile).Signed.txt + $(IntermediateOutputPath)$(SignedFileName) + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + GetMsmsToSign; + InternalSignMsm; + + + GetCabsToSign; + GetMsiToSign; + InternalSignCabs; + InscribeMsi; + InternalSignMsi; + + + GetContainersToSign; + InternalSignContainers; + InscribeBundleEngine; + InternalSignBundleEngine; + InscribeBundle; + InternalSignBundle; + + + + WixBuild; + CalculateSignTargetFiles; + BeforeSigning; + $(InternalSignDependsOn); + AfterSigning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets new file mode 100644 index 00000000..b35d18c7 --- /dev/null +++ b/src/WixToolset.MSBuild/tools/wix.targets @@ -0,0 +1,1060 @@ + + + + + + true + + + + + + + + + + $(MSBuildThisFileDirectory)netcoreapp2.1\ + $(MSBuildThisFileDirectory)net461\ + $(WixBinDir)WixToolset.BuildTasks.dll + $(MSBuildThisFileDirectory)wix.harvest.targets + $(MSBuildThisFileDirectory)wix.signing.targets + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildAllProjects);$(WixHarvestTargetsPath) + $(MSBuildAllProjects);$(WixSigningTargetsPath) + $(MSBuildAllProjects);$(CustomBeforeWixTargets) + $(MSBuildAllProjects);$(CustomAfterWixTargets) + + + + + + .wxs + wix + wix + + + $(MSBuildProjectName) + $(OutputName) + + + Package + + + full + + + + + .msi + .msm + .pcp + .wixlib + .exe + .wixipl + + + + + + + $(TargetDir) + $(PdbOutputDir)\ + + + $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) + + + $(TargetName).wixpdb + + + $(TargetPdbDir)$(TargetPdbFileName) + + + + + + + + + + + + + + + + + $(MSBuildProjectFile).BindContentsFileList.txt + $(MSBuildProjectFile).BindOutputsFileList.txt + $(MSBuildProjectFile).BindBuiltOutputsFileList.txt + + + + $(IntermediateOutputPath)cabcache\ + + + + $(WixBinDir) + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + $(Platform) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + + + + + + + + + + + + + <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. + <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) + + + + + + + + + + + + + + + + + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + + WixBuild; + Signing; + + GetTargetPath; + PrepareForRun; + IncrementalClean; + PostBuildEvent + + + + + + + + + + BeforeResolveReferences; + AssignProjectConfiguration; + ResolveProjectReferences; + ResolveWixLibraryReferences; + ResolveWixExtensionReferences; + AfterResolveReferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssignTargetPaths + + + + + + + + + ResolveReferences; + BeforeCompile; + _TimeStampBeforeCompile; + + CalculateDefineConstants; + Harvest; + + GenerateCompileWithObjectPath; + + AssignTargetPaths; + ReadPreviousBindInputsAndBuiltOutputs; + + CoreWixBuild; + + UpdateLinkFileWrites; + _TimeStampAfterCompile; + AfterCompile + + + + + + + + + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) + + $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) + + + + + + + + + + + ResolveReferences + + + + + + Configuration=$(ConfigurationName); + OutDir=$(OutDir); + Platform=$(PlatformName); + ProjectDir=$(ProjectDir); + ProjectExt=$(ProjectExt); + ProjectFileName=$(ProjectFileName); + ProjectName=$(ProjectName); + ProjectPath=$(ProjectPath); + TargetDir=$(TargetDir); + TargetExt=$(TargetExt); + TargetFileName=$(TargetFileName); + TargetName=$(TargetName); + TargetPath=$(TargetPath); + + + + + $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) + $(SolutionDefineConstants);SolutionDir=$(SolutionDir) + $(SolutionDefineConstants);SolutionExt=$(SolutionExt) + $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) + $(SolutionDefineConstants);SolutionName=$(SolutionName) + $(SolutionDefineConstants);SolutionPath=$(SolutionPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> + <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> + + + + @(_CulturedTargetPath) + @(_CulturedTargetPdbPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(TargetPath) + $(TargetFileName) + + + + + + PrepareForBuild;AssignTargetPaths + + + + + + + + + + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> + + + + + + + %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) + + + + + + + AssignTargetPaths + + + + + + + + + + + + + + + + true + + + + true + true + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) + + + + + + + + + <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> + <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.MSBuild/wix.ca.targets b/src/WixToolset.MSBuild/wix.ca.targets deleted file mode 100644 index 4578c2d8..00000000 --- a/src/WixToolset.MSBuild/wix.ca.targets +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - true - - $(TargetName).CA$(TargetExt) - - $(MSBuildThisFileDirectory) - $(WixSdkPath)x86\ - $(WixSdkPath)x64\ - - $(WixSdkPath)MakeSfxCA.exe - $(WixSdkX64Path)SfxCA.dll - $(WixSdkX86Path)SfxCA.dll - - - - - - - - - - - - - - - - - - - @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.MSBuild/wix.harvest.targets b/src/WixToolset.MSBuild/wix.harvest.targets deleted file mode 100644 index e4d866ea..00000000 --- a/src/WixToolset.MSBuild/wix.harvest.targets +++ /dev/null @@ -1,499 +0,0 @@ - - - - - - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - true - false - true - false - - - - - - false - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - $(IntermediateOutputPath)Product.Generated.wxs - $(IntermediateOutputPath)Bundle.Generated.wxs - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - - ConvertReferences; - ConvertBundleReferences; - HarvestProjects; - HarvestDirectory; - HarvestFile; - GenerateCode; - - - - - - - - RefreshGeneratedFile; - RefreshBundleGeneratedFile - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - %(_MSBuildProjectReferenceExistent.RefTargetDir) - Binaries;Symbols;Sources;Content;Satellites;Documents - %(_MSBuildProjectReferenceExistent.Name) - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - Binaries;Symbols;Sources;Content;Satellites;Documents - payloadgroup - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - - - CombineHarvestProjects - - - - - - - - - - - - - - - - - $(HarvestDirectoryTransforms) - $(HarvestDirectoryComponentGroupName) - $(HarvestDirectoryDirectoryRefId) - $(HarvestDirectoryKeepEmptyDirectories) - $(HarvestDirectoryPreprocessorVariable) - $(HarvestDirectorySuppressCom) - $(HarvestDirectorySuppressRootDirectory) - $(HarvestDirectorySuppressRegistry) - - - - - - GetHarvestDirectoryContent - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestFileTransforms) - $(HarvestFileComponentGroupName) - $(HarvestFileDirectoryRefId) - $(HarvestFilePreprocessorVariable) - $(HarvestFileSuppressCom) - $(HarvestFileSuppressRegistry) - $(HarvestFileSuppressRootDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.MSBuild/wix.signing.targets b/src/WixToolset.MSBuild/wix.signing.targets deleted file mode 100644 index 7c25175f..00000000 --- a/src/WixToolset.MSBuild/wix.signing.targets +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - $(MSBuildProjectFile).Signed.txt - $(IntermediateOutputPath)$(SignedFileName) - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - GetMsmsToSign; - InternalSignMsm; - - - GetCabsToSign; - GetMsiToSign; - InternalSignCabs; - InscribeMsi; - InternalSignMsi; - - - GetContainersToSign; - InternalSignContainers; - InscribeBundleEngine; - InternalSignBundleEngine; - InscribeBundle; - InternalSignBundle; - - - - WixBuild; - CalculateSignTargetFiles; - BeforeSigning; - $(InternalSignDependsOn); - AfterSigning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.MSBuild/wix.targets b/src/WixToolset.MSBuild/wix.targets deleted file mode 100644 index b35d18c7..00000000 --- a/src/WixToolset.MSBuild/wix.targets +++ /dev/null @@ -1,1060 +0,0 @@ - - - - - - true - - - - - - - - - - $(MSBuildThisFileDirectory)netcoreapp2.1\ - $(MSBuildThisFileDirectory)net461\ - $(WixBinDir)WixToolset.BuildTasks.dll - $(MSBuildThisFileDirectory)wix.harvest.targets - $(MSBuildThisFileDirectory)wix.signing.targets - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildAllProjects);$(WixHarvestTargetsPath) - $(MSBuildAllProjects);$(WixSigningTargetsPath) - $(MSBuildAllProjects);$(CustomBeforeWixTargets) - $(MSBuildAllProjects);$(CustomAfterWixTargets) - - - - - - .wxs - wix - wix - - - $(MSBuildProjectName) - $(OutputName) - - - Package - - - full - - - - - .msi - .msm - .pcp - .wixlib - .exe - .wixipl - - - - - - - $(TargetDir) - $(PdbOutputDir)\ - - - $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) - - - $(TargetName).wixpdb - - - $(TargetPdbDir)$(TargetPdbFileName) - - - - - - - - - - - - - - - - - $(MSBuildProjectFile).BindContentsFileList.txt - $(MSBuildProjectFile).BindOutputsFileList.txt - $(MSBuildProjectFile).BindBuiltOutputsFileList.txt - - - - $(IntermediateOutputPath)cabcache\ - - - - $(WixBinDir) - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - $(Platform) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - - - - - - - - - - - - - <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. - <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) - - - - - - - - - - - - - - - - - - - BuildOnlySettings; - PrepareForBuild; - PreBuildEvent; - - WixBuild; - Signing; - - GetTargetPath; - PrepareForRun; - IncrementalClean; - PostBuildEvent - - - - - - - - - - BeforeResolveReferences; - AssignProjectConfiguration; - ResolveProjectReferences; - ResolveWixLibraryReferences; - ResolveWixExtensionReferences; - AfterResolveReferences - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AssignTargetPaths - - - - - - - - - ResolveReferences; - BeforeCompile; - _TimeStampBeforeCompile; - - CalculateDefineConstants; - Harvest; - - GenerateCompileWithObjectPath; - - AssignTargetPaths; - ReadPreviousBindInputsAndBuiltOutputs; - - CoreWixBuild; - - UpdateLinkFileWrites; - _TimeStampAfterCompile; - AfterCompile - - - - - - - - - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) - - $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) - - - - - - - - - - - ResolveReferences - - - - - - Configuration=$(ConfigurationName); - OutDir=$(OutDir); - Platform=$(PlatformName); - ProjectDir=$(ProjectDir); - ProjectExt=$(ProjectExt); - ProjectFileName=$(ProjectFileName); - ProjectName=$(ProjectName); - ProjectPath=$(ProjectPath); - TargetDir=$(TargetDir); - TargetExt=$(TargetExt); - TargetFileName=$(TargetFileName); - TargetName=$(TargetName); - TargetPath=$(TargetPath); - - - - - $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) - $(SolutionDefineConstants);SolutionDir=$(SolutionDir) - $(SolutionDefineConstants);SolutionExt=$(SolutionExt) - $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) - $(SolutionDefineConstants);SolutionName=$(SolutionName) - $(SolutionDefineConstants);SolutionPath=$(SolutionPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> - <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> - - - - @(_CulturedTargetPath) - @(_CulturedTargetPdbPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(TargetPath) - $(TargetFileName) - - - - - - PrepareForBuild;AssignTargetPaths - - - - - - - - - - - - - <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> - - - - - - - %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) - - - - - - - AssignTargetPaths - - - - - - - - - - - - - - - - true - - - - true - true - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) - - - - - - - - - <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> - <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs deleted file mode 100644 index 0768f863..00000000 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildFixture.cs +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.BuildTasks -{ - using System; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.BuildTasks; - using Xunit; - - public class MsbuildFixture - { - private static readonly string WixBinPath = Path.GetDirectoryName(new Uri(typeof(WixBuild).Assembly.CodeBase).AbsolutePath) + "\\"; - private static readonly string WixTargetsPath = Path.Combine(WixBinPath, "wix.targets"); - - [Fact] - public void CanBuildSimpleBundle() - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\SimpleBundle\SimpleBundle.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" - }); - result.AssertSuccess(); - - var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); - Assert.Single(platformSwitches); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(new[] - { - @"bin\SimpleBundle.exe", - @"bin\SimpleBundle.wixpdb", - }, paths); - } - } - - [Fact] - public void CanBuildSimpleMsiPackage() - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" - }); - result.AssertSuccess(); - - var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); - Assert.Single(platformSwitches); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Equal(4, warnings.Count()); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(new[] - { - @"bin\en-US\cab1.cab", - @"bin\en-US\MsiPackage.msi", - @"bin\en-US\MsiPackage.wixpdb", - }, paths); - } - } - - [Fact] - public void CanBuildWithDefaultAndExplicitlyFullWixpdbs() - { - var expectedOutputs = new[] - { - @"bin\en-US\cab1.cab", - @"bin\en-US\MsiPackage.msi", - @"bin\en-US\MsiPackage.wixpdb", - }; - - this.AssertWixpdb(null, expectedOutputs); - this.AssertWixpdb("Full", expectedOutputs); - } - - [Fact] - public void CanBuildWithNoWixpdb() - { - this.AssertWixpdb("NONE", new[] - { - @"bin\en-US\cab1.cab", - @"bin\en-US\MsiPackage.msi", - }); - } - - private void AssertWixpdb(string wixpdbType, string[] expectedOutputFiles) - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", - }); - result.AssertSuccess(); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(expectedOutputFiles, paths); - } - } - - [Fact] - public void CanBuild64BitMsiPackage() - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", - $"-p:InstallerPlatform=x64", - }); - result.AssertSuccess(); - - var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64")); - Assert.Single(platformSwitches); - } - } - - [Fact(Skip = "Currently fails")] - public void CanBuildSimpleMsiPackageWithIceSuppressions() - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", - "-p:SuppressIces=\"ICE45;ICE46\"" - }); - result.AssertSuccess(); - } - } - - [Fact] - public void CanBuildSimpleMsiPackageWithWarningSuppressions() - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", - "-p:SuppressSpecificWarnings=\"1118;1102\"" - }); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - } - } - - [Fact] - public void CanBuildSimpleMsiPackageAsWixipl() - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", - "-p:OutputType=IntermediatePostLink" - }); - result.AssertSuccess(); - - var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .Single(); - Assert.Equal(@"bin\MsiPackage.wixipl", path); - } - } - - [Fact] - public void CanBuildAndCleanSimpleMsiPackage() - { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - // Build - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", - "-v:diag" - }); - result.AssertSuccess(); - - var buildOutput = String.Join("\r\n", result.Output); - - var createdPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.NotEmpty(createdPaths); - - // Clean - result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", - "-t:Clean", - "-v:diag" - }); - result.AssertSuccess(); - - var cleanOutput = String.Join("\r\n", result.Output); - - // Clean is only expected to delete the files listed in {Project}.FileListAbsolute.txt, - // so this is not quite right but close enough. - var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .Where(s => s != "obj\\MsiPackage.wixproj.FileListAbsolute.txt") - .OrderBy(s => s) - .ToArray(); - Assert.Empty(remainingPaths); - } - } - } -} diff --git a/src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs deleted file mode 100644 index 95805658..00000000 --- a/src/test/WixToolsetTest.BuildTasks/MsbuildHeatFixture.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.BuildTasks -{ - using System; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.BuildTasks; - using WixToolset.Core.TestPackage; - using WixToolset.Data; - using WixToolset.Data.Tuples; - using Xunit; - - public class MsbuildHeatFixture - { - private static readonly string WixBinPath = Path.GetDirectoryName(new Uri(typeof(WixBuild).Assembly.CodeBase).AbsolutePath) + "\\"; - private static readonly string WixTargetsPath = Path.Combine(WixBinPath, "wix.targets"); - - [Fact] - public void CanBuildHeatFilePackage() - { - var projectPath = TestData.Get(@"TestData\HeatFilePackage\HeatFilePackage.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" - }); - result.AssertSuccess(); - - var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); - Assert.Single(heatCommandLines); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, @"_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal(@"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "HeatFilePackage.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); - } - } - - [Fact] - public void CanBuildHeatFileWithMultipleFilesPackage() - { - var projectPath = TestData.Get(@"TestData\HeatFileMultpleFilesSameFileName\HeatFileMultpleFilesSameFileName.wixproj"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:WixBinDir={WixBinPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" - }); - result.AssertSuccess(); - - var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); - Assert.Equal(2, heatCommandLines.Count()); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, @"_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal("" + - "" + - "" + - "" + - @"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - generatedFilePath = Path.Combine(intermediateFolder, @"_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - generatedContents = File.ReadAllText(generatedFilePath); - testXml = generatedContents.GetTestXml(); - Assert.Equal("" + - "" + - "" + - "" + - @"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "HeatFileMultpleFilesSameFileName.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileTuples = section.Tuples.OfType().ToArray(); - Assert.Equal(@"SourceDir\MyProgram.txt", fileTuples[0][FileTupleFields.Source].PreviousValue.AsPath().Path); - Assert.Equal(@"SourceDir\MyProgram.json", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path); - } - } - } -} diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj deleted file mode 100644 index 860fc2dd..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/HeatFileMultpleFilesSameFileName.wixproj +++ /dev/null @@ -1,61 +0,0 @@ - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - - - - - TxtProductComponents - INSTALLFOLDER - true - - - JsonProductComponents - INSTALLFOLDER - true - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json deleted file mode 100644 index 5f282702..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.json +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt deleted file mode 100644 index 5f282702..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/MyProgram.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs deleted file mode 100644 index 884da274..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFileMultpleFilesSameFileName/Package.wxs +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/HeatFilePackage.wixproj deleted file mode 100644 index 87f4388a..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/HeatFilePackage.wixproj +++ /dev/null @@ -1,56 +0,0 @@ - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - - - - - ProductComponents - INSTALLFOLDER - true - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/Package.wxs deleted file mode 100644 index e509c464..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/HeatFilePackage/Package.wxs +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj deleted file mode 100644 index e04ea43d..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null @@ -1,57 +0,0 @@ - - - - Debug - x86 - 0.9 - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - MsiPackage - Package - MsiPackage - MsiPackage - en-US,en;de-DE - - - - ..\..\..\..\..\..\build\Release\publish\net461\wix.targets - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl deleted file mode 100644 index 23493ace..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - German DowngradeError - German FeatureTitle - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - A newer version of [ProductName] is already installed. - MsiPackage - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs deleted file mode 100644 index d5a5a40d..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs deleted file mode 100644 index e26c4509..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln deleted file mode 100644 index 2c88704e..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} - EndGlobalSection -EndGlobal diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj deleted file mode 100644 index d5cac8d8..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null @@ -1,49 +0,0 @@ - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - A newer version of [ProductName] is already installed. - MsiPackage - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs deleted file mode 100644 index f7998fff..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs deleted file mode 100644 index ddb95faf..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/MsiPackage/data/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs deleted file mode 100644 index 6cd04712..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj deleted file mode 100644 index 4c837936..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - Debug - x86 - - - - 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d - Bundle - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln deleted file mode 100644 index dd21489d..00000000 --- a/src/test/WixToolsetTest.BuildTasks/TestData/SimpleMsiPackage/SimpleMsiPackage.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30011.22 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" -EndProject -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SimpleBundle", "SimpleBundle\SimpleBundle.wixproj", "{6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x64.ActiveCfg = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.ActiveCfg = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.Build.0 = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x64.ActiveCfg = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.ActiveCfg = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} - EndGlobalSection -EndGlobal diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 9fb2bc82..22d421de 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -10,31 +10,16 @@ - - - - - - - - - - - - - - - - - - - + + + + - - - + + + diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs new file mode 100644 index 00000000..85f111a9 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -0,0 +1,293 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.MSBuild +{ + using System; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + using Xunit; + + public class MsbuildFixture + { + private static readonly string WixTargetsPath = Path.Combine(new Uri(typeof(MsbuildFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "tools", "wix.targets"); + + [Fact] + public void CanBuildSimpleBundle() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\SimpleBundle\SimpleBundle.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}" + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); + Assert.Single(platformSwitches); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\SimpleBundle.exe", + @"bin\SimpleBundle.wixpdb", + }, paths); + } + } + + [Fact] + public void CanBuildSimpleMsiPackage() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}" + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); + Assert.Single(platformSwitches); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Equal(4, warnings.Count()); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\en-US\cab1.cab", + @"bin\en-US\MsiPackage.msi", + @"bin\en-US\MsiPackage.wixpdb", + }, paths); + } + } + + [Fact] + public void CanBuildWithDefaultAndExplicitlyFullWixpdbs() + { + var expectedOutputs = new[] + { + @"bin\en-US\cab1.cab", + @"bin\en-US\MsiPackage.msi", + @"bin\en-US\MsiPackage.wixpdb", + }; + + this.AssertWixpdb(null, expectedOutputs); + this.AssertWixpdb("Full", expectedOutputs); + } + + [Fact] + public void CanBuildWithNoWixpdb() + { + this.AssertWixpdb("NONE", new[] + { + @"bin\en-US\cab1.cab", + @"bin\en-US\MsiPackage.msi", + }); + } + + private void AssertWixpdb(string wixpdbType, string[] expectedOutputFiles) + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + }); + result.AssertSuccess(); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(expectedOutputFiles, paths); + } + } + + [Fact] + public void CanBuild64BitMsiPackage() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + $"-p:InstallerPlatform=x64", + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64")); + Assert.Single(platformSwitches); + } + } + + [Fact(Skip = "Currently fails")] + public void CanBuildSimpleMsiPackageWithIceSuppressions() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-p:SuppressIces=\"ICE45;ICE46\"" + }); + result.AssertSuccess(); + } + } + + [Fact] + public void CanBuildSimpleMsiPackageWithWarningSuppressions() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-p:SuppressSpecificWarnings=\"1118;1102\"" + }); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + } + } + + [Fact] + public void CanBuildSimpleMsiPackageAsWixipl() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-p:OutputType=IntermediatePostLink" + }); + result.AssertSuccess(); + + var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .Single(); + Assert.Equal(@"bin\MsiPackage.wixipl", path); + } + } + + [Fact] + public void CanBuildAndCleanSimpleMsiPackage() + { + var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + // Build + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-v:diag" + }); + result.AssertSuccess(); + + var buildOutput = String.Join("\r\n", result.Output); + + var createdPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.NotEmpty(createdPaths); + + // Clean + result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}", + "-t:Clean", + "-v:diag" + }); + result.AssertSuccess(); + + var cleanOutput = String.Join("\r\n", result.Output); + + // Clean is only expected to delete the files listed in {Project}.FileListAbsolute.txt, + // so this is not quite right but close enough. + var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .Where(s => s != "obj\\MsiPackage.wixproj.FileListAbsolute.txt") + .OrderBy(s => s) + .ToArray(); + Assert.Empty(remainingPaths); + } + } + } +} diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs new file mode 100644 index 00000000..fa8acb81 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -0,0 +1,151 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.MSBuild +{ + using System; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.Data; + using WixToolset.Data.Tuples; + using Xunit; + + public class MsbuildHeatFixture + { + private static readonly string WixTargetsPath = Path.Combine(new Uri(typeof(MsbuildHeatFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "tools", "wix.targets"); + + [Fact] + public void CanBuildHeatFilePackage() + { + var projectPath = TestData.Get(@"TestData\HeatFilePackage\HeatFilePackage.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}" + }); + result.AssertSuccess(); + + var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); + Assert.Single(heatCommandLines); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, @"_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal(@"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "HeatFilePackage.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileTuple = section.Tuples.OfType().Single(); + Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + } + } + + [Fact] + public void CanBuildHeatFileWithMultipleFilesPackage() + { + var projectPath = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName\HeatFileMultipleFilesSameFileName.wixproj"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + + var result = MsbuildRunner.Execute(projectPath, new[] + { + $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:IntermediateOutputPath={intermediateFolder}", + $"-p:OutputPath={binFolder}" + }); + result.AssertSuccess(); + + var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); + Assert.Equal(2, heatCommandLines.Count()); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, @"_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + generatedFilePath = Path.Combine(intermediateFolder, @"_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + generatedContents = File.ReadAllText(generatedFilePath); + testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "HeatFileMultipleFilesSameFileName.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileTuples = section.Tuples.OfType().ToArray(); + Assert.Equal(@"SourceDir\MyProgram.txt", fileTuples[0][FileTupleFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(@"SourceDir\MyProgram.json", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path); + } + } + } +} diff --git a/src/test/WixToolsetTest.MSBuild/README.md b/src/test/WixToolsetTest.MSBuild/README.md new file mode 100644 index 00000000..7faf34b9 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/README.md @@ -0,0 +1,5 @@ +In order to properly test wix.targets, +all of the supported architectures for WixToolset.BuildTasks need to be available in the layout used in the Nuget package. +Making this happen on every build for the solution takes too long, +so this project relies on manually running appveyor.cmd to publish everything before the tests can be run. +appveyor.cmd needs to be ran again every time changes are made in other projects, including the targets themselves. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj new file mode 100644 index 00000000..860fc2dd --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj @@ -0,0 +1,61 @@ + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + + + + + TxtProductComponents + INSTALLFOLDER + true + + + JsonProductComponents + INSTALLFOLDER + true + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs new file mode 100644 index 00000000..884da274 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj new file mode 100644 index 00000000..87f4388a --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj @@ -0,0 +1,56 @@ + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + + + + + ProductComponents + INSTALLFOLDER + true + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs new file mode 100644 index 00000000..e509c464 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..e04ea43d --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,57 @@ + + + + Debug + x86 + 0.9 + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + MsiPackage + Package + MsiPackage + MsiPackage + en-US,en;de-DE + + + + ..\..\..\..\..\..\build\Release\publish\net461\wix.targets + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl new file mode 100644 index 00000000..23493ace --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl @@ -0,0 +1,11 @@ + + + + + + German DowngradeError + German FeatureTitle + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..d5a5a40d --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln new file mode 100644 index 00000000..2c88704e --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..d5cac8d8 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,49 @@ + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..f7998fff --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..ddb95faf --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs new file mode 100644 index 00000000..6cd04712 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj new file mode 100644 index 00000000..4c837936 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj @@ -0,0 +1,45 @@ + + + + Debug + x86 + + + + 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d + Bundle + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln new file mode 100644 index 00000000..dd21489d --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln @@ -0,0 +1,39 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SimpleBundle", "SimpleBundle\SimpleBundle.wixproj", "{6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x64.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.Build.0 = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x64.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj new file mode 100644 index 00000000..bb109557 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj @@ -0,0 +1,43 @@ + + + + + + net461 + false + embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb From d57dad051e9c15919646fb9e4fb320003ba839da Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 30 May 2020 18:55:35 +1000 Subject: Change MSBuild tests to use the default intermediate and output folders. --- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 137 +++++++++++---------- .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 30 ++--- 2 files changed, 89 insertions(+), 78 deletions(-) diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 85f111a9..abb8673d 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -3,6 +3,7 @@ namespace WixToolsetTest.MSBuild { using System; + using System.Collections.Generic; using System.IO; using System.Linq; using WixBuildTools.TestSupport; @@ -15,19 +16,18 @@ namespace WixToolsetTest.MSBuild [Fact] public void CanBuildSimpleBundle() { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\SimpleBundle\SimpleBundle.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "SimpleBundle"); var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" }); result.AssertSuccess(); @@ -43,8 +43,8 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\SimpleBundle.exe", - @"bin\SimpleBundle.wixpdb", + @"bin\x86\Debug\SimpleBundle.exe", + @"bin\x86\Debug\SimpleBundle.wixpdb", }, paths); } } @@ -52,19 +52,18 @@ namespace WixToolsetTest.MSBuild [Fact] public void CanBuildSimpleMsiPackage() { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" }); result.AssertSuccess(); @@ -80,9 +79,9 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\en-US\cab1.cab", - @"bin\en-US\MsiPackage.msi", - @"bin\en-US\MsiPackage.wixpdb", + @"bin\x86\Debug\en-US\cab1.cab", + @"bin\x86\Debug\en-US\MsiPackage.msi", + @"bin\x86\Debug\en-US\MsiPackage.wixpdb", }, paths); } } @@ -92,9 +91,9 @@ namespace WixToolsetTest.MSBuild { var expectedOutputs = new[] { - @"bin\en-US\cab1.cab", - @"bin\en-US\MsiPackage.msi", - @"bin\en-US\MsiPackage.wixpdb", + @"bin\x86\Debug\en-US\cab1.cab", + @"bin\x86\Debug\en-US\MsiPackage.msi", + @"bin\x86\Debug\en-US\MsiPackage.wixpdb", }; this.AssertWixpdb(null, expectedOutputs); @@ -106,27 +105,26 @@ namespace WixToolsetTest.MSBuild { this.AssertWixpdb("NONE", new[] { - @"bin\en-US\cab1.cab", - @"bin\en-US\MsiPackage.msi", + @"bin\x86\Debug\en-US\cab1.cab", + @"bin\x86\Debug\en-US\MsiPackage.msi", }); } private void AssertWixpdb(string wixpdbType, string[] expectedOutputFiles) { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", }); result.AssertSuccess(); @@ -141,44 +139,53 @@ namespace WixToolsetTest.MSBuild [Fact] public void CanBuild64BitMsiPackage() { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", $"-p:InstallerPlatform=x64", }); result.AssertSuccess(); var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x64")); Assert.Single(platformSwitches); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Debug\en-US\cab1.cab", + @"bin\x86\Debug\en-US\MsiPackage.msi", + @"bin\x86\Debug\en-US\MsiPackage.wixpdb", + }, paths); } } [Fact(Skip = "Currently fails")] public void CanBuildSimpleMsiPackageWithIceSuppressions() { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", "-p:SuppressIces=\"ICE45;ICE46\"" }); result.AssertSuccess(); @@ -188,19 +195,18 @@ namespace WixToolsetTest.MSBuild [Fact] public void CanBuildSimpleMsiPackageWithWarningSuppressions() { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", "-p:SuppressSpecificWarnings=\"1118;1102\"" }); result.AssertSuccess(); @@ -213,19 +219,18 @@ namespace WixToolsetTest.MSBuild [Fact] public void CanBuildSimpleMsiPackageAsWixipl() { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", "-p:OutputType=IntermediatePostLink" }); result.AssertSuccess(); @@ -233,27 +238,25 @@ namespace WixToolsetTest.MSBuild var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) .Select(s => s.Substring(baseFolder.Length + 1)) .Single(); - Assert.Equal(@"bin\MsiPackage.wixipl", path); + Assert.Equal(@"bin\x86\Debug\MsiPackage.wixipl", path); } } [Fact] public void CanBuildAndCleanSimpleMsiPackage() { - var projectPath = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage\MsiPackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); // Build var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", "-v:diag" }); result.AssertSuccess(); @@ -270,8 +273,6 @@ namespace WixToolsetTest.MSBuild result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}", "-t:Clean", "-v:diag" }); @@ -281,9 +282,19 @@ namespace WixToolsetTest.MSBuild // Clean is only expected to delete the files listed in {Project}.FileListAbsolute.txt, // so this is not quite right but close enough. + var allowedFiles = new HashSet + { + "MsiPackage.wixproj", + "Package.en-us.wxl", + "Package.wxs", + "PackageComponents.wxs", + @"data\test.txt", + @"obj\x86\Debug\MsiPackage.wixproj.FileListAbsolute.txt", + }; + var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) .Select(s => s.Substring(baseFolder.Length + 1)) - .Where(s => s != "obj\\MsiPackage.wixproj.FileListAbsolute.txt") + .Where(s => !allowedFiles.Contains(s)) .OrderBy(s => s) .ToArray(); Assert.Empty(remainingPaths); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index fa8acb81..b5331cbc 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -18,19 +18,19 @@ namespace WixToolsetTest.MSBuild [Fact] public void CanBuildHeatFilePackage() { - var projectPath = TestData.Get(@"TestData\HeatFilePackage\HeatFilePackage.wixproj"); + var sourceFolder = TestData.Get(@"TestData\HeatFilePackage"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatFilePackage.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" }); result.AssertSuccess(); @@ -40,7 +40,7 @@ namespace WixToolsetTest.MSBuild var warnings = result.Output.Where(line => line.Contains(": warning")); Assert.Empty(warnings); - var generatedFilePath = Path.Combine(intermediateFolder, @"_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); Assert.True(File.Exists(generatedFilePath)); var generatedContents = File.ReadAllText(generatedFilePath); @@ -60,7 +60,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - var pdbPath = Path.Combine(binFolder, "HeatFilePackage.wixpdb"); + var pdbPath = Path.Combine(binFolder, "x86", "Debug", "HeatFilePackage.wixpdb"); Assert.True(File.Exists(pdbPath)); var intermediate = Intermediate.Load(pdbPath); @@ -74,19 +74,19 @@ namespace WixToolsetTest.MSBuild [Fact] public void CanBuildHeatFileWithMultipleFilesPackage() { - var projectPath = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName\HeatFileMultipleFilesSameFileName.wixproj"); + var sourceFolder = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName"); - using (var fs = new DisposableFileSystem()) + using (var fs = new TestDataFolderFileSystem()) { - var baseFolder = fs.GetFolder(); + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; var binFolder = Path.Combine(baseFolder, @"bin\"); var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatFileMultipleFilesSameFileName.wixproj"); var result = MsbuildRunner.Execute(projectPath, new[] { $"-p:WixTargetsPath={WixTargetsPath}", - $"-p:IntermediateOutputPath={intermediateFolder}", - $"-p:OutputPath={binFolder}" }); result.AssertSuccess(); @@ -96,7 +96,7 @@ namespace WixToolsetTest.MSBuild var warnings = result.Output.Where(line => line.Contains(": warning")); Assert.Empty(warnings); - var generatedFilePath = Path.Combine(intermediateFolder, @"_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); Assert.True(File.Exists(generatedFilePath)); var generatedContents = File.ReadAllText(generatedFilePath); @@ -116,7 +116,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - generatedFilePath = Path.Combine(intermediateFolder, @"_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); + generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); Assert.True(File.Exists(generatedFilePath)); generatedContents = File.ReadAllText(generatedFilePath); @@ -136,7 +136,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - var pdbPath = Path.Combine(binFolder, "HeatFileMultipleFilesSameFileName.wixpdb"); + var pdbPath = Path.Combine(binFolder, "x86", "Debug", "HeatFileMultipleFilesSameFileName.wixpdb"); Assert.True(File.Exists(pdbPath)); var intermediate = Intermediate.Load(pdbPath); -- cgit v1.2.3-55-g6feb From 05ee2175b44c68816c24a33a16861a637fa15ad7 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 30 May 2020 18:55:57 +1000 Subject: Update MSBuild tests to use WixToolset.MSBuild.props to find wix.targets. --- src/ThmViewerPackage/ThmViewerPackage.wixproj | 4 ++-- src/Wix.Build.props | 2 ++ src/WixToolset.MSBuild/WixToolset.MSBuild.csproj | 1 + src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 2 +- src/WixToolset.MSBuild/WixToolset.MSBuild.props | 8 -------- .../build/WixToolset.MSBuild.props | 8 ++++++++ src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 20 ++++++++++---------- .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 6 +++--- .../HeatFileMultipleFilesSameFileName.wixproj | 7 ++----- .../TestData/HeatFilePackage/HeatFilePackage.wixproj | 7 ++----- .../MsiPackage/MsiPackage.wixproj | 11 ++--------- .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 7 ++----- .../SimpleBundle/SimpleBundle.wixproj | 7 ++----- 13 files changed, 37 insertions(+), 53 deletions(-) delete mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.props create mode 100644 src/WixToolset.MSBuild/build/WixToolset.MSBuild.props diff --git a/src/ThmViewerPackage/ThmViewerPackage.wixproj b/src/ThmViewerPackage/ThmViewerPackage.wixproj index 212d1bae..9811782c 100644 --- a/src/ThmViewerPackage/ThmViewerPackage.wixproj +++ b/src/ThmViewerPackage/ThmViewerPackage.wixproj @@ -1,6 +1,6 @@ - + 59c4b122-5167-445b-8fc4-09dcd4eced89 @@ -23,7 +23,7 @@ - + diff --git a/src/Wix.Build.props b/src/Wix.Build.props index 936126e3..bf286bb4 100644 --- a/src/Wix.Build.props +++ b/src/Wix.Build.props @@ -9,4 +9,6 @@ + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj index 2d5ea01b..ba67660c 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj @@ -12,6 +12,7 @@ + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index ff0d74ee..be04d21b 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -11,7 +11,7 @@ - + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/WixToolset.MSBuild.props deleted file mode 100644 index b453361b..00000000 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) - - diff --git a/src/WixToolset.MSBuild/build/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/build/WixToolset.MSBuild.props new file mode 100644 index 00000000..b453361b --- /dev/null +++ b/src/WixToolset.MSBuild/build/WixToolset.MSBuild.props @@ -0,0 +1,8 @@ + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) + + diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index abb8673d..4a831061 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -11,7 +11,7 @@ namespace WixToolsetTest.MSBuild public class MsbuildFixture { - private static readonly string WixTargetsPath = Path.Combine(new Uri(typeof(MsbuildFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "tools", "wix.targets"); + private static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); [Fact] public void CanBuildSimpleBundle() @@ -27,7 +27,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", }); result.AssertSuccess(); @@ -63,7 +63,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", }); result.AssertSuccess(); @@ -124,7 +124,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", }); result.AssertSuccess(); @@ -150,7 +150,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", $"-p:InstallerPlatform=x64", }); result.AssertSuccess(); @@ -185,7 +185,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", "-p:SuppressIces=\"ICE45;ICE46\"" }); result.AssertSuccess(); @@ -206,7 +206,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", "-p:SuppressSpecificWarnings=\"1118;1102\"" }); result.AssertSuccess(); @@ -230,7 +230,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", "-p:OutputType=IntermediatePostLink" }); result.AssertSuccess(); @@ -256,7 +256,7 @@ namespace WixToolsetTest.MSBuild // Build var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", "-v:diag" }); result.AssertSuccess(); @@ -272,7 +272,7 @@ namespace WixToolsetTest.MSBuild // Clean result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", "-t:Clean", "-v:diag" }); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index b5331cbc..58a3d333 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -13,7 +13,7 @@ namespace WixToolsetTest.MSBuild public class MsbuildHeatFixture { - private static readonly string WixTargetsPath = Path.Combine(new Uri(typeof(MsbuildHeatFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "tools", "wix.targets"); + private static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildHeatFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); [Fact] public void CanBuildHeatFilePackage() @@ -30,7 +30,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", }); result.AssertSuccess(); @@ -86,7 +86,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildRunner.Execute(projectPath, new[] { - $"-p:WixTargetsPath={WixTargetsPath}", + $"-p:WixMSBuildProps={WixPropsPath}", }); result.AssertSuccess(); diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj index 860fc2dd..7d751319 100644 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj @@ -1,5 +1,6 @@ + Debug x86 @@ -53,9 +54,5 @@ - - - - - + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj index 87f4388a..3988acaf 100644 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj +++ b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj @@ -1,5 +1,6 @@ + Debug x86 @@ -48,9 +49,5 @@ - - - - - + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj index e04ea43d..555addbe 100644 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj +++ b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj @@ -1,5 +1,6 @@  + Debug x86 @@ -12,10 +13,6 @@ en-US,en;de-DE - - ..\..\..\..\..\..\build\Release\publish\net461\wix.targets - - $(Platform) bin\$(Platform)\$(Configuration)\ @@ -49,9 +46,5 @@ - - - - - + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj index d5cac8d8..18ae08b2 100644 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj @@ -1,5 +1,6 @@ + Debug x86 @@ -41,9 +42,5 @@ - - - - - + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj index 4c837936..199eb6d9 100644 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj +++ b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj @@ -1,5 +1,6 @@ + Debug x86 @@ -37,9 +38,5 @@ - - - - - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 0fbada441640a27352935edc43e1ea16c7a4d8f8 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 30 May 2020 18:56:15 +1000 Subject: Update all MSBuild tests to run on x86 and x64 MSBuild. --- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 113 +++++++++++---------- .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 24 ++--- .../WixToolsetTest.MSBuild/MsbuildUtilities.cs | 46 +++++++++ 3 files changed, 114 insertions(+), 69 deletions(-) create mode 100644 src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 4a831061..3515b314 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -11,10 +11,10 @@ namespace WixToolsetTest.MSBuild public class MsbuildFixture { - private static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); - - [Fact] - public void CanBuildSimpleBundle() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleBundle(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); @@ -25,10 +25,7 @@ namespace WixToolsetTest.MSBuild var binFolder = Path.Combine(baseFolder, @"bin\"); var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixMSBuildProps={WixPropsPath}", - }); + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); @@ -49,8 +46,10 @@ namespace WixToolsetTest.MSBuild } } - [Fact] - public void CanBuildSimpleMsiPackage() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -61,10 +60,7 @@ namespace WixToolsetTest.MSBuild var binFolder = Path.Combine(baseFolder, @"bin\"); var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixMSBuildProps={WixPropsPath}", - }); + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); @@ -86,8 +82,10 @@ namespace WixToolsetTest.MSBuild } } - [Fact] - public void CanBuildWithDefaultAndExplicitlyFullWixpdbs() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) { var expectedOutputs = new[] { @@ -96,21 +94,23 @@ namespace WixToolsetTest.MSBuild @"bin\x86\Debug\en-US\MsiPackage.wixpdb", }; - this.AssertWixpdb(null, expectedOutputs); - this.AssertWixpdb("Full", expectedOutputs); + this.AssertWixpdb(buildSystem, null, expectedOutputs); + this.AssertWixpdb(buildSystem, "Full", expectedOutputs); } - [Fact] - public void CanBuildWithNoWixpdb() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildWithNoWixpdb(BuildSystem buildSystem) { - this.AssertWixpdb("NONE", new[] + this.AssertWixpdb(buildSystem, "NONE", new[] { @"bin\x86\Debug\en-US\cab1.cab", @"bin\x86\Debug\en-US\MsiPackage.msi", }); } - private void AssertWixpdb(string wixpdbType, string[] expectedOutputFiles) + private void AssertWixpdb(BuildSystem buildSystem, string wixpdbType, string[] expectedOutputFiles) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -121,10 +121,9 @@ namespace WixToolsetTest.MSBuild var binFolder = Path.Combine(baseFolder, @"bin\"); var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", - $"-p:WixMSBuildProps={WixPropsPath}", }); result.AssertSuccess(); @@ -136,8 +135,10 @@ namespace WixToolsetTest.MSBuild } } - [Fact] - public void CanBuild64BitMsiPackage() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuild64BitMsiPackage(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -148,10 +149,9 @@ namespace WixToolsetTest.MSBuild var binFolder = Path.Combine(baseFolder, @"bin\"); var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - $"-p:WixMSBuildProps={WixPropsPath}", - $"-p:InstallerPlatform=x64", + $"-p:Platform=x64", }); result.AssertSuccess(); @@ -164,15 +164,17 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\en-US\cab1.cab", - @"bin\x86\Debug\en-US\MsiPackage.msi", - @"bin\x86\Debug\en-US\MsiPackage.wixpdb", + @"bin\x64\Debug\en-US\cab1.cab", + @"bin\x64\Debug\en-US\MsiPackage.msi", + @"bin\x64\Debug\en-US\MsiPackage.wixpdb", }, paths); } } - [Fact(Skip = "Currently fails")] - public void CanBuildSimpleMsiPackageWithIceSuppressions() + [Theory(Skip = "Currently fails")] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithIceSuppressions(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -183,17 +185,18 @@ namespace WixToolsetTest.MSBuild var binFolder = Path.Combine(baseFolder, @"bin\"); var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - $"-p:WixMSBuildProps={WixPropsPath}", - "-p:SuppressIces=\"ICE45;ICE46\"" + "-p:SuppressIces=\"ICE45;ICE46\"", }); result.AssertSuccess(); } } - [Fact] - public void CanBuildSimpleMsiPackageWithWarningSuppressions() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithWarningSuppressions(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -204,10 +207,9 @@ namespace WixToolsetTest.MSBuild var binFolder = Path.Combine(baseFolder, @"bin\"); var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - $"-p:WixMSBuildProps={WixPropsPath}", - "-p:SuppressSpecificWarnings=\"1118;1102\"" + "-p:SuppressSpecificWarnings=\"1118;1102\"", }); result.AssertSuccess(); @@ -216,8 +218,10 @@ namespace WixToolsetTest.MSBuild } } - [Fact] - public void CanBuildSimpleMsiPackageAsWixipl() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -228,10 +232,9 @@ namespace WixToolsetTest.MSBuild var binFolder = Path.Combine(baseFolder, @"bin\"); var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - $"-p:WixMSBuildProps={WixPropsPath}", - "-p:OutputType=IntermediatePostLink" + "-p:OutputType=IntermediatePostLink", }); result.AssertSuccess(); @@ -242,8 +245,10 @@ namespace WixToolsetTest.MSBuild } } - [Fact] - public void CanBuildAndCleanSimpleMsiPackage() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildAndCleanSimpleMsiPackage(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -254,10 +259,9 @@ namespace WixToolsetTest.MSBuild var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); // Build - var result = MsbuildRunner.Execute(projectPath, new[] + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - $"-p:WixMSBuildProps={WixPropsPath}", - "-v:diag" + "-v:diag", }); result.AssertSuccess(); @@ -270,11 +274,10 @@ namespace WixToolsetTest.MSBuild Assert.NotEmpty(createdPaths); // Clean - result = MsbuildRunner.Execute(projectPath, new[] + result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - $"-p:WixMSBuildProps={WixPropsPath}", "-t:Clean", - "-v:diag" + "-v:diag", }); result.AssertSuccess(); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index 58a3d333..63c83bc7 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -13,10 +13,10 @@ namespace WixToolsetTest.MSBuild public class MsbuildHeatFixture { - private static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildHeatFixture).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); - - [Fact] - public void CanBuildHeatFilePackage() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildHeatFilePackage(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\HeatFilePackage"); @@ -28,10 +28,7 @@ namespace WixToolsetTest.MSBuild var intermediateFolder = Path.Combine(baseFolder, @"obj\"); var projectPath = Path.Combine(baseFolder, "HeatFilePackage.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixMSBuildProps={WixPropsPath}", - }); + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); @@ -71,8 +68,10 @@ namespace WixToolsetTest.MSBuild } } - [Fact] - public void CanBuildHeatFileWithMultipleFilesPackage() + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildHeatFileWithMultipleFilesPackage(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName"); @@ -84,10 +83,7 @@ namespace WixToolsetTest.MSBuild var intermediateFolder = Path.Combine(baseFolder, @"obj\"); var projectPath = Path.Combine(baseFolder, "HeatFileMultipleFilesSameFileName.wixproj"); - var result = MsbuildRunner.Execute(projectPath, new[] - { - $"-p:WixMSBuildProps={WixPropsPath}", - }); + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); var heatCommandLines = result.Output.Where(line => line.TrimStart().StartsWith("heat.exe file")); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs new file mode 100644 index 00000000..d4815bde --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs @@ -0,0 +1,46 @@ +// Copyright(c) .NET Foundation and contributors.All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.MSBuild +{ + using System; + using System.Collections.Generic; + using System.IO; + using WixBuildTools.TestSupport; + + public enum BuildSystem + { + MSBuild, + MSBuild64, + } + + public static class MsbuildUtilities + { + public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); + + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, params string[] arguments) + { + var allArgs = new List + { + $"-p:WixMSBuildProps={MsbuildUtilities.WixPropsPath}", + }; + + if (arguments != null) + { + allArgs.AddRange(arguments); + } + + switch (buildSystem) + { + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); + } + default: + { + throw new NotImplementedException(); + } + } + } + } +} -- cgit v1.2.3-55-g6feb From ba0069bf9572d26a9deac77bac3613bc2f96e01a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 30 May 2020 23:01:11 +1000 Subject: Provide x86 and x64 versions of net461 build tasks. --- appveyor.cmd | 3 +- .../WixToolset.BuildTasks.csproj | 1 + src/WixToolset.MSBuild/tools/wix.targets | 40 ++++++++++--- src/heat/heat.csproj | 1 - src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 68 ++++++++++++++++++++++ .../MergeMsiPackage/MergeMsiPackage.wixproj | 44 ++++++++++++++ .../MergeModule/MergeMsiPackage/Package.wxs | 22 +++++++ .../MergeModule/SimpleMergeModule/MergeModule.wxs | 22 +++++++ .../SimpleMergeModule/SimpleMergeModule.wixproj | 42 +++++++++++++ .../SimpleMergeModule/data/MergeModule.txt | 1 + .../WixToolsetTest.MSBuild.csproj | 5 ++ src/wix/wix.csproj | 1 - src/wixcop/WixCop.csproj | 1 - 13 files changed, 239 insertions(+), 12 deletions(-) create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj create mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt diff --git a/appveyor.cmd b/appveyor.cmd index e04f0de2..36565551 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -12,7 +12,8 @@ dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix @rem dotnet publish -c %_C% -o %_P%\netfx-heat\ -f net461 src\heat @rem dotnet publish -c %_C% -o %_P%\netfx-wix\ -f net461 src\wix @rem dotnet publish -c %_C% -o %_P%\netfx-wixcop\ -f net461 src\wixcop -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\ -f net461 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\WixToolset.BuildTasks dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index a8363e7b..221478ed 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -9,6 +9,7 @@ embedded true win-x86 + AnyCPU diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets index b35d18c7..62414017 100644 --- a/src/WixToolset.MSBuild/tools/wix.targets +++ b/src/WixToolset.MSBuild/tools/wix.targets @@ -20,8 +20,13 @@ $(MSBuildThisFileDirectory)netcoreapp2.1\ - $(MSBuildThisFileDirectory)net461\ + $(MSBuildThisFileDirectory)net461\x86\ + $(MSBuildThisFileDirectory)net461\x64\ $(WixBinDir)WixToolset.BuildTasks.dll + $(WixBinDir64)WixToolset.BuildTasks.dll + + + $(MSBuildThisFileDirectory)wix.harvest.targets $(MSBuildThisFileDirectory)wix.signing.targets @@ -99,15 +104,34 @@ --> - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectFile).BindContentsFileList.txt diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index f6548e65..c2dc5116 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -11,7 +11,6 @@ true win-x86 - AnyCPU app.config heat.exe.manifest diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 3515b314..cd9ef9fc 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -46,6 +46,41 @@ namespace WixToolsetTest.MSBuild } } + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.TrimStart().StartsWith("wix.exe build -platform x86")); + Assert.Single(platformSwitches); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Debug\SimpleMergeModule.msm", + @"bin\x86\Debug\SimpleMergeModule.wixpdb", + }, paths); + } + } + [Theory] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] @@ -82,6 +117,39 @@ namespace WixToolsetTest.MSBuild } } + [Theory] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Debug\cab1.cab", + @"bin\x86\Debug\MergeMsiPackage.msi", + @"bin\x86\Debug\MergeMsiPackage.wixpdb", + }, paths); + } + } + [Theory] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj new file mode 100644 index 00000000..77ee4420 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj @@ -0,0 +1,44 @@ + + + + + Debug + x86 + + + + {B00939D5-7952-4ADF-BEB1-507D227B2FE2} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + SimpleMergeModule + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs new file mode 100644 index 00000000..1c25e684 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs new file mode 100644 index 00000000..b9ab953a --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj new file mode 100644 index 00000000..91579790 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + Module + + + + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj index bb109557..916300af 100644 --- a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj +++ b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj @@ -15,6 +15,11 @@ + + + + + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 8fd45631..f1b85752 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -11,7 +11,6 @@ true win-x86 - AnyCPU app.config wix.exe.manifest diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index 63e1aa06..ac5af52e 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -11,7 +11,6 @@ true win-x86 - AnyCPU app.config wixcop.exe.manifest -- cgit v1.2.3-55-g6feb From 1027b60874319e9b14d4e27c95a992835abb1403 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 31 May 2020 14:59:58 +1000 Subject: Disable node reuse when running msbuild inside of tests. --- src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index d4815bde..6da52ed9 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs @@ -22,6 +22,9 @@ namespace WixToolsetTest.MSBuild var allArgs = new List { $"-p:WixMSBuildProps={MsbuildUtilities.WixPropsPath}", + // Node reuse means that child msbuild processes can stay around after the build completes. + // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. + "-nr:false", }; if (arguments != null) -- cgit v1.2.3-55-g6feb From 2ba71ab83ea951a01344e2851a1f411affc42f38 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 31 May 2020 15:04:41 +1000 Subject: In MSBuild tests, default to Release. --- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 40 +++++++++++----------- .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 10 +++--- .../WixToolsetTest.MSBuild/MsbuildUtilities.cs | 3 +- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index cd9ef9fc..210473fa 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -40,8 +40,8 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\SimpleBundle.exe", - @"bin\x86\Debug\SimpleBundle.wixpdb", + @"bin\x86\Release\SimpleBundle.exe", + @"bin\x86\Release\SimpleBundle.wixpdb", }, paths); } } @@ -75,8 +75,8 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\SimpleMergeModule.msm", - @"bin\x86\Debug\SimpleMergeModule.wixpdb", + @"bin\x86\Release\SimpleMergeModule.msm", + @"bin\x86\Release\SimpleMergeModule.wixpdb", }, paths); } } @@ -110,9 +110,9 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\en-US\cab1.cab", - @"bin\x86\Debug\en-US\MsiPackage.msi", - @"bin\x86\Debug\en-US\MsiPackage.wixpdb", + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", }, paths); } } @@ -143,9 +143,9 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x86\Debug\cab1.cab", - @"bin\x86\Debug\MergeMsiPackage.msi", - @"bin\x86\Debug\MergeMsiPackage.wixpdb", + @"bin\x86\Release\cab1.cab", + @"bin\x86\Release\MergeMsiPackage.msi", + @"bin\x86\Release\MergeMsiPackage.wixpdb", }, paths); } } @@ -157,9 +157,9 @@ namespace WixToolsetTest.MSBuild { var expectedOutputs = new[] { - @"bin\x86\Debug\en-US\cab1.cab", - @"bin\x86\Debug\en-US\MsiPackage.msi", - @"bin\x86\Debug\en-US\MsiPackage.wixpdb", + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", }; this.AssertWixpdb(buildSystem, null, expectedOutputs); @@ -173,8 +173,8 @@ namespace WixToolsetTest.MSBuild { this.AssertWixpdb(buildSystem, "NONE", new[] { - @"bin\x86\Debug\en-US\cab1.cab", - @"bin\x86\Debug\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", }); } @@ -232,9 +232,9 @@ namespace WixToolsetTest.MSBuild .ToArray(); Assert.Equal(new[] { - @"bin\x64\Debug\en-US\cab1.cab", - @"bin\x64\Debug\en-US\MsiPackage.msi", - @"bin\x64\Debug\en-US\MsiPackage.wixpdb", + @"bin\x64\Release\en-US\cab1.cab", + @"bin\x64\Release\en-US\MsiPackage.msi", + @"bin\x64\Release\en-US\MsiPackage.wixpdb", }, paths); } } @@ -309,7 +309,7 @@ namespace WixToolsetTest.MSBuild var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) .Select(s => s.Substring(baseFolder.Length + 1)) .Single(); - Assert.Equal(@"bin\x86\Debug\MsiPackage.wixipl", path); + Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path); } } @@ -360,7 +360,7 @@ namespace WixToolsetTest.MSBuild "Package.wxs", "PackageComponents.wxs", @"data\test.txt", - @"obj\x86\Debug\MsiPackage.wixproj.FileListAbsolute.txt", + @"obj\x86\Release\MsiPackage.wixproj.FileListAbsolute.txt", }; var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index 63c83bc7..038da241 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -37,7 +37,7 @@ namespace WixToolsetTest.MSBuild var warnings = result.Output.Where(line => line.Contains(": warning")); Assert.Empty(warnings); - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); Assert.True(File.Exists(generatedFilePath)); var generatedContents = File.ReadAllText(generatedFilePath); @@ -57,7 +57,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - var pdbPath = Path.Combine(binFolder, "x86", "Debug", "HeatFilePackage.wixpdb"); + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFilePackage.wixpdb"); Assert.True(File.Exists(pdbPath)); var intermediate = Intermediate.Load(pdbPath); @@ -92,7 +92,7 @@ namespace WixToolsetTest.MSBuild var warnings = result.Output.Where(line => line.Contains(": warning")); Assert.Empty(warnings); - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); Assert.True(File.Exists(generatedFilePath)); var generatedContents = File.ReadAllText(generatedFilePath); @@ -112,7 +112,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - generatedFilePath = Path.Combine(intermediateFolder, "x86", "Debug", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); + generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); Assert.True(File.Exists(generatedFilePath)); generatedContents = File.ReadAllText(generatedFilePath); @@ -132,7 +132,7 @@ namespace WixToolsetTest.MSBuild "" + "", testXml); - var pdbPath = Path.Combine(binFolder, "x86", "Debug", "HeatFileMultipleFilesSameFileName.wixpdb"); + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFileMultipleFilesSameFileName.wixpdb"); Assert.True(File.Exists(pdbPath)); var intermediate = Intermediate.Load(pdbPath); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index 6da52ed9..633fffe0 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs @@ -17,10 +17,11 @@ namespace WixToolsetTest.MSBuild { public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); - public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, params string[] arguments) + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release") { var allArgs = new List { + $"-p:Configuration={configuration}", $"-p:WixMSBuildProps={MsbuildUtilities.WixPropsPath}", // Node reuse means that child msbuild processes can stay around after the build completes. // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. -- cgit v1.2.3-55-g6feb From 82a26a321bae36e38743f50f38887387a392ce24 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 1 Jun 2020 21:58:44 +1000 Subject: Add ability for net461 tasks to run the tool out of proc. --- appveyor.cmd | 10 ++- src/WixToolset.BuildTasks/HeatTask.cs | 9 ++- src/WixToolset.BuildTasks/ToolsetTask.cs | 76 +++++++++++++++++++--- src/WixToolset.BuildTasks/WixBuild.cs | 10 +-- src/WixToolset.MSBuild/tools/wix.harvest.targets | 19 +++++- src/WixToolset.MSBuild/tools/wix.targets | 11 ++-- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 25 +++---- .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 8 ++- .../WixToolsetTest.MSBuild/MsbuildUtilities.cs | 7 +- 9 files changed, 126 insertions(+), 49 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 36565551..8a023895 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -9,11 +9,15 @@ dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks dotnet test -c %_C% src\test\WixToolsetTest.WixCop dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix -@rem dotnet publish -c %_C% -o %_P%\netfx-heat\ -f net461 src\heat -@rem dotnet publish -c %_C% -o %_P%\netfx-wix\ -f net461 src\wix -@rem dotnet publish -c %_C% -o %_P%\netfx-wixcop\ -f net461 src\wixcop + dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\heat +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\wix +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\wixcop dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\heat +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\wix +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\wixcop dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild diff --git a/src/WixToolset.BuildTasks/HeatTask.cs b/src/WixToolset.BuildTasks/HeatTask.cs index 586f02f7..5feed26d 100644 --- a/src/WixToolset.BuildTasks/HeatTask.cs +++ b/src/WixToolset.BuildTasks/HeatTask.cs @@ -59,7 +59,8 @@ namespace WixToolset.BuildTasks set { this.transforms = value; } } - protected override string TaskShortName => "HEAT"; + protected sealed override string TaskShortName => "HEAT"; + protected sealed override string ToolName => "heat.exe"; /// /// Gets the name of the heat operation performed by the task. @@ -71,10 +72,8 @@ namespace WixToolset.BuildTasks get; } - protected override void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) + protected sealed override int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) { - this.Log.LogMessage(MessageImportance.Normal, "heat.exe " + commandLineString); - var messaging = serviceProvider.GetService(); messaging.SetListener(listener); @@ -83,7 +82,7 @@ namespace WixToolset.BuildTasks var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider, true); var command = commandLine.ParseStandardCommandLine(arguments); - command?.Execute(); + return command?.Execute() ?? -1; } /// diff --git a/src/WixToolset.BuildTasks/ToolsetTask.cs b/src/WixToolset.BuildTasks/ToolsetTask.cs index 713a938b..fe6812fc 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask.cs @@ -3,14 +3,16 @@ namespace WixToolset.BuildTasks { using System; + using System.IO; using System.Runtime.InteropServices; + using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; using WixToolset.Extensibility.Services; - public abstract class ToolsetTask : Task + public abstract class ToolsetTask : ToolTask { /// /// Gets or sets additional options that are appended the the tool command-line. @@ -26,6 +28,12 @@ namespace WixToolset.BuildTasks /// public bool NoLogo { get; set; } + /// + /// Gets or sets a flag indicating whether the task + /// should be run as separate process or in-proc. + /// + public bool RunAsSeparateProcess { get; set; } + /// /// Gets or sets whether all warnings should be suppressed. /// @@ -51,19 +59,27 @@ namespace WixToolset.BuildTasks /// public bool VerboseOutput { get; set; } - public override bool Execute() + protected sealed override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + if (this.RunAsSeparateProcess) + { + return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); + } + + return this.ExecuteInProc($"{commandLineCommands} {responseFileCommands}"); + } + private int ExecuteInProc(string commandLineString) + { + this.Log.LogMessage(MessageImportance.Normal, $"({this.ToolName}){commandLineString}"); + + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); var listener = new MsbuildMessageListener(this.Log, this.TaskShortName, this.BuildEngine.ProjectFileOfTaskNode); + int exitCode = -1; try { - var commandLineBuilder = new WixCommandLineBuilder(); - this.BuildCommandLine(commandLineBuilder); - - var commandLineString = commandLineBuilder.ToString(); - this.ExecuteCore(serviceProvider, listener, commandLineString); + exitCode = this.ExecuteCore(serviceProvider, listener, commandLineString); } catch (WixException e) { @@ -79,7 +95,47 @@ namespace WixToolset.BuildTasks } } - return !this.Log.HasLoggedErrors; + if (exitCode == 0 && this.Log.HasLoggedErrors) + { + exitCode = -1; + } + return exitCode; + } + + /// + /// Get the path to the executable. + /// + /// + /// ToolTask only calls GenerateFullPathToTool when the ToolPath property is not set. + /// WiX never sets the ToolPath property, but the user can through $(WixToolDir). + /// If we return only a file name, ToolTask will search the system paths for it. + /// + protected sealed override string GenerateFullPathToTool() + { + var thisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; + if (this.RunAsSeparateProcess) + { + return Path.Combine(Path.GetDirectoryName(thisDllPath), this.ToolExe); + } + + // We need to return a path that exists, so if we're not actually going to run the tool then just return this dll path. + return thisDllPath; + } + + protected sealed override string GenerateResponseFileCommands() + { + var commandLineBuilder = new WixCommandLineBuilder(); + this.BuildCommandLine(commandLineBuilder); + return commandLineBuilder.ToString(); + } + + protected sealed override void LogToolCommand(string message) + { + // Only log this if we're actually going to do it. + if (this.RunAsSeparateProcess) + { + base.LogToolCommand(message); + } } /// @@ -98,7 +154,7 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); } - protected abstract void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener messageListener, string commandLineString); + protected abstract int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener messageListener, string commandLineString); protected abstract string TaskShortName { get; } } diff --git a/src/WixToolset.BuildTasks/WixBuild.cs b/src/WixToolset.BuildTasks/WixBuild.cs index b8fb4136..c15bc2f7 100644 --- a/src/WixToolset.BuildTasks/WixBuild.cs +++ b/src/WixToolset.BuildTasks/WixBuild.cs @@ -4,10 +4,7 @@ namespace WixToolset.BuildTasks { using System; using System.Collections.Generic; - using System.Runtime.InteropServices; using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -80,11 +77,10 @@ namespace WixToolset.BuildTasks public string AdditionalCub { get; set; } protected override string TaskShortName => "WIX"; + protected override string ToolName => "wix.exe"; - protected override void ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) + protected override int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) { - this.Log.LogMessage(MessageImportance.Normal, "wix.exe " + commandLineString); - var messaging = serviceProvider.GetService(); messaging.SetListener(listener); @@ -95,7 +91,7 @@ namespace WixToolset.BuildTasks commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); commandLine.Arguments = arguments; var command = commandLine.ParseStandardCommandLine(); - command?.Execute(); + return command?.Execute() ?? -1; } protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) diff --git a/src/WixToolset.MSBuild/tools/wix.harvest.targets b/src/WixToolset.MSBuild/tools/wix.harvest.targets index e4d866ea..dea44469 100644 --- a/src/WixToolset.MSBuild/tools/wix.harvest.targets +++ b/src/WixToolset.MSBuild/tools/wix.harvest.targets @@ -3,6 +3,10 @@ + + + $(WixToolDir) + @@ -274,7 +278,10 @@ Configuration="%(_AllHeatProjects.Configuration)" Platform="%(_AllHeatProjects.Platform)" GenerateWixVariables="$(HarvestProjectsGenerateWixVariables)" - AdditionalOptions="$(HarvestProjectsAdditionalOptions)"> + AdditionalOptions="$(HarvestProjectsAdditionalOptions)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + ToolExe="$(HeatToolExe)" + ToolPath="$(HeatToolDir)"> @@ -359,7 +366,10 @@ SuppressCom="%(HarvestDirectory.SuppressCom)" SuppressRootDirectory="%(HarvestDirectory.SuppressRootDirectory)" SuppressRegistry="%(HarvestDirectory.SuppressRegistry)" - AdditionalOptions="$(HarvestDirectoryAdditionalOptions)"> + AdditionalOptions="$(HarvestDirectoryAdditionalOptions)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + ToolExe="$(HeatToolExe)" + ToolPath="$(HeatToolDir)"> @@ -432,7 +442,10 @@ SuppressCom="%(HarvestFile.SuppressCom)" SuppressRegistry="%(HarvestFile.SuppressRegistry)" SuppressRootDirectory="%(HarvestFile.SuppressRootDirectory)" - AdditionalOptions="$(HarvestFileAdditionalOptions)"> + AdditionalOptions="$(HarvestFileAdditionalOptions)" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + ToolExe="$(HeatToolExe)" + ToolPath="$(HeatToolDir)"> diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets index 62414017..6914d03e 100644 --- a/src/WixToolset.MSBuild/tools/wix.targets +++ b/src/WixToolset.MSBuild/tools/wix.targets @@ -249,11 +249,6 @@ - - @@ -695,7 +690,11 @@ SuppressValidation="$(SuppressValidation)" SuppressIces="$(SuppressIces)" - AdditionalCub="$(AdditionalCub)" /> + AdditionalCub="$(AdditionalCub)" + + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + ToolExe="$(WixToolExe)" + ToolPath="$(WixToolDir)" /> - - - - netstandard2.0;net461;net472 - Tools Core - WiX Toolset Tools Core - embedded - true - - - - - - - - - - - diff --git a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject b/src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/WixToolset.Tools.Core/WixToolset.Tools.Core.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Wixtoolset.Tools.Core/ToolsCommon.cs b/src/Wixtoolset.Tools.Core/ToolsCommon.cs deleted file mode 100644 index 37d89f3c..00000000 --- a/src/Wixtoolset.Tools.Core/ToolsCommon.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.Core -{ - using System; - using System.Text.RegularExpressions; - - /// - /// Common WixTasks utility methods and types. - /// - public static class ToolsCommon - { - /// Metadata key name to turn off harvesting of project references. - public const string DoNotHarvest = "DoNotHarvest"; - - private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); - private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters - - /// - /// Return an identifier based on passed file/directory name - /// - /// File/directory name to generate identifer from - /// A version of the name that is a legal identifier. - /// This is duplicated from WiX's Common class. - public static string GetIdentifierFromName(string name) - { - string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". - - // MSI identifiers must begin with an alphabetic character or an - // underscore. Prefix all other values with an underscore. - if (AddPrefix.IsMatch(name)) - { - result = String.Concat("_", result); - } - - return result; - } - } -} diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index c2dc5116..b5018b67 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index f1b85752..2b053196 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index ac5af52e..c7c04f55 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -20,7 +20,7 @@ - + -- cgit v1.2.3-55-g6feb From be9b04d2272ef9a9e811d2d5486593b628a68993 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 3 Jun 2020 12:31:23 +1000 Subject: Never run in-proc on .NET Core. --- appveyor.cmd | 3 ++ src/WixToolset.BuildTasks/HeatTask_InProc.cs | 2 + .../MsbuildMessageListener.cs | 2 + src/WixToolset.BuildTasks/ToolsetTask.cs | 49 ++++++++++++++++++++-- src/WixToolset.BuildTasks/ToolsetTask_InProc.cs | 2 + src/WixToolset.BuildTasks/WixBuild_InProc.cs | 2 + .../WixToolset.BuildTasks.csproj | 11 +++-- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 30 +++++++------ .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 11 +++-- .../WixToolsetTest.MSBuild/MsbuildUtilities.cs | 46 +++++++++++++++++++- 10 files changed, 129 insertions(+), 29 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 8a023895..b8a37ba6 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -19,6 +19,9 @@ dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\wix dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\wixcop dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\heat +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\wix +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\wixcop dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild dotnet pack -c %_C% src\dotnet-wix diff --git a/src/WixToolset.BuildTasks/HeatTask_InProc.cs b/src/WixToolset.BuildTasks/HeatTask_InProc.cs index 8190d9e2..eb6feafc 100644 --- a/src/WixToolset.BuildTasks/HeatTask_InProc.cs +++ b/src/WixToolset.BuildTasks/HeatTask_InProc.cs @@ -1,5 +1,6 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +#if !NETCOREAPP namespace WixToolset.BuildTasks { using WixToolset.Extensibility; @@ -25,3 +26,4 @@ namespace WixToolset.BuildTasks } } } +#endif diff --git a/src/WixToolset.BuildTasks/MsbuildMessageListener.cs b/src/WixToolset.BuildTasks/MsbuildMessageListener.cs index 47399a41..f186d721 100644 --- a/src/WixToolset.BuildTasks/MsbuildMessageListener.cs +++ b/src/WixToolset.BuildTasks/MsbuildMessageListener.cs @@ -1,5 +1,6 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +#if !NETCOREAPP namespace WixToolset.BuildTasks { using System; @@ -64,3 +65,4 @@ namespace WixToolset.BuildTasks public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; } } +#endif diff --git a/src/WixToolset.BuildTasks/ToolsetTask.cs b/src/WixToolset.BuildTasks/ToolsetTask.cs index 4fd7af3f..94d007f0 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask.cs @@ -4,10 +4,13 @@ namespace WixToolset.BuildTasks { using System; using System.IO; + using System.Runtime.InteropServices; using Microsoft.Build.Utilities; public abstract partial class ToolsetTask : ToolTask { + private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; + /// /// Gets or sets additional options that are appended the the tool command-line. /// @@ -53,6 +56,8 @@ namespace WixToolset.BuildTasks /// public bool VerboseOutput { get; set; } + private string ToolFullPath => Path.Combine(Path.GetDirectoryName(ThisDllPath), this.ToolExe); + /// /// Get the path to the executable. /// @@ -63,13 +68,20 @@ namespace WixToolset.BuildTasks /// protected sealed override string GenerateFullPathToTool() { - var thisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; +#if !NETCOREAPP if (!this.RunAsSeparateProcess) { // We need to return a path that exists, so if we're not actually going to run the tool then just return this dll path. - return thisDllPath; + return ThisDllPath; } - return Path.Combine(Path.GetDirectoryName(thisDllPath), this.ToolExe); + return this.ToolFullPath; +#else + if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath)) + { + return toolFullPath; + } + return DotnetFullPath; +#endif } protected sealed override string GenerateResponseFileCommands() @@ -94,5 +106,36 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendArrayIfNotNull("-wx ", this.TreatSpecificWarningsAsErrors); commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); } + +#if NETCOREAPP + private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet"; + + protected override string GenerateCommandLineCommands() + { + if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath)) + { + return null; + } + else + { + return $"exec \"{toolFullPath}\""; + } + } + + private static bool IsSelfExecutable(string proposedToolFullPath, out string toolFullPath) + { + var toolFullPathWithoutExtension = Path.Combine(Path.GetDirectoryName(proposedToolFullPath), Path.GetFileNameWithoutExtension(proposedToolFullPath)); + var exeExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : String.Empty; + var exeToolFullPath = $"{toolFullPathWithoutExtension}{exeExtension}"; + if (File.Exists(exeToolFullPath)) + { + toolFullPath = exeToolFullPath; + return true; + } + + toolFullPath = $"{toolFullPathWithoutExtension}.dll"; + return false; + } +#endif } } diff --git a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs b/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs index 4b365b2a..a3290e60 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs @@ -1,5 +1,6 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +#if !NETCOREAPP namespace WixToolset.BuildTasks { using System; @@ -69,3 +70,4 @@ namespace WixToolset.BuildTasks protected abstract string TaskShortName { get; } } } +#endif diff --git a/src/WixToolset.BuildTasks/WixBuild_InProc.cs b/src/WixToolset.BuildTasks/WixBuild_InProc.cs index 8e9f2fec..49148c8a 100644 --- a/src/WixToolset.BuildTasks/WixBuild_InProc.cs +++ b/src/WixToolset.BuildTasks/WixBuild_InProc.cs @@ -1,5 +1,6 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +#if !NETCOREAPP namespace WixToolset.BuildTasks { using WixToolset.Data; @@ -51,3 +52,4 @@ namespace WixToolset.BuildTasks } } } +#endif diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 221478ed..6709949e 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -18,19 +18,18 @@ - + - + + - - - - + + diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 6862f2a8..71255165 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -12,6 +12,7 @@ namespace WixToolsetTest.MSBuild public class MsbuildFixture { [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildSimpleBundle(BuildSystem buildSystem) @@ -44,6 +45,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildSimpleMergeModule(BuildSystem buildSystem) @@ -76,6 +78,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) @@ -112,6 +115,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) @@ -145,6 +149,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) @@ -161,6 +166,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildWithNoWixpdb(BuildSystem buildSystem) @@ -198,6 +204,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuild64BitMsiPackage(BuildSystem buildSystem) @@ -234,6 +241,7 @@ namespace WixToolsetTest.MSBuild } [Theory(Skip = "Currently fails")] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildSimpleMsiPackageWithIceSuppressions(BuildSystem buildSystem) @@ -249,13 +257,14 @@ namespace WixToolsetTest.MSBuild var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - "-p:SuppressIces=\"ICE45;ICE46\"", + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressIces", "ICE45;ICE46"), }); result.AssertSuccess(); } } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildSimpleMsiPackageWithWarningSuppressions(BuildSystem buildSystem) @@ -271,7 +280,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { - "-p:SuppressSpecificWarnings=\"1118;1102\"", + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressSpecificWarnings", "1118;1102"), }); result.AssertSuccess(); @@ -281,6 +290,8 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk, null)] + [InlineData(BuildSystem.DotNetCoreSdk, true)] [InlineData(BuildSystem.MSBuild, null)] [InlineData(BuildSystem.MSBuild, true)] [InlineData(BuildSystem.MSBuild64, null)] @@ -302,10 +313,8 @@ namespace WixToolsetTest.MSBuild }, outOfProc: outOfProc); result.AssertSuccess(); - var expectedOutOfProc = outOfProc.HasValue && outOfProc.Value; - var expectedWixCommand = $"{(expectedOutOfProc ? "wix.exe" : "(wix.exe)")} build"; - var buildCommands = result.Output.Where(line => line.TrimStart().Contains(expectedWixCommand)); - Assert.Single(buildCommands); + var wixBuildCommands = MsbuildUtilities.GetToolCommandLines(result, "wix", "build", buildSystem, outOfProc); + Assert.Single(wixBuildCommands); var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) .Select(s => s.Substring(baseFolder.Length + 1)) @@ -315,6 +324,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildAndCleanSimpleMsiPackage(BuildSystem buildSystem) @@ -328,10 +338,7 @@ namespace WixToolsetTest.MSBuild var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); // Build - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - "-v:diag", - }); + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, verbosityLevel: "diag"); result.AssertSuccess(); var buildOutput = String.Join("\r\n", result.Output); @@ -346,8 +353,7 @@ namespace WixToolsetTest.MSBuild result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] { "-t:Clean", - "-v:diag", - }); + }, verbosityLevel: "diag"); result.AssertSuccess(); var cleanOutput = String.Join("\r\n", result.Output); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index b5c71f86..f5f03be0 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -3,6 +3,7 @@ namespace WixToolsetTest.MSBuild { using System; + using System.Collections.Generic; using System.IO; using System.Linq; using WixBuildTools.TestSupport; @@ -14,6 +15,7 @@ namespace WixToolsetTest.MSBuild public class MsbuildHeatFixture { [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildHeatFilePackage(BuildSystem buildSystem) @@ -31,9 +33,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); - var expectedOutOfProc = false; - var expectedHeatCommand = $"{(expectedOutOfProc ? "heat.exe" : "(heat.exe)")} file"; - var heatCommandLines = result.Output.Where(line => line.Contains(expectedHeatCommand)); + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem); Assert.Single(heatCommandLines); var warnings = result.Output.Where(line => line.Contains(": warning")); @@ -71,6 +71,7 @@ namespace WixToolsetTest.MSBuild } [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] public void CanBuildHeatFileWithMultipleFilesPackage(BuildSystem buildSystem) @@ -88,9 +89,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); - var expectedOutOfProc = false; - var expectedHeatCommand = $"{(expectedOutOfProc ? "heat.exe" : "(heat.exe)")} file"; - var heatCommandLines = result.Output.Where(line => line.Contains(expectedHeatCommand)); + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem); Assert.Equal(2, heatCommandLines.Count()); var warnings = result.Output.Where(line => line.Contains(": warning")); diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index 6a6f32e0..90c3194b 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs @@ -5,10 +5,12 @@ namespace WixToolsetTest.MSBuild using System; using System.Collections.Generic; using System.IO; + using System.Linq; using WixBuildTools.TestSupport; public enum BuildSystem { + DotNetCoreSdk, MSBuild, MSBuild64, } @@ -17,12 +19,13 @@ namespace WixToolsetTest.MSBuild { public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); - public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null) + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") { var allArgs = new List { + $"-verbosity:{verbosityLevel}", $"-p:Configuration={configuration}", - $"-p:WixMSBuildProps={MsbuildUtilities.WixPropsPath}", + GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildUtilities.WixPropsPath), // Node reuse means that child msbuild processes can stay around after the build completes. // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. "-nr:false", @@ -40,6 +43,16 @@ namespace WixToolsetTest.MSBuild switch (buildSystem) { + case BuildSystem.DotNetCoreSdk: + { + allArgs.Add(projectPath); + var result = DotnetRunner.Execute("msbuild", allArgs.ToArray()); + return new MsbuildRunnerResult + { + ExitCode = result.ExitCode, + Output = result.StandardOutput, + }; + } case BuildSystem.MSBuild: case BuildSystem.MSBuild64: { @@ -51,5 +64,34 @@ namespace WixToolsetTest.MSBuild } } } + + public static string GetQuotedPropertySwitch(BuildSystem buildSystem, string propertyName, string valueToQuote) + { + switch (buildSystem) + { + case BuildSystem.DotNetCoreSdk: + { + return $"-p:{propertyName}=\\\"{valueToQuote}\\\""; + } + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + return $"-p:{propertyName}=\"{valueToQuote}\""; + } + default: + { + throw new NotImplementedException(); + } + } + } + + public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem, bool? outOfProc = null) + { + var expectedOutOfProc = buildSystem == BuildSystem.DotNetCoreSdk || outOfProc.HasValue && outOfProc.Value; + var expectedToolExe = !expectedOutOfProc ? $"({toolName}.exe)" : + buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; + var expectedToolCommand = $"{expectedToolExe} {operation}"; + return result.Output.Where(line => line.Contains(expectedToolCommand)); + } } } -- cgit v1.2.3-55-g6feb From 874fb5fc3597d784a4e8ac07d735e3caa34417be Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 3 Jun 2020 12:51:14 +1000 Subject: Set .NET Core RollForward policy to Major. --- src/heat/heat.csproj | 1 + src/wix/wix.csproj | 1 + src/wixcop/WixCop.csproj | 1 + 3 files changed, 3 insertions(+) diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index b5018b67..9d6eeaa7 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -13,6 +13,7 @@ win-x86 app.config heat.exe.manifest + Major diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 2b053196..117bbcd9 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -13,6 +13,7 @@ win-x86 app.config wix.exe.manifest + Major diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj index c7c04f55..13a188ab 100644 --- a/src/wixcop/WixCop.csproj +++ b/src/wixcop/WixCop.csproj @@ -13,6 +13,7 @@ win-x86 app.config wixcop.exe.manifest + Major -- cgit v1.2.3-55-g6feb From 6bb2c3d5a2082c377a31bffe1bbdb950b5e15781 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 3 Jun 2020 14:01:28 +1000 Subject: Get the inner exception test working in the MSBuild test project. --- appveyor.cmd | 1 + src/WixToolset.BuildTasks/ToolsetTask.cs | 18 +++++++-- .../WixBuildTaskFixture.cs | 43 ---------------------- .../WixToolsetTest.BuildTasks.csproj | 6 --- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 26 +++++++++++++ .../WixToolsetTest.MSBuild/MsbuildUtilities.cs | 3 +- 6 files changed, 44 insertions(+), 53 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index b8a37ba6..99034ca7 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -23,6 +23,7 @@ dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcor dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\wix dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\wixcop dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\broken\net461\ -f net461 -r dne src\wix dotnet pack -c %_C% src\dotnet-wix dotnet pack -c %_C% src\WixToolset.MSBuild diff --git a/src/WixToolset.BuildTasks/ToolsetTask.cs b/src/WixToolset.BuildTasks/ToolsetTask.cs index 94d007f0..ae11254a 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask.cs @@ -56,7 +56,19 @@ namespace WixToolset.BuildTasks /// public bool VerboseOutput { get; set; } - private string ToolFullPath => Path.Combine(Path.GetDirectoryName(ThisDllPath), this.ToolExe); + private string DefaultToolFullPath => Path.Combine(Path.GetDirectoryName(ThisDllPath), this.ToolExe); + + private string ToolFullPath + { + get + { + if (String.IsNullOrEmpty(this.ToolPath)) + { + return this.DefaultToolFullPath; + } + return Path.Combine(this.ToolPath, this.ToolExe); + } + } /// /// Get the path to the executable. @@ -74,9 +86,9 @@ namespace WixToolset.BuildTasks // We need to return a path that exists, so if we're not actually going to run the tool then just return this dll path. return ThisDllPath; } - return this.ToolFullPath; + return this.DefaultToolFullPath; #else - if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath)) + if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath)) { return toolFullPath; } diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index 92033766..cd41f16e 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -62,48 +62,5 @@ namespace WixToolsetTest.BuildTasks Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); } } - - [Fact(Skip = "Requires deleting wixnative.exe from output folder after build but before running the test.")] - public void ReportsInnerExceptionForUnexpectedExceptions() - { - var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var intermediateFolder = Path.Combine(baseFolder, "obj"); - var pdbPath = Path.Combine(baseFolder, @"bin\testpackage.wixpdb"); - var engine = new FakeBuildEngine(); - - var task = new WixBuild - { - BuildEngine = engine, - SourceFiles = new[] - { - new TaskItem(Path.Combine(folder, "Package.wxs")), - new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), - }, - LocalizationFiles = new[] - { - new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), - }, - BindInputPaths = new[] - { - new TaskItem(Path.Combine(folder, "data")), - }, - IntermediateDirectory = new TaskItem(intermediateFolder), - OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), - PdbType = "Full", - PdbFile = new TaskItem(pdbPath), - }; - - var result = task.Execute(); - Assert.False(result, $"MSBuild task succeeded unexpectedly. Output:\r\n{engine.Output}"); - - Assert.Contains( - "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from", - engine.Output); - } - } } } diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 22d421de..bfcc10ad 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -16,12 +16,6 @@ - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 71255165..163e8402 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -378,5 +378,31 @@ namespace WixToolsetTest.MSBuild Assert.Empty(remainingPaths); } } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildUtilities.WixMsbuildPath, "broken", "net461")), + }, outOfProc: true); + Assert.Equal(1, result.ExitCode); + + var expectedMessage = "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from"; + Assert.Contains(result.Output, m => m.Contains(expectedMessage)); + } + } } } diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs index 90c3194b..fead4915 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs @@ -17,7 +17,8 @@ namespace WixToolsetTest.MSBuild public static class MsbuildUtilities { - public static readonly string WixPropsPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild", "build", "WixToolset.MSBuild.props"); + public static readonly string WixMsbuildPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild"); + public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.MSBuild.props"); public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") { -- cgit v1.2.3-55-g6feb From e7f2e4b4912012bbade5d562345d8467eb6b658a Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 3 Jun 2020 15:18:24 +1000 Subject: Disable RunAsSeparateProcess until build server issues are resolved. --- src/WixToolset.MSBuild/tools/wix.targets | 2 +- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets index 6914d03e..233acef0 100644 --- a/src/WixToolset.MSBuild/tools/wix.targets +++ b/src/WixToolset.MSBuild/tools/wix.targets @@ -692,7 +692,7 @@ SuppressIces="$(SuppressIces)" AdditionalCub="$(AdditionalCub)" - RunAsSeparateProcess="$(RunWixToolsOutOfProc)" + RunAsSeparateProcess="false" ToolExe="$(WixToolExe)" ToolPath="$(WixToolDir)" /> diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index 163e8402..aecc607a 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -291,11 +291,11 @@ namespace WixToolsetTest.MSBuild [Theory] [InlineData(BuildSystem.DotNetCoreSdk, null)] - [InlineData(BuildSystem.DotNetCoreSdk, true)] + //[InlineData(BuildSystem.DotNetCoreSdk, true)] [InlineData(BuildSystem.MSBuild, null)] - [InlineData(BuildSystem.MSBuild, true)] + //[InlineData(BuildSystem.MSBuild, true)] [InlineData(BuildSystem.MSBuild64, null)] - [InlineData(BuildSystem.MSBuild64, true)] + //[InlineData(BuildSystem.MSBuild64, true)] public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -381,8 +381,8 @@ namespace WixToolsetTest.MSBuild [Theory] [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] + //[InlineData(BuildSystem.MSBuild)] + //[InlineData(BuildSystem.MSBuild64)] public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); -- cgit v1.2.3-55-g6feb From ff881bbb67a85db1878add8e7795a263dbb78633 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 3 Jun 2020 20:12:17 +1000 Subject: Reenable RunAsSeparateProcess. Publish the parts of WixToolset.MSBuild to individual folders and then manually recombine them, because otherwise dotnet publish was mysteriously bringing in the wrong versions of dlls. Disable tests in appveyor.yml because Appveyor was running the tests again at the end of the build. --- appveyor.cmd | 44 +++++++++++++++-------- appveyor.yml | 2 ++ src/WixToolset.MSBuild/tools/wix.targets | 2 +- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 10 +++--- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 99034ca7..2d32a7f0 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -2,6 +2,7 @@ @pushd %~dp0 @set _C=Release @set _P=%~dp0build\%_C%\publish +@set _RCO=/S /R:1 /W:1 /NP /XO nuget restore @@ -10,26 +11,41 @@ dotnet test -c %_C% src\test\WixToolsetTest.WixCop dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\WixToolset.BuildTasks -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\heat -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\wix -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x86\ -f net461 -r win-x86 src\wixcop -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\WixToolset.BuildTasks -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\heat -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\wix -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\net461\x64\ -f net461 -r win-x64 src\wixcop -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\WixToolset.BuildTasks -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\heat -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\wix -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\tools\netcoreapp2.1\ -f netcoreapp2.1 src\wixcop +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wixcop\ -f net461 -r win-x86 src\wixcop +robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\heat %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wix %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wixcop %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% + +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wixcop\ -f net461 -r win-x64 src\wixcop +robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\heat %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wix %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wixcop %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% + +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wixcop\ -f netcoreapp2.1 src\wixcop +robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wixcop %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% + dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\broken\net461\ -f net461 -r dne src\wix +dotnet test -c %_C% src\test\WixToolsetTest.MSBuild + dotnet pack -c %_C% src\dotnet-wix dotnet pack -c %_C% src\WixToolset.MSBuild -dotnet test -c %_C% src\test\WixToolsetTest.MSBuild - msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj @popd diff --git a/appveyor.yml b/appveyor.yml index 522e5af3..01f87f46 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,6 +30,8 @@ nuget: skip_branch_with_pr: true skip_tags: true +test: off + artifacts: - path: build\Release\**\*.nupkg name: nuget diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets index 233acef0..6914d03e 100644 --- a/src/WixToolset.MSBuild/tools/wix.targets +++ b/src/WixToolset.MSBuild/tools/wix.targets @@ -692,7 +692,7 @@ SuppressIces="$(SuppressIces)" AdditionalCub="$(AdditionalCub)" - RunAsSeparateProcess="false" + RunAsSeparateProcess="$(RunWixToolsOutOfProc)" ToolExe="$(WixToolExe)" ToolPath="$(WixToolDir)" /> diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs index aecc607a..163e8402 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs @@ -291,11 +291,11 @@ namespace WixToolsetTest.MSBuild [Theory] [InlineData(BuildSystem.DotNetCoreSdk, null)] - //[InlineData(BuildSystem.DotNetCoreSdk, true)] + [InlineData(BuildSystem.DotNetCoreSdk, true)] [InlineData(BuildSystem.MSBuild, null)] - //[InlineData(BuildSystem.MSBuild, true)] + [InlineData(BuildSystem.MSBuild, true)] [InlineData(BuildSystem.MSBuild64, null)] - //[InlineData(BuildSystem.MSBuild64, true)] + [InlineData(BuildSystem.MSBuild64, true)] public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); @@ -381,8 +381,8 @@ namespace WixToolsetTest.MSBuild [Theory] [InlineData(BuildSystem.DotNetCoreSdk)] - //[InlineData(BuildSystem.MSBuild)] - //[InlineData(BuildSystem.MSBuild64)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) { var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); -- cgit v1.2.3-55-g6feb From 928e44669fab43f2ac100288bd188bf11e11e9c5 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 3 Jun 2020 20:12:36 +1000 Subject: Exclude the MSBuild dlls since they should already be loaded in the process. --- appveyor.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 2d32a7f0..bceeb691 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -15,7 +15,7 @@ dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wixcop\ -f net461 -r win-x86 src\wixcop -robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\heat %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wix %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wixcop %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% @@ -24,7 +24,7 @@ dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wixcop\ -f net461 -r win-x64 src\wixcop -robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\heat %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wix %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wixcop %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% @@ -33,7 +33,7 @@ dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildta dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wixcop\ -f netcoreapp2.1 src\wixcop -robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% +robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wixcop %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% -- cgit v1.2.3-55-g6feb From 0ec925dbf8359629e6d4f71fb142118a05f07298 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 7 Jun 2020 08:14:46 -0700 Subject: Move WixCop to "wix.exe convert" command --- .../ConsoleMessageListener.cs | 96 -------- .../TestData/PermissionEx/v3.wxs | 27 --- .../TestData/PermissionEx/v4_expected.wxs | 27 --- .../Preprocessor/ConvertedPreprocessor.wxs | 62 ------ .../TestData/Preprocessor/Preprocessor.wxs | 63 ------ .../TestData/Preprocessor/wixcop.settings.xml | 9 - .../TestData/QtExec.bad/v3.wxs | 65 ------ .../TestData/QtExec.bad/v4_expected.wxs | 64 ------ .../WixToolsetTest.WixCop/TestData/QtExec/v3.wxs | 64 ------ .../TestData/QtExec/v4_expected.wxs | 63 ------ .../TestData/SingleFile/ConvertedSingleFile.wxs | 60 ----- .../TestData/SingleFile/SingleFile.wxs | 61 ------ src/test/WixToolsetTest.WixCop/WixCopFixture.cs | 242 --------------------- src/test/WixToolsetTest.WixCop/WixCopRunner.cs | 68 ------ .../WixToolsetTest.WixCop/WixCopRunnerResult.cs | 22 -- .../WixToolsetTest.WixCop.csproj | 51 ----- .../WixToolsetTest.WixCop.v3.ncrunchproject | 6 - src/wix/ConsoleMessageListener.cs | 96 ++++++++ src/wix/Program.cs | 4 +- src/wix/app.config | 10 +- src/wix/wix.csproj | 5 +- src/wix/wix.exe.manifest | 4 +- src/wixcop/CommandLine/ConvertCommand.cs | 224 ------------------- src/wixcop/CommandLine/HelpCommand.cs | 37 ---- src/wixcop/CommandLine/WixCopCommandLineParser.cs | 135 ------------ src/wixcop/Interfaces/IWixCopCommandLineParser.cs | 13 -- src/wixcop/Program.cs | 79 ------- src/wixcop/WixCop.csproj | 35 --- src/wixcop/WixCop.net461.v3.ncrunchproject | 5 - src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject | 5 - src/wixcop/app.config | 10 - src/wixcop/wixcop.exe.manifest | 20 -- 32 files changed, 105 insertions(+), 1627 deletions(-) delete mode 100644 src/WixToolset.Tools.Core/ConsoleMessageListener.cs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs delete mode 100644 src/test/WixToolsetTest.WixCop/WixCopFixture.cs delete mode 100644 src/test/WixToolsetTest.WixCop/WixCopRunner.cs delete mode 100644 src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs delete mode 100644 src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj delete mode 100644 src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject create mode 100644 src/wix/ConsoleMessageListener.cs delete mode 100644 src/wixcop/CommandLine/ConvertCommand.cs delete mode 100644 src/wixcop/CommandLine/HelpCommand.cs delete mode 100644 src/wixcop/CommandLine/WixCopCommandLineParser.cs delete mode 100644 src/wixcop/Interfaces/IWixCopCommandLineParser.cs delete mode 100644 src/wixcop/Program.cs delete mode 100644 src/wixcop/WixCop.csproj delete mode 100644 src/wixcop/WixCop.net461.v3.ncrunchproject delete mode 100644 src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject delete mode 100644 src/wixcop/app.config delete mode 100644 src/wixcop/wixcop.exe.manifest diff --git a/src/WixToolset.Tools.Core/ConsoleMessageListener.cs b/src/WixToolset.Tools.Core/ConsoleMessageListener.cs deleted file mode 100644 index 709fb576..00000000 --- a/src/WixToolset.Tools.Core/ConsoleMessageListener.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.Core -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Globalization; - using System.Text; - using System.Threading; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - - public sealed class ConsoleMessageListener : IMessageListener - { - public ConsoleMessageListener(string prefix, string appName) - { - this.Prefix = prefix; - this.AppName = appName; - - PrepareConsoleForLocalization(); - } - - public string AppName { get; } - - public string Prefix { get; } - - public void Write(Message message) - { - var filename = message.SourceLineNumbers?.FileName ?? this.AppName; - var type = message.Level.ToString().ToLowerInvariant(); - var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; - - if (message.SourceLineNumbers?.LineNumber.HasValue == true) - { - filename = String.Concat(filename, "(", message.SourceLineNumbers?.LineNumber.Value, ")"); - } - - output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.Prefix, message.Id, message.ToString()); - - var fileNames = GetFileNames(message.SourceLineNumbers); - if (fileNames.Any()) - { - output.WriteLine("Source trace:"); - - foreach (var fileName in fileNames) - { - output.WriteLine("Source trace: {0}", fileName); - } - } - } - - public void Write(string message) - { - Console.Out.WriteLine(message); - } - - public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; - - private static IList GetFileNames(SourceLineNumber sourceLineNumbers) - { - var fileNames = new List(); - - for (var sln = sourceLineNumbers; null != sln; sln = sln.Parent) - { - if (String.IsNullOrEmpty(sln.FileName)) - { - continue; - } - else if (sln.LineNumber.HasValue) - { - fileNames.Add(String.Format(CultureInfo.CurrentUICulture, "{0}: line {1}", sln.FileName, sln.LineNumber)); - } - else - { - fileNames.Add(sln.FileName); - } - } - - return fileNames; - } - - private static void PrepareConsoleForLocalization() - { - Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); - - if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && - Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && - Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) - { - Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); - } - } - } -} diff --git a/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs b/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs deleted file mode 100644 index 0e241544..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v3.wxs +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs deleted file mode 100644 index 375b70d3..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/PermissionEx/v4_expected.wxs +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs deleted file mode 100644 index dcd43e35..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/ConvertedPreprocessor.wxs +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs deleted file mode 100644 index 2eb908c2..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/Preprocessor.wxs +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml b/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml deleted file mode 100644 index 9d3ad496..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/Preprocessor/wixcop.settings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs deleted file mode 100644 index b0630f65..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v3.wxs +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs deleted file mode 100644 index b28c94e4..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/QtExec.bad/v4_expected.wxs +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs deleted file mode 100644 index 8d81a758..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v3.wxs +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs b/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs deleted file mode 100644 index 99cc2151..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/QtExec/v4_expected.wxs +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs b/src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs deleted file mode 100644 index aacb68fa..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/SingleFile/ConvertedSingleFile.wxs +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs b/src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs deleted file mode 100644 index 310ae811..00000000 --- a/src/test/WixToolsetTest.WixCop/TestData/SingleFile/SingleFile.wxs +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs b/src/test/WixToolsetTest.WixCop/WixCopFixture.cs deleted file mode 100644 index 72a36dd6..00000000 --- a/src/test/WixToolsetTest.WixCop/WixCopFixture.cs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.WixCop -{ - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - using Xunit; - - public class WixCopFixture - { - [Fact] - public void CanConvertPermissionExFile() - { - const string beforeFileName = "v3.wxs"; - const string afterFileName = "v4_expected.wxs"; - var folder = TestData.Get(@"TestData\PermissionEx"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(true); - var targetFile = Path.Combine(baseFolder, beforeFileName); - File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); - - var runner = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result = runner.Execute(); - - Assert.Equal(2, result.ExitCode); - - var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); - var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); - Assert.Equal(expected, actual); - - var runner2 = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result2 = runner2.Execute(); - - Assert.Equal(0, result2.ExitCode); - } - } - - [Fact] - public void CanConvertSingleFile() - { - const string beforeFileName = "SingleFile.wxs"; - const string afterFileName = "ConvertedSingleFile.wxs"; - var folder = TestData.Get(@"TestData\SingleFile"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(true); - var targetFile = Path.Combine(baseFolder, beforeFileName); - File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); - - var runner = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result = runner.Execute(); - - Assert.Equal(2, result.ExitCode); - - var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); - var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); - Assert.Equal(expected, actual); - - var runner2 = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result2 = runner2.Execute(); - - Assert.Equal(0, result2.ExitCode); - } - } - - [Fact] - public void RetainsPreprocessorInstructions() - { - const string beforeFileName = "Preprocessor.wxs"; - const string afterFileName = "ConvertedPreprocessor.wxs"; - var folder = TestData.Get(@"TestData\Preprocessor"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(true); - var targetFile = Path.Combine(baseFolder, beforeFileName); - File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); - - var runner = new WixCopRunner - { - FixErrors = true, - SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), - SearchPatterns = - { - targetFile, - }, - }; - - var result = runner.Execute(); - - Assert.Equal(2, result.ExitCode); - - var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); - var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); - Assert.Equal(expected, actual); - - var runner2 = new WixCopRunner - { - FixErrors = true, - SettingFile1 = Path.Combine(folder, "wixcop.settings.xml"), - SearchPatterns = - { - targetFile, - }, - }; - - var result2 = runner2.Execute(); - - Assert.Equal(0, result2.ExitCode); - } - } - - [Fact] - public void CanConvertQtExec() - { - const string beforeFileName = "v3.wxs"; - const string afterFileName = "v4_expected.wxs"; - var folder = TestData.Get(@"TestData\QtExec"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(true); - var targetFile = Path.Combine(baseFolder, beforeFileName); - File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); - - var runner = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result = runner.Execute(); - - Assert.Equal(2, result.ExitCode); - - var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); - var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); - Assert.Equal(expected, actual); - - var runner2 = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result2 = runner2.Execute(); - - Assert.Equal(0, result2.ExitCode); - } - } - - [Fact] - public void DetectUnconvertableQtExecCmdTimeout() - { - const string beforeFileName = "v3.wxs"; - const string afterFileName = "v4_expected.wxs"; - var folder = TestData.Get(@"TestData\QtExec.bad"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(true); - var targetFile = Path.Combine(baseFolder, beforeFileName); - File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); - - var runner = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result = runner.Execute(); - - Assert.Equal(2, result.ExitCode); - - Assert.Single(result.Messages.Where(message => message.ToString().EndsWith("(QtExecCmdTimeoutAmbiguous)"))); - - var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); - var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); - Assert.Equal(expected, actual); - - // still fails because QtExecCmdTimeoutAmbiguous is unfixable - var runner2 = new WixCopRunner - { - FixErrors = true, - SearchPatterns = - { - targetFile, - }, - }; - - var result2 = runner2.Execute(); - - Assert.Equal(2, result2.ExitCode); - } - } - } -} diff --git a/src/test/WixToolsetTest.WixCop/WixCopRunner.cs b/src/test/WixToolsetTest.WixCop/WixCopRunner.cs deleted file mode 100644 index d2a0abbe..00000000 --- a/src/test/WixToolsetTest.WixCop/WixCopRunner.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.WixCop -{ - using System; - using System.Collections.Generic; - using WixToolset.Core; - using WixToolset.Core.TestPackage; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - using WixToolset.Tools.WixCop; - using WixToolset.Tools.WixCop.CommandLine; - using WixToolset.Tools.WixCop.Interfaces; - - public class WixCopRunner - { - public bool FixErrors { get; set; } - - public List SearchPatterns { get; } = new List(); - - public string SettingFile1 { get; set; } - - public WixCopRunnerResult Execute() - { - var argList = new List(); - - if (this.FixErrors) - { - argList.Add("-f"); - } - - if (!String.IsNullOrEmpty(this.SettingFile1)) - { - argList.Add($"-set1{this.SettingFile1}"); - } - - foreach (var searchPattern in this.SearchPatterns) - { - argList.Add(searchPattern); - } - - return WixCopRunner.Execute(argList.ToArray()); - } - - public static WixCopRunnerResult Execute(string[] args) - { - var listener = new TestMessageListener(); - - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - serviceProvider.AddService((x, y) => listener); - serviceProvider.AddService((x, y) => new WixCopCommandLineParser(x)); - - var exitCode = Execute(serviceProvider, args); - - return new WixCopRunnerResult - { - ExitCode = exitCode, - Messages = listener.Messages.ToArray() - }; - } - - public static int Execute(IWixToolsetServiceProvider serviceProvider, string[] args) - { - var wixcop = new Program(); - return wixcop.Run(serviceProvider, args); - } - } -} diff --git a/src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs b/src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs deleted file mode 100644 index 1b35e491..00000000 --- a/src/test/WixToolsetTest.WixCop/WixCopRunnerResult.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.WixCop -{ - using System; - using System.Linq; - using WixToolset.Data; - using Xunit; - - public class WixCopRunnerResult - { - public int ExitCode { get; set; } - - public Message[] Messages { get; set; } - - public WixCopRunnerResult AssertSuccess() - { - Assert.True(0 == this.ExitCode, $"WixCop failed unexpectedly. Output:\r\n{String.Join("\r\n", this.Messages.Select(m => m.ToString()).ToArray())}"); - return this; - } - } -} diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj deleted file mode 100644 index 3ea4dae5..00000000 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.csproj +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - net461 - false - embedded - win-x86 - - - - NU1603 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject b/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject deleted file mode 100644 index 8f3624cb..00000000 --- a/src/test/WixToolsetTest.WixCop/WixToolsetTest.WixCop.v3.ncrunchproject +++ /dev/null @@ -1,6 +0,0 @@ - - - True - - - \ No newline at end of file diff --git a/src/wix/ConsoleMessageListener.cs b/src/wix/ConsoleMessageListener.cs new file mode 100644 index 00000000..709fb576 --- /dev/null +++ b/src/wix/ConsoleMessageListener.cs @@ -0,0 +1,96 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools.Core +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Globalization; + using System.Text; + using System.Threading; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + public sealed class ConsoleMessageListener : IMessageListener + { + public ConsoleMessageListener(string prefix, string appName) + { + this.Prefix = prefix; + this.AppName = appName; + + PrepareConsoleForLocalization(); + } + + public string AppName { get; } + + public string Prefix { get; } + + public void Write(Message message) + { + var filename = message.SourceLineNumbers?.FileName ?? this.AppName; + var type = message.Level.ToString().ToLowerInvariant(); + var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; + + if (message.SourceLineNumbers?.LineNumber.HasValue == true) + { + filename = String.Concat(filename, "(", message.SourceLineNumbers?.LineNumber.Value, ")"); + } + + output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.Prefix, message.Id, message.ToString()); + + var fileNames = GetFileNames(message.SourceLineNumbers); + if (fileNames.Any()) + { + output.WriteLine("Source trace:"); + + foreach (var fileName in fileNames) + { + output.WriteLine("Source trace: {0}", fileName); + } + } + } + + public void Write(string message) + { + Console.Out.WriteLine(message); + } + + public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; + + private static IList GetFileNames(SourceLineNumber sourceLineNumbers) + { + var fileNames = new List(); + + for (var sln = sourceLineNumbers; null != sln; sln = sln.Parent) + { + if (String.IsNullOrEmpty(sln.FileName)) + { + continue; + } + else if (sln.LineNumber.HasValue) + { + fileNames.Add(String.Format(CultureInfo.CurrentUICulture, "{0}: line {1}", sln.FileName, sln.LineNumber)); + } + else + { + fileNames.Add(sln.FileName); + } + } + + return fileNames; + } + + private static void PrepareConsoleForLocalization() + { + Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); + + if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) + { + Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); + } + } + } +} diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 7e302078..3293ef05 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -4,6 +4,7 @@ namespace WixToolset.Tools { using System; using System.Runtime.InteropServices; + using WixToolset.Converters; using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; @@ -24,7 +25,8 @@ namespace WixToolset.Tools [MTAThread] public static int Main(string[] args) { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() + .AddConverter(); var listener = new ConsoleMessageListener("WIX", "wix.exe"); diff --git a/src/wix/app.config b/src/wix/app.config index 65d3d6c3..081fea2c 100644 --- a/src/wix/app.config +++ b/src/wix/app.config @@ -1,10 +1,8 @@ - - - - - - + + + + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 117bbcd9..2507de33 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -21,10 +21,7 @@ - - - - + diff --git a/src/wix/wix.exe.manifest b/src/wix/wix.exe.manifest index 49d90508..f35b5534 100644 --- a/src/wix/wix.exe.manifest +++ b/src/wix/wix.exe.manifest @@ -1,10 +1,8 @@ - - - WiX Toolset Compiler + WiX Toolset Compiler diff --git a/src/wixcop/CommandLine/ConvertCommand.cs b/src/wixcop/CommandLine/ConvertCommand.cs deleted file mode 100644 index 0a765771..00000000 --- a/src/wixcop/CommandLine/ConvertCommand.cs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.WixCop.CommandLine -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Xml; - using WixToolset.Converters; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - - internal class ConvertCommand : ICommandLineCommand - { - private const string SettingsFileDefault = "wixcop.settings.xml"; - - public ConvertCommand(IWixToolsetServiceProvider serviceProvider, bool showLogo, bool fixErrors, int indentationAmount, List searchPatterns, bool subDirectories, string settingsFile1, string settingsFile2) - { - this.ErrorsAsWarnings = new HashSet(); - this.ExemptFiles = new HashSet(); - this.FixErrors = fixErrors; - this.IndentationAmount = indentationAmount; - this.IgnoreErrors = new HashSet(); - this.SearchPatternResults = new HashSet(); - this.SearchPatterns = searchPatterns; - this.ServiceProvider = serviceProvider; - this.SettingsFile1 = settingsFile1; - this.SettingsFile2 = settingsFile2; - this.ShowLogo = showLogo; - this.SubDirectories = subDirectories; - } - - private HashSet ErrorsAsWarnings { get; } - - private HashSet ExemptFiles { get; } - - private bool FixErrors { get; } - - private int IndentationAmount { get; } - - private HashSet IgnoreErrors { get; } - - private HashSet SearchPatternResults { get; } - - private List SearchPatterns { get; } - - private IWixToolsetServiceProvider ServiceProvider { get; } - - private string SettingsFile1 { get; } - - private string SettingsFile2 { get; } - - private bool SubDirectories { get; } - - public bool ShowLogo { get; } - - public bool StopParsing => throw new NotImplementedException(); - - public bool TryParseArgument(ICommandLineParser parser, string argument) - { - throw new NotImplementedException(); - } - - public int Execute() - { - // parse the settings if any were specified - if (null != this.SettingsFile1 || null != this.SettingsFile2) - { - this.ParseSettingsFiles(this.SettingsFile1, this.SettingsFile2); - } - else - { - if (File.Exists(ConvertCommand.SettingsFileDefault)) - { - this.ParseSettingsFiles(ConvertCommand.SettingsFileDefault, null); - } - } - - var messaging = this.ServiceProvider.GetService(); - var converter = new Wix3Converter(messaging, this.IndentationAmount, this.ErrorsAsWarnings, this.IgnoreErrors); - - var errors = this.InspectSubDirectories(converter, Path.GetFullPath(".")); - - foreach (var searchPattern in this.SearchPatterns) - { - if (!this.SearchPatternResults.Contains(searchPattern)) - { - Console.Error.WriteLine("Could not find file \"{0}\"", searchPattern); - errors++; - } - } - - return errors != 0 ? 2 : 0; - } - - /// - /// Get the files that match a search path pattern. - /// - /// The base directory at which to begin the search. - /// The search path pattern. - /// The files matching the pattern. - private static string[] GetFiles(string baseDir, string searchPath) - { - // convert alternate directory separators to the standard one - var filePath = searchPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - var lastSeparator = filePath.LastIndexOf(Path.DirectorySeparatorChar); - string[] files = null; - - try - { - if (0 > lastSeparator) - { - files = Directory.GetFiles(baseDir, filePath); - } - else // found directory separator - { - var searchPattern = filePath.Substring(lastSeparator + 1); - - files = Directory.GetFiles(filePath.Substring(0, lastSeparator + 1), searchPattern); - } - } - catch (DirectoryNotFoundException) - { - // don't let this function throw the DirectoryNotFoundException. (this exception - // occurs for non-existant directories and invalid characters in the searchPattern) - } - - return files; - } - - /// - /// Inspect sub-directories. - /// - /// The directory whose sub-directories will be inspected. - /// The number of errors that were found. - private int InspectSubDirectories(Wix3Converter converter, string directory) - { - var errors = 0; - - foreach (var searchPattern in this.SearchPatterns) - { - foreach (var sourceFilePath in GetFiles(directory, searchPattern)) - { - var file = new FileInfo(sourceFilePath); - - if (!this.ExemptFiles.Contains(file.Name.ToUpperInvariant())) - { - this.SearchPatternResults.Add(searchPattern); - errors += converter.ConvertFile(file.FullName, this.FixErrors); - } - } - } - - if (this.SubDirectories) - { - foreach (var childDirectoryPath in Directory.GetDirectories(directory)) - { - errors += this.InspectSubDirectories(converter, childDirectoryPath); - } - } - - return errors; - } - - /// - /// Parse the primary and secondary settings files. - /// - /// The primary settings file. - /// The secondary settings file. - private void ParseSettingsFiles(string localSettingsFile1, string localSettingsFile2) - { - if (null == localSettingsFile1 && null != localSettingsFile2) - { - throw new ArgumentException("Cannot specify a secondary settings file (set2) without a primary settings file (set1).", "localSettingsFile2"); - } - - var settingsFile = localSettingsFile1; - while (null != settingsFile) - { - XmlTextReader reader = null; - try - { - reader = new XmlTextReader(settingsFile); - var doc = new XmlDocument(); - doc.Load(reader); - - // get the types of tests that will have their errors displayed as warnings - var testsIgnoredElements = doc.SelectNodes("/Settings/IgnoreErrors/Test"); - foreach (XmlElement test in testsIgnoredElements) - { - var key = test.GetAttribute("Id"); - this.IgnoreErrors.Add(key); - } - - // get the types of tests that will have their errors displayed as warnings - var testsAsWarningsElements = doc.SelectNodes("/Settings/ErrorsAsWarnings/Test"); - foreach (XmlElement test in testsAsWarningsElements) - { - var key = test.GetAttribute("Id"); - this.ErrorsAsWarnings.Add(key); - } - - // get the exempt files - var localExemptFiles = doc.SelectNodes("/Settings/ExemptFiles/File"); - foreach (XmlElement file in localExemptFiles) - { - var key = file.GetAttribute("Name").ToUpperInvariant(); - this.ExemptFiles.Add(key); - } - } - finally - { - if (null != reader) - { - reader.Close(); - } - } - - settingsFile = localSettingsFile2; - localSettingsFile2 = null; - } - } - } -} diff --git a/src/wixcop/CommandLine/HelpCommand.cs b/src/wixcop/CommandLine/HelpCommand.cs deleted file mode 100644 index 4a173cd9..00000000 --- a/src/wixcop/CommandLine/HelpCommand.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.WixCop.CommandLine -{ - using System; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - - internal class HelpCommand : ICommandLineCommand - { - public bool ShowLogo => true; - - public bool StopParsing => true; - - public int Execute() - { - Console.WriteLine(" usage: wixcop.exe sourceFile [sourceFile ...]"); - Console.WriteLine(); - Console.WriteLine(" -f fix errors automatically for writable files"); - Console.WriteLine(" -nologo suppress displaying the logo information"); - Console.WriteLine(" -s search for matching files in current dir and subdirs"); - Console.WriteLine(" -set1 primary settings file"); - Console.WriteLine(" -set2 secondary settings file (overrides primary)"); - Console.WriteLine(" -indent: indentation multiple (overrides default of 4)"); - Console.WriteLine(" -? this help information"); - Console.WriteLine(); - Console.WriteLine(" sourceFile may use wildcards like *.wxs"); - - return 0; - } - - public bool TryParseArgument(ICommandLineParser parser, string argument) - { - return true; - } - } -} diff --git a/src/wixcop/CommandLine/WixCopCommandLineParser.cs b/src/wixcop/CommandLine/WixCopCommandLineParser.cs deleted file mode 100644 index f06decee..00000000 --- a/src/wixcop/CommandLine/WixCopCommandLineParser.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.WixCop.CommandLine -{ - using System; - using System.Collections.Generic; - using WixToolset.Core; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Tools.WixCop.Interfaces; - - public sealed class WixCopCommandLineParser : IWixCopCommandLineParser - { - private bool fixErrors; - private int indentationAmount; - private readonly List searchPatterns; - private readonly IWixToolsetServiceProvider serviceProvider; - private string settingsFile1; - private string settingsFile2; - private bool showHelp; - private bool showLogo; - private bool subDirectories; - - public WixCopCommandLineParser(IWixToolsetServiceProvider serviceProvider) - { - this.serviceProvider = serviceProvider; - - this.indentationAmount = 4; - this.searchPatterns = new List(); - this.showLogo = true; - } - - public ICommandLineArguments Arguments { get; set; } - - public ICommandLineCommand ParseWixCopCommandLine() - { - this.Parse(); - - if (this.showLogo) - { - AppCommon.DisplayToolHeader(); - Console.WriteLine(); - } - - if (this.showHelp) - { - return new HelpCommand(); - } - - return new ConvertCommand( - this.serviceProvider, - this.showLogo, - this.fixErrors, - this.indentationAmount, - this.searchPatterns, - this.subDirectories, - this.settingsFile1, - this.settingsFile2); - } - - private void Parse() - { - this.showHelp = 0 == this.Arguments.Arguments.Length; - var parser = this.Arguments.Parse(); - - while (!this.showHelp && - String.IsNullOrEmpty(parser.ErrorArgument) && - parser.TryGetNextSwitchOrArgument(out var arg)) - { - if (String.IsNullOrWhiteSpace(arg)) // skip blank arguments. - { - continue; - } - - if (parser.IsSwitch(arg)) - { - if (!this.ParseArgument(parser, arg)) - { - parser.ErrorArgument = arg; - } - } - else - { - this.searchPatterns.Add(arg); - } - } - } - - private bool ParseArgument(ICommandLineParser parser, string arg) - { - var parameter = arg.Substring(1); - - switch (parameter.ToLowerInvariant()) - { - case "?": - this.showHelp = true; - return true; - case "f": - this.fixErrors = true; - return true; - case "nologo": - this.showLogo = false; - return true; - case "s": - this.subDirectories = true; - return true; - default: // other parameters - if (parameter.StartsWith("set1", StringComparison.Ordinal)) - { - this.settingsFile1 = parameter.Substring(4); - } - else if (parameter.StartsWith("set2", StringComparison.Ordinal)) - { - this.settingsFile2 = parameter.Substring(4); - } - else if (parameter.StartsWith("indent:", StringComparison.Ordinal)) - { - try - { - this.indentationAmount = Convert.ToInt32(parameter.Substring(7)); - } - catch - { - throw new ArgumentException("Invalid numeric argument.", parameter); - } - } - else - { - throw new ArgumentException("Invalid argument.", parameter); - } - return true; - } - } - } -} diff --git a/src/wixcop/Interfaces/IWixCopCommandLineParser.cs b/src/wixcop/Interfaces/IWixCopCommandLineParser.cs deleted file mode 100644 index 44c75289..00000000 --- a/src/wixcop/Interfaces/IWixCopCommandLineParser.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.WixCop.Interfaces -{ - using WixToolset.Extensibility.Data; - - public interface IWixCopCommandLineParser - { - ICommandLineArguments Arguments { get; set; } - - ICommandLineCommand ParseWixCopCommandLine(); - } -} diff --git a/src/wixcop/Program.cs b/src/wixcop/Program.cs deleted file mode 100644 index 5e72f8ea..00000000 --- a/src/wixcop/Program.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.WixCop -{ - using System; - using System.Diagnostics; - using WixToolset.Core; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Tools.Core; - using WixToolset.Tools.WixCop.CommandLine; - using WixToolset.Tools.WixCop.Interfaces; - - /// - /// Wix source code style inspector and converter. - /// - public sealed class Program - { - /// - /// The main entry point for the application. - /// - /// The commandline arguments. - /// The number of errors that were found. - [STAThread] - public static int Main(string[] args) - { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - var listener = new ConsoleMessageListener("WXCP", "wixcop.exe"); - - serviceProvider.AddService((x, y) => listener); - serviceProvider.AddService((x, y) => new WixCopCommandLineParser(x)); - - var program = new Program(); - return program.Run(serviceProvider, args); - } - - /// - /// Run the application with the given arguments. - /// - /// Service provider to use throughout this execution. - /// The commandline arguments. - /// The number of errors that were found. - public int Run(IWixToolsetServiceProvider serviceProvider, string[] args) - { - try - { - var listener = serviceProvider.GetService(); - var messaging = serviceProvider.GetService(); - messaging.SetListener(listener); - - var arguments = serviceProvider.GetService(); - arguments.Populate(args); - - var commandLine = serviceProvider.GetService(); - commandLine.Arguments = arguments; - var command = commandLine.ParseWixCopCommandLine(); - - if (command.ShowLogo) - { - var wixcopAssembly = this.GetType().Assembly; - var fv = FileVersionInfo.GetVersionInfo(wixcopAssembly.Location); - - Console.WriteLine("WiX Cop version {0}", fv.FileVersion); - Console.WriteLine("Copyright (C) .NET Foundation and contributors. All rights reserved."); - Console.WriteLine(); - } - - return command?.Execute() ?? 1; - } - catch (Exception e) - { - Console.Error.WriteLine("wixcop.exe : fatal error WXCP0001 : {0}\r\n\n\nStack Trace:\r\n{1}", e.Message, e.StackTrace); - - return 1; - } - } - } -} diff --git a/src/wixcop/WixCop.csproj b/src/wixcop/WixCop.csproj deleted file mode 100644 index 13a188ab..00000000 --- a/src/wixcop/WixCop.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - netcoreapp2.1;net461;net472 - Exe - Converter - WiX Error Correction Tool - embedded - true - - win-x86 - app.config - wixcop.exe.manifest - Major - - - - NU1701 - - - - - - - - - - - - - - - diff --git a/src/wixcop/WixCop.net461.v3.ncrunchproject b/src/wixcop/WixCop.net461.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/wixcop/WixCop.net461.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject b/src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/wixcop/WixCop.netcoreapp2.1.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/wixcop/app.config b/src/wixcop/app.config deleted file mode 100644 index 65d3d6c3..00000000 --- a/src/wixcop/app.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/wixcop/wixcop.exe.manifest b/src/wixcop/wixcop.exe.manifest deleted file mode 100644 index bf4a93b0..00000000 --- a/src/wixcop/wixcop.exe.manifest +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - WiX Toolset Correction Tool - - - - - - - - - - true - - - -- cgit v1.2.3-55-g6feb From 1a69e7ed4156d15af0b0d479b1c99aa2358fbfc9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 8 Jun 2020 16:27:36 -0700 Subject: Support async execution of commands --- src/wix/Program.cs | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 3293ef05..3b6c45bc 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -4,6 +4,8 @@ namespace WixToolset.Tools { using System; using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; using WixToolset.Converters; using WixToolset.Core; using WixToolset.Data; @@ -23,17 +25,27 @@ namespace WixToolset.Tools /// Commandline arguments for the application. /// Returns the application error code. [MTAThread] - public static int Main(string[] args) + public static async Task Main(string[] args) { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() - .AddConverter(); - + var cts = new CancellationTokenSource(); var listener = new ConsoleMessageListener("WIX", "wix.exe"); + Console.CancelKeyPress += (s, e) => + { + cts.Cancel(); + e.Cancel = true; + }; + try { - var program = new Program(); - return program.Run(serviceProvider, listener, args); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() + .AddConverter(); + + return await Run(serviceProvider, listener, args, cts.Token); + } + catch (OperationCanceledException) + { + return -1; } catch (WixException e) { @@ -58,9 +70,11 @@ namespace WixToolset.Tools /// Executes the wix command-line interface. /// /// Service provider to use throughout this execution. + /// Listener to use for the messaging system. /// Command-line arguments to execute. + /// Cancellation token. /// Returns the application error code. - public int Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) + public static Task Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args, CancellationToken cancellationToken) { var messaging = serviceProvider.GetService(); messaging.SetListener(listener); @@ -72,7 +86,7 @@ namespace WixToolset.Tools commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); commandLine.Arguments = arguments; var command = commandLine.ParseStandardCommandLine(); - return command?.Execute() ?? 1; + return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); } private static IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) -- cgit v1.2.3-55-g6feb From 9c28d92623f1009234f97e43df008e2da8f7a456 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 8 Jun 2020 16:28:16 -0700 Subject: Support "extension" command --- src/wix/Program.cs | 2 ++ src/wix/wix.csproj | 1 + 2 files changed, 3 insertions(+) diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 3b6c45bc..dcf575f7 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -8,6 +8,7 @@ namespace WixToolset.Tools using System.Threading.Tasks; using WixToolset.Converters; using WixToolset.Core; + using WixToolset.Core.ExtensionCache; using WixToolset.Data; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -39,6 +40,7 @@ namespace WixToolset.Tools try { var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() + .AddExtensionCacheManager() .AddConverter(); return await Run(serviceProvider, listener, args, cts.Token); diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 2507de33..4deeee86 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -23,6 +23,7 @@ + -- cgit v1.2.3-55-g6feb From 5edb291f102959e993123ee402d364df450206cf Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 8 Jun 2020 16:59:17 -0700 Subject: Remove WixCop references from build files --- Tools.sln | 20 -------------------- appveyor.cmd | 45 +++++++++++++++++++-------------------------- 2 files changed, 19 insertions(+), 46 deletions(-) diff --git a/Tools.sln b/Tools.sln index d250d0fb..d24fc2a4 100644 --- a/Tools.sln +++ b/Tools.sln @@ -18,10 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixCop", "src\wixcop\WixCop.csproj", "{2E54120B-8958-40B1-A7FC-851446994CD8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.WixCop", "src\test\WixToolsetTest.WixCop\WixToolsetTest.WixCop.csproj", "{F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thmviewer", "src\thmviewer\thmviewer.vcxproj", "{95228C13-97F5-484A-B4A2-ECF4618B0881}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "heat", "src\heat\heat.csproj", "{B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}" @@ -76,22 +72,6 @@ Global {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.Build.0 = Release|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.ActiveCfg = Release|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.Build.0 = Release|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|x86.ActiveCfg = Debug|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Debug|x86.Build.0 = Debug|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|Any CPU.Build.0 = Release|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|x86.ActiveCfg = Release|Any CPU - {2E54120B-8958-40B1-A7FC-851446994CD8}.Release|x86.Build.0 = Release|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|x86.ActiveCfg = Debug|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Debug|x86.Build.0 = Debug|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|Any CPU.Build.0 = Release|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|x86.ActiveCfg = Release|Any CPU - {F1A8112B-95A1-4AF7-81CB-523BE7DB8E5C}.Release|x86.Build.0 = Release|Any CPU {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.ActiveCfg = Debug|Win32 {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.ActiveCfg = Debug|Win32 {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.Build.0 = Debug|Win32 diff --git a/appveyor.cmd b/appveyor.cmd index bceeb691..f07255b8 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -2,51 +2,44 @@ @pushd %~dp0 @set _C=Release @set _P=%~dp0build\%_C%\publish -@set _RCO=/S /R:1 /W:1 /NP /XO +@set _RCO=/S /R:1 /W:1 /NP /XO /NS /NC /NFL /NDL /NJH /NJS -nuget restore +nuget restore || exit /b %ERRORLEVEL% -dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks -dotnet test -c %_C% src\test\WixToolsetTest.WixCop +dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix +dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wixcop\ -f net461 -r win-x86 src\wixcop +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix || exit /b %ERRORLEVEL% robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\heat %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wix %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% -robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wixcop %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wixcop\ -f net461 -r win-x64 src\wixcop +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix || exit /b %ERRORLEVEL% robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\heat %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wix %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% -robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wixcop %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wixcop\ -f netcoreapp2.1 src\wixcop +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix || exit /b %ERRORLEVEL% robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% -robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wixcop %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\broken\net461\ -f net461 -r dne src\wix +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\broken\net461\ -f net461 -r dne src\wix || exit /b %ERRORLEVEL% -dotnet test -c %_C% src\test\WixToolsetTest.MSBuild +dotnet test -c %_C% src\test\WixToolsetTest.MSBuild || exit /b %ERRORLEVEL% -dotnet pack -c %_C% src\dotnet-wix -dotnet pack -c %_C% src\WixToolset.MSBuild +dotnet pack -c %_C% src\dotnet-wix || exit /b %ERRORLEVEL% +dotnet pack -c %_C% src\WixToolset.MSBuild || exit /b %ERRORLEVEL% -msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj +msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj || exit /b %ERRORLEVEL% @popd @endlocal -- cgit v1.2.3-55-g6feb From 74e57bee9f6d9029cbbb2977c18f02d8ec18c50c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 10 Jun 2020 08:11:09 -0700 Subject: Update MSBuild task to support async commands and push heat out of proc --- src/WixToolset.BuildTasks/HeatTask.cs | 5 +++++ src/WixToolset.BuildTasks/HeatTask_InProc.cs | 16 ++++------------ src/WixToolset.BuildTasks/ToolsetTask_InProc.cs | 14 ++++++++++---- src/WixToolset.BuildTasks/WixBuild_InProc.cs | 7 ++++--- src/heat/Program.cs | 10 ++++++---- src/heat/heat.csproj | 2 +- src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 4 ++-- 7 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/WixToolset.BuildTasks/HeatTask.cs b/src/WixToolset.BuildTasks/HeatTask.cs index 99cbae77..18c08342 100644 --- a/src/WixToolset.BuildTasks/HeatTask.cs +++ b/src/WixToolset.BuildTasks/HeatTask.cs @@ -17,6 +17,11 @@ namespace WixToolset.BuildTasks private bool suppressUniqueIds; private string[] transforms; + public HeatTask() + { + this.RunAsSeparateProcess = true; + } + public bool AutogenerateGuids { get { return this.autogenerageGuids; } diff --git a/src/WixToolset.BuildTasks/HeatTask_InProc.cs b/src/WixToolset.BuildTasks/HeatTask_InProc.cs index eb6feafc..dd763608 100644 --- a/src/WixToolset.BuildTasks/HeatTask_InProc.cs +++ b/src/WixToolset.BuildTasks/HeatTask_InProc.cs @@ -3,6 +3,9 @@ #if !NETCOREAPP namespace WixToolset.BuildTasks { + using System; + using System.Threading; + using System.Threading.Tasks; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; @@ -12,18 +15,7 @@ namespace WixToolset.BuildTasks { protected sealed override string TaskShortName => "HEAT"; - protected sealed override int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) - { - var messaging = serviceProvider.GetService(); - messaging.SetListener(listener); - - var arguments = serviceProvider.GetService(); - arguments.Populate(commandLineString); - - var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider, true); - var command = commandLine.ParseStandardCommandLine(arguments); - return command?.Execute() ?? -1; - } + protected sealed override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider serviceProvider, string commandLineString, CancellationToken cancellationToken) => throw new NotImplementedException(); } } #endif diff --git a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs b/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs index a3290e60..6c83ee11 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs @@ -5,6 +5,8 @@ namespace WixToolset.BuildTasks { using System; using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; using Microsoft.Build.Framework; using WixToolset.Core; using WixToolset.Data; @@ -27,13 +29,17 @@ namespace WixToolset.BuildTasks { this.Log.LogMessage(MessageImportance.Normal, $"({this.ToolName}){commandLineString}"); - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); var listener = new MsbuildMessageListener(this.Log, this.TaskShortName, this.BuildEngine.ProjectFileOfTaskNode); - int exitCode = -1; + var exitCode = -1; try { - exitCode = this.ExecuteCore(serviceProvider, listener, commandLineString); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + exitCode = this.ExecuteCoreAsync(serviceProvider, commandLineString, CancellationToken.None).GetAwaiter().GetResult(); } catch (WixException e) { @@ -65,7 +71,7 @@ namespace WixToolset.BuildTasks } } - protected abstract int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener messageListener, string commandLineString); + protected abstract Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider serviceProvider, string commandLineString, CancellationToken cancellationToken); protected abstract string TaskShortName { get; } } diff --git a/src/WixToolset.BuildTasks/WixBuild_InProc.cs b/src/WixToolset.BuildTasks/WixBuild_InProc.cs index 49148c8a..59a42431 100644 --- a/src/WixToolset.BuildTasks/WixBuild_InProc.cs +++ b/src/WixToolset.BuildTasks/WixBuild_InProc.cs @@ -3,6 +3,8 @@ #if !NETCOREAPP namespace WixToolset.BuildTasks { + using System.Threading; + using System.Threading.Tasks; using WixToolset.Data; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -12,10 +14,9 @@ namespace WixToolset.BuildTasks { protected override string TaskShortName => "WIX"; - protected override int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString) + protected override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider serviceProvider, string commandLineString, CancellationToken cancellationToken) { var messaging = serviceProvider.GetService(); - messaging.SetListener(listener); var arguments = serviceProvider.GetService(); arguments.Populate(commandLineString); @@ -24,7 +25,7 @@ namespace WixToolset.BuildTasks commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); commandLine.Arguments = arguments; var command = commandLine.ParseStandardCommandLine(); - return command?.Execute() ?? -1; + return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); } private IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) diff --git a/src/heat/Program.cs b/src/heat/Program.cs index 38d6d401..30a82511 100644 --- a/src/heat/Program.cs +++ b/src/heat/Program.cs @@ -4,6 +4,8 @@ namespace WixToolset.Tools.Heat { using System; using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; using WixToolset.Core; using WixToolset.Data; using WixToolset.Extensibility; @@ -23,7 +25,7 @@ namespace WixToolset.Tools.Heat /// Commandline arguments for the application. /// Returns the application error code. [MTAThread] - public static int Main(string[] args) + public static async Task Main(string[] args) { var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); var listener = new ConsoleMessageListener("HEAT", "heat.exe"); @@ -31,7 +33,7 @@ namespace WixToolset.Tools.Heat try { var program = new Program(); - return program.Run(serviceProvider, listener, args); + return await program.Run(serviceProvider, listener, args); } catch (WixException e) { @@ -58,7 +60,7 @@ namespace WixToolset.Tools.Heat /// Service provider to use throughout this execution. /// The commandline arguments. /// Returns the application error code. - public int Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) + public Task Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) { var messaging = serviceProvider.GetService(); messaging.SetListener(listener); @@ -68,7 +70,7 @@ namespace WixToolset.Tools.Heat var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider); var command = commandLine.ParseStandardCommandLine(arguments); - return command?.Execute() ?? 1; + return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); } } } diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 9d6eeaa7..bdcb4e3b 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index f5f03be0..3b4457be 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -33,7 +33,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem); + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); Assert.Single(heatCommandLines); var warnings = result.Output.Where(line => line.Contains(": warning")); @@ -89,7 +89,7 @@ namespace WixToolsetTest.MSBuild var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); result.AssertSuccess(); - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem); + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); Assert.Equal(2, heatCommandLines.Count()); var warnings = result.Output.Where(line => line.Contains(": warning")); -- cgit v1.2.3-55-g6feb From 486274efa2f919ec61e2208ef82c082f517a4108 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 10 Jun 2020 21:53:16 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 98fa23e91bca6d6a67457df056d0cb6cecf12901 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 13 Jun 2020 09:42:44 -0700 Subject: Use simplified command-line parsing and update loading standard backends --- src/WixToolset.BuildTasks/HeatTask_InProc.cs | 5 +-- src/WixToolset.BuildTasks/ToolsetTask_InProc.cs | 8 ++-- src/WixToolset.BuildTasks/WixBuild_InProc.cs | 43 ++++------------------ .../WixToolsetTest.BuildTasks.v3.ncrunchproject | 3 ++ .../WixToolsetTest.MSBuild.v3.ncrunchproject | 3 ++ src/wix/Program.cs | 34 +++-------------- 6 files changed, 23 insertions(+), 73 deletions(-) diff --git a/src/WixToolset.BuildTasks/HeatTask_InProc.cs b/src/WixToolset.BuildTasks/HeatTask_InProc.cs index dd763608..a21a8409 100644 --- a/src/WixToolset.BuildTasks/HeatTask_InProc.cs +++ b/src/WixToolset.BuildTasks/HeatTask_InProc.cs @@ -6,16 +6,13 @@ namespace WixToolset.BuildTasks using System; using System.Threading; using System.Threading.Tasks; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; - using WixToolset.Harvesters; public partial class HeatTask { protected sealed override string TaskShortName => "HEAT"; - protected sealed override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider serviceProvider, string commandLineString, CancellationToken cancellationToken) => throw new NotImplementedException(); + protected sealed override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken) => throw new NotImplementedException(); } } #endif diff --git a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs b/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs index 6c83ee11..fcf4aea9 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs @@ -34,12 +34,12 @@ namespace WixToolset.BuildTasks try { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var coreProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - var messaging = serviceProvider.GetService(); + var messaging = coreProvider.GetService(); messaging.SetListener(listener); - exitCode = this.ExecuteCoreAsync(serviceProvider, commandLineString, CancellationToken.None).GetAwaiter().GetResult(); + exitCode = this.ExecuteCoreAsync(coreProvider, commandLineString, CancellationToken.None).GetAwaiter().GetResult(); } catch (WixException e) { @@ -71,7 +71,7 @@ namespace WixToolset.BuildTasks } } - protected abstract Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider serviceProvider, string commandLineString, CancellationToken cancellationToken); + protected abstract Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken); protected abstract string TaskShortName { get; } } diff --git a/src/WixToolset.BuildTasks/WixBuild_InProc.cs b/src/WixToolset.BuildTasks/WixBuild_InProc.cs index 59a42431..a45d2369 100644 --- a/src/WixToolset.BuildTasks/WixBuild_InProc.cs +++ b/src/WixToolset.BuildTasks/WixBuild_InProc.cs @@ -5,52 +5,23 @@ namespace WixToolset.BuildTasks { using System.Threading; using System.Threading.Tasks; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Data; + using WixToolset.Core.Burn; + using WixToolset.Core.WindowsInstaller; using WixToolset.Extensibility.Services; public partial class WixBuild { protected override string TaskShortName => "WIX"; - protected override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider serviceProvider, string commandLineString, CancellationToken cancellationToken) + protected override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken) { - var messaging = serviceProvider.GetService(); + coreProvider.AddWindowsInstallerBackend() + .AddBundleBackend(); - var arguments = serviceProvider.GetService(); - arguments.Populate(commandLineString); - - var commandLine = serviceProvider.GetService(); - commandLine.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); - commandLine.Arguments = arguments; - var command = commandLine.ParseStandardCommandLine(); + var commandLine = coreProvider.GetService(); + var command = commandLine.CreateCommand(commandLineString); return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); } - - private IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) - { - var extensionManager = serviceProvider.GetService(); - - foreach (var type in new[] { typeof(WixToolset.Core.Burn.WixToolsetStandardBackend), typeof(WixToolset.Core.WindowsInstaller.WixToolsetStandardBackend) }) - { - extensionManager.Add(type.Assembly); - } - - foreach (var extension in extensions) - { - try - { - extensionManager.Load(extension); - } - catch (WixException e) - { - messaging.Write(e.Error); - } - } - - return extensionManager; - } } } #endif diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject index cf22dfa9..f1d03cd7 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject @@ -1,5 +1,8 @@  + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject index cf22dfa9..f1d03cd7 100644 --- a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject +++ b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject @@ -1,5 +1,8 @@  + + + \ No newline at end of file diff --git a/src/wix/Program.cs b/src/wix/Program.cs index dcf575f7..df0e22e7 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -8,7 +8,9 @@ namespace WixToolset.Tools using System.Threading.Tasks; using WixToolset.Converters; using WixToolset.Core; + using WixToolset.Core.Burn; using WixToolset.Core.ExtensionCache; + using WixToolset.Core.WindowsInstaller; using WixToolset.Data; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -40,6 +42,8 @@ namespace WixToolset.Tools try { var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() + .AddWindowsInstallerBackend() + .AddBundleBackend() .AddExtensionCacheManager() .AddConverter(); @@ -81,38 +85,10 @@ namespace WixToolset.Tools var messaging = serviceProvider.GetService(); messaging.SetListener(listener); - var arguments = serviceProvider.GetService(); - arguments.Populate(args); - var commandLine = serviceProvider.GetService(); - commandLine.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider, messaging, arguments.Extensions); - commandLine.Arguments = arguments; - var command = commandLine.ParseStandardCommandLine(); + var command = commandLine.CreateCommand(args); return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); } - private static IExtensionManager CreateExtensionManagerWithStandardBackends(IWixToolsetServiceProvider serviceProvider, IMessaging messaging, string[] extensions) - { - var extensionManager = serviceProvider.GetService(); - - foreach (var type in new[] { typeof(WixToolset.Core.Burn.WixToolsetStandardBackend), typeof(WixToolset.Core.WindowsInstaller.WixToolsetStandardBackend) }) - { - extensionManager.Add(type.Assembly); - } - - foreach (var extension in extensions) - { - try - { - extensionManager.Load(extension); - } - catch (WixException e) - { - messaging.Write(e.Error); - } - } - - return extensionManager; - } } } -- cgit v1.2.3-55-g6feb From ad523168cae1ac40580186b1ac446ea6ead9f188 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 15 Jun 2020 23:21:14 +1000 Subject: Make it impossible for Heat to try to run in-proc. --- appveyor.cmd | 36 +++++++++++----------- src/WixToolset.BuildTasks/HeatTask_InProc.cs | 2 ++ src/WixToolset.BuildTasks/ToolsetTask.cs | 2 +- .../WixToolset.BuildTasks.csproj | 1 - 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index f07255b8..f5141c14 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -4,42 +4,42 @@ @set _P=%~dp0build\%_C%\publish @set _RCO=/S /R:1 /W:1 /NP /XO /NS /NC /NFL /NDL /NJH /NJS -nuget restore || exit /b %ERRORLEVEL% +nuget restore || exit /b -dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks || exit /b %ERRORLEVEL% +dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix || exit /b robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\heat %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wix %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix || exit /b robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\heat %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wix %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix || exit /b robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% /XF Microsoft.Build.*.dll robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild || exit /b %ERRORLEVEL% -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\broken\net461\ -f net461 -r dne src\wix || exit /b %ERRORLEVEL% +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\broken\net461\ -f net461 -r dne src\wix || exit /b -dotnet test -c %_C% src\test\WixToolsetTest.MSBuild || exit /b %ERRORLEVEL% +dotnet test -c %_C% src\test\WixToolsetTest.MSBuild || exit /b -dotnet pack -c %_C% src\dotnet-wix || exit /b %ERRORLEVEL% -dotnet pack -c %_C% src\WixToolset.MSBuild || exit /b %ERRORLEVEL% +dotnet pack -c %_C% src\dotnet-wix || exit /b +dotnet pack -c %_C% src\WixToolset.MSBuild || exit /b -msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj || exit /b %ERRORLEVEL% +msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj || exit /b @popd @endlocal diff --git a/src/WixToolset.BuildTasks/HeatTask_InProc.cs b/src/WixToolset.BuildTasks/HeatTask_InProc.cs index a21a8409..48ee9e02 100644 --- a/src/WixToolset.BuildTasks/HeatTask_InProc.cs +++ b/src/WixToolset.BuildTasks/HeatTask_InProc.cs @@ -10,6 +10,8 @@ namespace WixToolset.BuildTasks public partial class HeatTask { + public override bool RunAsSeparateProcess { get => true; } + protected sealed override string TaskShortName => "HEAT"; protected sealed override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken) => throw new NotImplementedException(); diff --git a/src/WixToolset.BuildTasks/ToolsetTask.cs b/src/WixToolset.BuildTasks/ToolsetTask.cs index ae11254a..6b171eb0 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask.cs @@ -29,7 +29,7 @@ namespace WixToolset.BuildTasks /// Gets or sets a flag indicating whether the task /// should be run as separate process or in-proc. /// - public bool RunAsSeparateProcess { get; set; } + public virtual bool RunAsSeparateProcess { get; set; } /// /// Gets or sets whether all warnings should be suppressed. diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 6709949e..e70a6c66 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -25,7 +25,6 @@ - -- cgit v1.2.3-55-g6feb From 10869d880a868b5f52a1a93e1f636eff2594c721 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 17 Jun 2020 16:50:03 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From cb0d27d0fd3aa56c4186d8bf4d3a6357a75cfa6c Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 17 Jun 2020 20:02:15 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 7eab1eb96794e9dbf33414d1f7804a915bdb3bf9 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 22 Jun 2020 14:16:58 +1000 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 4a30b5af2909452db7995b75406c45429c85f4ef Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 22 Jun 2020 17:01:56 +1000 Subject: Update thmviewer to show theme load errors. --- Tools.sln | 1 + src/thmviewer/load.cpp | 2 + src/thmviewer/packages.config | 4 +- src/thmviewer/precomp.h | 1 + src/thmviewer/thmviewer.cpp | 94 +++++++++++++++++++++++++++++++++++++---- src/thmviewer/thmviewer.vcxproj | 4 +- 6 files changed, 94 insertions(+), 12 deletions(-) diff --git a/Tools.sln b/Tools.sln index d24fc2a4..66f867d5 100644 --- a/Tools.sln +++ b/Tools.sln @@ -73,6 +73,7 @@ Global {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.ActiveCfg = Release|Any CPU {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.Build.0 = Release|Any CPU {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.Build.0 = Debug|Win32 {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.ActiveCfg = Debug|Win32 {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.Build.0 = Debug|Win32 {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|Any CPU.ActiveCfg = Release|Win32 diff --git a/src/thmviewer/load.cpp b/src/thmviewer/load.cpp index cd48caff..0267402a 100644 --- a/src/thmviewer/load.cpp +++ b/src/thmviewer/load.cpp @@ -106,6 +106,8 @@ static DWORD WINAPI LoadThreadProc( FILETIME ftModified = { }; FileGetTime(sczThemePath, NULL, NULL, &ftModified); + ::SendMessageW(hWnd, WM_THMVWR_THEME_LOAD_BEGIN, 0, 0); + // Try to load the theme file. hr = ThemeLoadFromFile(sczThemePath, &pTheme); if (FAILED(hr)) diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 05bd6cc6..38ce9597 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -1,5 +1,5 @@ - + - + \ No newline at end of file diff --git a/src/thmviewer/precomp.h b/src/thmviewer/precomp.h index 1d186cf4..15d889fc 100644 --- a/src/thmviewer/precomp.h +++ b/src/thmviewer/precomp.h @@ -42,6 +42,7 @@ enum WM_THMVWR WM_THMVWR_PARSE_FILE, WM_THMVWR_NEW_THEME, WM_THMVWR_THEME_LOAD_ERROR, + WM_THMVWR_THEME_LOAD_BEGIN, }; extern "C" HRESULT DisplayStart( diff --git a/src/thmviewer/thmviewer.cpp b/src/thmviewer/thmviewer.cpp index 425cdf43..adad3f50 100644 --- a/src/thmviewer/thmviewer.cpp +++ b/src/thmviewer/thmviewer.cpp @@ -6,6 +6,7 @@ static const LPCWSTR THMVWR_WINDOW_CLASS_MAIN = L"ThmViewerMain"; static THEME* vpTheme = NULL; static DWORD vdwDisplayThreadId = 0; +static LPWSTR vsczThemeLoadErrors = NULL; enum THMVWR_CONTROL { @@ -39,6 +40,9 @@ static LRESULT CALLBACK MainWndProc( __in WPARAM wParam, __in LPARAM lParam ); +static void OnThemeLoadBegin( + __in_z_opt LPWSTR sczThemeLoadErrors + ); static void OnThemeLoadError( __in THEME* pTheme, __in HRESULT hrFailure @@ -48,6 +52,15 @@ static void OnNewTheme( __in HWND hWnd, __in HANDLE_THEME* pHandle ); +static void CALLBACK ThmviewerTraceError( + __in_z LPCSTR szFile, + __in int iLine, + __in REPORT_LEVEL rl, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ); int WINAPI wWinMain( @@ -76,6 +89,8 @@ int WINAPI wWinMain( ExitOnFailure(hr, "Failed to initialize COM."); fComInitialized = TRUE; + DutilInitialize(&ThmviewerTraceError); + hr = ProcessCommandLine(lpCmdLine, &sczThemeFile, &sczWxlFile); ExitOnFailure(hr, "Failed to process command line."); @@ -161,6 +176,7 @@ LExit: ThemeFree(vpTheme); ThemeUninitialize(); + DutilUninitialize(); // uninitialize COM if (fComInitialized) @@ -168,11 +184,45 @@ LExit: ::CoUninitialize(); } + ReleaseNullStr(vsczThemeLoadErrors); ReleaseStr(sczThemeFile); ReleaseStr(sczWxlFile); return hr; } +static void CALLBACK ThmviewerTraceError( + __in_z LPCSTR /*szFile*/, + __in int /*iLine*/, + __in REPORT_LEVEL /*rl*/, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ) +{ + HRESULT hr = S_OK; + LPSTR sczFormattedAnsi = NULL; + LPWSTR sczMessage = NULL; + + if (DUTIL_SOURCE_THMUTIL != source) + { + ExitFunction(); + } + + hr = StrAnsiAllocFormattedArgs(&sczFormattedAnsi, szFormat, args); + ExitOnFailure(hr, "Failed to format error log string."); + + hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x: %S\r\n", hrError, sczFormattedAnsi); + ExitOnFailure(hr, "Failed to prepend error number to error log string."); + + hr = StrAllocConcat(&vsczThemeLoadErrors, sczMessage, 0); + ExitOnFailure(hr, "Failed to append theme load error."); + +LExit: + ReleaseStr(sczFormattedAnsi); + ReleaseStr(sczMessage); +} + // // ProcessCommandLine - process the provided command line arguments. @@ -311,6 +361,10 @@ static LRESULT CALLBACK MainWndProc( } break; + case WM_THMVWR_THEME_LOAD_BEGIN: + OnThemeLoadBegin(vsczThemeLoadErrors); + return 0; + case WM_THMVWR_THEME_LOAD_ERROR: OnThemeLoadError(vpTheme, lParam); return 0; @@ -351,6 +405,13 @@ static LRESULT CALLBACK MainWndProc( return ThemeDefWindowProc(vpTheme, hWnd, uMsg, wParam, lParam); } +static void OnThemeLoadBegin( + __in_z_opt LPWSTR sczThemeLoadErrors + ) +{ + ReleaseNullStr(sczThemeLoadErrors); +} + static void OnThemeLoadError( __in THEME* pTheme, __in HRESULT hrFailure @@ -358,6 +419,8 @@ static void OnThemeLoadError( { HRESULT hr = S_OK; LPWSTR sczMessage = NULL; + LPWSTR* psczErrors = NULL; + UINT cErrors = 0; TVINSERTSTRUCTW tvi = { }; // Add the application node. @@ -368,22 +431,37 @@ static void OnThemeLoadError( tvi.item.pszText = L"Failed to load theme."; tvi.hParent = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); - hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x.", hrFailure); - ExitOnFailure(hr, "Failed to format error message."); + if (!vsczThemeLoadErrors) + { + hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x.", hrFailure); + ExitOnFailure(hr, "Failed to format error message."); + + tvi.item.pszText = sczMessage; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); - tvi.item.pszText = sczMessage; - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + hr = StrAllocFromError(&sczMessage, hrFailure, NULL); + ExitOnFailure(hr, "Failed to format error message text."); - hr = StrAllocFromError(&sczMessage, hrFailure, NULL); - ExitOnFailure(hr, "Failed to format error message text."); + tvi.item.pszText = sczMessage; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + } + else + { + hr = StrSplitAllocArray(&psczErrors, &cErrors, vsczThemeLoadErrors, L"\r\n"); + ExitOnFailure(hr, "Failed to split theme load errors."); - tvi.item.pszText = sczMessage; - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + for (DWORD i = 0; i < cErrors; ++i) + { + tvi.item.pszText = psczErrors[i]; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + } + } ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_EXPAND, TVE_EXPAND, reinterpret_cast(tvi.hParent)); LExit: ReleaseStr(sczMessage); + ReleaseMem(psczErrors); } diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index ea589b4c..47b72f78 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -2,7 +2,7 @@ - + @@ -70,6 +70,6 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + -- cgit v1.2.3-55-g6feb From 431ac2dcd9823fa0abbbcb16b833a83e3bd4faf9 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 24 Jun 2020 09:46:31 +1000 Subject: Add SourceLink to C++ projects. --- src/thmviewer/packages.config | 3 +++ src/thmviewer/thmviewer.vcxproj | 15 ++++++++++++++- src/thmviewer/thmviewer.vcxproj.filters | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 38ce9597..f3abcd35 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -1,5 +1,8 @@  + + + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index 47b72f78..fb9908e6 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -2,6 +2,9 @@ + + + @@ -50,6 +53,7 @@ + @@ -62,6 +66,9 @@ + + + @@ -69,7 +76,13 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj.filters b/src/thmviewer/thmviewer.vcxproj.filters index 9a1eff3f..488d5510 100644 --- a/src/thmviewer/thmviewer.vcxproj.filters +++ b/src/thmviewer/thmviewer.vcxproj.filters @@ -35,6 +35,7 @@ Resource Files + -- cgit v1.2.3-55-g6feb From 37440a2e80c30cdce283bc570d92afe94430a345 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 25 Jun 2020 16:40:41 -0400 Subject: Support SDK-style projects with MSBuild SDK assets. --- src/WixToolset.MSBuild/Sdk/Sdk.props | 22 ++++++++++++++++++++++ src/WixToolset.MSBuild/Sdk/Sdk.targets | 15 +++++++++++++++ src/WixToolset.MSBuild/WixToolset.MSBuild.csproj | 2 ++ src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 1 + 4 files changed, 40 insertions(+) create mode 100644 src/WixToolset.MSBuild/Sdk/Sdk.props create mode 100644 src/WixToolset.MSBuild/Sdk/Sdk.targets diff --git a/src/WixToolset.MSBuild/Sdk/Sdk.props b/src/WixToolset.MSBuild/Sdk/Sdk.props new file mode 100644 index 00000000..acbe994c --- /dev/null +++ b/src/WixToolset.MSBuild/Sdk/Sdk.props @@ -0,0 +1,22 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) + + + + true + true + true + + + + + + + diff --git a/src/WixToolset.MSBuild/Sdk/Sdk.targets b/src/WixToolset.MSBuild/Sdk/Sdk.targets new file mode 100644 index 00000000..e21cf5c6 --- /dev/null +++ b/src/WixToolset.MSBuild/Sdk/Sdk.targets @@ -0,0 +1,15 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + $(DefaultItemExcludes);$(BaseOutputPath)** + $(DefaultItemExcludes);$(BaseIntermediateOutputPath)** + $(DefaultItemExcludesInProjectFolder);**/.*/** + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj index ba67660c..a145c864 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj @@ -17,6 +17,8 @@ + + diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec index be04d21b..591b63a6 100644 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec @@ -12,6 +12,7 @@ + -- cgit v1.2.3-55-g6feb From 45fa3b78c4069a6046c172fb3e18c878a58f4e69 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 25 Jun 2020 15:44:40 -0700 Subject: The Great Tuple to Symbol Rename (tm) --- src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs | 8 ++++---- src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index cd41f16e..87382cb8 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -8,7 +8,7 @@ namespace WixToolsetTest.BuildTasks using WixBuildTools.TestSupport; using WixToolset.BuildTasks; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using Xunit; public class WixBuildTaskFixture @@ -57,9 +57,9 @@ namespace WixToolsetTest.BuildTasks var intermediate = Intermediate.Load(pdbPath); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileTuple[FileTupleFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } } } diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs index 3b4457be..b5b97649 100644 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs @@ -9,7 +9,7 @@ namespace WixToolsetTest.MSBuild using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; - using WixToolset.Data.Tuples; + using WixToolset.Data.Symbols; using Xunit; public class MsbuildHeatFixture @@ -65,8 +65,8 @@ namespace WixToolsetTest.MSBuild var intermediate = Intermediate.Load(pdbPath); var section = intermediate.Sections.Single(); - var fileTuple = section.Tuples.OfType().Single(); - Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileTuple[FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); } } @@ -141,9 +141,9 @@ namespace WixToolsetTest.MSBuild var intermediate = Intermediate.Load(pdbPath); var section = intermediate.Sections.Single(); - var fileTuples = section.Tuples.OfType().ToArray(); - Assert.Equal(@"SourceDir\MyProgram.txt", fileTuples[0][FileTupleFields.Source].PreviousValue.AsPath().Path); - Assert.Equal(@"SourceDir\MyProgram.json", fileTuples[1][FileTupleFields.Source].PreviousValue.AsPath().Path); + var fileSymbols = section.Symbols.OfType().ToArray(); + Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); } } } -- cgit v1.2.3-55-g6feb From 448c960dac5dc9b755b92f7d4b130dc998d64c70 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 26 Jun 2020 00:42:14 -0700 Subject: Add a default TargetFramework to the SDK --- src/WixToolset.MSBuild/Sdk/Sdk.props | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WixToolset.MSBuild/Sdk/Sdk.props b/src/WixToolset.MSBuild/Sdk/Sdk.props index acbe994c..5080e393 100644 --- a/src/WixToolset.MSBuild/Sdk/Sdk.props +++ b/src/WixToolset.MSBuild/Sdk/Sdk.props @@ -10,6 +10,7 @@ + netstandard2.0 true true true -- cgit v1.2.3-55-g6feb From 5f89a76d42dd9d132f4454e196e4f26fd65333ee Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 26 Jun 2020 01:09:40 -0700 Subject: Rename WixToolset.Msbuild to WixToolset.Sdk --- Tools.sln | 4 +- appveyor.cmd | 52 +- src/Wix.Build.props | 2 +- src/WixToolset.MSBuild/Sdk/Sdk.props | 23 - src/WixToolset.MSBuild/Sdk/Sdk.targets | 15 - src/WixToolset.MSBuild/WixToolset.MSBuild.csproj | 38 - src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec | 18 - .../WixToolset.MSBuild.v3.ncrunchproject | 5 - .../build/WixToolset.MSBuild.props | 8 - src/WixToolset.MSBuild/tools/wix.ca.targets | 123 --- src/WixToolset.MSBuild/tools/wix.harvest.targets | 512 --------- src/WixToolset.MSBuild/tools/wix.signing.targets | 370 ------- src/WixToolset.MSBuild/tools/wix.targets | 1083 -------------------- src/WixToolset.Sdk/Sdk/Sdk.props | 23 + src/WixToolset.Sdk/Sdk/Sdk.targets | 15 + src/WixToolset.Sdk/WixToolset.Sdk.csproj | 38 + src/WixToolset.Sdk/WixToolset.Sdk.nuspec | 18 + .../WixToolset.Sdk.v3.ncrunchproject | 5 + src/WixToolset.Sdk/build/WixToolset.Sdk.props | 8 + src/WixToolset.Sdk/tools/wix.ca.targets | 123 +++ src/WixToolset.Sdk/tools/wix.harvest.targets | 512 +++++++++ src/WixToolset.Sdk/tools/wix.signing.targets | 370 +++++++ src/WixToolset.Sdk/tools/wix.targets | 1083 ++++++++++++++++++++ .../WixToolsetTest.BuildTasks.csproj | 8 +- src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs | 408 -------- .../WixToolsetTest.MSBuild/MsbuildHeatFixture.cs | 150 --- .../WixToolsetTest.MSBuild/MsbuildUtilities.cs | 98 -- src/test/WixToolsetTest.MSBuild/README.md | 5 - .../HeatFileMultipleFilesSameFileName.wixproj | 58 -- .../MyProgram.json | 1 - .../MyProgram.txt | 1 - .../HeatFileMultipleFilesSameFileName/Package.wxs | 22 - .../HeatFilePackage/HeatFilePackage.wixproj | 53 - .../TestData/HeatFilePackage/Package.wxs | 21 - .../MergeMsiPackage/MergeMsiPackage.wixproj | 44 - .../MergeModule/MergeMsiPackage/Package.wxs | 22 - .../MergeModule/SimpleMergeModule/MergeModule.wxs | 22 - .../SimpleMergeModule/SimpleMergeModule.wixproj | 42 - .../SimpleMergeModule/data/MergeModule.txt | 1 - .../MsiPackage/MsiPackage.wixproj | 50 - .../MsiPackage/Package.de-de.wxl | 11 - .../MsiPackage/Package.en-us.wxl | 11 - .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 21 - .../MsiPackage/PackageComponents.wxs | 10 - .../MsiPackage/data/test.txt | 1 - .../MultiCulturalMsiPackage.sln | 31 - .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 46 - .../SimpleMsiPackage/MsiPackage/Package.en-us.wxl | 11 - .../SimpleMsiPackage/MsiPackage/Package.wxs | 25 - .../MsiPackage/PackageComponents.wxs | 10 - .../SimpleMsiPackage/MsiPackage/data/test.txt | 1 - .../SimpleMsiPackage/SimpleBundle/Bundle.wxs | 10 - .../SimpleBundle/SimpleBundle.wixproj | 42 - .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 39 - .../WixToolsetTest.MSBuild.csproj | 48 - .../WixToolsetTest.MSBuild.v3.ncrunchproject | 8 - src/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 408 ++++++++ src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | 150 +++ src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs | 98 ++ src/test/WixToolsetTest.Sdk/README.md | 5 + .../HeatFileMultipleFilesSameFileName.wixproj | 58 ++ .../MyProgram.json | 1 + .../MyProgram.txt | 1 + .../HeatFileMultipleFilesSameFileName/Package.wxs | 22 + .../HeatFilePackage/HeatFilePackage.wixproj | 53 + .../TestData/HeatFilePackage/Package.wxs | 21 + .../MergeMsiPackage/MergeMsiPackage.wixproj | 44 + .../MergeModule/MergeMsiPackage/Package.wxs | 22 + .../MergeModule/SimpleMergeModule/MergeModule.wxs | 22 + .../SimpleMergeModule/SimpleMergeModule.wixproj | 42 + .../SimpleMergeModule/data/MergeModule.txt | 1 + .../MsiPackage/MsiPackage.wixproj | 50 + .../MsiPackage/Package.de-de.wxl | 11 + .../MsiPackage/Package.en-us.wxl | 11 + .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 21 + .../MsiPackage/PackageComponents.wxs | 10 + .../MsiPackage/data/test.txt | 1 + .../MultiCulturalMsiPackage.sln | 31 + .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 46 + .../SimpleMsiPackage/MsiPackage/Package.en-us.wxl | 11 + .../SimpleMsiPackage/MsiPackage/Package.wxs | 25 + .../MsiPackage/PackageComponents.wxs | 10 + .../SimpleMsiPackage/MsiPackage/data/test.txt | 1 + .../SimpleMsiPackage/SimpleBundle/Bundle.wxs | 10 + .../SimpleBundle/SimpleBundle.wixproj | 42 + .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 39 + .../WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj | 48 + .../WixToolsetTest.Sdk.v3.ncrunchproject | 8 + 88 files changed, 3551 insertions(+), 3551 deletions(-) delete mode 100644 src/WixToolset.MSBuild/Sdk/Sdk.props delete mode 100644 src/WixToolset.MSBuild/Sdk/Sdk.targets delete mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.csproj delete mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec delete mode 100644 src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject delete mode 100644 src/WixToolset.MSBuild/build/WixToolset.MSBuild.props delete mode 100644 src/WixToolset.MSBuild/tools/wix.ca.targets delete mode 100644 src/WixToolset.MSBuild/tools/wix.harvest.targets delete mode 100644 src/WixToolset.MSBuild/tools/wix.signing.targets delete mode 100644 src/WixToolset.MSBuild/tools/wix.targets create mode 100644 src/WixToolset.Sdk/Sdk/Sdk.props create mode 100644 src/WixToolset.Sdk/Sdk/Sdk.targets create mode 100644 src/WixToolset.Sdk/WixToolset.Sdk.csproj create mode 100644 src/WixToolset.Sdk/WixToolset.Sdk.nuspec create mode 100644 src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject create mode 100644 src/WixToolset.Sdk/build/WixToolset.Sdk.props create mode 100644 src/WixToolset.Sdk/tools/wix.ca.targets create mode 100644 src/WixToolset.Sdk/tools/wix.harvest.targets create mode 100644 src/WixToolset.Sdk/tools/wix.signing.targets create mode 100644 src/WixToolset.Sdk/tools/wix.targets delete mode 100644 src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs delete mode 100644 src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs delete mode 100644 src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs delete mode 100644 src/test/WixToolsetTest.MSBuild/README.md delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj delete mode 100644 src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln delete mode 100644 src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj delete mode 100644 src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject create mode 100644 src/test/WixToolsetTest.Sdk/MsbuildFixture.cs create mode 100644 src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs create mode 100644 src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs create mode 100644 src/test/WixToolsetTest.Sdk/README.md create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt create mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln create mode 100644 src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj create mode 100644 src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject diff --git a/Tools.sln b/Tools.sln index 66f867d5..23f8a4d9 100644 --- a/Tools.sln +++ b/Tools.sln @@ -11,7 +11,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.BuildTasks", "sr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-wix", "src\dotnet-wix\dotnet-wix.csproj", "{938BCA04-610B-4B99-9CB7-02BF7397A972}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.MSBuild", "src\WixToolset.MSBuild\WixToolset.MSBuild.csproj", "{0DF5D4CF-8457-469D-8288-13775E984F70}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Sdk", "src\WixToolset.Sdk\WixToolset.Sdk.csproj", "{0DF5D4CF-8457-469D-8288-13775E984F70}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{449BE9B0-422F-4039-A030-BDD3E7D97878}" ProjectSection(SolutionItems) = preProject @@ -22,7 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thmviewer", "src\thmviewer\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "heat", "src\heat\heat.csproj", "{B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.MSBuild", "src\test\WixToolsetTest.MSBuild\WixToolsetTest.MSBuild.csproj", "{7B610B7B-C69D-4A4C-9D65-F304C44479E7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Sdk", "src\test\WixToolsetTest.Sdk\WixToolsetTest.Sdk.csproj", "{7B610B7B-C69D-4A4C-9D65-F304C44479E7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/appveyor.cmd b/appveyor.cmd index f5141c14..f12f3903 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -10,34 +10,34 @@ dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks || exit /b dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix || exit /b -robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% /XF Microsoft.Build.*.dll -robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\heat %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% -robocopy %_P%\WixToolset.MSBuild\separate\net461\x86\wix %_P%\WixToolset.MSBuild\tools\net461\x86 %_RCO% - -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix || exit /b -robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\buildtasks %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% /XF Microsoft.Build.*.dll -robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\heat %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% -robocopy %_P%\WixToolset.MSBuild\separate\net461\x64\wix %_P%\WixToolset.MSBuild\tools\net461\x64 %_RCO% - -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix || exit /b -robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% /XF Microsoft.Build.*.dll -robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\heat %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% -robocopy %_P%\WixToolset.MSBuild\separate\netcoreapp2.1\wix %_P%\WixToolset.MSBuild\tools\netcoreapp2.1 %_RCO% - -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\ src\WixToolset.MSBuild || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.MSBuild\broken\net461\ -f net461 -r dne src\wix || exit /b - -dotnet test -c %_C% src\test\WixToolsetTest.MSBuild || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix || exit /b +robocopy %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% /XF Microsoft.Build.*.dll +robocopy %_P%\WixToolset.Sdk\separate\net461\x86\heat %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% +robocopy %_P%\WixToolset.Sdk\separate\net461\x86\wix %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% + +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix || exit /b +robocopy %_P%\WixToolset.Sdk\separate\net461\x64\buildtasks %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% /XF Microsoft.Build.*.dll +robocopy %_P%\WixToolset.Sdk\separate\net461\x64\heat %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% +robocopy %_P%\WixToolset.Sdk\separate\net461\x64\wix %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% + +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix || exit /b +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.Sdk\tools\netcoreapp2.1 %_RCO% /XF Microsoft.Build.*.dll +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp2.1\heat %_P%\WixToolset.Sdk\tools\netcoreapp2.1 %_RCO% +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp2.1\wix %_P%\WixToolset.Sdk\tools\netcoreapp2.1 %_RCO% + +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\ src\WixToolset.Sdk || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\broken\net461\ -f net461 -r dne src\wix || exit /b + +dotnet test -c %_C% src\test\WixToolsetTest.Sdk || exit /b dotnet pack -c %_C% src\dotnet-wix || exit /b -dotnet pack -c %_C% src\WixToolset.MSBuild || exit /b +dotnet pack -c %_C% src\WixToolset.Sdk || exit /b msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj || exit /b diff --git a/src/Wix.Build.props b/src/Wix.Build.props index bf286bb4..a0aaa658 100644 --- a/src/Wix.Build.props +++ b/src/Wix.Build.props @@ -10,5 +10,5 @@ - + diff --git a/src/WixToolset.MSBuild/Sdk/Sdk.props b/src/WixToolset.MSBuild/Sdk/Sdk.props deleted file mode 100644 index 5080e393..00000000 --- a/src/WixToolset.MSBuild/Sdk/Sdk.props +++ /dev/null @@ -1,23 +0,0 @@ - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) - - - - netstandard2.0 - true - true - true - - - - - - - diff --git a/src/WixToolset.MSBuild/Sdk/Sdk.targets b/src/WixToolset.MSBuild/Sdk/Sdk.targets deleted file mode 100644 index e21cf5c6..00000000 --- a/src/WixToolset.MSBuild/Sdk/Sdk.targets +++ /dev/null @@ -1,15 +0,0 @@ - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - $(DefaultItemExcludes);$(BaseOutputPath)** - $(DefaultItemExcludes);$(BaseIntermediateOutputPath)** - $(DefaultItemExcludesInProjectFolder);**/.*/** - - diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj b/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj deleted file mode 100644 index a145c864..00000000 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - netcoreapp2.1 - false - WiX Toolset MSBuild integration - $(MSBuildThisFileName).nuspec - $(OutputPath)publish\WixToolset.MSBuild\ - Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) - - - - - - - - - - - - - - - - - - $(GenerateNuspecDependsOn);SetNuspecVersion - - - - - - $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) - - - diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec b/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec deleted file mode 100644 index 591b63a6..00000000 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.nuspec +++ /dev/null @@ -1,18 +0,0 @@ - - - - $id$ - $version$ - $authors$ - $authors$ - false - $description$ - $copyright$ - - - - - - - - diff --git a/src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject b/src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/WixToolset.MSBuild/WixToolset.MSBuild.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/WixToolset.MSBuild/build/WixToolset.MSBuild.props b/src/WixToolset.MSBuild/build/WixToolset.MSBuild.props deleted file mode 100644 index b453361b..00000000 --- a/src/WixToolset.MSBuild/build/WixToolset.MSBuild.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) - - diff --git a/src/WixToolset.MSBuild/tools/wix.ca.targets b/src/WixToolset.MSBuild/tools/wix.ca.targets deleted file mode 100644 index 4578c2d8..00000000 --- a/src/WixToolset.MSBuild/tools/wix.ca.targets +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - true - - $(TargetName).CA$(TargetExt) - - $(MSBuildThisFileDirectory) - $(WixSdkPath)x86\ - $(WixSdkPath)x64\ - - $(WixSdkPath)MakeSfxCA.exe - $(WixSdkX64Path)SfxCA.dll - $(WixSdkX86Path)SfxCA.dll - - - - - - - - - - - - - - - - - - - @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.MSBuild/tools/wix.harvest.targets b/src/WixToolset.MSBuild/tools/wix.harvest.targets deleted file mode 100644 index dea44469..00000000 --- a/src/WixToolset.MSBuild/tools/wix.harvest.targets +++ /dev/null @@ -1,512 +0,0 @@ - - - - - - - - $(WixToolDir) - - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - true - false - true - false - - - - - - false - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - $(IntermediateOutputPath)Product.Generated.wxs - $(IntermediateOutputPath)Bundle.Generated.wxs - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - - ConvertReferences; - ConvertBundleReferences; - HarvestProjects; - HarvestDirectory; - HarvestFile; - GenerateCode; - - - - - - - - RefreshGeneratedFile; - RefreshBundleGeneratedFile - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - %(_MSBuildProjectReferenceExistent.RefTargetDir) - Binaries;Symbols;Sources;Content;Satellites;Documents - %(_MSBuildProjectReferenceExistent.Name) - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - Binaries;Symbols;Sources;Content;Satellites;Documents - payloadgroup - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - - - CombineHarvestProjects - - - - - - - - - - - - - - - - - $(HarvestDirectoryTransforms) - $(HarvestDirectoryComponentGroupName) - $(HarvestDirectoryDirectoryRefId) - $(HarvestDirectoryKeepEmptyDirectories) - $(HarvestDirectoryPreprocessorVariable) - $(HarvestDirectorySuppressCom) - $(HarvestDirectorySuppressRootDirectory) - $(HarvestDirectorySuppressRegistry) - - - - - - GetHarvestDirectoryContent - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestFileTransforms) - $(HarvestFileComponentGroupName) - $(HarvestFileDirectoryRefId) - $(HarvestFilePreprocessorVariable) - $(HarvestFileSuppressCom) - $(HarvestFileSuppressRegistry) - $(HarvestFileSuppressRootDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.MSBuild/tools/wix.signing.targets b/src/WixToolset.MSBuild/tools/wix.signing.targets deleted file mode 100644 index 7c25175f..00000000 --- a/src/WixToolset.MSBuild/tools/wix.signing.targets +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - $(MSBuildProjectFile).Signed.txt - $(IntermediateOutputPath)$(SignedFileName) - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - GetMsmsToSign; - InternalSignMsm; - - - GetCabsToSign; - GetMsiToSign; - InternalSignCabs; - InscribeMsi; - InternalSignMsi; - - - GetContainersToSign; - InternalSignContainers; - InscribeBundleEngine; - InternalSignBundleEngine; - InscribeBundle; - InternalSignBundle; - - - - WixBuild; - CalculateSignTargetFiles; - BeforeSigning; - $(InternalSignDependsOn); - AfterSigning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.MSBuild/tools/wix.targets b/src/WixToolset.MSBuild/tools/wix.targets deleted file mode 100644 index 6914d03e..00000000 --- a/src/WixToolset.MSBuild/tools/wix.targets +++ /dev/null @@ -1,1083 +0,0 @@ - - - - - - true - - - - - - - - - - $(MSBuildThisFileDirectory)netcoreapp2.1\ - $(MSBuildThisFileDirectory)net461\x86\ - $(MSBuildThisFileDirectory)net461\x64\ - $(WixBinDir)WixToolset.BuildTasks.dll - $(WixBinDir64)WixToolset.BuildTasks.dll - - - - $(MSBuildThisFileDirectory)wix.harvest.targets - $(MSBuildThisFileDirectory)wix.signing.targets - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildAllProjects);$(WixHarvestTargetsPath) - $(MSBuildAllProjects);$(WixSigningTargetsPath) - $(MSBuildAllProjects);$(CustomBeforeWixTargets) - $(MSBuildAllProjects);$(CustomAfterWixTargets) - - - - - - .wxs - wix - wix - - - $(MSBuildProjectName) - $(OutputName) - - - Package - - - full - - - - - .msi - .msm - .pcp - .wixlib - .exe - .wixipl - - - - - - - $(TargetDir) - $(PdbOutputDir)\ - - - $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) - - - $(TargetName).wixpdb - - - $(TargetPdbDir)$(TargetPdbFileName) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildProjectFile).BindContentsFileList.txt - $(MSBuildProjectFile).BindOutputsFileList.txt - $(MSBuildProjectFile).BindBuiltOutputsFileList.txt - - - - $(IntermediateOutputPath)cabcache\ - - - - $(WixBinDir) - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - $(Platform) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - - - - - - - - - - - - - <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. - <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) - - - - - - - - - - - - - - - - - BuildOnlySettings; - PrepareForBuild; - PreBuildEvent; - - WixBuild; - Signing; - - GetTargetPath; - PrepareForRun; - IncrementalClean; - PostBuildEvent - - - - - - - - - - BeforeResolveReferences; - AssignProjectConfiguration; - ResolveProjectReferences; - ResolveWixLibraryReferences; - ResolveWixExtensionReferences; - AfterResolveReferences - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AssignTargetPaths - - - - - - - - - ResolveReferences; - BeforeCompile; - _TimeStampBeforeCompile; - - CalculateDefineConstants; - Harvest; - - GenerateCompileWithObjectPath; - - AssignTargetPaths; - ReadPreviousBindInputsAndBuiltOutputs; - - CoreWixBuild; - - UpdateLinkFileWrites; - _TimeStampAfterCompile; - AfterCompile - - - - - - - - - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) - - $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) - - - - - - - - - - - ResolveReferences - - - - - - Configuration=$(ConfigurationName); - OutDir=$(OutDir); - Platform=$(PlatformName); - ProjectDir=$(ProjectDir); - ProjectExt=$(ProjectExt); - ProjectFileName=$(ProjectFileName); - ProjectName=$(ProjectName); - ProjectPath=$(ProjectPath); - TargetDir=$(TargetDir); - TargetExt=$(TargetExt); - TargetFileName=$(TargetFileName); - TargetName=$(TargetName); - TargetPath=$(TargetPath); - - - - - $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) - $(SolutionDefineConstants);SolutionDir=$(SolutionDir) - $(SolutionDefineConstants);SolutionExt=$(SolutionExt) - $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) - $(SolutionDefineConstants);SolutionName=$(SolutionName) - $(SolutionDefineConstants);SolutionPath=$(SolutionPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> - <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> - - - - @(_CulturedTargetPath) - @(_CulturedTargetPdbPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(TargetPath) - $(TargetFileName) - - - - - - PrepareForBuild;AssignTargetPaths - - - - - - - - - - - - - <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> - - - - - - - %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) - - - - - - - AssignTargetPaths - - - - - - - - - - - - - - - - true - - - - true - true - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) - - - - - - - - - <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> - <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.Sdk/Sdk/Sdk.props b/src/WixToolset.Sdk/Sdk/Sdk.props new file mode 100644 index 00000000..5080e393 --- /dev/null +++ b/src/WixToolset.Sdk/Sdk/Sdk.props @@ -0,0 +1,23 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) + + + + netstandard2.0 + true + true + true + + + + + + + diff --git a/src/WixToolset.Sdk/Sdk/Sdk.targets b/src/WixToolset.Sdk/Sdk/Sdk.targets new file mode 100644 index 00000000..e21cf5c6 --- /dev/null +++ b/src/WixToolset.Sdk/Sdk/Sdk.targets @@ -0,0 +1,15 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + $(DefaultItemExcludes);$(BaseOutputPath)** + $(DefaultItemExcludes);$(BaseIntermediateOutputPath)** + $(DefaultItemExcludesInProjectFolder);**/.*/** + + diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.csproj b/src/WixToolset.Sdk/WixToolset.Sdk.csproj new file mode 100644 index 00000000..32bd66c0 --- /dev/null +++ b/src/WixToolset.Sdk/WixToolset.Sdk.csproj @@ -0,0 +1,38 @@ + + + + + + netcoreapp2.1 + false + WiX Toolset MSBuild integration + $(MSBuildThisFileName).nuspec + $(OutputPath)publish\WixToolset.Sdk\ + Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) + + + + + + + + + + + + + + + + + + $(GenerateNuspecDependsOn);SetNuspecVersion + + + + + + $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) + + + diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.nuspec b/src/WixToolset.Sdk/WixToolset.Sdk.nuspec new file mode 100644 index 00000000..591b63a6 --- /dev/null +++ b/src/WixToolset.Sdk/WixToolset.Sdk.nuspec @@ -0,0 +1,18 @@ + + + + $id$ + $version$ + $authors$ + $authors$ + false + $description$ + $copyright$ + + + + + + + + diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject b/src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/WixToolset.Sdk/build/WixToolset.Sdk.props b/src/WixToolset.Sdk/build/WixToolset.Sdk.props new file mode 100644 index 00000000..b453361b --- /dev/null +++ b/src/WixToolset.Sdk/build/WixToolset.Sdk.props @@ -0,0 +1,8 @@ + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) + + diff --git a/src/WixToolset.Sdk/tools/wix.ca.targets b/src/WixToolset.Sdk/tools/wix.ca.targets new file mode 100644 index 00000000..4578c2d8 --- /dev/null +++ b/src/WixToolset.Sdk/tools/wix.ca.targets @@ -0,0 +1,123 @@ + + + + + + + + + + true + + $(TargetName).CA$(TargetExt) + + $(MSBuildThisFileDirectory) + $(WixSdkPath)x86\ + $(WixSdkPath)x64\ + + $(WixSdkPath)MakeSfxCA.exe + $(WixSdkX64Path)SfxCA.dll + $(WixSdkX86Path)SfxCA.dll + + + + + + + + + + + + + + + + + + + @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.Sdk/tools/wix.harvest.targets b/src/WixToolset.Sdk/tools/wix.harvest.targets new file mode 100644 index 00000000..dea44469 --- /dev/null +++ b/src/WixToolset.Sdk/tools/wix.harvest.targets @@ -0,0 +1,512 @@ + + + + + + + + $(WixToolDir) + + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + true + false + true + false + + + + + + false + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + $(IntermediateOutputPath)Product.Generated.wxs + $(IntermediateOutputPath)Bundle.Generated.wxs + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + + ConvertReferences; + ConvertBundleReferences; + HarvestProjects; + HarvestDirectory; + HarvestFile; + GenerateCode; + + + + + + + + RefreshGeneratedFile; + RefreshBundleGeneratedFile + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + %(_MSBuildProjectReferenceExistent.RefTargetDir) + Binaries;Symbols;Sources;Content;Satellites;Documents + %(_MSBuildProjectReferenceExistent.Name) + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + Binaries;Symbols;Sources;Content;Satellites;Documents + payloadgroup + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + + + CombineHarvestProjects + + + + + + + + + + + + + + + + + $(HarvestDirectoryTransforms) + $(HarvestDirectoryComponentGroupName) + $(HarvestDirectoryDirectoryRefId) + $(HarvestDirectoryKeepEmptyDirectories) + $(HarvestDirectoryPreprocessorVariable) + $(HarvestDirectorySuppressCom) + $(HarvestDirectorySuppressRootDirectory) + $(HarvestDirectorySuppressRegistry) + + + + + + GetHarvestDirectoryContent + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestFileTransforms) + $(HarvestFileComponentGroupName) + $(HarvestFileDirectoryRefId) + $(HarvestFilePreprocessorVariable) + $(HarvestFileSuppressCom) + $(HarvestFileSuppressRegistry) + $(HarvestFileSuppressRootDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.Sdk/tools/wix.signing.targets b/src/WixToolset.Sdk/tools/wix.signing.targets new file mode 100644 index 00000000..7c25175f --- /dev/null +++ b/src/WixToolset.Sdk/tools/wix.signing.targets @@ -0,0 +1,370 @@ + + + + + + $(MSBuildProjectFile).Signed.txt + $(IntermediateOutputPath)$(SignedFileName) + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + GetMsmsToSign; + InternalSignMsm; + + + GetCabsToSign; + GetMsiToSign; + InternalSignCabs; + InscribeMsi; + InternalSignMsi; + + + GetContainersToSign; + InternalSignContainers; + InscribeBundleEngine; + InternalSignBundleEngine; + InscribeBundle; + InternalSignBundle; + + + + WixBuild; + CalculateSignTargetFiles; + BeforeSigning; + $(InternalSignDependsOn); + AfterSigning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.Sdk/tools/wix.targets b/src/WixToolset.Sdk/tools/wix.targets new file mode 100644 index 00000000..6914d03e --- /dev/null +++ b/src/WixToolset.Sdk/tools/wix.targets @@ -0,0 +1,1083 @@ + + + + + + true + + + + + + + + + + $(MSBuildThisFileDirectory)netcoreapp2.1\ + $(MSBuildThisFileDirectory)net461\x86\ + $(MSBuildThisFileDirectory)net461\x64\ + $(WixBinDir)WixToolset.BuildTasks.dll + $(WixBinDir64)WixToolset.BuildTasks.dll + + + + $(MSBuildThisFileDirectory)wix.harvest.targets + $(MSBuildThisFileDirectory)wix.signing.targets + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildAllProjects);$(WixHarvestTargetsPath) + $(MSBuildAllProjects);$(WixSigningTargetsPath) + $(MSBuildAllProjects);$(CustomBeforeWixTargets) + $(MSBuildAllProjects);$(CustomAfterWixTargets) + + + + + + .wxs + wix + wix + + + $(MSBuildProjectName) + $(OutputName) + + + Package + + + full + + + + + .msi + .msm + .pcp + .wixlib + .exe + .wixipl + + + + + + + $(TargetDir) + $(PdbOutputDir)\ + + + $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) + + + $(TargetName).wixpdb + + + $(TargetPdbDir)$(TargetPdbFileName) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectFile).BindContentsFileList.txt + $(MSBuildProjectFile).BindOutputsFileList.txt + $(MSBuildProjectFile).BindBuiltOutputsFileList.txt + + + + $(IntermediateOutputPath)cabcache\ + + + + $(WixBinDir) + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + $(Platform) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + + + + + + + + + + + + + <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. + <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) + + + + + + + + + + + + + + + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + + WixBuild; + Signing; + + GetTargetPath; + PrepareForRun; + IncrementalClean; + PostBuildEvent + + + + + + + + + + BeforeResolveReferences; + AssignProjectConfiguration; + ResolveProjectReferences; + ResolveWixLibraryReferences; + ResolveWixExtensionReferences; + AfterResolveReferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssignTargetPaths + + + + + + + + + ResolveReferences; + BeforeCompile; + _TimeStampBeforeCompile; + + CalculateDefineConstants; + Harvest; + + GenerateCompileWithObjectPath; + + AssignTargetPaths; + ReadPreviousBindInputsAndBuiltOutputs; + + CoreWixBuild; + + UpdateLinkFileWrites; + _TimeStampAfterCompile; + AfterCompile + + + + + + + + + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) + + $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) + + + + + + + + + + + ResolveReferences + + + + + + Configuration=$(ConfigurationName); + OutDir=$(OutDir); + Platform=$(PlatformName); + ProjectDir=$(ProjectDir); + ProjectExt=$(ProjectExt); + ProjectFileName=$(ProjectFileName); + ProjectName=$(ProjectName); + ProjectPath=$(ProjectPath); + TargetDir=$(TargetDir); + TargetExt=$(TargetExt); + TargetFileName=$(TargetFileName); + TargetName=$(TargetName); + TargetPath=$(TargetPath); + + + + + $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) + $(SolutionDefineConstants);SolutionDir=$(SolutionDir) + $(SolutionDefineConstants);SolutionExt=$(SolutionExt) + $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) + $(SolutionDefineConstants);SolutionName=$(SolutionName) + $(SolutionDefineConstants);SolutionPath=$(SolutionPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> + <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> + + + + @(_CulturedTargetPath) + @(_CulturedTargetPdbPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(TargetPath) + $(TargetFileName) + + + + + + PrepareForBuild;AssignTargetPaths + + + + + + + + + + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> + + + + + + + %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) + + + + + + + AssignTargetPaths + + + + + + + + + + + + + + + + true + + + + true + true + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) + + + + + + + + + <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> + <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index bfcc10ad..696e5845 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs deleted file mode 100644 index 163e8402..00000000 --- a/src/test/WixToolsetTest.MSBuild/MsbuildFixture.cs +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.MSBuild -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - using Xunit; - - public class MsbuildFixture - { - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleBundle(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = Path.Combine(fs.BaseFolder, "SimpleBundle"); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(new[] - { - @"bin\x86\Release\SimpleBundle.exe", - @"bin\x86\Release\SimpleBundle.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMergeModule(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(new[] - { - @"bin\x86\Release\SimpleMergeModule.msm", - @"bin\x86\Release\SimpleMergeModule.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); - Assert.Single(platformSwitches); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Equal(4, warnings.Count()); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(new[] - { - @"bin\x86\Release\en-US\cab1.cab", - @"bin\x86\Release\en-US\MsiPackage.msi", - @"bin\x86\Release\en-US\MsiPackage.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\MergeModule"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage"); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(new[] - { - @"bin\x86\Release\cab1.cab", - @"bin\x86\Release\MergeMsiPackage.msi", - @"bin\x86\Release\MergeMsiPackage.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) - { - var expectedOutputs = new[] - { - @"bin\x86\Release\en-US\cab1.cab", - @"bin\x86\Release\en-US\MsiPackage.msi", - @"bin\x86\Release\en-US\MsiPackage.wixpdb", - }; - - this.AssertWixpdb(buildSystem, null, expectedOutputs); - this.AssertWixpdb(buildSystem, "Full", expectedOutputs); - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildWithNoWixpdb(BuildSystem buildSystem) - { - this.AssertWixpdb(buildSystem, "NONE", new[] - { - @"bin\x86\Release\en-US\cab1.cab", - @"bin\x86\Release\en-US\MsiPackage.msi", - }); - } - - private void AssertWixpdb(BuildSystem buildSystem, string wixpdbType, string[] expectedOutputFiles) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", - }); - result.AssertSuccess(); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(expectedOutputFiles, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuild64BitMsiPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - $"-p:Platform=x64", - }); - result.AssertSuccess(); - - var platformSwitches = result.Output.Where(line => line.Contains("-platform x64")); - Assert.Single(platformSwitches); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.Equal(new[] - { - @"bin\x64\Release\en-US\cab1.cab", - @"bin\x64\Release\en-US\MsiPackage.msi", - @"bin\x64\Release\en-US\MsiPackage.wixpdb", - }, paths); - } - } - - [Theory(Skip = "Currently fails")] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackageWithIceSuppressions(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressIces", "ICE45;ICE46"), - }); - result.AssertSuccess(); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackageWithWarningSuppressions(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressSpecificWarnings", "1118;1102"), - }); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk, null)] - [InlineData(BuildSystem.DotNetCoreSdk, true)] - [InlineData(BuildSystem.MSBuild, null)] - [InlineData(BuildSystem.MSBuild, true)] - [InlineData(BuildSystem.MSBuild64, null)] - [InlineData(BuildSystem.MSBuild64, true)] - public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - "-p:OutputType=IntermediatePostLink", - }, outOfProc: outOfProc); - result.AssertSuccess(); - - var wixBuildCommands = MsbuildUtilities.GetToolCommandLines(result, "wix", "build", buildSystem, outOfProc); - Assert.Single(wixBuildCommands); - - var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .Single(); - Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildAndCleanSimpleMsiPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - // Build - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, verbosityLevel: "diag"); - result.AssertSuccess(); - - var buildOutput = String.Join("\r\n", result.Output); - - var createdPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.NotEmpty(createdPaths); - - // Clean - result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - "-t:Clean", - }, verbosityLevel: "diag"); - result.AssertSuccess(); - - var cleanOutput = String.Join("\r\n", result.Output); - - // Clean is only expected to delete the files listed in {Project}.FileListAbsolute.txt, - // so this is not quite right but close enough. - var allowedFiles = new HashSet - { - "MsiPackage.wixproj", - "Package.en-us.wxl", - "Package.wxs", - "PackageComponents.wxs", - @"data\test.txt", - @"obj\x86\Release\MsiPackage.wixproj.FileListAbsolute.txt", - }; - - var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .Where(s => !allowedFiles.Contains(s)) - .OrderBy(s => s) - .ToArray(); - Assert.Empty(remainingPaths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildUtilities.WixMsbuildPath, "broken", "net461")), - }, outOfProc: true); - Assert.Equal(1, result.ExitCode); - - var expectedMessage = "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from"; - Assert.Contains(result.Output, m => m.Contains(expectedMessage)); - } - } - } -} diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs deleted file mode 100644 index b5b97649..00000000 --- a/src/test/WixToolsetTest.MSBuild/MsbuildHeatFixture.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.MSBuild -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; - using WixToolset.Data; - using WixToolset.Data.Symbols; - using Xunit; - - public class MsbuildHeatFixture - { - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildHeatFilePackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\HeatFilePackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var projectPath = Path.Combine(baseFolder, "HeatFilePackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); - Assert.Single(heatCommandLines); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal(@"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFilePackage.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildHeatFileWithMultipleFilesPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var projectPath = Path.Combine(baseFolder, "HeatFileMultipleFilesSameFileName.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); - Assert.Equal(2, heatCommandLines.Count()); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal("" + - "" + - "" + - "" + - @"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - generatedContents = File.ReadAllText(generatedFilePath); - testXml = generatedContents.GetTestXml(); - Assert.Equal("" + - "" + - "" + - "" + - @"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFileMultipleFilesSameFileName.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileSymbols = section.Symbols.OfType().ToArray(); - Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path); - Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); - } - } - } -} diff --git a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs b/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs deleted file mode 100644 index fead4915..00000000 --- a/src/test/WixToolsetTest.MSBuild/MsbuildUtilities.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright(c) .NET Foundation and contributors.All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.MSBuild -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - - public enum BuildSystem - { - DotNetCoreSdk, - MSBuild, - MSBuild64, - } - - public static class MsbuildUtilities - { - public static readonly string WixMsbuildPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.MSBuild"); - public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.MSBuild.props"); - - public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") - { - var allArgs = new List - { - $"-verbosity:{verbosityLevel}", - $"-p:Configuration={configuration}", - GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildUtilities.WixPropsPath), - // Node reuse means that child msbuild processes can stay around after the build completes. - // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. - "-nr:false", - }; - - if (outOfProc.HasValue) - { - allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); - } - - if (arguments != null) - { - allArgs.AddRange(arguments); - } - - switch (buildSystem) - { - case BuildSystem.DotNetCoreSdk: - { - allArgs.Add(projectPath); - var result = DotnetRunner.Execute("msbuild", allArgs.ToArray()); - return new MsbuildRunnerResult - { - ExitCode = result.ExitCode, - Output = result.StandardOutput, - }; - } - case BuildSystem.MSBuild: - case BuildSystem.MSBuild64: - { - return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); - } - default: - { - throw new NotImplementedException(); - } - } - } - - public static string GetQuotedPropertySwitch(BuildSystem buildSystem, string propertyName, string valueToQuote) - { - switch (buildSystem) - { - case BuildSystem.DotNetCoreSdk: - { - return $"-p:{propertyName}=\\\"{valueToQuote}\\\""; - } - case BuildSystem.MSBuild: - case BuildSystem.MSBuild64: - { - return $"-p:{propertyName}=\"{valueToQuote}\""; - } - default: - { - throw new NotImplementedException(); - } - } - } - - public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem, bool? outOfProc = null) - { - var expectedOutOfProc = buildSystem == BuildSystem.DotNetCoreSdk || outOfProc.HasValue && outOfProc.Value; - var expectedToolExe = !expectedOutOfProc ? $"({toolName}.exe)" : - buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; - var expectedToolCommand = $"{expectedToolExe} {operation}"; - return result.Output.Where(line => line.Contains(expectedToolCommand)); - } - } -} diff --git a/src/test/WixToolsetTest.MSBuild/README.md b/src/test/WixToolsetTest.MSBuild/README.md deleted file mode 100644 index 7faf34b9..00000000 --- a/src/test/WixToolsetTest.MSBuild/README.md +++ /dev/null @@ -1,5 +0,0 @@ -In order to properly test wix.targets, -all of the supported architectures for WixToolset.BuildTasks need to be available in the layout used in the Nuget package. -Making this happen on every build for the solution takes too long, -so this project relies on manually running appveyor.cmd to publish everything before the tests can be run. -appveyor.cmd needs to be ran again every time changes are made in other projects, including the targets themselves. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj deleted file mode 100644 index 7d751319..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - - - - - TxtProductComponents - INSTALLFOLDER - true - - - JsonProductComponents - INSTALLFOLDER - true - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json deleted file mode 100644 index 5f282702..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt deleted file mode 100644 index 5f282702..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs deleted file mode 100644 index 884da274..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFileMultipleFilesSameFileName/Package.wxs +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj deleted file mode 100644 index 3988acaf..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/HeatFilePackage.wixproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - - - - - ProductComponents - INSTALLFOLDER - true - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs deleted file mode 100644 index e509c464..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/HeatFilePackage/Package.wxs +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj deleted file mode 100644 index 77ee4420..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Debug - x86 - - - - {B00939D5-7952-4ADF-BEB1-507D227B2FE2} - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - SimpleMergeModule - {9F84998B-7F45-4CB3-8795-915801DBBB74} - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs deleted file mode 100644 index 1c25e684..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/MergeMsiPackage/Package.wxs +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs deleted file mode 100644 index b9ab953a..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj deleted file mode 100644 index 91579790..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Debug - x86 - Module - - - - {9F84998B-7F45-4CB3-8795-915801DBBB74} - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt b/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj deleted file mode 100644 index 555addbe..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Debug - x86 - 0.9 - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - MsiPackage - Package - MsiPackage - MsiPackage - en-US,en;de-DE - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl deleted file mode 100644 index 23493ace..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - German DowngradeError - German FeatureTitle - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - A newer version of [ProductName] is already installed. - MsiPackage - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs deleted file mode 100644 index d5a5a40d..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs deleted file mode 100644 index e26c4509..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln deleted file mode 100644 index 2c88704e..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} - EndGlobalSection -EndGlobal diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj deleted file mode 100644 index 18ae08b2..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - A newer version of [ProductName] is already installed. - MsiPackage - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs deleted file mode 100644 index f7998fff..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs deleted file mode 100644 index ddb95faf..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/MsiPackage/data/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs deleted file mode 100644 index 6cd04712..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj deleted file mode 100644 index 199eb6d9..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Debug - x86 - - - - 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d - Bundle - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln deleted file mode 100644 index dd21489d..00000000 --- a/src/test/WixToolsetTest.MSBuild/TestData/SimpleMsiPackage/SimpleMsiPackage.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30011.22 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" -EndProject -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SimpleBundle", "SimpleBundle\SimpleBundle.wixproj", "{6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x64.ActiveCfg = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.ActiveCfg = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.Build.0 = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x64.ActiveCfg = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.ActiveCfg = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} - EndGlobalSection -EndGlobal diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj deleted file mode 100644 index 916300af..00000000 --- a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - net461 - false - embedded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject b/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject deleted file mode 100644 index f1d03cd7..00000000 --- a/src/test/WixToolsetTest.MSBuild/WixToolsetTest.MSBuild.v3.ncrunchproject +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs new file mode 100644 index 00000000..1ce326d8 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -0,0 +1,408 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Sdk +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + using Xunit; + + public class MsbuildFixture + { + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleBundle(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "SimpleBundle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Release\SimpleBundle.exe", + @"bin\x86\Release\SimpleBundle.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Release\SimpleMergeModule.msm", + @"bin\x86\Release\SimpleMergeModule.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); + Assert.Single(platformSwitches); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Equal(4, warnings.Count()); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x86\Release\cab1.cab", + @"bin\x86\Release\MergeMsiPackage.msi", + @"bin\x86\Release\MergeMsiPackage.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) + { + var expectedOutputs = new[] + { + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", + }; + + this.AssertWixpdb(buildSystem, null, expectedOutputs); + this.AssertWixpdb(buildSystem, "Full", expectedOutputs); + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildWithNoWixpdb(BuildSystem buildSystem) + { + this.AssertWixpdb(buildSystem, "NONE", new[] + { + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + }); + } + + private void AssertWixpdb(BuildSystem buildSystem, string wixpdbType, string[] expectedOutputFiles) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", + }); + result.AssertSuccess(); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(expectedOutputFiles, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuild64BitMsiPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + $"-p:Platform=x64", + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.Contains("-platform x64")); + Assert.Single(platformSwitches); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.Equal(new[] + { + @"bin\x64\Release\en-US\cab1.cab", + @"bin\x64\Release\en-US\MsiPackage.msi", + @"bin\x64\Release\en-US\MsiPackage.wixpdb", + }, paths); + } + } + + [Theory(Skip = "Currently fails")] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithIceSuppressions(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressIces", "ICE45;ICE46"), + }); + result.AssertSuccess(); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithWarningSuppressions(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressSpecificWarnings", "1118;1102"), + }); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk, null)] + [InlineData(BuildSystem.DotNetCoreSdk, true)] + [InlineData(BuildSystem.MSBuild, null)] + [InlineData(BuildSystem.MSBuild, true)] + [InlineData(BuildSystem.MSBuild64, null)] + [InlineData(BuildSystem.MSBuild64, true)] + public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + "-p:OutputType=IntermediatePostLink", + }, outOfProc: outOfProc); + result.AssertSuccess(); + + var wixBuildCommands = MsbuildUtilities.GetToolCommandLines(result, "wix", "build", buildSystem, outOfProc); + Assert.Single(wixBuildCommands); + + var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .Single(); + Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildAndCleanSimpleMsiPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + // Build + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, verbosityLevel: "diag"); + result.AssertSuccess(); + + var buildOutput = String.Join("\r\n", result.Output); + + var createdPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.NotEmpty(createdPaths); + + // Clean + result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + "-t:Clean", + }, verbosityLevel: "diag"); + result.AssertSuccess(); + + var cleanOutput = String.Join("\r\n", result.Output); + + // Clean is only expected to delete the files listed in {Project}.FileListAbsolute.txt, + // so this is not quite right but close enough. + var allowedFiles = new HashSet + { + "MsiPackage.wixproj", + "Package.en-us.wxl", + "Package.wxs", + "PackageComponents.wxs", + @"data\test.txt", + @"obj\x86\Release\MsiPackage.wixproj.FileListAbsolute.txt", + }; + + var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .Where(s => !allowedFiles.Contains(s)) + .OrderBy(s => s) + .ToArray(); + Assert.Empty(remainingPaths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildUtilities.WixMsbuildPath, "broken", "net461")), + }, outOfProc: true); + Assert.Equal(1, result.ExitCode); + + var expectedMessage = "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from"; + Assert.Contains(result.Output, m => m.Contains(expectedMessage)); + } + } + } +} diff --git a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs new file mode 100644 index 00000000..2f32a30f --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs @@ -0,0 +1,150 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Sdk +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using Xunit; + + public class MsbuildHeatFixture + { + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildHeatFilePackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\HeatFilePackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatFilePackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); + Assert.Single(heatCommandLines); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal(@"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFilePackage.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildHeatFileWithMultipleFilesPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatFileMultipleFilesSameFileName.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); + Assert.Equal(2, heatCommandLines.Count()); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + generatedContents = File.ReadAllText(generatedFilePath); + testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFileMultipleFilesSameFileName.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbols = section.Symbols.OfType().ToArray(); + Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); + } + } + } +} diff --git a/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs b/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs new file mode 100644 index 00000000..cfb421b2 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs @@ -0,0 +1,98 @@ +// Copyright(c) .NET Foundation and contributors.All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Sdk +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + + public enum BuildSystem + { + DotNetCoreSdk, + MSBuild, + MSBuild64, + } + + public static class MsbuildUtilities + { + public static readonly string WixMsbuildPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.Sdk"); + public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.Sdk.props"); + + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") + { + var allArgs = new List + { + $"-verbosity:{verbosityLevel}", + $"-p:Configuration={configuration}", + GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildUtilities.WixPropsPath), + // Node reuse means that child msbuild processes can stay around after the build completes. + // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. + "-nr:false", + }; + + if (outOfProc.HasValue) + { + allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); + } + + if (arguments != null) + { + allArgs.AddRange(arguments); + } + + switch (buildSystem) + { + case BuildSystem.DotNetCoreSdk: + { + allArgs.Add(projectPath); + var result = DotnetRunner.Execute("msbuild", allArgs.ToArray()); + return new MsbuildRunnerResult + { + ExitCode = result.ExitCode, + Output = result.StandardOutput, + }; + } + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); + } + default: + { + throw new NotImplementedException(); + } + } + } + + public static string GetQuotedPropertySwitch(BuildSystem buildSystem, string propertyName, string valueToQuote) + { + switch (buildSystem) + { + case BuildSystem.DotNetCoreSdk: + { + return $"-p:{propertyName}=\\\"{valueToQuote}\\\""; + } + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + return $"-p:{propertyName}=\"{valueToQuote}\""; + } + default: + { + throw new NotImplementedException(); + } + } + } + + public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem, bool? outOfProc = null) + { + var expectedOutOfProc = buildSystem == BuildSystem.DotNetCoreSdk || outOfProc.HasValue && outOfProc.Value; + var expectedToolExe = !expectedOutOfProc ? $"({toolName}.exe)" : + buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; + var expectedToolCommand = $"{expectedToolExe} {operation}"; + return result.Output.Where(line => line.Contains(expectedToolCommand)); + } + } +} diff --git a/src/test/WixToolsetTest.Sdk/README.md b/src/test/WixToolsetTest.Sdk/README.md new file mode 100644 index 00000000..7faf34b9 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/README.md @@ -0,0 +1,5 @@ +In order to properly test wix.targets, +all of the supported architectures for WixToolset.BuildTasks need to be available in the layout used in the Nuget package. +Making this happen on every build for the solution takes too long, +so this project relies on manually running appveyor.cmd to publish everything before the tests can be run. +appveyor.cmd needs to be ran again every time changes are made in other projects, including the targets themselves. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj new file mode 100644 index 00000000..7d751319 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj @@ -0,0 +1,58 @@ + + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + + + + + TxtProductComponents + INSTALLFOLDER + true + + + JsonProductComponents + INSTALLFOLDER + true + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs new file mode 100644 index 00000000..884da274 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj new file mode 100644 index 00000000..3988acaf --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj @@ -0,0 +1,53 @@ + + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + + + + + ProductComponents + INSTALLFOLDER + true + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs new file mode 100644 index 00000000..e509c464 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj new file mode 100644 index 00000000..77ee4420 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj @@ -0,0 +1,44 @@ + + + + + Debug + x86 + + + + {B00939D5-7952-4ADF-BEB1-507D227B2FE2} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + SimpleMergeModule + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs new file mode 100644 index 00000000..1c25e684 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs new file mode 100644 index 00000000..b9ab953a --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj new file mode 100644 index 00000000..91579790 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + Module + + + + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..555addbe --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,50 @@ + + + + + Debug + x86 + 0.9 + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + MsiPackage + Package + MsiPackage + MsiPackage + en-US,en;de-DE + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl new file mode 100644 index 00000000..23493ace --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl @@ -0,0 +1,11 @@ + + + + + + German DowngradeError + German FeatureTitle + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..d5a5a40d --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln new file mode 100644 index 00000000..2c88704e --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..18ae08b2 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,46 @@ + + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..f7998fff --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..ddb95faf --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs new file mode 100644 index 00000000..6cd04712 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj new file mode 100644 index 00000000..199eb6d9 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + + + + 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d + Bundle + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln new file mode 100644 index 00000000..dd21489d --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln @@ -0,0 +1,39 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SimpleBundle", "SimpleBundle\SimpleBundle.wixproj", "{6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x64.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.Build.0 = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x64.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj new file mode 100644 index 00000000..916300af --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj @@ -0,0 +1,48 @@ + + + + + + net461 + false + embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject new file mode 100644 index 00000000..f1d03cd7 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 9034d33599132a705f5852a4258affe97f12e5cd Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 6 Jul 2020 19:56:06 +1000 Subject: Update to latest thmutil. --- src/thmviewer/display.cpp | 13 +++++++------ src/thmviewer/packages.config | 2 +- src/thmviewer/thmviewer.cpp | 14 +++++++------- src/thmviewer/thmviewer.manifest | 8 ++++++++ src/thmviewer/thmviewer.vcxproj | 4 ++-- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/thmviewer/display.cpp b/src/thmviewer/display.cpp index cfd1c6b7..52fa3cf8 100644 --- a/src/thmviewer/display.cpp +++ b/src/thmviewer/display.cpp @@ -110,8 +110,8 @@ static DWORD WINAPI DisplayThreadProc( y = rc.bottom + 20; } - hWnd = ::CreateWindowExW(0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, pTheme->nWidth, pTheme->nHeight, hwndParent, NULL, hInstance, pCurrentHandle); - ExitOnNullWithLastError(hWnd, hr, "Failed to create display window."); + hr = ThemeCreateParentWindow(pTheme, 0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, hwndParent, hInstance, pCurrentHandle, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); + ExitOnFailure(hr, "Failed to create display window."); fCreateIfNecessary = FALSE; } @@ -263,9 +263,10 @@ static LRESULT CALLBACK DisplayWndProc( { case WM_NCCREATE: { - LPCREATESTRUCT lpcs = reinterpret_cast(lParam); - IncrementHandleTheme(reinterpret_cast(lpcs->lpCreateParams)); - ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(lpcs->lpCreateParams)); + LPCREATESTRUCT lpcs = reinterpret_cast(lParam); + pHandleTheme = reinterpret_cast(lpcs->lpCreateParams); + IncrementHandleTheme(pHandleTheme); + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pHandleTheme)); } break; @@ -328,7 +329,7 @@ static BOOL DisplayOnCreate( { HRESULT hr = S_OK; - hr = ThemeLoadControls(pTheme, hWnd, NULL, 0); + hr = ThemeLoadControls(pTheme, NULL, 0); ExitOnFailure(hr, "Failed to load theme controls"); // Pre-populate some control types with data. diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index f3abcd35..49f06de8 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.cpp b/src/thmviewer/thmviewer.cpp index adad3f50..f83182d3 100644 --- a/src/thmviewer/thmviewer.cpp +++ b/src/thmviewer/thmviewer.cpp @@ -100,8 +100,8 @@ int WINAPI wWinMain( hr = CreateMainWindowClass(hInstance, vpTheme, &atom); ExitOnFailure(hr, "Failed to create main window."); - hWnd = ::CreateWindowExW(0, reinterpret_cast(atom), vpTheme->sczCaption, vpTheme->dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, vpTheme->nWidth, vpTheme->nHeight, HWND_DESKTOP, NULL, hInstance, NULL); - ExitOnNullWithLastError(hWnd, hr, "Failed to create window."); + hr = ThemeCreateParentWindow(vpTheme, 0, reinterpret_cast(atom), vpTheme->sczCaption, vpTheme->dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, hInstance, NULL, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); + ExitOnFailure(hr, "Failed to create window."); if (!sczThemeFile) { @@ -353,11 +353,11 @@ static LRESULT CALLBACK MainWndProc( case WM_CREATE: { - HRESULT hr = ThemeLoadControls(vpTheme, hWnd, vrgInitControls, countof(vrgInitControls)); - if (FAILED(hr)) - { - return -1; - } + HRESULT hr = ThemeLoadControls(vpTheme, vrgInitControls, countof(vrgInitControls)); + if (FAILED(hr)) + { + return -1; + } } break; diff --git a/src/thmviewer/thmviewer.manifest b/src/thmviewer/thmviewer.manifest index 6bd63a5e..4663b61c 100644 --- a/src/thmviewer/thmviewer.manifest +++ b/src/thmviewer/thmviewer.manifest @@ -7,5 +7,13 @@ WiX Toolset Theme Viewer + + + + true/pm + + PerMonitorV2, PerMonitor, System + + diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index fb9908e6..a56a0bd4 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -5,7 +5,7 @@ - + @@ -83,6 +83,6 @@ - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 4e2031922b286f371e8bb329395384fba7eb9975 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 10 Jul 2020 21:56:04 +1000 Subject: Update to latest dutil. --- src/thmviewer/packages.config | 2 +- src/thmviewer/thmviewer.vcxproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 49f06de8..3be1bf65 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index a56a0bd4..b1493655 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -5,7 +5,7 @@ - + @@ -83,6 +83,6 @@ - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 989aac23fea77419bf1a8c316c56d88844e97c8f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 14 Jul 2020 14:49:57 +1000 Subject: Upgrade dependencies. --- src/ThmViewerPackage/ThmViewerPackage.wixproj | 4 ++-- src/ThmViewerPackage/packages.config | 6 +++--- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 2 +- .../WixToolset.Core.InternalPackage.csproj | 2 +- src/WixToolset.Sdk/WixToolset.Sdk.csproj | 2 +- src/dotnet-wix/dotnet-wix.csproj | 2 +- src/heat/heat.csproj | 2 +- src/thmviewer/packages.config | 2 +- src/thmviewer/thmviewer.vcxproj | 4 ++-- src/wix/wix.csproj | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ThmViewerPackage/ThmViewerPackage.wixproj b/src/ThmViewerPackage/ThmViewerPackage.wixproj index 9811782c..fefd6949 100644 --- a/src/ThmViewerPackage/ThmViewerPackage.wixproj +++ b/src/ThmViewerPackage/ThmViewerPackage.wixproj @@ -29,7 +29,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - + diff --git a/src/ThmViewerPackage/packages.config b/src/ThmViewerPackage/packages.config index d69ed11e..9b93a067 100644 --- a/src/ThmViewerPackage/packages.config +++ b/src/ThmViewerPackage/packages.config @@ -1,4 +1,4 @@ - + - - + + \ No newline at end of file diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index e70a6c66..70582569 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -33,6 +33,6 @@ - + diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj index 73f331ff..24d5decc 100644 --- a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj +++ b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.csproj b/src/WixToolset.Sdk/WixToolset.Sdk.csproj index 32bd66c0..f1f063d5 100644 --- a/src/WixToolset.Sdk/WixToolset.Sdk.csproj +++ b/src/WixToolset.Sdk/WixToolset.Sdk.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/dotnet-wix/dotnet-wix.csproj b/src/dotnet-wix/dotnet-wix.csproj index 88010875..0f42d0be 100644 --- a/src/dotnet-wix/dotnet-wix.csproj +++ b/src/dotnet-wix/dotnet-wix.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index bdcb4e3b..1dea7a75 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -31,6 +31,6 @@ - + diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 3be1bf65..321d628a 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index b1493655..157b3949 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -69,7 +69,7 @@ - + @@ -82,7 +82,7 @@ - + \ No newline at end of file diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 4deeee86..187af7d1 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -29,6 +29,6 @@ - + -- cgit v1.2.3-55-g6feb From 17b4761d426d19e56825f55bb3941b8cfa274e54 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 14 Jul 2020 14:26:10 -0700 Subject: Fix Theme Viewer's install using invalid directory names --- src/ThmViewerPackage/Package.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ThmViewerPackage/Package.wxs b/src/ThmViewerPackage/Package.wxs index 6609dbed..d758d4e0 100644 --- a/src/ThmViewerPackage/Package.wxs +++ b/src/ThmViewerPackage/Package.wxs @@ -25,10 +25,10 @@ - + - + -- cgit v1.2.3-55-g6feb From c47695e3128e8c5f8bf7595bceba25f1f137296a Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 18 Jul 2020 15:00:09 -0700 Subject: Remove noise from console output --- src/wix/ConsoleMessageListener.cs | 10 ++-------- src/wix/Program.cs | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/wix/ConsoleMessageListener.cs b/src/wix/ConsoleMessageListener.cs index 709fb576..ebf1622b 100644 --- a/src/wix/ConsoleMessageListener.cs +++ b/src/wix/ConsoleMessageListener.cs @@ -4,7 +4,6 @@ namespace WixToolset.Tools.Core { using System; using System.Collections.Generic; - using System.Linq; using System.Globalization; using System.Text; using System.Threading; @@ -40,10 +39,8 @@ namespace WixToolset.Tools.Core output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.Prefix, message.Id, message.ToString()); var fileNames = GetFileNames(message.SourceLineNumbers); - if (fileNames.Any()) + if (fileNames.Count > 1) { - output.WriteLine("Source trace:"); - foreach (var fileName in fileNames) { output.WriteLine("Source trace: {0}", fileName); @@ -51,10 +48,7 @@ namespace WixToolset.Tools.Core } } - public void Write(string message) - { - Console.Out.WriteLine(message); - } + public void Write(string message) => Console.Out.WriteLine(message); public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; diff --git a/src/wix/Program.cs b/src/wix/Program.cs index df0e22e7..988d9036 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -13,7 +13,6 @@ namespace WixToolset.Tools using WixToolset.Core.WindowsInstaller; using WixToolset.Data; using WixToolset.Extensibility; - using WixToolset.Extensibility.Data; using WixToolset.Extensibility.Services; using WixToolset.Tools.Core; -- cgit v1.2.3-55-g6feb From 7d20791bb5cddf933d68921098aef33abceb81fa Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 19 Jul 2020 16:45:26 +1000 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 524e930f7c103cdc257aa1917485f89725a0daad Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 4 Aug 2020 19:18:10 -0600 Subject: Use WixAssert.CompareLineByLine. --- src/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs index 1ce326d8..29969592 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -36,7 +36,7 @@ namespace WixToolsetTest.Sdk .Select(s => s.Substring(baseFolder.Length + 1)) .OrderBy(s => s) .ToArray(); - Assert.Equal(new[] + WixAssert.CompareLineByLine(new[] { @"bin\x86\Release\SimpleBundle.exe", @"bin\x86\Release\SimpleBundle.wixpdb", @@ -69,7 +69,7 @@ namespace WixToolsetTest.Sdk .Select(s => s.Substring(baseFolder.Length + 1)) .OrderBy(s => s) .ToArray(); - Assert.Equal(new[] + WixAssert.CompareLineByLine(new[] { @"bin\x86\Release\SimpleMergeModule.msm", @"bin\x86\Release\SimpleMergeModule.wixpdb", @@ -105,7 +105,7 @@ namespace WixToolsetTest.Sdk .Select(s => s.Substring(baseFolder.Length + 1)) .OrderBy(s => s) .ToArray(); - Assert.Equal(new[] + WixAssert.CompareLineByLine(new[] { @"bin\x86\Release\en-US\cab1.cab", @"bin\x86\Release\en-US\MsiPackage.msi", @@ -139,7 +139,7 @@ namespace WixToolsetTest.Sdk .Select(s => s.Substring(baseFolder.Length + 1)) .OrderBy(s => s) .ToArray(); - Assert.Equal(new[] + WixAssert.CompareLineByLine(new[] { @"bin\x86\Release\cab1.cab", @"bin\x86\Release\MergeMsiPackage.msi", @@ -199,7 +199,7 @@ namespace WixToolsetTest.Sdk .Select(s => s.Substring(baseFolder.Length + 1)) .OrderBy(s => s) .ToArray(); - Assert.Equal(expectedOutputFiles, paths); + WixAssert.CompareLineByLine(expectedOutputFiles, paths); } } @@ -231,7 +231,7 @@ namespace WixToolsetTest.Sdk .Select(s => s.Substring(baseFolder.Length + 1)) .OrderBy(s => s) .ToArray(); - Assert.Equal(new[] + WixAssert.CompareLineByLine(new[] { @"bin\x64\Release\en-US\cab1.cab", @"bin\x64\Release\en-US\MsiPackage.msi", -- cgit v1.2.3-55-g6feb From ce763a840147a75876136f18b46bca5245078da3 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 17 Aug 2020 15:11:17 -0500 Subject: Only target all frameworks in Release --- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 3 ++- src/heat/heat.csproj | 3 ++- src/wix/wix.csproj | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 70582569..2d7e7ca7 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -3,7 +3,8 @@ - netcoreapp2.1;net461 + netcoreapp2.1 + $(TargetFrameworks);net461 WiX Toolset MSBuild Tasks embedded diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 1dea7a75..780a9496 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -3,7 +3,8 @@ - netcoreapp2.1;net461;net472 + netcoreapp2.1 + $(TargetFrameworks);net461 Exe Harvester WiX Harvester diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 187af7d1..3125a7e7 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -3,7 +3,8 @@ - netcoreapp2.1;net461;net472 + netcoreapp2.1 + $(TargetFrameworks);net461 Exe Compiler WiX Toolset Compiler -- cgit v1.2.3-55-g6feb From 6eb6d14d88642b167fba793961e38ff57aa46e42 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 25 Aug 2020 18:23:29 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From a49696d54bc2f3d4ac7c5480841a6eccadc56230 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 26 Aug 2020 16:00:30 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 6a80fe9b2789213598a93cb4959c85502badc6fd Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 31 Aug 2020 17:11:21 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 6a2318a9a9cfd24694c83ea0ebb06af449db2ecc Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 2 Sep 2020 20:32:00 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 3de0383c7e4753807aabac2c7f7dde57db06f82c Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 14 Sep 2020 13:22:35 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 403b760493267918e242ebc3f6bf554302e2f74e Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 19 Sep 2020 21:52:22 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 804604425ae45ea40a816cfed9f5f17aa60181f5 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 22 Sep 2020 15:33:54 -0500 Subject: Update project files so appveyor.cmd can build Debug for dev. --- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 7 +++++-- src/heat/heat.csproj | 7 +++++-- src/wix/wix.csproj | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 2d7e7ca7..c006b5a4 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -3,8 +3,7 @@ - netcoreapp2.1 - $(TargetFrameworks);net461 + netcoreapp2.1;net461 WiX Toolset MSBuild Tasks embedded @@ -28,6 +27,10 @@ + + + + diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 780a9496..51c9b297 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -3,8 +3,7 @@ - netcoreapp2.1 - $(TargetFrameworks);net461 + netcoreapp2.1;net461 Exe Harvester WiX Harvester @@ -25,6 +24,10 @@ + + + + diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 3125a7e7..d03d076e 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -3,8 +3,7 @@ - netcoreapp2.1 - $(TargetFrameworks);net461 + netcoreapp2.1;net461 Exe Compiler WiX Toolset Compiler @@ -21,6 +20,10 @@ NU1701 + + + + -- cgit v1.2.3-55-g6feb From d4a95f350a977c74a67b58da3a577cb0942b8450 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 8 Oct 2020 15:37:29 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From c3efac199fd6c6f45ce7713b12902152f0404c70 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 13 Oct 2020 19:04:29 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 1ba5b0818ceeb14f5c66794d729314ecb56660ca Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 24 Oct 2020 20:31:37 -0400 Subject: Update test authoring for Package/SummaryInformation change. --- src/ThmViewerPackage/Package.wxs | 10 ++++------ .../TestData/HeatFileMultipleFilesSameFileName/Package.wxs | 10 ++++------ .../WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs | 10 ++++------ .../TestData/MergeModule/MergeMsiPackage/Package.wxs | 9 ++++----- .../TestData/MergeModule/SimpleMergeModule/MergeModule.wxs | 7 +++---- .../TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs | 9 ++++----- .../TestData/SimpleMsiPackage/MsiPackage/Package.wxs | 10 ++++------ 7 files changed, 27 insertions(+), 38 deletions(-) diff --git a/src/ThmViewerPackage/Package.wxs b/src/ThmViewerPackage/Package.wxs index d758d4e0..e2c3c9f8 100644 --- a/src/ThmViewerPackage/Package.wxs +++ b/src/ThmViewerPackage/Package.wxs @@ -1,9 +1,7 @@ - - + - - + + @@ -11,7 +9,7 @@ - + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs index 884da274..4cdcdf15 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs @@ -1,8 +1,6 @@ - - - - - + + + @@ -10,7 +8,7 @@ - + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs index e509c464..8e04a8ce 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs @@ -1,15 +1,13 @@ - - - - - + + + - + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs index 1c25e684..71d8fff6 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs @@ -1,14 +1,13 @@ - - - - + + + - + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs index b9ab953a..19a7b7e4 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs @@ -1,7 +1,6 @@ - - - - + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs index d5a5a40d..4bdebbcf 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs @@ -1,7 +1,6 @@ - - - - + + + @@ -9,7 +8,7 @@ - + diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs index f7998fff..b900447a 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -1,11 +1,9 @@ - - - + - - + + @@ -13,7 +11,7 @@ - + -- cgit v1.2.3-55-g6feb From 67fe2e44570efcd8df08e2044acfa95e59f66993 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 24 Oct 2020 19:38:26 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 592badb8b7e40dcfc35e7e7f3d45892874e99b1b Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 29 Oct 2020 22:18:15 -0400 Subject: Strong-name sign WiX assemblies. --- src/CSharp.Build.props | 11 +++++++++++ src/Directory.Build.props | 1 + src/wix.snk | Bin 0 -> 596 bytes 3 files changed, 12 insertions(+) create mode 100644 src/CSharp.Build.props create mode 100644 src/wix.snk diff --git a/src/CSharp.Build.props b/src/CSharp.Build.props new file mode 100644 index 00000000..b12f4c6e --- /dev/null +++ b/src/CSharp.Build.props @@ -0,0 +1,11 @@ + + + + + true + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a22f4470..f83cc154 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -22,6 +22,7 @@ WiX Toolset + diff --git a/src/wix.snk b/src/wix.snk new file mode 100644 index 00000000..3908a66a Binary files /dev/null and b/src/wix.snk differ -- cgit v1.2.3-55-g6feb From 9eae5ab055fa4fcd484783f468df235776b92753 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 2 Nov 2020 18:17:46 -0600 Subject: Change workaround in Sdk.props to also work with MSBuild 16.8. This requires the .NET 4.8 targeting pack to be installed. --- src/WixToolset.Sdk/Sdk/Sdk.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WixToolset.Sdk/Sdk/Sdk.props b/src/WixToolset.Sdk/Sdk/Sdk.props index 5080e393..c517a1cf 100644 --- a/src/WixToolset.Sdk/Sdk/Sdk.props +++ b/src/WixToolset.Sdk/Sdk/Sdk.props @@ -10,7 +10,7 @@ - netstandard2.0 + .NETFramework,Version=v4.8 true true true -- cgit v1.2.3-55-g6feb From 850bd580f898cf93d7b2d75b556324dd3d37f563 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 4 Nov 2020 19:13:50 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From b0cb6432808a687bf18b19e0018bb4287093d02b Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 7 Nov 2020 11:30:25 -0600 Subject: WIXFEAT:5490 - Send MSBuild bin path to heat project harvesting. --- src/WixToolset.BuildTasks/HeatProject.cs | 9 + src/WixToolset.Sdk/tools/wix.harvest.targets | 3 + src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | 225 +++++++++++++++++++++ .../HeatProjectPreSdkStyle.wixproj | 50 +++++ .../HeatProject/HeatProjectPreSdkStyle/Package.wxs | 19 ++ .../HeatProjectSdkStyle.wixproj | 50 +++++ .../HeatProject/HeatProjectSdkStyle/Package.wxs | 19 ++ .../TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs | 8 + .../HeatProject/SdkStyleCs/SdkStyleCs.csproj | 8 + .../ToolsVersion4Cs/Properties/AssemblyInfo.cs | 11 + .../ToolsVersion4Cs/ToolsVersion4Cs.csproj | 36 ++++ .../WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj | 9 + 12 files changed, 447 insertions(+) create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj diff --git a/src/WixToolset.BuildTasks/HeatProject.cs b/src/WixToolset.BuildTasks/HeatProject.cs index 71679dc4..3833a754 100644 --- a/src/WixToolset.BuildTasks/HeatProject.cs +++ b/src/WixToolset.BuildTasks/HeatProject.cs @@ -39,6 +39,8 @@ namespace WixToolset.BuildTasks set { this.generateType = value; } } + public string MsbuildBinPath { get; set; } + public string Platform { get { return this.platform; } @@ -77,6 +79,8 @@ namespace WixToolset.BuildTasks } } + public bool UseToolsVersion { get; set; } + protected override string OperationName { get { return "project"; } @@ -90,11 +94,16 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendSwitchIfNotNull("-configuration ", this.Configuration); commandLineBuilder.AppendSwitchIfNotNull("-directoryid ", this.DirectoryIds); commandLineBuilder.AppendSwitchIfNotNull("-generate ", this.GenerateType); + commandLineBuilder.AppendSwitchIfNotNull("-msbuildbinpath ", this.MsbuildBinPath); commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.Platform); commandLineBuilder.AppendArrayIfNotNull("-pog ", this.ProjectOutputGroups); commandLineBuilder.AppendSwitchIfNotNull("-projectname ", this.ProjectName); commandLineBuilder.AppendIfTrue("-wixvar", this.GenerateWixVariables); +#if !NETCOREAPP + commandLineBuilder.AppendIfTrue("-usetoolsversion", this.UseToolsVersion); +#endif + base.BuildCommandLine(commandLineBuilder); } } diff --git a/src/WixToolset.Sdk/tools/wix.harvest.targets b/src/WixToolset.Sdk/tools/wix.harvest.targets index dea44469..f3ec760b 100644 --- a/src/WixToolset.Sdk/tools/wix.harvest.targets +++ b/src/WixToolset.Sdk/tools/wix.harvest.targets @@ -48,6 +48,7 @@ $(HarvestTransforms) $(IntermediateOutputPath)Product.Generated.wxs $(IntermediateOutputPath)Bundle.Generated.wxs + $(MSBuildBinPath) @@ -273,11 +274,13 @@ Project="%(_AllHeatProjects.FullPath)" ProjectOutputGroups="%(_AllHeatProjects.ProjectOutputGroups)" GenerateType="%(_AllHeatProjects.GenerateType)" + MsbuildBinPath="$(HarvestProjectsMsbuildBinPath)" DirectoryIds="%(_AllHeatProjects.DirectoryIds)" ProjectName="%(_AllHeatProjects.ProjectName)" Configuration="%(_AllHeatProjects.Configuration)" Platform="%(_AllHeatProjects.Platform)" GenerateWixVariables="$(HarvestProjectsGenerateWixVariables)" + UseToolsVersion="$(HarvestProjectsUseToolsVersion)" AdditionalOptions="$(HarvestProjectsAdditionalOptions)" RunAsSeparateProcess="$(RunWixToolsOutOfProc)" ToolExe="$(HeatToolExe)" diff --git a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs index 2f32a30f..10840c56 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs @@ -146,5 +146,230 @@ namespace WixToolsetTest.Sdk Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); } } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk, true)] + [InlineData(BuildSystem.DotNetCoreSdk, false)] + [InlineData(BuildSystem.MSBuild, true)] + [InlineData(BuildSystem.MSBuild, false)] + [InlineData(BuildSystem.MSBuild64, true)] + [InlineData(BuildSystem.MSBuild64, false)] + public void CanBuildHeatProjectPreSdkStyle(BuildSystem buildSystem, bool useToolsVersion) + { + var sourceFolder = TestData.Get(@"TestData\HeatProject"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectPreSdkStyle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatProjectPreSdkStyle.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, + }); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); + var heatCommandLine = Assert.Single(heatCommandLines); + + if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) + { + Assert.Contains("-usetoolsversion", heatCommandLine); + } + else + { + Assert.DoesNotContain("-usetoolsversion", heatCommandLine); + } + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ToolsVersion4Cs.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal(@"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatProjectPreSdkStyle.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk, true)] + [InlineData(BuildSystem.DotNetCoreSdk, false)] + [InlineData(BuildSystem.MSBuild, true)] + [InlineData(BuildSystem.MSBuild, false)] + [InlineData(BuildSystem.MSBuild64, true)] + [InlineData(BuildSystem.MSBuild64, false)] + public void CanBuildHeatProjectSdkStyle(BuildSystem buildSystem, bool useToolsVersion) + { + var sourceFolder = TestData.Get(@"TestData\HeatProject"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectSdkStyle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatProjectSdkStyle.wixproj"); + var referencedProjectPath = Path.Combine(fs.BaseFolder, "SdkStyleCs", "SdkStyleCs.csproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, referencedProjectPath, new[] + { + "-t:restore", + }); + result.AssertSuccess(); + + result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, + }); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); + var heatCommandLine = Assert.Single(heatCommandLines); + + if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) + { + Assert.Contains("-usetoolsversion", heatCommandLine); + } + else + { + Assert.DoesNotContain("-usetoolsversion", heatCommandLine); + } + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_SdkStyleCs.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal(@"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatProjectSdkStyle.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); + } + } } } diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj new file mode 100644 index 00000000..c569e8ac --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj @@ -0,0 +1,50 @@ + + + + + Debug + x86 + + + + BB919765-DD69-41E7-91C5-415A69BE923E + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + true + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs new file mode 100644 index 00000000..b2988760 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj new file mode 100644 index 00000000..907f0bb0 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj @@ -0,0 +1,50 @@ + + + + + Debug + x86 + + + + CE998A54-9BEC-4268-BFA2-8E3DAE5831C8 + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + true + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs new file mode 100644 index 00000000..fc6e9d29 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs new file mode 100644 index 00000000..2b2c5be2 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs @@ -0,0 +1,8 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace SdkStyleCs +{ + public class SdkStyleCs + { + } +} diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj new file mode 100644 index 00000000..755976bc --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj @@ -0,0 +1,8 @@ + + + + + + netstandard2.0 + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c29a2303 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("ToolsVersion4Cs")] +[assembly: AssemblyDescription("ToolsVersion4Cs")] +[assembly: AssemblyProduct("WiX Toolset")] +[assembly: AssemblyCompany("WiX Toolset Team")] +[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and contributors. All rights reserved.")] diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj new file mode 100644 index 00000000..9c55f7a5 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj @@ -0,0 +1,36 @@ + + + + + + + {8B19578A-816A-48A1-A6C4-58067334EB79} + ToolsVersion4Cs + Library + ToolsVersion4Cs + v4.0 + + + true + false + $(DefineConstants);DEBUG;TRACE + bin\Debug\ + + + true + true + $(DefineConstants);TRACE + bin\Release\ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj index 916300af..45c38996 100644 --- a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj +++ b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj @@ -6,6 +6,7 @@ net461 false embedded + TestData\**;$(DefaultItemExcludes) @@ -15,6 +16,14 @@ + + + + + + + + -- cgit v1.2.3-55-g6feb From 4c5ad8eff847ae894bbb91a50335fe7982e0ead2 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 16 Nov 2020 22:20:31 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 50f38d69001b2eb457a4603e14c98d05e28c3a5d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 17 Nov 2020 18:59:51 -0500 Subject: Update dependencies ...and skip now-broken DotNetCoreSdk Heat test --- src/ThmViewerPackage/ThmViewerPackage.wixproj | 4 ++-- src/ThmViewerPackage/packages.config | 2 +- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 2 +- .../WixToolset.Core.InternalPackage.csproj | 2 +- src/WixToolset.Sdk/WixToolset.Sdk.csproj | 2 +- src/dotnet-wix/dotnet-wix.csproj | 2 +- src/heat/heat.csproj | 2 +- src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | 2 +- src/thmviewer/packages.config | 2 +- src/thmviewer/thmviewer.vcxproj | 4 ++-- src/wix/wix.csproj | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ThmViewerPackage/ThmViewerPackage.wixproj b/src/ThmViewerPackage/ThmViewerPackage.wixproj index fefd6949..23d24654 100644 --- a/src/ThmViewerPackage/ThmViewerPackage.wixproj +++ b/src/ThmViewerPackage/ThmViewerPackage.wixproj @@ -29,7 +29,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - + diff --git a/src/ThmViewerPackage/packages.config b/src/ThmViewerPackage/packages.config index 9b93a067..7e55f706 100644 --- a/src/ThmViewerPackage/packages.config +++ b/src/ThmViewerPackage/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index c006b5a4..196b0916 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -37,6 +37,6 @@ - + diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj index 24d5decc..122734ed 100644 --- a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj +++ b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.csproj b/src/WixToolset.Sdk/WixToolset.Sdk.csproj index f1f063d5..041cccc8 100644 --- a/src/WixToolset.Sdk/WixToolset.Sdk.csproj +++ b/src/WixToolset.Sdk/WixToolset.Sdk.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/dotnet-wix/dotnet-wix.csproj b/src/dotnet-wix/dotnet-wix.csproj index 0f42d0be..4cb9ba54 100644 --- a/src/dotnet-wix/dotnet-wix.csproj +++ b/src/dotnet-wix/dotnet-wix.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 51c9b297..b82087df 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -35,6 +35,6 @@ - + diff --git a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs index 10840c56..bbf151eb 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs @@ -257,7 +257,7 @@ namespace WixToolsetTest.Sdk } } - [Theory] + [Theory(Skip = "DotNetCoreSdk builds fail in 16.8.1")] [InlineData(BuildSystem.DotNetCoreSdk, true)] [InlineData(BuildSystem.DotNetCoreSdk, false)] [InlineData(BuildSystem.MSBuild, true)] diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 321d628a..28ff6ebd 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index 157b3949..65c00614 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -69,7 +69,7 @@ - + @@ -82,7 +82,7 @@ - + \ No newline at end of file diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index d03d076e..0552c28a 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -33,6 +33,6 @@ - + -- cgit v1.2.3-55-g6feb From b3fa4360440e42f162d695423b50f6cbc45f7f35 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 28 Nov 2020 21:49:14 -0600 Subject: Use LatestMajor roll forward for Heat so it can load newer MSBuild. --- src/heat/heat.csproj | 2 +- src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index b82087df..f21f2eb6 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -13,7 +13,7 @@ win-x86 app.config heat.exe.manifest - Major + LatestMajor diff --git a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs index bbf151eb..10840c56 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs @@ -257,7 +257,7 @@ namespace WixToolsetTest.Sdk } } - [Theory(Skip = "DotNetCoreSdk builds fail in 16.8.1")] + [Theory] [InlineData(BuildSystem.DotNetCoreSdk, true)] [InlineData(BuildSystem.DotNetCoreSdk, false)] [InlineData(BuildSystem.MSBuild, true)] -- cgit v1.2.3-55-g6feb From f26a57c54e65764f604885cd0aaa15256c8f2d67 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 2 Dec 2020 14:40:15 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From b3b898f31b6e2304c27f786a7043aa3674ce3a4b Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 8 Dec 2020 15:17:48 -0600 Subject: Update test for BootstrapperApplicationDll element. --- .../TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs | 9 +++++---- src/thmviewer/thmviewer.vcxproj | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs index 6cd04712..d668a14f 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs @@ -1,10 +1,11 @@ - - + - + + + - + diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index 65c00614..a1a1baa8 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -22,7 +22,7 @@ {95228C13-97F5-484A-B4A2-ECF4618B0881} Win32Proj Application - v141 + v142 Unicode WiX Toolset Theme Viewer -- cgit v1.2.3-55-g6feb From 037a8b850b518b9bd72d217375b73a872e47d092 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 8 Dec 2020 22:54:42 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From a82e1d8f35e8abd0e896543bf554dfe0ab4c1253 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 14 Dec 2020 14:45:40 -0600 Subject: Enable CheckForOverflowUnderflow. --- src/CSharp.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CSharp.Build.props b/src/CSharp.Build.props index b12f4c6e..bcd47a0c 100644 --- a/src/CSharp.Build.props +++ b/src/CSharp.Build.props @@ -5,6 +5,7 @@ --> + true true $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) -- cgit v1.2.3-55-g6feb From 93f39c964d95f587693c915f6d7d97b6d7873b80 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 18 Dec 2020 23:11:51 -0600 Subject: Update to latest repo template and remove warnings. --- src/CSharp.Build.props | 1 + src/Directory.Build.targets | 8 ++++++++ src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 4 ---- src/dotnet-wix/dotnet-wix.nuspec | 3 --- src/heat/heat.csproj | 4 ---- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/CSharp.Build.props b/src/CSharp.Build.props index bcd47a0c..81d24ad1 100644 --- a/src/CSharp.Build.props +++ b/src/CSharp.Build.props @@ -8,5 +8,6 @@ true true $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + false diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index dac7452a..cb988931 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -9,6 +9,11 @@ See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284 --> + + false + $(OutputPath)\$(AssemblyName).xml + + true $(SolutionPath) @@ -45,4 +50,7 @@ + + + diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 196b0916..6f43bae5 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -13,10 +13,6 @@ AnyCPU - - NU1701 - - diff --git a/src/dotnet-wix/dotnet-wix.nuspec b/src/dotnet-wix/dotnet-wix.nuspec index c2a4c8f4..8226a4c7 100644 --- a/src/dotnet-wix/dotnet-wix.nuspec +++ b/src/dotnet-wix/dotnet-wix.nuspec @@ -11,9 +11,6 @@ - - - diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index f21f2eb6..53446e2f 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -16,10 +16,6 @@ LatestMajor - - NU1701 - - -- cgit v1.2.3-55-g6feb From d718243dfbb41f28aa8030939595b6493f4a78f0 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 19 Dec 2020 14:53:52 -0600 Subject: Label skipped test with issue number. --- src/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs index 29969592..051d33fd 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -240,7 +240,7 @@ namespace WixToolsetTest.Sdk } } - [Theory(Skip = "Currently fails")] + [Theory(Skip = "Currently fails")] //https://github.com/wixtoolset/issues/issues/5946 [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] -- cgit v1.2.3-55-g6feb From 267adbf809c96b37e40a883a6b5241179de876d3 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 3 Jan 2021 14:26:52 -0600 Subject: Update to latest Core. --- src/WixToolset.BuildTasks/ToolsetTask.cs | 4 ++-- src/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WixToolset.BuildTasks/ToolsetTask.cs b/src/WixToolset.BuildTasks/ToolsetTask.cs index 6b171eb0..d48f2a20 100644 --- a/src/WixToolset.BuildTasks/ToolsetTask.cs +++ b/src/WixToolset.BuildTasks/ToolsetTask.cs @@ -112,10 +112,10 @@ namespace WixToolset.BuildTasks protected virtual void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) { commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); - commandLineBuilder.AppendArrayIfNotNull("-sw ", this.SuppressSpecificWarnings); + commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); commandLineBuilder.AppendIfTrue("-sw", this.SuppressAllWarnings); commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput); - commandLineBuilder.AppendArrayIfNotNull("-wx ", this.TreatSpecificWarningsAsErrors); + commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors); commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); } diff --git a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs index 051d33fd..f505dbb5 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -240,7 +240,7 @@ namespace WixToolsetTest.Sdk } } - [Theory(Skip = "Currently fails")] //https://github.com/wixtoolset/issues/issues/5946 + [Theory(Skip = "https://github.com/wixtoolset/issues/issues/5946")] [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] -- cgit v1.2.3-55-g6feb From d8cfa6ebc24657ce7638f0608c7975f177f0ba06 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sun, 3 Jan 2021 18:31:03 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 417df19074fe03d4886db1def788fa5bf6eb1db5 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 19 Jan 2021 15:53:39 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 61ddcf628b37261f0ef1f3c590915b4906cdcb88 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 19 Jan 2021 16:17:08 -0600 Subject: Add DetectCondition to ExePackage to fix test. --- .../TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs index d668a14f..3b4a9d6a 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs @@ -1,11 +1,11 @@ - + - + -- cgit v1.2.3-55-g6feb From 489fc2afcc38c06f5798d29680d74cfcce4f0b6f Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 26 Jan 2021 11:49:23 -0500 Subject: Add DefaultCompressionLevel support. --- src/WixToolset.BuildTasks/WixBuild.cs | 5 +++++ src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs | 1 + .../TestData/SimpleMsiPackage/MsiPackage/Package.wxs | 4 +--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/WixToolset.BuildTasks/WixBuild.cs b/src/WixToolset.BuildTasks/WixBuild.cs index b669c52b..dbff7e81 100644 --- a/src/WixToolset.BuildTasks/WixBuild.cs +++ b/src/WixToolset.BuildTasks/WixBuild.cs @@ -59,7 +59,9 @@ namespace WixToolset.BuildTasks public ITaskItem BindBuiltOutputsFile { get; set; } public string CabinetCachePath { get; set; } + public int CabinetCreationThreadCount { get; set; } + public string DefaultCompressionLevel { get; set; } [Output] @@ -69,7 +71,9 @@ namespace WixToolset.BuildTasks public string[] WixVariables { get; set; } public bool SuppressValidation { get; set; } + public string[] SuppressIces { get; set; } + public string AdditionalCub { get; set; } protected override string ToolName => "wix.exe"; @@ -95,6 +99,7 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile); commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile); commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile); + commandLineBuilder.AppendSwitchIfNotNull("-defaultcompressionlevel ", this.DefaultCompressionLevel); base.BuildCommandLine(commandLineBuilder); diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs index 87382cb8..9d132f66 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -45,6 +45,7 @@ namespace WixToolsetTest.BuildTasks OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), PdbType = "Full", PdbFile = new TaskItem(pdbPath), + DefaultCompressionLevel = "nOnE", }; var result = task.Execute(); diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs index b900447a..3fd580db 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -1,12 +1,10 @@ - + - - -- cgit v1.2.3-55-g6feb From 8fb65283c90248f41a6204461d310d2127e3d449 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 26 Jan 2021 17:22:17 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 2cc1d537b4a7bc88ba2e936e7b10344f5f8e0bf3 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 26 Jan 2021 21:55:49 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 045fb4a1145cd79bf8e104f2284d341be2154efa Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 27 Jan 2021 20:09:16 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 8ff46777c2707bfb41cc6eaeac058fd5b44914b7 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 28 Jan 2021 20:51:31 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 38c4c29ab834427ff675261f50260d064be3827c Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sun, 31 Jan 2021 19:46:44 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 582d90aaca35e2ee2e71ad99112b5d85401c7114 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 4 Feb 2021 20:37:39 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 8a773c1787bc7a28be3389a3f93454e84f26e1d5 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 6 Feb 2021 17:33:05 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..0995869e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 116f0e50f50ca4d87dc97a9ff304d975f7fbeaf0 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 11 Feb 2021 14:44:44 -0800 Subject: One shiny NuGet package, please and thank you. --- src/wix/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 988d9036..86a1d4d9 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -88,6 +88,5 @@ namespace WixToolset.Tools var command = commandLine.CreateCommand(args); return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); } - } } -- cgit v1.2.3-55-g6feb From a3df28ee2d0b5cdbb5ae0254fa41422e2ea9a380 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 17 Feb 2021 15:02:59 -0600 Subject: Update dutil. --- src/thmviewer/packages.config | 2 +- src/thmviewer/thmviewer.vcxproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 28ff6ebd..1c027b04 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index a1a1baa8..2c8a5161 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -5,7 +5,7 @@ - + @@ -83,6 +83,6 @@ - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 08fdca8b8b7b451f961b7ea3d2706cf7daa5b6a9 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 22 Feb 2021 20:31:24 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0995869e..7bbbf9df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 0575cd09cb8855454d39efe54aafa485678bf572 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Feb 2021 08:50:03 -0800 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bbbf9df..61314359 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Tools + Command line tools and MSBuild integration -- cgit v1.2.3-55-g6feb From 259297b40ae549fb5e7e52bcaf9861900c343566 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 1 Mar 2021 12:34:23 -0800 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61314359..a806dbde 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 9bf8e0cb421fe728e44f779cfcd777dcb2a63be1 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 2 Mar 2021 16:11:02 -0600 Subject: Update heat.exe to add the Burn backend. #4183, #3992 --- src/heat/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/heat/Program.cs b/src/heat/Program.cs index 30a82511..9f95e0bc 100644 --- a/src/heat/Program.cs +++ b/src/heat/Program.cs @@ -7,6 +7,7 @@ namespace WixToolset.Tools.Heat using System.Threading; using System.Threading.Tasks; using WixToolset.Core; + using WixToolset.Core.Burn; using WixToolset.Data; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -27,7 +28,8 @@ namespace WixToolset.Tools.Heat [MTAThread] public static async Task Main(string[] args) { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() + .AddBundleBackend(); var listener = new ConsoleMessageListener("HEAT", "heat.exe"); try -- cgit v1.2.3-55-g6feb From 9e5dc884cf215dab500a32688bd4b66644259776 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 3 Mar 2021 12:20:47 -0800 Subject: Update to latest build infrastructure --- .gitignore | 43 ++++++++++++----- appveyor.cmd | 7 ++- appveyor.yml | 8 ++-- src/CSharp.Build.props | 13 ----- src/Cpp.Build.props | 104 ---------------------------------------- src/Directory.Build.props | 4 +- src/Directory.Build.targets | 9 +--- src/Directory.csproj.props | 13 +++++ src/Directory.csproj.targets | 26 ++++++++++ src/Directory.vcxproj.props | 111 +++++++++++++++++++++++++++++++++++++++++++ src/Directory.wixproj.props | 14 ++++++ src/Wix.Build.props | 14 ------ 12 files changed, 209 insertions(+), 157 deletions(-) delete mode 100644 src/CSharp.Build.props delete mode 100644 src/Cpp.Build.props create mode 100644 src/Directory.csproj.props create mode 100644 src/Directory.csproj.targets create mode 100644 src/Directory.vcxproj.props create mode 100644 src/Directory.wixproj.props delete mode 100644 src/Wix.Build.props diff --git a/.gitignore b/.gitignore index 3e8a1553..1ee53850 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Mono auto generated files +mono_crash.* + # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -20,12 +23,14 @@ [Rr]eleases/ x64/ x86/ +[Ww][Ii][Nn]32/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ +[Ll]ogs/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -39,9 +44,10 @@ Generated\ Files/ [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +# NUnit *.VisualState.xml TestResult.xml +nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ @@ -56,6 +62,9 @@ project.lock.json project.fragment.lock.json artifacts/ +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + # StyleCop StyleCopReport.xml @@ -122,9 +131,6 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding add-in -.JustCode - # TeamCity is a build add-in _TeamCity* @@ -135,6 +141,11 @@ _TeamCity* .axoCover/* !.axoCover/settings.json +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + # Visual Studio code coverage results *.coverage *.coveragexml @@ -182,6 +193,8 @@ PublishScripts/ # NuGet Packages *.nupkg +# NuGet Symbol Packages +*.snupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. @@ -206,6 +219,8 @@ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx +*.appxbundle +*.appxupload # Visual Studio cache files # files ending in .cache can be ignored @@ -231,8 +246,6 @@ orleans.codegen.cs # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ -# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true -**/wwwroot/lib/ # RIA/Silverlight projects Generated_Code/ @@ -257,6 +270,9 @@ ServiceFabricBackup/ *.bim.layout *.bim_*.settings *.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ @@ -292,10 +308,6 @@ paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml - # CodeRush personal settings .cr/personal @@ -337,5 +349,14 @@ ASALocalRun/ # Local History for Visual Studio .localhistory/ -# BeatPulse healthcheck temp database +# BeatPulse healthcheck temp database healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/appveyor.cmd b/appveyor.cmd index f12f3903..23058ece 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -3,11 +3,15 @@ @set _C=Release @set _P=%~dp0build\%_C%\publish @set _RCO=/S /R:1 /W:1 /NP /XO /NS /NC /NFL /NDL /NJH /NJS +@if /i "%1"=="debug" set _C=Debug +:: Restore nuget restore || exit /b -dotnet test -c %_C% src\test\WixToolsetTest.BuildTasks || exit /b +:: Build +msbuild -p:Configuration=%_C% || exit /b +:: Test dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix || exit /b dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b @@ -36,6 +40,7 @@ dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\broken\net461\ -f net461 -r dne sr dotnet test -c %_C% src\test\WixToolsetTest.Sdk || exit /b +:: Pack dotnet pack -c %_C% src\dotnet-wix || exit /b dotnet pack -c %_C% src\WixToolset.Sdk || exit /b diff --git a/appveyor.yml b/appveyor.yml index 01f87f46..43014705 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,13 +30,13 @@ nuget: skip_branch_with_pr: true skip_tags: true -test: off - artifacts: -- path: build\Release\**\*.nupkg - name: nuget - path: build\Release\**\*.msi name: msi +- path: build\Release\**\*.nupkg + name: nuget +- path: build\Release\**\*.snupkg + name: snupkg notifications: - provider: Slack diff --git a/src/CSharp.Build.props b/src/CSharp.Build.props deleted file mode 100644 index 81d24ad1..00000000 --- a/src/CSharp.Build.props +++ /dev/null @@ -1,13 +0,0 @@ - - - - - true - true - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) - false - - diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props deleted file mode 100644 index 44a042c7..00000000 --- a/src/Cpp.Build.props +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - Win32 - $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ - $(OutputPath)$(Platform)\ - - - - $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) - - - - - $(DisableSpecificCompilerWarnings) - Level4 - $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - Use - precomp.h - StdCall - true - false - -YlprecompDefine - /Zc:threadSafeInit- %(AdditionalOptions) - true - - - $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) - $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) - - - $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) - - - $(ProjectSubSystem) - $(ProjectModuleDefinitionFile) - $(ResourceOnlyDll) - true - $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) - $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) - /IGNORE:4099 %(AdditionalOptions) - - - - - - NoExtensions - - - - - CDecl - - - - - OldStyle - true - true - - - - - Disabled - EnableFastChecks - _DEBUG;DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebug - - - - - - MultiThreadedDebugDll - - - - - MinSpace - NDEBUG;%(PreprocessorDefinitions) - true - true - MultiThreaded - - - true - true - - - - - - MultiThreadedDll - - - - - $(LinkKeyFile) - $(LinkDelaySign) - - - diff --git a/src/Directory.Build.props b/src/Directory.Build.props index f83cc154..b3c6287c 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -22,8 +22,6 @@ WiX Toolset - - - + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index cb988931..2fcc765a 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -9,11 +9,6 @@ See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284 --> - - false - $(OutputPath)\$(AssemblyName).xml - - true $(SolutionPath) @@ -45,12 +40,12 @@ - + - + diff --git a/src/Directory.csproj.props b/src/Directory.csproj.props new file mode 100644 index 00000000..81d24ad1 --- /dev/null +++ b/src/Directory.csproj.props @@ -0,0 +1,13 @@ + + + + + true + true + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + false + + diff --git a/src/Directory.csproj.targets b/src/Directory.csproj.targets new file mode 100644 index 00000000..c3270426 --- /dev/null +++ b/src/Directory.csproj.targets @@ -0,0 +1,26 @@ + + + + + false + $(OutputPath)\$(AssemblyName).xml + + + + + $(PrivateRepositoryUrl.Replace('.git','')) + + $(MSBuildProjectName).nuspec + $(OutputPath)..\ + $(NuspecProperties);Id=$(PackageId);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description);Title=$(Title) + $(NuspecProperties);Version=$(PackageVersion);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl);ProjectFolder=$(MSBuildProjectDirectory)\;ProjectUrl=$(ProjectUrl) + true + snupkg + + + + diff --git a/src/Directory.vcxproj.props b/src/Directory.vcxproj.props new file mode 100644 index 00000000..bcf26c57 --- /dev/null +++ b/src/Directory.vcxproj.props @@ -0,0 +1,111 @@ + + + + + + Win32 + $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ + $(OutputPath)$(Platform)\ + + + $(Company) + $(Copyright) + + win-x86;win-x64;win-arm64 + native,Version=v0.0 + + + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + + + + + $(DisableSpecificCompilerWarnings) + Level4 + $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + Use + precomp.h + StdCall + true + false + -YlprecompDefine + /Zc:threadSafeInit- %(AdditionalOptions) + true + + + $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) + $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) + + + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) + + + $(ProjectSubSystem) + $(ProjectModuleDefinitionFile) + $(ResourceOnlyDll) + true + $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) + /IGNORE:4099 %(AdditionalOptions) + + + + + + NoExtensions + + + + + CDecl + + + + + OldStyle + true + true + + + + + Disabled + EnableFastChecks + _DEBUG;DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + + MultiThreadedDebugDll + + + + + MinSpace + NDEBUG;%(PreprocessorDefinitions) + true + true + MultiThreaded + + + true + true + + + + + + MultiThreadedDll + + + + + $(LinkKeyFile) + $(LinkDelaySign) + + + diff --git a/src/Directory.wixproj.props b/src/Directory.wixproj.props new file mode 100644 index 00000000..a0aaa658 --- /dev/null +++ b/src/Directory.wixproj.props @@ -0,0 +1,14 @@ + + + + + + $(DefineConstants);CompanyName=$(Company) + + + + + + + + diff --git a/src/Wix.Build.props b/src/Wix.Build.props deleted file mode 100644 index a0aaa658..00000000 --- a/src/Wix.Build.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - $(DefineConstants);CompanyName=$(Company) - - - - - - - - -- cgit v1.2.3-55-g6feb From 59fea83c14b32d654271af313ee7be64ceb95236 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 8 Mar 2021 15:54:34 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a806dbde..61314359 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From d9b70147917b17f5c14537f085b161a392b983f4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 11 Mar 2021 20:23:54 -0600 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61314359..a806dbde 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 30ae681ff76799c1aea8821cbe4c8de292c59ddd Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 15 Mar 2021 20:47:34 -0400 Subject: Update service provider dependency --- src/WixToolset.BuildTasks/WixBuild_InProc.cs | 1 + src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 1 + src/heat/Program.cs | 2 +- src/wix/Program.cs | 2 +- src/wix/wix.csproj | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.BuildTasks/WixBuild_InProc.cs b/src/WixToolset.BuildTasks/WixBuild_InProc.cs index a45d2369..9cba0f62 100644 --- a/src/WixToolset.BuildTasks/WixBuild_InProc.cs +++ b/src/WixToolset.BuildTasks/WixBuild_InProc.cs @@ -3,6 +3,7 @@ #if !NETCOREAPP namespace WixToolset.BuildTasks { + using System; using System.Threading; using System.Threading.Tasks; using WixToolset.Core.Burn; diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 6f43bae5..e4dfaf2f 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -19,6 +19,7 @@ + diff --git a/src/heat/Program.cs b/src/heat/Program.cs index 9f95e0bc..d0bcf19f 100644 --- a/src/heat/Program.cs +++ b/src/heat/Program.cs @@ -62,7 +62,7 @@ namespace WixToolset.Tools.Heat /// Service provider to use throughout this execution. /// The commandline arguments. /// Returns the application error code. - public Task Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) + public Task Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args) { var messaging = serviceProvider.GetService(); messaging.SetListener(listener); diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 86a1d4d9..d1818df0 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -79,7 +79,7 @@ namespace WixToolset.Tools /// Command-line arguments to execute. /// Cancellation token. /// Returns the application error code. - public static Task Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args, CancellationToken cancellationToken) + public static Task Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args, CancellationToken cancellationToken) { var messaging = serviceProvider.GetService(); messaging.SetListener(listener); diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 0552c28a..f414bf41 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -26,6 +26,7 @@ + -- cgit v1.2.3-55-g6feb From aee0611332b06012b8ae2e34744c54db20c0dda0 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 16 Mar 2021 20:57:49 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a806dbde..61314359 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From f71e6a5dfdda7f12bac06b36ef6761af41b94ea1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 18 Mar 2021 02:33:32 -0700 Subject: Re-enable suppressed ICES test and update dependencies Completes wixtoolset/issues#5946 --- appveyor.cmd | 2 +- appveyor.yml | 2 ++ src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 1 + src/heat/heat.csproj | 1 + src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj | 2 +- src/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 2 +- src/wix/wix.csproj | 1 + 7 files changed, 8 insertions(+), 3 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 23058ece..0cf8062c 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -1,9 +1,9 @@ @setlocal @pushd %~dp0 @set _C=Release +@if /i "%1"=="debug" set _C=Debug @set _P=%~dp0build\%_C%\publish @set _RCO=/S /R:1 /W:1 /NP /XO /NS /NC /NFL /NDL /NJH /NJS -@if /i "%1"=="debug" set _C=Debug :: Restore nuget restore || exit /b diff --git a/appveyor.yml b/appveyor.yml index 43014705..d3b93b78 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,6 +30,8 @@ nuget: skip_branch_with_pr: true skip_tags: true +test: off + artifacts: - path: build\Release\**\*.msi name: msi diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index e4dfaf2f..20ae6931 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -20,6 +20,7 @@ + diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 53446e2f..83f97343 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -26,6 +26,7 @@ + diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 696e5845..95a88190 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -28,7 +28,7 @@ - + diff --git a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs index f505dbb5..034f5b0b 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -240,7 +240,7 @@ namespace WixToolsetTest.Sdk } } - [Theory(Skip = "https://github.com/wixtoolset/issues/issues/5946")] + [Theory] [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] [InlineData(BuildSystem.MSBuild64)] diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index f414bf41..648816fd 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -27,6 +27,7 @@ + -- cgit v1.2.3-55-g6feb From be385c4763246707b536f5585414b7e8a165263d Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 18 Mar 2021 09:36:31 -0500 Subject: Don't directly reference WixToolset.Core.Native. --- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 1 - src/heat/heat.csproj | 1 - src/wix/wix.csproj | 1 - 3 files changed, 3 deletions(-) diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index 20ae6931..e4dfaf2f 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -20,7 +20,6 @@ - diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 83f97343..53446e2f 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -26,7 +26,6 @@ - diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index 648816fd..f414bf41 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -27,7 +27,6 @@ - -- cgit v1.2.3-55-g6feb From c16266bfaa8db984c6bc3d9d270de6c66a21408b Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 22 Mar 2021 18:52:32 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61314359..a806dbde 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 1eb00ae94855f10612aa79cf669e0c73cf75fa93 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 31 Mar 2021 11:35:04 -0500 Subject: Fix Heat tests and run BuildTask tests. --- appveyor.cmd | 2 ++ src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 0cf8062c..98506de8 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -12,6 +12,8 @@ nuget restore || exit /b msbuild -p:Configuration=%_C% || exit /b :: Test +dotnet test -c %_C% --no-build src\test\WixToolsetTest.BuildTasks || exit /b + dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix || exit /b dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b diff --git a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs index 10840c56..8b2e8e3d 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs @@ -66,7 +66,7 @@ namespace WixToolsetTest.Sdk var section = intermediate.Sections.Single(); var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath()?.Path); } } @@ -142,8 +142,8 @@ namespace WixToolsetTest.Sdk var section = intermediate.Sections.Single(); var fileSymbols = section.Symbols.OfType().ToArray(); - Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath().Path); - Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); + Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); } } @@ -253,7 +253,7 @@ namespace WixToolsetTest.Sdk var section = intermediate.Sections.Single(); var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); } } @@ -368,7 +368,7 @@ namespace WixToolsetTest.Sdk var section = intermediate.Sections.Single(); var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); + Assert.Equal(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); } } } -- cgit v1.2.3-55-g6feb From 62dd878b5fd6d7d354034178584710ecb903985e Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 31 Mar 2021 11:50:36 -0500 Subject: Add failing tests for bundles with uncompressed payloads. --- src/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 34 ++++++++++++++++++ .../SimpleMsiPackage/UncompressedBundle/Bundle.wxs | 11 ++++++ .../UncompressedBundle/UncompressedBundle.wixproj | 42 ++++++++++++++++++++++ .../WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj | 2 ++ 4 files changed, 89 insertions(+) create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs create mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj diff --git a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs index 034f5b0b..3c8e79e7 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -44,6 +44,40 @@ namespace WixToolsetTest.Sdk } } + [Theory(Skip = "Test demonstrates failure")] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildUncompressedBundle(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "UncompressedBundle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "UncompressedBundle.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(new[] + { + @"bin\x86\Release\SimpleBundle.exe", + @"bin\x86\Release\SimpleBundle.wixpdb", + @"bin\x86\Release\test.txt", + }, paths); + } + } + [Theory] [InlineData(BuildSystem.DotNetCoreSdk)] [InlineData(BuildSystem.MSBuild)] diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs new file mode 100644 index 00000000..6ab9a016 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj new file mode 100644 index 00000000..199eb6d9 --- /dev/null +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + + + + 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d + Bundle + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj index 45c38996..35ed053a 100644 --- a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj +++ b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj @@ -40,6 +40,8 @@ + + -- cgit v1.2.3-55-g6feb From 9331f113bcaedd6c391077a07d5f98f3fdb85a95 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 31 Mar 2021 13:39:06 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a806dbde..61314359 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From 04dd968856734d40e20802cd07e89f40ac871191 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 2 Apr 2021 14:54:40 -0700 Subject: Standardize on .NET Core v3.1 --- appveyor.cmd | 16 ++++++++-------- src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj | 6 +++--- .../WixToolset.Core.InternalPackage.nuspec | 2 +- src/WixToolset.Sdk/WixToolset.Sdk.csproj | 2 +- src/WixToolset.Sdk/tools/wix.targets | 2 +- src/dotnet-wix/dotnet-wix.csproj | 2 +- src/dotnet-wix/dotnet-wix.nuspec | 4 ++-- src/heat/heat.csproj | 4 ++-- .../WixToolsetTest.BuildTasks.csproj | 2 +- src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs | 2 +- src/wix/wix.csproj | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/appveyor.cmd b/appveyor.cmd index 98506de8..504b2e9d 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -14,7 +14,7 @@ msbuild -p:Configuration=%_C% || exit /b :: Test dotnet test -c %_C% --no-build src\test\WixToolsetTest.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp2.1 src\wix || exit /b +dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp3.1 src\wix || exit /b dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b @@ -30,15 +30,15 @@ robocopy %_P%\WixToolset.Sdk\separate\net461\x64\buildtasks %_P%\WixToolset.Sdk\ robocopy %_P%\WixToolset.Sdk\separate\net461\x64\heat %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% robocopy %_P%\WixToolset.Sdk\separate\net461\x64\wix %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\netcoreapp2.1\buildtasks\ -f netcoreapp2.1 src\WixToolset.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\netcoreapp2.1\heat\ -f netcoreapp2.1 src\heat || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\netcoreapp2.1\wix\ -f netcoreapp2.1 src\wix || exit /b -robocopy %_P%\WixToolset.Sdk\separate\netcoreapp2.1\buildtasks %_P%\WixToolset.Sdk\tools\netcoreapp2.1 %_RCO% /XF Microsoft.Build.*.dll -robocopy %_P%\WixToolset.Sdk\separate\netcoreapp2.1\heat %_P%\WixToolset.Sdk\tools\netcoreapp2.1 %_RCO% -robocopy %_P%\WixToolset.Sdk\separate\netcoreapp2.1\wix %_P%\WixToolset.Sdk\tools\netcoreapp2.1 %_RCO% +dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\buildtasks\ -f netcoreapp3.1 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\heat\ -f netcoreapp3.1 src\heat || exit /b +dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\wix\ -f netcoreapp3.1 src\wix || exit /b +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\buildtasks %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% /XF Microsoft.Build.*.dll +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\heat %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\wix %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\ src\WixToolset.Sdk || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\broken\net461\ -f net461 -r dne src\wix || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\broken\net461\ -f net461 -r linux-x64 src\wix || exit /b dotnet test -c %_C% src\test\WixToolsetTest.Sdk || exit /b diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj index e4dfaf2f..3a1c7f4c 100644 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -3,12 +3,12 @@ - netcoreapp2.1;net461 + netcoreapp3.1;net461 WiX Toolset MSBuild Tasks embedded true - win-x86 + win-x86 AnyCPU @@ -28,7 +28,7 @@ - + diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec index a461557a..ed08d2a7 100644 --- a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec +++ b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec @@ -13,7 +13,7 @@ - + diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.csproj b/src/WixToolset.Sdk/WixToolset.Sdk.csproj index 041cccc8..2374bf86 100644 --- a/src/WixToolset.Sdk/WixToolset.Sdk.csproj +++ b/src/WixToolset.Sdk/WixToolset.Sdk.csproj @@ -3,7 +3,7 @@ - netcoreapp2.1 + netcoreapp3.1 false WiX Toolset MSBuild integration $(MSBuildThisFileName).nuspec diff --git a/src/WixToolset.Sdk/tools/wix.targets b/src/WixToolset.Sdk/tools/wix.targets index 6914d03e..5044bf5e 100644 --- a/src/WixToolset.Sdk/tools/wix.targets +++ b/src/WixToolset.Sdk/tools/wix.targets @@ -19,7 +19,7 @@ - $(MSBuildThisFileDirectory)netcoreapp2.1\ + $(MSBuildThisFileDirectory)netcoreapp3.1\ $(MSBuildThisFileDirectory)net461\x86\ $(MSBuildThisFileDirectory)net461\x64\ $(WixBinDir)WixToolset.BuildTasks.dll diff --git a/src/dotnet-wix/dotnet-wix.csproj b/src/dotnet-wix/dotnet-wix.csproj index 4cb9ba54..710ab5cd 100644 --- a/src/dotnet-wix/dotnet-wix.csproj +++ b/src/dotnet-wix/dotnet-wix.csproj @@ -3,7 +3,7 @@ - netcoreapp2.1 + netcoreapp3.1 false WiX Toolset Command-line interface $(MSBuildThisFileName).nuspec diff --git a/src/dotnet-wix/dotnet-wix.nuspec b/src/dotnet-wix/dotnet-wix.nuspec index 8226a4c7..66d42c75 100644 --- a/src/dotnet-wix/dotnet-wix.nuspec +++ b/src/dotnet-wix/dotnet-wix.nuspec @@ -14,7 +14,7 @@ - - + + diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 53446e2f..08cf61c0 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -3,14 +3,14 @@ - netcoreapp2.1;net461 + netcoreapp3.1;net461 Exe Harvester WiX Harvester embedded true - win-x86 + win-x86 app.config heat.exe.manifest LatestMajor diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj index 95a88190..c01860cd 100644 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs b/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs index cfb421b2..2e07af3a 100644 --- a/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs +++ b/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs @@ -17,7 +17,7 @@ namespace WixToolsetTest.Sdk public static class MsbuildUtilities { - public static readonly string WixMsbuildPath = Path.Combine(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath, "..", "..", "publish", "WixToolset.Sdk"); + public static readonly string WixMsbuildPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath), "..", "publish", "WixToolset.Sdk"); public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.Sdk.props"); public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj index f414bf41..7fac5e95 100644 --- a/src/wix/wix.csproj +++ b/src/wix/wix.csproj @@ -3,14 +3,14 @@ - netcoreapp2.1;net461 + netcoreapp3.1;net461 Exe Compiler WiX Toolset Compiler embedded true - win-x86 + win-x86 app.config wix.exe.manifest Major -- cgit v1.2.3-55-g6feb From bfceba63a439478543a52d56c882ffd941b6a008 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 7 Apr 2021 14:58:47 -0700 Subject: Update to StandardDirectory --- src/ThmViewerPackage/Package.wxs | 18 +++++++----------- .../HeatFileMultipleFilesSameFileName/Package.wxs | 10 ++++------ .../TestData/HeatFilePackage/Package.wxs | 12 +++++------- .../HeatProject/HeatProjectPreSdkStyle/Package.wxs | 10 ++++------ .../HeatProject/HeatProjectSdkStyle/Package.wxs | 10 ++++------ .../TestData/MergeModule/MergeMsiPackage/Package.wxs | 14 +++++--------- .../MergeModule/SimpleMergeModule/MergeModule.wxs | 6 ++---- .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 12 ++++-------- .../TestData/SimpleMsiPackage/MsiPackage/Package.wxs | 6 ++---- 9 files changed, 37 insertions(+), 61 deletions(-) diff --git a/src/ThmViewerPackage/Package.wxs b/src/ThmViewerPackage/Package.wxs index e2c3c9f8..cb2139cf 100644 --- a/src/ThmViewerPackage/Package.wxs +++ b/src/ThmViewerPackage/Package.wxs @@ -1,8 +1,6 @@  - - @@ -12,7 +10,7 @@ - + @@ -21,14 +19,12 @@ - - - - - - - - + + + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs index 4cdcdf15..5abcee9f 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs @@ -1,4 +1,4 @@ - + @@ -11,10 +11,8 @@ - - - - - + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs index 8e04a8ce..f5fa8cf6 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs @@ -1,4 +1,4 @@ - + @@ -10,10 +10,8 @@ - - - - - - + + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs index b2988760..6c12861b 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs @@ -1,4 +1,4 @@ - + @@ -10,10 +10,8 @@ - - - - - + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs index fc6e9d29..d30218f3 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs @@ -1,4 +1,4 @@ - + @@ -10,10 +10,8 @@ - - - - - + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs index 71d8fff6..ef62c31b 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs @@ -1,7 +1,5 @@ - + - - @@ -10,12 +8,10 @@ - - - - - + + + - + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs index 19a7b7e4..b892debd 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs @@ -1,4 +1,4 @@ - + @@ -6,9 +6,7 @@ - - - + diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs index 4bdebbcf..df24aa33 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs @@ -1,7 +1,5 @@ - + - - @@ -11,10 +9,8 @@ - - - - - + + + diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs index 3fd580db..0a133c7d 100644 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -12,10 +12,8 @@ - - + - - + -- cgit v1.2.3-55-g6feb From 5520192a6be72eb2a768bfe6b682b0c400bfbbae Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 8 Apr 2021 15:58:39 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61314359..a806dbde 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 41638c49957fb2c517d989209b41b578596e4627 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Mon, 12 Apr 2021 15:27:33 -0400 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a806dbde..61314359 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # Tools Command line tools and MSBuild integration - -- cgit v1.2.3-55-g6feb From a77209b8380e3432f08ac4b5e8ad8597d09a7aca Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 15 Apr 2021 18:07:16 -0500 Subject: Update to latest dutil. --- src/thmviewer/packages.config | 2 +- src/thmviewer/thmviewer.vcxproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 1c027b04..4f75128a 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index 2c8a5161..bdd17b64 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -5,7 +5,7 @@ - + @@ -83,6 +83,6 @@ - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From f500ba6c39184f90108ff4ea8e3b4348d13a0ae4 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 19 Apr 2021 19:27:15 -0700 Subject: Standardize appveyor.yml --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d3b93b78..8fea070e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,6 +21,8 @@ environment: build_script: - appveyor.cmd +test: off + pull_requests: do_not_increment_build_number: true @@ -30,8 +32,6 @@ nuget: skip_branch_with_pr: true skip_tags: true -test: off - artifacts: - path: build\Release\**\*.msi name: msi -- cgit v1.2.3-55-g6feb From 949d633b80d8b5cc9eb50b7620a0783a7f9f24dc Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 20 Apr 2021 12:13:40 -0700 Subject: Remove dead code --- .../WixToolset.Core.InternalPackage.csproj | 28 ---------------------- .../WixToolset.Core.InternalPackage.nuspec | 20 ---------------- .../WixToolset.Core.InternalPackage.props | 8 ------- 3 files changed, 56 deletions(-) delete mode 100644 src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj delete mode 100644 src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec delete mode 100644 src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj deleted file mode 100644 index 122734ed..00000000 --- a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - netstandard2.0 - false - Internal WiX Toolset Tools - $(MSBuildThisFileName).nuspec - $(OutputPath)publish - Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) - - - - - - - - $(GenerateNuspecDependsOn);SetNuspecVersion - - - - - - $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) - - - diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec deleted file mode 100644 index ed08d2a7..00000000 --- a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - $id$ - $version$ - $authors$ - $authors$ - false - $description$ - $copyright$ - - - - - - - - - - diff --git a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props b/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props deleted file mode 100644 index 8d71aa66..00000000 --- a/src/WixToolset.Core.InternalPackage/WixToolset.Core.InternalPackage.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - $(MSBuildThisFileDirectory)..\tools\net461\wix.targets - - -- cgit v1.2.3-55-g6feb From 1f7fee9ec1bc6a8b06c03f44e444e7b5deb80560 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 25 Apr 2021 23:06:37 -0500 Subject: One shiny NuGet package, please and thank you. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61314359..a806dbde 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # Tools Command line tools and MSBuild integration + -- cgit v1.2.3-55-g6feb From 19f147cc9d56924b8f556bebfa9be5ab3dbeb186 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 28 Apr 2021 17:11:01 -0500 Subject: Update to latest dutil. --- src/thmviewer/packages.config | 2 +- src/thmviewer/thmviewer.vcxproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config index 4f75128a..a98c0c8e 100644 --- a/src/thmviewer/packages.config +++ b/src/thmviewer/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj index bdd17b64..c02dc237 100644 --- a/src/thmviewer/thmviewer.vcxproj +++ b/src/thmviewer/thmviewer.vcxproj @@ -5,7 +5,7 @@ - + @@ -83,6 +83,6 @@ - + \ No newline at end of file -- cgit v1.2.3-55-g6feb From 35606d2cd04a7b1bec1d669f9619501dff2bf9dc Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 22 Apr 2021 17:38:36 -0700 Subject: Simplify heat by creating a single executable --- src/heat/AssemblyHarvester.cs | 41 + src/heat/Data/HarvesterErrors.cs | 205 + src/heat/Data/HarvesterVerboses.cs | 62 + src/heat/Data/HarvesterWarnings.cs | 79 + src/heat/Data/HeatCommandLineOption.cs | 31 + src/heat/Data/IHeatCommandLine.cs | 12 + src/heat/DirectoryHarvester.cs | 308 + src/heat/DllHarvester.cs | 106 + src/heat/Extensibility/BaseHarvesterExtension.cs | 26 + src/heat/Extensibility/BaseHeatExtension.cs | 55 + src/heat/Extensibility/BaseMutatorExtension.cs | 202 + src/heat/Extensibility/IHarvester.cs | 31 + src/heat/Extensibility/IHarvesterCore.cs | 51 + src/heat/Extensibility/IHarvesterExtension.cs | 14 + src/heat/Extensibility/IHeatCore.cs | 29 + src/heat/Extensibility/IHeatExtension.cs | 16 + src/heat/Extensibility/IMutator.cs | 44 + src/heat/Extensibility/IMutatorExtension.cs | 18 + src/heat/FileHarvester.cs | 156 + src/heat/Harvester.cs | 65 + src/heat/HarvesterCore.cs | 76 + src/heat/HeatCommand.cs | 275 + src/heat/HeatCommandLine.cs | 91 + src/heat/HeatCommandLineFactory.cs | 27 + src/heat/HeatCore.cs | 45 + src/heat/HelpCommand.cs | 97 + src/heat/IIsFinalizeHarvesterMutator.cs | 160 + src/heat/IIsHarvesterMutator.cs | 429 + src/heat/IIsHeatExtension.cs | 80 + src/heat/IIsWebSiteHarvester.cs | 439 + src/heat/Mutator.cs | 93 + src/heat/PayloadHarvester.cs | 129 + src/heat/PerformanceCategoryHarvester.cs | 207 + src/heat/RegFileHarvester.cs | 438 + src/heat/RegistryHarvester.cs | 477 + src/heat/Serialize/CodeDomInterfaces.cs | 96 + src/heat/Serialize/CodeDomReader.cs | 162 + src/heat/Serialize/ElementCollection.cs | 618 + src/heat/Serialize/WixHarvesterStrings.Designer.cs | 153 + src/heat/Serialize/WixHarvesterStrings.resx | 150 + src/heat/Serialize/iis.cs | 5915 ++ src/heat/Serialize/util.cs | 11462 ++++ src/heat/Serialize/vs.cs | 1574 + src/heat/Serialize/wix.cs | 57740 +++++++++++++++++++ src/heat/TypeLibraryHarvester.cs | 93 + src/heat/UtilFinalizeHarvesterMutator.cs | 1185 + src/heat/UtilHarvesterMutator.cs | 218 + src/heat/UtilHeatExtension.cs | 405 + src/heat/UtilMutator.cs | 633 + src/heat/UtilTransformMutator.cs | 77 + src/heat/VSHeatExtension.cs | 229 + src/heat/VSProjectHarvester.cs | 1455 + src/heat/heat.csproj | 20 +- src/test/WixToolsetTest.Heat/HeatRunner.cs | 92 + src/test/WixToolsetTest.Heat/PayloadTests.cs | 66 + .../TestData/.Data/Windows8.1-KB2937592-x86.msu | Bin 0 -> 309544 bytes .../WixToolsetTest.Heat/TestData/.Data/burn.exe | Bin 0 -> 463360 bytes .../Payload/HarvestedExePackagePayload.wxs | 6 + .../Payload/HarvestedMsuPackagePayload.wxs | 6 + .../WixToolsetTest.Heat/WixToolsetTest.Heat.csproj | 28 + 60 files changed, 86996 insertions(+), 1 deletion(-) create mode 100644 src/heat/AssemblyHarvester.cs create mode 100644 src/heat/Data/HarvesterErrors.cs create mode 100644 src/heat/Data/HarvesterVerboses.cs create mode 100644 src/heat/Data/HarvesterWarnings.cs create mode 100644 src/heat/Data/HeatCommandLineOption.cs create mode 100644 src/heat/Data/IHeatCommandLine.cs create mode 100644 src/heat/DirectoryHarvester.cs create mode 100644 src/heat/DllHarvester.cs create mode 100644 src/heat/Extensibility/BaseHarvesterExtension.cs create mode 100644 src/heat/Extensibility/BaseHeatExtension.cs create mode 100644 src/heat/Extensibility/BaseMutatorExtension.cs create mode 100644 src/heat/Extensibility/IHarvester.cs create mode 100644 src/heat/Extensibility/IHarvesterCore.cs create mode 100644 src/heat/Extensibility/IHarvesterExtension.cs create mode 100644 src/heat/Extensibility/IHeatCore.cs create mode 100644 src/heat/Extensibility/IHeatExtension.cs create mode 100644 src/heat/Extensibility/IMutator.cs create mode 100644 src/heat/Extensibility/IMutatorExtension.cs create mode 100644 src/heat/FileHarvester.cs create mode 100644 src/heat/Harvester.cs create mode 100644 src/heat/HarvesterCore.cs create mode 100644 src/heat/HeatCommand.cs create mode 100644 src/heat/HeatCommandLine.cs create mode 100644 src/heat/HeatCommandLineFactory.cs create mode 100644 src/heat/HeatCore.cs create mode 100644 src/heat/HelpCommand.cs create mode 100644 src/heat/IIsFinalizeHarvesterMutator.cs create mode 100644 src/heat/IIsHarvesterMutator.cs create mode 100644 src/heat/IIsHeatExtension.cs create mode 100644 src/heat/IIsWebSiteHarvester.cs create mode 100644 src/heat/Mutator.cs create mode 100644 src/heat/PayloadHarvester.cs create mode 100644 src/heat/PerformanceCategoryHarvester.cs create mode 100644 src/heat/RegFileHarvester.cs create mode 100644 src/heat/RegistryHarvester.cs create mode 100644 src/heat/Serialize/CodeDomInterfaces.cs create mode 100644 src/heat/Serialize/CodeDomReader.cs create mode 100644 src/heat/Serialize/ElementCollection.cs create mode 100644 src/heat/Serialize/WixHarvesterStrings.Designer.cs create mode 100644 src/heat/Serialize/WixHarvesterStrings.resx create mode 100644 src/heat/Serialize/iis.cs create mode 100644 src/heat/Serialize/util.cs create mode 100644 src/heat/Serialize/vs.cs create mode 100644 src/heat/Serialize/wix.cs create mode 100644 src/heat/TypeLibraryHarvester.cs create mode 100644 src/heat/UtilFinalizeHarvesterMutator.cs create mode 100644 src/heat/UtilHarvesterMutator.cs create mode 100644 src/heat/UtilHeatExtension.cs create mode 100644 src/heat/UtilMutator.cs create mode 100644 src/heat/UtilTransformMutator.cs create mode 100644 src/heat/VSHeatExtension.cs create mode 100644 src/heat/VSProjectHarvester.cs create mode 100644 src/test/WixToolsetTest.Heat/HeatRunner.cs create mode 100644 src/test/WixToolsetTest.Heat/PayloadTests.cs create mode 100644 src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu create mode 100644 src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe create mode 100644 src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs create mode 100644 src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs create mode 100644 src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj diff --git a/src/heat/AssemblyHarvester.cs b/src/heat/AssemblyHarvester.cs new file mode 100644 index 00000000..be61f275 --- /dev/null +++ b/src/heat/AssemblyHarvester.cs @@ -0,0 +1,41 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Reflection; + using System.Runtime.InteropServices; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from an assembly file. + /// + internal class AssemblyHarvester + { + /// + /// Harvest the registry values written by RegisterAssembly. + /// + /// The file to harvest registry values from. + /// The harvested registry values. + public Wix.RegistryValue[] HarvestRegistryValues(string path) + { +#if NETCOREAPP + throw new PlatformNotSupportedException(); +#else + RegistrationServices regSvcs = new RegistrationServices(); + Assembly assembly = Assembly.LoadFrom(path); + + // must call this before overriding registry hives to prevent binding failures + // on exported types during RegisterAssembly + assembly.GetExportedTypes(); + + using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) + { + regSvcs.RegisterAssembly(assembly, AssemblyRegistrationFlags.SetCodeBase); + + return registryHarvester.HarvestRegistry(); + } +#endif + } + } +} diff --git a/src/heat/Data/HarvesterErrors.cs b/src/heat/Data/HarvesterErrors.cs new file mode 100644 index 00000000..a8a3055a --- /dev/null +++ b/src/heat/Data/HarvesterErrors.cs @@ -0,0 +1,205 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using System; + using System.Resources; + using WixToolset.Data; + +#pragma warning disable 1591 // TODO: add documentation + public static class HarvesterErrors + { + public static Message ArgumentRequiresValue(string argument) + { + return Message(null, Ids.ArgumentRequiresValue, "The argument '{0}' does not have a value specified and it is required.", argument); + } + + public static Message BuildErrorDuringHarvesting(string buildError) + { + return Message(null, Ids.BuildErrorDuringHarvesting, "Build error during harvesting: {0}", buildError); + } + + public static Message BuildFailed() + { + return Message(null, Ids.BuildFailed, "Build failed."); + } + + public static Message CannotBuildProject(string projectFile, string innerExceptionMessage) + { + return Message(null, Ids.CannotBuildProject, "Failed to build project {0}: {1}", projectFile, innerExceptionMessage); + } + + public static Message CannotHarvestWebSite() + { + return Message(null, Ids.CannotHarvestWebSite, "Cannot harvest website. On Windows Vista, you must install IIS 6 Management Compatibility."); + } + + public static Message CannotLoadMSBuildAssembly(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildAssembly, "Failed to load MSBuild assembly: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildEngine(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildEngine, "Failed to load MSBuild engine: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildWrapperAssembly(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildWrapperAssembly, "Failed to load MSBuild wrapper assembly: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildWrapperObject(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildWrapperObject, "Failed to load MSBuild wrapper object: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildWrapperType(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildWrapperType, "Failed to load MSBuild wrapper type: {0}", innerExceptionMessage); + } + + public static Message CannotLoadProject(string projectFile, string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadProject, "Failed to load project {0}: {1}", projectFile, innerExceptionMessage); + } + + public static Message DirectoryAttributeAccessorBadType(string attributeName) + { + return Message(null, Ids.DirectoryAttributeAccessorBadType, "DirectoryAttributeAccessor tried to access an invalid element type for attribute '{0'}.", attributeName); + } + + public static Message DirectoryNotFound(string directory) + { + return Message(null, Ids.DirectoryNotFound, "The directory '{0}' could not be found.", directory); + } + + public static Message EmptyDirectory(string directory) + { + return Message(null, Ids.EmptyDirectory, "The directory '{0}' did not contain any files or sub-directories and since empty directories are not being kept, there was nothing to harvest.", directory); + } + + public static Message ErrorTransformingHarvestedWiX(string transform, string message) + { + return Message(null, Ids.ErrorTransformingHarvestedWiX, "Error applying transform {0} to harvested WiX: {1}", transform, message); + } + + public static Message FileNotFound(string file) + { + return Message(null, Ids.FileNotFound, "The file '{0}' cannot be found.", file); + } + + public static Message InsufficientPermissionHarvestWebSite() + { + return Message(null, Ids.InsufficientPermissionHarvestWebSite, "Not enough permissions to harvest website. On Windows Vista, you must run Heat elevated."); + } + + public static Message InvalidDirectoryId(string generateType) + { + return Message(null, Ids.InvalidDirectoryId, "Invalid directory ID: {0}. Check that it doesn't start with a hyphen or slash.", generateType); + } + + public static Message InvalidDirectoryOutputType(string generateType) + { + return Message(null, Ids.InvalidOutputType, "Invalid generated type: {0}. Must be one of: components, payloadgroup.", generateType); + } + + public static Message InvalidOutputGroup(string outputGroup) + { + return Message(null, Ids.InvalidOutputGroup, "Invalid project output group: {0}.", outputGroup); + } + + public static Message InvalidProjectOutputType(string generateType) + { + return Message(null, Ids.InvalidOutputType, "Invalid generated type: {0}. Must be one of: components, container, payloadgroup, packagegroup.", generateType); + } + + public static Message InvalidProjectName(string generateType) + { + return Message(null, Ids.InvalidProjectName, "Invalid project name: {0}. Check that it doesn't start with a hyphen or slash.", generateType); + } + + public static Message MissingProjectOutputGroup(string projectFile, string outputGroup) + { + return Message(null, Ids.MissingProjectOutputGroup, "Missing project output group '{1}' in project {0}.", projectFile, outputGroup); + } + + public static Message MsbuildBinPathRequired(string version) + { + return Message(null, Ids.MsbuildBinPathRequired, "MSBuildBinPath required for ToolsVersion '{0}'", version); + } + + public static Message NoOutputGroupSpecified() + { + return Message(null, Ids.NoOutputGroupSpecified, "No project output group specified."); + } + + public static Message PerformanceCategoryNotFound(string key) + { + return Message(null, Ids.PerformanceCategoryNotFound, "Performance category '{0}' not found.", key); + } + + public static Message SpacesNotAllowedInArgumentValue(string arg, string value) + { + return Message(null, Ids.SpacesNotAllowedInArgumentValue, "The switch '{0}' does not allow the spaces from the value. Please remove the spaces in from the value: {1}", arg, value); + } + + public static Message UnableToOpenRegistryKey(string key) + { + return Message(null, Ids.UnableToOpenRegistryKey, "Unable to open registry key '{0}'.", key); + } + + public static Message UnsupportedPerformanceCounterType(string key) + { + return Message(null, Ids.UnsupportedPerformanceCounterType, "Unsupported performance counter type '{0}'.", key); + } + + public static Message WebSiteNotFound(string webSiteDescription) + { + return Message(null, Ids.WebSiteNotFound, "The web site '{0}' could not be found. Please check that the web site exists, and that it is spelled correctly (please note, you must use the correct case).", webSiteDescription); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + DirectoryNotFound = 5052, + EmptyDirectory = 5053, + ErrorTransformingHarvestedWiX = 5055, + UnableToOpenRegistryKey = 5056, + SpacesNotAllowedInArgumentValue = 5057, + ArgumentRequiresValue = 5058, + FileNotFound = 5059, + PerformanceCategoryNotFound = 5060, + UnsupportedPerformanceCounterType = 5061, + WebSiteNotFound = 5158, + InsufficientPermissionHarvestWebSite = 5159, + CannotHarvestWebSite = 5160, + InvalidOutputGroup = 5301, + NoOutputGroupSpecified = 5302, + CannotLoadMSBuildAssembly = 5303, + CannotLoadMSBuildEngine = 5304, + CannotLoadProject = 5305, + CannotBuildProject = 5306, + BuildFailed = 5307, + MissingProjectOutputGroup = 5308, + DirectoryAttributeAccessorBadType = 5309, + InvalidOutputType = 5310, + InvalidDirectoryId = 5311, + InvalidProjectName = 5312, + BuildErrorDuringHarvesting = 5313, + CannotLoadMSBuildWrapperAssembly = 5314, + CannotLoadMSBuildWrapperType = 5315, + CannotLoadMSBuildWrapperObject = 5316, + MsbuildBinPathRequired = 5317, + } + } +} diff --git a/src/heat/Data/HarvesterVerboses.cs b/src/heat/Data/HarvesterVerboses.cs new file mode 100644 index 00000000..72de2351 --- /dev/null +++ b/src/heat/Data/HarvesterVerboses.cs @@ -0,0 +1,62 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using System; + using System.Resources; + using WixToolset.Data; + +#pragma warning disable 1591 // TODO: add documentation + public static class HarvesterVerboses + { + public static Message FoundToolsVersion(string toolsVersion) + { + return Message(null, Ids.FoundToolsVersion, "Found ToolsVersion {0} inside project file.", toolsVersion); + } + + public static Message HarvestingAssembly(string fileName) + { + return Message(null, Ids.HarvestingAssembly, "Trying to harvest {0} as an assembly.", fileName); + } + + public static Message HarvestingSelfReg(string fileName) + { + return Message(null, Ids.HarvestingSelfReg, "Trying to harvest self-registration information from native DLL {0}.", fileName); + } + + public static Message HarvestingTypeLib(string fileName) + { + return Message(null, Ids.HarvestingTypeLib, "Trying to harvest type-library information from native DLL {0}.", fileName); + } + + public static Message LoadingProjectWithBinPath(string msbuildBinPath) + { + return Message(null, Ids.LoadingProjectWithBinPath, "Loading project using MSBuild bin path {0}.", msbuildBinPath); + } + + public static Message LoadingProjectWithVersion(string msbuildVersion) + { + return Message(null, Ids.LoadingProjectWithVersion, "Loading project using MSBuild version {0}.", msbuildVersion); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Verbose, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Verbose, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + HarvestingAssembly = 5100, + HarvestingSelfReg = 5101, + HarvestingTypeLib = 5102, + LoadingProjectWithVersion = 5378, + FoundToolsVersion = 5379, + LoadingProjectWithBinPath = 5380, + } + } +} diff --git a/src/heat/Data/HarvesterWarnings.cs b/src/heat/Data/HarvesterWarnings.cs new file mode 100644 index 00000000..80ee5c31 --- /dev/null +++ b/src/heat/Data/HarvesterWarnings.cs @@ -0,0 +1,79 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using System; + using System.Resources; + using WixToolset.Data; + +#pragma warning disable 1591 // TODO: add documentation + public static class HarvesterWarnings + { + public static Message AssemblyHarvestFailed(string file, string message) + { + return Message(null, Ids.AssemblyHarvestFailed, "Could not harvest data from a file that was expected to be an assembly: {0}. If this file is not an assembly you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); + } + + public static Message DuplicateDllRegistryEntry(string registryKey, string componentId) + { + return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{1}'.", registryKey, componentId); + } + + public static Message DuplicateDllRegistryEntry(string registryKey, string registryKeyValue, string componentId) + { + return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{2}'. The registry key value '{1}' will not be harvested.", registryKey, registryKeyValue, componentId); + } + + public static Message EncounteredNullDirectoryForWebSite(string directory) + { + return Message(null, Ids.EncounteredNullDirectoryForWebSite, "Could not harvest website directory: {0}. Please update the output with the appropriate directory ID before using.", directory); + } + + public static Message NoLogger(string exceptionMessage) + { + return Message(null, Ids.NoLogger, "Failed to set loggers: {0}", exceptionMessage); + } + + public static Message NoProjectConfiguration(string exceptionMessage) + { + return Message(null, Ids.NoProjectConfiguration, "Failed to set project configuration and platform: {0}", exceptionMessage); + } + + public static Message SelfRegHarvestFailed(string file, string message) + { + return Message(null, Ids.SelfRegHarvestFailed, "Could not harvest data from a file that was expected to be a SelfReg DLL: {0}. If this file does not support SelfReg you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); + } + + public static Message TypeLibLoadFailed(string file, string message) + { + return Message(null, Ids.TypeLibLoadFailed, "Could not load file that was expected to be a type library based off of file extension: {0}. If this file is not a type library you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the load failure: {1}", file, message); + } + + public static Message UnsupportedRegistryType(string registryValue, int regFileLineNumber, string unsupportedType) + { + return Message(null, Ids.UnsupportedRegistryType, "Ignoring the registry value '{0}' found on line {1}, because it is of a type unsupported by Windows Installer ({2}).", registryValue, regFileLineNumber, unsupportedType); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + SelfRegHarvestFailed = 5150, + AssemblyHarvestFailed = 5151, + TypeLibLoadFailed = 5152, + DuplicateDllRegistryEntry = 5156, + UnsupportedRegistryType = 5157, + NoProjectConfiguration = 5398, + NoLogger = 5399, + EncounteredNullDirectoryForWebSite = 5400, + } + } +} diff --git a/src/heat/Data/HeatCommandLineOption.cs b/src/heat/Data/HeatCommandLineOption.cs new file mode 100644 index 00000000..5815abf0 --- /dev/null +++ b/src/heat/Data/HeatCommandLineOption.cs @@ -0,0 +1,31 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + /// + /// A command line option. + /// + public struct HeatCommandLineOption + { + /// + /// The option name used on the command line. + /// + public string Option; + + /// + /// Description shown in Help command. + /// + public string Description; + + /// + /// Instantiates a new CommandLineOption. + /// + /// The option name. + /// The description of the option. + public HeatCommandLineOption(string option, string description) + { + this.Option = option; + this.Description = description; + } + } +} diff --git a/src/heat/Data/IHeatCommandLine.cs b/src/heat/Data/IHeatCommandLine.cs new file mode 100644 index 00000000..9198468d --- /dev/null +++ b/src/heat/Data/IHeatCommandLine.cs @@ -0,0 +1,12 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using WixToolset.Extensibility.Data; + +#pragma warning disable 1591 // TODO: add documentation + public interface IHeatCommandLine + { + ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments); + } +} diff --git a/src/heat/DirectoryHarvester.cs b/src/heat/DirectoryHarvester.cs new file mode 100644 index 00000000..090d67ab --- /dev/null +++ b/src/heat/DirectoryHarvester.cs @@ -0,0 +1,308 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a directory from the file system. + /// + internal class DirectoryHarvester : BaseHarvesterExtension + { + private FileHarvester fileHarvester; + + private const string ComponentPrefix = "cmp"; + private const string DirectoryPrefix = "dir"; + private const string FilePrefix = "fil"; + + /// + /// Instantiate a new DirectoryHarvester. + /// + public DirectoryHarvester() + { + this.fileHarvester = new FileHarvester(); + this.SetUniqueIdentifiers = true; + } + + /// + /// Gets or sets what type of elements are to be generated. + /// + /// The type of elements being generated. + public GenerateType GenerateType { get; set; } + + /// + /// Gets or sets the option to keep empty directories. + /// + /// The option to keep empty directories. + public bool KeepEmptyDirectories { get; set; } + + /// + /// Gets or sets the rooted DirectoryRef Id if the user has supplied it. + /// + /// The DirectoryRef Id to use as the root. + public string RootedDirectoryRef { get; set; } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers { get; set; } + + /// + /// Gets or sets the option to suppress including the root directory as an element. + /// + /// The option to suppress including the root directory as an element. + public bool SuppressRootDirectory { get; set; } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The harvested directory. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + Wix.IParentElement harvestParent = this.HarvestDirectory(argument, true, this.GenerateType); + Wix.ISchemaElement harvestElement; + + if (this.GenerateType == GenerateType.PayloadGroup) + { + Wix.PayloadGroup payloadGroup = (Wix.PayloadGroup)harvestParent; + payloadGroup.Id = this.RootedDirectoryRef; + harvestElement = payloadGroup; + } + else + { + Wix.Directory directory = (Wix.Directory)harvestParent; + + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = this.RootedDirectoryRef; + + if (this.SuppressRootDirectory) + { + foreach (Wix.ISchemaElement element in directory.Children) + { + directoryRef.AddChild(element); + } + } + else + { + directoryRef.AddChild(directory); + } + harvestElement = directoryRef; + } + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(harvestElement); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The option to harvest child directories and files. + /// The harvested directory. + public Wix.Directory HarvestDirectory(string path, bool harvestChildren) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + return (Wix.Directory)this.HarvestDirectory(path, harvestChildren, GenerateType.Components); + } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The option to harvest child directories and files. + /// The type to generate. + /// The harvested directory. + private Wix.IParentElement HarvestDirectory(string path, bool harvestChildren, GenerateType generateType) + { + if (File.Exists(path)) + { + throw new WixException(ErrorMessages.ExpectedDirectoryGotFile("dir", path)); + } + + if (null == this.RootedDirectoryRef) + { + this.RootedDirectoryRef = "TARGETDIR"; + } + + // use absolute paths + path = Path.GetFullPath(path); + + // Remove any trailing separator to ensure Path.GetFileName() will return the directory name. + path = path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + + Wix.IParentElement harvestParent; + if (generateType == GenerateType.PayloadGroup) + { + harvestParent = new Wix.PayloadGroup(); + } + else + { + Wix.Directory directory = new Wix.Directory(); + directory.Name = Path.GetFileName(path); + directory.FileSource = path; + + if (this.SetUniqueIdentifiers) + { + if (this.SuppressRootDirectory) + { + directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, this.RootedDirectoryRef); + } + else + { + directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, this.RootedDirectoryRef, directory.Name); + } + } + harvestParent = directory; + } + + if (harvestChildren) + { + try + { + int fileCount = this.HarvestDirectory(path, "SourceDir\\", harvestParent, generateType); + + if (generateType != GenerateType.PayloadGroup) + { + // its an error to not harvest anything with the option to keep empty directories off + if (0 == fileCount && !this.KeepEmptyDirectories) + { + throw new WixException(HarvesterErrors.EmptyDirectory(path)); + } + } + } + catch (DirectoryNotFoundException) + { + throw new WixException(HarvesterErrors.DirectoryNotFound(path)); + } + } + + return harvestParent; + } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The relative path that will be used when harvesting. + /// The directory for this path. + /// + /// The number of files harvested. + private int HarvestDirectory(string path, string relativePath, Wix.IParentElement harvestParent, GenerateType generateType) + { + int fileCount = 0; + Wix.Directory directory = generateType != GenerateType.PayloadGroup ? (Wix.Directory)harvestParent : null; + + // harvest the child directories + foreach (string childDirectoryPath in Directory.GetDirectories(path)) + { + var childDirectoryName = Path.GetFileName(childDirectoryPath); + Wix.IParentElement newParent; + Wix.Directory childDirectory = null; + + if (generateType == GenerateType.PayloadGroup) + { + newParent = harvestParent; + } + else + { + childDirectory = new Wix.Directory(); + newParent = childDirectory; + + childDirectory.Name = childDirectoryName; + childDirectory.FileSource = childDirectoryPath; + + if (this.SetUniqueIdentifiers) + { + childDirectory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, directory.Id, childDirectory.Name); + } + } + + int childFileCount = this.HarvestDirectory(childDirectoryPath, String.Concat(relativePath, childDirectoryName, "\\"), newParent, generateType); + + if (generateType != GenerateType.PayloadGroup) + { + // keep the directory if it contained any files (or empty directories are being kept) + if (0 < childFileCount || this.KeepEmptyDirectories) + { + directory.AddChild(childDirectory); + } + } + + fileCount += childFileCount; + } + + // harvest the files + string[] files = Directory.GetFiles(path); + if (0 < files.Length) + { + foreach (string filePath in Directory.GetFiles(path)) + { + string fileName = Path.GetFileName(filePath); + string source = String.Concat(relativePath, fileName); + + Wix.ISchemaElement newChild; + if (generateType == GenerateType.PayloadGroup) + { + Wix.Payload payload = new Wix.Payload(); + newChild = payload; + + payload.SourceFile = source; + } + else + { + Wix.Component component = new Wix.Component(); + newChild = component; + + Wix.File file = this.fileHarvester.HarvestFile(filePath); + file.Source = source; + + if (this.SetUniqueIdentifiers) + { + file.Id = this.Core.GenerateIdentifier(FilePrefix, directory.Id, fileName); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, directory.Id, file.Id); + } + + component.AddChild(file); + } + + harvestParent.AddChild(newChild); + } + } + else if (generateType != GenerateType.PayloadGroup && 0 == fileCount && this.KeepEmptyDirectories) + { + Wix.Component component = new Wix.Component(); + component.KeyPath = Wix.YesNoType.yes; + + if (this.SetUniqueIdentifiers) + { + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, directory.Id); + } + + Wix.CreateFolder createFolder = new Wix.CreateFolder(); + component.AddChild(createFolder); + + directory.AddChild(component); + } + + return fileCount + files.Length; + } + } +} diff --git a/src/heat/DllHarvester.cs b/src/heat/DllHarvester.cs new file mode 100644 index 00000000..723e44ee --- /dev/null +++ b/src/heat/DllHarvester.cs @@ -0,0 +1,106 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Reflection; + using System.Reflection.Emit; + using System.Runtime.InteropServices; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from a native DLL file. + /// + internal class DllHarvester + { + /// + /// Harvest the registry values written by calling DllRegisterServer on the specified file. + /// + /// The file to harvest registry values from. + /// The harvested registry values. + public Wix.RegistryValue[] HarvestRegistryValues(string file) + { + // load the DLL + NativeMethods.LoadLibrary(file); + + using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) + { + try + { + DynamicPInvoke(file, "DllRegisterServer", typeof(int), null, null); + + return registryHarvester.HarvestRegistry(); + } + catch (TargetInvocationException e) + { + e.Data["file"] = file; + throw; + } + } + } + + /// + /// Dynamically PInvokes into a DLL. + /// + /// Dynamic link library containing the entry point. + /// Entry point into dynamic link library. + /// Return type of entry point. + /// Type of parameters to entry point. + /// Value of parameters to entry point. + /// Value from invoked code. + private static object DynamicPInvoke(string dll, string entryPoint, Type returnType, Type[] parameterTypes, object[] parameterValues) + { +#if NETCOREAPP + throw new PlatformNotSupportedException(); +#else + AssemblyName assemblyName = new AssemblyName(); + assemblyName.Name = "wixTempAssembly"; + + AssemblyBuilder dynamicAssembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); + ModuleBuilder dynamicModule = dynamicAssembly.DefineDynamicModule("wixTempModule"); + + MethodBuilder dynamicMethod = dynamicModule.DefinePInvokeMethod(entryPoint, dll, MethodAttributes.Static | MethodAttributes.Public | MethodAttributes.PinvokeImpl, CallingConventions.Standard, returnType, parameterTypes, CallingConvention.Winapi, CharSet.Ansi); + dynamicModule.CreateGlobalFunctions(); + + MethodInfo methodInfo = dynamicModule.GetMethod(entryPoint); + return methodInfo.Invoke(null, parameterValues); +#endif + } + + /// + /// Native methods for loading libraries. + /// + private sealed class NativeMethods + { + private const UInt32 LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008; + + /// + /// Load a DLL library. + /// + /// The file name of the executable module. + /// If the function succeeds, the return value is a handle to the mapped executable module. + internal static IntPtr LoadLibrary(string file) + { + IntPtr dllHandle = LoadLibraryEx(file, IntPtr.Zero, NativeMethods.LOAD_WITH_ALTERED_SEARCH_PATH); + + if (IntPtr.Zero == dllHandle) + { + int lastError = Marshal.GetLastWin32Error(); + throw new Exception(String.Format("Unable to load file: {0}, error: {1}", file, lastError)); + } + + return dllHandle; + } + + /// + /// Maps the specified executable module into the address space of the calling process. + /// + /// The file name of the executable module. + /// This parameter is reserved for future use. It must be NULL. + /// Action to take when loading the module. + /// If the function succeeds, the return value is a handle to the mapped executable module. + [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)] + private static extern IntPtr LoadLibraryEx(string file, IntPtr fileHandle, UInt32 flags); + } + } +} diff --git a/src/heat/Extensibility/BaseHarvesterExtension.cs b/src/heat/Extensibility/BaseHarvesterExtension.cs new file mode 100644 index 00000000..02696d5b --- /dev/null +++ b/src/heat/Extensibility/BaseHarvesterExtension.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The base harvester extension. Any of these methods can be overridden to change + /// the behavior of the harvester. + /// + public abstract class BaseHarvesterExtension : IHarvesterExtension + { + /// + /// Gets or sets the harvester core for the extension. + /// + /// The harvester core for the extension. + public IHarvesterCore Core { get; set; } + + /// + /// Harvest a WiX document. + /// + /// The argument for harvesting. + /// The harvested Fragments. + public abstract Wix.Fragment[] Harvest(string argument); + } +} diff --git a/src/heat/Extensibility/BaseHeatExtension.cs b/src/heat/Extensibility/BaseHeatExtension.cs new file mode 100644 index 00000000..b76aaf62 --- /dev/null +++ b/src/heat/Extensibility/BaseHeatExtension.cs @@ -0,0 +1,55 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using System; + using WixToolset.Harvesters.Data; + + /// + /// An extension for the WiX Toolset Harvester application. + /// + public abstract class BaseHeatExtension : IHeatExtension + { + /// + /// Gets or sets the heat core for the extension. + /// + /// The heat core for the extension. + public IHeatCore Core { get; set; } + + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public virtual HeatCommandLineOption[] CommandLineTypes + { + get { return null; } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public virtual void ParseOptions(string type, string[] args) + { + } + + /// + /// Determines if the index refers to an argument. + /// + /// + /// + /// + public static bool IsValidArg(string[] args, int index) + { + if (args.Length <= index || String.IsNullOrEmpty(args[index]) || '/' == args[index][0] || '-' == args[index][0]) + { + return false; + } + else + { + return true; + } + } + } +} diff --git a/src/heat/Extensibility/BaseMutatorExtension.cs b/src/heat/Extensibility/BaseMutatorExtension.cs new file mode 100644 index 00000000..c36a8ed1 --- /dev/null +++ b/src/heat/Extensibility/BaseMutatorExtension.cs @@ -0,0 +1,202 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using System; + using System.Collections.Generic; + using System.Text; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The base mutator extension. Any of these methods can be overridden to change + /// the behavior of the mutator. + /// + public abstract class BaseMutatorExtension : IMutatorExtension + { + /// + /// Gets or sets the mutator core for the extension. + /// + /// The mutator core for the extension. + public IHarvesterCore Core { get; set; } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public abstract int Sequence { get; } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public virtual void Mutate(Wix.Wix wix) + { + } + + /// + /// Mutate a WiX document as a string. + /// + /// The Wix document element as a string. + /// The mutated Wix document as a string. + public virtual string Mutate(string wixString) + { + return wixString; + } + + /// + /// Generate unique MSI identifiers. + /// + protected class IdentifierGenerator + { + /// + /// + /// + public const int MaxProductIdentifierLength = 72; + + /// + /// + /// + public const int MaxModuleIdentifierLength = 35; + + private string baseName; + private int maxLength; + private Dictionary existingIdentifiers; + private Dictionary possibleIdentifiers; + private IHarvesterCore harvesterCore; + + /// + /// Instantiate a new IdentifierGenerator. + /// + /// The base resource name to use if a resource name contains no usable characters. + /// + public IdentifierGenerator(string baseName, IHarvesterCore harvesterCore) + { + this.baseName = baseName; + this.maxLength = IdentifierGenerator.MaxProductIdentifierLength; + this.existingIdentifiers = new Dictionary(StringComparer.OrdinalIgnoreCase); + this.possibleIdentifiers = new Dictionary(StringComparer.OrdinalIgnoreCase); + this.harvesterCore = harvesterCore; + } + + /// + /// Gets or sets the maximum length for generated identifiers. + /// + /// Maximum length for generated identifiers. (Default is 72.) + public int MaxIdentifierLength + { + get { return this.maxLength; } + set { this.maxLength = value; } + } + + /// + /// Index an existing identifier for collision detection. + /// + /// The identifier. + public void IndexExistingIdentifier(string identifier) + { + if (null == identifier) + { + throw new ArgumentNullException("identifier"); + } + + this.existingIdentifiers[identifier] = null; + } + + /// + /// Index a resource name for collision detection. + /// + /// The resource name. + public void IndexName(string name) + { + if (null == name) + { + throw new ArgumentNullException("name"); + } + + string identifier = this.CreateIdentifier(name, 0); + + if (this.possibleIdentifiers.ContainsKey(identifier)) + { + this.possibleIdentifiers[identifier] = String.Empty; + } + else + { + this.possibleIdentifiers.Add(identifier, null); + } + } + + /// + /// Get the identifier for the given resource name. + /// + /// The resource name. + /// A legal MSI identifier. + public string GetIdentifier(string name) + { + if (null == name) + { + throw new ArgumentNullException("name"); + } + + for (int i = 0; i <= Int32.MaxValue; i++) + { + string identifier = this.CreateIdentifier(name, i); + + if (this.existingIdentifiers.ContainsKey(identifier) || // already used + (0 == i && 0 != this.possibleIdentifiers.Count && null != this.possibleIdentifiers[identifier]) || // needs an index because its duplicated + (0 != i && this.possibleIdentifiers.ContainsKey(identifier))) // collides with another possible identifier + { + continue; + } + else // use this identifier + { + this.existingIdentifiers.Add(identifier, null); + + return identifier; + } + } + + throw new InvalidOperationException("Could not find a unique identifier for the given resource name."); + } + + /// + /// Create a legal MSI identifier from a resource name and an index. + /// + /// The name of the resource for which an identifier should be created. + /// An index to append to the end of the identifier to make it unique. + /// A legal MSI identifier. + public string CreateIdentifier(string name, int index) + { + if (null == name) + { + throw new ArgumentNullException("name"); + } + + StringBuilder identifier = new StringBuilder(); + + // Convert the name to a standard MSI identifier + identifier.Append(this.harvesterCore.CreateIdentifierFromFilename(name)); + + // no legal identifier characters were found, use the base id instead + if (0 == identifier.Length) + { + identifier.Append(this.baseName); + } + + // truncate the identifier if it's too long (reserve 3 characters for up to 99 collisions) + int adjustedMaxLength = this.MaxIdentifierLength - (index != 0 ? 3 : 0); + if (adjustedMaxLength < identifier.Length) + { + identifier.Length = adjustedMaxLength; + } + + // if the index is not zero, then append it to the identifier name + if (0 != index) + { + identifier.AppendFormat("_{0}", index); + } + + return identifier.ToString(); + } + } + } +} diff --git a/src/heat/Extensibility/IHarvester.cs b/src/heat/Extensibility/IHarvester.cs new file mode 100644 index 00000000..6d363b50 --- /dev/null +++ b/src/heat/Extensibility/IHarvester.cs @@ -0,0 +1,31 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Interface for the harvester. + /// + public interface IHarvester + { + /// + /// Gets or sets the harvester core for the extension. + /// + /// The harvester core for the extension. + IHarvesterCore Core { get; } + + /// + /// Gets or sets the extension. + /// + /// The extension. + IHarvesterExtension Extension { get; set; } + + /// + /// Harvest wix authoring. + /// + /// The argument for harvesting. + /// The harvested wix authoring. + Wix.Wix Harvest(string argument); + } +} diff --git a/src/heat/Extensibility/IHarvesterCore.cs b/src/heat/Extensibility/IHarvesterCore.cs new file mode 100644 index 00000000..3c34b8a1 --- /dev/null +++ b/src/heat/Extensibility/IHarvesterCore.cs @@ -0,0 +1,51 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using WixToolset.Extensibility.Services; + + /// + /// The WiX Toolset harvester core. + /// + public interface IHarvesterCore + { + /// + /// + /// + IMessaging Messaging { get; set; } + + /// + /// Gets or sets the value of the extension argument passed to heat. + /// + /// The extension argument. + string ExtensionArgument { get; set; } + + /// + /// Gets or sets the value of the root directory that is being harvested. + /// + /// The root directory being harvested. + string RootDirectory { get; set; } + + /// + /// Create an identifier based on passed file name + /// + /// File name to generate identifer from + /// + string CreateIdentifierFromFilename(string filename); + + /// + /// Generate an identifier by hashing data from the row. + /// + /// Three letter or less prefix for generated row identifier. + /// Information to hash. + /// The generated identifier. + string GenerateIdentifier(string prefix, params string[] args); + + /// + /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". + /// + /// The Wix.File.Source value with "SourceDir\". + /// The full path of the file. + string ResolveFilePath(string fileSource); + } +} diff --git a/src/heat/Extensibility/IHarvesterExtension.cs b/src/heat/Extensibility/IHarvesterExtension.cs new file mode 100644 index 00000000..5125ea32 --- /dev/null +++ b/src/heat/Extensibility/IHarvesterExtension.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + +#pragma warning disable 1591 // TODO: add documentation + public interface IHarvesterExtension + { + IHarvesterCore Core { get; set; } + + Wix.Fragment[] Harvest(string argument); + } +} diff --git a/src/heat/Extensibility/IHeatCore.cs b/src/heat/Extensibility/IHeatCore.cs new file mode 100644 index 00000000..0aa01b62 --- /dev/null +++ b/src/heat/Extensibility/IHeatCore.cs @@ -0,0 +1,29 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using WixToolset.Extensibility.Services; + + /// + /// The WiX Toolset Harvester application core. + /// + public interface IHeatCore + { + /// + /// Gets the harvester. + /// + /// The harvester. + IHarvester Harvester { get; } + + /// + /// + /// + IMessaging Messaging { get; } + + /// + /// Gets the mutator. + /// + /// The mutator. + IMutator Mutator { get; } + } +} diff --git a/src/heat/Extensibility/IHeatExtension.cs b/src/heat/Extensibility/IHeatExtension.cs new file mode 100644 index 00000000..8a00da37 --- /dev/null +++ b/src/heat/Extensibility/IHeatExtension.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using WixToolset.Harvesters.Data; + +#pragma warning disable 1591 // TODO: add documentation + public interface IHeatExtension + { + IHeatCore Core { get; set; } + + HeatCommandLineOption[] CommandLineTypes { get; } + + void ParseOptions(string type, string[] args); + } +} diff --git a/src/heat/Extensibility/IMutator.cs b/src/heat/Extensibility/IMutator.cs new file mode 100644 index 00000000..c936339e --- /dev/null +++ b/src/heat/Extensibility/IMutator.cs @@ -0,0 +1,44 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Interface for a mutator. + /// + public interface IMutator + { + /// + /// Gets or sets the harvester core for the extension. + /// + /// The harvester core for the extension. + IHarvesterCore Core { get; } + + /// + /// Gets or sets the value of the extension argument passed to heat. + /// + /// The extension argument. + string ExtensionArgument { get; } + + /// + /// Adds a mutator extension. + /// + /// The mutator extension to add. + void AddExtension(IMutatorExtension mutatorExtension); + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + /// true if mutation was successful + bool Mutate(Wix.Wix wix); + + /// + /// Mutate a WiX document. + /// + /// The Wix document as a string. + /// The mutated Wix document as a string if mutation was successful, else null. + string Mutate(string wixString); + } +} diff --git a/src/heat/Extensibility/IMutatorExtension.cs b/src/heat/Extensibility/IMutatorExtension.cs new file mode 100644 index 00000000..b81f586e --- /dev/null +++ b/src/heat/Extensibility/IMutatorExtension.cs @@ -0,0 +1,18 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + +#pragma warning disable 1591 // TODO: add documentation + public interface IMutatorExtension + { + IHarvesterCore Core { get; set; } + + int Sequence { get; } + + void Mutate(Wix.Wix wix); + + string Mutate(string wixString); + } +} diff --git a/src/heat/FileHarvester.cs b/src/heat/FileHarvester.cs new file mode 100644 index 00000000..8bb1a155 --- /dev/null +++ b/src/heat/FileHarvester.cs @@ -0,0 +1,156 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a file from the file system. + /// + internal class FileHarvester : BaseHarvesterExtension + { + private string rootedDirectoryRef; + private bool setUniqueIdentifiers; + private bool suppressRootDirectory; + + private static readonly string ComponentPrefix = "cmp"; + private static readonly string DirectoryPrefix = "dir"; + private static readonly string FilePrefix = "fil"; + + /// + /// Instantiate a new FileHarvester. + /// + public FileHarvester() + { + this.setUniqueIdentifiers = true; + this.suppressRootDirectory = false; + } + + /// + /// Gets or sets the rooted DirectoryRef Id if the user has supplied it. + /// + /// The DirectoryRef Id to use as the root. + public string RootedDirectoryRef + { + get { return this.rootedDirectoryRef; } + set { this.rootedDirectoryRef = value; } + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Gets or sets the option to suppress including the root directory as an element. + /// + /// The option to suppress including the root directory as an element. + public bool SuppressRootDirectory + { + get { return this.suppressRootDirectory; } + set { this.suppressRootDirectory = value; } + } + + /// + /// Harvest a file. + /// + /// The path of the file. + /// A harvested file. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + if (null == this.rootedDirectoryRef) + { + this.rootedDirectoryRef = "TARGETDIR"; + } + + string fullPath = Path.GetFullPath(argument); + + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = this.rootedDirectoryRef; + + Wix.File file = this.HarvestFile(fullPath); + + if (!this.suppressRootDirectory) + { + file.Source = String.Concat("SourceDir\\", Path.GetFileName(Path.GetDirectoryName(fullPath)), "\\", Path.GetFileName(fullPath)); + } + + Wix.Component component = new Wix.Component(); + component.AddChild(file); + + Wix.Directory directory = new Wix.Directory(); + + if (this.suppressRootDirectory) + { + directoryRef.AddChild(component); + } + else + { + string directoryPath = Path.GetDirectoryName(Path.GetFullPath(argument)); + directory.Name = Path.GetFileName(directoryPath); + + if (this.setUniqueIdentifiers) + { + directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, directoryRef.Id, directory.Name); + } + directory.AddChild(component); + directoryRef.AddChild(directory); + } + + if (this.setUniqueIdentifiers) + { + file.Id = this.Core.GenerateIdentifier(FilePrefix, (this.suppressRootDirectory) ? directoryRef.Id : directory.Id, Path.GetFileName(file.Source)); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, (this.suppressRootDirectory) ? directoryRef.Id : directory.Id, file.Id); + } + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directoryRef); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a file. + /// + /// The path of the file. + /// A harvested file. + public Wix.File HarvestFile(string path) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + if (!File.Exists(path)) + { + throw new WixException(HarvesterErrors.FileNotFound(path)); + } + + Wix.File file = new Wix.File(); + + // use absolute paths + path = Path.GetFullPath(path); + + file.KeyPath = Wix.YesNoType.yes; + + file.Source = String.Concat("SourceDir\\", Path.GetFileName(path)); + + return file; + } + } +} diff --git a/src/heat/Harvester.cs b/src/heat/Harvester.cs new file mode 100644 index 00000000..791c1cb2 --- /dev/null +++ b/src/heat/Harvester.cs @@ -0,0 +1,65 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using WixToolset.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The WiX Toolset harvester. + /// + internal class Harvester : IHarvester + { + private IHarvesterExtension harvesterExtension; + + public IHarvesterCore Core { get; set; } + + public IHarvesterExtension Extension + { + get + { + return this.harvesterExtension; + } + set + { + if (null != this.harvesterExtension) + { + throw new InvalidOperationException("Multiple harvester extensions specified."); + } + + this.harvesterExtension = value; + } + } + + public Wix.Wix Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + if (null == this.harvesterExtension) + { + throw new WixException(ErrorMessages.HarvestTypeNotFound()); + } + + this.harvesterExtension.Core = this.Core; + + Wix.Fragment[] fragments = this.harvesterExtension.Harvest(argument); + if (null == fragments || 0 == fragments.Length) + { + return null; + } + + Wix.Wix wix = new Wix.Wix(); + foreach (Wix.Fragment fragment in fragments) + { + wix.AddChild(fragment); + } + + return wix; + } + } +} diff --git a/src/heat/HarvesterCore.cs b/src/heat/HarvesterCore.cs new file mode 100644 index 00000000..92b34ab0 --- /dev/null +++ b/src/heat/HarvesterCore.cs @@ -0,0 +1,76 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Extensibility; + + /// + /// The WiX Toolset harvester core. + /// + internal class HarvesterCore : IHarvesterCore + { + public IMessaging Messaging { get; set; } + + public IParseHelper ParseHelper { get; set; } + + /// + /// Gets or sets the value of the extension argument passed to heat. + /// + /// The extension argument. + public string ExtensionArgument { get; set; } + + /// + /// Gets or sets the value of the root directory that is being harvested. + /// + /// The root directory being harvested. + public string RootDirectory { get; set; } + + /// + /// Create an identifier based on passed file name + /// + /// File name to generate identifer from + /// + public string CreateIdentifierFromFilename(string filename) + { + return this.ParseHelper.CreateIdentifierFromFilename(filename).Id; + } + + /// + /// Generate an identifier by hashing data from the row. + /// + /// Three letter or less prefix for generated row identifier. + /// Information to hash. + /// The generated identifier. + public string GenerateIdentifier(string prefix, params string[] args) + { + return this.ParseHelper.CreateIdentifier(prefix, args).Id; + } + + /// + /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". + /// + /// The Wix.File.Source value with "SourceDir\". + /// The full path of the file. + public string ResolveFilePath(string fileSource) + { + if (fileSource.StartsWith("SourceDir\\", StringComparison.Ordinal)) + { + string file = Path.GetFullPath(this.RootDirectory); + if (File.Exists(file)) + { + return file; + } + else + { + fileSource = fileSource.Substring(10); + fileSource = Path.Combine(Path.GetFullPath(this.RootDirectory), fileSource); + } + } + + return fileSource; + } + } +} diff --git a/src/heat/HeatCommand.cs b/src/heat/HeatCommand.cs new file mode 100644 index 00000000..99f27521 --- /dev/null +++ b/src/heat/HeatCommand.cs @@ -0,0 +1,275 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; + using System.Xml; + using WixToolset.Data; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + internal class HeatCommand : ICommandLineCommand + { + public HeatCommand(string harvestType, IList extensions, IServiceProvider serviceProvider) + { + this.Extensions = extensions; + this.Messaging = serviceProvider.GetService(); + this.ServiceProvider = serviceProvider; + + this.ExtensionType = harvestType; + this.ExtensionOptions.Add(harvestType); + } + + private string ExtensionArgument { get; set; } + + private List ExtensionOptions { get; } = new List(); + + private string ExtensionType { get; } + + private IList Extensions { get; } + + private int Indent { get; set; } = 4; + + private IMessaging Messaging { get; } + + private string OutputFile { get; set; } + + private IServiceProvider ServiceProvider { get; } + + public bool ShowLogo { get; private set; } + + public bool StopParsing { get; private set; } + + public Task ExecuteAsync(CancellationToken cancellationToken) + { + var exitCode = this.Harvest(); + return Task.FromResult(exitCode); + } + + public bool TryParseArgument(ICommandLineParser parser, string arg) + { + if (this.ExtensionArgument == null) + { + this.ExtensionArgument = arg; + } + else if ('-' == arg[0] || '/' == arg[0]) + { + string parameter = arg.Substring(1); + if ("nologo" == parameter) + { + this.ShowLogo = false; + } + else if ("o" == parameter || "out" == parameter) + { + this.OutputFile = parser.GetNextArgumentAsFilePathOrError(arg); + + if (String.IsNullOrEmpty(this.OutputFile)) + { + return false; + } + } + else if ("swall" == parameter) + { + this.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("swall", "sw")); + this.Messaging.SuppressAllWarnings = true; + } + else if (parameter.StartsWith("sw")) + { + string paramArg = parameter.Substring(2); + try + { + if (0 == paramArg.Length) + { + this.Messaging.SuppressAllWarnings = true; + } + else + { + int suppressWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat); + if (0 >= suppressWarning) + { + this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); + } + + this.Messaging.SuppressWarningMessage(suppressWarning); + } + } + catch (FormatException) + { + this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); + } + catch (OverflowException) + { + this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); + } + } + else if ("wxall" == parameter) + { + this.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("wxall", "wx")); + this.Messaging.WarningsAsError = true; + } + else if (parameter.StartsWith("wx")) + { + string paramArg = parameter.Substring(2); + try + { + if (0 == paramArg.Length) + { + this.Messaging.WarningsAsError = true; + } + else + { + int elevateWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat); + if (0 >= elevateWarning) + { + this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); + } + + this.Messaging.ElevateWarningMessage(elevateWarning); + } + } + catch (FormatException) + { + this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); + } + catch (OverflowException) + { + this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); + } + } + else if ("v" == parameter) + { + this.Messaging.ShowVerboseMessages = true; + } + else if ("indent" == parameter) + { + try + { + this.Indent = Int32.Parse(parser.GetNextArgumentOrError(arg), CultureInfo.InvariantCulture); + } + catch + { + throw new ArgumentException("Invalid numeric argument.", parameter); + } + } + } + + this.ExtensionOptions.Add(arg); + return true; + } + + private int Harvest() + { + try + { + if (String.IsNullOrEmpty(this.ExtensionArgument)) + { + this.Messaging.Write(ErrorMessages.HarvestSourceNotSpecified()); + } + else if (String.IsNullOrEmpty(this.OutputFile)) + { + this.Messaging.Write(ErrorMessages.OutputTargetNotSpecified()); + } + + // exit if there was an error parsing the core command line + if (this.Messaging.EncounteredError) + { + return this.Messaging.LastErrorNumber; + } + + if (this.ShowLogo) + { + HelpCommand.DisplayToolHeader(); + } + + var heatCore = new HeatCore(this.ServiceProvider, this.ExtensionArgument); + + // parse the extension's command line arguments + var extensionOptionsArray = this.ExtensionOptions.ToArray(); + foreach (var heatExtension in this.Extensions) + { + heatExtension.Core = heatCore; + heatExtension.ParseOptions(this.ExtensionType, extensionOptionsArray); + } + + // exit if there was an error parsing the command line (otherwise the logo appears after error messages) + if (this.Messaging.EncounteredError) + { + return this.Messaging.LastErrorNumber; + } + + // harvest the output + Wix.Wix wix = heatCore.Harvester.Harvest(this.ExtensionArgument); + if (null == wix) + { + return this.Messaging.LastErrorNumber; + } + + // mutate the output + if (!heatCore.Mutator.Mutate(wix)) + { + return this.Messaging.LastErrorNumber; + } + + XmlWriterSettings xmlSettings = new XmlWriterSettings(); + xmlSettings.Indent = true; + xmlSettings.IndentChars = new string(' ', this.Indent); + xmlSettings.OmitXmlDeclaration = true; + + string wixString; + using (StringWriter stringWriter = new StringWriter()) + { + using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + wix.OutputXml(xmlWriter); + } + + wixString = stringWriter.ToString(); + } + + string mutatedWixString = heatCore.Mutator.Mutate(wixString); + if (String.IsNullOrEmpty(mutatedWixString)) + { + return this.Messaging.LastErrorNumber; + } + + Directory.CreateDirectory(Path.GetDirectoryName(this.OutputFile)); + + using (StreamWriter streamWriter = new StreamWriter(this.OutputFile, false, System.Text.Encoding.UTF8)) + { + xmlSettings.OmitXmlDeclaration = false; + xmlSettings.Encoding = System.Text.Encoding.UTF8; + using (XmlWriter xmlWriter = XmlWriter.Create(streamWriter, xmlSettings)) + { + xmlWriter.WriteStartDocument(); + xmlWriter.Flush(); + } + + streamWriter.WriteLine(); + streamWriter.Write(mutatedWixString); + } + } + catch (WixException we) + { + this.Messaging.Write(we.Error); + } + catch (Exception e) + { + this.Messaging.Write(ErrorMessages.UnexpectedException(e)); + if (e is NullReferenceException || e is SEHException) + { + throw; + } + } + + return this.Messaging.LastErrorNumber; + } + } +} diff --git a/src/heat/HeatCommandLine.cs b/src/heat/HeatCommandLine.cs new file mode 100644 index 00000000..b11dda4e --- /dev/null +++ b/src/heat/HeatCommandLine.cs @@ -0,0 +1,91 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using System.Linq; + using WixToolset.Data; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + internal class HeatCommandLine : IHeatCommandLine + { + private readonly List extensions; + private readonly IMessaging messaging; + private readonly IServiceProvider serviceProvider; + + public HeatCommandLine(IServiceProvider serviceProvider, IEnumerable heatExtensions) + { + this.extensions = new List { new IIsHeatExtension(), new UtilHeatExtension(serviceProvider), new VSHeatExtension() }; + if (heatExtensions != null) + { + this.extensions.AddRange(heatExtensions); + } + this.messaging = serviceProvider.GetService(); + this.serviceProvider = serviceProvider; + } + + public ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments) + { + ICommandLineCommand command = null; + var parser = arguments.Parse(); + + while (command?.StopParsing != true && + String.IsNullOrEmpty(parser.ErrorArgument) && + parser.TryGetNextSwitchOrArgument(out var arg)) + { + if (String.IsNullOrWhiteSpace(arg)) // skip blank arguments. + { + continue; + } + + // First argument must be the command or global switch (that creates a command). + if (command == null) + { + if (!this.TryParseUnknownCommandArg(arg, parser, out command)) + { + parser.ReportErrorArgument(arg, ErrorMessages.HarvestTypeNotFound(arg)); + } + } + else if (!command.TryParseArgument(parser, arg)) + { + parser.ReportErrorArgument(arg); + } + } + + return command ?? new HelpCommand(this.extensions); + } + + public bool TryParseUnknownCommandArg(string arg, ICommandLineParser parser, out ICommandLineCommand command) + { + command = null; + + if (parser.IsSwitch(arg)) + { + var parameter = arg.Substring(1); + switch (parameter.ToLowerInvariant()) + { + case "?": + case "h": + case "help": + command = new HelpCommand(this.extensions); + return true; + } + } + + foreach (var heatExtension in this.extensions) + { + if (heatExtension.CommandLineTypes.Any(o => o.Option == arg)) + { + command = new HeatCommand(arg, this.extensions, this.serviceProvider); + return true; + } + } + + return false; + } + } +} diff --git a/src/heat/HeatCommandLineFactory.cs b/src/heat/HeatCommandLineFactory.cs new file mode 100644 index 00000000..44291e48 --- /dev/null +++ b/src/heat/HeatCommandLineFactory.cs @@ -0,0 +1,27 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// Extension methods to use Harvesters services. + /// + public class HeatCommandLineFactory + { + /// + /// Creates service. + /// + /// + /// + /// + public static IHeatCommandLine CreateCommandLine(IServiceProvider serviceProvider, IEnumerable heatExtensions = null) + { + return new HeatCommandLine(serviceProvider, heatExtensions); + } + } +} diff --git a/src/heat/HeatCore.cs b/src/heat/HeatCore.cs new file mode 100644 index 00000000..578c4aab --- /dev/null +++ b/src/heat/HeatCore.cs @@ -0,0 +1,45 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Extensibility; + + /// + /// The WiX Toolset Harvester application core. + /// + internal class HeatCore : IHeatCore + { + /// + /// Instantiates a new HeatCore. + /// + /// The service provider. + /// The extension argument. + public HeatCore(IServiceProvider serviceProvider, string extensionArgument) + { + this.Messaging = serviceProvider.GetService(); + var harvesterCore = new HarvesterCore + { + ExtensionArgument = extensionArgument, + Messaging = this.Messaging, + ParseHelper = serviceProvider.GetService(), + }; + + this.Harvester = new Harvester + { + Core = harvesterCore, + }; + this.Mutator = new Mutator + { + Core = harvesterCore, + }; + } + + public IHarvester Harvester { get; } + + public IMessaging Messaging { get; } + + public IMutator Mutator { get; } + } +} diff --git a/src/heat/HelpCommand.cs b/src/heat/HelpCommand.cs new file mode 100644 index 00000000..bd2bcc24 --- /dev/null +++ b/src/heat/HelpCommand.cs @@ -0,0 +1,97 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Diagnostics; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + internal class HelpCommand : ICommandLineCommand + { + const string HelpMessageOptionFormat = " {0,-7} {1}"; + + public HelpCommand(IList extensions) + { + this.Extensions = extensions; + } + + private IList Extensions { get; } + + public bool ShowLogo => false; + + public bool StopParsing => true; + + public Task ExecuteAsync(CancellationToken cancellationToken) + { + var exitCode = this.DisplayHelp(); + return Task.FromResult(exitCode); + } + + public static void DisplayToolHeader() + { + var wixcopAssembly = typeof(HelpCommand).Assembly; + var fv = FileVersionInfo.GetVersionInfo(wixcopAssembly.Location); + + Console.WriteLine("WiX Toolset Harvester version {0}", fv.FileVersion); + Console.WriteLine("Copyright (C) .NET Foundation and contributors. All rights reserved."); + Console.WriteLine(); + } + + public bool TryParseArgument(ICommandLineParser parser, string argument) => true; + + private int DisplayHelp() + { + DisplayToolHeader(); + + // output the harvest types alphabetically + SortedList harvestOptions = new SortedList(); + foreach (var heatExtension in this.Extensions) + { + foreach (HeatCommandLineOption commandLineOption in heatExtension.CommandLineTypes) + { + harvestOptions.Add(commandLineOption.Option, commandLineOption); + } + } + + harvestOptions.Add("-nologo", new HeatCommandLineOption("-nologo", "skip printing heat logo information")); + harvestOptions.Add("-indent ", new HeatCommandLineOption("-indent ", "indentation multiple (overrides default of 4)")); + harvestOptions.Add("-o[ut]", new HeatCommandLineOption("-out", "specify output file (default: write to current directory)")); + harvestOptions.Add("-sw", new HeatCommandLineOption("-sw", "suppress all warnings or a specific message ID\r\n (example: -sw1011 -sw1012)")); + harvestOptions.Add("-swall", new HeatCommandLineOption("-swall", "suppress all warnings (deprecated)")); + harvestOptions.Add("-v", new HeatCommandLineOption("-v", "verbose output")); + harvestOptions.Add("-wx[N]", new HeatCommandLineOption("-wx[N]", "treat all warnings or a specific message ID as an error\r\n (example: -wx1011 -wx1012)")); + harvestOptions.Add("-wxall", new HeatCommandLineOption("-wxall", "treat all warnings as errors (deprecated)")); + + foreach (HeatCommandLineOption commandLineOption in harvestOptions.Values) + { + if (!commandLineOption.Option.StartsWith("-")) + { + Console.WriteLine(HelpMessageOptionFormat, commandLineOption.Option, commandLineOption.Description); + } + } + + Console.WriteLine(); + Console.WriteLine("Options:"); + + foreach (HeatCommandLineOption commandLineOption in harvestOptions.Values) + { + if (commandLineOption.Option.StartsWith("-")) + { + Console.WriteLine(HelpMessageOptionFormat, commandLineOption.Option, commandLineOption.Description); + } + } + + Console.WriteLine(HelpMessageOptionFormat, "-? | -help", "this help information"); + Console.WriteLine("For more information see: https://wixtoolset.org/"); + + return 0; + } + } +} diff --git a/src/heat/IIsFinalizeHarvesterMutator.cs b/src/heat/IIsFinalizeHarvesterMutator.cs new file mode 100644 index 00000000..17d3bef4 --- /dev/null +++ b/src/heat/IIsFinalizeHarvesterMutator.cs @@ -0,0 +1,160 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Specialized; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + using IIs = Serialize.IIs; + + /// + /// The finalize harvester mutator for the WiX Toolset Internet Information Services Extension. + /// + internal class IIsFinalizeHarvesterMutator : BaseMutatorExtension + { + private Hashtable directoryPaths; + private Hashtable filePaths; + private ArrayList webFilters; + private ArrayList webSites; + private ArrayList webVirtualDirs; + + /// + /// Instantiate a new IIsFinalizeHarvesterMutator. + /// + public IIsFinalizeHarvesterMutator() + { + this.directoryPaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); + this.filePaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); + this.webFilters = new ArrayList(); + this.webSites = new ArrayList(); + this.webVirtualDirs = new ArrayList(); + } + + /// + /// Gets the sequence of this mutator extension. + /// + /// The sequence of this mutator extension. + public override int Sequence + { + get { return 1900; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.directoryPaths.Clear(); + this.filePaths.Clear(); + this.webFilters.Clear(); + this.webSites.Clear(); + this.webVirtualDirs.Clear(); + + this.IndexElement(wix); + + this.MutateWebFilters(); + this.MutateWebSites(); + this.MutateWebVirtualDirs(); + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is IIs.WebFilter) + { + this.webFilters.Add(element); + } + else if (element is IIs.WebSite) + { + this.webSites.Add(element); + } + else if (element is IIs.WebVirtualDir) + { + this.webVirtualDirs.Add(element); + } + else if (element is Wix.Directory) + { + Wix.Directory directory = (Wix.Directory)element; + + if (null != directory.Id && null != directory.FileSource) + { + this.directoryPaths.Add(directory.FileSource, directory.Id); + } + } + else if (element is Wix.File) + { + Wix.File file = (Wix.File)element; + + if (null != file.Id && null != file.Source) + { + this.filePaths[file.Source] = String.Concat("[#", file.Id, "]"); + } + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the WebFilters. + /// + private void MutateWebFilters() + { + foreach (IIs.WebFilter webFilter in this.webFilters) + { + webFilter.Path = (string)this.filePaths[webFilter.Path]; + } + } + + /// + /// Mutate the WebSites. + /// + private void MutateWebSites() + { + foreach (IIs.WebSite webSite in this.webSites) + { + string path = (string)this.directoryPaths[webSite.Directory]; + if (null == path) + { + this.Core.Messaging.Write(HarvesterWarnings.EncounteredNullDirectoryForWebSite(path)); + } + else + { + webSite.Directory = path; + } + } + } + + /// + /// Mutate the WebVirtualDirs. + /// + private void MutateWebVirtualDirs() + { + foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) + { + string path = (string)this.directoryPaths[webVirtualDir.Directory]; + if (null == path) + { + this.Core.Messaging.Write(HarvesterWarnings.EncounteredNullDirectoryForWebSite(path)); + } + else + { + webVirtualDir.Directory = path; + } + } + } + } +} diff --git a/src/heat/IIsHarvesterMutator.cs b/src/heat/IIsHarvesterMutator.cs new file mode 100644 index 00000000..76d94b6a --- /dev/null +++ b/src/heat/IIsHarvesterMutator.cs @@ -0,0 +1,429 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Specialized; + using System.IO; + using WixToolset.Harvesters.Extensibility; + using IIs = Serialize.IIs; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The harvester mutator for the WiX Toolset Internet Information Services Extension. + /// + internal class IIsHarvesterMutator : BaseMutatorExtension + { + private ArrayList components; + private DirectoryHarvester directoryHarvester; + private Hashtable directoryPaths; + private FileHarvester fileHarvester; + private Wix.IParentElement rootElement; + private bool setUniqueIdentifiers; + private ArrayList webAddresses; + private ArrayList webDirs; + private ArrayList webDirProperties; + private ArrayList webFilters; + private ArrayList webSites; + private ArrayList webVirtualDirs; + + /// + /// Instantiate a new IIsHarvesterMutator. + /// + public IIsHarvesterMutator() + { + this.components = new ArrayList(); + this.directoryHarvester = new DirectoryHarvester(); + this.directoryPaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); + this.fileHarvester = new FileHarvester(); + this.webAddresses = new ArrayList(); + this.webDirs = new ArrayList(); + this.webDirProperties = new ArrayList(); + this.webFilters = new ArrayList(); + this.webSites = new ArrayList(); + this.webVirtualDirs = new ArrayList(); + } + + /// + /// Gets the sequence of this mutator extension. + /// + /// The sequence of this mutator extension. + public override int Sequence + { + get { return 100; } + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.components.Clear(); + this.directoryPaths.Clear(); + this.webAddresses.Clear(); + this.webDirs.Clear(); + this.webDirProperties.Clear(); + this.webFilters.Clear(); + this.webSites.Clear(); + this.webVirtualDirs.Clear(); + this.rootElement = null; + + this.IndexElement(wix); + + this.MutateWebAddresses(); + + this.MutateWebDirs(); + + this.MutateWebDirProperties(); + + this.MutateWebSites(); + + this.MutateWebVirtualDirs(); + + // this must come after the web virtual dirs in case they harvest a directory containing a web filter file + this.MutateWebFilters(); + + // this must come after the web site identifiers are created + this.MutateComponents(); + } + + /// + /// Harvest a new directory or return one that was previously harvested. + /// + /// The path of the directory. + /// The option to harvest the children of the directory. + /// The harvested directory. + private Wix.Directory HarvestUniqueDirectory(string path, bool harvestChildren) + { + if (this.directoryPaths.Contains(path)) + { + return (Wix.Directory)this.directoryPaths[path]; + } + else + { + Wix.Directory directory = this.directoryHarvester.HarvestDirectory(path, harvestChildren); + + this.rootElement.AddChild(directory); + + // index this new directory and all of its children + this.IndexElement(directory); + + return directory; + } + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is IIs.WebAddress) + { + this.webAddresses.Add(element); + } + else if (element is IIs.WebDir) + { + this.webDirs.Add(element); + } + else if (element is IIs.WebDirProperties) + { + this.webDirProperties.Add(element); + } + else if (element is IIs.WebFilter) + { + this.webFilters.Add(element); + } + else if (element is IIs.WebSite) + { + this.webSites.Add(element); + } + else if (element is IIs.WebVirtualDir) + { + this.webVirtualDirs.Add(element); + } + else if (element is Wix.Component) + { + this.components.Add(element); + } + else if (element is Wix.Directory) + { + Wix.Directory directory = (Wix.Directory)element; + + if (null != directory.FileSource) + { + this.directoryPaths.Add(directory.FileSource, directory); + } + } + else if (element is Wix.Fragment || element is Wix.Module || element is Wix.PatchCreation || element is Wix.Package) + { + this.rootElement = (Wix.IParentElement)element; + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the Component elements. + /// + private void MutateComponents() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("Component", this.Core); + + // index all the existing identifiers + foreach (Wix.Component component in this.components) + { + if (null != component.Id) + { + identifierGenerator.IndexExistingIdentifier(component.Id); + } + } + + // index all the web site identifiers + foreach (IIs.WebSite webSite in this.webSites) + { + if (webSite.ParentElement is Wix.Component) + { + identifierGenerator.IndexName(webSite.Id); + } + } + + // create an identifier for each component based on its child web site identifier + foreach (IIs.WebSite webSite in this.webSites) + { + Wix.Component component = webSite.ParentElement as Wix.Component; + + if (null != component) + { + component.Id = identifierGenerator.GetIdentifier(webSite.Id); + } + } + } + } + + /// + /// Mutate the WebAddress elements. + /// + private void MutateWebAddresses() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebAddress", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebAddress webAddress in this.webAddresses) + { + if (null != webAddress.Id) + { + identifierGenerator.IndexExistingIdentifier(webAddress.Id); + } + else + { + identifierGenerator.IndexName(String.Concat(webAddress.IP, "_", webAddress.Port)); + } + } + + foreach (IIs.WebAddress webAddress in this.webAddresses) + { + if (null == webAddress.Id) + { + webAddress.Id = identifierGenerator.GetIdentifier(String.Concat(webAddress.IP, "_", webAddress.Port)); + } + } + } + } + + /// + /// Mutate the WebDir elements. + /// + private void MutateWebDirs() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebDir", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebDir webDir in this.webDirs) + { + if (null != webDir.Id) + { + identifierGenerator.IndexExistingIdentifier(webDir.Id); + } + else + { + identifierGenerator.IndexName(webDir.Path); + } + } + + foreach (IIs.WebDir webDir in this.webDirs) + { + if (null == webDir.Id) + { + webDir.Id = identifierGenerator.GetIdentifier(webDir.Path); + } + } + } + } + + /// + /// Mutate the WebDirProperties elements. + /// + private void MutateWebDirProperties() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebDirProperties", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebDirProperties webDirProperties in this.webDirProperties) + { + if (null != webDirProperties.Id) + { + identifierGenerator.IndexExistingIdentifier(webDirProperties.Id); + } + } + + foreach (IIs.WebDirProperties webDirProperties in this.webDirProperties) + { + if (null == webDirProperties.Id) + { + webDirProperties.Id = identifierGenerator.GetIdentifier(String.Empty); + } + } + } + } + + /// + /// Mutate the WebFilter elements. + /// + private void MutateWebFilters() + { + IdentifierGenerator identifierGenerator = null; + + if (this.setUniqueIdentifiers) + { + identifierGenerator = new IdentifierGenerator("WebFilter", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebFilter webFilter in this.webFilters) + { + if (null != webFilter.Id) + { + identifierGenerator.IndexExistingIdentifier(webFilter.Id); + } + else + { + identifierGenerator.IndexName(webFilter.Name); + } + } + } + + foreach (IIs.WebFilter webFilter in this.webFilters) + { + if (this.setUniqueIdentifiers && null == webFilter.Id) + { + webFilter.Id = identifierGenerator.GetIdentifier(webFilter.Name); + } + + // harvest the file for this WebFilter + Wix.Directory directory = this.HarvestUniqueDirectory(Path.GetDirectoryName(webFilter.Path), false); + + Wix.Component component = new Wix.Component(); + directory.AddChild(component); + + Wix.File file = this.fileHarvester.HarvestFile(webFilter.Path); + component.AddChild(file); + } + } + + /// + /// Mutate the WebSite elements. + /// + private void MutateWebSites() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebSite", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebSite webSite in this.webSites) + { + if (null != webSite.Id) + { + identifierGenerator.IndexExistingIdentifier(webSite.Id); + } + else + { + identifierGenerator.IndexName(webSite.Description); + } + } + + foreach (IIs.WebSite webSite in this.webSites) + { + if (null == webSite.Id) + { + webSite.Id = identifierGenerator.GetIdentifier(webSite.Description); + } + } + } + } + + /// + /// Mutate the WebVirtualDir elements. + /// + private void MutateWebVirtualDirs() + { + IdentifierGenerator identifierGenerator = null; + + if (this.setUniqueIdentifiers) + { + identifierGenerator = new IdentifierGenerator("WebVirtualDir", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) + { + if (null != webVirtualDir.Id) + { + identifierGenerator.IndexExistingIdentifier(webVirtualDir.Id); + } + else + { + identifierGenerator.IndexName(webVirtualDir.Alias); + } + } + } + + foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) + { + if (this.setUniqueIdentifiers && null == webVirtualDir.Id) + { + webVirtualDir.Id = identifierGenerator.GetIdentifier(webVirtualDir.Alias); + } + + // harvest the directory for this WebVirtualDir + this.HarvestUniqueDirectory(webVirtualDir.Directory, true); + } + } + } +} diff --git a/src/heat/IIsHeatExtension.cs b/src/heat/IIsHeatExtension.cs new file mode 100644 index 00000000..94e11a68 --- /dev/null +++ b/src/heat/IIsHeatExtension.cs @@ -0,0 +1,80 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// An IIS harvesting extension for the WiX Toolset Harvester application. + /// + internal class IIsHeatExtension : BaseHeatExtension + { + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public override HeatCommandLineOption[] CommandLineTypes + { + get + { + return new HeatCommandLineOption[] + { + new HeatCommandLineOption("website", "harvest an IIS web site"), + }; + } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public override void ParseOptions(string type, string[] args) + { + bool active = false; + IHarvesterExtension harvesterExtension = null; + IIsHarvesterMutator iisHarvesterMutator = new IIsHarvesterMutator(); + + // select the harvester + switch (type) + { + case "website": + harvesterExtension = new IIsWebSiteHarvester(); + active = true; + break; + } + + // set default settings + iisHarvesterMutator.SetUniqueIdentifiers = true; + + // parse the options + foreach (string arg in args) + { + if (null == arg || 0 == arg.Length) // skip blank arguments + { + continue; + } + + if ('-' == arg[0] || '/' == arg[0]) + { + string parameter = arg.Substring(1); + + if ("suid" == parameter) + { + iisHarvesterMutator.SetUniqueIdentifiers = false; + } + } + } + + // set the appropriate harvester extension + if (active) + { + this.Core.Harvester.Extension = harvesterExtension; + this.Core.Mutator.AddExtension(iisHarvesterMutator); + this.Core.Mutator.AddExtension(new IIsFinalizeHarvesterMutator()); + this.Core.Mutator.AddExtension(new UtilFinalizeHarvesterMutator()); + } + } + } +} diff --git a/src/heat/IIsWebSiteHarvester.cs b/src/heat/IIsWebSiteHarvester.cs new file mode 100644 index 00000000..86861b16 --- /dev/null +++ b/src/heat/IIsWebSiteHarvester.cs @@ -0,0 +1,439 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.DirectoryServices; + using System.Globalization; + using System.Runtime.InteropServices; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using IIs = WixToolset.Harvesters.Serialize.IIs; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The web site harvester for the WiX Toolset Internet Information Services Extension. + /// + internal class IIsWebSiteHarvester : BaseHarvesterExtension + { + /// + /// Harvest a WiX document. + /// + /// The argument for harvesting. + /// The harvested Fragment. + public override Wix.Fragment[] Harvest(string argument) + { + DirectoryHarvester directoryHarvester = new DirectoryHarvester(); + directoryHarvester.Core = this.Core; + directoryHarvester.KeepEmptyDirectories = true; + + IIsWebSiteHarvester iisWebSiteHarvester = new IIsWebSiteHarvester(); + iisWebSiteHarvester.Core = this.Core; + + IIs.WebSite webSite = iisWebSiteHarvester.HarvestWebSite(argument); + + Wix.Component component = new Wix.Component(); + component.AddChild(new Wix.CreateFolder()); + component.AddChild(webSite); + + this.Core.RootDirectory = webSite.Directory; + Wix.Directory directory = directoryHarvester.HarvestDirectory(webSite.Directory, true); + directory.AddChild(component); + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directory); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a web site. + /// + /// The name of the web site. + /// The harvested web site. + public IIs.WebSite HarvestWebSite(string name) + { + try + { + DirectoryEntry directoryEntry = new DirectoryEntry("IIS://localhost/W3SVC"); + + foreach (DirectoryEntry childEntry in directoryEntry.Children) + { + if ("IIsWebServer" == childEntry.SchemaClassName) + { + if (String.Equals((string)childEntry.Properties["ServerComment"].Value, name, StringComparison.OrdinalIgnoreCase)) + { + return this.HarvestWebSite(childEntry); + } + } + } + } + catch (COMException ce) + { + // 0x8007005 - access denied + // If we don't have permission to harvest a website, it's likely because we're on + // Vista or higher and aren't an Admin. + if ((0x80070005 == unchecked((uint)ce.ErrorCode))) + { + throw new WixException(HarvesterErrors.InsufficientPermissionHarvestWebSite()); + } + // 0x80005000 - unknown error + else if ((0x80005000 == unchecked((uint)ce.ErrorCode))) + { + throw new WixException(HarvesterErrors.CannotHarvestWebSite()); + } + } + + throw new WixException(HarvesterErrors.WebSiteNotFound(name)); + } + + /// + /// Harvest a web site. + /// + /// The web site directory entry. + /// The harvested web site. + private IIs.WebSite HarvestWebSite(DirectoryEntry webSiteEntry) + { + IIs.WebSite webSite = new IIs.WebSite(); + + foreach (string propertyName in webSiteEntry.Properties.PropertyNames) + { + PropertyValueCollection property = webSiteEntry.Properties[propertyName]; + PropertyValueCollection parentProperty = webSiteEntry.Parent.Properties[propertyName]; + + if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) + { + switch (propertyName) + { + case "SecureBindings": + IIs.WebAddress secureWebAddress = this.HarvestBindings(propertyName, property); + if (null != secureWebAddress) + { + webSite.AddChild(secureWebAddress); + } + break; + case "ServerBindings": + IIs.WebAddress webAddress = this.HarvestBindings(propertyName, property); + if (null != webAddress) + { + webSite.AddChild(webAddress); + } + break; + case "ServerComment": + webSite.Description = (string)property.Value; + break; + } + } + } + + foreach (DirectoryEntry childEntry in webSiteEntry.Children) + { + switch (childEntry.SchemaClassName) + { + case "IIsFilters": + string loadOrder = (string)childEntry.Properties["FilterLoadOrder"].Value; + if (loadOrder.Length > 0) + { + string[] filterNames = loadOrder.Split(",".ToCharArray()); + + for (int i = 0; i < filterNames.Length; i++) + { + using (DirectoryEntry webFilterEntry = new DirectoryEntry(String.Concat(childEntry.Path, '/', filterNames[i]))) + { + IIs.WebFilter webFilter = this.HarvestWebFilter(webFilterEntry); + + webFilter.LoadOrder = (i + 1).ToString(CultureInfo.InvariantCulture); + + webSite.AddChild(webFilter); + } + } + } + break; + case "IIsWebDirectory": + this.HarvestWebDirectory(childEntry, webSite); + break; + case "IIsWebVirtualDir": + foreach (string propertyName in childEntry.Properties.PropertyNames) + { + PropertyValueCollection property = childEntry.Properties[propertyName]; + + switch (propertyName) + { + case "Path": + webSite.Directory = (string)property.Value; + break; + } + } + + IIs.WebDirProperties webDirProps = this.HarvestWebDirProperties(childEntry); + if (null != webDirProps) + { + webSite.AddChild(webDirProps); + } + + foreach (DirectoryEntry child2Entry in childEntry.Children) + { + switch (child2Entry.SchemaClassName) + { + case "IIsWebDirectory": + this.HarvestWebDirectory(child2Entry, webSite); + break; + case "IIsWebVirtualDir": + this.HarvestWebVirtualDir(child2Entry, webSite); + break; + } + } + break; + } + } + + return webSite; + } + + /// + /// Harvest bindings. + /// + /// The property name of the bindings property. + /// The bindings property. + /// The harvested bindings. + private IIs.WebAddress HarvestBindings(string propertyName, PropertyValueCollection bindingsProperty) + { + if (1 == bindingsProperty.Count) + { + IIs.WebAddress webAddress = new IIs.WebAddress(); + + string[] bindings = ((string)bindingsProperty[0]).Split(":".ToCharArray()); + + if (0 < bindings[0].Length) + { + webAddress.IP = bindings[0]; + } + + if (0 < bindings[1].Length) + { + webAddress.Port = bindings[1]; + } + + if (0 < bindings[2].Length) + { + webAddress.Header = bindings[2]; + } + + if ("SecureBindings" == propertyName) + { + webAddress.Secure = IIs.YesNoType.yes; + } + + return webAddress; + } + + return null; + } + + /// + /// Harvest a web directory. + /// + /// The web directory directory entry. + /// The parent web site. + private void HarvestWebDirectory(DirectoryEntry webDirectoryEntry, IIs.WebSite webSite) + { + foreach (DirectoryEntry childEntry in webDirectoryEntry.Children) + { + switch (childEntry.SchemaClassName) + { + case "IIsWebDirectory": + this.HarvestWebDirectory(childEntry, webSite); + break; + case "IIsWebVirtualDir": + this.HarvestWebVirtualDir(childEntry, webSite); + break; + } + } + + IIs.WebDirProperties webDirProperties = this.HarvestWebDirProperties(webDirectoryEntry); + + if (null != webDirProperties) + { + IIs.WebDir webDir = new IIs.WebDir(); + + int indexOfRoot = webDirectoryEntry.Path.IndexOf("ROOT/", StringComparison.OrdinalIgnoreCase); + webDir.Path = webDirectoryEntry.Path.Substring(indexOfRoot + 5); + + webDir.AddChild(webDirProperties); + + webSite.AddChild(webDir); + } + } + + /// + /// Harvest a web filter. + /// + /// The web filter directory entry. + /// The harvested web filter. + private IIs.WebFilter HarvestWebFilter(DirectoryEntry webFilterEntry) + { + IIs.WebFilter webFilter = new IIs.WebFilter(); + + webFilter.Name = webFilterEntry.Name; + + foreach (string propertyName in webFilterEntry.Properties.PropertyNames) + { + PropertyValueCollection property = webFilterEntry.Properties[propertyName]; + + switch (propertyName) + { + case "FilterDescription": + webFilter.Description = (string)property.Value; + break; + case "FilterFlags": + webFilter.Flags = (int)property.Value; + break; + case "FilterPath": + webFilter.Path = (string)property.Value; + break; + } + } + + return webFilter; + } + + /// + /// Harvest a web directory's properties. + /// + /// The web directory directory entry. + /// The harvested web directory's properties. + private IIs.WebDirProperties HarvestWebDirProperties(DirectoryEntry directoryEntry) + { + bool foundProperties = false; + IIs.WebDirProperties webDirProperties = new IIs.WebDirProperties(); + + // Cannot read properties for "iisadmin" site. + if (String.Equals("iisadmin", directoryEntry.Name, StringComparison.OrdinalIgnoreCase) && + String.Equals("ROOT", directoryEntry.Parent.Name, StringComparison.OrdinalIgnoreCase)) + { + return null; + } + + foreach (string propertyName in directoryEntry.Properties.PropertyNames) + { + PropertyValueCollection property = directoryEntry.Properties[propertyName]; + PropertyValueCollection parentProperty = directoryEntry.Parent.Properties[propertyName]; + + if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) + { + switch (propertyName) + { + case "AccessFlags": + int access = (int)property.Value; + + if (0x1 == (access & 0x1)) + { + webDirProperties.Read = IIs.YesNoType.yes; + } + + if (0x2 == (access & 0x2)) + { + webDirProperties.Write = IIs.YesNoType.yes; + } + + if (0x4 == (access & 0x4)) + { + webDirProperties.Execute = IIs.YesNoType.yes; + } + + if (0x200 == (access & 0x200)) + { + webDirProperties.Script = IIs.YesNoType.yes; + } + + foundProperties = true; + break; + case "AuthFlags": + int authorization = (int)property.Value; + + if (0x1 == (authorization & 0x1)) + { + webDirProperties.AnonymousAccess = IIs.YesNoType.yes; + } + + if (0x2 == (authorization & 0x2)) + { + webDirProperties.BasicAuthentication = IIs.YesNoType.yes; + } + + if (0x4 == (authorization & 0x4)) + { + webDirProperties.WindowsAuthentication = IIs.YesNoType.yes; + } + + if (0x10 == (authorization & 0x10)) + { + webDirProperties.DigestAuthentication = IIs.YesNoType.yes; + } + + if (0x40 == (authorization & 0x40)) + { + webDirProperties.PassportAuthentication = IIs.YesNoType.yes; + } + + foundProperties = true; + break; + } + } + } + + return foundProperties ? webDirProperties : null; + } + + /// + /// Harvest a web virtual directory. + /// + /// The web virtual directory directory entry. + /// The parent web site. + private void HarvestWebVirtualDir(DirectoryEntry webVirtualDirEntry, IIs.WebSite webSite) + { + IIs.WebVirtualDir webVirtualDir = new IIs.WebVirtualDir(); + + foreach (string propertyName in webVirtualDirEntry.Properties.PropertyNames) + { + PropertyValueCollection property = webVirtualDirEntry.Properties[propertyName]; + PropertyValueCollection parentProperty = webVirtualDirEntry.Parent.Properties[propertyName]; + + if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) + { + switch (propertyName) + { + case "Path": + webVirtualDir.Directory = (string)property.Value; + break; + } + } + } + + int indexOfRoot = webVirtualDirEntry.Path.IndexOf("ROOT/", StringComparison.OrdinalIgnoreCase); + webVirtualDir.Alias = webVirtualDirEntry.Path.Substring(indexOfRoot + 5); + + IIs.WebDirProperties webDirProps = this.HarvestWebDirProperties(webVirtualDirEntry); + if (webDirProps != null) + { + webVirtualDir.AddChild(webDirProps); + } + + foreach (DirectoryEntry childEntry in webVirtualDirEntry.Children) + { + switch (childEntry.SchemaClassName) + { + case "IIsWebDirectory": + this.HarvestWebDirectory(childEntry, webSite); + break; + case "IIsWebVirtualDir": + this.HarvestWebVirtualDir(childEntry, webSite); + break; + } + } + + webSite.AddChild(webVirtualDir); + } + } +} diff --git a/src/heat/Mutator.cs b/src/heat/Mutator.cs new file mode 100644 index 00000000..8c63882d --- /dev/null +++ b/src/heat/Mutator.cs @@ -0,0 +1,93 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The WiX Toolset mutator. + /// + internal class Mutator : IMutator + { + private SortedList extensions; + private string extensionArgument; + + /// + /// Instantiate a new mutator. + /// + public Mutator() + { + this.extensions = new SortedList(); + } + + public IHarvesterCore Core { get; set; } + + public string ExtensionArgument + { + get { return this.extensionArgument; } + set { this.extensionArgument = value; } + } + + public void AddExtension(IMutatorExtension mutatorExtension) + { + this.extensions.Add(mutatorExtension.Sequence, mutatorExtension); + } + + public bool Mutate(Wix.Wix wix) + { + bool encounteredError = false; + + try + { + foreach (IMutatorExtension mutatorExtension in this.extensions.Values) + { + if (null == mutatorExtension.Core) + { + mutatorExtension.Core = this.Core; + } + + mutatorExtension.Mutate(wix); + } + } + finally + { + encounteredError = this.Core.Messaging.EncounteredError; + } + + // return the Wix document element only if mutation completed successfully + return !encounteredError; + } + + public string Mutate(string wixString) + { + bool encounteredError = false; + + try + { + foreach (IMutatorExtension mutatorExtension in this.extensions.Values) + { + if (null == mutatorExtension.Core) + { + mutatorExtension.Core = this.Core; + } + + wixString = mutatorExtension.Mutate(wixString); + + if (String.IsNullOrEmpty(wixString) || this.Core.Messaging.EncounteredError) + { + break; + } + } + } + finally + { + encounteredError = this.Core.Messaging.EncounteredError; + } + + return encounteredError ? null : wixString; + } + } +} diff --git a/src/heat/PayloadHarvester.cs b/src/heat/PayloadHarvester.cs new file mode 100644 index 00000000..4bf625d1 --- /dev/null +++ b/src/heat/PayloadHarvester.cs @@ -0,0 +1,129 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Core.Burn.Interfaces; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a payload from the file system. + /// + internal class PayloadHarvester : BaseHarvesterExtension + { + private bool setUniqueIdentifiers; + private WixBundlePackageType packageType; + + private IPayloadHarvester payloadHarvester; + + /// + /// Instantiate a new PayloadHarvester. + /// + public PayloadHarvester(IPayloadHarvester payloadHarvester, WixBundlePackageType packageType) + { + this.payloadHarvester = payloadHarvester; + + this.packageType = packageType; + this.setUniqueIdentifiers = true; + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Harvest a payload. + /// + /// The path of the payload. + /// A harvested payload. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + string fullPath = Path.GetFullPath(argument); + + var remotePayload = this.HarvestRemotePayload(fullPath); + + var fragment = new Wix.Fragment(); + fragment.AddChild(remotePayload); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a payload. + /// + /// The path of the payload. + /// A harvested payload. + public Wix.RemotePayload HarvestRemotePayload(string path) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + if (!File.Exists(path)) + { + throw new WixException(HarvesterErrors.FileNotFound(path)); + } + + Wix.RemotePayload remotePayload; + + switch (this.packageType) + { + case WixBundlePackageType.Exe: + remotePayload = new Wix.ExePackagePayload(); + break; + case WixBundlePackageType.Msu: + remotePayload = new Wix.MsuPackagePayload(); + break; + default: + throw new NotImplementedException(); + } + + var payloadSymbol = new WixBundlePayloadSymbol + { + SourceFile = new IntermediateFieldPathValue { Path = path }, + }; + + this.payloadHarvester.HarvestStandardInformation(payloadSymbol); + + if (payloadSymbol.FileSize.HasValue) + { + remotePayload.Size = payloadSymbol.FileSize.Value; + } + remotePayload.Hash = payloadSymbol.Hash; + + if (!String.IsNullOrEmpty(payloadSymbol.Version)) + { + remotePayload.Version = payloadSymbol.Version; + } + + if (!String.IsNullOrEmpty(payloadSymbol.Description)) + { + remotePayload.Description = payloadSymbol.Description; + } + + if (!String.IsNullOrEmpty(payloadSymbol.DisplayName)) + { + remotePayload.ProductName = payloadSymbol.DisplayName; + } + + return remotePayload; + } + } +} diff --git a/src/heat/PerformanceCategoryHarvester.cs b/src/heat/PerformanceCategoryHarvester.cs new file mode 100644 index 00000000..d9c46001 --- /dev/null +++ b/src/heat/PerformanceCategoryHarvester.cs @@ -0,0 +1,207 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Linq; + using System.Diagnostics; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Util = WixToolset.Harvesters.Serialize.Util; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a file from the file system. + /// + internal class PerformanceCategoryHarvester : BaseHarvesterExtension + { + /// + /// Harvest a performance category. + /// + /// The name of the performance category. + /// A harvested performance category. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + Util.PerformanceCategory perf = this.HarvestPerformanceCategory(argument); + + Wix.Component component = new Wix.Component(); + component.Id = this.Core.CreateIdentifierFromFilename(argument); + component.KeyPath = Wix.YesNoType.yes; + component.AddChild(perf); + + Wix.Directory directory = new Wix.Directory(); + directory.Id = "TARGETDIR"; + //directory.Name = directory.Id; + directory.AddChild(component); + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directory); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a performance category. + /// + /// The name of the performance category. + /// A harvested file. + public Util.PerformanceCategory HarvestPerformanceCategory(string category) + { + if (null == category) + { + throw new ArgumentNullException("category"); + } + + if (PerformanceCounterCategory.Exists(category)) + { + Util.PerformanceCategory perfCategory = new Util.PerformanceCategory(); + + // Get the performance counter category and set the appropriate WiX attributes + PerformanceCounterCategory pcc = PerformanceCounterCategory.GetCategories().Single(c => string.Equals(c.CategoryName, category)); + perfCategory.Id = this.Core.CreateIdentifierFromFilename(pcc.CategoryName); + perfCategory.Name = pcc.CategoryName; + perfCategory.Help = pcc.CategoryHelp; + if (PerformanceCounterCategoryType.MultiInstance == pcc.CategoryType) + { + perfCategory.MultiInstance = Util.YesNoType.yes; + } + + // If it's multi-instance, check if there are any instances and get counters from there; else we get + // the counters straight up. For multi-instance, GetCounters() fails if there are any instances. If there + // are no instances, then GetCounters(instance) can't be called since there is no instance. Instances + // will exist for each counter even if only one of the counters was "intialized." + string[] instances = pcc.GetInstanceNames(); + bool hasInstances = instances.Length > 0; + PerformanceCounter[] counters = hasInstances + ? pcc.GetCounters(instances.First()) + : pcc.GetCounters(); + + foreach (PerformanceCounter counter in counters) + { + Util.PerformanceCounter perfCounter = new Util.PerformanceCounter(); + + // Get the performance counter and set the appropriate WiX attributes + perfCounter.Name = counter.CounterName; + perfCounter.Type = this.CounterTypeToWix(counter.CounterType); + perfCounter.Help = counter.CounterHelp; + + perfCategory.AddChild(perfCounter); + } + + return perfCategory; + } + else + { + throw new WixException(HarvesterErrors.PerformanceCategoryNotFound(category)); + } + } + + /// + /// Get the WiX performance counter type. + /// + /// The performance counter value to get. + /// The WiX performance counter type. + private Util.PerformanceCounterTypesType CounterTypeToWix(PerformanceCounterType pct) + { + Util.PerformanceCounterTypesType type; + + switch (pct) + { + case PerformanceCounterType.AverageBase: + type = Util.PerformanceCounterTypesType.averageBase; + break; + case PerformanceCounterType.AverageCount64: + type = Util.PerformanceCounterTypesType.averageCount64; + break; + case PerformanceCounterType.AverageTimer32: + type = Util.PerformanceCounterTypesType.averageTimer32; + break; + case PerformanceCounterType.CounterDelta32: + type = Util.PerformanceCounterTypesType.counterDelta32; + break; + case PerformanceCounterType.CounterTimerInverse: + type = Util.PerformanceCounterTypesType.counterTimerInverse; + break; + case PerformanceCounterType.SampleFraction: + type = Util.PerformanceCounterTypesType.sampleFraction; + break; + case PerformanceCounterType.Timer100Ns: + type = Util.PerformanceCounterTypesType.timer100Ns; + break; + case PerformanceCounterType.CounterTimer: + type = Util.PerformanceCounterTypesType.counterTimer; + break; + case PerformanceCounterType.RawFraction: + type = Util.PerformanceCounterTypesType.rawFraction; + break; + case PerformanceCounterType.Timer100NsInverse: + type = Util.PerformanceCounterTypesType.timer100NsInverse; + break; + case PerformanceCounterType.CounterMultiTimer: + type = Util.PerformanceCounterTypesType.counterMultiTimer; + break; + case PerformanceCounterType.CounterMultiTimer100Ns: + type = Util.PerformanceCounterTypesType.counterMultiTimer100Ns; + break; + case PerformanceCounterType.CounterMultiTimerInverse: + type = Util.PerformanceCounterTypesType.counterMultiTimerInverse; + break; + case PerformanceCounterType.CounterMultiTimer100NsInverse: + type = Util.PerformanceCounterTypesType.counterMultiTimer100NsInverse; + break; + case PerformanceCounterType.ElapsedTime: + type = Util.PerformanceCounterTypesType.elapsedTime; + break; + case PerformanceCounterType.SampleBase: + type = Util.PerformanceCounterTypesType.sampleBase; + break; + case PerformanceCounterType.RawBase: + type = Util.PerformanceCounterTypesType.rawBase; + break; + case PerformanceCounterType.CounterMultiBase: + type = Util.PerformanceCounterTypesType.counterMultiBase; + break; + case PerformanceCounterType.RateOfCountsPerSecond64: + type = Util.PerformanceCounterTypesType.rateOfCountsPerSecond64; + break; + case PerformanceCounterType.RateOfCountsPerSecond32: + type = Util.PerformanceCounterTypesType.rateOfCountsPerSecond32; + break; + case PerformanceCounterType.CountPerTimeInterval64: + type = Util.PerformanceCounterTypesType.countPerTimeInterval64; + break; + case PerformanceCounterType.CountPerTimeInterval32: + type = Util.PerformanceCounterTypesType.countPerTimeInterval32; + break; + case PerformanceCounterType.SampleCounter: + type = Util.PerformanceCounterTypesType.sampleCounter; + break; + case PerformanceCounterType.CounterDelta64: + type = Util.PerformanceCounterTypesType.counterDelta64; + break; + case PerformanceCounterType.NumberOfItems64: + type = Util.PerformanceCounterTypesType.numberOfItems64; + break; + case PerformanceCounterType.NumberOfItems32: + type = Util.PerformanceCounterTypesType.numberOfItems32; + break; + case PerformanceCounterType.NumberOfItemsHEX64: + type = Util.PerformanceCounterTypesType.numberOfItemsHEX64; + break; + case PerformanceCounterType.NumberOfItemsHEX32: + type = Util.PerformanceCounterTypesType.numberOfItemsHEX32; + break; + default: + throw new WixException(HarvesterErrors.UnsupportedPerformanceCounterType(pct.ToString())); + } + + return type; + } + } +} diff --git a/src/heat/RegFileHarvester.cs b/src/heat/RegFileHarvester.cs new file mode 100644 index 00000000..a3d181f2 --- /dev/null +++ b/src/heat/RegFileHarvester.cs @@ -0,0 +1,438 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Globalization; + using System.IO; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a reg file. + /// + internal class RegFileHarvester : BaseHarvesterExtension + { + private static readonly string ComponentPrefix = "cmp"; + + /// + /// Current line in the reg file being processed. + /// + private int currentLineNumber = 0; + + /// + /// Flag indicating whether this is a unicode registry file. + /// + private bool unicodeRegistry; + + /// + /// Harvest a file. + /// + /// The path of the file. + /// A harvested file. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + // Harvest the keys from the registry file + Wix.Fragment fragment = this.HarvestRegFile(argument); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a reg file. + /// + /// The path of the file. + /// A harvested registy file. + public Wix.Fragment HarvestRegFile(string path) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + if (!File.Exists(path)) + { + throw new WixException(HarvesterErrors.FileNotFound(path)); + } + + Wix.Directory directory = new Wix.Directory(); + directory.Id = "TARGETDIR"; + + // Use absolute paths + path = Path.GetFullPath(path); + FileInfo file = new FileInfo(path); + + using (StreamReader sr = file.OpenText()) + { + string line; + this.currentLineNumber = 0; + + while (null != (line = this.GetNextLine(sr))) + { + if (line.StartsWith(@"Windows Registry Editor Version 5.00")) + { + this.unicodeRegistry = true; + } + else if (line.StartsWith(@"REGEDIT4")) + { + this.unicodeRegistry = false; + } + else if (line.StartsWith(@"[HKEY_CLASSES_ROOT\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKCR, line.Substring(19, line.Length - 20)); + } + else if (line.StartsWith(@"[HKEY_CURRENT_USER\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKCU, line.Substring(19, line.Length - 20)); + } + else if (line.StartsWith(@"[HKEY_LOCAL_MACHINE\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKLM, line.Substring(20, line.Length - 21)); + } + else if (line.StartsWith(@"[HKEY_USERS\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKU, line.Substring(12, line.Length - 13)); + } + } + } + + Console.WriteLine("Processing complete"); + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directory); + + return fragment; + } + + /// + /// Converts the registry key to a WiX component element. + /// + /// The registry file stream. + /// A WiX directory reference. + /// The root key. + /// The current line. + private void ConvertKey(StreamReader sr, ref Wix.Directory directory, Wix.RegistryRootType root, string line) + { + Wix.Component component = new Wix.Component(); + + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, line); + component.KeyPath = Wix.YesNoType.yes; + + this.ConvertValues(sr, ref component, root, line); + directory.AddChild(component); + } + + /// + /// Converts the registry values to WiX regisry key element. + /// + /// The registry file stream. + /// A WiX component reference. + /// The root key. + /// The current line. + private void ConvertValues(StreamReader sr, ref Wix.Component component, Wix.RegistryRootType root, string line) + { + string name = null; + string value = null; + Wix.RegistryValue.TypeType type; + Wix.RegistryKey registryKey = new Wix.RegistryKey(); + + registryKey.Root = root; + registryKey.Key = line; + + while (this.GetValue(sr, ref name, ref value, out type)) + { + Wix.RegistryValue registryValue = new Wix.RegistryValue(); + ArrayList charArray; + + // Don't specifiy name for default attribute + if (!string.IsNullOrEmpty(name)) + { + registryValue.Name = name; + } + + registryValue.Type = type; + + switch (type) + { + case Wix.RegistryValue.TypeType.binary: + registryValue.Value = value.Replace(",", string.Empty).ToUpper(); + break; + + case Wix.RegistryValue.TypeType.integer: + registryValue.Value = Int32.Parse(value, NumberStyles.HexNumber).ToString(); + break; + + case Wix.RegistryValue.TypeType.expandable: + charArray = this.ConvertCharList(value); + value = string.Empty; + + // create the string, remove the terminating null + for (int i = 0; i < charArray.Count; i++) + { + if ('\0' != (char)charArray[i]) + { + value += charArray[i]; + } + } + + registryValue.Value = value; + break; + + case Wix.RegistryValue.TypeType.multiString: + charArray = this.ConvertCharList(value); + value = string.Empty; + + // Convert the character array to a string so we can simply split it at the nulls, ignore the final null null. + for (int i = 0; i < (charArray.Count - 2); i++) + { + value += charArray[i]; + } + + // Although the value can use [~] the preffered way is to use MultiStringValue + string[] parts = value.Split("\0".ToCharArray()); + foreach (string part in parts) + { + Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); + multiStringValue.Content = part; + registryValue.AddChild(multiStringValue); + } + + break; + + case Wix.RegistryValue.TypeType.@string: + // Remove \\ and \" + value = value.ToString().Replace("\\\"", "\""); + value = value.ToString().Replace(@"\\", @"\"); + // Escape [ and ] + value = value.ToString().Replace(@"[", @"[\[]"); + value = value.ToString().Replace(@"]", @"[\]]"); + // This undoes the duplicate escaping caused by the second replace + value = value.ToString().Replace(@"[\[[\]]", @"[\[]"); + // Escape $ + value = value.ToString().Replace(@"$", @"$$"); + + registryValue.Value = value; + break; + + default: + throw new ApplicationException(String.Format("Did not recognize the type of reg value on line {0}", this.currentLineNumber)); + } + + registryKey.AddChild(registryValue); + } + + // Make sure empty keys are created + if (null == value) + { + registryKey.ForceCreateOnInstall = Wix.YesNoType.yes; + } + + component.AddChild(registryKey); + } + + /// + /// Parse a value from a line. + /// + /// Reader for the reg file. + /// Name of the value. + /// Value of the value. + /// Type of the value. + /// true if the value can be parsed, false otherwise. + private bool GetValue(StreamReader sr, ref string name, ref string value, out Wix.RegistryValue.TypeType type) + { + string line = this.GetNextLine(sr); + + if (null == line || 0 == line.Length) + { + type = 0; + return false; + } + + string[] parts; + + if (line.StartsWith("@")) + { + // Special case for default value + parts = line.Trim().Split("=".ToCharArray(), 2); + + name = null; + } + else + { + parts = line.Trim().Split("=".ToCharArray()); + + // It is valid to have an '=' in the name or the data. This is probably a string so the separator will be '"="'. + if (2 != parts.Length) + { + string[] stringSeparator = new string[] { "\"=\"" }; + parts = line.Trim().Split(stringSeparator, StringSplitOptions.None); + + if (2 != parts.Length) + { + // Line still no parsed correctly + throw new ApplicationException(String.Format("Cannot parse value: {0} at line {1}.", line, this.currentLineNumber)); + } + + // Put back quotes stripped by Split() + parts[0] += "\""; + parts[1] = "\"" + parts[1]; + } + + name = parts[0].Substring(1, parts[0].Length - 2); + } + + if (parts[1].StartsWith("hex:")) + { + // binary + value = parts[1].Substring(4); + type = Wix.RegistryValue.TypeType.binary; + } + else if (parts[1].StartsWith("dword:")) + { + // dword + value = parts[1].Substring(6); + type = Wix.RegistryValue.TypeType.integer; + } + else if (parts[1].StartsWith("hex(2):")) + { + // expandable string + value = parts[1].Substring(7); + type = Wix.RegistryValue.TypeType.expandable; + } + else if (parts[1].StartsWith("hex(7):")) + { + // multi-string + value = parts[1].Substring(7); + type = Wix.RegistryValue.TypeType.multiString; + } + else if (parts[1].StartsWith("hex(")) + { + // Give a better error when we find something that isn't supported + // by specifying the type that isn't supported. + string unsupportedType = ""; + + if (parts[1].StartsWith("hex(0")) { unsupportedType = "REG_NONE"; } + else if (parts[1].StartsWith("hex(6")) { unsupportedType = "REG_LINK"; } + else if (parts[1].StartsWith("hex(8")) { unsupportedType = "REG_RESOURCE_LIST"; } + else if (parts[1].StartsWith("hex(9")) { unsupportedType = "REG_FULL_RESOURCE_DESCRIPTOR"; } + else if (parts[1].StartsWith("hex(a")) { unsupportedType = "REG_RESOURCE_REQUIREMENTS_LIST"; } + else if (parts[1].StartsWith("hex(b")) { unsupportedType = "REG_QWORD"; } + + // REG_NONE(0), REG_LINK(6), REG_RESOURCE_LIST(8), REG_FULL_RESOURCE_DESCRIPTOR(9), REG_RESOURCE_REQUIREMENTS_LIST(a), REG_QWORD(b) + this.Core.Messaging.Write(HarvesterWarnings.UnsupportedRegistryType(parts[0], this.currentLineNumber, unsupportedType)); + + type = 0; + return false; + } + else if (parts[1].StartsWith("\"")) + { + // string + value = parts[1].Substring(1, parts[1].Length - 2); + type = Wix.RegistryValue.TypeType.@string; + } + else + { + // unsupported value + throw new ApplicationException(String.Format("Unsupported registry value {0} at line {1}.", line, this.currentLineNumber)); + } + + return true; + } + + /// + /// Get the next line from the reg file input stream. + /// + /// Reader for the reg file. + /// The next line. + private string GetNextLine(StreamReader sr) + { + string line; + string totalLine = null; + + while (null != (line = sr.ReadLine())) + { + bool stop = true; + + this.currentLineNumber++; + line = line.Trim(); + Console.Write("Processing line: {0}\r", this.currentLineNumber); + + if (line.EndsWith("\\")) + { + stop = false; + line = line.Substring(0, line.Length - 1); + } + + if (null == totalLine) + { + // first line + totalLine = line; + } + else + { + // other lines + totalLine += line; + } + + // break if there is no more info for this line + if (stop) + { + break; + } + } + + return totalLine; + } + + /// + /// Convert a character list into the proper WiX format for either unicode or ansi lists. + /// + /// List of characters. + /// Array of characters. + private ArrayList ConvertCharList(string charList) + { + if (string.IsNullOrEmpty(charList)) + { + return new ArrayList(); + } + + string[] strChars = charList.Split(",".ToCharArray()); + + ArrayList charArray = new ArrayList(); + + if (this.unicodeRegistry) + { + if (0 != strChars.Length % 2) + { + throw new ApplicationException(String.Format("Problem parsing Expandable string data at line {0}, its probably not Unicode.", this.currentLineNumber)); + } + + for (int i = 0; i < strChars.Length; i += 2) + { + string chars = strChars[i + 1] + strChars[i]; + int unicodeInt = Int32.Parse(chars, NumberStyles.HexNumber); + char unicodeChar = (char)unicodeInt; + charArray.Add(unicodeChar); + } + } + else + { + for (int i = 0; i < strChars.Length; i++) + { + char charValue = (char)Int32.Parse(strChars[i], NumberStyles.HexNumber); + charArray.Add(charValue); + } + } + + return charArray; + } + } +} diff --git a/src/heat/RegistryHarvester.cs b/src/heat/RegistryHarvester.cs new file mode 100644 index 00000000..d416236c --- /dev/null +++ b/src/heat/RegistryHarvester.cs @@ -0,0 +1,477 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Diagnostics; + using System.Globalization; + using System.Runtime.InteropServices; + using System.Text; + using Microsoft.Win32; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from the registry. + /// + internal class RegistryHarvester : IDisposable + { + private const string HKCRPathInHKLM = @"Software\Classes"; + private string remappedPath; + private static readonly int majorOSVersion = Environment.OSVersion.Version.Major; + private RegistryKey regKeyToOverride = Registry.LocalMachine; + private IntPtr regRootToOverride = NativeMethods.HkeyLocalMachine; + + /// + /// Instantiate a new RegistryHarvester. + /// + /// Set to true to remap the entire registry to a private location for this process. + public RegistryHarvester(bool remap) + { + // Detect OS major version and set the hive to use when + // redirecting registry writes. We want to redirect registry + // writes to HKCU on Windows Vista and higher to avoid UAC + // problems, and to HKLM on downlevel OS's. + if (majorOSVersion >= 6) + { + this.regKeyToOverride = Registry.CurrentUser; + this.regRootToOverride = NativeMethods.HkeyCurrentUser; + } + + // create a path in the registry for redirected keys which is process-specific + if (remap) + { + this.remappedPath = String.Concat(@"SOFTWARE\WiX\heat\", Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture)); + + // remove the previous remapped key if it exists + this.RemoveRemappedKey(); + + // remap the registry roots supported by MSI + // note - order is important here - the hive being used to redirect + // to must be overridden last to avoid creating the other override + // hives in the wrong location in the registry. For example, if HKLM is + // the redirect destination, overriding it first will cause other hives + // to be overridden under HKLM\Software\WiX\heat\HKLM\Software\WiX\HKCR + // instead of under HKLM\Software\WiX\heat\HKCR + if (majorOSVersion < 6) + { + this.RemapRegistryKey(NativeMethods.HkeyClassesRoot, String.Concat(this.remappedPath, @"\\HKEY_CLASSES_ROOT")); + this.RemapRegistryKey(NativeMethods.HkeyCurrentUser, String.Concat(this.remappedPath, @"\\HKEY_CURRENT_USER")); + this.RemapRegistryKey(NativeMethods.HkeyUsers, String.Concat(this.remappedPath, @"\\HKEY_USERS")); + this.RemapRegistryKey(NativeMethods.HkeyLocalMachine, String.Concat(this.remappedPath, @"\\HKEY_LOCAL_MACHINE")); + } + else + { + this.RemapRegistryKey(NativeMethods.HkeyClassesRoot, String.Concat(this.remappedPath, @"\\HKEY_CLASSES_ROOT")); + this.RemapRegistryKey(NativeMethods.HkeyLocalMachine, String.Concat(this.remappedPath, @"\\HKEY_LOCAL_MACHINE")); + this.RemapRegistryKey(NativeMethods.HkeyUsers, String.Concat(this.remappedPath, @"\\HKEY_USERS")); + this.RemapRegistryKey(NativeMethods.HkeyCurrentUser, String.Concat(this.remappedPath, @"\\HKEY_CURRENT_USER")); + + // Typelib registration on Windows Vista requires that the key + // HKLM\Software\Classes exist, so add it to the remapped root + Registry.LocalMachine.CreateSubKey(HKCRPathInHKLM); + } + } + } + + /// + /// Close the RegistryHarvester and remove any remapped registry keys. + /// + public void Close() + { + // note - order is important here - we must quit overriding the hive + // being used to redirect first + if (majorOSVersion < 6) + { + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyLocalMachine, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyClassesRoot, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyCurrentUser, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyUsers, IntPtr.Zero); + } + else + { + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyCurrentUser, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyClassesRoot, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyLocalMachine, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyUsers, IntPtr.Zero); + } + + this.RemoveRemappedKey(); + } + + /// + /// Dispose the RegistryHarvester. + /// + public void Dispose() + { + this.Close(); + } + + /// + /// Harvest all registry roots supported by Windows Installer. + /// + /// The registry keys and values in the registry. + public Wix.RegistryValue[] HarvestRegistry() + { + ArrayList registryValues = new ArrayList(); + + this.HarvestRegistryKey(Registry.ClassesRoot, registryValues); + this.HarvestRegistryKey(Registry.CurrentUser, registryValues); + this.HarvestRegistryKey(Registry.LocalMachine, registryValues); + this.HarvestRegistryKey(Registry.Users, registryValues); + + return (Wix.RegistryValue[])registryValues.ToArray(typeof(Wix.RegistryValue)); + } + + /// + /// Harvest a registry key. + /// + /// The path of the registry key to harvest. + /// The registry keys and values under the key. + public Wix.RegistryValue[] HarvestRegistryKey(string path) + { + RegistryKey registryKey = null; + ArrayList registryValues = new ArrayList(); + + string[] parts = GetPathParts(path); + + try + { + switch (parts[0]) + { + case "HKEY_CLASSES_ROOT": + registryKey = Registry.ClassesRoot; + break; + case "HKEY_CURRENT_USER": + registryKey = Registry.CurrentUser; + break; + case "HKEY_LOCAL_MACHINE": + registryKey = Registry.LocalMachine; + break; + case "HKEY_USERS": + registryKey = Registry.Users; + break; + default: + // TODO: put a better exception here + throw new Exception(); + } + + if (1 < parts.Length) + { + registryKey = registryKey.OpenSubKey(parts[1]); + + if (null == registryKey) + { + throw new WixException(HarvesterErrors.UnableToOpenRegistryKey(parts[1])); + } + } + + this.HarvestRegistryKey(registryKey, registryValues); + } + finally + { + if (null != registryKey) + { + registryKey.Close(); + } + } + + return (Wix.RegistryValue[])registryValues.ToArray(typeof(Wix.RegistryValue)); + } + + /// + /// Gets the parts of a registry key's path. + /// + /// The registry key path. + /// The root and key parts of the registry key path. + private static string[] GetPathParts(string path) + { + return path.Split(@"\".ToCharArray(), 2); + } + + /// + /// Harvest a registry key. + /// + /// The registry key to harvest. + /// The collected registry values. + private void HarvestRegistryKey(RegistryKey registryKey, ArrayList registryValues) + { + // harvest the sub-keys + foreach (string subKeyName in registryKey.GetSubKeyNames()) + { + using (RegistryKey subKey = registryKey.OpenSubKey(subKeyName)) + { + this.HarvestRegistryKey(subKey, registryValues); + } + } + + string[] parts = GetPathParts(registryKey.Name); + + Wix.RegistryRootType root; + switch (parts[0]) + { + case "HKEY_CLASSES_ROOT": + root = Wix.RegistryRootType.HKCR; + break; + case "HKEY_CURRENT_USER": + root = Wix.RegistryRootType.HKCU; + break; + case "HKEY_LOCAL_MACHINE": + // HKLM\Software\Classes is equivalent to HKCR + if (1 < parts.Length && parts[1].StartsWith(HKCRPathInHKLM, StringComparison.OrdinalIgnoreCase)) + { + root = Wix.RegistryRootType.HKCR; + parts[1] = parts[1].Remove(0, HKCRPathInHKLM.Length); + + if (0 < parts[1].Length) + { + parts[1] = parts[1].TrimStart('\\'); + } + + if (String.IsNullOrEmpty(parts[1])) + { + parts = new [] { parts[0] }; + } + } + else + { + root = Wix.RegistryRootType.HKLM; + } + break; + case "HKEY_USERS": + root = Wix.RegistryRootType.HKU; + break; + default: + // TODO: put a better exception here + throw new Exception(); + } + + // harvest the values + foreach (string valueName in registryKey.GetValueNames()) + { + Wix.RegistryValue registryValue = new Wix.RegistryValue(); + + registryValue.Action = Wix.RegistryValue.ActionType.write; + + registryValue.Root = root; + + if (1 < parts.Length) + { + registryValue.Key = parts[1]; + } + + if (null != valueName && 0 < valueName.Length) + { + registryValue.Name = valueName; + } + + object value = registryKey.GetValue(valueName); + + if (value is byte[]) // binary + { + StringBuilder hexadecimalValue = new StringBuilder(); + + // convert the byte array to hexadecimal + foreach (byte byteValue in (byte[])value) + { + hexadecimalValue.Append(byteValue.ToString("X2", CultureInfo.InvariantCulture.NumberFormat)); + } + + registryValue.Type = Wix.RegistryValue.TypeType.binary; + registryValue.Value = hexadecimalValue.ToString(); + } + else if (value is int) // integer + { + registryValue.Type = Wix.RegistryValue.TypeType.integer; + registryValue.Value = ((int)value).ToString(CultureInfo.InvariantCulture); + } + else if (value is string[]) // multi-string + { + registryValue.Type = Wix.RegistryValue.TypeType.multiString; + + if (0 == ((string[])value).Length) + { + Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); + + multiStringValue.Content = String.Empty; + + registryValue.AddChild(multiStringValue); + } + else + { + foreach (string multiStringValueContent in (string[])value) + { + Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); + + multiStringValue.Content = multiStringValueContent; + + registryValue.AddChild(multiStringValue); + } + } + } + else if (value is string) // string, expandable (there is no way to differentiate a string and expandable value in .NET 1.1) + { + registryValue.Type = Wix.RegistryValue.TypeType.@string; + registryValue.Value = (string)value; + } + else + { + // TODO: put a better exception here + throw new Exception(); + } + + registryValues.Add(registryValue); + } + + // If there were no subkeys and no values, we still need an element for this empty registry key. + // But specifically avoid SOFTWARE\Classes because it shouldn't be harvested as an empty key. + if (parts.Length > 1 && registryKey.SubKeyCount == 0 && registryKey.ValueCount == 0 && + !String.Equals(parts[1], HKCRPathInHKLM, StringComparison.OrdinalIgnoreCase)) + { + Wix.RegistryValue emptyRegistryKey = new Wix.RegistryValue(); + emptyRegistryKey.Root = root; + emptyRegistryKey.Key = parts[1]; + emptyRegistryKey.Type = Wix.RegistryValue.TypeType.@string; + emptyRegistryKey.Value = String.Empty; + emptyRegistryKey.Action = Wix.RegistryValue.ActionType.write; + registryValues.Add(emptyRegistryKey); + } + } + + /// + /// Remap a registry key to an alternative location. + /// + /// The registry key to remap. + /// The path to remap the registry key to under HKLM. + private void RemapRegistryKey(IntPtr registryKey, string remappedPath) + { + IntPtr remappedKey = IntPtr.Zero; + + try + { + remappedKey = NativeMethods.OpenRegistryKey(this.regRootToOverride, remappedPath); + + NativeMethods.OverrideRegistryKey(registryKey, remappedKey); + } + finally + { + if (IntPtr.Zero != remappedKey) + { + NativeMethods.CloseRegistryKey(remappedKey); + } + } + } + + /// + /// Remove the remapped registry key. + /// + private void RemoveRemappedKey() + { + try + { + this.regKeyToOverride.DeleteSubKeyTree(this.remappedPath); + } + catch (ArgumentException) + { + // ignore the error where the key does not exist + } + } + + /// + /// The native methods for re-mapping registry keys. + /// + private sealed class NativeMethods + { + internal static readonly IntPtr HkeyClassesRoot = (IntPtr)unchecked((Int32)0x80000000); + internal static readonly IntPtr HkeyCurrentUser = (IntPtr)unchecked((Int32)0x80000001); + internal static readonly IntPtr HkeyLocalMachine = (IntPtr)unchecked((Int32)0x80000002); + internal static readonly IntPtr HkeyUsers = (IntPtr)unchecked((Int32)0x80000003); + + private const uint GenericRead = 0x80000000; + private const uint GenericWrite = 0x40000000; + private const uint GenericExecute = 0x20000000; + private const uint GenericAll = 0x10000000; + private const uint StandardRightsAll = 0x001F0000; + + /// + /// Opens a registry key. + /// + /// Base key to open. + /// Path to subkey to open. + /// Handle to new key. + internal static IntPtr OpenRegistryKey(IntPtr key, string path) + { + IntPtr newKey = IntPtr.Zero; + uint disposition = 0; + uint sam = StandardRightsAll | GenericRead | GenericWrite | GenericExecute | GenericAll; + + if (0 != RegCreateKeyEx(key, path, 0, null, 0, sam, 0, out newKey, out disposition)) + { + throw new Exception(); + } + + return newKey; + } + + /// + /// Closes a previously open registry key. + /// + /// Handle to key to close. + internal static void CloseRegistryKey(IntPtr key) + { + if (0 != RegCloseKey(key)) + { + throw new Exception(); + } + } + + /// + /// Override a registry key. + /// + /// Handle of the key to override. + /// Handle to override key. + internal static void OverrideRegistryKey(IntPtr key, IntPtr newKey) + { + if (0 != RegOverridePredefKey(key, newKey)) + { + throw new Exception(); + } + } + + /// + /// Interop to RegCreateKeyW. + /// + /// Handle to base key. + /// Subkey to create. + /// Always 0 + /// Just pass null. + /// Just pass 0. + /// Rights to registry key. + /// Just pass null. + /// Opened key. + /// Whether key was opened or created. + /// Handle to registry key. + [DllImport("advapi32.dll", EntryPoint = "RegCreateKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static extern int RegCreateKeyEx(IntPtr key, string subkey, uint reserved, string className, uint options, uint desiredSam, uint securityAttributes, out IntPtr openedKey, out uint disposition); + + /// + /// Interop to RegCloseKey. + /// + /// Handle to key to close. + /// 0 if success. + [DllImport("advapi32.dll", EntryPoint = "RegCloseKey", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static extern int RegCloseKey(IntPtr key); + + /// + /// Interop to RegOverridePredefKey. + /// + /// Handle to key to override. + /// Handle to override key. + /// 0 if success. + [DllImport("advapi32.dll", EntryPoint = "RegOverridePredefKey", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static extern int RegOverridePredefKey(IntPtr key, IntPtr newKey); + } + } +} diff --git a/src/heat/Serialize/CodeDomInterfaces.cs b/src/heat/Serialize/CodeDomInterfaces.cs new file mode 100644 index 00000000..bd674db6 --- /dev/null +++ b/src/heat/Serialize/CodeDomInterfaces.cs @@ -0,0 +1,96 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.Collections; + using System.Xml; + + /// + /// Interface for generated schema elements. + /// + public interface ISchemaElement + { + /// + /// Gets and sets the parent of this element. May be null. + /// + /// An ISchemaElement that has this element as a child. + ISchemaElement ParentElement + { + get; + set; + } + + /// + /// Outputs xml representing this element, including the associated attributes + /// and any nested elements. + /// + /// XmlWriter to be used when outputting the element. + void OutputXml(XmlWriter writer); + } + + /// + /// Interface for generated schema elements. Implemented by elements that have child + /// elements. + /// + public interface IParentElement + { + /// + /// Gets an enumerable collection of the children of this element. + /// + /// An enumerable collection of the children of this element. + IEnumerable Children + { + get; + } + + /// + /// Gets an enumerable collection of the children of this element, filtered + /// by the passed in type. + /// + /// The type of children to retrieve. + IEnumerable this[Type childType] + { + get; + } + + /// + /// Adds a child to this element. + /// + /// Child to add. + void AddChild(ISchemaElement child); + + /// + /// Removes a child from this element. + /// + /// Child to remove. + void RemoveChild(ISchemaElement child); + } + + /// + /// Interface for generated schema elements. Implemented by classes with attributes. + /// + public interface ISetAttributes + { + /// + /// Sets the attribute with the given name to the given value. The value here is + /// a string, and is converted to the strongly-typed version inside this method. + /// + /// The name of the attribute to set. + /// The value to assign to the attribute. + void SetAttribute(string name, string value); + } + + /// + /// Interface for generated schema elements. Implemented by classes with children. + /// + public interface ICreateChildren + { + /// + /// Creates an instance of the child with the passed in name. + /// + /// String matching the element name of the child when represented in XML. + /// An instance of that child. + ISchemaElement CreateChild(string childName); + } +} diff --git a/src/heat/Serialize/CodeDomReader.cs b/src/heat/Serialize/CodeDomReader.cs new file mode 100644 index 00000000..0741bf68 --- /dev/null +++ b/src/heat/Serialize/CodeDomReader.cs @@ -0,0 +1,162 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Reflection; + using System.Xml; + using WixToolset.Harvesters.Extensibility.Serialize; + + /// + /// Class used for reading XML files in to the CodeDom. + /// + public class CodeDomReader + { + private Assembly[] assemblies; + + /// + /// Creates a new CodeDomReader, using the current assembly. + /// + public CodeDomReader() + { + this.assemblies = new Assembly[] { Assembly.GetExecutingAssembly() }; + } + + /// + /// Creates a new CodeDomReader, and takes in a list of assemblies in which to + /// look for elements. + /// + /// Assemblies in which to look for types that correspond + /// to elements. + public CodeDomReader(Assembly[] assemblies) + { + this.assemblies = assemblies; + } + + /// + /// Loads an XML file into a strongly-typed code dom. + /// + /// File to load into the code dom. + /// The strongly-typed object at the root of the tree. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + public ISchemaElement Load(string filePath) + { + XmlDocument document = new XmlDocument(); + document.Load(filePath); + ISchemaElement schemaElement = null; + + foreach (XmlNode node in document.ChildNodes) + { + XmlElement element = node as XmlElement; + if (element != null) + { + if (schemaElement != null) + { + throw new InvalidOperationException(WixHarvesterStrings.EXP_MultipleRootElementsFoundInFile); + } + + schemaElement = this.CreateObjectFromElement(element); + this.ParseObjectFromElement(schemaElement, element); + } + } + return schemaElement; + } + + /// + /// Sets an attribute on an ISchemaElement. + /// + /// Schema element to set attribute on. + /// Name of the attribute to set. + /// Value to set on the attribute. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + private static void SetAttributeOnObject(ISchemaElement schemaElement, string name, string value) + { + ISetAttributes setAttributes = schemaElement as ISetAttributes; + if (setAttributes == null) + { + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_ISchemaElementDoesnotImplementISetAttribute, schemaElement.GetType().FullName)); + } + else + { + setAttributes.SetAttribute(name, value); + } + } + + /// + /// Parses an ISchemaElement from the XmlElement. + /// + /// ISchemaElement to fill in. + /// XmlElement to parse from. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + private void ParseObjectFromElement(ISchemaElement schemaElement, XmlElement element) + { + foreach (XmlAttribute attribute in element.Attributes) + { + SetAttributeOnObject(schemaElement, attribute.LocalName, attribute.Value); + } + + foreach (XmlNode node in element.ChildNodes) + { + XmlElement childElement = node as XmlElement; + if (childElement != null) + { + ISchemaElement childSchemaElement = null; + ICreateChildren createChildren = schemaElement as ICreateChildren; + if (createChildren == null) + { + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_ISchemaElementDoesnotImplementICreateChildren, element.LocalName)); + } + else + { + childSchemaElement = createChildren.CreateChild(childElement.LocalName); + } + + if (childSchemaElement == null) + { + childSchemaElement = this.CreateObjectFromElement(childElement); + if (childSchemaElement == null) + { + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_XmlElementDoesnotHaveISchemaElement, childElement.LocalName)); + } + } + + this.ParseObjectFromElement(childSchemaElement, childElement); + IParentElement parentElement = (IParentElement)schemaElement; + parentElement.AddChild(childSchemaElement); + } + else + { + XmlText childText = node as XmlText; + if (childText != null) + { + SetAttributeOnObject(schemaElement, "Content", childText.Value); + } + } + } + } + + /// + /// Creates an object from an XML element by digging through the assembly list. + /// + /// XML Element to create an ISchemaElement from. + /// A constructed ISchemaElement. + private ISchemaElement CreateObjectFromElement(XmlElement element) + { + ISchemaElement schemaElement = null; + foreach (Assembly assembly in this.assemblies) + { + foreach (Type type in assembly.GetTypes()) + { + if (type.FullName.EndsWith(element.LocalName, StringComparison.Ordinal) + && typeof(ISchemaElement).IsAssignableFrom(type)) + { + schemaElement = (ISchemaElement)Activator.CreateInstance(type); + } + } + } + return schemaElement; + } + } +} diff --git a/src/heat/Serialize/ElementCollection.cs b/src/heat/Serialize/ElementCollection.cs new file mode 100644 index 00000000..bacbafbd --- /dev/null +++ b/src/heat/Serialize/ElementCollection.cs @@ -0,0 +1,618 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.Collections; + using System.Globalization; + using WixToolset.Harvesters.Extensibility.Serialize; + + /// + /// Collection used in the CodeDOM for the children of a given element. Provides type-checking + /// on the allowed children to ensure that only allowed types are added. + /// + public class ElementCollection : ICollection, IEnumerable + { + private CollectionType collectionType; + private int totalContainedItems; + private int containersUsed; + private ArrayList items; + + /// + /// Creates a new element collection. + /// + /// Type of the collection to create. + public ElementCollection(CollectionType collectionType) + { + this.collectionType = collectionType; + this.items = new ArrayList(); + } + + /// + /// Enum representing types of XML collections. + /// + public enum CollectionType + { + /// + /// A choice type, corresponding to the XSD choice element. + /// + Choice, + + /// + /// A sequence type, corresponding to the XSD sequence element. + /// + Sequence + } + + /// + /// Gets the type of collection. + /// + /// The type of collection. + public CollectionType Type + { + get { return this.collectionType; } + } + + /// + /// Gets the count of child elements in this collection (counts ISchemaElements, not nested collections). + /// + /// The count of child elements in this collection (counts ISchemaElements, not nested collections). + public int Count + { + get { return this.totalContainedItems; } + } + + /// + /// Gets the flag specifying whether this collection is synchronized. Always returns false. + /// + /// The flag specifying whether this collection is synchronized. Always returns false. + public bool IsSynchronized + { + get { return false; } + } + + /// + /// Gets an object external callers can synchronize on. + /// + /// An object external callers can synchronize on. + public object SyncRoot + { + get { return this; } + } + + /// + /// Adds a child element to this collection. + /// + /// The element to add. + /// Thrown if the child is not of an allowed type. + public void AddElement(ISchemaElement element) + { + foreach (object obj in this.items) + { + bool containerUsed; + + CollectionItem collectionItem = obj as CollectionItem; + if (collectionItem != null) + { + containerUsed = collectionItem.Elements.Count != 0; + if (collectionItem.ElementType.IsAssignableFrom(element.GetType())) + { + collectionItem.AddElement(element); + + if (!containerUsed) + { + this.containersUsed++; + } + + this.totalContainedItems++; + return; + } + + continue; + } + + ElementCollection collection = obj as ElementCollection; + if (collection != null) + { + containerUsed = collection.Count != 0; + + try + { + collection.AddElement(element); + + if (!containerUsed) + { + this.containersUsed++; + } + + this.totalContainedItems++; + return; + } + catch (ArgumentException) + { + // Eat the exception and keep looking. We'll throw our own if we can't find its home. + } + + continue; + } + } + + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementOfTypeIsNotValidForThisCollection, + element.GetType().Name)); + } + + /// + /// Removes a child element from this collection. + /// + /// The element to remove. + /// Thrown if the element is not of an allowed type. + public void RemoveElement(ISchemaElement element) + { + foreach (object obj in this.items) + { + CollectionItem collectionItem = obj as CollectionItem; + if (collectionItem != null) + { + if (collectionItem.ElementType.IsAssignableFrom(element.GetType())) + { + if (collectionItem.Elements.Count == 0) + { + return; + } + + collectionItem.RemoveElement(element); + + if (collectionItem.Elements.Count == 0) + { + this.containersUsed--; + } + + this.totalContainedItems--; + return; + } + + continue; + } + + ElementCollection collection = obj as ElementCollection; + if (collection != null) + { + if (collection.Count == 0) + { + continue; + } + + try + { + collection.RemoveElement(element); + + if (collection.Count == 0) + { + this.containersUsed--; + } + + this.totalContainedItems--; + return; + } + catch (ArgumentException) + { + // Eat the exception and keep looking. We'll throw our own if we can't find its home. + } + + continue; + } + } + + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementOfTypeIsNotValidForThisCollection, + element.GetType().Name)); + } + + /// + /// Copies this collection to an array. + /// + /// Array to copy to. + /// Offset into the array. + public void CopyTo(Array array, int index) + { + int item = 0; + foreach (ISchemaElement element in this) + { + array.SetValue(element, (long)(item + index)); + item++; + } + } + + /// + /// Creates an enumerator for walking the elements in this collection. + /// + /// A newly created enumerator. + public IEnumerator GetEnumerator() + { + return new ElementCollectionEnumerator(this); + } + + /// + /// Gets an enumerable collection of children of a given type. + /// + /// Type of children to get. + /// A collection of children. + /// Thrown if the type isn't a valid child type. + public IEnumerable Filter(Type childType) + { + foreach (object container in this.items) + { + CollectionItem collectionItem = container as CollectionItem; + if (collectionItem != null) + { + if (collectionItem.ElementType.IsAssignableFrom(childType)) + { + return collectionItem.Elements; + } + + continue; + } + + ElementCollection elementCollection = container as ElementCollection; + if (elementCollection != null) + { + IEnumerable nestedFilter = elementCollection.Filter(childType); + if (nestedFilter != null) + { + return nestedFilter; + } + + continue; + } + } + + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_TypeIsNotValidForThisCollection, + childType.Name)); + } + + /// + /// Adds a type to this collection. + /// + /// CollectionItem representing the type to add. + public void AddItem(CollectionItem collectionItem) + { + this.items.Add(collectionItem); + } + + /// + /// Adds a nested collection to this collection. + /// + /// ElementCollection to add. + public void AddCollection(ElementCollection collection) + { + this.items.Add(collection); + } + + /// + /// Class used to represent a given type in the child collection of an element. Abstract, + /// has subclasses for choice and sequence (which can do cardinality checks). + /// + public abstract class CollectionItem + { + private Type elementType; + private ArrayList elements; + + /// + /// Creates a new CollectionItem for the given element type. + /// + /// Type of the element for this collection item. + protected CollectionItem(Type elementType) + { + this.elementType = elementType; + this.elements = new ArrayList(); + } + + /// + /// Gets the type of this collection's items. + /// + /// The type of this collection's items. + public Type ElementType + { + get { return this.elementType; } + } + + /// + /// Gets the elements of this collection. + /// + /// The elements of this collection. + public ArrayList Elements + { + get { return this.elements; } + } + + /// + /// Adds an element to this collection. Must be of an assignable type to the collection's + /// type. + /// + /// The element to add. + /// Thrown if the type isn't assignable to the collection's type. + public void AddElement(ISchemaElement element) + { + if (!this.elementType.IsAssignableFrom(element.GetType())) + { + throw new ArgumentException( + String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementIsSubclassOfDifferentType, + this.elementType.Name, + element.GetType().Name), + "element"); + } + + this.elements.Add(element); + } + + /// + /// Removes an element from this collection. + /// + /// The element to remove. + /// Thrown if the element's type isn't assignable to the collection's type. + public void RemoveElement(ISchemaElement element) + { + if (!this.elementType.IsAssignableFrom(element.GetType())) + { + throw new ArgumentException( + String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementIsSubclassOfDifferentType, + this.elementType.Name, + element.GetType().Name), + "element"); + } + + this.elements.Remove(element); + } + } + + /// + /// Class representing a choice item. Doesn't do cardinality checks. + /// + public class ChoiceItem : CollectionItem + { + /// + /// Creates a new choice item. + /// + /// Type of the created item. + public ChoiceItem(Type elementType) + : base(elementType) + { + } + } + + /// + /// Class representing a sequence item. Can do cardinality checks, if required. + /// + public class SequenceItem : CollectionItem + { + /// + /// Creates a new sequence item. + /// + /// Type of the created item. + public SequenceItem(Type elementType) + : base(elementType) + { + } + } + + /// + /// Enumerator for the ElementCollection. + /// + private class ElementCollectionEnumerator : IEnumerator + { + private ElementCollection collection; + private Stack collectionStack; + + /// + /// Creates a new ElementCollectionEnumerator. + /// + /// The collection to create an enumerator for. + public ElementCollectionEnumerator(ElementCollection collection) + { + this.collection = collection; + } + + /// + /// Gets the current object from the enumerator. + /// + public object Current + { + get + { + if (this.collectionStack != null && this.collectionStack.Count > 0) + { + CollectionSymbol symbol = (CollectionSymbol)this.collectionStack.Peek(); + object container = symbol.Collection.items[symbol.ContainerIndex]; + + CollectionItem collectionItem = container as CollectionItem; + if (collectionItem != null) + { + return collectionItem.Elements[symbol.ItemIndex]; + } + + throw new InvalidOperationException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementMustBeChoiceItemOrSequenceItem, + container.GetType().Name)); + } + + return null; + } + } + + /// + /// Resets the enumerator to the beginning. + /// + public void Reset() + { + if (this.collectionStack != null) + { + this.collectionStack.Clear(); + this.collectionStack = null; + } + } + + /// + /// Moves the enumerator to the next item. + /// + /// True if there is a next item, false otherwise. + public bool MoveNext() + { + if (this.collectionStack == null) + { + if (this.collection.Count == 0) + { + return false; + } + + this.collectionStack = new Stack(); + this.collectionStack.Push(new CollectionSymbol(this.collection)); + } + + CollectionSymbol symbol = (CollectionSymbol)this.collectionStack.Peek(); + + if (this.FindNext(symbol)) + { + return true; + } + + this.collectionStack.Pop(); + if (this.collectionStack.Count == 0) + { + return false; + } + + return this.MoveNext(); + } + + /// + /// Pushes a collection onto the stack. + /// + /// The collection to push. + private void PushCollection(ElementCollection elementCollection) + { + if (elementCollection.Count <= 0) + { + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_CollectionMustHaveAtLeastOneElement, + elementCollection.Count)); + } + + CollectionSymbol symbol = new CollectionSymbol(elementCollection); + this.collectionStack.Push(symbol); + this.FindNext(symbol); + } + + /// + /// Finds the next item from a given symbol. + /// + /// The symbol to start looking from. + /// True if a next element is found, false otherwise. + private bool FindNext(CollectionSymbol symbol) + { + object container = symbol.Collection.items[symbol.ContainerIndex]; + + CollectionItem collectionItem = container as CollectionItem; + if (collectionItem != null) + { + if (symbol.ItemIndex + 1 < collectionItem.Elements.Count) + { + symbol.ItemIndex++; + return true; + } + } + + ElementCollection elementCollection = container as ElementCollection; + if (elementCollection != null && elementCollection.Count > 0 && symbol.ItemIndex == -1) + { + symbol.ItemIndex++; + this.PushCollection(elementCollection); + return true; + } + + symbol.ItemIndex = 0; + + for (int i = symbol.ContainerIndex + 1; i < symbol.Collection.items.Count; ++i) + { + object nestedContainer = symbol.Collection.items[i]; + + CollectionItem nestedCollectionItem = nestedContainer as CollectionItem; + if (nestedCollectionItem != null) + { + if (nestedCollectionItem.Elements.Count > 0) + { + symbol.ContainerIndex = i; + return true; + } + } + + ElementCollection nestedElementCollection = nestedContainer as ElementCollection; + if (nestedElementCollection != null && nestedElementCollection.Count > 0) + { + symbol.ContainerIndex = i; + this.PushCollection(nestedElementCollection); + return true; + } + } + + return false; + } + + /// + /// Class representing a single point in the collection. Consists of an ElementCollection, + /// a container index, and an index into the container. + /// + private class CollectionSymbol + { + private ElementCollection collection; + private int containerIndex; + private int itemIndex = -1; + + /// + /// Creates a new CollectionSymbol. + /// + /// The collection for the symbol. + public CollectionSymbol(ElementCollection collection) + { + this.collection = collection; + } + + /// + /// Gets the collection for the symbol. + /// + public ElementCollection Collection + { + get { return this.collection; } + } + + /// + /// Gets and sets the index of the container in the collection. + /// + public int ContainerIndex + { + get { return this.containerIndex; } + set { this.containerIndex = value; } + } + + /// + /// Gets and sets the index of the item in the container. + /// + public int ItemIndex + { + get { return this.itemIndex; } + set { this.itemIndex = value; } + } + } + } + } +} diff --git a/src/heat/Serialize/WixHarvesterStrings.Designer.cs b/src/heat/Serialize/WixHarvesterStrings.Designer.cs new file mode 100644 index 00000000..6504a67b --- /dev/null +++ b/src/heat/Serialize/WixHarvesterStrings.Designer.cs @@ -0,0 +1,153 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WixToolset.Harvesters.Extensibility.Serialize { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class WixHarvesterStrings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal WixHarvesterStrings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WixToolset.Harvesters.Extensibility.Serialize.WixHarvesterStrings", typeof(WixHarvesterStrings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Collection has {0} elements. Must have at least one.. + /// + internal static string EXP_CollectionMustHaveAtLeastOneElement { + get { + return ResourceManager.GetString("EXP_CollectionMustHaveAtLeastOneElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element must be a subclass of {0}, but was of type {1}.. + /// + internal static string EXP_ElementIsSubclassOfDifferentType { + get { + return ResourceManager.GetString("EXP_ElementIsSubclassOfDifferentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element of type {0} found in enumerator. Must be ChoiceItem or SequenceItem.. + /// + internal static string EXP_ElementMustBeChoiceItemOrSequenceItem { + get { + return ResourceManager.GetString("EXP_ElementMustBeChoiceItemOrSequenceItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element of type {0} is not valid for this collection.. + /// + internal static string EXP_ElementOfTypeIsNotValidForThisCollection { + get { + return ResourceManager.GetString("EXP_ElementOfTypeIsNotValidForThisCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ISchemaElement with name {0} does not implement ICreateChildren.. + /// + internal static string EXP_ISchemaElementDoesnotImplementICreateChildren { + get { + return ResourceManager.GetString("EXP_ISchemaElementDoesnotImplementICreateChildren", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ISchemaElement with name {0} does not implement ISetAttributes.. + /// + internal static string EXP_ISchemaElementDoesnotImplementISetAttribute { + get { + return ResourceManager.GetString("EXP_ISchemaElementDoesnotImplementISetAttribute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A Merge table FileCompression column contains an invalid value '{0}'.. + /// + internal static string EXP_MergeTableFileCompressionColumnContainsInvalidValue { + get { + return ResourceManager.GetString("EXP_MergeTableFileCompressionColumnContainsInvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple root elements found in file.. + /// + internal static string EXP_MultipleRootElementsFoundInFile { + get { + return ResourceManager.GetString("EXP_MultipleRootElementsFoundInFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type {0} is not valid for this collection.. + /// + internal static string EXP_TypeIsNotValidForThisCollection { + get { + return ResourceManager.GetString("EXP_TypeIsNotValidForThisCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to XmlElement with name {0} does not have a corresponding ISchemaElement.. + /// + internal static string EXP_XmlElementDoesnotHaveISchemaElement { + get { + return ResourceManager.GetString("EXP_XmlElementDoesnotHaveISchemaElement", resourceCulture); + } + } + } +} diff --git a/src/heat/Serialize/WixHarvesterStrings.resx b/src/heat/Serialize/WixHarvesterStrings.resx new file mode 100644 index 00000000..5894a190 --- /dev/null +++ b/src/heat/Serialize/WixHarvesterStrings.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + A Merge table FileCompression column contains an invalid value '{0}'. + + + Multiple root elements found in file. + + + ISchemaElement with name {0} does not implement ICreateChildren. + + + ISchemaElement with name {0} does not implement ISetAttributes. + + + XmlElement with name {0} does not have a corresponding ISchemaElement. + + + Element of type {0} is not valid for this collection. + + + Type {0} is not valid for this collection. + + + Collection has {0} elements. Must have at least one. + + + Element must be a subclass of {0}, but was of type {1}. + + + Element of type {0} found in enumerator. Must be ChoiceItem or SequenceItem. + + \ No newline at end of file diff --git a/src/heat/Serialize/iis.cs b/src/heat/Serialize/iis.cs new file mode 100644 index 00000000..3f2943f8 --- /dev/null +++ b/src/heat/Serialize/iis.cs @@ -0,0 +1,5915 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 +namespace WixToolset.Harvesters.Serialize.IIs +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + using WixToolset.Harvesters.Serialize; + + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a YesNoDefaultType from a string. + /// + public static YesNoDefaultType ParseYesNoDefaultType(string value) + { + YesNoDefaultType parsedValue; + Enums.TryParseYesNoDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoDefaultType from a string. + /// + public static bool TryParseYesNoDefaultType(string value, out YesNoDefaultType parsedValue) + { + parsedValue = YesNoDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("default" == value)) + { + parsedValue = YesNoDefaultType.@default; + } + else + { + if (("no" == value)) + { + parsedValue = YesNoDefaultType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoDefaultType.yes; + } + else + { + parsedValue = YesNoDefaultType.IllegalValue; + return false; + } + } + } + return true; + } + } + + /// + /// Values of this type will either be "default", "yes", or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + @default, + + no, + + yes, + } + + /// + /// WebDirProperties used by one or more WebSites. Lists properties common to IIS web sites and vroots. Corresponding properties can be viewed through the IIS Manager snap-in. One property entry can be reused by multiple sites or vroots using the Id field as a reference, using WebVirtualDir.DirProperties, WebSite.DirProperties, or WebDir.DirProperties. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebDirProperties : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType writeField; + + private bool writeFieldSet; + + private YesNoType scriptField; + + private bool scriptFieldSet; + + private YesNoType executeField; + + private bool executeFieldSet; + + private YesNoType anonymousAccessField; + + private bool anonymousAccessFieldSet; + + private string anonymousUserField; + + private bool anonymousUserFieldSet; + + private YesNoType iIsControlledPasswordField; + + private bool iIsControlledPasswordFieldSet; + + private YesNoType windowsAuthenticationField; + + private bool windowsAuthenticationFieldSet; + + private YesNoType digestAuthenticationField; + + private bool digestAuthenticationFieldSet; + + private YesNoType basicAuthenticationField; + + private bool basicAuthenticationFieldSet; + + private YesNoType passportAuthenticationField; + + private bool passportAuthenticationFieldSet; + + private YesNoType logVisitsField; + + private bool logVisitsFieldSet; + + private YesNoType indexField; + + private bool indexFieldSet; + + private string defaultDocumentsField; + + private bool defaultDocumentsFieldSet; + + private YesNoType aspDetailedErrorField; + + private bool aspDetailedErrorFieldSet; + + private string httpExpiresField; + + private bool httpExpiresFieldSet; + + private long cacheControlMaxAgeField; + + private bool cacheControlMaxAgeFieldSet; + + private string cacheControlCustomField; + + private bool cacheControlCustomFieldSet; + + private YesNoType clearCustomErrorField; + + private bool clearCustomErrorFieldSet; + + private YesNoType accessSSLField; + + private bool accessSSLFieldSet; + + private YesNoType accessSSL128Field; + + private bool accessSSL128FieldSet; + + private YesNoType accessSSLMapCertField; + + private bool accessSSLMapCertFieldSet; + + private YesNoType accessSSLNegotiateCertField; + + private bool accessSSLNegotiateCertFieldSet; + + private YesNoType accessSSLRequireCertField; + + private bool accessSSLRequireCertFieldSet; + + private string authenticationProvidersField; + + private bool authenticationProvidersFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Write + { + get + { + return this.writeField; + } + set + { + this.writeFieldSet = true; + this.writeField = value; + } + } + + public YesNoType Script + { + get + { + return this.scriptField; + } + set + { + this.scriptFieldSet = true; + this.scriptField = value; + } + } + + public YesNoType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + /// + /// Sets the Enable Anonymous Access checkbox, which maps anonymous users to a Windows user account. When setting this to 'yes' you should also provide the user account using the AnonymousUser attribute, and determine what setting to use for the IIsControlledPassword attribute. Defaults to 'no.' + /// + public YesNoType AnonymousAccess + { + get + { + return this.anonymousAccessField; + } + set + { + this.anonymousAccessFieldSet = true; + this.anonymousAccessField = value; + } + } + + /// + /// Reference to the Id attribute on the User element to be used as the anonymous user for the directory. See the User element for more information. + /// + public string AnonymousUser + { + get + { + return this.anonymousUserField; + } + set + { + this.anonymousUserFieldSet = true; + this.anonymousUserField = value; + } + } + + /// + /// Sets whether IIS should control the password used for the Windows account specified in the AnonymousUser attribute. Defaults to 'no.' + /// + public YesNoType IIsControlledPassword + { + get + { + return this.iIsControlledPasswordField; + } + set + { + this.iIsControlledPasswordFieldSet = true; + this.iIsControlledPasswordField = value; + } + } + + /// + /// Sets the Windows Authentication option, which enables integrated Windows authentication to be used on the site. Defaults to 'no.' + /// + public YesNoType WindowsAuthentication + { + get + { + return this.windowsAuthenticationField; + } + set + { + this.windowsAuthenticationFieldSet = true; + this.windowsAuthenticationField = value; + } + } + + /// + /// Sets the Digest Authentication option, which allows using digest authentication with domain user accounts. Defaults to 'no.' + /// + public YesNoType DigestAuthentication + { + get + { + return this.digestAuthenticationField; + } + set + { + this.digestAuthenticationFieldSet = true; + this.digestAuthenticationField = value; + } + } + + /// + /// Sets the Basic Authentication option, which allows clients to provide credentials in plaintext over the wire. Defaults to 'no.' + /// + public YesNoType BasicAuthentication + { + get + { + return this.basicAuthenticationField; + } + set + { + this.basicAuthenticationFieldSet = true; + this.basicAuthenticationField = value; + } + } + + /// + /// Sets the Passport Authentication option, which allows clients to provide credentials via a .Net Passport account. Defaults to 'no.' + /// + public YesNoType PassportAuthentication + { + get + { + return this.passportAuthenticationField; + } + set + { + this.passportAuthenticationFieldSet = true; + this.passportAuthenticationField = value; + } + } + + /// + /// Sets whether visits to this site should be logged. Defaults to 'no.' + /// + public YesNoType LogVisits + { + get + { + return this.logVisitsField; + } + set + { + this.logVisitsFieldSet = true; + this.logVisitsField = value; + } + } + + /// + /// Sets the Index Resource option, which specifies whether this web directory should be indexed. Defaults to 'no.' + /// + public YesNoType Index + { + get + { + return this.indexField; + } + set + { + this.indexFieldSet = true; + this.indexField = value; + } + } + + /// + /// The list of default documents to set for this web directory, in comma-delimited format. + /// + public string DefaultDocuments + { + get + { + return this.defaultDocumentsField; + } + set + { + this.defaultDocumentsFieldSet = true; + this.defaultDocumentsField = value; + } + } + + /// + /// Sets the option for whether to send detailed ASP errors back to the client on script error. Default is 'no.' + /// + public YesNoType AspDetailedError + { + get + { + return this.aspDetailedErrorField; + } + set + { + this.aspDetailedErrorFieldSet = true; + this.aspDetailedErrorField = value; + } + } + + /// + /// Value to set the HttpExpires attribute to for a Web Dir in the metabase. + /// + public string HttpExpires + { + get + { + return this.httpExpiresField; + } + set + { + this.httpExpiresFieldSet = true; + this.httpExpiresField = value; + } + } + + /// + /// Integer value specifying the cache control maximum age value. + /// + public long CacheControlMaxAge + { + get + { + return this.cacheControlMaxAgeField; + } + set + { + this.cacheControlMaxAgeFieldSet = true; + this.cacheControlMaxAgeField = value; + } + } + + /// + /// Custom HTTP 1.1 cache control directives. + /// + public string CacheControlCustom + { + get + { + return this.cacheControlCustomField; + } + set + { + this.cacheControlCustomFieldSet = true; + this.cacheControlCustomField = value; + } + } + + /// + /// Specifies whether IIs will return custom errors for this directory. + /// + public YesNoType ClearCustomError + { + get + { + return this.clearCustomErrorField; + } + set + { + this.clearCustomErrorFieldSet = true; + this.clearCustomErrorField = value; + } + } + + /// + /// A value of true indicates that file access requires SSL file permission processing, with or without a client certificate. This corresponds to AccessSSL flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSL + { + get + { + return this.accessSSLField; + } + set + { + this.accessSSLFieldSet = true; + this.accessSSLField = value; + } + } + + /// + /// A value of true indicates that file access requires SSL file permission processing with a minimum key size of 128 bits, with or without a client certificate. This corresponds to AccessSSL128 flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSL128 + { + get + { + return this.accessSSL128Field; + } + set + { + this.accessSSL128FieldSet = true; + this.accessSSL128Field = value; + } + } + + /// + /// This corresponds to AccessSSLMapCert flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSLMapCert + { + get + { + return this.accessSSLMapCertField; + } + set + { + this.accessSSLMapCertFieldSet = true; + this.accessSSLMapCertField = value; + } + } + + /// + /// This corresponds to AccessSSLNegotiateCert flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSLNegotiateCert + { + get + { + return this.accessSSLNegotiateCertField; + } + set + { + this.accessSSLNegotiateCertFieldSet = true; + this.accessSSLNegotiateCertField = value; + } + } + + /// + /// This corresponds to AccessSSLRequireCert flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSLRequireCert + { + get + { + return this.accessSSLRequireCertField; + } + set + { + this.accessSSLRequireCertFieldSet = true; + this.accessSSLRequireCertField = value; + } + } + + /// + /// Comma delimited list, in order of precedence, of Windows authentication providers that IIS will attempt to use: NTLM, Kerberos, Negotiate, and others. + /// + public string AuthenticationProviders + { + get + { + return this.authenticationProvidersField; + } + set + { + this.authenticationProvidersFieldSet = true; + this.authenticationProvidersField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebDirProperties", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.writeFieldSet) + { + if ((this.writeField == YesNoType.no)) + { + writer.WriteAttributeString("Write", "no"); + } + if ((this.writeField == YesNoType.yes)) + { + writer.WriteAttributeString("Write", "yes"); + } + } + if (this.scriptFieldSet) + { + if ((this.scriptField == YesNoType.no)) + { + writer.WriteAttributeString("Script", "no"); + } + if ((this.scriptField == YesNoType.yes)) + { + writer.WriteAttributeString("Script", "yes"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == YesNoType.no)) + { + writer.WriteAttributeString("Execute", "no"); + } + if ((this.executeField == YesNoType.yes)) + { + writer.WriteAttributeString("Execute", "yes"); + } + } + if (this.anonymousAccessFieldSet) + { + if ((this.anonymousAccessField == YesNoType.no)) + { + writer.WriteAttributeString("AnonymousAccess", "no"); + } + if ((this.anonymousAccessField == YesNoType.yes)) + { + writer.WriteAttributeString("AnonymousAccess", "yes"); + } + } + if (this.anonymousUserFieldSet) + { + writer.WriteAttributeString("AnonymousUser", this.anonymousUserField); + } + if (this.iIsControlledPasswordFieldSet) + { + if ((this.iIsControlledPasswordField == YesNoType.no)) + { + writer.WriteAttributeString("IIsControlledPassword", "no"); + } + if ((this.iIsControlledPasswordField == YesNoType.yes)) + { + writer.WriteAttributeString("IIsControlledPassword", "yes"); + } + } + if (this.windowsAuthenticationFieldSet) + { + if ((this.windowsAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("WindowsAuthentication", "no"); + } + if ((this.windowsAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("WindowsAuthentication", "yes"); + } + } + if (this.digestAuthenticationFieldSet) + { + if ((this.digestAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("DigestAuthentication", "no"); + } + if ((this.digestAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("DigestAuthentication", "yes"); + } + } + if (this.basicAuthenticationFieldSet) + { + if ((this.basicAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("BasicAuthentication", "no"); + } + if ((this.basicAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("BasicAuthentication", "yes"); + } + } + if (this.passportAuthenticationFieldSet) + { + if ((this.passportAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("PassportAuthentication", "no"); + } + if ((this.passportAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("PassportAuthentication", "yes"); + } + } + if (this.logVisitsFieldSet) + { + if ((this.logVisitsField == YesNoType.no)) + { + writer.WriteAttributeString("LogVisits", "no"); + } + if ((this.logVisitsField == YesNoType.yes)) + { + writer.WriteAttributeString("LogVisits", "yes"); + } + } + if (this.indexFieldSet) + { + if ((this.indexField == YesNoType.no)) + { + writer.WriteAttributeString("Index", "no"); + } + if ((this.indexField == YesNoType.yes)) + { + writer.WriteAttributeString("Index", "yes"); + } + } + if (this.defaultDocumentsFieldSet) + { + writer.WriteAttributeString("DefaultDocuments", this.defaultDocumentsField); + } + if (this.aspDetailedErrorFieldSet) + { + if ((this.aspDetailedErrorField == YesNoType.no)) + { + writer.WriteAttributeString("AspDetailedError", "no"); + } + if ((this.aspDetailedErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("AspDetailedError", "yes"); + } + } + if (this.httpExpiresFieldSet) + { + writer.WriteAttributeString("HttpExpires", this.httpExpiresField); + } + if (this.cacheControlMaxAgeFieldSet) + { + writer.WriteAttributeString("CacheControlMaxAge", this.cacheControlMaxAgeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.cacheControlCustomFieldSet) + { + writer.WriteAttributeString("CacheControlCustom", this.cacheControlCustomField); + } + if (this.clearCustomErrorFieldSet) + { + if ((this.clearCustomErrorField == YesNoType.no)) + { + writer.WriteAttributeString("ClearCustomError", "no"); + } + if ((this.clearCustomErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("ClearCustomError", "yes"); + } + } + if (this.accessSSLFieldSet) + { + if ((this.accessSSLField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSL", "no"); + } + if ((this.accessSSLField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSL", "yes"); + } + } + if (this.accessSSL128FieldSet) + { + if ((this.accessSSL128Field == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSL128", "no"); + } + if ((this.accessSSL128Field == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSL128", "yes"); + } + } + if (this.accessSSLMapCertFieldSet) + { + if ((this.accessSSLMapCertField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSLMapCert", "no"); + } + if ((this.accessSSLMapCertField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSLMapCert", "yes"); + } + } + if (this.accessSSLNegotiateCertFieldSet) + { + if ((this.accessSSLNegotiateCertField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSLNegotiateCert", "no"); + } + if ((this.accessSSLNegotiateCertField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSLNegotiateCert", "yes"); + } + } + if (this.accessSSLRequireCertFieldSet) + { + if ((this.accessSSLRequireCertField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSLRequireCert", "no"); + } + if ((this.accessSSLRequireCertField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSLRequireCert", "yes"); + } + } + if (this.authenticationProvidersFieldSet) + { + writer.WriteAttributeString("AuthenticationProviders", this.authenticationProvidersField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Write" == name)) + { + this.writeField = Enums.ParseYesNoType(value); + this.writeFieldSet = true; + } + if (("Script" == name)) + { + this.scriptField = Enums.ParseYesNoType(value); + this.scriptFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = Enums.ParseYesNoType(value); + this.executeFieldSet = true; + } + if (("AnonymousAccess" == name)) + { + this.anonymousAccessField = Enums.ParseYesNoType(value); + this.anonymousAccessFieldSet = true; + } + if (("AnonymousUser" == name)) + { + this.anonymousUserField = value; + this.anonymousUserFieldSet = true; + } + if (("IIsControlledPassword" == name)) + { + this.iIsControlledPasswordField = Enums.ParseYesNoType(value); + this.iIsControlledPasswordFieldSet = true; + } + if (("WindowsAuthentication" == name)) + { + this.windowsAuthenticationField = Enums.ParseYesNoType(value); + this.windowsAuthenticationFieldSet = true; + } + if (("DigestAuthentication" == name)) + { + this.digestAuthenticationField = Enums.ParseYesNoType(value); + this.digestAuthenticationFieldSet = true; + } + if (("BasicAuthentication" == name)) + { + this.basicAuthenticationField = Enums.ParseYesNoType(value); + this.basicAuthenticationFieldSet = true; + } + if (("PassportAuthentication" == name)) + { + this.passportAuthenticationField = Enums.ParseYesNoType(value); + this.passportAuthenticationFieldSet = true; + } + if (("LogVisits" == name)) + { + this.logVisitsField = Enums.ParseYesNoType(value); + this.logVisitsFieldSet = true; + } + if (("Index" == name)) + { + this.indexField = Enums.ParseYesNoType(value); + this.indexFieldSet = true; + } + if (("DefaultDocuments" == name)) + { + this.defaultDocumentsField = value; + this.defaultDocumentsFieldSet = true; + } + if (("AspDetailedError" == name)) + { + this.aspDetailedErrorField = Enums.ParseYesNoType(value); + this.aspDetailedErrorFieldSet = true; + } + if (("HttpExpires" == name)) + { + this.httpExpiresField = value; + this.httpExpiresFieldSet = true; + } + if (("CacheControlMaxAge" == name)) + { + this.cacheControlMaxAgeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.cacheControlMaxAgeFieldSet = true; + } + if (("CacheControlCustom" == name)) + { + this.cacheControlCustomField = value; + this.cacheControlCustomFieldSet = true; + } + if (("ClearCustomError" == name)) + { + this.clearCustomErrorField = Enums.ParseYesNoType(value); + this.clearCustomErrorFieldSet = true; + } + if (("AccessSSL" == name)) + { + this.accessSSLField = Enums.ParseYesNoType(value); + this.accessSSLFieldSet = true; + } + if (("AccessSSL128" == name)) + { + this.accessSSL128Field = Enums.ParseYesNoType(value); + this.accessSSL128FieldSet = true; + } + if (("AccessSSLMapCert" == name)) + { + this.accessSSLMapCertField = Enums.ParseYesNoType(value); + this.accessSSLMapCertFieldSet = true; + } + if (("AccessSSLNegotiateCert" == name)) + { + this.accessSSLNegotiateCertField = Enums.ParseYesNoType(value); + this.accessSSLNegotiateCertFieldSet = true; + } + if (("AccessSSLRequireCert" == name)) + { + this.accessSSLRequireCertField = Enums.ParseYesNoType(value); + this.accessSSLRequireCertFieldSet = true; + } + if (("AuthenticationProviders" == name)) + { + this.authenticationProvidersField = value; + this.authenticationProvidersFieldSet = true; + } + } + } + + /// + /// Custom Web Errors used by WebSites and Virtual Directories. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebError : ISchemaElement, ISetAttributes + { + + private int errorCodeField; + + private bool errorCodeFieldSet; + + private int subCodeField; + + private bool subCodeFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string uRLField; + + private bool uRLFieldSet; + + private ISchemaElement parentElement; + + /// + /// HTTP 1.1 error code. + /// + public int ErrorCode + { + get + { + return this.errorCodeField; + } + set + { + this.errorCodeFieldSet = true; + this.errorCodeField = value; + } + } + + /// + /// Error sub code. Set to 0 to get the wild card "*". + /// + public int SubCode + { + get + { + return this.subCodeField; + } + set + { + this.subCodeFieldSet = true; + this.subCodeField = value; + } + } + + /// + /// File to be sent to the client for this error code and sub code. This can be formatted. For example: [#FileId]. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// URL to be sent to the client for this error code and sub code. This can be formatted. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string URL + { + get + { + return this.uRLField; + } + set + { + this.uRLFieldSet = true; + this.uRLField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebError", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.errorCodeFieldSet) + { + writer.WriteAttributeString("ErrorCode", this.errorCodeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.subCodeFieldSet) + { + writer.WriteAttributeString("SubCode", this.subCodeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.uRLFieldSet) + { + writer.WriteAttributeString("URL", this.uRLField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ErrorCode" == name)) + { + this.errorCodeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.errorCodeFieldSet = true; + } + if (("SubCode" == name)) + { + this.subCodeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.subCodeFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("URL" == name)) + { + this.uRLField = value; + this.uRLFieldSet = true; + } + } + } + + /// + /// Custom HTTP Header definition for IIS resources such as WebSite and WebVirtualDir. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HttpHeader : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key for custom HTTP Header entry. This will default to the Name attribute. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the custom HTTP Header. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Value for the custom HTTP Header. This attribute can contain a formatted string that is processed at install time to insert the values of properties using [PropertyName] syntax. Also supported are environment variables, file installation paths, and component installation directories; see + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HttpHeader", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// MimeMap definition for IIS resources. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class MimeMap : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string typeField; + + private bool typeFieldSet; + + private string extensionField; + + private bool extensionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id for the MimeMap. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Mime-type covered by the MimeMap. + /// + public string Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Extension covered by the MimeMap. Must begin with a dot. + /// + public string Extension + { + get + { + return this.extensionField; + } + set + { + this.extensionFieldSet = true; + this.extensionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MimeMap", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.typeFieldSet) + { + writer.WriteAttributeString("Type", this.typeField); + } + if (this.extensionFieldSet) + { + writer.WriteAttributeString("Extension", this.extensionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = value; + this.typeFieldSet = true; + } + if (("Extension" == name)) + { + this.extensionField = value; + this.extensionFieldSet = true; + } + } + } + + /// + /// IIs Filter for a Component + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebFilter : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private string webSiteField; + + private bool webSiteFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private int flagsField; + + private bool flagsFieldSet; + + private string loadOrderField; + + private bool loadOrderFieldSet; + + private ISchemaElement parentElement; + + /// + /// The unique Id for the web filter. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The name of the filter to be used in IIS. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The path of the filter executable file. + /// This should usually be a value like '[!FileId]', where 'FileId' is the file identifier + /// of the filter executable file. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Specifies the parent website for this filter (if there is one). + /// If this is a global filter, then this attribute should not be specified. + /// + public string WebSite + { + get + { + return this.webSiteField; + } + set + { + this.webSiteFieldSet = true; + this.webSiteField = value; + } + } + + /// + /// Description of the filter. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Sets the MD_FILTER_FLAGS metabase key for the filter. This must be an integer. See MSDN 'FilterFlags' documentation for more details. + /// + public int Flags + { + get + { + return this.flagsField; + } + set + { + this.flagsFieldSet = true; + this.flagsField = value; + } + } + + /// + /// The legal values are "first", "last", or a number. + /// If a number is specified, it must be greater than 0. + /// + public string LoadOrder + { + get + { + return this.loadOrderField; + } + set + { + this.loadOrderFieldSet = true; + this.loadOrderField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebFilter", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.webSiteFieldSet) + { + writer.WriteAttributeString("WebSite", this.webSiteField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.flagsFieldSet) + { + writer.WriteAttributeString("Flags", this.flagsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.loadOrderFieldSet) + { + writer.WriteAttributeString("LoadOrder", this.loadOrderField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("WebSite" == name)) + { + this.webSiteField = value; + this.webSiteFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Flags" == name)) + { + this.flagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.flagsFieldSet = true; + } + if (("LoadOrder" == name)) + { + this.loadOrderField = value; + this.loadOrderFieldSet = true; + } + } + } + + /// + /// Extension for WebApplication + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebApplicationExtension : ISchemaElement, ISetAttributes + { + + private string executableField; + + private bool executableFieldSet; + + private string extensionField; + + private bool extensionFieldSet; + + private string verbsField; + + private bool verbsFieldSet; + + private YesNoType scriptField; + + private bool scriptFieldSet; + + private YesNoType checkPathField; + + private bool checkPathFieldSet; + + private ISchemaElement parentElement; + + /// + /// usually a Property that resolves to short file name path + /// + public string Executable + { + get + { + return this.executableField; + } + set + { + this.executableFieldSet = true; + this.executableField = value; + } + } + + /// + /// Extension being registered. Do not prefix with a '.' (e.g. you should use "html", not ".html"). To register for all extensions, use Extension="*". To register a wildcard application map (which handles all requests, even those for directories or files with no extension) omit the Extension attribute completely. + /// + public string Extension + { + get + { + return this.extensionField; + } + set + { + this.extensionFieldSet = true; + this.extensionField = value; + } + } + + public string Verbs + { + get + { + return this.verbsField; + } + set + { + this.verbsFieldSet = true; + this.verbsField = value; + } + } + + public YesNoType Script + { + get + { + return this.scriptField; + } + set + { + this.scriptFieldSet = true; + this.scriptField = value; + } + } + + public YesNoType CheckPath + { + get + { + return this.checkPathField; + } + set + { + this.checkPathFieldSet = true; + this.checkPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebApplicationExtension", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.executableFieldSet) + { + writer.WriteAttributeString("Executable", this.executableField); + } + if (this.extensionFieldSet) + { + writer.WriteAttributeString("Extension", this.extensionField); + } + if (this.verbsFieldSet) + { + writer.WriteAttributeString("Verbs", this.verbsField); + } + if (this.scriptFieldSet) + { + if ((this.scriptField == YesNoType.no)) + { + writer.WriteAttributeString("Script", "no"); + } + if ((this.scriptField == YesNoType.yes)) + { + writer.WriteAttributeString("Script", "yes"); + } + } + if (this.checkPathFieldSet) + { + if ((this.checkPathField == YesNoType.no)) + { + writer.WriteAttributeString("CheckPath", "no"); + } + if ((this.checkPathField == YesNoType.yes)) + { + writer.WriteAttributeString("CheckPath", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Executable" == name)) + { + this.executableField = value; + this.executableFieldSet = true; + } + if (("Extension" == name)) + { + this.extensionField = value; + this.extensionFieldSet = true; + } + if (("Verbs" == name)) + { + this.verbsField = value; + this.verbsFieldSet = true; + } + if (("Script" == name)) + { + this.scriptField = Enums.ParseYesNoType(value); + this.scriptFieldSet = true; + } + if (("CheckPath" == name)) + { + this.checkPathField = Enums.ParseYesNoType(value); + this.checkPathFieldSet = true; + } + } + } + + /// + /// IIS6 Application Pool + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebAppPool : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string userField; + + private bool userFieldSet; + + private int recycleMinutesField; + + private bool recycleMinutesFieldSet; + + private int recycleRequestsField; + + private bool recycleRequestsFieldSet; + + private int virtualMemoryField; + + private bool virtualMemoryFieldSet; + + private int privateMemoryField; + + private bool privateMemoryFieldSet; + + private int idleTimeoutField; + + private bool idleTimeoutFieldSet; + + private int queueLimitField; + + private bool queueLimitFieldSet; + + private long maxCpuUsageField; + + private bool maxCpuUsageFieldSet; + + private int refreshCpuField; + + private bool refreshCpuFieldSet; + + private CpuActionType cpuActionField; + + private bool cpuActionFieldSet; + + private int maxWorkerProcessesField; + + private bool maxWorkerProcessesFieldSet; + + private IdentityType identityField; + + private bool identityFieldSet; + + private string managedPipelineModeField; + + private bool managedPipelineModeFieldSet; + + private string managedRuntimeVersionField; + + private bool managedRuntimeVersionFieldSet; + + private ISchemaElement parentElement; + + public WebAppPool() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RecycleTime))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Id of the AppPool. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the AppPool to be shown in IIs. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// User account to run the AppPool as. To use this, you must set the Identity attribute to 'other'. + /// + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + /// + /// How often, in minutes, you want the AppPool to be recycled. + /// + public int RecycleMinutes + { + get + { + return this.recycleMinutesField; + } + set + { + this.recycleMinutesFieldSet = true; + this.recycleMinutesField = value; + } + } + + /// + /// How often, in requests, you want the AppPool to be recycled. + /// + public int RecycleRequests + { + get + { + return this.recycleRequestsField; + } + set + { + this.recycleRequestsFieldSet = true; + this.recycleRequestsField = value; + } + } + + /// + /// Specifies the amount of virtual memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this attribute is 4,294,967 KB. + /// + public int VirtualMemory + { + get + { + return this.virtualMemoryField; + } + set + { + this.virtualMemoryFieldSet = true; + this.virtualMemoryField = value; + } + } + + /// + /// Specifies the amount of private memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this attribute is 4,294,967 KB. + /// + public int PrivateMemory + { + get + { + return this.privateMemoryField; + } + set + { + this.privateMemoryFieldSet = true; + this.privateMemoryField = value; + } + } + + /// + /// Shutdown worker process after being idle for (time in minutes). + /// + public int IdleTimeout + { + get + { + return this.idleTimeoutField; + } + set + { + this.idleTimeoutFieldSet = true; + this.idleTimeoutField = value; + } + } + + /// + /// Limit the kernel request queue (number of requests). + /// + public int QueueLimit + { + get + { + return this.queueLimitField; + } + set + { + this.queueLimitFieldSet = true; + this.queueLimitField = value; + } + } + + /// + /// Maximum CPU usage (percent). + /// + public long MaxCpuUsage + { + get + { + return this.maxCpuUsageField; + } + set + { + this.maxCpuUsageFieldSet = true; + this.maxCpuUsageField = value; + } + } + + /// + /// Refresh CPU usage numbers (in minutes). + /// + public int RefreshCpu + { + get + { + return this.refreshCpuField; + } + set + { + this.refreshCpuFieldSet = true; + this.refreshCpuField = value; + } + } + + /// + /// Action taken when CPU exceeds maximum CPU use (as defined with MaxCpuUsage and RefreshCpu). + /// + public CpuActionType CpuAction + { + get + { + return this.cpuActionField; + } + set + { + this.cpuActionFieldSet = true; + this.cpuActionField = value; + } + } + + /// + /// Maximum number of worker processes. + /// + public int MaxWorkerProcesses + { + get + { + return this.maxWorkerProcessesField; + } + set + { + this.maxWorkerProcessesFieldSet = true; + this.maxWorkerProcessesField = value; + } + } + + /// + /// Identity you want the AppPool to run under (applicationPoolIdentity is only available on IIS7). Use the 'other' value in conjunction with the User attribute to specify non-standard user. + /// + public IdentityType Identity + { + get + { + return this.identityField; + } + set + { + this.identityFieldSet = true; + this.identityField = value; + } + } + + /// + /// Specifies the request-processing mode that is used to process requests for managed content. Only available on IIS7, ignored on IIS6. + /// See + /// + public string ManagedPipelineMode + { + get + { + return this.managedPipelineModeField; + } + set + { + this.managedPipelineModeFieldSet = true; + this.managedPipelineModeField = value; + } + } + + /// + /// Specifies the .NET Framework version to be used by the application pool. Only available on IIS7, ignored on IIS6. + /// See + /// + public string ManagedRuntimeVersion + { + get + { + return this.managedRuntimeVersionField; + } + set + { + this.managedRuntimeVersionFieldSet = true; + this.managedRuntimeVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RecycleTime" == childName)) + { + childValue = new RecycleTime(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a CpuActionType from a string. + /// + public static CpuActionType ParseCpuActionType(string value) + { + CpuActionType parsedValue; + WebAppPool.TryParseCpuActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CpuActionType from a string. + /// + public static bool TryParseCpuActionType(string value, out CpuActionType parsedValue) + { + parsedValue = CpuActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = CpuActionType.none; + } + else + { + if (("shutdown" == value)) + { + parsedValue = CpuActionType.shutdown; + } + else + { + parsedValue = CpuActionType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a IdentityType from a string. + /// + public static IdentityType ParseIdentityType(string value) + { + IdentityType parsedValue; + WebAppPool.TryParseIdentityType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IdentityType from a string. + /// + public static bool TryParseIdentityType(string value, out IdentityType parsedValue) + { + parsedValue = IdentityType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("networkService" == value)) + { + parsedValue = IdentityType.networkService; + } + else + { + if (("localService" == value)) + { + parsedValue = IdentityType.localService; + } + else + { + if (("localSystem" == value)) + { + parsedValue = IdentityType.localSystem; + } + else + { + if (("other" == value)) + { + parsedValue = IdentityType.other; + } + else + { + if (("applicationPoolIdentity" == value)) + { + parsedValue = IdentityType.applicationPoolIdentity; + } + else + { + parsedValue = IdentityType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebAppPool", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.recycleMinutesFieldSet) + { + writer.WriteAttributeString("RecycleMinutes", this.recycleMinutesField.ToString(CultureInfo.InvariantCulture)); + } + if (this.recycleRequestsFieldSet) + { + writer.WriteAttributeString("RecycleRequests", this.recycleRequestsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.virtualMemoryFieldSet) + { + writer.WriteAttributeString("VirtualMemory", this.virtualMemoryField.ToString(CultureInfo.InvariantCulture)); + } + if (this.privateMemoryFieldSet) + { + writer.WriteAttributeString("PrivateMemory", this.privateMemoryField.ToString(CultureInfo.InvariantCulture)); + } + if (this.idleTimeoutFieldSet) + { + writer.WriteAttributeString("IdleTimeout", this.idleTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.queueLimitFieldSet) + { + writer.WriteAttributeString("QueueLimit", this.queueLimitField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maxCpuUsageFieldSet) + { + writer.WriteAttributeString("MaxCpuUsage", this.maxCpuUsageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.refreshCpuFieldSet) + { + writer.WriteAttributeString("RefreshCpu", this.refreshCpuField.ToString(CultureInfo.InvariantCulture)); + } + if (this.cpuActionFieldSet) + { + if ((this.cpuActionField == CpuActionType.none)) + { + writer.WriteAttributeString("CpuAction", "none"); + } + if ((this.cpuActionField == CpuActionType.shutdown)) + { + writer.WriteAttributeString("CpuAction", "shutdown"); + } + } + if (this.maxWorkerProcessesFieldSet) + { + writer.WriteAttributeString("MaxWorkerProcesses", this.maxWorkerProcessesField.ToString(CultureInfo.InvariantCulture)); + } + if (this.identityFieldSet) + { + if ((this.identityField == IdentityType.networkService)) + { + writer.WriteAttributeString("Identity", "networkService"); + } + if ((this.identityField == IdentityType.localService)) + { + writer.WriteAttributeString("Identity", "localService"); + } + if ((this.identityField == IdentityType.localSystem)) + { + writer.WriteAttributeString("Identity", "localSystem"); + } + if ((this.identityField == IdentityType.other)) + { + writer.WriteAttributeString("Identity", "other"); + } + if ((this.identityField == IdentityType.applicationPoolIdentity)) + { + writer.WriteAttributeString("Identity", "applicationPoolIdentity"); + } + } + if (this.managedPipelineModeFieldSet) + { + writer.WriteAttributeString("ManagedPipelineMode", this.managedPipelineModeField); + } + if (this.managedRuntimeVersionFieldSet) + { + writer.WriteAttributeString("ManagedRuntimeVersion", this.managedRuntimeVersionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("RecycleMinutes" == name)) + { + this.recycleMinutesField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.recycleMinutesFieldSet = true; + } + if (("RecycleRequests" == name)) + { + this.recycleRequestsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.recycleRequestsFieldSet = true; + } + if (("VirtualMemory" == name)) + { + this.virtualMemoryField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.virtualMemoryFieldSet = true; + } + if (("PrivateMemory" == name)) + { + this.privateMemoryField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.privateMemoryFieldSet = true; + } + if (("IdleTimeout" == name)) + { + this.idleTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.idleTimeoutFieldSet = true; + } + if (("QueueLimit" == name)) + { + this.queueLimitField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.queueLimitFieldSet = true; + } + if (("MaxCpuUsage" == name)) + { + this.maxCpuUsageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxCpuUsageFieldSet = true; + } + if (("RefreshCpu" == name)) + { + this.refreshCpuField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.refreshCpuFieldSet = true; + } + if (("CpuAction" == name)) + { + this.cpuActionField = WebAppPool.ParseCpuActionType(value); + this.cpuActionFieldSet = true; + } + if (("MaxWorkerProcesses" == name)) + { + this.maxWorkerProcessesField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxWorkerProcessesFieldSet = true; + } + if (("Identity" == name)) + { + this.identityField = WebAppPool.ParseIdentityType(value); + this.identityFieldSet = true; + } + if (("ManagedPipelineMode" == name)) + { + this.managedPipelineModeField = value; + this.managedPipelineModeFieldSet = true; + } + if (("ManagedRuntimeVersion" == name)) + { + this.managedRuntimeVersionField = value; + this.managedRuntimeVersionFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum CpuActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + shutdown, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum IdentityType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + networkService, + + localService, + + localSystem, + + other, + + applicationPoolIdentity, + } + } + + /// + /// IIS6 Application Pool Recycle Times on 24 hour clock. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RecycleTime : ISchemaElement, ISetAttributes + { + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RecycleTime", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Used to install and uninstall certificates. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Certificate : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private StoreNameType storeNameField; + + private bool storeNameFieldSet; + + private StoreLocationType storeLocationField; + + private bool storeLocationFieldSet; + + private YesNoType overwriteField; + + private bool overwriteFieldSet; + + private YesNoType requestField; + + private bool requestFieldSet; + + private string binaryKeyField; + + private bool binaryKeyFieldSet; + + private string certificatePathField; + + private bool certificatePathFieldSet; + + private string pFXPasswordField; + + private bool pFXPasswordFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for this certificate in the installation package. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the certificate that will be installed or uninstalled in the specified store. + /// This attribute may be set via a formatted Property (e.g. [MyProperty]). + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public StoreNameType StoreName + { + get + { + return this.storeNameField; + } + set + { + this.storeNameFieldSet = true; + this.storeNameField = value; + } + } + + public StoreLocationType StoreLocation + { + get + { + return this.storeLocationField; + } + set + { + this.storeLocationFieldSet = true; + this.storeLocationField = value; + } + } + + public YesNoType Overwrite + { + get + { + return this.overwriteField; + } + set + { + this.overwriteFieldSet = true; + this.overwriteField = value; + } + } + + /// + /// This attribute controls whether the CertificatePath attribute is a path to a certificate file (Request='no') or the + /// certificate authority to request the certificate from (Request='yes'). + /// + public YesNoType Request + { + get + { + return this.requestField; + } + set + { + this.requestFieldSet = true; + this.requestField = value; + } + } + + /// + /// Reference to a Binary element that will store the certificate as a stream inside the package. This attribute cannot be specified with + /// the CertificatePath attribute. + /// + public string BinaryKey + { + get + { + return this.binaryKeyField; + } + set + { + this.binaryKeyFieldSet = true; + this.binaryKeyField = value; + } + } + + /// + /// If the Request attribute is "no" then this attribute is the path to the certificate file outside of the package. + /// If the Request attribute is "yes" then this atribute is the certificate authority to request the certificate from. + /// This attribute may be set via a formatted Property (e.g. [MyProperty]). + /// + public string CertificatePath + { + get + { + return this.certificatePathField; + } + set + { + this.certificatePathFieldSet = true; + this.certificatePathField = value; + } + } + + /// + /// If the Binary stream or path to the file outside of the package is a password protected PFX file, the password for that + /// PFX must be specified here. This attribute may be set via a formatted Property (e.g. [MyProperty]). + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string PFXPassword + { + get + { + return this.pFXPasswordField; + } + set + { + this.pFXPasswordFieldSet = true; + this.pFXPasswordField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a StoreNameType from a string. + /// + public static StoreNameType ParseStoreNameType(string value) + { + StoreNameType parsedValue; + Certificate.TryParseStoreNameType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a StoreNameType from a string. + /// + public static bool TryParseStoreNameType(string value, out StoreNameType parsedValue) + { + parsedValue = StoreNameType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ca" == value)) + { + parsedValue = StoreNameType.ca; + } + else + { + if (("my" == value)) + { + parsedValue = StoreNameType.my; + } + else + { + if (("personal" == value)) + { + parsedValue = StoreNameType.personal; + } + else + { + if (("request" == value)) + { + parsedValue = StoreNameType.request; + } + else + { + if (("root" == value)) + { + parsedValue = StoreNameType.root; + } + else + { + if (("otherPeople" == value)) + { + parsedValue = StoreNameType.otherPeople; + } + else + { + if (("trustedPeople" == value)) + { + parsedValue = StoreNameType.trustedPeople; + } + else + { + if (("trustedPublisher" == value)) + { + parsedValue = StoreNameType.trustedPublisher; + } + else + { + parsedValue = StoreNameType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a StoreLocationType from a string. + /// + public static StoreLocationType ParseStoreLocationType(string value) + { + StoreLocationType parsedValue; + Certificate.TryParseStoreLocationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a StoreLocationType from a string. + /// + public static bool TryParseStoreLocationType(string value, out StoreLocationType parsedValue) + { + parsedValue = StoreLocationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("currentUser" == value)) + { + parsedValue = StoreLocationType.currentUser; + } + else + { + if (("localMachine" == value)) + { + parsedValue = StoreLocationType.localMachine; + } + else + { + parsedValue = StoreLocationType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Certificate", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.storeNameFieldSet) + { + if ((this.storeNameField == StoreNameType.ca)) + { + writer.WriteAttributeString("StoreName", "ca"); + } + if ((this.storeNameField == StoreNameType.my)) + { + writer.WriteAttributeString("StoreName", "my"); + } + if ((this.storeNameField == StoreNameType.personal)) + { + writer.WriteAttributeString("StoreName", "personal"); + } + if ((this.storeNameField == StoreNameType.request)) + { + writer.WriteAttributeString("StoreName", "request"); + } + if ((this.storeNameField == StoreNameType.root)) + { + writer.WriteAttributeString("StoreName", "root"); + } + if ((this.storeNameField == StoreNameType.otherPeople)) + { + writer.WriteAttributeString("StoreName", "otherPeople"); + } + if ((this.storeNameField == StoreNameType.trustedPeople)) + { + writer.WriteAttributeString("StoreName", "trustedPeople"); + } + if ((this.storeNameField == StoreNameType.trustedPublisher)) + { + writer.WriteAttributeString("StoreName", "trustedPublisher"); + } + } + if (this.storeLocationFieldSet) + { + if ((this.storeLocationField == StoreLocationType.currentUser)) + { + writer.WriteAttributeString("StoreLocation", "currentUser"); + } + if ((this.storeLocationField == StoreLocationType.localMachine)) + { + writer.WriteAttributeString("StoreLocation", "localMachine"); + } + } + if (this.overwriteFieldSet) + { + if ((this.overwriteField == YesNoType.no)) + { + writer.WriteAttributeString("Overwrite", "no"); + } + if ((this.overwriteField == YesNoType.yes)) + { + writer.WriteAttributeString("Overwrite", "yes"); + } + } + if (this.requestFieldSet) + { + if ((this.requestField == YesNoType.no)) + { + writer.WriteAttributeString("Request", "no"); + } + if ((this.requestField == YesNoType.yes)) + { + writer.WriteAttributeString("Request", "yes"); + } + } + if (this.binaryKeyFieldSet) + { + writer.WriteAttributeString("BinaryKey", this.binaryKeyField); + } + if (this.certificatePathFieldSet) + { + writer.WriteAttributeString("CertificatePath", this.certificatePathField); + } + if (this.pFXPasswordFieldSet) + { + writer.WriteAttributeString("PFXPassword", this.pFXPasswordField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("StoreName" == name)) + { + this.storeNameField = Certificate.ParseStoreNameType(value); + this.storeNameFieldSet = true; + } + if (("StoreLocation" == name)) + { + this.storeLocationField = Certificate.ParseStoreLocationType(value); + this.storeLocationFieldSet = true; + } + if (("Overwrite" == name)) + { + this.overwriteField = Enums.ParseYesNoType(value); + this.overwriteFieldSet = true; + } + if (("Request" == name)) + { + this.requestField = Enums.ParseYesNoType(value); + this.requestFieldSet = true; + } + if (("BinaryKey" == name)) + { + this.binaryKeyField = value; + this.binaryKeyFieldSet = true; + } + if (("CertificatePath" == name)) + { + this.certificatePathField = value; + this.certificatePathFieldSet = true; + } + if (("PFXPassword" == name)) + { + this.pFXPasswordField = value; + this.pFXPasswordFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum StoreNameType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Contains the certificates of certificate authorities that the user trusts to issue certificates to others. Certificates in these stores are normally supplied with the operating system or by the user's network administrator. + /// + ca, + + /// + /// Use the "personal" value instead. + /// + my, + + /// + /// Contains personal certificates. These certificates will usually have an associated private key. This store is often + /// referred to as the "MY" certificate store. + /// + personal, + + request, + + /// + /// Contains the certificates of certificate authorities that the user trusts to issue certificates to others. Certificates in these stores are normally supplied with the operating system or by the user's network administrator. Certificates in this store are typically self-signed. + /// + root, + + /// + /// Contains the certificates of those that the user normally sends enveloped messages to or receives signed messages from. + /// See + /// + otherPeople, + + /// + /// Contains the certificates of those directly trusted people and resources. + /// See + /// + trustedPeople, + + /// + /// Contains the certificates of those publishers who are trusted. + /// See + /// + trustedPublisher, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum StoreLocationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + currentUser, + + localMachine, + } + } + + /// + /// Associates a certificate with the parent WebSite. The Certificate element should be + /// in the same Component as the parent WebSite. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class CertificateRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the referenced Certificate. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CertificateRef", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// IIS Properties + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebProperty : ISchemaElement, ISetAttributes + { + + private IdType idField; + + private bool idFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + public IdType Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The value to be used for the WebProperty specified in the Id attribute. See + /// the remarks section for information on acceptable values for each Id. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a IdType from a string. + /// + public static IdType ParseIdType(string value) + { + IdType parsedValue; + WebProperty.TryParseIdType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IdType from a string. + /// + public static bool TryParseIdType(string value, out IdType parsedValue) + { + parsedValue = IdType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ETagChangeNumber" == value)) + { + parsedValue = IdType.ETagChangeNumber; + } + else + { + if (("IIs5IsolationMode" == value)) + { + parsedValue = IdType.IIs5IsolationMode; + } + else + { + if (("MaxGlobalBandwidth" == value)) + { + parsedValue = IdType.MaxGlobalBandwidth; + } + else + { + if (("LogInUTF8" == value)) + { + parsedValue = IdType.LogInUTF8; + } + else + { + parsedValue = IdType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebProperty", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + if ((this.idField == IdType.ETagChangeNumber)) + { + writer.WriteAttributeString("Id", "ETagChangeNumber"); + } + if ((this.idField == IdType.IIs5IsolationMode)) + { + writer.WriteAttributeString("Id", "IIs5IsolationMode"); + } + if ((this.idField == IdType.MaxGlobalBandwidth)) + { + writer.WriteAttributeString("Id", "MaxGlobalBandwidth"); + } + if ((this.idField == IdType.LogInUTF8)) + { + writer.WriteAttributeString("Id", "LogInUTF8"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = WebProperty.ParseIdType(value); + this.idFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum IdType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + ETagChangeNumber, + + IIs5IsolationMode, + + MaxGlobalBandwidth, + + LogInUTF8, + } + } + + /// + /// Defines properties for a web application. These properties can be used for more than one application defined in a web site or vroot, by defining this element in a common location and referring to it by setting the WebApplication attribute of the WebSite and WebVirtualDir elements. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebApplication : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private IsolationType isolationField; + + private bool isolationFieldSet; + + private YesNoDefaultType allowSessionsField; + + private bool allowSessionsFieldSet; + + private int sessionTimeoutField; + + private bool sessionTimeoutFieldSet; + + private YesNoDefaultType bufferField; + + private bool bufferFieldSet; + + private YesNoDefaultType parentPathsField; + + private bool parentPathsFieldSet; + + private DefaultScriptType defaultScriptField; + + private bool defaultScriptFieldSet; + + private int scriptTimeoutField; + + private bool scriptTimeoutFieldSet; + + private YesNoDefaultType serverDebuggingField; + + private bool serverDebuggingFieldSet; + + private YesNoDefaultType clientDebuggingField; + + private bool clientDebuggingFieldSet; + + private string webAppPoolField; + + private bool webAppPoolFieldSet; + + private ISchemaElement parentElement; + + public WebApplication() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(WebApplicationExtension))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets the name of this application. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Sets the application isolation level for this application for pre-IIS 6 applications. + /// + public IsolationType Isolation + { + get + { + return this.isolationField; + } + set + { + this.isolationFieldSet = true; + this.isolationField = value; + } + } + + /// + /// Sets the Enable Session State option. When enabled, you can set the session timeout using the SessionTimeout attribute. + /// + public YesNoDefaultType AllowSessions + { + get + { + return this.allowSessionsField; + } + set + { + this.allowSessionsFieldSet = true; + this.allowSessionsField = value; + } + } + + /// + /// Sets the timeout value for sessions in minutes. + /// + public int SessionTimeout + { + get + { + return this.sessionTimeoutField; + } + set + { + this.sessionTimeoutFieldSet = true; + this.sessionTimeoutField = value; + } + } + + /// + /// Sets the option that enables response buffering in the application, which allows ASP script to set response headers anywhere in the script. + /// + public YesNoDefaultType Buffer + { + get + { + return this.bufferField; + } + set + { + this.bufferFieldSet = true; + this.bufferField = value; + } + } + + /// + /// Sets the parent paths option, which allows a client to use relative paths to reach parent directories from this application. + /// + public YesNoDefaultType ParentPaths + { + get + { + return this.parentPathsField; + } + set + { + this.parentPathsFieldSet = true; + this.parentPathsField = value; + } + } + + /// + /// Sets the default script language for the site. + /// + public DefaultScriptType DefaultScript + { + get + { + return this.defaultScriptField; + } + set + { + this.defaultScriptFieldSet = true; + this.defaultScriptField = value; + } + } + + /// + /// Sets the timeout value in seconds for executing ASP scripts. + /// + public int ScriptTimeout + { + get + { + return this.scriptTimeoutField; + } + set + { + this.scriptTimeoutFieldSet = true; + this.scriptTimeoutField = value; + } + } + + /// + /// Enable ASP server-side script debugging. + /// + public YesNoDefaultType ServerDebugging + { + get + { + return this.serverDebuggingField; + } + set + { + this.serverDebuggingFieldSet = true; + this.serverDebuggingField = value; + } + } + + /// + /// Enable ASP client-side script debugging. + /// + public YesNoDefaultType ClientDebugging + { + get + { + return this.clientDebuggingField; + } + set + { + this.clientDebuggingFieldSet = true; + this.clientDebuggingField = value; + } + } + + /// + /// References the Id attribute of a WebAppPool element to use as the application pool for this application in IIS 6 applications. + /// + public string WebAppPool + { + get + { + return this.webAppPoolField; + } + set + { + this.webAppPoolFieldSet = true; + this.webAppPoolField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebApplicationExtension" == childName)) + { + childValue = new WebApplicationExtension(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a IsolationType from a string. + /// + public static IsolationType ParseIsolationType(string value) + { + IsolationType parsedValue; + WebApplication.TryParseIsolationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IsolationType from a string. + /// + public static bool TryParseIsolationType(string value, out IsolationType parsedValue) + { + parsedValue = IsolationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("low" == value)) + { + parsedValue = IsolationType.low; + } + else + { + if (("medium" == value)) + { + parsedValue = IsolationType.medium; + } + else + { + if (("high" == value)) + { + parsedValue = IsolationType.high; + } + else + { + parsedValue = IsolationType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a DefaultScriptType from a string. + /// + public static DefaultScriptType ParseDefaultScriptType(string value) + { + DefaultScriptType parsedValue; + WebApplication.TryParseDefaultScriptType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a DefaultScriptType from a string. + /// + public static bool TryParseDefaultScriptType(string value, out DefaultScriptType parsedValue) + { + parsedValue = DefaultScriptType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("VBScript" == value)) + { + parsedValue = DefaultScriptType.VBScript; + } + else + { + if (("JScript" == value)) + { + parsedValue = DefaultScriptType.JScript; + } + else + { + parsedValue = DefaultScriptType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebApplication", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.isolationFieldSet) + { + if ((this.isolationField == IsolationType.low)) + { + writer.WriteAttributeString("Isolation", "low"); + } + if ((this.isolationField == IsolationType.medium)) + { + writer.WriteAttributeString("Isolation", "medium"); + } + if ((this.isolationField == IsolationType.high)) + { + writer.WriteAttributeString("Isolation", "high"); + } + } + if (this.allowSessionsFieldSet) + { + if ((this.allowSessionsField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("AllowSessions", "default"); + } + if ((this.allowSessionsField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("AllowSessions", "no"); + } + if ((this.allowSessionsField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("AllowSessions", "yes"); + } + } + if (this.sessionTimeoutFieldSet) + { + writer.WriteAttributeString("SessionTimeout", this.sessionTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.bufferFieldSet) + { + if ((this.bufferField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Buffer", "default"); + } + if ((this.bufferField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Buffer", "no"); + } + if ((this.bufferField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Buffer", "yes"); + } + } + if (this.parentPathsFieldSet) + { + if ((this.parentPathsField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ParentPaths", "default"); + } + if ((this.parentPathsField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ParentPaths", "no"); + } + if ((this.parentPathsField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ParentPaths", "yes"); + } + } + if (this.defaultScriptFieldSet) + { + if ((this.defaultScriptField == DefaultScriptType.VBScript)) + { + writer.WriteAttributeString("DefaultScript", "VBScript"); + } + if ((this.defaultScriptField == DefaultScriptType.JScript)) + { + writer.WriteAttributeString("DefaultScript", "JScript"); + } + } + if (this.scriptTimeoutFieldSet) + { + writer.WriteAttributeString("ScriptTimeout", this.scriptTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.serverDebuggingFieldSet) + { + if ((this.serverDebuggingField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ServerDebugging", "default"); + } + if ((this.serverDebuggingField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ServerDebugging", "no"); + } + if ((this.serverDebuggingField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ServerDebugging", "yes"); + } + } + if (this.clientDebuggingFieldSet) + { + if ((this.clientDebuggingField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ClientDebugging", "default"); + } + if ((this.clientDebuggingField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ClientDebugging", "no"); + } + if ((this.clientDebuggingField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ClientDebugging", "yes"); + } + } + if (this.webAppPoolFieldSet) + { + writer.WriteAttributeString("WebAppPool", this.webAppPoolField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Isolation" == name)) + { + this.isolationField = WebApplication.ParseIsolationType(value); + this.isolationFieldSet = true; + } + if (("AllowSessions" == name)) + { + this.allowSessionsField = Enums.ParseYesNoDefaultType(value); + this.allowSessionsFieldSet = true; + } + if (("SessionTimeout" == name)) + { + this.sessionTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sessionTimeoutFieldSet = true; + } + if (("Buffer" == name)) + { + this.bufferField = Enums.ParseYesNoDefaultType(value); + this.bufferFieldSet = true; + } + if (("ParentPaths" == name)) + { + this.parentPathsField = Enums.ParseYesNoDefaultType(value); + this.parentPathsFieldSet = true; + } + if (("DefaultScript" == name)) + { + this.defaultScriptField = WebApplication.ParseDefaultScriptType(value); + this.defaultScriptFieldSet = true; + } + if (("ScriptTimeout" == name)) + { + this.scriptTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.scriptTimeoutFieldSet = true; + } + if (("ServerDebugging" == name)) + { + this.serverDebuggingField = Enums.ParseYesNoDefaultType(value); + this.serverDebuggingFieldSet = true; + } + if (("ClientDebugging" == name)) + { + this.clientDebuggingField = Enums.ParseYesNoDefaultType(value); + this.clientDebuggingFieldSet = true; + } + if (("WebAppPool" == name)) + { + this.webAppPoolField = value; + this.webAppPoolFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum IsolationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Means the application executes within the IIS process. + /// + low, + + /// + /// Executes pooled in a separate process. + /// + medium, + + /// + /// Means execution alone in a separate process. + /// + high, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum DefaultScriptType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + VBScript, + + JScript, + } + } + + /// + /// WebAddress for WebSite + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebAddress : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string iPField; + + private bool iPFieldSet; + + private string portField; + + private bool portFieldSet; + + private string headerField; + + private bool headerFieldSet; + + private YesNoType secureField; + + private bool secureFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The IP address to locate an existing WebSite or create a new WebSite. When the WebAddress is part of a WebSite element + /// used to locate an existing web site the following rules are used: + /// + public string IP + { + get + { + return this.iPField; + } + set + { + this.iPFieldSet = true; + this.iPField = value; + } + } + + public string Port + { + get + { + return this.portField; + } + set + { + this.portFieldSet = true; + this.portField = value; + } + } + + public string Header + { + get + { + return this.headerField; + } + set + { + this.headerFieldSet = true; + this.headerField = value; + } + } + + /// + /// Determines if this address represents a secure binding. The default is 'no'. + /// + public YesNoType Secure + { + get + { + return this.secureField; + } + set + { + this.secureFieldSet = true; + this.secureField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebAddress", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.iPFieldSet) + { + writer.WriteAttributeString("IP", this.iPField); + } + if (this.portFieldSet) + { + writer.WriteAttributeString("Port", this.portField); + } + if (this.headerFieldSet) + { + writer.WriteAttributeString("Header", this.headerField); + } + if (this.secureFieldSet) + { + if ((this.secureField == YesNoType.no)) + { + writer.WriteAttributeString("Secure", "no"); + } + if ((this.secureField == YesNoType.yes)) + { + writer.WriteAttributeString("Secure", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IP" == name)) + { + this.iPField = value; + this.iPFieldSet = true; + } + if (("Port" == name)) + { + this.portField = value; + this.portFieldSet = true; + } + if (("Header" == name)) + { + this.headerField = value; + this.headerFieldSet = true; + } + if (("Secure" == name)) + { + this.secureField = Enums.ParseYesNoType(value); + this.secureFieldSet = true; + } + } + } + + /// + /// Defines an IIS virtual directory. When this element is a child of WebSite element, the virtual directory is defined within that web site. Otherwise this virtual directory must reference a WebSite element via the WebSite attribute + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebVirtualDir : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string webSiteField; + + private bool webSiteFieldSet; + + private string aliasField; + + private bool aliasFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string dirPropertiesField; + + private bool dirPropertiesFieldSet; + + private string webApplicationField; + + private bool webApplicationFieldSet; + + private ISchemaElement parentElement; + + public WebVirtualDir() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebError))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebVirtualDir))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HttpHeader))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MimeMap))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// References the Id attribute for a WebSite in which this virtual directory belongs. Required when this element is not a child of WebSite element. + /// + public string WebSite + { + get + { + return this.webSiteField; + } + set + { + this.webSiteFieldSet = true; + this.webSiteField = value; + } + } + + /// + /// Sets the application name, which is the URL relative path used to access this virtual directory + /// + public string Alias + { + get + { + return this.aliasField; + } + set + { + this.aliasFieldSet = true; + this.aliasField = value; + } + } + + /// + /// References the Id attribute for a Directory element that points to the content for this virtual directory. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this virtual directory. + /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. + /// + public string DirProperties + { + get + { + return this.dirPropertiesField; + } + set + { + this.dirPropertiesFieldSet = true; + this.dirPropertiesField = value; + } + } + + /// + /// References the Id attribute for a WebApplication element that specifies web application settings for this virtual directory. If a WebApplication child is not specified, the virtual directory does not host web applications. + /// + public string WebApplication + { + get + { + return this.webApplicationField; + } + set + { + this.webApplicationFieldSet = true; + this.webApplicationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebApplication" == childName)) + { + childValue = new WebApplication(); + } + if (("WebDirProperties" == childName)) + { + childValue = new WebDirProperties(); + } + if (("WebError" == childName)) + { + childValue = new WebError(); + } + if (("WebVirtualDir" == childName)) + { + childValue = new WebVirtualDir(); + } + if (("HttpHeader" == childName)) + { + childValue = new HttpHeader(); + } + if (("MimeMap" == childName)) + { + childValue = new MimeMap(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebVirtualDir", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.webSiteFieldSet) + { + writer.WriteAttributeString("WebSite", this.webSiteField); + } + if (this.aliasFieldSet) + { + writer.WriteAttributeString("Alias", this.aliasField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.dirPropertiesFieldSet) + { + writer.WriteAttributeString("DirProperties", this.dirPropertiesField); + } + if (this.webApplicationFieldSet) + { + writer.WriteAttributeString("WebApplication", this.webApplicationField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("WebSite" == name)) + { + this.webSiteField = value; + this.webSiteFieldSet = true; + } + if (("Alias" == name)) + { + this.aliasField = value; + this.aliasFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DirProperties" == name)) + { + this.dirPropertiesField = value; + this.dirPropertiesFieldSet = true; + } + if (("WebApplication" == name)) + { + this.webApplicationField = value; + this.webApplicationFieldSet = true; + } + } + } + + /// + /// Defines a subdirectory within an IIS web site. When this element is a child of WebSite, the web directory is defined within that web site. Otherwise the web directory must reference a WebSite element via the WebSite attribute. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebDir : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string webSiteField; + + private bool webSiteFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private string dirPropertiesField; + + private bool dirPropertiesFieldSet; + + private ISchemaElement parentElement; + + public WebDir() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// References the Id attribute for a WebSite element in which this directory belongs. Required when this element is not a child of a WebSite element. + /// + public string WebSite + { + get + { + return this.webSiteField; + } + set + { + this.webSiteFieldSet = true; + this.webSiteField = value; + } + } + + /// + /// Specifies the name of this web directory. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this web directory. + /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. + /// + public string DirProperties + { + get + { + return this.dirPropertiesField; + } + set + { + this.dirPropertiesFieldSet = true; + this.dirPropertiesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebApplication" == childName)) + { + childValue = new WebApplication(); + } + if (("WebDirProperties" == childName)) + { + childValue = new WebDirProperties(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebDir", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.webSiteFieldSet) + { + writer.WriteAttributeString("WebSite", this.webSiteField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.dirPropertiesFieldSet) + { + writer.WriteAttributeString("DirProperties", this.dirPropertiesField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("WebSite" == name)) + { + this.webSiteField = value; + this.webSiteFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("DirProperties" == name)) + { + this.dirPropertiesField = value; + this.dirPropertiesFieldSet = true; + } + } + } + + /// + /// IIs Web Site + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebSite : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType autoStartField; + + private bool autoStartFieldSet; + + private YesNoType configureIfExistsField; + + private bool configureIfExistsFieldSet; + + private long connectionTimeoutField; + + private bool connectionTimeoutFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string dirPropertiesField; + + private bool dirPropertiesFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string siteIdField; + + private bool siteIdFieldSet; + + private YesNoType startOnInstallField; + + private bool startOnInstallFieldSet; + + private string webApplicationField; + + private bool webApplicationFieldSet; + + private string webLogField; + + private bool webLogFieldSet; + + private ISchemaElement parentElement; + + public WebSite() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebAddress))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MimeMap))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CertificateRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HttpHeader))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDir))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebError))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebFilter))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebVirtualDir))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the WebSite. Used within the MSI package only. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies whether to automatically start the web site. + /// + public YesNoType AutoStart + { + get + { + return this.autoStartField; + } + set + { + this.autoStartFieldSet = true; + this.autoStartField = value; + } + } + + /// + /// Specifies whether to configure the web site if it already exists. Note: This will not affect uninstall behavior. If the web site exists on uninstall, it will be removed. + /// + public YesNoType ConfigureIfExists + { + get + { + return this.configureIfExistsField; + } + set + { + this.configureIfExistsFieldSet = true; + this.configureIfExistsField = value; + } + } + + /// + /// Sets the timeout value for connections in seconds. + /// + public long ConnectionTimeout + { + get + { + return this.connectionTimeoutField; + } + set + { + this.connectionTimeoutFieldSet = true; + this.connectionTimeoutField = value; + } + } + + /// + /// This is the name of the web site that will show up in the IIS management console. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Root directory of the web site. Resolved to a directory in the Directory table at install time by the server custom actions. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this website root directory. + /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. + /// + public string DirProperties + { + get + { + return this.dirPropertiesField; + } + set + { + this.dirPropertiesFieldSet = true; + this.dirPropertiesField = value; + } + } + + /// + /// Sequence that the web site is to be created in. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Optional attribute to directly specify the site id of the WebSite. Use this to ensure all web + /// sites in a web garden get the same site id. If a number is provided, the site id must be unique + /// on all target machines. If "*" is used, the Description attribute will be hashed to create a unique + /// value for the site id. This value must be a positive number or a "*" or a formatted value that resolves + /// to "-1" (for the same behavior as "*") or a positive number or blank. If this attribute is absent then + /// the web site will be located using the WebAddress element associated with the web site. + /// + public string SiteId + { + get + { + return this.siteIdField; + } + set + { + this.siteIdFieldSet = true; + this.siteIdField = value; + } + } + + /// + /// Specifies whether to start the web site on install. + /// + public YesNoType StartOnInstall + { + get + { + return this.startOnInstallField; + } + set + { + this.startOnInstallFieldSet = true; + this.startOnInstallField = value; + } + } + + /// + /// Reference to a WebApplication that is to be installed as part of this web site. + /// + public string WebApplication + { + get + { + return this.webApplicationField; + } + set + { + this.webApplicationFieldSet = true; + this.webApplicationField = value; + } + } + + /// + /// Reference to WebLog definition. + /// + public string WebLog + { + get + { + return this.webLogField; + } + set + { + this.webLogFieldSet = true; + this.webLogField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebAddress" == childName)) + { + childValue = new WebAddress(); + } + if (("WebApplication" == childName)) + { + childValue = new WebApplication(); + } + if (("WebDirProperties" == childName)) + { + childValue = new WebDirProperties(); + } + if (("MimeMap" == childName)) + { + childValue = new MimeMap(); + } + if (("CertificateRef" == childName)) + { + childValue = new CertificateRef(); + } + if (("HttpHeader" == childName)) + { + childValue = new HttpHeader(); + } + if (("WebDir" == childName)) + { + childValue = new WebDir(); + } + if (("WebError" == childName)) + { + childValue = new WebError(); + } + if (("WebFilter" == childName)) + { + childValue = new WebFilter(); + } + if (("WebVirtualDir" == childName)) + { + childValue = new WebVirtualDir(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebSite", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.autoStartFieldSet) + { + if ((this.autoStartField == YesNoType.no)) + { + writer.WriteAttributeString("AutoStart", "no"); + } + if ((this.autoStartField == YesNoType.yes)) + { + writer.WriteAttributeString("AutoStart", "yes"); + } + } + if (this.configureIfExistsFieldSet) + { + if ((this.configureIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("ConfigureIfExists", "no"); + } + if ((this.configureIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("ConfigureIfExists", "yes"); + } + } + if (this.connectionTimeoutFieldSet) + { + writer.WriteAttributeString("ConnectionTimeout", this.connectionTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.dirPropertiesFieldSet) + { + writer.WriteAttributeString("DirProperties", this.dirPropertiesField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.siteIdFieldSet) + { + writer.WriteAttributeString("SiteId", this.siteIdField); + } + if (this.startOnInstallFieldSet) + { + if ((this.startOnInstallField == YesNoType.no)) + { + writer.WriteAttributeString("StartOnInstall", "no"); + } + if ((this.startOnInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("StartOnInstall", "yes"); + } + } + if (this.webApplicationFieldSet) + { + writer.WriteAttributeString("WebApplication", this.webApplicationField); + } + if (this.webLogFieldSet) + { + writer.WriteAttributeString("WebLog", this.webLogField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AutoStart" == name)) + { + this.autoStartField = Enums.ParseYesNoType(value); + this.autoStartFieldSet = true; + } + if (("ConfigureIfExists" == name)) + { + this.configureIfExistsField = Enums.ParseYesNoType(value); + this.configureIfExistsFieldSet = true; + } + if (("ConnectionTimeout" == name)) + { + this.connectionTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.connectionTimeoutFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DirProperties" == name)) + { + this.dirPropertiesField = value; + this.dirPropertiesFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("SiteId" == name)) + { + this.siteIdField = value; + this.siteIdFieldSet = true; + } + if (("StartOnInstall" == name)) + { + this.startOnInstallField = Enums.ParseYesNoType(value); + this.startOnInstallFieldSet = true; + } + if (("WebApplication" == name)) + { + this.webApplicationField = value; + this.webApplicationFieldSet = true; + } + if (("WebLog" == name)) + { + this.webLogField = value; + this.webLogFieldSet = true; + } + } + } + + /// + /// WebLog definition. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebLog : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the WebLog. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + WebLog.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("IIS" == value)) + { + parsedValue = TypeType.IIS; + } + else + { + if (("NCSA" == value)) + { + parsedValue = TypeType.NCSA; + } + else + { + if (("none" == value)) + { + parsedValue = TypeType.none; + } + else + { + if (("ODBC" == value)) + { + parsedValue = TypeType.ODBC; + } + else + { + if (("W3C" == value)) + { + parsedValue = TypeType.W3C; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebLog", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.IIS)) + { + writer.WriteAttributeString("Type", "IIS"); + } + if ((this.typeField == TypeType.NCSA)) + { + writer.WriteAttributeString("Type", "NCSA"); + } + if ((this.typeField == TypeType.none)) + { + writer.WriteAttributeString("Type", "none"); + } + if ((this.typeField == TypeType.ODBC)) + { + writer.WriteAttributeString("Type", "ODBC"); + } + if ((this.typeField == TypeType.W3C)) + { + writer.WriteAttributeString("Type", "W3C"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = WebLog.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Microsoft IIS Log File Format + /// + IIS, + + /// + /// NCSA Common Log File Format + /// + NCSA, + + /// + /// Disables logging. + /// + none, + + /// + /// ODBC Logging + /// + ODBC, + + /// + /// W3C Extended Log File Format + /// + W3C, + } + } + + /// + /// The WebServiceExtension property is used by the Web server to determine whether a Web service extension is permitted to run. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebServiceExtension : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string groupField; + + private bool groupFieldSet; + + private YesNoType allowField; + + private bool allowFieldSet; + + private YesNoType uIDeletableField; + + private bool uIDeletableFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Usually a Property that resolves to short file name path + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Description of the extension. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// String used to identify groups of extensions. + /// + public string Group + { + get + { + return this.groupField; + } + set + { + this.groupFieldSet = true; + this.groupField = value; + } + } + + /// + /// Indicates if the extension is allowed or denied. + /// + public YesNoType Allow + { + get + { + return this.allowField; + } + set + { + this.allowFieldSet = true; + this.allowField = value; + } + } + + /// + /// Indicates if the UI is allowed to delete the extension from the list of not. Default: Not deletable. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType UIDeletable + { + get + { + return this.uIDeletableField; + } + set + { + this.uIDeletableFieldSet = true; + this.uIDeletableField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebServiceExtension", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.groupFieldSet) + { + writer.WriteAttributeString("Group", this.groupField); + } + if (this.allowFieldSet) + { + if ((this.allowField == YesNoType.no)) + { + writer.WriteAttributeString("Allow", "no"); + } + if ((this.allowField == YesNoType.yes)) + { + writer.WriteAttributeString("Allow", "yes"); + } + } + if (this.uIDeletableFieldSet) + { + if ((this.uIDeletableField == YesNoType.no)) + { + writer.WriteAttributeString("UIDeletable", "no"); + } + if ((this.uIDeletableField == YesNoType.yes)) + { + writer.WriteAttributeString("UIDeletable", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Group" == name)) + { + this.groupField = value; + this.groupFieldSet = true; + } + if (("Allow" == name)) + { + this.allowField = Enums.ParseYesNoType(value); + this.allowFieldSet = true; + } + if (("UIDeletable" == name)) + { + this.uIDeletableField = Enums.ParseYesNoType(value); + this.uIDeletableFieldSet = true; + } + } + } +} diff --git a/src/heat/Serialize/util.cs b/src/heat/Serialize/util.cs new file mode 100644 index 00000000..84f56eb0 --- /dev/null +++ b/src/heat/Serialize/util.cs @@ -0,0 +1,11462 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 +namespace WixToolset.Harvesters.Serialize.Util +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + using WixToolset.Harvesters.Serialize; + + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a PerformanceCounterLanguageType from a string. + /// + public static PerformanceCounterLanguageType ParsePerformanceCounterLanguageType(string value) + { + PerformanceCounterLanguageType parsedValue; + Enums.TryParsePerformanceCounterLanguageType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PerformanceCounterLanguageType from a string. + /// + public static bool TryParsePerformanceCounterLanguageType(string value, out PerformanceCounterLanguageType parsedValue) + { + parsedValue = PerformanceCounterLanguageType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("afrikaans" == value)) + { + parsedValue = PerformanceCounterLanguageType.afrikaans; + } + else + { + if (("albanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.albanian; + } + else + { + if (("arabic" == value)) + { + parsedValue = PerformanceCounterLanguageType.arabic; + } + else + { + if (("armenian" == value)) + { + parsedValue = PerformanceCounterLanguageType.armenian; + } + else + { + if (("assamese" == value)) + { + parsedValue = PerformanceCounterLanguageType.assamese; + } + else + { + if (("azeri" == value)) + { + parsedValue = PerformanceCounterLanguageType.azeri; + } + else + { + if (("basque" == value)) + { + parsedValue = PerformanceCounterLanguageType.basque; + } + else + { + if (("belarusian" == value)) + { + parsedValue = PerformanceCounterLanguageType.belarusian; + } + else + { + if (("bengali" == value)) + { + parsedValue = PerformanceCounterLanguageType.bengali; + } + else + { + if (("bulgarian" == value)) + { + parsedValue = PerformanceCounterLanguageType.bulgarian; + } + else + { + if (("catalan" == value)) + { + parsedValue = PerformanceCounterLanguageType.catalan; + } + else + { + if (("chinese" == value)) + { + parsedValue = PerformanceCounterLanguageType.chinese; + } + else + { + if (("croatian" == value)) + { + parsedValue = PerformanceCounterLanguageType.croatian; + } + else + { + if (("czech" == value)) + { + parsedValue = PerformanceCounterLanguageType.czech; + } + else + { + if (("danish" == value)) + { + parsedValue = PerformanceCounterLanguageType.danish; + } + else + { + if (("divehi" == value)) + { + parsedValue = PerformanceCounterLanguageType.divehi; + } + else + { + if (("dutch" == value)) + { + parsedValue = PerformanceCounterLanguageType.dutch; + } + else + { + if (("english" == value)) + { + parsedValue = PerformanceCounterLanguageType.english; + } + else + { + if (("estonian" == value)) + { + parsedValue = PerformanceCounterLanguageType.estonian; + } + else + { + if (("faeroese" == value)) + { + parsedValue = PerformanceCounterLanguageType.faeroese; + } + else + { + if (("farsi" == value)) + { + parsedValue = PerformanceCounterLanguageType.farsi; + } + else + { + if (("finnish" == value)) + { + parsedValue = PerformanceCounterLanguageType.finnish; + } + else + { + if (("french" == value)) + { + parsedValue = PerformanceCounterLanguageType.french; + } + else + { + if (("galician" == value)) + { + parsedValue = PerformanceCounterLanguageType.galician; + } + else + { + if (("georgian" == value)) + { + parsedValue = PerformanceCounterLanguageType.georgian; + } + else + { + if (("german" == value)) + { + parsedValue = PerformanceCounterLanguageType.german; + } + else + { + if (("greek" == value)) + { + parsedValue = PerformanceCounterLanguageType.greek; + } + else + { + if (("gujarati" == value)) + { + parsedValue = PerformanceCounterLanguageType.gujarati; + } + else + { + if (("hebrew" == value)) + { + parsedValue = PerformanceCounterLanguageType.hebrew; + } + else + { + if (("hindi" == value)) + { + parsedValue = PerformanceCounterLanguageType.hindi; + } + else + { + if (("hungarian" == value)) + { + parsedValue = PerformanceCounterLanguageType.hungarian; + } + else + { + if (("icelandic" == value)) + { + parsedValue = PerformanceCounterLanguageType.icelandic; + } + else + { + if (("indonesian" == value)) + { + parsedValue = PerformanceCounterLanguageType.indonesian; + } + else + { + if (("italian" == value)) + { + parsedValue = PerformanceCounterLanguageType.italian; + } + else + { + if (("japanese" == value)) + { + parsedValue = PerformanceCounterLanguageType.japanese; + } + else + { + if (("kannada" == value)) + { + parsedValue = PerformanceCounterLanguageType.kannada; + } + else + { + if (("kashmiri" == value)) + { + parsedValue = PerformanceCounterLanguageType.kashmiri; + } + else + { + if (("kazak" == value)) + { + parsedValue = PerformanceCounterLanguageType.kazak; + } + else + { + if (("konkani" == value)) + { + parsedValue = PerformanceCounterLanguageType.konkani; + } + else + { + if (("korean" == value)) + { + parsedValue = PerformanceCounterLanguageType.korean; + } + else + { + if (("kyrgyz" == value)) + { + parsedValue = PerformanceCounterLanguageType.kyrgyz; + } + else + { + if (("latvian" == value)) + { + parsedValue = PerformanceCounterLanguageType.latvian; + } + else + { + if (("lithuanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.lithuanian; + } + else + { + if (("macedonian" == value)) + { + parsedValue = PerformanceCounterLanguageType.macedonian; + } + else + { + if (("malay" == value)) + { + parsedValue = PerformanceCounterLanguageType.malay; + } + else + { + if (("malayalam" == value)) + { + parsedValue = PerformanceCounterLanguageType.malayalam; + } + else + { + if (("manipuri" == value)) + { + parsedValue = PerformanceCounterLanguageType.manipuri; + } + else + { + if (("marathi" == value)) + { + parsedValue = PerformanceCounterLanguageType.marathi; + } + else + { + if (("mongolian" == value)) + { + parsedValue = PerformanceCounterLanguageType.mongolian; + } + else + { + if (("nepali" == value)) + { + parsedValue = PerformanceCounterLanguageType.nepali; + } + else + { + if (("norwegian" == value)) + { + parsedValue = PerformanceCounterLanguageType.norwegian; + } + else + { + if (("oriya" == value)) + { + parsedValue = PerformanceCounterLanguageType.oriya; + } + else + { + if (("polish" == value)) + { + parsedValue = PerformanceCounterLanguageType.polish; + } + else + { + if (("portuguese" == value)) + { + parsedValue = PerformanceCounterLanguageType.portuguese; + } + else + { + if (("punjabi" == value)) + { + parsedValue = PerformanceCounterLanguageType.punjabi; + } + else + { + if (("romanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.romanian; + } + else + { + if (("russian" == value)) + { + parsedValue = PerformanceCounterLanguageType.russian; + } + else + { + if (("sanskrit" == value)) + { + parsedValue = PerformanceCounterLanguageType.sanskrit; + } + else + { + if (("serbian" == value)) + { + parsedValue = PerformanceCounterLanguageType.serbian; + } + else + { + if (("sindhi" == value)) + { + parsedValue = PerformanceCounterLanguageType.sindhi; + } + else + { + if (("slovak" == value)) + { + parsedValue = PerformanceCounterLanguageType.slovak; + } + else + { + if (("slovenian" == value)) + { + parsedValue = PerformanceCounterLanguageType.slovenian; + } + else + { + if (("spanish" == value)) + { + parsedValue = PerformanceCounterLanguageType.spanish; + } + else + { + if (("swahili" == value)) + { + parsedValue = PerformanceCounterLanguageType.swahili; + } + else + { + if (("swedish" == value)) + { + parsedValue = PerformanceCounterLanguageType.swedish; + } + else + { + if (("syriac" == value)) + { + parsedValue = PerformanceCounterLanguageType.syriac; + } + else + { + if (("tamil" == value)) + { + parsedValue = PerformanceCounterLanguageType.tamil; + } + else + { + if (("tatar" == value)) + { + parsedValue = PerformanceCounterLanguageType.tatar; + } + else + { + if (("telugu" == value)) + { + parsedValue = PerformanceCounterLanguageType.telugu; + } + else + { + if (("thai" == value)) + { + parsedValue = PerformanceCounterLanguageType.thai; + } + else + { + if (("turkish" == value)) + { + parsedValue = PerformanceCounterLanguageType.turkish; + } + else + { + if (("ukrainian" == value)) + { + parsedValue = PerformanceCounterLanguageType.ukrainian; + } + else + { + if (("urdu" == value)) + { + parsedValue = PerformanceCounterLanguageType.urdu; + } + else + { + if (("uzbek" == value)) + { + parsedValue = PerformanceCounterLanguageType.uzbek; + } + else + { + if (("vietnamese" == value)) + { + parsedValue = PerformanceCounterLanguageType.vietnamese; + } + else + { + parsedValue = PerformanceCounterLanguageType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a PerformanceCounterTypesType from a string. + /// + public static PerformanceCounterTypesType ParsePerformanceCounterTypesType(string value) + { + PerformanceCounterTypesType parsedValue; + Enums.TryParsePerformanceCounterTypesType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PerformanceCounterTypesType from a string. + /// + public static bool TryParsePerformanceCounterTypesType(string value, out PerformanceCounterTypesType parsedValue) + { + parsedValue = PerformanceCounterTypesType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("averageBase" == value)) + { + parsedValue = PerformanceCounterTypesType.averageBase; + } + else + { + if (("averageCount64" == value)) + { + parsedValue = PerformanceCounterTypesType.averageCount64; + } + else + { + if (("averageTimer32" == value)) + { + parsedValue = PerformanceCounterTypesType.averageTimer32; + } + else + { + if (("counterDelta32" == value)) + { + parsedValue = PerformanceCounterTypesType.counterDelta32; + } + else + { + if (("counterTimerInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterTimerInverse; + } + else + { + if (("sampleFraction" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleFraction; + } + else + { + if (("timer100Ns" == value)) + { + parsedValue = PerformanceCounterTypesType.timer100Ns; + } + else + { + if (("counterTimer" == value)) + { + parsedValue = PerformanceCounterTypesType.counterTimer; + } + else + { + if (("rawFraction" == value)) + { + parsedValue = PerformanceCounterTypesType.rawFraction; + } + else + { + if (("timer100NsInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.timer100NsInverse; + } + else + { + if (("counterMultiTimer" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer; + } + else + { + if (("counterMultiTimer100Ns" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer100Ns; + } + else + { + if (("counterMultiTimerInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimerInverse; + } + else + { + if (("counterMultiTimer100NsInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer100NsInverse; + } + else + { + if (("elapsedTime" == value)) + { + parsedValue = PerformanceCounterTypesType.elapsedTime; + } + else + { + if (("sampleBase" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleBase; + } + else + { + if (("rawBase" == value)) + { + parsedValue = PerformanceCounterTypesType.rawBase; + } + else + { + if (("counterMultiBase" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiBase; + } + else + { + if (("rateOfCountsPerSecond64" == value)) + { + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond64; + } + else + { + if (("rateOfCountsPerSecond32" == value)) + { + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond32; + } + else + { + if (("countPerTimeInterval64" == value)) + { + parsedValue = PerformanceCounterTypesType.countPerTimeInterval64; + } + else + { + if (("countPerTimeInterval32" == value)) + { + parsedValue = PerformanceCounterTypesType.countPerTimeInterval32; + } + else + { + if (("sampleCounter" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleCounter; + } + else + { + if (("counterDelta64" == value)) + { + parsedValue = PerformanceCounterTypesType.counterDelta64; + } + else + { + if (("numberOfItems64" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItems64; + } + else + { + if (("numberOfItems32" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItems32; + } + else + { + if (("numberOfItemsHEX64" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX64; + } + else + { + if (("numberOfItemsHEX32" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX32; + } + else + { + parsedValue = PerformanceCounterTypesType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + } + + /// + /// Enumeration of valid languages for performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum PerformanceCounterLanguageType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + afrikaans, + + albanian, + + arabic, + + armenian, + + assamese, + + azeri, + + basque, + + belarusian, + + bengali, + + bulgarian, + + catalan, + + chinese, + + croatian, + + czech, + + danish, + + divehi, + + dutch, + + english, + + estonian, + + faeroese, + + farsi, + + finnish, + + french, + + galician, + + georgian, + + german, + + greek, + + gujarati, + + hebrew, + + hindi, + + hungarian, + + icelandic, + + indonesian, + + italian, + + japanese, + + kannada, + + kashmiri, + + kazak, + + konkani, + + korean, + + kyrgyz, + + latvian, + + lithuanian, + + macedonian, + + malay, + + malayalam, + + manipuri, + + marathi, + + mongolian, + + nepali, + + norwegian, + + oriya, + + polish, + + portuguese, + + punjabi, + + romanian, + + russian, + + sanskrit, + + serbian, + + sindhi, + + slovak, + + slovenian, + + spanish, + + swahili, + + swedish, + + syriac, + + tamil, + + tatar, + + telugu, + + thai, + + turkish, + + ukrainian, + + urdu, + + uzbek, + + vietnamese, + } + + /// + /// Enumeration of valid types for performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum PerformanceCounterTypesType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + averageBase, + + averageCount64, + + averageTimer32, + + counterDelta32, + + counterTimerInverse, + + sampleFraction, + + timer100Ns, + + counterTimer, + + rawFraction, + + timer100NsInverse, + + counterMultiTimer, + + counterMultiTimer100Ns, + + counterMultiTimerInverse, + + counterMultiTimer100NsInverse, + + elapsedTime, + + sampleBase, + + rawBase, + + counterMultiBase, + + rateOfCountsPerSecond64, + + rateOfCountsPerSecond32, + + countPerTimeInterval64, + + countPerTimeInterval32, + + sampleCounter, + + counterDelta64, + + numberOfItems64, + + numberOfItems32, + + numberOfItemsHEX64, + + numberOfItemsHEX32, + } + + /// + /// Closes applications or schedules a reboot if application cannot be closed. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class CloseApplication : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private YesNoType closeMessageField; + + private bool closeMessageFieldSet; + + private YesNoType endSessionMessageField; + + private bool endSessionMessageFieldSet; + + private YesNoType elevatedCloseMessageField; + + private bool elevatedCloseMessageFieldSet; + + private YesNoType elevatedEndSessionMessageField; + + private bool elevatedEndSessionMessageFieldSet; + + private YesNoType rebootPromptField; + + private bool rebootPromptFieldSet; + + private YesNoType promptToContinueField; + + private bool promptToContinueFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private int terminateProcessField; + + private bool terminateProcessFieldSet; + + private int timeoutField; + + private bool timeoutFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the close application (primary key). If the Id is not specified, one will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the exectuable to be closed. This should only be the file name. + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Description to show if application is running and needs to be closed. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Optionally orders the applications to be closed. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Optionally sends a close message to the application. Default is no. + /// + public YesNoType CloseMessage + { + get + { + return this.closeMessageField; + } + set + { + this.closeMessageFieldSet = true; + this.closeMessageField = value; + } + } + + /// + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application. Default is "no". + /// + public YesNoType EndSessionMessage + { + get + { + return this.endSessionMessageField; + } + set + { + this.endSessionMessageFieldSet = true; + this.endSessionMessageField = value; + } + } + + /// + /// Optionally sends a close message to the application from deffered action without impersonation. Default is no. + /// + public YesNoType ElevatedCloseMessage + { + get + { + return this.elevatedCloseMessageField; + } + set + { + this.elevatedCloseMessageFieldSet = true; + this.elevatedCloseMessageField = value; + } + } + + /// + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application from a deffered action without impersonation. Default is "no". + /// + public YesNoType ElevatedEndSessionMessage + { + get + { + return this.elevatedEndSessionMessageField; + } + set + { + this.elevatedEndSessionMessageFieldSet = true; + this.elevatedEndSessionMessageField = value; + } + } + + /// + /// Optionally prompts for reboot if application is still running. The default is "yes". The TerminateProcess attribute must be "no" or not specified if this attribute is "yes". + /// + public YesNoType RebootPrompt + { + get + { + return this.rebootPromptField; + } + set + { + this.rebootPromptFieldSet = true; + this.rebootPromptField = value; + } + } + + /// + /// When this attribute is set to "yes", the user will be prompted when the application is still running. The Description attribute must contain the message to + /// display in the prompt. The prompt occurs before executing any of the other options and gives the options to "Abort", "Retry", or "Ignore". Abort will cancel + /// the install. Retry will attempt the check again and if the application is still running, prompt again. "Ignore" will continue and execute any other options + /// set on the CloseApplication element. The default is "no". + /// + public YesNoType PromptToContinue + { + get + { + return this.promptToContinueField; + } + set + { + this.promptToContinueFieldSet = true; + this.promptToContinueField = value; + } + } + + /// + /// Property to be set if application is still running. Useful for launch conditions or to conditionalize custom UI to ask user to shut down apps. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// Attempts to terminates process and return the specified exit code if application is still running after sending any requested close and/or end session messages. + /// If this attribute is specified, the RebootPrompt attribute must be "no". The default is "no". + /// + public int TerminateProcess + { + get + { + return this.terminateProcessField; + } + set + { + this.terminateProcessFieldSet = true; + this.terminateProcessField = value; + } + } + + /// + /// Optional time in seconds to wait for the application to exit after the close and/or end session messages. If the application is still running after the timeout then + /// the RebootPrompt or TerminateProcess attributes will be considered. The default value is "5" seconds. + /// + public int Timeout + { + get + { + return this.timeoutField; + } + set + { + this.timeoutFieldSet = true; + this.timeoutField = value; + } + } + + /// + /// Condition that determines if the application should be closed. Must be blank or evaluate to true + /// for the application to be scheduled for closing. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CloseApplication", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.closeMessageFieldSet) + { + if ((this.closeMessageField == YesNoType.no)) + { + writer.WriteAttributeString("CloseMessage", "no"); + } + if ((this.closeMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("CloseMessage", "yes"); + } + } + if (this.endSessionMessageFieldSet) + { + if ((this.endSessionMessageField == YesNoType.no)) + { + writer.WriteAttributeString("EndSessionMessage", "no"); + } + if ((this.endSessionMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("EndSessionMessage", "yes"); + } + } + if (this.elevatedCloseMessageFieldSet) + { + if ((this.elevatedCloseMessageField == YesNoType.no)) + { + writer.WriteAttributeString("ElevatedCloseMessage", "no"); + } + if ((this.elevatedCloseMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevatedCloseMessage", "yes"); + } + } + if (this.elevatedEndSessionMessageFieldSet) + { + if ((this.elevatedEndSessionMessageField == YesNoType.no)) + { + writer.WriteAttributeString("ElevatedEndSessionMessage", "no"); + } + if ((this.elevatedEndSessionMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevatedEndSessionMessage", "yes"); + } + } + if (this.rebootPromptFieldSet) + { + if ((this.rebootPromptField == YesNoType.no)) + { + writer.WriteAttributeString("RebootPrompt", "no"); + } + if ((this.rebootPromptField == YesNoType.yes)) + { + writer.WriteAttributeString("RebootPrompt", "yes"); + } + } + if (this.promptToContinueFieldSet) + { + if ((this.promptToContinueField == YesNoType.no)) + { + writer.WriteAttributeString("PromptToContinue", "no"); + } + if ((this.promptToContinueField == YesNoType.yes)) + { + writer.WriteAttributeString("PromptToContinue", "yes"); + } + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.terminateProcessFieldSet) + { + writer.WriteAttributeString("TerminateProcess", this.terminateProcessField.ToString(CultureInfo.InvariantCulture)); + } + if (this.timeoutFieldSet) + { + writer.WriteAttributeString("Timeout", this.timeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("CloseMessage" == name)) + { + this.closeMessageField = Enums.ParseYesNoType(value); + this.closeMessageFieldSet = true; + } + if (("EndSessionMessage" == name)) + { + this.endSessionMessageField = Enums.ParseYesNoType(value); + this.endSessionMessageFieldSet = true; + } + if (("ElevatedCloseMessage" == name)) + { + this.elevatedCloseMessageField = Enums.ParseYesNoType(value); + this.elevatedCloseMessageFieldSet = true; + } + if (("ElevatedEndSessionMessage" == name)) + { + this.elevatedEndSessionMessageField = Enums.ParseYesNoType(value); + this.elevatedEndSessionMessageFieldSet = true; + } + if (("RebootPrompt" == name)) + { + this.rebootPromptField = Enums.ParseYesNoType(value); + this.rebootPromptFieldSet = true; + } + if (("PromptToContinue" == name)) + { + this.promptToContinueField = Enums.ParseYesNoType(value); + this.promptToContinueFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("TerminateProcess" == name)) + { + this.terminateProcessField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.terminateProcessFieldSet = true; + } + if (("Timeout" == name)) + { + this.timeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.timeoutFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Describes a component search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ComponentSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Component to search for. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// Optional ProductCode to determine if the component is installed. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// Rather than saving the matching key path into the variable, a ComponentSearch can save an attribute of the component instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + ComponentSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = ResultType.directory; + } + else + { + if (("state" == value)) + { + parsedValue = ResultType.state; + } + else + { + if (("keyPath" == value)) + { + parsedValue = ResultType.keyPath; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.directory)) + { + writer.WriteAttributeString("Result", "directory"); + } + if ((this.resultField == ResultType.state)) + { + writer.WriteAttributeString("Result", "state"); + } + if ((this.resultField == ResultType.keyPath)) + { + writer.WriteAttributeString("Result", "keyPath"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = ComponentSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves the parent directory for the component's file key path; other types of key path are returned unmodified. + /// + directory, + + /// + /// Saves the state of the component: absent (2), locally installed (3), will run from source (4), or installed in default location (either local or from source) (5) + /// + state, + + /// + /// Saves the key path of the component if installed. This is the default. + /// + keyPath, + } + } + + /// + /// References a ComponentSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ComponentSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Describes a directory search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class DirectorySearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Directory path to search for. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Rather than saving the matching directory path into the variable, a DirectorySearch can save an + /// attribute of the matching directory instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + DirectorySearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = DirectorySearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching directory is found; false otherwise. + /// + exists, + } + } + + /// + /// References a DirectorySearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class DirectorySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates an event source. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class EventSource : ISchemaElement, ISetAttributes + { + + private int categoryCountField; + + private bool categoryCountFieldSet; + + private string categoryMessageFileField; + + private bool categoryMessageFileFieldSet; + + private string eventMessageFileField; + + private bool eventMessageFileFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private string logField; + + private bool logFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string parameterMessageFileField; + + private bool parameterMessageFileFieldSet; + + private YesNoType supportsErrorsField; + + private bool supportsErrorsFieldSet; + + private YesNoType supportsFailureAuditsField; + + private bool supportsFailureAuditsFieldSet; + + private YesNoType supportsInformationalsField; + + private bool supportsInformationalsFieldSet; + + private YesNoType supportsSuccessAuditsField; + + private bool supportsSuccessAuditsFieldSet; + + private YesNoType supportsWarningsField; + + private bool supportsWarningsFieldSet; + + private ISchemaElement parentElement; + + /// + /// The number of categories in CategoryMessageFile. CategoryMessageFile + /// must be specified too. + /// + public int CategoryCount + { + get + { + return this.categoryCountField; + } + set + { + this.categoryCountFieldSet = true; + this.categoryCountField = value; + } + } + + /// + /// Name of the category message file. CategoryCount must be specified too. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string CategoryMessageFile + { + get + { + return this.categoryMessageFileField; + } + set + { + this.categoryMessageFileFieldSet = true; + this.categoryMessageFileField = value; + } + } + + /// + /// Name of the event message file. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string EventMessageFile + { + get + { + return this.eventMessageFileField; + } + set + { + this.eventMessageFileFieldSet = true; + this.eventMessageFileField = value; + } + } + + /// + /// Marks the EventSource registry as the key path of the component it belongs to. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// Name of the event source's log. + /// + public string Log + { + get + { + return this.logField; + } + set + { + this.logFieldSet = true; + this.logField = value; + } + } + + /// + /// Name of the event source. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Name of the parameter message file. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string ParameterMessageFile + { + get + { + return this.parameterMessageFileField; + } + set + { + this.parameterMessageFileFieldSet = true; + this.parameterMessageFileField = value; + } + } + + /// + /// Equivalent to EVENTLOG_ERROR_TYPE. + /// + public YesNoType SupportsErrors + { + get + { + return this.supportsErrorsField; + } + set + { + this.supportsErrorsFieldSet = true; + this.supportsErrorsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_AUDIT_FAILURE. + /// + public YesNoType SupportsFailureAudits + { + get + { + return this.supportsFailureAuditsField; + } + set + { + this.supportsFailureAuditsFieldSet = true; + this.supportsFailureAuditsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_INFORMATION_TYPE. + /// + public YesNoType SupportsInformationals + { + get + { + return this.supportsInformationalsField; + } + set + { + this.supportsInformationalsFieldSet = true; + this.supportsInformationalsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_AUDIT_SUCCESS. + /// + public YesNoType SupportsSuccessAudits + { + get + { + return this.supportsSuccessAuditsField; + } + set + { + this.supportsSuccessAuditsFieldSet = true; + this.supportsSuccessAuditsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_WARNING_TYPE. + /// + public YesNoType SupportsWarnings + { + get + { + return this.supportsWarningsField; + } + set + { + this.supportsWarningsFieldSet = true; + this.supportsWarningsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EventSource", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.categoryCountFieldSet) + { + writer.WriteAttributeString("CategoryCount", this.categoryCountField.ToString(CultureInfo.InvariantCulture)); + } + if (this.categoryMessageFileFieldSet) + { + writer.WriteAttributeString("CategoryMessageFile", this.categoryMessageFileField); + } + if (this.eventMessageFileFieldSet) + { + writer.WriteAttributeString("EventMessageFile", this.eventMessageFileField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.logFieldSet) + { + writer.WriteAttributeString("Log", this.logField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.parameterMessageFileFieldSet) + { + writer.WriteAttributeString("ParameterMessageFile", this.parameterMessageFileField); + } + if (this.supportsErrorsFieldSet) + { + if ((this.supportsErrorsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsErrors", "no"); + } + if ((this.supportsErrorsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsErrors", "yes"); + } + } + if (this.supportsFailureAuditsFieldSet) + { + if ((this.supportsFailureAuditsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsFailureAudits", "no"); + } + if ((this.supportsFailureAuditsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsFailureAudits", "yes"); + } + } + if (this.supportsInformationalsFieldSet) + { + if ((this.supportsInformationalsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsInformationals", "no"); + } + if ((this.supportsInformationalsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsInformationals", "yes"); + } + } + if (this.supportsSuccessAuditsFieldSet) + { + if ((this.supportsSuccessAuditsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsSuccessAudits", "no"); + } + if ((this.supportsSuccessAuditsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsSuccessAudits", "yes"); + } + } + if (this.supportsWarningsFieldSet) + { + if ((this.supportsWarningsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsWarnings", "no"); + } + if ((this.supportsWarningsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsWarnings", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("CategoryCount" == name)) + { + this.categoryCountField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.categoryCountFieldSet = true; + } + if (("CategoryMessageFile" == name)) + { + this.categoryMessageFileField = value; + this.categoryMessageFileFieldSet = true; + } + if (("EventMessageFile" == name)) + { + this.eventMessageFileField = value; + this.eventMessageFileFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("Log" == name)) + { + this.logField = value; + this.logFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ParameterMessageFile" == name)) + { + this.parameterMessageFileField = value; + this.parameterMessageFileFieldSet = true; + } + if (("SupportsErrors" == name)) + { + this.supportsErrorsField = Enums.ParseYesNoType(value); + this.supportsErrorsFieldSet = true; + } + if (("SupportsFailureAudits" == name)) + { + this.supportsFailureAuditsField = Enums.ParseYesNoType(value); + this.supportsFailureAuditsFieldSet = true; + } + if (("SupportsInformationals" == name)) + { + this.supportsInformationalsField = Enums.ParseYesNoType(value); + this.supportsInformationalsFieldSet = true; + } + if (("SupportsSuccessAudits" == name)) + { + this.supportsSuccessAuditsField = Enums.ParseYesNoType(value); + this.supportsSuccessAuditsFieldSet = true; + } + if (("SupportsWarnings" == name)) + { + this.supportsWarningsField = Enums.ParseYesNoType(value); + this.supportsWarningsFieldSet = true; + } + } + } + + /// + /// Describes a file search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// File path to search for. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Rather than saving the matching file path into the variable, a FileSearch can save an attribute of the matching file instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + FileSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + if (("version" == value)) + { + parsedValue = ResultType.version; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + if ((this.resultField == ResultType.version)) + { + writer.WriteAttributeString("Result", "version"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = FileSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching file is found; false otherwise. + /// + exists, + + /// + /// Saves the version information for files that have it (.exe, .dll); zero-version (0.0.0.0) otherwise. + /// + version, + } + } + + /// + /// References a FileSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates a file share out of the component's directory. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileShare : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private ISchemaElement parentElement; + + public FileShare() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(FileSharePermission))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the file share (primary key). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the file share. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Description of the file share. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("FileSharePermission" == childName)) + { + childValue = new FileSharePermission(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileShare", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + } + } + + /// + /// Sets ACLs on a FileShare. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSharePermission : ISchemaElement, ISetAttributes + { + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private ISchemaElement parentElement; + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSharePermission", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + } + } + + /// + /// Formats a file's contents at install time. The contents are formatted according to the rules of the + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FormatFile : ISchemaElement, ISetAttributes + { + + private string binaryKeyField; + + private bool binaryKeyFieldSet; + + private ISchemaElement parentElement; + + /// + /// The id of a Binary row that contains a copy of the file. The file in the Binary table overwrites whatever + /// file is installed by the parent component. + /// + public string BinaryKey + { + get + { + return this.binaryKeyField; + } + set + { + this.binaryKeyFieldSet = true; + this.binaryKeyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FormatFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.binaryKeyFieldSet) + { + writer.WriteAttributeString("BinaryKey", this.binaryKeyField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("BinaryKey" == name)) + { + this.binaryKeyField = value; + this.binaryKeyFieldSet = true; + } + } + } + + /// + /// Finds user groups on the local machine or specified Active Directory domain. The local machine will be + /// searched for the group first then fallback to looking in Active Directory. This element is not capable + /// of creating new groups but can be used to add new or existing users to an existing group. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Group : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string domainField; + + private bool domainFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier in your installation package for this group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// An optional + /// + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Group", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + } + } + + /// + /// Used to join a user to a group + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class GroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("GroupRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates a shortcut to a URL. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class InternetShortcut : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private string iconFileField; + + private bool iconFileFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier in your installation package for this Internet shortcut. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Identifier reference to Directory element where shortcut is to be created. This attribute's value defaults to the parent Component directory. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// The name of the shortcut file, which is visible to the user. (The .lnk + /// extension is added automatically and by default, is not shown to the user.) + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// URL that should be opened when the user selects the shortcut. Windows + /// opens the URL in the appropriate handler for the protocol specified + /// in the URL. Note that this is a formatted field, so you can use + /// [#fileId] syntax to refer to a file being installed (using the file: + /// protocol). + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Which type of shortcut should be created. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Icon file that should be displayed. Note that this is a formatted field, so you can use + /// [#fileId] syntax to refer to a file being installed (using the file: + /// protocol). + /// + public string IconFile + { + get + { + return this.iconFileField; + } + set + { + this.iconFileFieldSet = true; + this.iconFileField = value; + } + } + + /// + /// Index of the icon being referenced + /// + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + InternetShortcut.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("url" == value)) + { + parsedValue = TypeType.url; + } + else + { + if (("link" == value)) + { + parsedValue = TypeType.link; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InternetShortcut", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.url)) + { + writer.WriteAttributeString("Type", "url"); + } + if ((this.typeField == TypeType.link)) + { + writer.WriteAttributeString("Type", "link"); + } + } + if (this.iconFileFieldSet) + { + writer.WriteAttributeString("IconFile", this.iconFileField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = InternetShortcut.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("IconFile" == name)) + { + this.iconFileField = value; + this.iconFileFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates .url files using IUniformResourceLocatorW. + /// + url, + + /// + /// Creates .lnk files using IShellLinkW (default). + /// + link, + } + } + + /// + /// Used to create performance categories and configure performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerformanceCategory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private YesNoType multiInstanceField; + + private bool multiInstanceFieldSet; + + private string libraryField; + + private bool libraryFieldSet; + + private string openField; + + private bool openFieldSet; + + private string closeField; + + private bool closeFieldSet; + + private string collectField; + + private bool collectFieldSet; + + private PerformanceCounterLanguageType defaultLanguageField; + + private bool defaultLanguageFieldSet; + + private ISchemaElement parentElement; + + public PerformanceCategory() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PerformanceCounter))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier in your installation package for this performance counter category. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the performance counter category. If this attribute is not provided the Id attribute is used as the name of the performance counter category. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Optional help text for the performance counter category. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// Flag that specifies whether the performance counter category is multi or single instanced. Default is single instance. + /// + public YesNoType MultiInstance + { + get + { + return this.multiInstanceField; + } + set + { + this.multiInstanceFieldSet = true; + this.multiInstanceField = value; + } + } + + /// + /// DLL that contains the performance counter. The default is "netfxperf.dll" which should be used for all managed code performance counters. + /// + public string Library + { + get + { + return this.libraryField; + } + set + { + this.libraryFieldSet = true; + this.libraryField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when opening the performance counter. The default is "OpenPerformanceData" which should be used for all managed code performance counters. + /// + public string Open + { + get + { + return this.openField; + } + set + { + this.openFieldSet = true; + this.openField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when closing the performance counter. The default is "ClosePerformanceData" which should be used for all managed code performance counters. + /// + public string Close + { + get + { + return this.closeField; + } + set + { + this.closeFieldSet = true; + this.closeField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when collecting data from the performance counter. The default is "CollectPerformanceData" which should be used for all managed code performance counters. + /// + public string Collect + { + get + { + return this.collectField; + } + set + { + this.collectFieldSet = true; + this.collectField = value; + } + } + + /// + /// Default language for the performance category and contained counters' names and help text. + /// + public PerformanceCounterLanguageType DefaultLanguage + { + get + { + return this.defaultLanguageField; + } + set + { + this.defaultLanguageFieldSet = true; + this.defaultLanguageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PerformanceCounter" == childName)) + { + childValue = new PerformanceCounter(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerformanceCategory", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.multiInstanceFieldSet) + { + if ((this.multiInstanceField == YesNoType.no)) + { + writer.WriteAttributeString("MultiInstance", "no"); + } + if ((this.multiInstanceField == YesNoType.yes)) + { + writer.WriteAttributeString("MultiInstance", "yes"); + } + } + if (this.libraryFieldSet) + { + writer.WriteAttributeString("Library", this.libraryField); + } + if (this.openFieldSet) + { + writer.WriteAttributeString("Open", this.openField); + } + if (this.closeFieldSet) + { + writer.WriteAttributeString("Close", this.closeField); + } + if (this.collectFieldSet) + { + writer.WriteAttributeString("Collect", this.collectField); + } + if (this.defaultLanguageFieldSet) + { + if ((this.defaultLanguageField == PerformanceCounterLanguageType.afrikaans)) + { + writer.WriteAttributeString("DefaultLanguage", "afrikaans"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.albanian)) + { + writer.WriteAttributeString("DefaultLanguage", "albanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.arabic)) + { + writer.WriteAttributeString("DefaultLanguage", "arabic"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.armenian)) + { + writer.WriteAttributeString("DefaultLanguage", "armenian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.assamese)) + { + writer.WriteAttributeString("DefaultLanguage", "assamese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.azeri)) + { + writer.WriteAttributeString("DefaultLanguage", "azeri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.basque)) + { + writer.WriteAttributeString("DefaultLanguage", "basque"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.belarusian)) + { + writer.WriteAttributeString("DefaultLanguage", "belarusian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bengali)) + { + writer.WriteAttributeString("DefaultLanguage", "bengali"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bulgarian)) + { + writer.WriteAttributeString("DefaultLanguage", "bulgarian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.catalan)) + { + writer.WriteAttributeString("DefaultLanguage", "catalan"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.chinese)) + { + writer.WriteAttributeString("DefaultLanguage", "chinese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.croatian)) + { + writer.WriteAttributeString("DefaultLanguage", "croatian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.czech)) + { + writer.WriteAttributeString("DefaultLanguage", "czech"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.danish)) + { + writer.WriteAttributeString("DefaultLanguage", "danish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.divehi)) + { + writer.WriteAttributeString("DefaultLanguage", "divehi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.dutch)) + { + writer.WriteAttributeString("DefaultLanguage", "dutch"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.english)) + { + writer.WriteAttributeString("DefaultLanguage", "english"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.estonian)) + { + writer.WriteAttributeString("DefaultLanguage", "estonian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.faeroese)) + { + writer.WriteAttributeString("DefaultLanguage", "faeroese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.farsi)) + { + writer.WriteAttributeString("DefaultLanguage", "farsi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.finnish)) + { + writer.WriteAttributeString("DefaultLanguage", "finnish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.french)) + { + writer.WriteAttributeString("DefaultLanguage", "french"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.galician)) + { + writer.WriteAttributeString("DefaultLanguage", "galician"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.georgian)) + { + writer.WriteAttributeString("DefaultLanguage", "georgian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.german)) + { + writer.WriteAttributeString("DefaultLanguage", "german"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.greek)) + { + writer.WriteAttributeString("DefaultLanguage", "greek"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.gujarati)) + { + writer.WriteAttributeString("DefaultLanguage", "gujarati"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hebrew)) + { + writer.WriteAttributeString("DefaultLanguage", "hebrew"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hindi)) + { + writer.WriteAttributeString("DefaultLanguage", "hindi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hungarian)) + { + writer.WriteAttributeString("DefaultLanguage", "hungarian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.icelandic)) + { + writer.WriteAttributeString("DefaultLanguage", "icelandic"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.indonesian)) + { + writer.WriteAttributeString("DefaultLanguage", "indonesian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.italian)) + { + writer.WriteAttributeString("DefaultLanguage", "italian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.japanese)) + { + writer.WriteAttributeString("DefaultLanguage", "japanese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kannada)) + { + writer.WriteAttributeString("DefaultLanguage", "kannada"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kashmiri)) + { + writer.WriteAttributeString("DefaultLanguage", "kashmiri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kazak)) + { + writer.WriteAttributeString("DefaultLanguage", "kazak"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.konkani)) + { + writer.WriteAttributeString("DefaultLanguage", "konkani"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.korean)) + { + writer.WriteAttributeString("DefaultLanguage", "korean"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kyrgyz)) + { + writer.WriteAttributeString("DefaultLanguage", "kyrgyz"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.latvian)) + { + writer.WriteAttributeString("DefaultLanguage", "latvian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.lithuanian)) + { + writer.WriteAttributeString("DefaultLanguage", "lithuanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.macedonian)) + { + writer.WriteAttributeString("DefaultLanguage", "macedonian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.malay)) + { + writer.WriteAttributeString("DefaultLanguage", "malay"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.malayalam)) + { + writer.WriteAttributeString("DefaultLanguage", "malayalam"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.manipuri)) + { + writer.WriteAttributeString("DefaultLanguage", "manipuri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.marathi)) + { + writer.WriteAttributeString("DefaultLanguage", "marathi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.mongolian)) + { + writer.WriteAttributeString("DefaultLanguage", "mongolian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.nepali)) + { + writer.WriteAttributeString("DefaultLanguage", "nepali"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.norwegian)) + { + writer.WriteAttributeString("DefaultLanguage", "norwegian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.oriya)) + { + writer.WriteAttributeString("DefaultLanguage", "oriya"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.polish)) + { + writer.WriteAttributeString("DefaultLanguage", "polish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.portuguese)) + { + writer.WriteAttributeString("DefaultLanguage", "portuguese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.punjabi)) + { + writer.WriteAttributeString("DefaultLanguage", "punjabi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.romanian)) + { + writer.WriteAttributeString("DefaultLanguage", "romanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.russian)) + { + writer.WriteAttributeString("DefaultLanguage", "russian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.sanskrit)) + { + writer.WriteAttributeString("DefaultLanguage", "sanskrit"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.serbian)) + { + writer.WriteAttributeString("DefaultLanguage", "serbian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.sindhi)) + { + writer.WriteAttributeString("DefaultLanguage", "sindhi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovak)) + { + writer.WriteAttributeString("DefaultLanguage", "slovak"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovenian)) + { + writer.WriteAttributeString("DefaultLanguage", "slovenian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.spanish)) + { + writer.WriteAttributeString("DefaultLanguage", "spanish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.swahili)) + { + writer.WriteAttributeString("DefaultLanguage", "swahili"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.swedish)) + { + writer.WriteAttributeString("DefaultLanguage", "swedish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.syriac)) + { + writer.WriteAttributeString("DefaultLanguage", "syriac"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.tamil)) + { + writer.WriteAttributeString("DefaultLanguage", "tamil"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.tatar)) + { + writer.WriteAttributeString("DefaultLanguage", "tatar"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.telugu)) + { + writer.WriteAttributeString("DefaultLanguage", "telugu"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.thai)) + { + writer.WriteAttributeString("DefaultLanguage", "thai"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.turkish)) + { + writer.WriteAttributeString("DefaultLanguage", "turkish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.ukrainian)) + { + writer.WriteAttributeString("DefaultLanguage", "ukrainian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.urdu)) + { + writer.WriteAttributeString("DefaultLanguage", "urdu"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.uzbek)) + { + writer.WriteAttributeString("DefaultLanguage", "uzbek"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.vietnamese)) + { + writer.WriteAttributeString("DefaultLanguage", "vietnamese"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("MultiInstance" == name)) + { + this.multiInstanceField = Enums.ParseYesNoType(value); + this.multiInstanceFieldSet = true; + } + if (("Library" == name)) + { + this.libraryField = value; + this.libraryFieldSet = true; + } + if (("Open" == name)) + { + this.openField = value; + this.openFieldSet = true; + } + if (("Close" == name)) + { + this.closeField = value; + this.closeFieldSet = true; + } + if (("Collect" == name)) + { + this.collectField = value; + this.collectFieldSet = true; + } + if (("DefaultLanguage" == name)) + { + this.defaultLanguageField = Enums.ParsePerformanceCounterLanguageType(value); + this.defaultLanguageFieldSet = true; + } + } + } + + /// + /// Creates a performance counter in a performance category. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerformanceCounter : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private PerformanceCounterTypesType typeField; + + private bool typeFieldSet; + + private PerformanceCounterLanguageType languageField; + + private bool languageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name for the performance counter. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Optional help text for the performance counter. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// Type of the performance counter. + /// + public PerformanceCounterTypesType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Language for the peformance counter name and help. The default is to use the parent PerformanceCategory element's DefaultLanguage attribute. + /// + public PerformanceCounterLanguageType Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerformanceCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.typeFieldSet) + { + if ((this.typeField == PerformanceCounterTypesType.averageBase)) + { + writer.WriteAttributeString("Type", "averageBase"); + } + if ((this.typeField == PerformanceCounterTypesType.averageCount64)) + { + writer.WriteAttributeString("Type", "averageCount64"); + } + if ((this.typeField == PerformanceCounterTypesType.averageTimer32)) + { + writer.WriteAttributeString("Type", "averageTimer32"); + } + if ((this.typeField == PerformanceCounterTypesType.counterDelta32)) + { + writer.WriteAttributeString("Type", "counterDelta32"); + } + if ((this.typeField == PerformanceCounterTypesType.counterTimerInverse)) + { + writer.WriteAttributeString("Type", "counterTimerInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleFraction)) + { + writer.WriteAttributeString("Type", "sampleFraction"); + } + if ((this.typeField == PerformanceCounterTypesType.timer100Ns)) + { + writer.WriteAttributeString("Type", "timer100Ns"); + } + if ((this.typeField == PerformanceCounterTypesType.counterTimer)) + { + writer.WriteAttributeString("Type", "counterTimer"); + } + if ((this.typeField == PerformanceCounterTypesType.rawFraction)) + { + writer.WriteAttributeString("Type", "rawFraction"); + } + if ((this.typeField == PerformanceCounterTypesType.timer100NsInverse)) + { + writer.WriteAttributeString("Type", "timer100NsInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer)) + { + writer.WriteAttributeString("Type", "counterMultiTimer"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100Ns)) + { + writer.WriteAttributeString("Type", "counterMultiTimer100Ns"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimerInverse)) + { + writer.WriteAttributeString("Type", "counterMultiTimerInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100NsInverse)) + { + writer.WriteAttributeString("Type", "counterMultiTimer100NsInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.elapsedTime)) + { + writer.WriteAttributeString("Type", "elapsedTime"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleBase)) + { + writer.WriteAttributeString("Type", "sampleBase"); + } + if ((this.typeField == PerformanceCounterTypesType.rawBase)) + { + writer.WriteAttributeString("Type", "rawBase"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiBase)) + { + writer.WriteAttributeString("Type", "counterMultiBase"); + } + if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond64)) + { + writer.WriteAttributeString("Type", "rateOfCountsPerSecond64"); + } + if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond32)) + { + writer.WriteAttributeString("Type", "rateOfCountsPerSecond32"); + } + if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval64)) + { + writer.WriteAttributeString("Type", "countPerTimeInterval64"); + } + if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval32)) + { + writer.WriteAttributeString("Type", "countPerTimeInterval32"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleCounter)) + { + writer.WriteAttributeString("Type", "sampleCounter"); + } + if ((this.typeField == PerformanceCounterTypesType.counterDelta64)) + { + writer.WriteAttributeString("Type", "counterDelta64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItems64)) + { + writer.WriteAttributeString("Type", "numberOfItems64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItems32)) + { + writer.WriteAttributeString("Type", "numberOfItems32"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX64)) + { + writer.WriteAttributeString("Type", "numberOfItemsHEX64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX32)) + { + writer.WriteAttributeString("Type", "numberOfItemsHEX32"); + } + } + if (this.languageFieldSet) + { + if ((this.languageField == PerformanceCounterLanguageType.afrikaans)) + { + writer.WriteAttributeString("Language", "afrikaans"); + } + if ((this.languageField == PerformanceCounterLanguageType.albanian)) + { + writer.WriteAttributeString("Language", "albanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.arabic)) + { + writer.WriteAttributeString("Language", "arabic"); + } + if ((this.languageField == PerformanceCounterLanguageType.armenian)) + { + writer.WriteAttributeString("Language", "armenian"); + } + if ((this.languageField == PerformanceCounterLanguageType.assamese)) + { + writer.WriteAttributeString("Language", "assamese"); + } + if ((this.languageField == PerformanceCounterLanguageType.azeri)) + { + writer.WriteAttributeString("Language", "azeri"); + } + if ((this.languageField == PerformanceCounterLanguageType.basque)) + { + writer.WriteAttributeString("Language", "basque"); + } + if ((this.languageField == PerformanceCounterLanguageType.belarusian)) + { + writer.WriteAttributeString("Language", "belarusian"); + } + if ((this.languageField == PerformanceCounterLanguageType.bengali)) + { + writer.WriteAttributeString("Language", "bengali"); + } + if ((this.languageField == PerformanceCounterLanguageType.bulgarian)) + { + writer.WriteAttributeString("Language", "bulgarian"); + } + if ((this.languageField == PerformanceCounterLanguageType.catalan)) + { + writer.WriteAttributeString("Language", "catalan"); + } + if ((this.languageField == PerformanceCounterLanguageType.chinese)) + { + writer.WriteAttributeString("Language", "chinese"); + } + if ((this.languageField == PerformanceCounterLanguageType.croatian)) + { + writer.WriteAttributeString("Language", "croatian"); + } + if ((this.languageField == PerformanceCounterLanguageType.czech)) + { + writer.WriteAttributeString("Language", "czech"); + } + if ((this.languageField == PerformanceCounterLanguageType.danish)) + { + writer.WriteAttributeString("Language", "danish"); + } + if ((this.languageField == PerformanceCounterLanguageType.divehi)) + { + writer.WriteAttributeString("Language", "divehi"); + } + if ((this.languageField == PerformanceCounterLanguageType.dutch)) + { + writer.WriteAttributeString("Language", "dutch"); + } + if ((this.languageField == PerformanceCounterLanguageType.english)) + { + writer.WriteAttributeString("Language", "english"); + } + if ((this.languageField == PerformanceCounterLanguageType.estonian)) + { + writer.WriteAttributeString("Language", "estonian"); + } + if ((this.languageField == PerformanceCounterLanguageType.faeroese)) + { + writer.WriteAttributeString("Language", "faeroese"); + } + if ((this.languageField == PerformanceCounterLanguageType.farsi)) + { + writer.WriteAttributeString("Language", "farsi"); + } + if ((this.languageField == PerformanceCounterLanguageType.finnish)) + { + writer.WriteAttributeString("Language", "finnish"); + } + if ((this.languageField == PerformanceCounterLanguageType.french)) + { + writer.WriteAttributeString("Language", "french"); + } + if ((this.languageField == PerformanceCounterLanguageType.galician)) + { + writer.WriteAttributeString("Language", "galician"); + } + if ((this.languageField == PerformanceCounterLanguageType.georgian)) + { + writer.WriteAttributeString("Language", "georgian"); + } + if ((this.languageField == PerformanceCounterLanguageType.german)) + { + writer.WriteAttributeString("Language", "german"); + } + if ((this.languageField == PerformanceCounterLanguageType.greek)) + { + writer.WriteAttributeString("Language", "greek"); + } + if ((this.languageField == PerformanceCounterLanguageType.gujarati)) + { + writer.WriteAttributeString("Language", "gujarati"); + } + if ((this.languageField == PerformanceCounterLanguageType.hebrew)) + { + writer.WriteAttributeString("Language", "hebrew"); + } + if ((this.languageField == PerformanceCounterLanguageType.hindi)) + { + writer.WriteAttributeString("Language", "hindi"); + } + if ((this.languageField == PerformanceCounterLanguageType.hungarian)) + { + writer.WriteAttributeString("Language", "hungarian"); + } + if ((this.languageField == PerformanceCounterLanguageType.icelandic)) + { + writer.WriteAttributeString("Language", "icelandic"); + } + if ((this.languageField == PerformanceCounterLanguageType.indonesian)) + { + writer.WriteAttributeString("Language", "indonesian"); + } + if ((this.languageField == PerformanceCounterLanguageType.italian)) + { + writer.WriteAttributeString("Language", "italian"); + } + if ((this.languageField == PerformanceCounterLanguageType.japanese)) + { + writer.WriteAttributeString("Language", "japanese"); + } + if ((this.languageField == PerformanceCounterLanguageType.kannada)) + { + writer.WriteAttributeString("Language", "kannada"); + } + if ((this.languageField == PerformanceCounterLanguageType.kashmiri)) + { + writer.WriteAttributeString("Language", "kashmiri"); + } + if ((this.languageField == PerformanceCounterLanguageType.kazak)) + { + writer.WriteAttributeString("Language", "kazak"); + } + if ((this.languageField == PerformanceCounterLanguageType.konkani)) + { + writer.WriteAttributeString("Language", "konkani"); + } + if ((this.languageField == PerformanceCounterLanguageType.korean)) + { + writer.WriteAttributeString("Language", "korean"); + } + if ((this.languageField == PerformanceCounterLanguageType.kyrgyz)) + { + writer.WriteAttributeString("Language", "kyrgyz"); + } + if ((this.languageField == PerformanceCounterLanguageType.latvian)) + { + writer.WriteAttributeString("Language", "latvian"); + } + if ((this.languageField == PerformanceCounterLanguageType.lithuanian)) + { + writer.WriteAttributeString("Language", "lithuanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.macedonian)) + { + writer.WriteAttributeString("Language", "macedonian"); + } + if ((this.languageField == PerformanceCounterLanguageType.malay)) + { + writer.WriteAttributeString("Language", "malay"); + } + if ((this.languageField == PerformanceCounterLanguageType.malayalam)) + { + writer.WriteAttributeString("Language", "malayalam"); + } + if ((this.languageField == PerformanceCounterLanguageType.manipuri)) + { + writer.WriteAttributeString("Language", "manipuri"); + } + if ((this.languageField == PerformanceCounterLanguageType.marathi)) + { + writer.WriteAttributeString("Language", "marathi"); + } + if ((this.languageField == PerformanceCounterLanguageType.mongolian)) + { + writer.WriteAttributeString("Language", "mongolian"); + } + if ((this.languageField == PerformanceCounterLanguageType.nepali)) + { + writer.WriteAttributeString("Language", "nepali"); + } + if ((this.languageField == PerformanceCounterLanguageType.norwegian)) + { + writer.WriteAttributeString("Language", "norwegian"); + } + if ((this.languageField == PerformanceCounterLanguageType.oriya)) + { + writer.WriteAttributeString("Language", "oriya"); + } + if ((this.languageField == PerformanceCounterLanguageType.polish)) + { + writer.WriteAttributeString("Language", "polish"); + } + if ((this.languageField == PerformanceCounterLanguageType.portuguese)) + { + writer.WriteAttributeString("Language", "portuguese"); + } + if ((this.languageField == PerformanceCounterLanguageType.punjabi)) + { + writer.WriteAttributeString("Language", "punjabi"); + } + if ((this.languageField == PerformanceCounterLanguageType.romanian)) + { + writer.WriteAttributeString("Language", "romanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.russian)) + { + writer.WriteAttributeString("Language", "russian"); + } + if ((this.languageField == PerformanceCounterLanguageType.sanskrit)) + { + writer.WriteAttributeString("Language", "sanskrit"); + } + if ((this.languageField == PerformanceCounterLanguageType.serbian)) + { + writer.WriteAttributeString("Language", "serbian"); + } + if ((this.languageField == PerformanceCounterLanguageType.sindhi)) + { + writer.WriteAttributeString("Language", "sindhi"); + } + if ((this.languageField == PerformanceCounterLanguageType.slovak)) + { + writer.WriteAttributeString("Language", "slovak"); + } + if ((this.languageField == PerformanceCounterLanguageType.slovenian)) + { + writer.WriteAttributeString("Language", "slovenian"); + } + if ((this.languageField == PerformanceCounterLanguageType.spanish)) + { + writer.WriteAttributeString("Language", "spanish"); + } + if ((this.languageField == PerformanceCounterLanguageType.swahili)) + { + writer.WriteAttributeString("Language", "swahili"); + } + if ((this.languageField == PerformanceCounterLanguageType.swedish)) + { + writer.WriteAttributeString("Language", "swedish"); + } + if ((this.languageField == PerformanceCounterLanguageType.syriac)) + { + writer.WriteAttributeString("Language", "syriac"); + } + if ((this.languageField == PerformanceCounterLanguageType.tamil)) + { + writer.WriteAttributeString("Language", "tamil"); + } + if ((this.languageField == PerformanceCounterLanguageType.tatar)) + { + writer.WriteAttributeString("Language", "tatar"); + } + if ((this.languageField == PerformanceCounterLanguageType.telugu)) + { + writer.WriteAttributeString("Language", "telugu"); + } + if ((this.languageField == PerformanceCounterLanguageType.thai)) + { + writer.WriteAttributeString("Language", "thai"); + } + if ((this.languageField == PerformanceCounterLanguageType.turkish)) + { + writer.WriteAttributeString("Language", "turkish"); + } + if ((this.languageField == PerformanceCounterLanguageType.ukrainian)) + { + writer.WriteAttributeString("Language", "ukrainian"); + } + if ((this.languageField == PerformanceCounterLanguageType.urdu)) + { + writer.WriteAttributeString("Language", "urdu"); + } + if ((this.languageField == PerformanceCounterLanguageType.uzbek)) + { + writer.WriteAttributeString("Language", "uzbek"); + } + if ((this.languageField == PerformanceCounterLanguageType.vietnamese)) + { + writer.WriteAttributeString("Language", "vietnamese"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Enums.ParsePerformanceCounterTypesType(value); + this.typeFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = Enums.ParsePerformanceCounterLanguageType(value); + this.languageFieldSet = true; + } + } + } + + /// + /// Used to install Perfmon counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerfCounter : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private ISchemaElement parentElement; + + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerfCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + } + } + + /// + /// Used to install Perfmon Counter Manifests. + /// Note that this functionality cannot be used with major upgrades that are scheduled after the InstallExecute, + /// InstallExecuteAgain, or InstallFinalize actions. For more information on major upgrade scheduling, see + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerfCounterManifest : ISchemaElement, ISetAttributes + { + + private string resourceFileDirectoryField; + + private bool resourceFileDirectoryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The directory that holds the resource file of the providers in the perfmon counter manifest. Often the resource file path cannot be determined until setup time. Put the directory here and during perfmon manifest registrtion the path will be updated in the registry. If not specified, Perfmon will look for the resource file in the same directory of the perfmon counter manifest file. + /// + public string ResourceFileDirectory + { + get + { + return this.resourceFileDirectoryField; + } + set + { + this.resourceFileDirectoryFieldSet = true; + this.resourceFileDirectoryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerfCounterManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.resourceFileDirectoryFieldSet) + { + writer.WriteAttributeString("ResourceFileDirectory", this.resourceFileDirectoryField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ResourceFileDirectory" == name)) + { + this.resourceFileDirectoryField = value; + this.resourceFileDirectoryFieldSet = true; + } + } + } + + /// + /// Used to install Event Manifests. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class EventManifest : ISchemaElement, ISetAttributes + { + + private string messageFileField; + + private bool messageFileFieldSet; + + private string parameterFileField; + + private bool parameterFileFieldSet; + + private string resourceFileField; + + private bool resourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// The message file (including path) of all the providers in the event manifest. Often the message file path cannot be determined until setup time. Put your MessageFile here and the messageFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string MessageFile + { + get + { + return this.messageFileField; + } + set + { + this.messageFileFieldSet = true; + this.messageFileField = value; + } + } + + /// + /// The parameter file (including path) of all the providers in the event manifest. Often the parameter file path cannot be determined until setup time. Put your ParameterFile here and the parameterFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string ParameterFile + { + get + { + return this.parameterFileField; + } + set + { + this.parameterFileFieldSet = true; + this.parameterFileField = value; + } + } + + /// + /// The resource file (including path) of all the providers in the event manifest. Often the resource file path cannot be determined until setup time. Put your ResourceFile here and the resourceFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string ResourceFile + { + get + { + return this.resourceFileField; + } + set + { + this.resourceFileFieldSet = true; + this.resourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EventManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.messageFileFieldSet) + { + writer.WriteAttributeString("MessageFile", this.messageFileField); + } + if (this.parameterFileFieldSet) + { + writer.WriteAttributeString("ParameterFile", this.parameterFileField); + } + if (this.resourceFileFieldSet) + { + writer.WriteAttributeString("ResourceFile", this.resourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("MessageFile" == name)) + { + this.messageFileField = value; + this.messageFileFieldSet = true; + } + if (("ParameterFile" == name)) + { + this.parameterFileField = value; + this.parameterFileFieldSet = true; + } + if (("ResourceFile" == name)) + { + this.resourceFileField = value; + this.resourceFileFieldSet = true; + } + } + } + + /// + /// Sets ACLs on File, Registry, CreateFolder, or ServiceInstall. When under a Registry element, this cannot be used + /// if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PermissionEx : ISchemaElement, ISetAttributes + { + + private string domainField; + + private bool domainFieldSet; + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType appendField; + + private bool appendFieldSet; + + private YesNoType executeField; + + private bool executeFieldSet; + + private YesNoType writeField; + + private bool writeFieldSet; + + private YesNoType createSubkeysField; + + private bool createSubkeysFieldSet; + + private YesNoType enumerateSubkeysField; + + private bool enumerateSubkeysFieldSet; + + private YesNoType notifyField; + + private bool notifyFieldSet; + + private YesNoType createLinkField; + + private bool createLinkFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private YesNoType serviceQueryConfigField; + + private bool serviceQueryConfigFieldSet; + + private YesNoType serviceChangeConfigField; + + private bool serviceChangeConfigFieldSet; + + private YesNoType serviceQueryStatusField; + + private bool serviceQueryStatusFieldSet; + + private YesNoType serviceEnumerateDependentsField; + + private bool serviceEnumerateDependentsFieldSet; + + private YesNoType serviceStartField; + + private bool serviceStartFieldSet; + + private YesNoType serviceStopField; + + private bool serviceStopFieldSet; + + private YesNoType servicePauseContinueField; + + private bool servicePauseContinueFieldSet; + + private YesNoType serviceInterrogateField; + + private bool serviceInterrogateFieldSet; + + private YesNoType serviceUserDefinedControlField; + + private bool serviceUserDefinedControlFieldSet; + + private ISchemaElement parentElement; + + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType Append + { + get + { + return this.appendField; + } + set + { + this.appendFieldSet = true; + this.appendField = value; + } + } + + public YesNoType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + public YesNoType Write + { + get + { + return this.writeField; + } + set + { + this.writeFieldSet = true; + this.writeField = value; + } + } + + public YesNoType CreateSubkeys + { + get + { + return this.createSubkeysField; + } + set + { + this.createSubkeysFieldSet = true; + this.createSubkeysField = value; + } + } + + public YesNoType EnumerateSubkeys + { + get + { + return this.enumerateSubkeysField; + } + set + { + this.enumerateSubkeysFieldSet = true; + this.enumerateSubkeysField = value; + } + } + + public YesNoType Notify + { + get + { + return this.notifyField; + } + set + { + this.notifyFieldSet = true; + this.notifyField = value; + } + } + + public YesNoType CreateLink + { + get + { + return this.createLinkField; + } + set + { + this.createLinkFieldSet = true; + this.createLinkField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + /// + /// Required to call the QueryServiceConfig and QueryServiceConfig2 functions to query the service configuration. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceQueryConfig + { + get + { + return this.serviceQueryConfigField; + } + set + { + this.serviceQueryConfigFieldSet = true; + this.serviceQueryConfigField = value; + } + } + + /// + /// Required to call the ChangeServiceConfig or ChangeServiceConfig2 function to change the service configuration. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceChangeConfig + { + get + { + return this.serviceChangeConfigField; + } + set + { + this.serviceChangeConfigFieldSet = true; + this.serviceChangeConfigField = value; + } + } + + /// + /// Required to call the QueryServiceStatus function to ask the service control manager about the status of the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceQueryStatus + { + get + { + return this.serviceQueryStatusField; + } + set + { + this.serviceQueryStatusFieldSet = true; + this.serviceQueryStatusField = value; + } + } + + /// + /// Required to call the EnumDependentServices function to enumerate all the services dependent on the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceEnumerateDependents + { + get + { + return this.serviceEnumerateDependentsField; + } + set + { + this.serviceEnumerateDependentsFieldSet = true; + this.serviceEnumerateDependentsField = value; + } + } + + /// + /// Required to call the StartService function to start the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceStart + { + get + { + return this.serviceStartField; + } + set + { + this.serviceStartFieldSet = true; + this.serviceStartField = value; + } + } + + /// + /// Required to call the ControlService function to stop the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceStop + { + get + { + return this.serviceStopField; + } + set + { + this.serviceStopFieldSet = true; + this.serviceStopField = value; + } + } + + /// + /// Required to call the ControlService function to pause or continue the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServicePauseContinue + { + get + { + return this.servicePauseContinueField; + } + set + { + this.servicePauseContinueFieldSet = true; + this.servicePauseContinueField = value; + } + } + + /// + /// Required to call the ControlService function to ask the service to report its status immediately. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceInterrogate + { + get + { + return this.serviceInterrogateField; + } + set + { + this.serviceInterrogateFieldSet = true; + this.serviceInterrogateField = value; + } + } + + /// + /// Required to call the ControlService function to specify a user-defined control code. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceUserDefinedControl + { + get + { + return this.serviceUserDefinedControlField; + } + set + { + this.serviceUserDefinedControlFieldSet = true; + this.serviceUserDefinedControlField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PermissionEx", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.appendFieldSet) + { + if ((this.appendField == YesNoType.no)) + { + writer.WriteAttributeString("Append", "no"); + } + if ((this.appendField == YesNoType.yes)) + { + writer.WriteAttributeString("Append", "yes"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == YesNoType.no)) + { + writer.WriteAttributeString("Execute", "no"); + } + if ((this.executeField == YesNoType.yes)) + { + writer.WriteAttributeString("Execute", "yes"); + } + } + if (this.writeFieldSet) + { + if ((this.writeField == YesNoType.no)) + { + writer.WriteAttributeString("Write", "no"); + } + if ((this.writeField == YesNoType.yes)) + { + writer.WriteAttributeString("Write", "yes"); + } + } + if (this.createSubkeysFieldSet) + { + if ((this.createSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("CreateSubkeys", "no"); + } + if ((this.createSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateSubkeys", "yes"); + } + } + if (this.enumerateSubkeysFieldSet) + { + if ((this.enumerateSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("EnumerateSubkeys", "no"); + } + if ((this.enumerateSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("EnumerateSubkeys", "yes"); + } + } + if (this.notifyFieldSet) + { + if ((this.notifyField == YesNoType.no)) + { + writer.WriteAttributeString("Notify", "no"); + } + if ((this.notifyField == YesNoType.yes)) + { + writer.WriteAttributeString("Notify", "yes"); + } + } + if (this.createLinkFieldSet) + { + if ((this.createLinkField == YesNoType.no)) + { + writer.WriteAttributeString("CreateLink", "no"); + } + if ((this.createLinkField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateLink", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + if (this.serviceQueryConfigFieldSet) + { + if ((this.serviceQueryConfigField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceQueryConfig", "no"); + } + if ((this.serviceQueryConfigField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceQueryConfig", "yes"); + } + } + if (this.serviceChangeConfigFieldSet) + { + if ((this.serviceChangeConfigField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceChangeConfig", "no"); + } + if ((this.serviceChangeConfigField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceChangeConfig", "yes"); + } + } + if (this.serviceQueryStatusFieldSet) + { + if ((this.serviceQueryStatusField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceQueryStatus", "no"); + } + if ((this.serviceQueryStatusField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceQueryStatus", "yes"); + } + } + if (this.serviceEnumerateDependentsFieldSet) + { + if ((this.serviceEnumerateDependentsField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceEnumerateDependents", "no"); + } + if ((this.serviceEnumerateDependentsField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceEnumerateDependents", "yes"); + } + } + if (this.serviceStartFieldSet) + { + if ((this.serviceStartField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceStart", "no"); + } + if ((this.serviceStartField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceStart", "yes"); + } + } + if (this.serviceStopFieldSet) + { + if ((this.serviceStopField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceStop", "no"); + } + if ((this.serviceStopField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceStop", "yes"); + } + } + if (this.servicePauseContinueFieldSet) + { + if ((this.servicePauseContinueField == YesNoType.no)) + { + writer.WriteAttributeString("ServicePauseContinue", "no"); + } + if ((this.servicePauseContinueField == YesNoType.yes)) + { + writer.WriteAttributeString("ServicePauseContinue", "yes"); + } + } + if (this.serviceInterrogateFieldSet) + { + if ((this.serviceInterrogateField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceInterrogate", "no"); + } + if ((this.serviceInterrogateField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceInterrogate", "yes"); + } + } + if (this.serviceUserDefinedControlFieldSet) + { + if ((this.serviceUserDefinedControlField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceUserDefinedControl", "no"); + } + if ((this.serviceUserDefinedControlField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceUserDefinedControl", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("Append" == name)) + { + this.appendField = Enums.ParseYesNoType(value); + this.appendFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = Enums.ParseYesNoType(value); + this.executeFieldSet = true; + } + if (("Write" == name)) + { + this.writeField = Enums.ParseYesNoType(value); + this.writeFieldSet = true; + } + if (("CreateSubkeys" == name)) + { + this.createSubkeysField = Enums.ParseYesNoType(value); + this.createSubkeysFieldSet = true; + } + if (("EnumerateSubkeys" == name)) + { + this.enumerateSubkeysField = Enums.ParseYesNoType(value); + this.enumerateSubkeysFieldSet = true; + } + if (("Notify" == name)) + { + this.notifyField = Enums.ParseYesNoType(value); + this.notifyFieldSet = true; + } + if (("CreateLink" == name)) + { + this.createLinkField = Enums.ParseYesNoType(value); + this.createLinkFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + if (("ServiceQueryConfig" == name)) + { + this.serviceQueryConfigField = Enums.ParseYesNoType(value); + this.serviceQueryConfigFieldSet = true; + } + if (("ServiceChangeConfig" == name)) + { + this.serviceChangeConfigField = Enums.ParseYesNoType(value); + this.serviceChangeConfigFieldSet = true; + } + if (("ServiceQueryStatus" == name)) + { + this.serviceQueryStatusField = Enums.ParseYesNoType(value); + this.serviceQueryStatusFieldSet = true; + } + if (("ServiceEnumerateDependents" == name)) + { + this.serviceEnumerateDependentsField = Enums.ParseYesNoType(value); + this.serviceEnumerateDependentsFieldSet = true; + } + if (("ServiceStart" == name)) + { + this.serviceStartField = Enums.ParseYesNoType(value); + this.serviceStartFieldSet = true; + } + if (("ServiceStop" == name)) + { + this.serviceStopField = Enums.ParseYesNoType(value); + this.serviceStopFieldSet = true; + } + if (("ServicePauseContinue" == name)) + { + this.servicePauseContinueField = Enums.ParseYesNoType(value); + this.servicePauseContinueFieldSet = true; + } + if (("ServiceInterrogate" == name)) + { + this.serviceInterrogateField = Enums.ParseYesNoType(value); + this.serviceInterrogateFieldSet = true; + } + if (("ServiceUserDefinedControl" == name)) + { + this.serviceUserDefinedControlField = Enums.ParseYesNoType(value); + this.serviceUserDefinedControlFieldSet = true; + } + } + } + + /// + /// Describes a product search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ProductSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The Guid attribute has been deprecated; use the ProductCode or UpgradeCode attribute instead. If this attribute is used, it is assumed to be a ProductCode. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// The ProductCode to use for the search. This attribute must be omitted if UpgradeCode is specified. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// The UpgradeCode to use for the search. This attribute must be omitted if ProductCode is specified. Note that if multiple products are found, the highest versioned product will be used for the result. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// Rather than saving the product version into the variable, a ProductSearch can save another attribute of the matching product instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + ProductSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("version" == value)) + { + parsedValue = ResultType.version; + } + else + { + if (("language" == value)) + { + parsedValue = ResultType.language; + } + else + { + if (("state" == value)) + { + parsedValue = ResultType.state; + } + else + { + if (("assignment" == value)) + { + parsedValue = ResultType.assignment; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.version)) + { + writer.WriteAttributeString("Result", "version"); + } + if ((this.resultField == ResultType.language)) + { + writer.WriteAttributeString("Result", "language"); + } + if ((this.resultField == ResultType.state)) + { + writer.WriteAttributeString("Result", "state"); + } + if ((this.resultField == ResultType.assignment)) + { + writer.WriteAttributeString("Result", "assignment"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = ProductSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves the version of a matching product if found; 0.0.0.0 otherwise. This is the default. + /// + version, + + /// + /// Saves the language of a matching product if found; empty otherwise. + /// + language, + + /// + /// Saves the state of the product: advertised (1), absent (2), or locally installed (5). + /// + state, + + /// + /// Saves the assignment type of the product: per-user (0), or per-machine (1). + /// + assignment, + } + } + + /// + /// References a ProductSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ProductSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Remove a folder and all contained files and folders if the parent component is selected for installation or removal. + /// The folder must be specified in the Property attribute as the name of a property that will have a value that resolves + /// to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. + /// For more details, see the Remarks. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RemoveFolderEx : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private OnType onField; + + private bool onFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. If this is not specified, a stable identifier + /// will be generated at compile time based on the other attributes. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The id of a property that resolves to the full path of the source directory. The property does not have + /// to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. The property value can contain environment variables surrounded by + /// percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before + /// being evaluated for a full path. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This value determines when the folder may be removed. + /// + public OnType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a OnType from a string. + /// + public static OnType ParseOnType(string value) + { + OnType parsedValue; + RemoveFolderEx.TryParseOnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a OnType from a string. + /// + public static bool TryParseOnType(string value, out OnType parsedValue) + { + parsedValue = OnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = OnType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = OnType.uninstall; + } + else + { + if (("both" == value)) + { + parsedValue = OnType.both; + } + else + { + parsedValue = OnType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFolderEx", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.onFieldSet) + { + if ((this.onField == OnType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == OnType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + if ((this.onField == OnType.both)) + { + writer.WriteAttributeString("On", "both"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("On" == name)) + { + this.onField = RemoveFolderEx.ParseOnType(value); + this.onFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum OnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Removes the folder only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource). + /// + install, + + /// + /// Default: Removes the folder only when the parent component is being removed (msiInstallStateAbsent). + /// + uninstall, + + /// + /// Removes the folder when the parent component is being installed or removed. + /// + both, + } + } + + /// + /// Registers a resource with the Restart Manager. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RestartResource : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private string processNameField; + + private bool processNameFieldSet; + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private ISchemaElement parentElement; + + /// + /// The unique identifier for this resource. A unique identifier will + /// be generated automatically if not specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The full path to the process module to register with the Restart Manager. + /// This can be a formatted value that resolves to a full path. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// The name of a process to register with the Restart Manager. + /// This can be a formatted value that resolves to a process name. + /// + public string ProcessName + { + get + { + return this.processNameField; + } + set + { + this.processNameFieldSet = true; + this.processNameField = value; + } + } + + /// + /// The name of a Windows service to register with the Restart Manager. + /// This can be a formatted value that resolves to a service name. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RestartResource", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.processNameFieldSet) + { + writer.WriteAttributeString("ProcessName", this.processNameField); + } + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("ProcessName" == name)) + { + this.processNameField = value; + this.processNameFieldSet = true; + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + } + } + + /// + /// Describes a registry search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RegistrySearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private RootType rootField; + + private bool rootFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private FormatType formatField; + + private bool formatFieldSet; + + private YesNoType expandEnvironmentVariablesField; + + private bool expandEnvironmentVariablesFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Registry root hive to search under. + /// + public RootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// Key to search for. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// Optional value to search for under the given Key. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// What format to return the value in. + /// + public FormatType Format + { + get + { + return this.formatField; + } + set + { + this.formatFieldSet = true; + this.formatField = value; + } + } + + /// + /// Whether to expand any environment variables in REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ values. + /// + public YesNoType ExpandEnvironmentVariables + { + get + { + return this.expandEnvironmentVariablesField; + } + set + { + this.expandEnvironmentVariablesFieldSet = true; + this.expandEnvironmentVariablesField = value; + } + } + + /// + /// Rather than saving the matching registry value into the variable, a RegistrySearch can save an attribute of the matching entry instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + /// + /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. The default value is 'no'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a RootType from a string. + /// + public static RootType ParseRootType(string value) + { + RootType parsedValue; + RegistrySearch.TryParseRootType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RootType from a string. + /// + public static bool TryParseRootType(string value, out RootType parsedValue) + { + parsedValue = RootType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("HKLM" == value)) + { + parsedValue = RootType.HKLM; + } + else + { + if (("HKCU" == value)) + { + parsedValue = RootType.HKCU; + } + else + { + if (("HKCR" == value)) + { + parsedValue = RootType.HKCR; + } + else + { + if (("HKU" == value)) + { + parsedValue = RootType.HKU; + } + else + { + parsedValue = RootType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a FormatType from a string. + /// + public static FormatType ParseFormatType(string value) + { + FormatType parsedValue; + RegistrySearch.TryParseFormatType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FormatType from a string. + /// + public static bool TryParseFormatType(string value, out FormatType parsedValue) + { + parsedValue = FormatType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("raw" == value)) + { + parsedValue = FormatType.raw; + } + else + { + if (("compatible" == value)) + { + parsedValue = FormatType.compatible; + } + else + { + parsedValue = FormatType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + RegistrySearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + if (("value" == value)) + { + parsedValue = ResultType.value; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.formatFieldSet) + { + if ((this.formatField == FormatType.raw)) + { + writer.WriteAttributeString("Format", "raw"); + } + if ((this.formatField == FormatType.compatible)) + { + writer.WriteAttributeString("Format", "compatible"); + } + } + if (this.expandEnvironmentVariablesFieldSet) + { + if ((this.expandEnvironmentVariablesField == YesNoType.no)) + { + writer.WriteAttributeString("ExpandEnvironmentVariables", "no"); + } + if ((this.expandEnvironmentVariablesField == YesNoType.yes)) + { + writer.WriteAttributeString("ExpandEnvironmentVariables", "yes"); + } + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + if ((this.resultField == ResultType.value)) + { + writer.WriteAttributeString("Result", "value"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = RegistrySearch.ParseRootType(value); + this.rootFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Format" == name)) + { + this.formatField = RegistrySearch.ParseFormatType(value); + this.formatFieldSet = true; + } + if (("ExpandEnvironmentVariables" == name)) + { + this.expandEnvironmentVariablesField = Enums.ParseYesNoType(value); + this.expandEnvironmentVariablesFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = RegistrySearch.ParseResultType(value); + this.resultFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum RootType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// HKEY_LOCAL_MACHINE + /// + HKLM, + + /// + /// HKEY_CURRENT_USER + /// + HKCU, + + /// + /// HKEY_CLASSES_ROOT + /// + HKCR, + + /// + /// HKEY_USERS + /// + HKU, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum FormatType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Returns the unformatted value directly from the registry. For example, a REG_DWORD value of '1' is returned as '1', not '#1'. + /// + raw, + + /// + /// Returns the value formatted as Windows Installer would. For example, a REG_DWORD value of '1' is returned as '#1', not '1'. + /// + compatible, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching registry entry is found; false otherwise. + /// + exists, + + /// + /// Saves the value of the registry key in the variable. This is the default. + /// + value, + } + } + + /// + /// References a RegistrySearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RegistrySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Service configuration information for failure actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ServiceConfig : ISchemaElement, ISetAttributes + { + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private FirstFailureActionTypeType firstFailureActionTypeField; + + private bool firstFailureActionTypeFieldSet; + + private SecondFailureActionTypeType secondFailureActionTypeField; + + private bool secondFailureActionTypeFieldSet; + + private ThirdFailureActionTypeType thirdFailureActionTypeField; + + private bool thirdFailureActionTypeFieldSet; + + private int resetPeriodInDaysField; + + private bool resetPeriodInDaysFieldSet; + + private int restartServiceDelayInSecondsField; + + private bool restartServiceDelayInSecondsFieldSet; + + private string programCommandLineField; + + private bool programCommandLineFieldSet; + + private string rebootMessageField; + + private bool rebootMessageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Required if not under a ServiceInstall element. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + /// + /// Action to take on the first failure of the service. + /// + public FirstFailureActionTypeType FirstFailureActionType + { + get + { + return this.firstFailureActionTypeField; + } + set + { + this.firstFailureActionTypeFieldSet = true; + this.firstFailureActionTypeField = value; + } + } + + /// + /// Action to take on the second failure of the service. + /// + public SecondFailureActionTypeType SecondFailureActionType + { + get + { + return this.secondFailureActionTypeField; + } + set + { + this.secondFailureActionTypeFieldSet = true; + this.secondFailureActionTypeField = value; + } + } + + /// + /// Action to take on the third failure of the service. + /// + public ThirdFailureActionTypeType ThirdFailureActionType + { + get + { + return this.thirdFailureActionTypeField; + } + set + { + this.thirdFailureActionTypeFieldSet = true; + this.thirdFailureActionTypeField = value; + } + } + + /// + /// Number of days after which to reset the failure count to zero if there are no failures. + /// + public int ResetPeriodInDays + { + get + { + return this.resetPeriodInDaysField; + } + set + { + this.resetPeriodInDaysFieldSet = true; + this.resetPeriodInDaysField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "restart", this specifies the number of seconds to wait before doing so. + /// + public int RestartServiceDelayInSeconds + { + get + { + return this.restartServiceDelayInSecondsField; + } + set + { + this.restartServiceDelayInSecondsFieldSet = true; + this.restartServiceDelayInSecondsField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "runCommand", this specifies the command to run when doing so. This value is formatted. + /// + public string ProgramCommandLine + { + get + { + return this.programCommandLineField; + } + set + { + this.programCommandLineFieldSet = true; + this.programCommandLineField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "reboot", this specifies the message to broadcast to server users before doing so. + /// + public string RebootMessage + { + get + { + return this.rebootMessageField; + } + set + { + this.rebootMessageFieldSet = true; + this.rebootMessageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a FirstFailureActionTypeType from a string. + /// + public static FirstFailureActionTypeType ParseFirstFailureActionTypeType(string value) + { + FirstFailureActionTypeType parsedValue; + ServiceConfig.TryParseFirstFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FirstFailureActionTypeType from a string. + /// + public static bool TryParseFirstFailureActionTypeType(string value, out FirstFailureActionTypeType parsedValue) + { + parsedValue = FirstFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = FirstFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = FirstFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = FirstFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = FirstFailureActionTypeType.runCommand; + } + else + { + parsedValue = FirstFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a SecondFailureActionTypeType from a string. + /// + public static SecondFailureActionTypeType ParseSecondFailureActionTypeType(string value) + { + SecondFailureActionTypeType parsedValue; + ServiceConfig.TryParseSecondFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SecondFailureActionTypeType from a string. + /// + public static bool TryParseSecondFailureActionTypeType(string value, out SecondFailureActionTypeType parsedValue) + { + parsedValue = SecondFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = SecondFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = SecondFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = SecondFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = SecondFailureActionTypeType.runCommand; + } + else + { + parsedValue = SecondFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a ThirdFailureActionTypeType from a string. + /// + public static ThirdFailureActionTypeType ParseThirdFailureActionTypeType(string value) + { + ThirdFailureActionTypeType parsedValue; + ServiceConfig.TryParseThirdFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ThirdFailureActionTypeType from a string. + /// + public static bool TryParseThirdFailureActionTypeType(string value, out ThirdFailureActionTypeType parsedValue) + { + parsedValue = ThirdFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = ThirdFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = ThirdFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = ThirdFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = ThirdFailureActionTypeType.runCommand; + } + else + { + parsedValue = ThirdFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + if (this.firstFailureActionTypeFieldSet) + { + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.none)) + { + writer.WriteAttributeString("FirstFailureActionType", "none"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("FirstFailureActionType", "reboot"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.restart)) + { + writer.WriteAttributeString("FirstFailureActionType", "restart"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("FirstFailureActionType", "runCommand"); + } + } + if (this.secondFailureActionTypeFieldSet) + { + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.none)) + { + writer.WriteAttributeString("SecondFailureActionType", "none"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("SecondFailureActionType", "reboot"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.restart)) + { + writer.WriteAttributeString("SecondFailureActionType", "restart"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("SecondFailureActionType", "runCommand"); + } + } + if (this.thirdFailureActionTypeFieldSet) + { + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.none)) + { + writer.WriteAttributeString("ThirdFailureActionType", "none"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("ThirdFailureActionType", "reboot"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.restart)) + { + writer.WriteAttributeString("ThirdFailureActionType", "restart"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("ThirdFailureActionType", "runCommand"); + } + } + if (this.resetPeriodInDaysFieldSet) + { + writer.WriteAttributeString("ResetPeriodInDays", this.resetPeriodInDaysField.ToString(CultureInfo.InvariantCulture)); + } + if (this.restartServiceDelayInSecondsFieldSet) + { + writer.WriteAttributeString("RestartServiceDelayInSeconds", this.restartServiceDelayInSecondsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.programCommandLineFieldSet) + { + writer.WriteAttributeString("ProgramCommandLine", this.programCommandLineField); + } + if (this.rebootMessageFieldSet) + { + writer.WriteAttributeString("RebootMessage", this.rebootMessageField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + if (("FirstFailureActionType" == name)) + { + this.firstFailureActionTypeField = ServiceConfig.ParseFirstFailureActionTypeType(value); + this.firstFailureActionTypeFieldSet = true; + } + if (("SecondFailureActionType" == name)) + { + this.secondFailureActionTypeField = ServiceConfig.ParseSecondFailureActionTypeType(value); + this.secondFailureActionTypeFieldSet = true; + } + if (("ThirdFailureActionType" == name)) + { + this.thirdFailureActionTypeField = ServiceConfig.ParseThirdFailureActionTypeType(value); + this.thirdFailureActionTypeFieldSet = true; + } + if (("ResetPeriodInDays" == name)) + { + this.resetPeriodInDaysField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.resetPeriodInDaysFieldSet = true; + } + if (("RestartServiceDelayInSeconds" == name)) + { + this.restartServiceDelayInSecondsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.restartServiceDelayInSecondsFieldSet = true; + } + if (("ProgramCommandLine" == name)) + { + this.programCommandLineField = value; + this.programCommandLineFieldSet = true; + } + if (("RebootMessage" == name)) + { + this.rebootMessageField = value; + this.rebootMessageFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum FirstFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum SecondFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ThirdFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + } + + /// + /// Updates the last modified date/time of a file. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class TouchFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private YesNoType onInstallField; + + private bool onInstallFieldSet; + + private YesNoType onReinstallField; + + private bool onReinstallFieldSet; + + private YesNoType onUninstallField; + + private bool onUninstallFieldSet; + + private YesNoType nonvitalField; + + private bool nonvitalFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the touch file operation. If the identifier is not specified it will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path of the file to update. This value is formatted. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on install. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + /// + public YesNoType OnInstall + { + get + { + return this.onInstallField; + } + set + { + this.onInstallFieldSet = true; + this.onInstallField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on reinstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + /// + public YesNoType OnReinstall + { + get + { + return this.onReinstallField; + } + set + { + this.onReinstallFieldSet = true; + this.onReinstallField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on uninstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'no'. + /// + public YesNoType OnUninstall + { + get + { + return this.onUninstallField; + } + set + { + this.onUninstallFieldSet = true; + this.onUninstallField = value; + } + } + + /// + /// Indicates the installation will succeed even if the modified time of the file cannot be updated. The default is 'no'. + /// + public YesNoType Nonvital + { + get + { + return this.nonvitalField; + } + set + { + this.nonvitalFieldSet = true; + this.nonvitalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TouchFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.onInstallFieldSet) + { + if ((this.onInstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnInstall", "no"); + } + if ((this.onInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnInstall", "yes"); + } + } + if (this.onReinstallFieldSet) + { + if ((this.onReinstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnReinstall", "no"); + } + if ((this.onReinstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnReinstall", "yes"); + } + } + if (this.onUninstallFieldSet) + { + if ((this.onUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnUninstall", "no"); + } + if ((this.onUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnUninstall", "yes"); + } + } + if (this.nonvitalFieldSet) + { + if ((this.nonvitalField == YesNoType.no)) + { + writer.WriteAttributeString("Nonvital", "no"); + } + if ((this.nonvitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Nonvital", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("OnInstall" == name)) + { + this.onInstallField = Enums.ParseYesNoType(value); + this.onInstallFieldSet = true; + } + if (("OnReinstall" == name)) + { + this.onReinstallField = Enums.ParseYesNoType(value); + this.onReinstallFieldSet = true; + } + if (("OnUninstall" == name)) + { + this.onUninstallField = Enums.ParseYesNoType(value); + this.onUninstallFieldSet = true; + } + if (("Nonvital" == name)) + { + this.nonvitalField = Enums.ParseYesNoType(value); + this.nonvitalFieldSet = true; + } + } + } + + /// + /// User for all kinds of things. When it is not nested under a component it is included in the MSI so it can be referenced by other elements such as the User attribute in the AppPool element. When it is nested under a Component element, the User will be created on install and can also be used for reference. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class User : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string domainField; + + private bool domainFieldSet; + + private string passwordField; + + private bool passwordFieldSet; + + private YesNoType passwordNeverExpiresField; + + private bool passwordNeverExpiresFieldSet; + + private YesNoType canNotChangePasswordField; + + private bool canNotChangePasswordFieldSet; + + private YesNoType removeOnUninstallField; + + private bool removeOnUninstallFieldSet; + + private YesNoType failIfExistsField; + + private bool failIfExistsFieldSet; + + private YesNoType logonAsServiceField; + + private bool logonAsServiceFieldSet; + + private YesNoType logonAsBatchJobField; + + private bool logonAsBatchJobFieldSet; + + private YesNoType updateIfExistsField; + + private bool updateIfExistsFieldSet; + + private YesNoType passwordExpiredField; + + private bool passwordExpiredFieldSet; + + private YesNoType disabledField; + + private bool disabledFieldSet; + + private YesNoType createUserField; + + private bool createUserFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private ISchemaElement parentElement; + + public User() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(GroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// A + /// + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + /// + /// Usually a Property that is passed in on the command-line to keep it more secure. + /// + public string Password + { + get + { + return this.passwordField; + } + set + { + this.passwordFieldSet = true; + this.passwordField = value; + } + } + + /// + /// The account's password never expires. Equivalent to UF_DONT_EXPIRE_PASSWD. + /// + public YesNoType PasswordNeverExpires + { + get + { + return this.passwordNeverExpiresField; + } + set + { + this.passwordNeverExpiresFieldSet = true; + this.passwordNeverExpiresField = value; + } + } + + /// + /// The user cannot change the account's password. Equivalent to UF_PASSWD_CANT_CHANGE. + /// + public YesNoType CanNotChangePassword + { + get + { + return this.canNotChangePasswordField; + } + set + { + this.canNotChangePasswordFieldSet = true; + this.canNotChangePasswordField = value; + } + } + + /// + /// Indicates whether the user account should be removed or left behind on uninstall. + /// + public YesNoType RemoveOnUninstall + { + get + { + return this.removeOnUninstallField; + } + set + { + this.removeOnUninstallFieldSet = true; + this.removeOnUninstallField = value; + } + } + + /// + /// Indicates if the install should fail if the user already exists. + /// + public YesNoType FailIfExists + { + get + { + return this.failIfExistsField; + } + set + { + this.failIfExistsFieldSet = true; + this.failIfExistsField = value; + } + } + + /// + /// Indicates whether or not the user can logon as a serivce. User creation can be skipped if all that is desired is to set this access right on the user. + /// + public YesNoType LogonAsService + { + get + { + return this.logonAsServiceField; + } + set + { + this.logonAsServiceFieldSet = true; + this.logonAsServiceField = value; + } + } + + /// + /// Indicates whether or not the user can logon as a batch job. User creation can be skipped if all that is desired is to set this access right on the user. + /// + public YesNoType LogonAsBatchJob + { + get + { + return this.logonAsBatchJobField; + } + set + { + this.logonAsBatchJobFieldSet = true; + this.logonAsBatchJobField = value; + } + } + + /// + /// Indicates if the user account properties should be updated if the user already exists. + /// + public YesNoType UpdateIfExists + { + get + { + return this.updateIfExistsField; + } + set + { + this.updateIfExistsFieldSet = true; + this.updateIfExistsField = value; + } + } + + /// + /// Indicates whether the user must change their password on their first login. + /// + public YesNoType PasswordExpired + { + get + { + return this.passwordExpiredField; + } + set + { + this.passwordExpiredFieldSet = true; + this.passwordExpiredField = value; + } + } + + /// + /// The account is disabled. Equivalent to UF_ACCOUNTDISABLE. + /// + public YesNoType Disabled + { + get + { + return this.disabledField; + } + set + { + this.disabledFieldSet = true; + this.disabledField = value; + } + } + + /// + /// Indicates whether or not to create the user. User creation can be skipped if all that is desired is to join a user to groups. + /// + public YesNoType CreateUser + { + get + { + return this.createUserField; + } + set + { + this.createUserFieldSet = true; + this.createUserField = value; + } + } + + /// + /// Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes". + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("GroupRef" == childName)) + { + childValue = new GroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("User", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.passwordFieldSet) + { + writer.WriteAttributeString("Password", this.passwordField); + } + if (this.passwordNeverExpiresFieldSet) + { + if ((this.passwordNeverExpiresField == YesNoType.no)) + { + writer.WriteAttributeString("PasswordNeverExpires", "no"); + } + if ((this.passwordNeverExpiresField == YesNoType.yes)) + { + writer.WriteAttributeString("PasswordNeverExpires", "yes"); + } + } + if (this.canNotChangePasswordFieldSet) + { + if ((this.canNotChangePasswordField == YesNoType.no)) + { + writer.WriteAttributeString("CanNotChangePassword", "no"); + } + if ((this.canNotChangePasswordField == YesNoType.yes)) + { + writer.WriteAttributeString("CanNotChangePassword", "yes"); + } + } + if (this.removeOnUninstallFieldSet) + { + if ((this.removeOnUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("RemoveOnUninstall", "no"); + } + if ((this.removeOnUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("RemoveOnUninstall", "yes"); + } + } + if (this.failIfExistsFieldSet) + { + if ((this.failIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("FailIfExists", "no"); + } + if ((this.failIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("FailIfExists", "yes"); + } + } + if (this.logonAsServiceFieldSet) + { + if ((this.logonAsServiceField == YesNoType.no)) + { + writer.WriteAttributeString("LogonAsService", "no"); + } + if ((this.logonAsServiceField == YesNoType.yes)) + { + writer.WriteAttributeString("LogonAsService", "yes"); + } + } + if (this.logonAsBatchJobFieldSet) + { + if ((this.logonAsBatchJobField == YesNoType.no)) + { + writer.WriteAttributeString("LogonAsBatchJob", "no"); + } + if ((this.logonAsBatchJobField == YesNoType.yes)) + { + writer.WriteAttributeString("LogonAsBatchJob", "yes"); + } + } + if (this.updateIfExistsFieldSet) + { + if ((this.updateIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("UpdateIfExists", "no"); + } + if ((this.updateIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("UpdateIfExists", "yes"); + } + } + if (this.passwordExpiredFieldSet) + { + if ((this.passwordExpiredField == YesNoType.no)) + { + writer.WriteAttributeString("PasswordExpired", "no"); + } + if ((this.passwordExpiredField == YesNoType.yes)) + { + writer.WriteAttributeString("PasswordExpired", "yes"); + } + } + if (this.disabledFieldSet) + { + if ((this.disabledField == YesNoType.no)) + { + writer.WriteAttributeString("Disabled", "no"); + } + if ((this.disabledField == YesNoType.yes)) + { + writer.WriteAttributeString("Disabled", "yes"); + } + } + if (this.createUserFieldSet) + { + if ((this.createUserField == YesNoType.no)) + { + writer.WriteAttributeString("CreateUser", "no"); + } + if ((this.createUserField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateUser", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("Password" == name)) + { + this.passwordField = value; + this.passwordFieldSet = true; + } + if (("PasswordNeverExpires" == name)) + { + this.passwordNeverExpiresField = Enums.ParseYesNoType(value); + this.passwordNeverExpiresFieldSet = true; + } + if (("CanNotChangePassword" == name)) + { + this.canNotChangePasswordField = Enums.ParseYesNoType(value); + this.canNotChangePasswordFieldSet = true; + } + if (("RemoveOnUninstall" == name)) + { + this.removeOnUninstallField = Enums.ParseYesNoType(value); + this.removeOnUninstallFieldSet = true; + } + if (("FailIfExists" == name)) + { + this.failIfExistsField = Enums.ParseYesNoType(value); + this.failIfExistsFieldSet = true; + } + if (("LogonAsService" == name)) + { + this.logonAsServiceField = Enums.ParseYesNoType(value); + this.logonAsServiceFieldSet = true; + } + if (("LogonAsBatchJob" == name)) + { + this.logonAsBatchJobField = Enums.ParseYesNoType(value); + this.logonAsBatchJobFieldSet = true; + } + if (("UpdateIfExists" == name)) + { + this.updateIfExistsField = Enums.ParseYesNoType(value); + this.updateIfExistsFieldSet = true; + } + if (("PasswordExpired" == name)) + { + this.passwordExpiredField = Enums.ParseYesNoType(value); + this.passwordExpiredFieldSet = true; + } + if (("Disabled" == name)) + { + this.disabledField = Enums.ParseYesNoType(value); + this.disabledFieldSet = true; + } + if (("CreateUser" == name)) + { + this.createUserField = Enums.ParseYesNoType(value); + this.createUserFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + } + } + + /// + /// Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class XmlFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string elementPathField; + + private bool elementPathFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType preserveModifiedDateField; + + private bool preserveModifiedDateFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private SelectionLanguageType selectionLanguageField; + + private bool selectionLanguageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for xml file modification. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string ElementPath + { + get + { + return this.elementPathField; + } + set + { + this.elementPathFieldSet = true; + this.elementPathField = value; + } + } + + /// + /// Path of the .xml file to configure. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value to be written. See the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The type of modification to be made to the XML file when the component is installed. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Specifies whether or not the modification should be removed on uninstall. This has no effect on uninstall if the action was deleteValue. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + /// + public YesNoType PreserveModifiedDate + { + get + { + return this.preserveModifiedDateField; + } + set + { + this.preserveModifiedDateFieldSet = true; + this.preserveModifiedDateField = value; + } + } + + /// + /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. + /// + public SelectionLanguageType SelectionLanguage + { + get + { + return this.selectionLanguageField; + } + set + { + this.selectionLanguageFieldSet = true; + this.selectionLanguageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + XmlFile.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("createElement" == value)) + { + parsedValue = ActionType.createElement; + } + else + { + if (("deleteValue" == value)) + { + parsedValue = ActionType.deleteValue; + } + else + { + if (("setValue" == value)) + { + parsedValue = ActionType.setValue; + } + else + { + if (("bulkSetValue" == value)) + { + parsedValue = ActionType.bulkSetValue; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a SelectionLanguageType from a string. + /// + public static SelectionLanguageType ParseSelectionLanguageType(string value) + { + SelectionLanguageType parsedValue; + XmlFile.TryParseSelectionLanguageType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SelectionLanguageType from a string. + /// + public static bool TryParseSelectionLanguageType(string value, out SelectionLanguageType parsedValue) + { + parsedValue = SelectionLanguageType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("XPath" == value)) + { + parsedValue = SelectionLanguageType.XPath; + } + else + { + if (("XSLPattern" == value)) + { + parsedValue = SelectionLanguageType.XSLPattern; + } + else + { + parsedValue = SelectionLanguageType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("XmlFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.elementPathFieldSet) + { + writer.WriteAttributeString("ElementPath", this.elementPathField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.createElement)) + { + writer.WriteAttributeString("Action", "createElement"); + } + if ((this.actionField == ActionType.deleteValue)) + { + writer.WriteAttributeString("Action", "deleteValue"); + } + if ((this.actionField == ActionType.setValue)) + { + writer.WriteAttributeString("Action", "setValue"); + } + if ((this.actionField == ActionType.bulkSetValue)) + { + writer.WriteAttributeString("Action", "bulkSetValue"); + } + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.preserveModifiedDateFieldSet) + { + if ((this.preserveModifiedDateField == YesNoType.no)) + { + writer.WriteAttributeString("PreserveModifiedDate", "no"); + } + if ((this.preserveModifiedDateField == YesNoType.yes)) + { + writer.WriteAttributeString("PreserveModifiedDate", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.selectionLanguageFieldSet) + { + if ((this.selectionLanguageField == SelectionLanguageType.XPath)) + { + writer.WriteAttributeString("SelectionLanguage", "XPath"); + } + if ((this.selectionLanguageField == SelectionLanguageType.XSLPattern)) + { + writer.WriteAttributeString("SelectionLanguage", "XSLPattern"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ElementPath" == name)) + { + this.elementPathField = value; + this.elementPathFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = XmlFile.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("PreserveModifiedDate" == name)) + { + this.preserveModifiedDateField = Enums.ParseYesNoType(value); + this.preserveModifiedDateFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("SelectionLanguage" == name)) + { + this.selectionLanguageField = XmlFile.ParseSelectionLanguageType(value); + this.selectionLanguageFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates a new element under the element specified in ElementPath. The Name attribute is required in this case and specifies the name of the new element. The Value attribute is not necessary when createElement is specified as the action. If the Value attribute is set, it will cause the new element's text value to be set. + /// + createElement, + + /// + /// Deletes a value from the element specified in the ElementPath. If Name is specified, the attribute with that name is deleted. If Name is not specified, the text value of the element specified in the ElementPath is deleted. The Value attribute is ignored if deleteValue is the action specified. + /// + deleteValue, + + /// + /// Sets a value in the element specified in the ElementPath. If Name is specified, and attribute with that name is set to the value specified in Value. If Name is not specified, the text value of the element is set. Value is a required attribute if setValue is the action specified. + /// + setValue, + + /// + /// Sets all the values in the elements that match the ElementPath. If Name is specified, attributes with that name are set to the same value specified in Value. If Name is not specified, the text values of the elements are set. Value is a required attribute if setBulkValue is the action specified. + /// + bulkSetValue, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum SelectionLanguageType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + XPath, + + XSLPattern, + } + } + + /// + /// Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class XmlConfig : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string elementIdField; + + private bool elementIdFieldSet; + + private string elementPathField; + + private bool elementPathFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private NodeType nodeField; + + private bool nodeFieldSet; + + private OnType onField; + + private bool onFieldSet; + + private YesNoType preserveModifiedDateField; + + private bool preserveModifiedDateFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string verifyPathField; + + private bool verifyPathFieldSet; + + private ISchemaElement parentElement; + + public XmlConfig() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(XmlConfig))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for xml file modification. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The Id of another XmlConfig to add attributes to. In this case, the 'ElementPath', 'Action', 'Node', and 'On' attributes must be omitted. + /// + public string ElementId + { + get + { + return this.elementIdField; + } + set + { + this.elementIdFieldSet = true; + this.elementIdField = value; + } + } + + /// + /// The XPath of the parent element being modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string ElementPath + { + get + { + return this.elementPathField; + } + set + { + this.elementPathFieldSet = true; + this.elementPathField = value; + } + } + + /// + /// Path of the .xml file to configure. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public NodeType Node + { + get + { + return this.nodeField; + } + set + { + this.nodeFieldSet = true; + this.nodeField = value; + } + } + + public OnType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + /// + /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + /// + public YesNoType PreserveModifiedDate + { + get + { + return this.preserveModifiedDateField; + } + set + { + this.preserveModifiedDateFieldSet = true; + this.preserveModifiedDateField = value; + } + } + + /// + /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// The value to be written. See the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The XPath to the element being modified. This is required for 'delete' actions. For 'create' actions, VerifyPath is used to decide if the element already exists. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string VerifyPath + { + get + { + return this.verifyPathField; + } + set + { + this.verifyPathFieldSet = true; + this.verifyPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("XmlConfig" == childName)) + { + childValue = new XmlConfig(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + XmlConfig.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("create" == value)) + { + parsedValue = ActionType.create; + } + else + { + if (("delete" == value)) + { + parsedValue = ActionType.delete; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a NodeType from a string. + /// + public static NodeType ParseNodeType(string value) + { + NodeType parsedValue; + XmlConfig.TryParseNodeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a NodeType from a string. + /// + public static bool TryParseNodeType(string value, out NodeType parsedValue) + { + parsedValue = NodeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("element" == value)) + { + parsedValue = NodeType.element; + } + else + { + if (("value" == value)) + { + parsedValue = NodeType.value; + } + else + { + if (("document" == value)) + { + parsedValue = NodeType.document; + } + else + { + parsedValue = NodeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a OnType from a string. + /// + public static OnType ParseOnType(string value) + { + OnType parsedValue; + XmlConfig.TryParseOnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a OnType from a string. + /// + public static bool TryParseOnType(string value, out OnType parsedValue) + { + parsedValue = OnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = OnType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = OnType.uninstall; + } + else + { + parsedValue = OnType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("XmlConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.create)) + { + writer.WriteAttributeString("Action", "create"); + } + if ((this.actionField == ActionType.delete)) + { + writer.WriteAttributeString("Action", "delete"); + } + } + if (this.elementIdFieldSet) + { + writer.WriteAttributeString("ElementId", this.elementIdField); + } + if (this.elementPathFieldSet) + { + writer.WriteAttributeString("ElementPath", this.elementPathField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.nodeFieldSet) + { + if ((this.nodeField == NodeType.element)) + { + writer.WriteAttributeString("Node", "element"); + } + if ((this.nodeField == NodeType.value)) + { + writer.WriteAttributeString("Node", "value"); + } + if ((this.nodeField == NodeType.document)) + { + writer.WriteAttributeString("Node", "document"); + } + } + if (this.onFieldSet) + { + if ((this.onField == OnType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == OnType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + } + if (this.preserveModifiedDateFieldSet) + { + if ((this.preserveModifiedDateField == YesNoType.no)) + { + writer.WriteAttributeString("PreserveModifiedDate", "no"); + } + if ((this.preserveModifiedDateField == YesNoType.yes)) + { + writer.WriteAttributeString("PreserveModifiedDate", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.verifyPathFieldSet) + { + writer.WriteAttributeString("VerifyPath", this.verifyPathField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = XmlConfig.ParseActionType(value); + this.actionFieldSet = true; + } + if (("ElementId" == name)) + { + this.elementIdField = value; + this.elementIdFieldSet = true; + } + if (("ElementPath" == name)) + { + this.elementPathField = value; + this.elementPathFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Node" == name)) + { + this.nodeField = XmlConfig.ParseNodeType(value); + this.nodeFieldSet = true; + } + if (("On" == name)) + { + this.onField = XmlConfig.ParseOnType(value); + this.onFieldSet = true; + } + if (("PreserveModifiedDate" == name)) + { + this.preserveModifiedDateField = Enums.ParseYesNoType(value); + this.preserveModifiedDateFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("VerifyPath" == name)) + { + this.verifyPathField = value; + this.verifyPathFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + create, + + delete, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum NodeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + element, + + value, + + document, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum OnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + install, + + uninstall, + } + } +} diff --git a/src/heat/Serialize/vs.cs b/src/heat/Serialize/vs.cs new file mode 100644 index 00000000..8f926efc --- /dev/null +++ b/src/heat/Serialize/vs.cs @@ -0,0 +1,1574 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 +namespace WixToolset.Harvesters.Serialize.VS +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + using WixToolset.Harvesters.Serialize; + + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + } + + /// + /// Help Namespace for a help collection. The parent file is the key for the HxC (Collection) file. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpCollection : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType suppressCustomActionsField; + + private bool suppressCustomActionsFieldSet; + + private ISchemaElement parentElement; + + public HelpCollection() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFileRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFilterRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PlugCollectionInto))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary Key for HelpNamespace. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Friendly name for Namespace. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Internal Microsoft Help ID for this Namespace. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressCustomActions + { + get + { + return this.suppressCustomActionsField; + } + set + { + this.suppressCustomActionsFieldSet = true; + this.suppressCustomActionsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("HelpFileRef" == childName)) + { + childValue = new HelpFileRef(); + } + if (("HelpFilterRef" == childName)) + { + childValue = new HelpFilterRef(); + } + if (("PlugCollectionInto" == childName)) + { + childValue = new PlugCollectionInto(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpCollection", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.suppressCustomActionsFieldSet) + { + if ((this.suppressCustomActionsField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressCustomActions", "no"); + } + if ((this.suppressCustomActionsField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressCustomActions", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SuppressCustomActions" == name)) + { + this.suppressCustomActionsField = Enums.ParseYesNoType(value); + this.suppressCustomActionsFieldSet = true; + } + } + } + + /// + /// Filter for Help Namespace. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFilter : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string filterDefinitionField; + + private bool filterDefinitionFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType suppressCustomActionsField; + + private bool suppressCustomActionsFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFilter. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Query String for Help Filter. + /// + public string FilterDefinition + { + get + { + return this.filterDefinitionField; + } + set + { + this.filterDefinitionFieldSet = true; + this.filterDefinitionField = value; + } + } + + /// + /// Friendly name for Filter. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressCustomActions + { + get + { + return this.suppressCustomActionsField; + } + set + { + this.suppressCustomActionsFieldSet = true; + this.suppressCustomActionsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFilter", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.filterDefinitionFieldSet) + { + writer.WriteAttributeString("FilterDefinition", this.filterDefinitionField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.suppressCustomActionsFieldSet) + { + if ((this.suppressCustomActionsField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressCustomActions", "no"); + } + if ((this.suppressCustomActionsField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressCustomActions", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("FilterDefinition" == name)) + { + this.filterDefinitionField = value; + this.filterDefinitionFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SuppressCustomActions" == name)) + { + this.suppressCustomActionsField = Enums.ParseYesNoType(value); + this.suppressCustomActionsFieldSet = true; + } + } + } + + /// + /// File for Help Namespace. The parent file is the key for HxS (Title) file. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string attributeIndexField; + + private bool attributeIndexFieldSet; + + private string indexField; + + private bool indexFieldSet; + + private int languageField; + + private bool languageFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sampleLocationField; + + private bool sampleLocationFieldSet; + + private string searchField; + + private bool searchFieldSet; + + private YesNoType suppressCustomActionsField; + + private bool suppressCustomActionsFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFile Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Key for HxR (Attributes) file. + /// + public string AttributeIndex + { + get + { + return this.attributeIndexField; + } + set + { + this.attributeIndexFieldSet = true; + this.attributeIndexField = value; + } + } + + /// + /// Key for HxI (Index) file. + /// + public string Index + { + get + { + return this.indexField; + } + set + { + this.indexFieldSet = true; + this.indexField = value; + } + } + + /// + /// Language ID for content file. + /// + public int Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// Internal Microsoft Help ID for this HelpFile. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Key for a file that is in the "root" of the samples directory for this HelpFile. + /// + public string SampleLocation + { + get + { + return this.sampleLocationField; + } + set + { + this.sampleLocationFieldSet = true; + this.sampleLocationField = value; + } + } + + /// + /// Key for HxQ (Query) file. + /// + public string Search + { + get + { + return this.searchField; + } + set + { + this.searchFieldSet = true; + this.searchField = value; + } + } + + /// + /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressCustomActions + { + get + { + return this.suppressCustomActionsField; + } + set + { + this.suppressCustomActionsFieldSet = true; + this.suppressCustomActionsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFile", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.attributeIndexFieldSet) + { + writer.WriteAttributeString("AttributeIndex", this.attributeIndexField); + } + if (this.indexFieldSet) + { + writer.WriteAttributeString("Index", this.indexField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sampleLocationFieldSet) + { + writer.WriteAttributeString("SampleLocation", this.sampleLocationField); + } + if (this.searchFieldSet) + { + writer.WriteAttributeString("Search", this.searchField); + } + if (this.suppressCustomActionsFieldSet) + { + if ((this.suppressCustomActionsField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressCustomActions", "no"); + } + if ((this.suppressCustomActionsField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressCustomActions", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AttributeIndex" == name)) + { + this.attributeIndexField = value; + this.attributeIndexFieldSet = true; + } + if (("Index" == name)) + { + this.indexField = value; + this.indexFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.languageFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SampleLocation" == name)) + { + this.sampleLocationField = value; + this.sampleLocationFieldSet = true; + } + if (("Search" == name)) + { + this.searchField = value; + this.searchFieldSet = true; + } + if (("SuppressCustomActions" == name)) + { + this.suppressCustomActionsField = Enums.ParseYesNoType(value); + this.suppressCustomActionsFieldSet = true; + } + } + } + + /// + /// Plugin for Help Namespace. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PlugCollectionInto : ISchemaElement, ISetAttributes + { + + private string attributesField; + + private bool attributesFieldSet; + + private string tableOfContentsField; + + private bool tableOfContentsFieldSet; + + private string targetCollectionField; + + private bool targetCollectionFieldSet; + + private string targetTableOfContentsField; + + private bool targetTableOfContentsFieldSet; + + private string targetFeatureField; + + private bool targetFeatureFieldSet; + + private YesNoType suppressExternalNamespacesField; + + private bool suppressExternalNamespacesFieldSet; + + private ISchemaElement parentElement; + + /// + /// Key for HxA (Attributes) file of child namespace. + /// + public string Attributes + { + get + { + return this.attributesField; + } + set + { + this.attributesFieldSet = true; + this.attributesField = value; + } + } + + /// + /// Key for HxT file of child namespace. + /// + public string TableOfContents + { + get + { + return this.tableOfContentsField; + } + set + { + this.tableOfContentsFieldSet = true; + this.tableOfContentsField = value; + } + } + + /// + /// Foriegn Key into HelpNamespace table for the parent namespace into which the child will be inserted. + /// The following special keys can be used to plug into external namespaces defined outside of the installer. + /// MS_VSIPCC_v80 : Visual Studio 2005 + /// MS.VSIPCC.v90 : Visual Studio 2008 + /// + public string TargetCollection + { + get + { + return this.targetCollectionField; + } + set + { + this.targetCollectionFieldSet = true; + this.targetCollectionField = value; + } + } + + /// + /// Key for HxT file of parent namespace that now includes the new child namespace. + /// + public string TargetTableOfContents + { + get + { + return this.targetTableOfContentsField; + } + set + { + this.targetTableOfContentsFieldSet = true; + this.targetTableOfContentsField = value; + } + } + + /// + /// Key for the feature parent of this help collection. Required only when plugging into external namespaces. + /// + public string TargetFeature + { + get + { + return this.targetFeatureField; + } + set + { + this.targetFeatureFieldSet = true; + this.targetFeatureField = value; + } + } + + /// + /// Suppress linking Visual Studio Help namespaces. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressExternalNamespaces + { + get + { + return this.suppressExternalNamespacesField; + } + set + { + this.suppressExternalNamespacesFieldSet = true; + this.suppressExternalNamespacesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PlugCollectionInto", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.attributesFieldSet) + { + writer.WriteAttributeString("Attributes", this.attributesField); + } + if (this.tableOfContentsFieldSet) + { + writer.WriteAttributeString("TableOfContents", this.tableOfContentsField); + } + if (this.targetCollectionFieldSet) + { + writer.WriteAttributeString("TargetCollection", this.targetCollectionField); + } + if (this.targetTableOfContentsFieldSet) + { + writer.WriteAttributeString("TargetTableOfContents", this.targetTableOfContentsField); + } + if (this.targetFeatureFieldSet) + { + writer.WriteAttributeString("TargetFeature", this.targetFeatureField); + } + if (this.suppressExternalNamespacesFieldSet) + { + if ((this.suppressExternalNamespacesField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressExternalNamespaces", "no"); + } + if ((this.suppressExternalNamespacesField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressExternalNamespaces", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Attributes" == name)) + { + this.attributesField = value; + this.attributesFieldSet = true; + } + if (("TableOfContents" == name)) + { + this.tableOfContentsField = value; + this.tableOfContentsFieldSet = true; + } + if (("TargetCollection" == name)) + { + this.targetCollectionField = value; + this.targetCollectionFieldSet = true; + } + if (("TargetTableOfContents" == name)) + { + this.targetTableOfContentsField = value; + this.targetTableOfContentsFieldSet = true; + } + if (("TargetFeature" == name)) + { + this.targetFeatureField = value; + this.targetFeatureFieldSet = true; + } + if (("SuppressExternalNamespaces" == name)) + { + this.suppressExternalNamespacesField = Enums.ParseYesNoType(value); + this.suppressExternalNamespacesFieldSet = true; + } + } + } + + /// + /// Create a reference to a HelpFile element in another Fragment. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFileRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFile Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFileRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a HelpFile element in another Fragment. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFilterRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFilter. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFilterRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a HelpCollection element in another Fragment. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpCollectionRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public HelpCollectionRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFileRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary Key for HelpNamespace Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("HelpFileRef" == childName)) + { + childValue = new HelpFileRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpCollectionRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// This element provides the metdata required to install/uninstall a file as + /// a VSIX Package. The VSIX package file will be installed as part of the MSI + /// then passed to the VSIX installer to install the VSIX package. To avoid the + /// duplication, simply use the MSI to install the VSIX package itself. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class VsixPackage : ISchemaElement, ISetAttributes + { + + private string fileField; + + private bool fileFieldSet; + + private string packageIdField; + + private bool packageIdFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string targetVersionField; + + private bool targetVersionFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private string vsixInstallerPathPropertyField; + + private bool vsixInstallerPathPropertyFieldSet; + + private ISchemaElement parentElement; + + /// + /// Reference to file identifer. This attribute is required when the element is not a + /// child of a File element and is invalid when the element is a child of the File element. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Identity of the VSIX package per its internal manifest. If this value is not correct + /// the VSIX package will not correctly uninstall. + /// + public string PackageId + { + get + { + return this.packageIdField; + } + set + { + this.packageIdFieldSet = true; + this.packageIdField = value; + } + } + + /// + /// Indicates whether the VSIX package is uninstalled when the parent Component is uninstalled. + /// The default is 'no'. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies the SKU of Visual Studio in which to register the extension. If no target + /// is specified the extension is registered with all installed SKUs. If the Target + /// attribute is specified the TargetVersion attribute must also be specified. The + /// following is a list of known Visual Studio targets: integratedShell, professional, + /// premium, ultimate, vbExpress, vcExpress, vcsExpress, vwdExpress + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Specifies the version of Visual Studio in which to register the extension. This attribute + /// is required if the Target attribute is specified. + /// + public string TargetVersion + { + get + { + return this.targetVersionField; + } + set + { + this.targetVersionFieldSet = true; + this.targetVersionField = value; + } + } + + /// + /// Indicates whether failure to install the VSIX package causes the installation to rollback. + /// The default is 'yes'. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Optional reference to a Property element that contains the path to the VsixInstaller.exe. + /// By default, the latest VsixInstaller.exe on the machine will be used to install the VSIX + /// package. It is highly recommended that this attribute is *not* used. + /// + public string VsixInstallerPathProperty + { + get + { + return this.vsixInstallerPathPropertyField; + } + set + { + this.vsixInstallerPathPropertyFieldSet = true; + this.vsixInstallerPathPropertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("VsixPackage", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.packageIdFieldSet) + { + writer.WriteAttributeString("PackageId", this.packageIdField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.targetVersionFieldSet) + { + writer.WriteAttributeString("TargetVersion", this.targetVersionField); + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.vsixInstallerPathPropertyFieldSet) + { + writer.WriteAttributeString("VsixInstallerPathProperty", this.vsixInstallerPathPropertyField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("PackageId" == name)) + { + this.packageIdField = value; + this.packageIdFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("TargetVersion" == name)) + { + this.targetVersionField = value; + this.targetVersionFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("VsixInstallerPathProperty" == name)) + { + this.vsixInstallerPathPropertyField = value; + this.vsixInstallerPathPropertyFieldSet = true; + } + } + } +} diff --git a/src/heat/Serialize/wix.cs b/src/heat/Serialize/wix.cs new file mode 100644 index 00000000..e5a81cd0 --- /dev/null +++ b/src/heat/Serialize/wix.cs @@ -0,0 +1,57740 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // TODO: add documentation +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + + /// + /// Values of this type will either be "attached" or "detached". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum BurnContainerType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + attached, + + detached, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a BurnContainerType from a string. + /// + public static BurnContainerType ParseBurnContainerType(string value) + { + BurnContainerType parsedValue; + Enums.TryParseBurnContainerType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a BurnContainerType from a string. + /// + public static bool TryParseBurnContainerType(string value, out BurnContainerType parsedValue) + { + parsedValue = BurnContainerType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("attached" == value)) + { + parsedValue = BurnContainerType.attached; + } + else + { + if (("detached" == value)) + { + parsedValue = BurnContainerType.detached; + } + else + { + parsedValue = BurnContainerType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a BurnExeProtocolType from a string. + /// + public static BurnExeProtocolType ParseBurnExeProtocolType(string value) + { + BurnExeProtocolType parsedValue; + Enums.TryParseBurnExeProtocolType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a BurnExeProtocolType from a string. + /// + public static bool TryParseBurnExeProtocolType(string value, out BurnExeProtocolType parsedValue) + { + parsedValue = BurnExeProtocolType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = BurnExeProtocolType.none; + } + else + { + if (("burn" == value)) + { + parsedValue = BurnExeProtocolType.burn; + } + else + { + if (("netfx4" == value)) + { + parsedValue = BurnExeProtocolType.netfx4; + } + else + { + parsedValue = BurnExeProtocolType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a YesNoButtonType from a string. + /// + public static YesNoButtonType ParseYesNoButtonType(string value) + { + YesNoButtonType parsedValue; + Enums.TryParseYesNoButtonType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoButtonType from a string. + /// + public static bool TryParseYesNoButtonType(string value, out YesNoButtonType parsedValue) + { + parsedValue = YesNoButtonType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoButtonType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoButtonType.yes; + } + else + { + if (("button" == value)) + { + parsedValue = YesNoButtonType.button; + } + else + { + parsedValue = YesNoButtonType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a YesNoDefaultType from a string. + /// + public static YesNoDefaultType ParseYesNoDefaultType(string value) + { + YesNoDefaultType parsedValue; + Enums.TryParseYesNoDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoDefaultType from a string. + /// + public static bool TryParseYesNoDefaultType(string value, out YesNoDefaultType parsedValue) + { + parsedValue = YesNoDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("default" == value)) + { + parsedValue = YesNoDefaultType.@default; + } + else + { + if (("no" == value)) + { + parsedValue = YesNoDefaultType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoDefaultType.yes; + } + else + { + parsedValue = YesNoDefaultType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a YesNoAlwaysType from a string. + /// + public static YesNoAlwaysType ParseYesNoAlwaysType(string value) + { + YesNoAlwaysType parsedValue; + Enums.TryParseYesNoAlwaysType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoAlwaysType from a string. + /// + public static bool TryParseYesNoAlwaysType(string value, out YesNoAlwaysType parsedValue) + { + parsedValue = YesNoAlwaysType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("always" == value)) + { + parsedValue = YesNoAlwaysType.always; + } + else + { + if (("no" == value)) + { + parsedValue = YesNoAlwaysType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoAlwaysType.yes; + } + else + { + parsedValue = YesNoAlwaysType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a RegistryRootType from a string. + /// + public static RegistryRootType ParseRegistryRootType(string value) + { + RegistryRootType parsedValue; + Enums.TryParseRegistryRootType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RegistryRootType from a string. + /// + public static bool TryParseRegistryRootType(string value, out RegistryRootType parsedValue) + { + parsedValue = RegistryRootType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("HKMU" == value)) + { + parsedValue = RegistryRootType.HKMU; + } + else + { + if (("HKCR" == value)) + { + parsedValue = RegistryRootType.HKCR; + } + else + { + if (("HKCU" == value)) + { + parsedValue = RegistryRootType.HKCU; + } + else + { + if (("HKLM" == value)) + { + parsedValue = RegistryRootType.HKLM; + } + else + { + if (("HKU" == value)) + { + parsedValue = RegistryRootType.HKU; + } + else + { + parsedValue = RegistryRootType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ExitType from a string. + /// + public static ExitType ParseExitType(string value) + { + ExitType parsedValue; + Enums.TryParseExitType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ExitType from a string. + /// + public static bool TryParseExitType(string value, out ExitType parsedValue) + { + parsedValue = ExitType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("success" == value)) + { + parsedValue = ExitType.success; + } + else + { + if (("cancel" == value)) + { + parsedValue = ExitType.cancel; + } + else + { + if (("error" == value)) + { + parsedValue = ExitType.error; + } + else + { + if (("suspend" == value)) + { + parsedValue = ExitType.suspend; + } + else + { + parsedValue = ExitType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a InstallUninstallType from a string. + /// + public static InstallUninstallType ParseInstallUninstallType(string value) + { + InstallUninstallType parsedValue; + Enums.TryParseInstallUninstallType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallUninstallType from a string. + /// + public static bool TryParseInstallUninstallType(string value, out InstallUninstallType parsedValue) + { + parsedValue = InstallUninstallType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = InstallUninstallType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = InstallUninstallType.uninstall; + } + else + { + if (("both" == value)) + { + parsedValue = InstallUninstallType.both; + } + else + { + parsedValue = InstallUninstallType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a SequenceType from a string. + /// + public static SequenceType ParseSequenceType(string value) + { + SequenceType parsedValue; + Enums.TryParseSequenceType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SequenceType from a string. + /// + public static bool TryParseSequenceType(string value, out SequenceType parsedValue) + { + parsedValue = SequenceType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("both" == value)) + { + parsedValue = SequenceType.both; + } + else + { + if (("first" == value)) + { + parsedValue = SequenceType.first; + } + else + { + if (("execute" == value)) + { + parsedValue = SequenceType.execute; + } + else + { + if (("ui" == value)) + { + parsedValue = SequenceType.ui; + } + else + { + parsedValue = SequenceType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a CompressionLevelType from a string. + /// + public static CompressionLevelType ParseCompressionLevelType(string value) + { + CompressionLevelType parsedValue; + Enums.TryParseCompressionLevelType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CompressionLevelType from a string. + /// + public static bool TryParseCompressionLevelType(string value, out CompressionLevelType parsedValue) + { + parsedValue = CompressionLevelType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("high" == value)) + { + parsedValue = CompressionLevelType.high; + } + else + { + if (("low" == value)) + { + parsedValue = CompressionLevelType.low; + } + else + { + if (("medium" == value)) + { + parsedValue = CompressionLevelType.medium; + } + else + { + if (("mszip" == value)) + { + parsedValue = CompressionLevelType.mszip; + } + else + { + if (("none" == value)) + { + parsedValue = CompressionLevelType.none; + } + else + { + parsedValue = CompressionLevelType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + } + + /// + /// The list of communcation protocols with executable packages Burn supports. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum BurnExeProtocolType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The executable package does not support a communication protocol. + /// + none, + + /// + /// The executable package is another Burn bundle and supports the Burn communication protocol. + /// + burn, + + /// + /// The executable package implements the .NET Framework v4.0 communication protocol. + /// + netfx4, + } + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + /// + /// Values of this type will either be "button", "yes" or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoButtonType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + + button, + } + + /// + /// Values of this type will either be "default", "yes", or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + @default, + + no, + + yes, + } + + /// + /// Values of this type will either be "always", "yes", or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoAlwaysType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + always, + + no, + + yes, + } + + /// + /// Values of this type represent possible registry roots. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum RegistryRootType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// A per-user installation will make the operation occur under HKEY_CURRENT_USER. + /// A per-machine installation will make the operation occur under HKEY_LOCAL_MACHINE. + /// + HKMU, + + /// + /// Operation occurs under HKEY_CLASSES_ROOT. When using Windows 2000 or later, the installer writes or removes the value + /// from the HKCU\Software\Classes hive during per-user installations. When using Windows 2000 or later operating systems, + /// the installer writes or removes the value from the HKLM\Software\Classes hive during per-machine installations. + /// + HKCR, + + /// + /// Operation occurs under HKEY_CURRENT_USER. It is recommended to set the KeyPath='yes' attribute when setting this value for writing values + /// in order to ensure that the installer writes the necessary registry entries when there are multiple users on the same computer. + /// + HKCU, + + /// + /// Operation occurs under HKEY_LOCAL_MACHINE. + /// + HKLM, + + /// + /// Operation occurs under HKEY_USERS. + /// + HKU, + } + + /// + /// Value indicates that this action is executed if the installer returns the associated exit type. Each exit type can be used with no more than one action. + /// Multiple actions can have exit types assigned, but every action and exit type must be different. Exit types are typically used with dialog boxes. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ExitType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + success, + + cancel, + + error, + + suspend, + } + + /// + /// Specifies whether an action occur on install, uninstall or both. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallUninstallType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The action should happen during install (msiInstallStateLocal or msiInstallStateSource). + /// + install, + + /// + /// The action should happen during uninstall (msiInstallStateAbsent). + /// + uninstall, + + /// + /// The action should happen during both install and uninstall. + /// + both, + } + + /// + /// Controls which sequences the item assignment is sequenced in. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum SequenceType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Schedules the assignment in the InstallUISequence and the InstallExecuteSequence. + /// + both, + + /// + /// Schedules the assignment to run in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped. + /// + first, + + /// + /// Schedules the assignment only in the the InstallExecuteSequence. + /// + execute, + + /// + /// Schedules the assignment only in the the InstallUISequence. + /// + ui, + } + + /// + /// Indicates the compression level for a cabinet. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum CompressionLevelType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + high, + + low, + + medium, + + mszip, + + none, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public abstract class ActionModuleSequenceType : ISchemaElement, ISetAttributes + { + + private string afterField; + + private bool afterFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private YesNoType suppressField; + + private bool suppressFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of an action that this action should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The name of an action that this action should come before. + /// + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + /// + /// If "yes", the sequencing of this action may be overridden by sequencing elsewhere. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + /// + /// A value used to indicate the position of this action in a sequence. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// If yes, this action will not occur. + /// + public YesNoType Suppress + { + get + { + return this.suppressField; + } + set + { + this.suppressFieldSet = true; + this.suppressField = value; + } + } + + /// + /// Text node specifies the condition of the action. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.suppressFieldSet) + { + if ((this.suppressField == YesNoType.no)) + { + writer.WriteAttributeString("Suppress", "no"); + } + if ((this.suppressField == YesNoType.yes)) + { + writer.WriteAttributeString("Suppress", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Suppress" == name)) + { + this.suppressField = Enums.ParseYesNoType(value); + this.suppressFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public abstract class ActionSequenceType : ISchemaElement, ISetAttributes + { + + private int sequenceField; + + private bool sequenceFieldSet; + + private YesNoType suppressField; + + private bool suppressFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// A value used to indicate the position of this action in a sequence. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// If yes, this action will not occur. + /// + public YesNoType Suppress + { + get + { + return this.suppressField; + } + set + { + this.suppressFieldSet = true; + this.suppressField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.suppressFieldSet) + { + if ((this.suppressField == YesNoType.no)) + { + writer.WriteAttributeString("Suppress", "no"); + } + if ((this.suppressField == YesNoType.yes)) + { + writer.WriteAttributeString("Suppress", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Suppress" == name)) + { + this.suppressField = Enums.ParseYesNoType(value); + this.suppressFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// This is the top-level container element for every wxs file. Among the possible children, + /// the Bundle, Package, Module, Patch, and PatchCreation elements are analogous to the main function in a C program. + /// There can only be one of these present when linking occurs. Package compiles into an msi file, + /// Module compiles into an msm file, PatchCreation compiles into a pcp file. The Fragment element + /// is an atomic unit which ultimately links into either a Package, Module, or PatchCreation. The + /// Fragment can either be completely included or excluded during linking. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Wix : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string requiredVersionField; + + private bool requiredVersionFieldSet; + + private ISchemaElement parentElement; + + public Wix() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Bundle))); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Package))); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Module))); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Patch))); + childCollection1.AddCollection(childCollection2); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(Fragment))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCreation))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Required version of the WiX toolset to compile this input file. + /// + public string RequiredVersion + { + get + { + return this.requiredVersionField; + } + set + { + this.requiredVersionFieldSet = true; + this.requiredVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Bundle" == childName)) + { + childValue = new Bundle(); + } + if (("Package" == childName)) + { + childValue = new Package(); + } + if (("Module" == childName)) + { + childValue = new Module(); + } + if (("Patch" == childName)) + { + childValue = new Patch(); + } + if (("Fragment" == childName)) + { + childValue = new Fragment(); + } + if (("PatchCreation" == childName)) + { + childValue = new PatchCreation(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Wix", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.requiredVersionFieldSet) + { + writer.WriteAttributeString("RequiredVersion", this.requiredVersionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("RequiredVersion" == name)) + { + this.requiredVersionField = value; + this.requiredVersionFieldSet = true; + } + } + } + + /// + /// This is the top-level container element for every wxi file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Include : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public Include() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Include", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// The root element for creating bundled packages. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Bundle : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string aboutUrlField; + + private bool aboutUrlFieldSet; + + private string copyrightField; + + private bool copyrightFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoButtonType disableModifyField; + + private bool disableModifyFieldSet; + + private YesNoType disableRemoveField; + + private bool disableRemoveFieldSet; + + private YesNoType disableRepairField; + + private bool disableRepairFieldSet; + + private string helpTelephoneField; + + private bool helpTelephoneFieldSet; + + private string helpUrlField; + + private bool helpUrlFieldSet; + + private string iconSourceFileField; + + private bool iconSourceFileFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string parentNameField; + + private bool parentNameFieldSet; + + private string splashScreenSourceFileField; + + private bool splashScreenSourceFileFieldSet; + + private string tagField; + + private bool tagFieldSet; + + private string updateUrlField; + + private bool updateUrlFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private ISchemaElement parentElement; + + public Bundle() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ApprovedExeForElevation))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Log))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Catalog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplicationRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(OptionalUpdateRegistration))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Chain))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Container))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ContainerRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RelatedBundle))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Update))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Variable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// A URL for more information about the bundle to display in Programs and Features (also + /// known as Add/Remove Programs). + /// + public string AboutUrl + { + get + { + return this.aboutUrlField; + } + set + { + this.aboutUrlFieldSet = true; + this.aboutUrlField = value; + } + } + + /// + /// The legal copyright found in the version resources of final bundle executable. If + /// this attribute is not provided the copyright will be set to "Copyright (c) [Bundle/@Manufacturer]. All rights reserved.". + /// + public string Copyright + { + get + { + return this.copyrightField; + } + set + { + this.copyrightFieldSet = true; + this.copyrightField = value; + } + } + + /// + /// Whether Packages and Payloads not assigned to a container should be added to the default attached container or if they should be external. The default is yes. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// Determines whether the bundle can be modified via the Programs and Features (also known as + /// Add/Remove Programs). If the value is "button" then Programs and Features will show a single + /// "Uninstall/Change" button. If the value is "yes" then Programs and Features will only show + /// the "Uninstall" button". If the value is "no", the default, then a "Change" button is shown. + /// See the DisableRemove attribute for information how to not display the bundle in Programs + /// and Features. + /// + public YesNoButtonType DisableModify + { + get + { + return this.disableModifyField; + } + set + { + this.disableModifyFieldSet = true; + this.disableModifyField = value; + } + } + + /// + /// Determines whether the bundle can be removed via the Programs and Features (also + /// known as Add/Remove Programs). If the value is "yes" then the "Uninstall" button will + /// not be displayed. The default is "no" which ensures there is an "Uninstall" button to + /// remove the bundle. If the "DisableModify" attribute is also "yes" or "button" then the + /// bundle will not be displayed in Progams and Features and another mechanism (such as + /// registering as a related bundle addon) must be used to ensure the bundle can be removed. + /// + public YesNoType DisableRemove + { + get + { + return this.disableRemoveField; + } + set + { + this.disableRemoveFieldSet = true; + this.disableRemoveField = value; + } + } + + public YesNoType DisableRepair + { + get + { + return this.disableRepairField; + } + set + { + this.disableRepairFieldSet = true; + this.disableRepairField = value; + } + } + + /// + /// A telephone number for help to display in Programs and Features (also known as + /// Add/Remove Programs). + /// + public string HelpTelephone + { + get + { + return this.helpTelephoneField; + } + set + { + this.helpTelephoneFieldSet = true; + this.helpTelephoneField = value; + } + } + + /// + /// A URL to the help for the bundle to display in Programs and Features (also known as + /// Add/Remove Programs). + /// + public string HelpUrl + { + get + { + return this.helpUrlField; + } + set + { + this.helpUrlFieldSet = true; + this.helpUrlField = value; + } + } + + /// + /// Path to an icon that will replace the default icon in the final Bundle executable. + /// This icon will also be displayed in Programs and Features (also known as Add/Remove + /// Programs). + /// + public string IconSourceFile + { + get + { + return this.iconSourceFileField; + } + set + { + this.iconSourceFileFieldSet = true; + this.iconSourceFileField = value; + } + } + + /// + /// The publisher of the bundle to display in Programs and Features (also known as + /// Add/Remove Programs). + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The name of the bundle to display in Programs and Features (also known as Add/Remove + /// Programs). This name can be accessed and overwritten by a BootstrapperApplication + /// using the WixBundleName bundle variable. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The name of the parent bundle to display in Installed Updates (also known as Add/Remove + /// Programs). This name is used to nest or group bundles that will appear as updates. + /// If the parent name does not actually exist, a virtual parent is created automatically. + /// + public string ParentName + { + get + { + return this.parentNameField; + } + set + { + this.parentNameFieldSet = true; + this.parentNameField = value; + } + } + + /// + /// Path to a bitmap that will be shown as the bootstrapper application is being loaded. If this attribute is not specified, no splash screen will be displayed. + /// + public string SplashScreenSourceFile + { + get + { + return this.splashScreenSourceFileField; + } + set + { + this.splashScreenSourceFileFieldSet = true; + this.splashScreenSourceFileField = value; + } + } + + /// + /// Set this string to uniquely identify this bundle to its own BA, and to related bundles. The value of this string only matters to the BA, and its value has no direct effect on engine functionality. + /// + public string Tag + { + get + { + return this.tagField; + } + set + { + this.tagFieldSet = true; + this.tagField = value; + } + } + + /// + /// A URL for updates of the bundle to display in Programs and Features (also + /// known as Add/Remove Programs). + /// + public string UpdateUrl + { + get + { + return this.updateUrlField; + } + set + { + this.updateUrlFieldSet = true; + this.updateUrlField = value; + } + } + + /// + /// Unique identifier for a family of bundles. If two bundles have the same UpgradeCode the + /// bundle with the highest version will be installed. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// The version of the bundle. Newer versions upgrade earlier versions of the bundles + /// with matching UpgradeCodes. If the bundle is registered in Programs and Features + /// then this attribute will be displayed in the Programs and Features user interface. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + /// + /// The condition of the bundle. If the condition is not met, the bundle will + /// refuse to run. Conditions are checked before the bootstrapper application is loaded + /// (before detect), and thus can only reference built-in variables such as + /// variables which indicate the version of the OS. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ApprovedExeForElevation" == childName)) + { + childValue = new ApprovedExeForElevation(); + } + if (("Log" == childName)) + { + childValue = new Log(); + } + if (("Catalog" == childName)) + { + childValue = new Catalog(); + } + if (("BootstrapperApplication" == childName)) + { + childValue = new BootstrapperApplication(); + } + if (("BootstrapperApplicationRef" == childName)) + { + childValue = new BootstrapperApplicationRef(); + } + if (("OptionalUpdateRegistration" == childName)) + { + childValue = new OptionalUpdateRegistration(); + } + if (("Chain" == childName)) + { + childValue = new Chain(); + } + if (("Container" == childName)) + { + childValue = new Container(); + } + if (("ContainerRef" == childName)) + { + childValue = new ContainerRef(); + } + if (("PayloadGroup" == childName)) + { + childValue = new PayloadGroup(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if (("RelatedBundle" == childName)) + { + childValue = new RelatedBundle(); + } + if (("Update" == childName)) + { + childValue = new Update(); + } + if (("Variable" == childName)) + { + childValue = new Variable(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Bundle", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.aboutUrlFieldSet) + { + writer.WriteAttributeString("AboutUrl", this.aboutUrlField); + } + if (this.copyrightFieldSet) + { + writer.WriteAttributeString("Copyright", this.copyrightField); + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.disableModifyFieldSet) + { + if ((this.disableModifyField == YesNoButtonType.no)) + { + writer.WriteAttributeString("DisableModify", "no"); + } + if ((this.disableModifyField == YesNoButtonType.yes)) + { + writer.WriteAttributeString("DisableModify", "yes"); + } + if ((this.disableModifyField == YesNoButtonType.button)) + { + writer.WriteAttributeString("DisableModify", "button"); + } + } + if (this.disableRemoveFieldSet) + { + if ((this.disableRemoveField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRemove", "no"); + } + if ((this.disableRemoveField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRemove", "yes"); + } + } + if (this.disableRepairFieldSet) + { + if ((this.disableRepairField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRepair", "no"); + } + if ((this.disableRepairField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRepair", "yes"); + } + } + if (this.helpTelephoneFieldSet) + { + writer.WriteAttributeString("HelpTelephone", this.helpTelephoneField); + } + if (this.helpUrlFieldSet) + { + writer.WriteAttributeString("HelpUrl", this.helpUrlField); + } + if (this.iconSourceFileFieldSet) + { + writer.WriteAttributeString("IconSourceFile", this.iconSourceFileField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.parentNameFieldSet) + { + writer.WriteAttributeString("ParentName", this.parentNameField); + } + if (this.splashScreenSourceFileFieldSet) + { + writer.WriteAttributeString("SplashScreenSourceFile", this.splashScreenSourceFileField); + } + if (this.tagFieldSet) + { + writer.WriteAttributeString("Tag", this.tagField); + } + if (this.updateUrlFieldSet) + { + writer.WriteAttributeString("UpdateUrl", this.updateUrlField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("AboutUrl" == name)) + { + this.aboutUrlField = value; + this.aboutUrlFieldSet = true; + } + if (("Copyright" == name)) + { + this.copyrightField = value; + this.copyrightFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("DisableModify" == name)) + { + this.disableModifyField = Enums.ParseYesNoButtonType(value); + this.disableModifyFieldSet = true; + } + if (("DisableRemove" == name)) + { + this.disableRemoveField = Enums.ParseYesNoType(value); + this.disableRemoveFieldSet = true; + } + if (("DisableRepair" == name)) + { + this.disableRepairField = Enums.ParseYesNoType(value); + this.disableRepairFieldSet = true; + } + if (("HelpTelephone" == name)) + { + this.helpTelephoneField = value; + this.helpTelephoneFieldSet = true; + } + if (("HelpUrl" == name)) + { + this.helpUrlField = value; + this.helpUrlFieldSet = true; + } + if (("IconSourceFile" == name)) + { + this.iconSourceFileField = value; + this.iconSourceFileFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ParentName" == name)) + { + this.parentNameField = value; + this.parentNameFieldSet = true; + } + if (("SplashScreenSourceFile" == name)) + { + this.splashScreenSourceFileField = value; + this.splashScreenSourceFileFieldSet = true; + } + if (("Tag" == name)) + { + this.tagField = value; + this.tagFieldSet = true; + } + if (("UpdateUrl" == name)) + { + this.updateUrlField = value; + this.updateUrlFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + } + } + + /// + /// Provides information about an .exe so that the BA can request the engine to run it elevated from any secure location. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ApprovedExeForElevation : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the ApprovedExeForElevation element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The key path. + /// For security purposes, the root key will be HKLM and Variables are not supported. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The value name. + /// For security purposes, Variables are not supported. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Instructs the search to look in the 64-bit registry when the value is 'yes'. + /// When the value is 'no', the search looks in the 32-bit registry. + /// The default value is 'no'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ApprovedExeForElevation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + } + + /// + /// Overrides the default log settings for a bundle. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Log : ISchemaElement, ISetAttributes + { + + private YesNoType disableField; + + private bool disableFieldSet; + + private string pathVariableField; + + private bool pathVariableFieldSet; + + private string prefixField; + + private bool prefixFieldSet; + + private string extensionField; + + private bool extensionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Disables the default logging in the Bundle. The end user can still generate a + /// log file by specifying the "-l" command-line argument when installing the + /// Bundle. + /// + public YesNoType Disable + { + get + { + return this.disableField; + } + set + { + this.disableFieldSet = true; + this.disableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value + /// will cause the variable to not be set. The default is "WixBundleLog". + /// + public string PathVariable + { + get + { + return this.pathVariableField; + } + set + { + this.pathVariableFieldSet = true; + this.pathVariableField = value; + } + } + + /// + /// File name and optionally a relative path to use as the prefix for the log file. The + /// default is to use the Bundle/@Name or, if Bundle/@Name is not specified, the value + /// "Setup". + /// + public string Prefix + { + get + { + return this.prefixField; + } + set + { + this.prefixFieldSet = true; + this.prefixField = value; + } + } + + /// + /// The extension to use for the log. The default is ".log". + /// + public string Extension + { + get + { + return this.extensionField; + } + set + { + this.extensionFieldSet = true; + this.extensionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Log", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.disableFieldSet) + { + if ((this.disableField == YesNoType.no)) + { + writer.WriteAttributeString("Disable", "no"); + } + if ((this.disableField == YesNoType.yes)) + { + writer.WriteAttributeString("Disable", "yes"); + } + } + if (this.pathVariableFieldSet) + { + writer.WriteAttributeString("PathVariable", this.pathVariableField); + } + if (this.prefixFieldSet) + { + writer.WriteAttributeString("Prefix", this.prefixField); + } + if (this.extensionFieldSet) + { + writer.WriteAttributeString("Extension", this.extensionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Disable" == name)) + { + this.disableField = Enums.ParseYesNoType(value); + this.disableFieldSet = true; + } + if (("PathVariable" == name)) + { + this.pathVariableField = value; + this.pathVariableFieldSet = true; + } + if (("Prefix" == name)) + { + this.prefixField = value; + this.prefixFieldSet = true; + } + if (("Extension" == name)) + { + this.extensionField = value; + this.extensionFieldSet = true; + } + } + } + + /// + /// Specify one or more catalog files that will be used to verify the contents of the bundle. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Catalog : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the catalog element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The catalog file + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Catalog", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Contains all the relevant information about the setup UI. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BootstrapperApplication : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private ISchemaElement parentElement; + + public BootstrapperApplication() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the BootstrapperApplication element. Only required if you want to reference this element using a BootstrapperApplicationRef element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The DLL with the bootstrapper application entry function. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The relative destination path and file name for the bootstrapper application DLL. The default is the source file name. Use this attribute to rename the bootstrapper application DLL or extract it into a subfolder. The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BootstrapperApplication", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + } + } + + /// + /// Used to reference a BootstrapperApplication element and optionally add additional payloads to the bootstrapper application. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BootstrapperApplicationRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public BootstrapperApplicationRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the BootstrapperApplication element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BootstrapperApplicationRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// This element has been deprecated. Use the BootstrapperApplication element instead. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UX : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string splashScreenSourceFileField; + + private bool splashScreenSourceFileFieldSet; + + private ISchemaElement parentElement; + + public UX() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// See the BootstrapperApplication instead. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// See the BootstrapperApplication instead. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// See the BootstrapperApplication instead. + /// + public string SplashScreenSourceFile + { + get + { + return this.splashScreenSourceFileField; + } + set + { + this.splashScreenSourceFileFieldSet = true; + this.splashScreenSourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UX", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.splashScreenSourceFileFieldSet) + { + writer.WriteAttributeString("SplashScreenSourceFile", this.splashScreenSourceFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SplashScreenSourceFile" == name)) + { + this.splashScreenSourceFileField = value; + this.splashScreenSourceFileFieldSet = true; + } + } + } + + /// + /// Writes additional information to the Windows registry that can be used to detect the bundle. + /// This registration is intended primarily for update to an existing product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class OptionalUpdateRegistration : ISchemaElement, ISetAttributes + { + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string departmentField; + + private bool departmentFieldSet; + + private string productFamilyField; + + private bool productFamilyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string classificationField; + + private bool classificationFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the manufacturer. The default is the Bundle/@Manufacturer attribute, + /// but may also be a short form, ex: Acme instead of Acme Corporation. + /// An error is generated at build time if neither attribute is specified. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The name of the department or division publishing the update bundle. + /// The PublishingGroup registry value is not written if this attribute is not specified. + /// + public string Department + { + get + { + return this.departmentField; + } + set + { + this.departmentFieldSet = true; + this.departmentField = value; + } + } + + /// + /// The name of the family of products being updated. The default is the Bundle/@ParentName attribute. + /// The corresponding registry key is not created if neither attribute is specified. + /// + public string ProductFamily + { + get + { + return this.productFamilyField; + } + set + { + this.productFamilyFieldSet = true; + this.productFamilyField = value; + } + } + + /// + /// The name of the bundle. The default is the Bundle/@Name attribute, + /// but may also be a short form, ex: KB12345 instead of Update to Product (KB12345). + /// An error is generated at build time if neither attribute is specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The release type of the update bundle, such as Update, Security Update, Service Pack, etc. + /// The default value is Update. + /// + public string Classification + { + get + { + return this.classificationField; + } + set + { + this.classificationFieldSet = true; + this.classificationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("OptionalUpdateRegistration", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.departmentFieldSet) + { + writer.WriteAttributeString("Department", this.departmentField); + } + if (this.productFamilyFieldSet) + { + writer.WriteAttributeString("ProductFamily", this.productFamilyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.classificationFieldSet) + { + writer.WriteAttributeString("Classification", this.classificationField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Department" == name)) + { + this.departmentField = value; + this.departmentFieldSet = true; + } + if (("ProductFamily" == name)) + { + this.productFamilyField = value; + this.productFamilyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Classification" == name)) + { + this.classificationField = value; + this.classificationFieldSet = true; + } + } + } + + /// + /// Contains the chain of packages to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Chain : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType disableRollbackField; + + private bool disableRollbackFieldSet; + + private YesNoType disableSystemRestoreField; + + private bool disableSystemRestoreFieldSet; + + private YesNoType parallelCacheField; + + private bool parallelCacheFieldSet; + + private ISchemaElement parentElement; + + public Chain() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MspPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RollbackBoundary))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Specifies whether the bundle will attempt to rollback packages + /// executed in the chain. If "yes" is specified then when a vital + /// package fails to install only that package will rollback and the + /// chain will stop with the error. The default is "no" which + /// indicates all packages executed during the chain will be + /// rolledback to their previous state when a vital package fails. + /// + public YesNoType DisableRollback + { + get + { + return this.disableRollbackField; + } + set + { + this.disableRollbackFieldSet = true; + this.disableRollbackField = value; + } + } + + /// + /// Specifies whether the bundle will attempt to create a system + /// restore point when executing the chain. If "yes" is specified then + /// a system restore point will not be created. The default is "no" which + /// indicates a system restore point will be created when the bundle is + /// installed, uninstalled, repaired, modified, etc. If the system restore + /// point cannot be created, the bundle will log the issue and continue. + /// + public YesNoType DisableSystemRestore + { + get + { + return this.disableSystemRestoreField; + } + set + { + this.disableSystemRestoreFieldSet = true; + this.disableSystemRestoreField = value; + } + } + + /// + /// Specifies whether the bundle will start installing packages + /// while other packages are still being cached. If "yes", + /// packages will start executing when a rollback boundary is + /// encountered. The default is "no" which dictates all packages + /// must be cached before any packages will start to be installed. + /// + public YesNoType ParallelCache + { + get + { + return this.parallelCacheField; + } + set + { + this.parallelCacheFieldSet = true; + this.parallelCacheField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiPackage" == childName)) + { + childValue = new MsiPackage(); + } + if (("MspPackage" == childName)) + { + childValue = new MspPackage(); + } + if (("MsuPackage" == childName)) + { + childValue = new MsuPackage(); + } + if (("ExePackage" == childName)) + { + childValue = new ExePackage(); + } + if (("RollbackBoundary" == childName)) + { + childValue = new RollbackBoundary(); + } + if (("PackageGroupRef" == childName)) + { + childValue = new PackageGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Chain", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.disableRollbackFieldSet) + { + if ((this.disableRollbackField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRollback", "no"); + } + if ((this.disableRollbackField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRollback", "yes"); + } + } + if (this.disableSystemRestoreFieldSet) + { + if ((this.disableSystemRestoreField == YesNoType.no)) + { + writer.WriteAttributeString("DisableSystemRestore", "no"); + } + if ((this.disableSystemRestoreField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableSystemRestore", "yes"); + } + } + if (this.parallelCacheFieldSet) + { + if ((this.parallelCacheField == YesNoType.no)) + { + writer.WriteAttributeString("ParallelCache", "no"); + } + if ((this.parallelCacheField == YesNoType.yes)) + { + writer.WriteAttributeString("ParallelCache", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("DisableRollback" == name)) + { + this.disableRollbackField = Enums.ParseYesNoType(value); + this.disableRollbackFieldSet = true; + } + if (("DisableSystemRestore" == name)) + { + this.disableSystemRestoreField = Enums.ParseYesNoType(value); + this.disableSystemRestoreFieldSet = true; + } + if (("ParallelCache" == name)) + { + this.parallelCacheField = Enums.ParseYesNoType(value); + this.parallelCacheFieldSet = true; + } + } + } + + /// + /// Describes a single msi package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private YesNoType enableFeatureSelectionField; + + private bool enableFeatureSelectionFieldSet; + + private YesNoType forcePerMachineField; + + private bool forcePerMachineFieldSet; + + private YesNoType suppressLooseFilePayloadGenerationField; + + private bool suppressLooseFilePayloadGenerationFieldSet; + + private YesNoType visibleField; + + private bool visibleFieldSet; + + private ISchemaElement parentElement; + + public MsiPackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiProperty))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SlipstreamMsp))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// Specifies whether the bundle will allow individual control over the installation state of Features inside + /// the msi package. Managing feature selection requires special care to ensure the install, modify, update and + /// uninstall behavior of the package is always correct. The default is "no". + /// + public YesNoType EnableFeatureSelection + { + get + { + return this.enableFeatureSelectionField; + } + set + { + this.enableFeatureSelectionFieldSet = true; + this.enableFeatureSelectionField = value; + } + } + + /// + /// Override the automatic per-machine detection of MSI packages and force the package to be per-machine. + /// The default is "no", which allows the tools to detect the expected value. + /// + public YesNoType ForcePerMachine + { + get + { + return this.forcePerMachineField; + } + set + { + this.forcePerMachineFieldSet = true; + this.forcePerMachineField = value; + } + } + + /// + /// This attribute has been deprecated. When the value is "yes", the Binder will not read the MSI package + /// to detect uncompressed files that would otherwise be automatically included in the Bundle as Payloads. + /// The resulting Bundle may not be able to install the MSI package correctly. The default is "no". + /// + public YesNoType SuppressLooseFilePayloadGeneration + { + get + { + return this.suppressLooseFilePayloadGenerationField; + } + set + { + this.suppressLooseFilePayloadGenerationFieldSet = true; + this.suppressLooseFilePayloadGenerationField = value; + } + } + + /// + /// Specifies whether the MSI will be displayed in Programs and Features (also known as Add/Remove Programs). If "yes" is + /// specified the MSI package information will be displayed in Programs and Features. The default "no" indicates the MSI + /// will not be displayed. + /// + public YesNoType Visible + { + get + { + return this.visibleField; + } + set + { + this.visibleFieldSet = true; + this.visibleField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiProperty" == childName)) + { + childValue = new MsiProperty(); + } + if (("SlipstreamMsp" == childName)) + { + childValue = new SlipstreamMsp(); + } + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiPackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.enableFeatureSelectionFieldSet) + { + if ((this.enableFeatureSelectionField == YesNoType.no)) + { + writer.WriteAttributeString("EnableFeatureSelection", "no"); + } + if ((this.enableFeatureSelectionField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableFeatureSelection", "yes"); + } + } + if (this.forcePerMachineFieldSet) + { + if ((this.forcePerMachineField == YesNoType.no)) + { + writer.WriteAttributeString("ForcePerMachine", "no"); + } + if ((this.forcePerMachineField == YesNoType.yes)) + { + writer.WriteAttributeString("ForcePerMachine", "yes"); + } + } + if (this.suppressLooseFilePayloadGenerationFieldSet) + { + if ((this.suppressLooseFilePayloadGenerationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressLooseFilePayloadGeneration", "no"); + } + if ((this.suppressLooseFilePayloadGenerationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressLooseFilePayloadGeneration", "yes"); + } + } + if (this.visibleFieldSet) + { + if ((this.visibleField == YesNoType.no)) + { + writer.WriteAttributeString("Visible", "no"); + } + if ((this.visibleField == YesNoType.yes)) + { + writer.WriteAttributeString("Visible", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("EnableFeatureSelection" == name)) + { + this.enableFeatureSelectionField = Enums.ParseYesNoType(value); + this.enableFeatureSelectionFieldSet = true; + } + if (("ForcePerMachine" == name)) + { + this.forcePerMachineField = Enums.ParseYesNoType(value); + this.forcePerMachineFieldSet = true; + } + if (("SuppressLooseFilePayloadGeneration" == name)) + { + this.suppressLooseFilePayloadGenerationField = Enums.ParseYesNoType(value); + this.suppressLooseFilePayloadGenerationFieldSet = true; + } + if (("Visible" == name)) + { + this.visibleField = Enums.ParseYesNoType(value); + this.visibleFieldSet = true; + } + } + } + + /// + /// Describes a single msp package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MspPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private YesNoDefaultType perMachineField; + + private bool perMachineFieldSet; + + private YesNoType slipstreamField; + + private bool slipstreamFieldSet; + + private ISchemaElement parentElement; + + public MspPackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiProperty))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// Indicates the package must be executed elevated. The default is "no". + /// + public YesNoDefaultType PerMachine + { + get + { + return this.perMachineField; + } + set + { + this.perMachineFieldSet = true; + this.perMachineField = value; + } + } + + /// + /// Specifies whether to automatically slipstream the patch for any target msi packages in the chain. The default is "no". + /// Even when the value is "no", you can still author the SlipstreamMsp element under MsiPackage elements as desired. + /// + public YesNoType Slipstream + { + get + { + return this.slipstreamField; + } + set + { + this.slipstreamFieldSet = true; + this.slipstreamField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiProperty" == childName)) + { + childValue = new MsiProperty(); + } + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MspPackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.perMachineFieldSet) + { + if ((this.perMachineField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("PerMachine", "default"); + } + if ((this.perMachineField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("PerMachine", "no"); + } + if ((this.perMachineField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("PerMachine", "yes"); + } + } + if (this.slipstreamFieldSet) + { + if ((this.slipstreamField == YesNoType.no)) + { + writer.WriteAttributeString("Slipstream", "no"); + } + if ((this.slipstreamField == YesNoType.yes)) + { + writer.WriteAttributeString("Slipstream", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("PerMachine" == name)) + { + this.perMachineField = Enums.ParseYesNoDefaultType(value); + this.perMachineFieldSet = true; + } + if (("Slipstream" == name)) + { + this.slipstreamField = Enums.ParseYesNoType(value); + this.slipstreamFieldSet = true; + } + } + } + + /// + /// Describes a single msu package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsuPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private string detectConditionField; + + private bool detectConditionFieldSet; + + private string kBField; + + private bool kBFieldSet; + + private ISchemaElement parentElement; + + public MsuPackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackagePayload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// A condition that determines if the package is present on the target system. This condition can use built-in + /// variables and variables returned by searches. This condition is necessary because Windows doesn't provide a + /// method to detect the presence of an MsuPackage. Burn uses this condition to determine how to treat this + /// package during a bundle action; for example, if this condition is false or omitted and the bundle is being + /// installed, Burn will install this package. + /// + public string DetectCondition + { + get + { + return this.detectConditionField; + } + set + { + this.detectConditionFieldSet = true; + this.detectConditionField = value; + } + } + + /// + /// The knowledge base identifier for the MSU. The KB attribute must be specified to enable the MSU package to + /// be uninstalled. Even then MSU uninstallation is only supported on Windows 7 and later. When the KB attribute + /// is specified, the Permanent attribute will the control whether the package is uninstalled. + /// + public string KB + { + get + { + return this.kBField; + } + set + { + this.kBFieldSet = true; + this.kBField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if (("MsuPackagePayload" == childName)) + { + childValue = new MsuPackagePayload(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsuPackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.detectConditionFieldSet) + { + writer.WriteAttributeString("DetectCondition", this.detectConditionField); + } + if (this.kBFieldSet) + { + writer.WriteAttributeString("KB", this.kBField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("DetectCondition" == name)) + { + this.detectConditionField = value; + this.detectConditionFieldSet = true; + } + if (("KB" == name)) + { + this.kBField = value; + this.kBFieldSet = true; + } + } + } + + /// + /// Describes a single exe package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExePackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private string detectConditionField; + + private bool detectConditionFieldSet; + + private string installCommandField; + + private bool installCommandFieldSet; + + private string repairCommandField; + + private bool repairCommandFieldSet; + + private string uninstallCommandField; + + private bool uninstallCommandFieldSet; + + private YesNoDefaultType perMachineField; + + private bool perMachineFieldSet; + + private BurnExeProtocolType protocolField; + + private bool protocolFieldSet; + + private ISchemaElement parentElement; + + public ExePackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackagePayload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExitCode))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CommandLine))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// A condition that determines if the package is present on the target system. This condition can use built-in + /// variables and variables returned by searches. This condition is necessary because Windows doesn't provide a + /// method to detect the presence of an ExePackage. Burn uses this condition to determine how to treat this + /// package during a bundle action; for example, if this condition is false or omitted and the bundle is being + /// installed, Burn will install this package. + /// + public string DetectCondition + { + get + { + return this.detectConditionField; + } + set + { + this.detectConditionFieldSet = true; + this.detectConditionField = value; + } + } + + /// + /// The command-line arguments provided to the ExePackage during install. If this attribute is absent the executable will be launched with no command-line arguments. + /// + public string InstallCommand + { + get + { + return this.installCommandField; + } + set + { + this.installCommandFieldSet = true; + this.installCommandField = value; + } + } + + /// + /// The command-line arguments to specify to indicate a repair. If the executable package can be repaired but + /// does not require any special command-line arguments to do so then set the attribute's value to blank. To + /// indicate that the package does not support repair, omit this attribute. + /// + public string RepairCommand + { + get + { + return this.repairCommandField; + } + set + { + this.repairCommandFieldSet = true; + this.repairCommandField = value; + } + } + + /// + /// The command-line arguments provided to the ExePackage during uninstall. If this attribute is absent the executable will be launched with no command-line arguments. To prevent an ExePackage from being uninstalled set the Permanent attribute to "yes". + /// + public string UninstallCommand + { + get + { + return this.uninstallCommandField; + } + set + { + this.uninstallCommandFieldSet = true; + this.uninstallCommandField = value; + } + } + + /// + /// Indicates the package must be executed elevated. The default is "no". + /// + public YesNoDefaultType PerMachine + { + get + { + return this.perMachineField; + } + set + { + this.perMachineFieldSet = true; + this.perMachineField = value; + } + } + + /// + /// Indicates the communication protocol the package supports for extended progress and error reporting. The default is "none". + /// + public BurnExeProtocolType Protocol + { + get + { + return this.protocolField; + } + set + { + this.protocolFieldSet = true; + this.protocolField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if (("ExePackagePayload" == childName)) + { + childValue = new ExePackagePayload(); + } + if (("ExitCode" == childName)) + { + childValue = new ExitCode(); + } + if (("CommandLine" == childName)) + { + childValue = new CommandLine(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExePackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.detectConditionFieldSet) + { + writer.WriteAttributeString("DetectCondition", this.detectConditionField); + } + if (this.installCommandFieldSet) + { + writer.WriteAttributeString("InstallCommand", this.installCommandField); + } + if (this.repairCommandFieldSet) + { + writer.WriteAttributeString("RepairCommand", this.repairCommandField); + } + if (this.uninstallCommandFieldSet) + { + writer.WriteAttributeString("UninstallCommand", this.uninstallCommandField); + } + if (this.perMachineFieldSet) + { + if ((this.perMachineField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("PerMachine", "default"); + } + if ((this.perMachineField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("PerMachine", "no"); + } + if ((this.perMachineField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("PerMachine", "yes"); + } + } + if (this.protocolFieldSet) + { + if ((this.protocolField == BurnExeProtocolType.none)) + { + writer.WriteAttributeString("Protocol", "none"); + } + if ((this.protocolField == BurnExeProtocolType.burn)) + { + writer.WriteAttributeString("Protocol", "burn"); + } + if ((this.protocolField == BurnExeProtocolType.netfx4)) + { + writer.WriteAttributeString("Protocol", "netfx4"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("DetectCondition" == name)) + { + this.detectConditionField = value; + this.detectConditionFieldSet = true; + } + if (("InstallCommand" == name)) + { + this.installCommandField = value; + this.installCommandFieldSet = true; + } + if (("RepairCommand" == name)) + { + this.repairCommandField = value; + this.repairCommandFieldSet = true; + } + if (("UninstallCommand" == name)) + { + this.uninstallCommandField = value; + this.uninstallCommandFieldSet = true; + } + if (("PerMachine" == name)) + { + this.perMachineField = Enums.ParseYesNoDefaultType(value); + this.perMachineFieldSet = true; + } + if (("Protocol" == name)) + { + this.protocolField = Enums.ParseBurnExeProtocolType(value); + this.protocolFieldSet = true; + } + } + } + + /// + /// Describes a rollback boundary in the chain. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RollbackBoundary : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoType transactionField; + + private bool transactionFieldSet; + + private ISchemaElement parentElement; + + public RollbackBoundary() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for this rollback boundary, for ordering and cross-referencing. If this attribute is + /// not provided a stable identifier will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies whether the rollback boundary aborts the chain. The default "yes" indicates that if + /// the rollback boundary is encountered then the chain will fail and rollback or stop. If "no" + /// is specified then the chain should continue successfuly at the next rollback boundary. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Specifies whether the rollback boundary is wrapped in an MSI transaction. The default is "no" + /// + public YesNoType Transaction + { + get + { + return this.transactionField; + } + set + { + this.transactionFieldSet = true; + this.transactionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RollbackBoundary", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.transactionFieldSet) + { + if ((this.transactionField == YesNoType.no)) + { + writer.WriteAttributeString("Transaction", "no"); + } + if ((this.transactionField == YesNoType.yes)) + { + writer.WriteAttributeString("Transaction", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Transaction" == name)) + { + this.transactionField = Enums.ParseYesNoType(value); + this.transactionFieldSet = true; + } + } + } + + /// + /// Describes a package group to a bootstrapper. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PackageGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PackageGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MspPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RollbackBoundary))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for package group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiPackage" == childName)) + { + childValue = new MsiPackage(); + } + if (("MspPackage" == childName)) + { + childValue = new MspPackage(); + } + if (("MsuPackage" == childName)) + { + childValue = new MsuPackage(); + } + if (("ExePackage" == childName)) + { + childValue = new ExePackage(); + } + if (("RollbackBoundary" == childName)) + { + childValue = new RollbackBoundary(); + } + if (("PackageGroupRef" == childName)) + { + childValue = new PackageGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PackageGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to PackageGroup element that exists inside a Bundle or Fragment element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PackageGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PackageGroup element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of a package that this group should be installed after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PackageGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + } + } + + /// + /// Allows an MSI property to be set based on the value of a burn engine expression. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiProperty : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the MSI property to set. Burn controls the follow MSI properties so they cannot be set with MsiProperty: ACTION, ALLUSERS, REBOOT, REINSTALL, REINSTALLMODE + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value to set the property to. This string is evaluated by the burn engine and can be as simple as a burn engine variable reference or as complex as a full expression. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Specifies a patch included in the same bundle that is installed when the parent MSI package is installed. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SlipstreamMsp : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier for a MspPackage in the bundle. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SlipstreamMsp", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Describes a burn engine variable to define. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Variable : ISchemaElement, ISetAttributes + { + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType persistedField; + + private bool persistedFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + /// + /// Whether the value of the variable should be hidden. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// The name for the variable. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Whether the variable should be persisted. + /// + public YesNoType Persisted + { + get + { + return this.persistedField; + } + set + { + this.persistedFieldSet = true; + this.persistedField = value; + } + } + + /// + /// Starting value for the variable. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Type of the variable, inferred from the value if not specified. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + Variable.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + if (("numeric" == value)) + { + parsedValue = TypeType.numeric; + } + else + { + if (("version" == value)) + { + parsedValue = TypeType.version; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Variable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.persistedFieldSet) + { + if ((this.persistedField == YesNoType.no)) + { + writer.WriteAttributeString("Persisted", "no"); + } + if ((this.persistedField == YesNoType.yes)) + { + writer.WriteAttributeString("Persisted", "yes"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + if ((this.typeField == TypeType.numeric)) + { + writer.WriteAttributeString("Type", "numeric"); + } + if ((this.typeField == TypeType.version)) + { + writer.WriteAttributeString("Type", "version"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Persisted" == name)) + { + this.persistedField = Enums.ParseYesNoType(value); + this.persistedFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Variable.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + @string, + + numeric, + + version, + } + } + + /// + /// Representation of a file that contains one or more files. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Container : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private BurnContainerType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + public Container() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// The unique identifier for the container. If this attribute is not specified the Name attribute will be used. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The file name for this container. A relative path may be provided to place the container in a sub-folder of the bundle. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Indicates whether the container is "attached" to the bundle executable or placed external to the bundle extecutable as "detached". If + /// this attribute is not specified, the default is to create a detached container. + /// + public BurnContainerType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PackageGroupRef" == childName)) + { + childValue = new PackageGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Container", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == BurnContainerType.attached)) + { + writer.WriteAttributeString("Type", "attached"); + } + if ((this.typeField == BurnContainerType.detached)) + { + writer.WriteAttributeString("Type", "detached"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Enums.ParseBurnContainerType(value); + this.typeFieldSet = true; + } + } + } + + /// + /// Create a reference to an existing Container element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ContainerRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of Container element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ContainerRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Describes map of exit code returned from executable package to a bootstrapper behavior. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExitCode : ISchemaElement, ISetAttributes + { + + private int valueField; + + private bool valueFieldSet; + + private BehaviorType behaviorField; + + private bool behaviorFieldSet; + + private ISchemaElement parentElement; + + /// + /// Exit code returned from executable package. If no value is provided it means all values not explicitly set default to this behavior. + /// + public int Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Choose one of the supported behaviors error codes: success, error, scheduleReboot, forceReboot. + /// + public BehaviorType Behavior + { + get + { + return this.behaviorField; + } + set + { + this.behaviorFieldSet = true; + this.behaviorField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a BehaviorType from a string. + /// + public static BehaviorType ParseBehaviorType(string value) + { + BehaviorType parsedValue; + ExitCode.TryParseBehaviorType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a BehaviorType from a string. + /// + public static bool TryParseBehaviorType(string value, out BehaviorType parsedValue) + { + parsedValue = BehaviorType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("success" == value)) + { + parsedValue = BehaviorType.success; + } + else + { + if (("error" == value)) + { + parsedValue = BehaviorType.error; + } + else + { + if (("scheduleReboot" == value)) + { + parsedValue = BehaviorType.scheduleReboot; + } + else + { + if (("forceReboot" == value)) + { + parsedValue = BehaviorType.forceReboot; + } + else + { + parsedValue = BehaviorType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExitCode", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.behaviorFieldSet) + { + if ((this.behaviorField == BehaviorType.success)) + { + writer.WriteAttributeString("Behavior", "success"); + } + if ((this.behaviorField == BehaviorType.error)) + { + writer.WriteAttributeString("Behavior", "error"); + } + if ((this.behaviorField == BehaviorType.scheduleReboot)) + { + writer.WriteAttributeString("Behavior", "scheduleReboot"); + } + if ((this.behaviorField == BehaviorType.forceReboot)) + { + writer.WriteAttributeString("Behavior", "forceReboot"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Value" == name)) + { + this.valueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.valueFieldSet = true; + } + if (("Behavior" == name)) + { + this.behaviorField = ExitCode.ParseBehaviorType(value); + this.behaviorFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum BehaviorType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + success, + + error, + + scheduleReboot, + + forceReboot, + } + } + + /// + /// Describes additional, conditional command-line arguments for an ExePackage. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CommandLine : ISchemaElement, ISetAttributes + { + + private string installArgumentField; + + private bool installArgumentFieldSet; + + private string uninstallArgumentField; + + private bool uninstallArgumentFieldSet; + + private string repairArgumentField; + + private bool repairArgumentFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Additional command-line arguments to apply during package installation if Condition is true. + /// + public string InstallArgument + { + get + { + return this.installArgumentField; + } + set + { + this.installArgumentFieldSet = true; + this.installArgumentField = value; + } + } + + /// + /// Additional command-line arguments to apply during package uninstallation if Condition is true. + /// + public string UninstallArgument + { + get + { + return this.uninstallArgumentField; + } + set + { + this.uninstallArgumentFieldSet = true; + this.uninstallArgumentField = value; + } + } + + /// + /// Additional command-line arguments to apply during package repair if Condition is true. + /// + public string RepairArgument + { + get + { + return this.repairArgumentField; + } + set + { + this.repairArgumentFieldSet = true; + this.repairArgumentField = value; + } + } + + /// + /// The condition that controls whether the command-line arguments specified in the + /// InstallArgument, UninstallArgument, or RepairArgument attributes are appended to the + /// command line passed to the ExePackage. Which attribute is used depends on the + /// action being applied to the ExePackage. For example, when the ExePackage is + /// being installed, the InstallArgument attribute value is appended to the command + /// line when the ExePackage is executed. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CommandLine", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.installArgumentFieldSet) + { + writer.WriteAttributeString("InstallArgument", this.installArgumentField); + } + if (this.uninstallArgumentFieldSet) + { + writer.WriteAttributeString("UninstallArgument", this.uninstallArgumentField); + } + if (this.repairArgumentFieldSet) + { + writer.WriteAttributeString("RepairArgument", this.repairArgumentField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("InstallArgument" == name)) + { + this.installArgumentField = value; + this.installArgumentFieldSet = true; + } + if (("UninstallArgument" == name)) + { + this.uninstallArgumentField = value; + this.uninstallArgumentFieldSet = true; + } + if (("RepairArgument" == name)) + { + this.repairArgumentField = value; + this.repairArgumentFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + } + } + + /// + /// Describes a payload to a bootstrapper. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Payload : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of Payload element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Whether the payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// Location of the source file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this payload. The default is the source file name. The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Payload", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + } + } + + /// + /// Describes a payload group to a bootstrapper. PayloadGroups referenced from within a Bundle are tied to the Bundle. + /// PayloadGroups referenced from a Fragment are tied to the context of whatever references them such as an ExePackage or MsiPackage. + /// It is possible to share a PayloadGroup between multiple Packages and/or a Bundle by creating multiple references to it. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PayloadGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PayloadGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for payload group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PayloadGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to PayloadGroup element that exists inside a Bundle or Fragment element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PayloadGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PayloadGroup element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PayloadGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + public class ExePackagePayload : RemotePayload + { + public ExePackagePayload() : base("ExePackagePayload") { } + } + + public class MsuPackagePayload : RemotePayload + { + public MsuPackagePayload() : base("MsuPackagePayload") { } + } + + /// + /// Describes information about a remote file payload that is not available at the time of building the bundle. + /// The parent must specify DownloadUrl and must not specify SourceFile when using this element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public abstract class RemotePayload : ISchemaElement, ISetAttributes + { + private string elementName; + + public RemotePayload(string elementName) + { + this.elementName = elementName; + } + + private string descriptionField; + + private bool descriptionFieldSet; + + private string hashField; + + private bool hashFieldSet; + + private string productNameField; + + private bool productNameFieldSet; + + private long sizeField; + + private bool sizeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Description of the file from version resources. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// SHA-1 hash of the RemotePayload. Include this attribute if the remote file is unsigned or SuppressSignatureVerification is set to Yes. + /// + public string Hash + { + get + { + return this.hashField; + } + set + { + this.hashFieldSet = true; + this.hashField = value; + } + } + + /// + /// Product name of the file from version resouces. + /// + public string ProductName + { + get + { + return this.productNameField; + } + set + { + this.productNameFieldSet = true; + this.productNameField = value; + } + } + + /// + /// Size of the remote file in bytes. + /// + public long Size + { + get + { + return this.sizeField; + } + set + { + this.sizeFieldSet = true; + this.sizeField = value; + } + } + + /// + /// Version of the remote file + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement(this.elementName, "http://wixtoolset.org/schemas/v4/wxs"); + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.hashFieldSet) + { + writer.WriteAttributeString("Hash", this.hashField); + } + if (this.productNameFieldSet) + { + writer.WriteAttributeString("ProductName", this.productNameField); + } + if (this.sizeFieldSet) + { + writer.WriteAttributeString("Size", this.sizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Hash" == name)) + { + this.hashField = value; + this.hashFieldSet = true; + } + if (("ProductName" == name)) + { + this.productNameField = value; + this.productNameFieldSet = true; + } + if (("Size" == name)) + { + this.sizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sizeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + } + } + + /// + /// Create a RelatedBundle element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RelatedBundle : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the RelatedBundle group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The action to take on bundles related to this one. Detect is the default. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RelatedBundle.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Detect" == value)) + { + parsedValue = ActionType.Detect; + } + else + { + if (("Upgrade" == value)) + { + parsedValue = ActionType.Upgrade; + } + else + { + if (("Addon" == value)) + { + parsedValue = ActionType.Addon; + } + else + { + if (("Patch" == value)) + { + parsedValue = ActionType.Patch; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RelatedBundle", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.Detect)) + { + writer.WriteAttributeString("Action", "Detect"); + } + if ((this.actionField == ActionType.Upgrade)) + { + writer.WriteAttributeString("Action", "Upgrade"); + } + if ((this.actionField == ActionType.Addon)) + { + writer.WriteAttributeString("Action", "Addon"); + } + if ((this.actionField == ActionType.Patch)) + { + writer.WriteAttributeString("Action", "Patch"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RelatedBundle.ParseActionType(value); + this.actionFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Detect, + + Upgrade, + + Addon, + + Patch, + } + } + + /// + /// Defines the update for a Bundle. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Update : ISchemaElement, ISetAttributes + { + + private string locationField; + + private bool locationFieldSet; + + private ISchemaElement parentElement; + + /// + /// The absolute path or URL to check for an update bundle. Currently the engine provides this value + /// in the IBootstrapperApplication::OnDetectUpdateBegin() and otherwise ignores the value. In the + /// future the engine will be able to acquire an update bundle from the location and determine if it + /// is newer than the current executing bundle. + /// + public string Location + { + get + { + return this.locationField; + } + set + { + this.locationFieldSet = true; + this.locationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Update", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.locationFieldSet) + { + writer.WriteAttributeString("Location", this.locationField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Location" == name)) + { + this.locationField = value; + this.locationFieldSet = true; + } + } + } + + /// + /// The Package element is analogous to the main function in a C program. When linking, only one Package section + /// can be given to the linker to produce a successful result. Using this element creates an msi file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Package : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private ISchemaElement parentElement; + + public Package() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SummaryInformation))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComplianceCheck))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroup))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(InstanceTransforms))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(MajorUpgrade))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(MediaTemplate))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PackageCertificates))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCertificates))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Upgrade))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); + childCollection1.AddCollection(childCollection2); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The product code GUID for the product. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The code page integer value or web name for the resulting MSI. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// The decimal language ID (LCID) for the product. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The manufacturer of the product. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The descriptive name of the product. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The upgrade code GUID for the product. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// The product's version string. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SummaryInformation" == childName)) + { + childValue = new SummaryInformation(); + } + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("ComplianceCheck" == childName)) + { + childValue = new ComplianceCheck(); + } + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroup" == childName)) + { + childValue = new ComponentGroup(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("CustomAction" == childName)) + { + childValue = new CustomAction(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("CustomTable" == childName)) + { + childValue = new CustomTable(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("EmbeddedChainer" == childName)) + { + childValue = new EmbeddedChainer(); + } + if (("EmbeddedChainerRef" == childName)) + { + childValue = new EmbeddedChainerRef(); + } + if (("EnsureTable" == childName)) + { + childValue = new EnsureTable(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("InstanceTransforms" == childName)) + { + childValue = new InstanceTransforms(); + } + if (("MajorUpgrade" == childName)) + { + childValue = new MajorUpgrade(); + } + if (("Media" == childName)) + { + childValue = new Media(); + } + if (("MediaTemplate" == childName)) + { + childValue = new MediaTemplate(); + } + if (("PackageCertificates" == childName)) + { + childValue = new PackageCertificates(); + } + if (("PatchCertificates" == childName)) + { + childValue = new PatchCertificates(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("SetDirectory" == childName)) + { + childValue = new SetDirectory(); + } + if (("SetProperty" == childName)) + { + childValue = new SetProperty(); + } + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("UI" == childName)) + { + childValue = new UI(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if (("Upgrade" == childName)) + { + childValue = new Upgrade(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if (("InstallExecuteSequence" == childName)) + { + childValue = new InstallExecuteSequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("AdminExecuteSequence" == childName)) + { + childValue = new AdminExecuteSequence(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("AdvertiseExecuteSequence" == childName)) + { + childValue = new AdvertiseExecuteSequence(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Package", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + } + } + + /// + /// The Module element is analogous to the main function in a C program. When linking, only + /// one Module section can be given to the linker to produce a successful result. Using this + /// element creates an msm file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Module : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private ISchemaElement parentElement; + + public Module() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SummaryInformation))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Configuration))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Dependency))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Exclusion))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreModularization))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Substitution))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); + childCollection1.AddCollection(childCollection2); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The name of the merge module (not the file name). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The code page integer value or web name for the resulting MSM. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// The modularizaion Guid. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// The decimal language ID (LCID) of the merge module. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The major and minor versions of the merge module. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SummaryInformation" == childName)) + { + childValue = new SummaryInformation(); + } + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Configuration" == childName)) + { + childValue = new Configuration(); + } + if (("CustomAction" == childName)) + { + childValue = new CustomAction(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("CustomTable" == childName)) + { + childValue = new CustomTable(); + } + if (("Dependency" == childName)) + { + childValue = new Dependency(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("EmbeddedChainer" == childName)) + { + childValue = new EmbeddedChainer(); + } + if (("EmbeddedChainerRef" == childName)) + { + childValue = new EmbeddedChainerRef(); + } + if (("EnsureTable" == childName)) + { + childValue = new EnsureTable(); + } + if (("Exclusion" == childName)) + { + childValue = new Exclusion(); + } + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("IgnoreModularization" == childName)) + { + childValue = new IgnoreModularization(); + } + if (("IgnoreTable" == childName)) + { + childValue = new IgnoreTable(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("SetDirectory" == childName)) + { + childValue = new SetDirectory(); + } + if (("SetProperty" == childName)) + { + childValue = new SetProperty(); + } + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("Substitution" == childName)) + { + childValue = new Substitution(); + } + if (("UI" == childName)) + { + childValue = new UI(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if (("InstallExecuteSequence" == childName)) + { + childValue = new InstallExecuteSequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("AdminExecuteSequence" == childName)) + { + childValue = new AdminExecuteSequence(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("AdvertiseExecuteSequence" == childName)) + { + childValue = new AdvertiseExecuteSequence(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Module", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + } + } + + /// + /// Declares a dependency on another merge module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Dependency : ISchemaElement, ISetAttributes + { + + private string requiredIdField; + + private bool requiredIdFieldSet; + + private int requiredLanguageField; + + private bool requiredLanguageFieldSet; + + private string requiredVersionField; + + private bool requiredVersionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier of the merge module required by the merge module. + /// + public string RequiredId + { + get + { + return this.requiredIdField; + } + set + { + this.requiredIdFieldSet = true; + this.requiredIdField = value; + } + } + + /// + /// Numeric language ID of the merge module in RequiredID. + /// + public int RequiredLanguage + { + get + { + return this.requiredLanguageField; + } + set + { + this.requiredLanguageFieldSet = true; + this.requiredLanguageField = value; + } + } + + /// + /// Version of the merge module in RequiredID. + /// + public string RequiredVersion + { + get + { + return this.requiredVersionField; + } + set + { + this.requiredVersionFieldSet = true; + this.requiredVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Dependency", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.requiredIdFieldSet) + { + writer.WriteAttributeString("RequiredId", this.requiredIdField); + } + if (this.requiredLanguageFieldSet) + { + writer.WriteAttributeString("RequiredLanguage", this.requiredLanguageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.requiredVersionFieldSet) + { + writer.WriteAttributeString("RequiredVersion", this.requiredVersionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("RequiredId" == name)) + { + this.requiredIdField = value; + this.requiredIdFieldSet = true; + } + if (("RequiredLanguage" == name)) + { + this.requiredLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.requiredLanguageFieldSet = true; + } + if (("RequiredVersion" == name)) + { + this.requiredVersionField = value; + this.requiredVersionFieldSet = true; + } + } + } + + /// + /// Declares a merge module with which this merge module is incompatible. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Exclusion : ISchemaElement, ISetAttributes + { + + private string excludedIdField; + + private bool excludedIdFieldSet; + + private int excludeExceptLanguageField; + + private bool excludeExceptLanguageFieldSet; + + private int excludeLanguageField; + + private bool excludeLanguageFieldSet; + + private string excludedMinVersionField; + + private bool excludedMinVersionFieldSet; + + private string excludedMaxVersionField; + + private bool excludedMaxVersionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier of the merge module that is incompatible. + /// + public string ExcludedId + { + get + { + return this.excludedIdField; + } + set + { + this.excludedIdFieldSet = true; + this.excludedIdField = value; + } + } + + /// + /// Numeric language ID of the merge module in ExcludedID. All except this language will be excluded. Only one of ExcludeExceptLanguage and ExcludeLanguage may be specified. + /// + public int ExcludeExceptLanguage + { + get + { + return this.excludeExceptLanguageField; + } + set + { + this.excludeExceptLanguageFieldSet = true; + this.excludeExceptLanguageField = value; + } + } + + /// + /// Numeric language ID of the merge module in ExcludedID. The specified language will be excluded. Only one of ExcludeExceptLanguage and ExcludeLanguage may be specified. + /// + public int ExcludeLanguage + { + get + { + return this.excludeLanguageField; + } + set + { + this.excludeLanguageFieldSet = true; + this.excludeLanguageField = value; + } + } + + /// + /// Minimum version excluded from a range. If not set, all versions before max are excluded. If neither max nor min, no exclusion based on version. + /// + public string ExcludedMinVersion + { + get + { + return this.excludedMinVersionField; + } + set + { + this.excludedMinVersionFieldSet = true; + this.excludedMinVersionField = value; + } + } + + /// + /// Maximum version excluded from a range. If not set, all versions after min are excluded. If neither max nor min, no exclusion based on version. + /// + public string ExcludedMaxVersion + { + get + { + return this.excludedMaxVersionField; + } + set + { + this.excludedMaxVersionFieldSet = true; + this.excludedMaxVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Exclusion", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.excludedIdFieldSet) + { + writer.WriteAttributeString("ExcludedId", this.excludedIdField); + } + if (this.excludeExceptLanguageFieldSet) + { + writer.WriteAttributeString("ExcludeExceptLanguage", this.excludeExceptLanguageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.excludeLanguageFieldSet) + { + writer.WriteAttributeString("ExcludeLanguage", this.excludeLanguageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.excludedMinVersionFieldSet) + { + writer.WriteAttributeString("ExcludedMinVersion", this.excludedMinVersionField); + } + if (this.excludedMaxVersionFieldSet) + { + writer.WriteAttributeString("ExcludedMaxVersion", this.excludedMaxVersionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ExcludedId" == name)) + { + this.excludedIdField = value; + this.excludedIdFieldSet = true; + } + if (("ExcludeExceptLanguage" == name)) + { + this.excludeExceptLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.excludeExceptLanguageFieldSet = true; + } + if (("ExcludeLanguage" == name)) + { + this.excludeLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.excludeLanguageFieldSet = true; + } + if (("ExcludedMinVersion" == name)) + { + this.excludedMinVersionField = value; + this.excludedMinVersionFieldSet = true; + } + if (("ExcludedMaxVersion" == name)) + { + this.excludedMaxVersionField = value; + this.excludedMaxVersionFieldSet = true; + } + } + } + + /// + /// Defines the configurable attributes of merge module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Configuration : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private FormatType formatField; + + private bool formatFieldSet; + + private string typeField; + + private bool typeFieldSet; + + private string contextDataField; + + private bool contextDataFieldSet; + + private string defaultValueField; + + private bool defaultValueFieldSet; + + private YesNoType keyNoOrphanField; + + private bool keyNoOrphanFieldSet; + + private YesNoType nonNullableField; + + private bool nonNullableFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string helpLocationField; + + private bool helpLocationFieldSet; + + private string helpKeywordField; + + private bool helpKeywordFieldSet; + + private ISchemaElement parentElement; + + /// + /// Defines the name of the configurable item. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Specifies the format of the data being changed. + /// + public FormatType Format + { + get + { + return this.formatField; + } + set + { + this.formatFieldSet = true; + this.formatField = value; + } + } + + /// + /// Specifies the type of the data being changed. + /// + public string Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Specifies a semantic context for the requested data. + /// + public string ContextData + { + get + { + return this.contextDataField; + } + set + { + this.contextDataFieldSet = true; + this.contextDataField = value; + } + } + + /// + /// Specifies a default value for the item in this record if the merge tool declines to provide a value. + /// + public string DefaultValue + { + get + { + return this.defaultValueField; + } + set + { + this.defaultValueFieldSet = true; + this.defaultValueField = value; + } + } + + /// + /// Does not merge rule according to rules in MSI SDK. + /// + public YesNoType KeyNoOrphan + { + get + { + return this.keyNoOrphanField; + } + set + { + this.keyNoOrphanFieldSet = true; + this.keyNoOrphanField = value; + } + } + + /// + /// If yes, null is not a valid entry. + /// + public YesNoType NonNullable + { + get + { + return this.nonNullableField; + } + set + { + this.nonNullableFieldSet = true; + this.nonNullableField = value; + } + } + + /// + /// Display name for authoring. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Description for authoring. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Location of chm file for authoring. + /// + public string HelpLocation + { + get + { + return this.helpLocationField; + } + set + { + this.helpLocationFieldSet = true; + this.helpLocationField = value; + } + } + + /// + /// Keyword into chm file for authoring. + /// + public string HelpKeyword + { + get + { + return this.helpKeywordField; + } + set + { + this.helpKeywordFieldSet = true; + this.helpKeywordField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a FormatType from a string. + /// + public static FormatType ParseFormatType(string value) + { + FormatType parsedValue; + Configuration.TryParseFormatType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FormatType from a string. + /// + public static bool TryParseFormatType(string value, out FormatType parsedValue) + { + parsedValue = FormatType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Text" == value)) + { + parsedValue = FormatType.Text; + } + else + { + if (("Key" == value)) + { + parsedValue = FormatType.Key; + } + else + { + if (("Integer" == value)) + { + parsedValue = FormatType.Integer; + } + else + { + if (("Bitfield" == value)) + { + parsedValue = FormatType.Bitfield; + } + else + { + parsedValue = FormatType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Configuration", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.formatFieldSet) + { + if ((this.formatField == FormatType.Text)) + { + writer.WriteAttributeString("Format", "Text"); + } + if ((this.formatField == FormatType.Key)) + { + writer.WriteAttributeString("Format", "Key"); + } + if ((this.formatField == FormatType.Integer)) + { + writer.WriteAttributeString("Format", "Integer"); + } + if ((this.formatField == FormatType.Bitfield)) + { + writer.WriteAttributeString("Format", "Bitfield"); + } + } + if (this.typeFieldSet) + { + writer.WriteAttributeString("Type", this.typeField); + } + if (this.contextDataFieldSet) + { + writer.WriteAttributeString("ContextData", this.contextDataField); + } + if (this.defaultValueFieldSet) + { + writer.WriteAttributeString("DefaultValue", this.defaultValueField); + } + if (this.keyNoOrphanFieldSet) + { + if ((this.keyNoOrphanField == YesNoType.no)) + { + writer.WriteAttributeString("KeyNoOrphan", "no"); + } + if ((this.keyNoOrphanField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyNoOrphan", "yes"); + } + } + if (this.nonNullableFieldSet) + { + if ((this.nonNullableField == YesNoType.no)) + { + writer.WriteAttributeString("NonNullable", "no"); + } + if ((this.nonNullableField == YesNoType.yes)) + { + writer.WriteAttributeString("NonNullable", "yes"); + } + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.helpLocationFieldSet) + { + writer.WriteAttributeString("HelpLocation", this.helpLocationField); + } + if (this.helpKeywordFieldSet) + { + writer.WriteAttributeString("HelpKeyword", this.helpKeywordField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Format" == name)) + { + this.formatField = Configuration.ParseFormatType(value); + this.formatFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = value; + this.typeFieldSet = true; + } + if (("ContextData" == name)) + { + this.contextDataField = value; + this.contextDataFieldSet = true; + } + if (("DefaultValue" == name)) + { + this.defaultValueField = value; + this.defaultValueFieldSet = true; + } + if (("KeyNoOrphan" == name)) + { + this.keyNoOrphanField = Enums.ParseYesNoType(value); + this.keyNoOrphanFieldSet = true; + } + if (("NonNullable" == name)) + { + this.nonNullableField = Enums.ParseYesNoType(value); + this.nonNullableFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("HelpLocation" == name)) + { + this.helpLocationField = value; + this.helpLocationFieldSet = true; + } + if (("HelpKeyword" == name)) + { + this.helpKeywordField = value; + this.helpKeywordFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum FormatType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Text, + + Key, + + Integer, + + Bitfield, + } + } + + /// + /// Specifies the configurable fields of a module database and provides a template for the configuration of each field. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Substitution : ISchemaElement, ISetAttributes + { + + private string tableField; + + private bool tableFieldSet; + + private string rowField; + + private bool rowFieldSet; + + private string columnField; + + private bool columnFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the name of the table being modified in the module database. + /// + public string Table + { + get + { + return this.tableField; + } + set + { + this.tableFieldSet = true; + this.tableField = value; + } + } + + /// + /// Specifies the primary keys of the target row in the table named in the Table column. If multiple keys, separated by semicolons. + /// + public string Row + { + get + { + return this.rowField; + } + set + { + this.rowFieldSet = true; + this.rowField = value; + } + } + + /// + /// Specifies the target column in the row named in the Row column. + /// + public string Column + { + get + { + return this.columnField; + } + set + { + this.columnFieldSet = true; + this.columnField = value; + } + } + + /// + /// Provides a formatting template for the data being substituted into the target field specified by Table, Row, and Column. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Substitution", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.tableFieldSet) + { + writer.WriteAttributeString("Table", this.tableField); + } + if (this.rowFieldSet) + { + writer.WriteAttributeString("Row", this.rowField); + } + if (this.columnFieldSet) + { + writer.WriteAttributeString("Column", this.columnField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Table" == name)) + { + this.tableField = value; + this.tableFieldSet = true; + } + if (("Row" == name)) + { + this.rowField = value; + this.rowFieldSet = true; + } + if (("Column" == name)) + { + this.columnField = value; + this.columnFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Specifies a table from the merge module that is not merged into an .msi file. + /// If the table already exists in an .msi file, it is not modified by the merge. + /// The specified table can therefore contain data that is unneeded after the merge. + /// To minimize the size of the .msm file, it is recommended that developers remove + /// unused tables from modules intended for redistribution rather than creating + /// IgnoreTable elements for those tables. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IgnoreTable : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the table in the merge module that is not to be merged into the .msi file. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IgnoreTable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The Fragment element is the building block of creating an installer database in WiX. Once defined, + /// the Fragment becomes an immutable, atomic unit which can either be completely included or excluded + /// from a product. The contents of a Fragment element can be linked into a product by utilizing one + /// of the many *Ref elements. When linking in a Fragment, it will be necessary to link in all of its + /// individual units. For instance, if a given Fragment contains two Component elements, you must link + /// both under features using ComponentRef for each linked Component. Otherwise, you will get a linker + /// warning and have a floating Component that does not appear under any Feature. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Fragment : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public Fragment() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplicationRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComplianceCheck))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Container))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreModularization))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MediaTemplate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageCertificates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCertificates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RelatedBundle))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Upgrade))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Variable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Optional identifier for a Fragment. Should only be set by advanced users to tag sections. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("BootstrapperApplication" == childName)) + { + childValue = new BootstrapperApplication(); + } + if (("BootstrapperApplicationRef" == childName)) + { + childValue = new BootstrapperApplicationRef(); + } + if (("ComplianceCheck" == childName)) + { + childValue = new ComplianceCheck(); + } + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroup" == childName)) + { + childValue = new ComponentGroup(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("Container" == childName)) + { + childValue = new Container(); + } + if (("CustomAction" == childName)) + { + childValue = new CustomAction(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("CustomTable" == childName)) + { + childValue = new CustomTable(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("EmbeddedChainer" == childName)) + { + childValue = new EmbeddedChainer(); + } + if (("EmbeddedChainerRef" == childName)) + { + childValue = new EmbeddedChainerRef(); + } + if (("EnsureTable" == childName)) + { + childValue = new EnsureTable(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureGroup" == childName)) + { + childValue = new FeatureGroup(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("IgnoreModularization" == childName)) + { + childValue = new IgnoreModularization(); + } + if (("Media" == childName)) + { + childValue = new Media(); + } + if (("MediaTemplate" == childName)) + { + childValue = new MediaTemplate(); + } + if (("PackageGroup" == childName)) + { + childValue = new PackageGroup(); + } + if (("PackageCertificates" == childName)) + { + childValue = new PackageCertificates(); + } + if (("PatchCertificates" == childName)) + { + childValue = new PatchCertificates(); + } + if (("PatchFamily" == childName)) + { + childValue = new PatchFamily(); + } + if (("PatchFamilyGroup" == childName)) + { + childValue = new PatchFamilyGroup(); + } + if (("PayloadGroup" == childName)) + { + childValue = new PayloadGroup(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("RelatedBundle" == childName)) + { + childValue = new RelatedBundle(); + } + if (("SetDirectory" == childName)) + { + childValue = new SetDirectory(); + } + if (("SetProperty" == childName)) + { + childValue = new SetProperty(); + } + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("UI" == childName)) + { + childValue = new UI(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if (("Upgrade" == childName)) + { + childValue = new Upgrade(); + } + if (("Variable" == childName)) + { + childValue = new Variable(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if (("InstallExecuteSequence" == childName)) + { + childValue = new InstallExecuteSequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("AdminExecuteSequence" == childName)) + { + childValue = new AdminExecuteSequence(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("AdvertiseExecuteSequence" == childName)) + { + childValue = new AdvertiseExecuteSequence(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Fragment", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The Patch element is analogous to the main function in a C program. When linking, only one Patch section + /// can be given to the linker to produce a successful result. Using this element creates an MSP file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Patch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private YesNoType allowRemovalField; + + private bool allowRemovalFieldSet; + + private string classificationField; + + private bool classificationFieldSet; + + private string clientPatchIdField; + + private bool clientPatchIdFieldSet; + + private YesNoType apiPatchingSymbolNoImagehlpFlagField; + + private bool apiPatchingSymbolNoImagehlpFlagFieldSet; + + private YesNoType apiPatchingSymbolNoFailuresFlagField; + + private bool apiPatchingSymbolNoFailuresFlagFieldSet; + + private YesNoType apiPatchingSymbolUndecoratedTooFlagField; + + private bool apiPatchingSymbolUndecoratedTooFlagFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string commentsField; + + private bool commentsFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private YesNoType minorUpdateTargetRTMField; + + private bool minorUpdateTargetRTMFieldSet; + + private string moreInfoURLField; + + private bool moreInfoURLFieldSet; + + private YesNoType optimizedInstallModeField; + + private bool optimizedInstallModeFieldSet; + + private string targetProductNameField; + + private bool targetProductNameFieldSet; + + private YesNoType optimizePatchSizeForLargeFilesField; + + private bool optimizePatchSizeForLargeFilesFieldSet; + + private ISchemaElement parentElement; + + public Patch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchInformation))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(OptimizeCustomActions))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroup))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroupRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCodes))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Patch code for this patch. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The code page integer value or web name for the resulting MSP. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// Whether this is an uninstallable patch. + /// + public YesNoType AllowRemoval + { + get + { + return this.allowRemovalField; + } + set + { + this.allowRemovalFieldSet = true; + this.allowRemovalField = value; + } + } + + /// + /// Category of updates. Recommended values are Critical Update, Hotfix, Security Rollup, Security Update, Service Pack, Update, Update Rollup. + /// + public string Classification + { + get + { + return this.classificationField; + } + set + { + this.classificationFieldSet = true; + this.classificationField = value; + } + } + + /// + /// An easily referenced identity unique to a patch that can be used in product authoring. See remarks for more information. + /// + public string ClientPatchId + { + get + { + return this.clientPatchIdField; + } + set + { + this.clientPatchIdFieldSet = true; + this.clientPatchIdField = value; + } + } + + /// + /// Flag used when creating a binary file patch. Default is "no". Don't use imagehlp.dll. + /// + public YesNoType ApiPatchingSymbolNoImagehlpFlag + { + get + { + return this.apiPatchingSymbolNoImagehlpFlagField; + } + set + { + this.apiPatchingSymbolNoImagehlpFlagFieldSet = true; + this.apiPatchingSymbolNoImagehlpFlagField = value; + } + } + + /// + /// Flag used when creating a binary file patch. Default is "no". Don't fail patch due to imagehlp failures. + /// + public YesNoType ApiPatchingSymbolNoFailuresFlag + { + get + { + return this.apiPatchingSymbolNoFailuresFlagField; + } + set + { + this.apiPatchingSymbolNoFailuresFlagFieldSet = true; + this.apiPatchingSymbolNoFailuresFlagField = value; + } + } + + /// + /// Flag used when creating a binary file patch. Default is "no". After matching decorated symbols, try to match remaining by undecorated names. + /// + public YesNoType ApiPatchingSymbolUndecoratedTooFlag + { + get + { + return this.apiPatchingSymbolUndecoratedTooFlagField; + } + set + { + this.apiPatchingSymbolUndecoratedTooFlagFieldSet = true; + this.apiPatchingSymbolUndecoratedTooFlagField = value; + } + } + + /// + /// Description of the patch. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// A title for the patch that is suitable for public display. In Add/Remove Programs from XP SP2 on. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Optional comments for browsing. + /// + public string Comments + { + get + { + return this.commentsField; + } + set + { + this.commentsFieldSet = true; + this.commentsField = value; + } + } + + /// + /// Vendor releasing the package + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// Indicates that the patch targets the RTM version of the product or the most recent major + /// upgrade patch. Author this optional property in minor update patches that contain sequencing + /// information to indicate that the patch removes all patches up to the RTM version of the + /// product, or up to the most recent major upgrade patch. This property is available beginning + /// with Windows Installer 3.1. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType MinorUpdateTargetRTM + { + get + { + return this.minorUpdateTargetRTMField; + } + set + { + this.minorUpdateTargetRTMFieldSet = true; + this.minorUpdateTargetRTMField = value; + } + } + + /// + /// A URL that provides information specific to this patch. In Add/Remove Programs from XP SP2 on. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string MoreInfoURL + { + get + { + return this.moreInfoURLField; + } + set + { + this.moreInfoURLFieldSet = true; + this.moreInfoURLField = value; + } + } + + /// + /// If this attribute is set to 'yes' in all the patches to be applied in a transaction, the + /// application of the patch is optimized if possible. Available beginning with Windows Installer 3.1. + /// + public YesNoType OptimizedInstallMode + { + get + { + return this.optimizedInstallModeField; + } + set + { + this.optimizedInstallModeFieldSet = true; + this.optimizedInstallModeField = value; + } + } + + /// + /// Name of the application or target product suite. + /// + public string TargetProductName + { + get + { + return this.targetProductNameField; + } + set + { + this.targetProductNameFieldSet = true; + this.targetProductNameField = value; + } + } + + /// + /// When this attribute is set, patches for files greater than approximately 4 MB in size may be made smaller. + /// + public YesNoType OptimizePatchSizeForLargeFiles + { + get + { + return this.optimizePatchSizeForLargeFilesField; + } + set + { + this.optimizePatchSizeForLargeFilesFieldSet = true; + this.optimizePatchSizeForLargeFilesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PatchInformation" == childName)) + { + childValue = new PatchInformation(); + } + if (("Media" == childName)) + { + childValue = new Media(); + } + if (("OptimizeCustomActions" == childName)) + { + childValue = new OptimizeCustomActions(); + } + if (("PatchFamily" == childName)) + { + childValue = new PatchFamily(); + } + if (("PatchFamilyRef" == childName)) + { + childValue = new PatchFamilyRef(); + } + if (("PatchFamilyGroup" == childName)) + { + childValue = new PatchFamilyGroup(); + } + if (("PatchFamilyGroupRef" == childName)) + { + childValue = new PatchFamilyGroupRef(); + } + if (("PatchProperty" == childName)) + { + childValue = new PatchProperty(); + } + if (("TargetProductCodes" == childName)) + { + childValue = new TargetProductCodes(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Patch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.allowRemovalFieldSet) + { + if ((this.allowRemovalField == YesNoType.no)) + { + writer.WriteAttributeString("AllowRemoval", "no"); + } + if ((this.allowRemovalField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowRemoval", "yes"); + } + } + if (this.classificationFieldSet) + { + writer.WriteAttributeString("Classification", this.classificationField); + } + if (this.clientPatchIdFieldSet) + { + writer.WriteAttributeString("ClientPatchId", this.clientPatchIdField); + } + if (this.apiPatchingSymbolNoImagehlpFlagFieldSet) + { + if ((this.apiPatchingSymbolNoImagehlpFlagField == YesNoType.no)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoImagehlpFlag", "no"); + } + if ((this.apiPatchingSymbolNoImagehlpFlagField == YesNoType.yes)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoImagehlpFlag", "yes"); + } + } + if (this.apiPatchingSymbolNoFailuresFlagFieldSet) + { + if ((this.apiPatchingSymbolNoFailuresFlagField == YesNoType.no)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoFailuresFlag", "no"); + } + if ((this.apiPatchingSymbolNoFailuresFlagField == YesNoType.yes)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoFailuresFlag", "yes"); + } + } + if (this.apiPatchingSymbolUndecoratedTooFlagFieldSet) + { + if ((this.apiPatchingSymbolUndecoratedTooFlagField == YesNoType.no)) + { + writer.WriteAttributeString("ApiPatchingSymbolUndecoratedTooFlag", "no"); + } + if ((this.apiPatchingSymbolUndecoratedTooFlagField == YesNoType.yes)) + { + writer.WriteAttributeString("ApiPatchingSymbolUndecoratedTooFlag", "yes"); + } + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.commentsFieldSet) + { + writer.WriteAttributeString("Comments", this.commentsField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.minorUpdateTargetRTMFieldSet) + { + if ((this.minorUpdateTargetRTMField == YesNoType.no)) + { + writer.WriteAttributeString("MinorUpdateTargetRTM", "no"); + } + if ((this.minorUpdateTargetRTMField == YesNoType.yes)) + { + writer.WriteAttributeString("MinorUpdateTargetRTM", "yes"); + } + } + if (this.moreInfoURLFieldSet) + { + writer.WriteAttributeString("MoreInfoURL", this.moreInfoURLField); + } + if (this.optimizedInstallModeFieldSet) + { + if ((this.optimizedInstallModeField == YesNoType.no)) + { + writer.WriteAttributeString("OptimizedInstallMode", "no"); + } + if ((this.optimizedInstallModeField == YesNoType.yes)) + { + writer.WriteAttributeString("OptimizedInstallMode", "yes"); + } + } + if (this.targetProductNameFieldSet) + { + writer.WriteAttributeString("TargetProductName", this.targetProductNameField); + } + if (this.optimizePatchSizeForLargeFilesFieldSet) + { + if ((this.optimizePatchSizeForLargeFilesField == YesNoType.no)) + { + writer.WriteAttributeString("OptimizePatchSizeForLargeFiles", "no"); + } + if ((this.optimizePatchSizeForLargeFilesField == YesNoType.yes)) + { + writer.WriteAttributeString("OptimizePatchSizeForLargeFiles", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("AllowRemoval" == name)) + { + this.allowRemovalField = Enums.ParseYesNoType(value); + this.allowRemovalFieldSet = true; + } + if (("Classification" == name)) + { + this.classificationField = value; + this.classificationFieldSet = true; + } + if (("ClientPatchId" == name)) + { + this.clientPatchIdField = value; + this.clientPatchIdFieldSet = true; + } + if (("ApiPatchingSymbolNoImagehlpFlag" == name)) + { + this.apiPatchingSymbolNoImagehlpFlagField = Enums.ParseYesNoType(value); + this.apiPatchingSymbolNoImagehlpFlagFieldSet = true; + } + if (("ApiPatchingSymbolNoFailuresFlag" == name)) + { + this.apiPatchingSymbolNoFailuresFlagField = Enums.ParseYesNoType(value); + this.apiPatchingSymbolNoFailuresFlagFieldSet = true; + } + if (("ApiPatchingSymbolUndecoratedTooFlag" == name)) + { + this.apiPatchingSymbolUndecoratedTooFlagField = Enums.ParseYesNoType(value); + this.apiPatchingSymbolUndecoratedTooFlagFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Comments" == name)) + { + this.commentsField = value; + this.commentsFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("MinorUpdateTargetRTM" == name)) + { + this.minorUpdateTargetRTMField = Enums.ParseYesNoType(value); + this.minorUpdateTargetRTMFieldSet = true; + } + if (("MoreInfoURL" == name)) + { + this.moreInfoURLField = value; + this.moreInfoURLFieldSet = true; + } + if (("OptimizedInstallMode" == name)) + { + this.optimizedInstallModeField = Enums.ParseYesNoType(value); + this.optimizedInstallModeFieldSet = true; + } + if (("TargetProductName" == name)) + { + this.targetProductNameField = value; + this.targetProductNameFieldSet = true; + } + if (("OptimizePatchSizeForLargeFiles" == name)) + { + this.optimizePatchSizeForLargeFilesField = Enums.ParseYesNoType(value); + this.optimizePatchSizeForLargeFilesFieldSet = true; + } + } + } + + /// + /// Sets information in the patch transform that determines if the transform applies to an installed product and what errors should be ignored when applying the patch transform. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Validate : ISchemaElement, ISetAttributes + { + + private YesNoType productIdField; + + private bool productIdFieldSet; + + private YesNoType productLanguageField; + + private bool productLanguageFieldSet; + + private ProductVersionType productVersionField; + + private bool productVersionFieldSet; + + private ProductVersionOperatorType productVersionOperatorField; + + private bool productVersionOperatorFieldSet; + + private YesNoType upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private YesNoType ignoreAddExistingRowField; + + private bool ignoreAddExistingRowFieldSet; + + private YesNoType ignoreAddExistingTableField; + + private bool ignoreAddExistingTableFieldSet; + + private YesNoType ignoreDeleteMissingRowField; + + private bool ignoreDeleteMissingRowFieldSet; + + private YesNoType ignoreDeleteMissingTableField; + + private bool ignoreDeleteMissingTableFieldSet; + + private YesNoType ignoreUpdateMissingRowField; + + private bool ignoreUpdateMissingRowFieldSet; + + private YesNoType ignoreChangingCodePageField; + + private bool ignoreChangingCodePageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Requires that the installed ProductCode match the target ProductCode used to create the transform. The default is 'yes'. + /// + public YesNoType ProductId + { + get + { + return this.productIdField; + } + set + { + this.productIdFieldSet = true; + this.productIdField = value; + } + } + + /// + /// Requires that the installed ProductLanguage match the target ProductLanguage used to create the transform. The default is 'no'. + /// + public YesNoType ProductLanguage + { + get + { + return this.productLanguageField; + } + set + { + this.productLanguageFieldSet = true; + this.productLanguageField = value; + } + } + + /// + /// Determines how many fields of the installed ProductVersion to compare. See remarks for more information. The default is 'Update'. + /// + public ProductVersionType ProductVersion + { + get + { + return this.productVersionField; + } + set + { + this.productVersionFieldSet = true; + this.productVersionField = value; + } + } + + /// + /// Determines how the installed ProductVersion is compared to the target ProductVersion used to create the transform. See remarks for more information. The default is 'Equal'. + /// + public ProductVersionOperatorType ProductVersionOperator + { + get + { + return this.productVersionOperatorField; + } + set + { + this.productVersionOperatorFieldSet = true; + this.productVersionOperatorField = value; + } + } + + /// + /// Requires that the installed UpgradeCode match the target UpgradeCode used to create the transform. The default is 'yes'. + /// + public YesNoType UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// Ignore errors when adding existing rows. The default is 'yes'. + /// + public YesNoType IgnoreAddExistingRow + { + get + { + return this.ignoreAddExistingRowField; + } + set + { + this.ignoreAddExistingRowFieldSet = true; + this.ignoreAddExistingRowField = value; + } + } + + /// + /// Ignore errors when adding existing tables. The default is 'yes'. + /// + public YesNoType IgnoreAddExistingTable + { + get + { + return this.ignoreAddExistingTableField; + } + set + { + this.ignoreAddExistingTableFieldSet = true; + this.ignoreAddExistingTableField = value; + } + } + + /// + /// Ignore errors when deleting missing rows. The default is 'yes'. + /// + public YesNoType IgnoreDeleteMissingRow + { + get + { + return this.ignoreDeleteMissingRowField; + } + set + { + this.ignoreDeleteMissingRowFieldSet = true; + this.ignoreDeleteMissingRowField = value; + } + } + + /// + /// Ignore errors when deleting missing tables. The default is 'yes'. + /// + public YesNoType IgnoreDeleteMissingTable + { + get + { + return this.ignoreDeleteMissingTableField; + } + set + { + this.ignoreDeleteMissingTableFieldSet = true; + this.ignoreDeleteMissingTableField = value; + } + } + + /// + /// Ignore errors when updating missing rows. The default is 'yes'. + /// + public YesNoType IgnoreUpdateMissingRow + { + get + { + return this.ignoreUpdateMissingRowField; + } + set + { + this.ignoreUpdateMissingRowFieldSet = true; + this.ignoreUpdateMissingRowField = value; + } + } + + /// + /// Ignore errors when changing the database code page. The default is 'no'. + /// + public YesNoType IgnoreChangingCodePage + { + get + { + return this.ignoreChangingCodePageField; + } + set + { + this.ignoreChangingCodePageFieldSet = true; + this.ignoreChangingCodePageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ProductVersionType from a string. + /// + public static ProductVersionType ParseProductVersionType(string value) + { + ProductVersionType parsedValue; + Validate.TryParseProductVersionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ProductVersionType from a string. + /// + public static bool TryParseProductVersionType(string value, out ProductVersionType parsedValue) + { + parsedValue = ProductVersionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Major" == value)) + { + parsedValue = ProductVersionType.Major; + } + else + { + if (("Minor" == value)) + { + parsedValue = ProductVersionType.Minor; + } + else + { + if (("Update" == value)) + { + parsedValue = ProductVersionType.Update; + } + else + { + parsedValue = ProductVersionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a ProductVersionOperatorType from a string. + /// + public static ProductVersionOperatorType ParseProductVersionOperatorType(string value) + { + ProductVersionOperatorType parsedValue; + Validate.TryParseProductVersionOperatorType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ProductVersionOperatorType from a string. + /// + public static bool TryParseProductVersionOperatorType(string value, out ProductVersionOperatorType parsedValue) + { + parsedValue = ProductVersionOperatorType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Lesser" == value)) + { + parsedValue = ProductVersionOperatorType.Lesser; + } + else + { + if (("LesserOrEqual" == value)) + { + parsedValue = ProductVersionOperatorType.LesserOrEqual; + } + else + { + if (("Equal" == value)) + { + parsedValue = ProductVersionOperatorType.Equal; + } + else + { + if (("GreaterOrEqual" == value)) + { + parsedValue = ProductVersionOperatorType.GreaterOrEqual; + } + else + { + if (("Greater" == value)) + { + parsedValue = ProductVersionOperatorType.Greater; + } + else + { + parsedValue = ProductVersionOperatorType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Validate", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.productIdFieldSet) + { + if ((this.productIdField == YesNoType.no)) + { + writer.WriteAttributeString("ProductId", "no"); + } + if ((this.productIdField == YesNoType.yes)) + { + writer.WriteAttributeString("ProductId", "yes"); + } + } + if (this.productLanguageFieldSet) + { + if ((this.productLanguageField == YesNoType.no)) + { + writer.WriteAttributeString("ProductLanguage", "no"); + } + if ((this.productLanguageField == YesNoType.yes)) + { + writer.WriteAttributeString("ProductLanguage", "yes"); + } + } + if (this.productVersionFieldSet) + { + if ((this.productVersionField == ProductVersionType.Major)) + { + writer.WriteAttributeString("ProductVersion", "Major"); + } + if ((this.productVersionField == ProductVersionType.Minor)) + { + writer.WriteAttributeString("ProductVersion", "Minor"); + } + if ((this.productVersionField == ProductVersionType.Update)) + { + writer.WriteAttributeString("ProductVersion", "Update"); + } + } + if (this.productVersionOperatorFieldSet) + { + if ((this.productVersionOperatorField == ProductVersionOperatorType.Lesser)) + { + writer.WriteAttributeString("ProductVersionOperator", "Lesser"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.LesserOrEqual)) + { + writer.WriteAttributeString("ProductVersionOperator", "LesserOrEqual"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.Equal)) + { + writer.WriteAttributeString("ProductVersionOperator", "Equal"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.GreaterOrEqual)) + { + writer.WriteAttributeString("ProductVersionOperator", "GreaterOrEqual"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.Greater)) + { + writer.WriteAttributeString("ProductVersionOperator", "Greater"); + } + } + if (this.upgradeCodeFieldSet) + { + if ((this.upgradeCodeField == YesNoType.no)) + { + writer.WriteAttributeString("UpgradeCode", "no"); + } + if ((this.upgradeCodeField == YesNoType.yes)) + { + writer.WriteAttributeString("UpgradeCode", "yes"); + } + } + if (this.ignoreAddExistingRowFieldSet) + { + if ((this.ignoreAddExistingRowField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreAddExistingRow", "no"); + } + if ((this.ignoreAddExistingRowField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreAddExistingRow", "yes"); + } + } + if (this.ignoreAddExistingTableFieldSet) + { + if ((this.ignoreAddExistingTableField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreAddExistingTable", "no"); + } + if ((this.ignoreAddExistingTableField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreAddExistingTable", "yes"); + } + } + if (this.ignoreDeleteMissingRowFieldSet) + { + if ((this.ignoreDeleteMissingRowField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreDeleteMissingRow", "no"); + } + if ((this.ignoreDeleteMissingRowField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreDeleteMissingRow", "yes"); + } + } + if (this.ignoreDeleteMissingTableFieldSet) + { + if ((this.ignoreDeleteMissingTableField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreDeleteMissingTable", "no"); + } + if ((this.ignoreDeleteMissingTableField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreDeleteMissingTable", "yes"); + } + } + if (this.ignoreUpdateMissingRowFieldSet) + { + if ((this.ignoreUpdateMissingRowField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreUpdateMissingRow", "no"); + } + if ((this.ignoreUpdateMissingRowField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreUpdateMissingRow", "yes"); + } + } + if (this.ignoreChangingCodePageFieldSet) + { + if ((this.ignoreChangingCodePageField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreChangingCodePage", "no"); + } + if ((this.ignoreChangingCodePageField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreChangingCodePage", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ProductId" == name)) + { + this.productIdField = Enums.ParseYesNoType(value); + this.productIdFieldSet = true; + } + if (("ProductLanguage" == name)) + { + this.productLanguageField = Enums.ParseYesNoType(value); + this.productLanguageFieldSet = true; + } + if (("ProductVersion" == name)) + { + this.productVersionField = Validate.ParseProductVersionType(value); + this.productVersionFieldSet = true; + } + if (("ProductVersionOperator" == name)) + { + this.productVersionOperatorField = Validate.ParseProductVersionOperatorType(value); + this.productVersionOperatorFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = Enums.ParseYesNoType(value); + this.upgradeCodeFieldSet = true; + } + if (("IgnoreAddExistingRow" == name)) + { + this.ignoreAddExistingRowField = Enums.ParseYesNoType(value); + this.ignoreAddExistingRowFieldSet = true; + } + if (("IgnoreAddExistingTable" == name)) + { + this.ignoreAddExistingTableField = Enums.ParseYesNoType(value); + this.ignoreAddExistingTableFieldSet = true; + } + if (("IgnoreDeleteMissingRow" == name)) + { + this.ignoreDeleteMissingRowField = Enums.ParseYesNoType(value); + this.ignoreDeleteMissingRowFieldSet = true; + } + if (("IgnoreDeleteMissingTable" == name)) + { + this.ignoreDeleteMissingTableField = Enums.ParseYesNoType(value); + this.ignoreDeleteMissingTableFieldSet = true; + } + if (("IgnoreUpdateMissingRow" == name)) + { + this.ignoreUpdateMissingRowField = Enums.ParseYesNoType(value); + this.ignoreUpdateMissingRowFieldSet = true; + } + if (("IgnoreChangingCodePage" == name)) + { + this.ignoreChangingCodePageField = Enums.ParseYesNoType(value); + this.ignoreChangingCodePageFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ProductVersionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Checks the major version. + /// + Major, + + /// + /// Checks the major and minor versions. + /// + Minor, + + /// + /// Checks the major, minor, and update versions. + /// + Update, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ProductVersionOperatorType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Installed ProductVersion < target ProductVersion. + /// + Lesser, + + /// + /// Installed ProductVersion <= target ProductVersion. + /// + LesserOrEqual, + + /// + /// Installed ProductVersion = target ProductVersion. + /// + Equal, + + /// + /// Installed ProductVersion >= target ProductVersion. + /// + GreaterOrEqual, + + /// + /// Installed ProductVersion > target ProductVersion. + /// + Greater, + } + } + + /// + /// Indicates whether custom actions can be skipped when applying the patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class OptimizeCustomActions : ISchemaElement, ISetAttributes + { + + private YesNoType skipAssignmentField; + + private bool skipAssignmentFieldSet; + + private YesNoType skipImmediateField; + + private bool skipImmediateFieldSet; + + private YesNoType skipDeferredField; + + private bool skipDeferredFieldSet; + + private ISchemaElement parentElement; + + /// + /// Skip property (type 51) and directory (type 35) assignment custom actions. + /// + public YesNoType SkipAssignment + { + get + { + return this.skipAssignmentField; + } + set + { + this.skipAssignmentFieldSet = true; + this.skipAssignmentField = value; + } + } + + /// + /// Skip immediate custom actions that are not property or directory assignment custom actions. + /// + public YesNoType SkipImmediate + { + get + { + return this.skipImmediateField; + } + set + { + this.skipImmediateFieldSet = true; + this.skipImmediateField = value; + } + } + + /// + /// Skip custom actions that run within the script. + /// + public YesNoType SkipDeferred + { + get + { + return this.skipDeferredField; + } + set + { + this.skipDeferredFieldSet = true; + this.skipDeferredField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("OptimizeCustomActions", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.skipAssignmentFieldSet) + { + if ((this.skipAssignmentField == YesNoType.no)) + { + writer.WriteAttributeString("SkipAssignment", "no"); + } + if ((this.skipAssignmentField == YesNoType.yes)) + { + writer.WriteAttributeString("SkipAssignment", "yes"); + } + } + if (this.skipImmediateFieldSet) + { + if ((this.skipImmediateField == YesNoType.no)) + { + writer.WriteAttributeString("SkipImmediate", "no"); + } + if ((this.skipImmediateField == YesNoType.yes)) + { + writer.WriteAttributeString("SkipImmediate", "yes"); + } + } + if (this.skipDeferredFieldSet) + { + if ((this.skipDeferredField == YesNoType.no)) + { + writer.WriteAttributeString("SkipDeferred", "no"); + } + if ((this.skipDeferredField == YesNoType.yes)) + { + writer.WriteAttributeString("SkipDeferred", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SkipAssignment" == name)) + { + this.skipAssignmentField = Enums.ParseYesNoType(value); + this.skipAssignmentFieldSet = true; + } + if (("SkipImmediate" == name)) + { + this.skipImmediateField = Enums.ParseYesNoType(value); + this.skipImmediateFieldSet = true; + } + if (("SkipDeferred" == name)) + { + this.skipDeferredField = Enums.ParseYesNoType(value); + this.skipDeferredFieldSet = true; + } + } + } + + /// + /// Identifies a set of product versions. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchBaseline : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PatchBaseline() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Validate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for a set of product versions. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Validate" == childName)) + { + childValue = new Validate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchBaseline", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Collection of items that should be kept from the differences between two products. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamily : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private YesNoType supersedeField; + + private bool supersedeFieldSet; + + private ISchemaElement parentElement; + + public PatchFamily() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(All))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(BinaryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificateRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IconRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier which indicates a sequence family to which this patch belongs. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies the ProductCode of the product that this family applies to. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// Used to populate the sequence column of the MsiPatchSequence table in the final MSP file. Specified in x.x.x.x format. See documentation for Sequence column of MsiPatchSequence table in MSI SDK. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + /// + /// Set this value to 'yes' to indicate that this patch will supersede all previous patches in this patch family. + /// The default value is 'no'. + /// + public YesNoType Supersede + { + get + { + return this.supersedeField; + } + set + { + this.supersedeFieldSet = true; + this.supersedeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("All" == childName)) + { + childValue = new All(); + } + if (("BinaryRef" == childName)) + { + childValue = new BinaryRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("DigitalCertificateRef" == childName)) + { + childValue = new DigitalCertificateRef(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("IconRef" == childName)) + { + childValue = new IconRef(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamily", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + if (this.supersedeFieldSet) + { + if ((this.supersedeField == YesNoType.no)) + { + writer.WriteAttributeString("Supersede", "no"); + } + if ((this.supersedeField == YesNoType.yes)) + { + writer.WriteAttributeString("Supersede", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + if (("Supersede" == name)) + { + this.supersedeField = Enums.ParseYesNoType(value); + this.supersedeFieldSet = true; + } + } + } + + /// + /// Groups together multiple patch families to be used in other locations. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamilyGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PatchFamilyGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the PatchFamilyGroup. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PatchFamily" == childName)) + { + childValue = new PatchFamily(); + } + if (("PatchFamilyRef" == childName)) + { + childValue = new PatchFamilyRef(); + } + if (("PatchFamilyGroupRef" == childName)) + { + childValue = new PatchFamilyGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamilyGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a PatchFamilyGroup in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamilyGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PatchFamilyGroup to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamilyGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The PatchCreation element is analogous to the main function in a C program. When linking, only one PatchCreation section + /// can be given to the linker to produce a successful result. Using this element creates a pcp file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchCreation : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType allowMajorVersionMismatchesField; + + private bool allowMajorVersionMismatchesFieldSet; + + private YesNoType allowProductCodeMismatchesField; + + private bool allowProductCodeMismatchesFieldSet; + + private YesNoType cleanWorkingFolderField; + + private bool cleanWorkingFolderFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private string outputPathField; + + private bool outputPathFieldSet; + + private string sourceListField; + + private bool sourceListFieldSet; + + private int symbolFlagsField; + + private bool symbolFlagsFieldSet; + + private YesNoType wholeFilesOnlyField; + + private bool wholeFilesOnlyFieldSet; + + private ISchemaElement parentElement; + + public PatchCreation() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PatchInformation))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PatchMetadata))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Family))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchSequence))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ReplacePatch))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCode))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// PatchCreation identifier; this is the primary key for identifying patches. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Use this to set whether the major versions between the upgrade and target images match. See + /// + public YesNoType AllowMajorVersionMismatches + { + get + { + return this.allowMajorVersionMismatchesField; + } + set + { + this.allowMajorVersionMismatchesFieldSet = true; + this.allowMajorVersionMismatchesField = value; + } + } + + /// + /// Use this to set whether the product code between the upgrade and target images match. See + /// + public YesNoType AllowProductCodeMismatches + { + get + { + return this.allowProductCodeMismatchesField; + } + set + { + this.allowProductCodeMismatchesFieldSet = true; + this.allowProductCodeMismatchesField = value; + } + } + + /// + /// Use this to set whether Patchwiz should clean the temp folder when finished. See + /// + public YesNoType CleanWorkingFolder + { + get + { + return this.cleanWorkingFolderField; + } + set + { + this.cleanWorkingFolderFieldSet = true; + this.cleanWorkingFolderField = value; + } + } + + /// + /// The code page integer value or web name for the resulting PCP. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// The full path, including file name, of the patch package file that is to be generated. See + /// + public string OutputPath + { + get + { + return this.outputPathField; + } + set + { + this.outputPathFieldSet = true; + this.outputPathField = value; + } + } + + /// + /// Used to locate the .msp file for the patch if the cached copy is unavailable. See + /// + public string SourceList + { + get + { + return this.sourceListField; + } + set + { + this.sourceListFieldSet = true; + this.sourceListField = value; + } + } + + /// + /// An 8-digit hex integer representing the combination of patch symbol usage flags to use when creating a binary file patch. See + /// + public int SymbolFlags + { + get + { + return this.symbolFlagsField; + } + set + { + this.symbolFlagsFieldSet = true; + this.symbolFlagsField = value; + } + } + + /// + /// Use this to set whether changing files should be included in their entirety. See + /// + public YesNoType WholeFilesOnly + { + get + { + return this.wholeFilesOnlyField; + } + set + { + this.wholeFilesOnlyFieldSet = true; + this.wholeFilesOnlyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PatchInformation" == childName)) + { + childValue = new PatchInformation(); + } + if (("PatchMetadata" == childName)) + { + childValue = new PatchMetadata(); + } + if (("Family" == childName)) + { + childValue = new Family(); + } + if (("PatchProperty" == childName)) + { + childValue = new PatchProperty(); + } + if (("PatchSequence" == childName)) + { + childValue = new PatchSequence(); + } + if (("ReplacePatch" == childName)) + { + childValue = new ReplacePatch(); + } + if (("TargetProductCode" == childName)) + { + childValue = new TargetProductCode(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchCreation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.allowMajorVersionMismatchesFieldSet) + { + if ((this.allowMajorVersionMismatchesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowMajorVersionMismatches", "no"); + } + if ((this.allowMajorVersionMismatchesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowMajorVersionMismatches", "yes"); + } + } + if (this.allowProductCodeMismatchesFieldSet) + { + if ((this.allowProductCodeMismatchesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowProductCodeMismatches", "no"); + } + if ((this.allowProductCodeMismatchesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowProductCodeMismatches", "yes"); + } + } + if (this.cleanWorkingFolderFieldSet) + { + if ((this.cleanWorkingFolderField == YesNoType.no)) + { + writer.WriteAttributeString("CleanWorkingFolder", "no"); + } + if ((this.cleanWorkingFolderField == YesNoType.yes)) + { + writer.WriteAttributeString("CleanWorkingFolder", "yes"); + } + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.outputPathFieldSet) + { + writer.WriteAttributeString("OutputPath", this.outputPathField); + } + if (this.sourceListFieldSet) + { + writer.WriteAttributeString("SourceList", this.sourceListField); + } + if (this.symbolFlagsFieldSet) + { + writer.WriteAttributeString("SymbolFlags", this.symbolFlagsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.wholeFilesOnlyFieldSet) + { + if ((this.wholeFilesOnlyField == YesNoType.no)) + { + writer.WriteAttributeString("WholeFilesOnly", "no"); + } + if ((this.wholeFilesOnlyField == YesNoType.yes)) + { + writer.WriteAttributeString("WholeFilesOnly", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AllowMajorVersionMismatches" == name)) + { + this.allowMajorVersionMismatchesField = Enums.ParseYesNoType(value); + this.allowMajorVersionMismatchesFieldSet = true; + } + if (("AllowProductCodeMismatches" == name)) + { + this.allowProductCodeMismatchesField = Enums.ParseYesNoType(value); + this.allowProductCodeMismatchesFieldSet = true; + } + if (("CleanWorkingFolder" == name)) + { + this.cleanWorkingFolderField = Enums.ParseYesNoType(value); + this.cleanWorkingFolderFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("OutputPath" == name)) + { + this.outputPathField = value; + this.outputPathFieldSet = true; + } + if (("SourceList" == name)) + { + this.sourceListField = value; + this.sourceListFieldSet = true; + } + if (("SymbolFlags" == name)) + { + this.symbolFlagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.symbolFlagsFieldSet = true; + } + if (("WholeFilesOnly" == name)) + { + this.wholeFilesOnlyField = Enums.ParseYesNoType(value); + this.wholeFilesOnlyFieldSet = true; + } + } + } + + /// + /// Properties about the patch to be placed in the Summary Information Stream. These are visible from COM through the IStream interface, and these properties can be seen on the package in Explorer. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchInformation : ISchemaElement, ISetAttributes + { + + private string descriptionField; + + private bool descriptionFieldSet; + + private string platformsField; + + private bool platformsFieldSet; + + private string languagesField; + + private bool languagesFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string keywordsField; + + private bool keywordsFieldSet; + + private string commentsField; + + private bool commentsFieldSet; + + private YesNoDefaultType readOnlyField; + + private bool readOnlyFieldSet; + + private string summaryCodepageField; + + private bool summaryCodepageFieldSet; + + private YesNoType shortNamesField; + + private bool shortNamesFieldSet; + + private YesNoType compressedField; + + private bool compressedFieldSet; + + private YesNoType adminImageField; + + private bool adminImageFieldSet; + + private ISchemaElement parentElement; + + /// + /// A short description of the patch that includes the name of the product. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + public string Platforms + { + get + { + return this.platformsField; + } + set + { + this.platformsFieldSet = true; + this.platformsField = value; + } + } + + public string Languages + { + get + { + return this.languagesField; + } + set + { + this.languagesFieldSet = true; + this.languagesField = value; + } + } + + /// + /// The name of the manufacturer of the patch package. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// A semicolon-delimited list of network or URL locations for alternate sources of the patch. The default is "Installer,Patching,PCP,Database". + /// + public string Keywords + { + get + { + return this.keywordsField; + } + set + { + this.keywordsFieldSet = true; + this.keywordsField = value; + } + } + + /// + /// General purpose of the patch package. For example, "This patch contains the logic and data required to install + /// + public string Comments + { + get + { + return this.commentsField; + } + set + { + this.commentsFieldSet = true; + this.commentsField = value; + } + } + + /// + /// The value of this attribute conveys whether the package should be opened as read-only. + /// A database editing tool should not modify a read-only enforced database and should + /// issue a warning at attempts to modify a read-only recommended database. + /// + public YesNoDefaultType ReadOnly + { + get + { + return this.readOnlyField; + } + set + { + this.readOnlyFieldSet = true; + this.readOnlyField = value; + } + } + + /// + /// The code page integer value or web name for summary info strings only. The default is 1252. See remarks for more information. + /// + public string SummaryCodepage + { + get + { + return this.summaryCodepageField; + } + set + { + this.summaryCodepageFieldSet = true; + this.summaryCodepageField = value; + } + } + + public YesNoType ShortNames + { + get + { + return this.shortNamesField; + } + set + { + this.shortNamesFieldSet = true; + this.shortNamesField = value; + } + } + + public YesNoType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + public YesNoType AdminImage + { + get + { + return this.adminImageField; + } + set + { + this.adminImageFieldSet = true; + this.adminImageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchInformation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.platformsFieldSet) + { + writer.WriteAttributeString("Platforms", this.platformsField); + } + if (this.languagesFieldSet) + { + writer.WriteAttributeString("Languages", this.languagesField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.keywordsFieldSet) + { + writer.WriteAttributeString("Keywords", this.keywordsField); + } + if (this.commentsFieldSet) + { + writer.WriteAttributeString("Comments", this.commentsField); + } + if (this.readOnlyFieldSet) + { + if ((this.readOnlyField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ReadOnly", "default"); + } + if ((this.readOnlyField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ReadOnly", "no"); + } + if ((this.readOnlyField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ReadOnly", "yes"); + } + } + if (this.summaryCodepageFieldSet) + { + writer.WriteAttributeString("SummaryCodepage", this.summaryCodepageField); + } + if (this.shortNamesFieldSet) + { + if ((this.shortNamesField == YesNoType.no)) + { + writer.WriteAttributeString("ShortNames", "no"); + } + if ((this.shortNamesField == YesNoType.yes)) + { + writer.WriteAttributeString("ShortNames", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.adminImageFieldSet) + { + if ((this.adminImageField == YesNoType.no)) + { + writer.WriteAttributeString("AdminImage", "no"); + } + if ((this.adminImageField == YesNoType.yes)) + { + writer.WriteAttributeString("AdminImage", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Platforms" == name)) + { + this.platformsField = value; + this.platformsFieldSet = true; + } + if (("Languages" == name)) + { + this.languagesField = value; + this.languagesFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Keywords" == name)) + { + this.keywordsField = value; + this.keywordsFieldSet = true; + } + if (("Comments" == name)) + { + this.commentsField = value; + this.commentsFieldSet = true; + } + if (("ReadOnly" == name)) + { + this.readOnlyField = Enums.ParseYesNoDefaultType(value); + this.readOnlyFieldSet = true; + } + if (("SummaryCodepage" == name)) + { + this.summaryCodepageField = value; + this.summaryCodepageFieldSet = true; + } + if (("ShortNames" == name)) + { + this.shortNamesField = Enums.ParseYesNoType(value); + this.shortNamesFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoType(value); + this.compressedFieldSet = true; + } + if (("AdminImage" == name)) + { + this.adminImageField = Enums.ParseYesNoType(value); + this.adminImageFieldSet = true; + } + } + } + + /// + /// Properties about the patch to be placed in the PatchMetadata table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchMetadata : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType allowRemovalField; + + private bool allowRemovalFieldSet; + + private string classificationField; + + private bool classificationFieldSet; + + private string creationTimeUTCField; + + private bool creationTimeUTCFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string manufacturerNameField; + + private bool manufacturerNameFieldSet; + + private string minorUpdateTargetRTMField; + + private bool minorUpdateTargetRTMFieldSet; + + private string moreInfoURLField; + + private bool moreInfoURLFieldSet; + + private YesNoType optimizedInstallModeField; + + private bool optimizedInstallModeFieldSet; + + private string targetProductNameField; + + private bool targetProductNameFieldSet; + + private ISchemaElement parentElement; + + public PatchMetadata() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(OptimizeCustomActions))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Whether this is an uninstallable patch. + /// + public YesNoType AllowRemoval + { + get + { + return this.allowRemovalField; + } + set + { + this.allowRemovalFieldSet = true; + this.allowRemovalField = value; + } + } + + /// + /// Category of updates. Recommended values are Critical Update, Hotfix, Security Rollup, Security Update, Service Pack, Update, Update Rollup. + /// + public string Classification + { + get + { + return this.classificationField; + } + set + { + this.classificationFieldSet = true; + this.classificationField = value; + } + } + + /// + /// Creation time of the .msp file in the form mm-dd-yy HH:MM (month-day-year hour:minute). + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string CreationTimeUTC + { + get + { + return this.creationTimeUTCField; + } + set + { + this.creationTimeUTCFieldSet = true; + this.creationTimeUTCField = value; + } + } + + /// + /// Description of the patch. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// A title for the patch that is suitable for public display. In Add/Remove Programs from XP SP2 on. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Name of the manufacturer. + /// + public string ManufacturerName + { + get + { + return this.manufacturerNameField; + } + set + { + this.manufacturerNameFieldSet = true; + this.manufacturerNameField = value; + } + } + + /// + /// Indicates that the patch targets the RTM version of the product or the most recent major + /// upgrade patch. Author this optional property in minor update patches that contain sequencing + /// information to indicate that the patch removes all patches up to the RTM version of the + /// product, or up to the most recent major upgrade patch. This property is available beginning + /// with Windows Installer 3.1. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string MinorUpdateTargetRTM + { + get + { + return this.minorUpdateTargetRTMField; + } + set + { + this.minorUpdateTargetRTMFieldSet = true; + this.minorUpdateTargetRTMField = value; + } + } + + /// + /// A URL that provides information specific to this patch. In Add/Remove Programs from XP SP2 on. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string MoreInfoURL + { + get + { + return this.moreInfoURLField; + } + set + { + this.moreInfoURLFieldSet = true; + this.moreInfoURLField = value; + } + } + + /// + /// If this attribute is set to 'yes' in all the patches to be applied in a transaction, the + /// application of the patch is optimized if possible. Available beginning with Windows Installer 3.1. + /// + public YesNoType OptimizedInstallMode + { + get + { + return this.optimizedInstallModeField; + } + set + { + this.optimizedInstallModeFieldSet = true; + this.optimizedInstallModeField = value; + } + } + + /// + /// Name of the application or target product suite. + /// + public string TargetProductName + { + get + { + return this.targetProductNameField; + } + set + { + this.targetProductNameFieldSet = true; + this.targetProductNameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("CustomProperty" == childName)) + { + childValue = new CustomProperty(); + } + if (("OptimizeCustomActions" == childName)) + { + childValue = new OptimizeCustomActions(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchMetadata", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.allowRemovalFieldSet) + { + if ((this.allowRemovalField == YesNoType.no)) + { + writer.WriteAttributeString("AllowRemoval", "no"); + } + if ((this.allowRemovalField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowRemoval", "yes"); + } + } + if (this.classificationFieldSet) + { + writer.WriteAttributeString("Classification", this.classificationField); + } + if (this.creationTimeUTCFieldSet) + { + writer.WriteAttributeString("CreationTimeUTC", this.creationTimeUTCField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.manufacturerNameFieldSet) + { + writer.WriteAttributeString("ManufacturerName", this.manufacturerNameField); + } + if (this.minorUpdateTargetRTMFieldSet) + { + writer.WriteAttributeString("MinorUpdateTargetRTM", this.minorUpdateTargetRTMField); + } + if (this.moreInfoURLFieldSet) + { + writer.WriteAttributeString("MoreInfoURL", this.moreInfoURLField); + } + if (this.optimizedInstallModeFieldSet) + { + if ((this.optimizedInstallModeField == YesNoType.no)) + { + writer.WriteAttributeString("OptimizedInstallMode", "no"); + } + if ((this.optimizedInstallModeField == YesNoType.yes)) + { + writer.WriteAttributeString("OptimizedInstallMode", "yes"); + } + } + if (this.targetProductNameFieldSet) + { + writer.WriteAttributeString("TargetProductName", this.targetProductNameField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("AllowRemoval" == name)) + { + this.allowRemovalField = Enums.ParseYesNoType(value); + this.allowRemovalFieldSet = true; + } + if (("Classification" == name)) + { + this.classificationField = value; + this.classificationFieldSet = true; + } + if (("CreationTimeUTC" == name)) + { + this.creationTimeUTCField = value; + this.creationTimeUTCFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("ManufacturerName" == name)) + { + this.manufacturerNameField = value; + this.manufacturerNameFieldSet = true; + } + if (("MinorUpdateTargetRTM" == name)) + { + this.minorUpdateTargetRTMField = value; + this.minorUpdateTargetRTMFieldSet = true; + } + if (("MoreInfoURL" == name)) + { + this.moreInfoURLField = value; + this.moreInfoURLFieldSet = true; + } + if (("OptimizedInstallMode" == name)) + { + this.optimizedInstallModeField = Enums.ParseYesNoType(value); + this.optimizedInstallModeFieldSet = true; + } + if (("TargetProductName" == name)) + { + this.targetProductNameField = value; + this.targetProductNameFieldSet = true; + } + } + } + + /// + /// A custom property for the PatchMetadata table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomProperty : ISchemaElement, ISetAttributes + { + + private string companyField; + + private bool companyFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the company. + /// + public string Company + { + get + { + return this.companyField; + } + set + { + this.companyFieldSet = true; + this.companyField = value; + } + } + + /// + /// The name of the metadata property. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// Value of the metadata property. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.companyFieldSet) + { + writer.WriteAttributeString("Company", this.companyField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Company" == name)) + { + this.companyField = value; + this.companyFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// A patch that is deprecated by this patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ReplacePatch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Patch GUID to be unregistered if it exists on the machine targeted by this patch. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ReplacePatch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The product codes for products that can accept the patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetProductCodes : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType replaceField; + + private bool replaceFieldSet; + + private ISchemaElement parentElement; + + public TargetProductCodes() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCode))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Whether to replace the product codes that can accept the patch from the target packages with the child elements. + /// + public YesNoType Replace + { + get + { + return this.replaceField; + } + set + { + this.replaceFieldSet = true; + this.replaceField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("TargetProductCode" == childName)) + { + childValue = new TargetProductCode(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetProductCodes", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.replaceFieldSet) + { + if ((this.replaceField == YesNoType.no)) + { + writer.WriteAttributeString("Replace", "no"); + } + if ((this.replaceField == YesNoType.yes)) + { + writer.WriteAttributeString("Replace", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Replace" == name)) + { + this.replaceField = Enums.ParseYesNoType(value); + this.replaceFieldSet = true; + } + } + } + + /// + /// A product code for a product that can accept the patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetProductCode : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The product code for a product that can accept the patch. This can be '*'. See remarks for more information. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetProductCode", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// A property for this patch database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchProperty : ISchemaElement, ISetAttributes + { + + private string companyField; + + private bool companyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name of the company for a custom metadata property. + /// + public string Company + { + get + { + return this.companyField; + } + set + { + this.companyFieldSet = true; + this.companyField = value; + } + } + + /// + /// Name of the patch property. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Value of the patch property. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.companyFieldSet) + { + writer.WriteAttributeString("Company", this.companyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Company" == name)) + { + this.companyField = value; + this.companyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Sequence information for this patch database. Sequence information is generated automatically in most cases, and rarely needs to be set explicitly. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchSequence : ISchemaElement, ISetAttributes + { + + private string patchFamilyField; + + private bool patchFamilyFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string sequenceField; + + private bool sequenceFieldSet; + + private YesNoType supersedeField; + + private bool supersedeFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string targetImageField; + + private bool targetImageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier which indicates a sequence family to which this patch belongs. + /// + public string PatchFamily + { + get + { + return this.patchFamilyField; + } + set + { + this.patchFamilyFieldSet = true; + this.patchFamilyField = value; + } + } + + /// + /// Specifies the ProductCode of the product that this family applies to. + /// This attribute cannot the specified if the TargetImage attribute is specified. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// Used to populate the sequence column of the MsiPatchSequence table in the final MSP file. Specified in x.x.x.x format. See documentation for Sequence column of MsiPatchSequence table in MSI SDK. + /// + public string Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Set this value to 'yes' to indicate that this patch will supersede all previous patches in this patch family. + /// The default value is 'no'. + /// + public YesNoType Supersede + { + get + { + return this.supersedeField; + } + set + { + this.supersedeFieldSet = true; + this.supersedeField = value; + } + } + + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Specifies the TargetImage that this family applies to. + /// This attribute cannot the specified if the ProductCode attribute is specified. + /// + public string TargetImage + { + get + { + return this.targetImageField; + } + set + { + this.targetImageFieldSet = true; + this.targetImageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchSequence", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.patchFamilyFieldSet) + { + writer.WriteAttributeString("PatchFamily", this.patchFamilyField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField); + } + if (this.supersedeFieldSet) + { + if ((this.supersedeField == YesNoType.no)) + { + writer.WriteAttributeString("Supersede", "no"); + } + if ((this.supersedeField == YesNoType.yes)) + { + writer.WriteAttributeString("Supersede", "yes"); + } + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.targetImageFieldSet) + { + writer.WriteAttributeString("TargetImage", this.targetImageField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("PatchFamily" == name)) + { + this.patchFamilyField = value; + this.patchFamilyFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = value; + this.sequenceFieldSet = true; + } + if (("Supersede" == name)) + { + this.supersedeField = Enums.ParseYesNoType(value); + this.supersedeFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("TargetImage" == name)) + { + this.targetImageField = value; + this.targetImageFieldSet = true; + } + } + } + + /// + /// Group of one or more upgraded images of a product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Family : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string diskPromptField; + + private bool diskPromptFieldSet; + + private string mediaSrcPropField; + + private bool mediaSrcPropFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private int sequenceStartField; + + private bool sequenceStartFieldSet; + + private string volumeLabelField; + + private bool volumeLabelFieldSet; + + private ISchemaElement parentElement; + + public Family() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(UpgradeImage))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ExternalFile))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectFile))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Entered into the DiskId field of the new Media table record. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Value to display in the "[1]" of the DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. + /// + public string DiskPrompt + { + get + { + return this.diskPromptField; + } + set + { + this.diskPromptFieldSet = true; + this.diskPromptField = value; + } + } + + /// + /// Entered into the Source field of the new Media table entry of the upgraded image. + /// + public string MediaSrcProp + { + get + { + return this.mediaSrcPropField; + } + set + { + this.mediaSrcPropFieldSet = true; + this.mediaSrcPropField = value; + } + } + + /// + /// Identifier for the family. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Sequence number for the starting file. + /// + public int SequenceStart + { + get + { + return this.sequenceStartField; + } + set + { + this.sequenceStartFieldSet = true; + this.sequenceStartField = value; + } + } + + /// + /// Entered into the VolumeLabel field of the new Media table record. + /// + public string VolumeLabel + { + get + { + return this.volumeLabelField; + } + set + { + this.volumeLabelFieldSet = true; + this.volumeLabelField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("UpgradeImage" == childName)) + { + childValue = new UpgradeImage(); + } + if (("ExternalFile" == childName)) + { + childValue = new ExternalFile(); + } + if (("ProtectFile" == childName)) + { + childValue = new ProtectFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Family", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.diskPromptFieldSet) + { + writer.WriteAttributeString("DiskPrompt", this.diskPromptField); + } + if (this.mediaSrcPropFieldSet) + { + writer.WriteAttributeString("MediaSrcProp", this.mediaSrcPropField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sequenceStartFieldSet) + { + writer.WriteAttributeString("SequenceStart", this.sequenceStartField.ToString(CultureInfo.InvariantCulture)); + } + if (this.volumeLabelFieldSet) + { + writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("DiskPrompt" == name)) + { + this.diskPromptField = value; + this.diskPromptFieldSet = true; + } + if (("MediaSrcProp" == name)) + { + this.mediaSrcPropField = value; + this.mediaSrcPropFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SequenceStart" == name)) + { + this.sequenceStartField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceStartFieldSet = true; + } + if (("VolumeLabel" == name)) + { + this.volumeLabelField = value; + this.volumeLabelFieldSet = true; + } + } + } + + /// + /// Contains information about the upgraded images of the product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UpgradeImage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private string sourcePatchField; + + private bool sourcePatchFieldSet; + + private string srcPatchField; + + private bool srcPatchFieldSet; + + private ISchemaElement parentElement; + + public UpgradeImage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(TargetImage))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UpgradeFile))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier to connect target images with upgraded image. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Full path to location of msi file for upgraded image. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Modified copy of the upgraded installation database that contains additional authoring specific to patching. + /// + public string SourcePatch + { + get + { + return this.sourcePatchField; + } + set + { + this.sourcePatchFieldSet = true; + this.sourcePatchField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string srcPatch + { + get + { + return this.srcPatchField; + } + set + { + this.srcPatchFieldSet = true; + this.srcPatchField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("TargetImage" == childName)) + { + childValue = new TargetImage(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("UpgradeFile" == childName)) + { + childValue = new UpgradeFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UpgradeImage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.sourcePatchFieldSet) + { + writer.WriteAttributeString("SourcePatch", this.sourcePatchField); + } + if (this.srcPatchFieldSet) + { + writer.WriteAttributeString("srcPatch", this.srcPatchField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("SourcePatch" == name)) + { + this.sourcePatchField = value; + this.sourcePatchFieldSet = true; + } + if (("srcPatch" == name)) + { + this.srcPatchField = value; + this.srcPatchFieldSet = true; + } + } + } + + /// + /// Contains information about the target images of the product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetImage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private int orderField; + + private bool orderFieldSet; + + private string validationField; + + private bool validationFieldSet; + + private YesNoType ignoreMissingFilesField; + + private bool ignoreMissingFilesFieldSet; + + private ISchemaElement parentElement; + + public TargetImage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TargetFile))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the target image. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Full path to the location of the msi file for the target image. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Relative order of the target image. + /// + public int Order + { + get + { + return this.orderField; + } + set + { + this.orderFieldSet = true; + this.orderField = value; + } + } + + /// + /// Product checking to avoid applying irrelevant transforms. + /// + public string Validation + { + get + { + return this.validationField; + } + set + { + this.validationFieldSet = true; + this.validationField = value; + } + } + + /// + /// Files missing from the target image are ignored by the installer. + /// + public YesNoType IgnoreMissingFiles + { + get + { + return this.ignoreMissingFilesField; + } + set + { + this.ignoreMissingFilesFieldSet = true; + this.ignoreMissingFilesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("TargetFile" == childName)) + { + childValue = new TargetFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetImage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.orderFieldSet) + { + writer.WriteAttributeString("Order", this.orderField.ToString(CultureInfo.InvariantCulture)); + } + if (this.validationFieldSet) + { + writer.WriteAttributeString("Validation", this.validationField); + } + if (this.ignoreMissingFilesFieldSet) + { + if ((this.ignoreMissingFilesField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreMissingFiles", "no"); + } + if ((this.ignoreMissingFilesField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreMissingFiles", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("Order" == name)) + { + this.orderField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.orderFieldSet = true; + } + if (("Validation" == name)) + { + this.validationField = value; + this.validationFieldSet = true; + } + if (("IgnoreMissingFiles" == name)) + { + this.ignoreMissingFilesField = Enums.ParseYesNoType(value); + this.ignoreMissingFilesFieldSet = true; + } + } + } + + /// + /// Information about specific files in a target image. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public TargetFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SymbolPath))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreRange))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectRange))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("IgnoreRange" == childName)) + { + childValue = new IgnoreRange(); + } + if (("ProtectRange" == childName)) + { + childValue = new ProtectRange(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Specifies part of a file that is to be ignored during patching. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IgnoreRange : ISchemaElement, ISetAttributes + { + + private int offsetField; + + private bool offsetFieldSet; + + private int lengthField; + + private bool lengthFieldSet; + + private ISchemaElement parentElement; + + /// + /// Offset of the start of the range. + /// + public int Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetFieldSet = true; + this.offsetField = value; + } + } + + /// + /// Length of the range. + /// + public int Length + { + get + { + return this.lengthField; + } + set + { + this.lengthFieldSet = true; + this.lengthField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IgnoreRange", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.offsetFieldSet) + { + writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); + } + if (this.lengthFieldSet) + { + writer.WriteAttributeString("Length", this.lengthField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Offset" == name)) + { + this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.offsetFieldSet = true; + } + if (("Length" == name)) + { + this.lengthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.lengthFieldSet = true; + } + } + } + + /// + /// Specifies part of a file that cannot be overwritten during patching. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProtectRange : ISchemaElement, ISetAttributes + { + + private int offsetField; + + private bool offsetFieldSet; + + private int lengthField; + + private bool lengthFieldSet; + + private ISchemaElement parentElement; + + /// + /// Offset of the start of the range. + /// + public int Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetFieldSet = true; + this.offsetField = value; + } + } + + /// + /// Length of the range. + /// + public int Length + { + get + { + return this.lengthField; + } + set + { + this.lengthFieldSet = true; + this.lengthField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProtectRange", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.offsetFieldSet) + { + writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); + } + if (this.lengthFieldSet) + { + writer.WriteAttributeString("Length", this.lengthField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Offset" == name)) + { + this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.offsetFieldSet = true; + } + if (("Length" == name)) + { + this.lengthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.lengthFieldSet = true; + } + } + } + + /// + /// Specifies a file to be protected. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProtectFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string fileField; + + private bool fileFieldSet; + + private ISchemaElement parentElement; + + public ProtectFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectRange))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProtectRange" == childName)) + { + childValue = new ProtectRange(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProtectFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + } + } + + /// + /// Contains information about specific files that are not part of a regular target image. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExternalFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string fileField; + + private bool fileFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private int orderField; + + private bool orderFieldSet; + + private ISchemaElement parentElement; + + public ExternalFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ProtectRange))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SymbolPath))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreRange))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Full path of the external file. + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Specifies the order of the external files to use when creating the patch. + /// + public int Order + { + get + { + return this.orderField; + } + set + { + this.orderFieldSet = true; + this.orderField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProtectRange" == childName)) + { + childValue = new ProtectRange(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("IgnoreRange" == childName)) + { + childValue = new IgnoreRange(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExternalFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.orderFieldSet) + { + writer.WriteAttributeString("Order", this.orderField.ToString(CultureInfo.InvariantCulture)); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("Order" == name)) + { + this.orderField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.orderFieldSet = true; + } + } + } + + /// + /// Specifies files to either ignore or to specify optional data about a file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UpgradeFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string fileField; + + private bool fileFieldSet; + + private YesNoType ignoreField; + + private bool ignoreFieldSet; + + private YesNoType allowIgnoreOnErrorField; + + private bool allowIgnoreOnErrorFieldSet; + + private YesNoType wholeFileField; + + private bool wholeFileFieldSet; + + private ISchemaElement parentElement; + + public UpgradeFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// If yes, the file is ignored during patching, and the next two attributes are ignored. + /// + public YesNoType Ignore + { + get + { + return this.ignoreField; + } + set + { + this.ignoreFieldSet = true; + this.ignoreField = value; + } + } + + /// + /// Specifies whether patching this file is vital. + /// + public YesNoType AllowIgnoreOnError + { + get + { + return this.allowIgnoreOnErrorField; + } + set + { + this.allowIgnoreOnErrorFieldSet = true; + this.allowIgnoreOnErrorField = value; + } + } + + /// + /// Whether the whole file should be installed, rather than creating a binary patch. + /// + public YesNoType WholeFile + { + get + { + return this.wholeFileField; + } + set + { + this.wholeFileFieldSet = true; + this.wholeFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UpgradeFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.ignoreFieldSet) + { + if ((this.ignoreField == YesNoType.no)) + { + writer.WriteAttributeString("Ignore", "no"); + } + if ((this.ignoreField == YesNoType.yes)) + { + writer.WriteAttributeString("Ignore", "yes"); + } + } + if (this.allowIgnoreOnErrorFieldSet) + { + if ((this.allowIgnoreOnErrorField == YesNoType.no)) + { + writer.WriteAttributeString("AllowIgnoreOnError", "no"); + } + if ((this.allowIgnoreOnErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowIgnoreOnError", "yes"); + } + } + if (this.wholeFileFieldSet) + { + if ((this.wholeFileField == YesNoType.no)) + { + writer.WriteAttributeString("WholeFile", "no"); + } + if ((this.wholeFileField == YesNoType.yes)) + { + writer.WriteAttributeString("WholeFile", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Ignore" == name)) + { + this.ignoreField = Enums.ParseYesNoType(value); + this.ignoreFieldSet = true; + } + if (("AllowIgnoreOnError" == name)) + { + this.allowIgnoreOnErrorField = Enums.ParseYesNoType(value); + this.allowIgnoreOnErrorFieldSet = true; + } + if (("WholeFile" == name)) + { + this.wholeFileField = Enums.ParseYesNoType(value); + this.wholeFileFieldSet = true; + } + } + } + + /// + /// A path to symbols. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SymbolPath : ISchemaElement, ISetAttributes + { + + private string pathField; + + private bool pathFieldSet; + + private ISchemaElement parentElement; + + /// + /// The path. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SymbolPath", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + } + } + + /// + /// Properties about the package to be placed in the Summary Information Stream. These are + /// visible from COM through the IStream interface, and these properties can be seen on the package in Explorer. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SummaryInformation : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType adminImageField; + + private bool adminImageFieldSet; + + private string commentsField; + + private bool commentsFieldSet; + + private YesNoType compressedField; + + private bool compressedFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private InstallPrivilegesType installPrivilegesField; + + private bool installPrivilegesFieldSet; + + private InstallScopeType installScopeField; + + private bool installScopeFieldSet; + + private int installerVersionField; + + private bool installerVersionFieldSet; + + private string keywordsField; + + private bool keywordsFieldSet; + + private string languagesField; + + private bool languagesFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string platformsField; + + private bool platformsFieldSet; + + private PlatformType platformField; + + private bool platformFieldSet; + + private YesNoDefaultType readOnlyField; + + private bool readOnlyFieldSet; + + private YesNoType shortNamesField; + + private bool shortNamesFieldSet; + + private string summaryCodepageField; + + private bool summaryCodepageFieldSet; + + private ISchemaElement parentElement; + + /// + /// The package code GUID for a product or merge module. + /// When compiling a product, this attribute should not be set in order to allow the package + /// code to be generated for each build. + /// When compiling a merge module, this attribute must be set to the modularization guid. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set to 'yes' if the source is an admin image. + /// + public YesNoType AdminImage + { + get + { + return this.adminImageField; + } + set + { + this.adminImageFieldSet = true; + this.adminImageField = value; + } + } + + /// + /// Optional comments for browsing. + /// + public string Comments + { + get + { + return this.commentsField; + } + set + { + this.commentsFieldSet = true; + this.commentsField = value; + } + } + + /// + /// Set to 'yes' to have compressed files in the source. + /// This attribute cannot be set for merge modules. + /// + public YesNoType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// The product full name or description. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Use this attribute to specify the priviliges required to install the package on Windows Vista and above. + /// + public InstallPrivilegesType InstallPrivileges + { + get + { + return this.installPrivilegesField; + } + set + { + this.installPrivilegesFieldSet = true; + this.installPrivilegesField = value; + } + } + + /// + /// Use this attribute to specify the installation scope of this package: per-machine or per-user. + /// + public InstallScopeType InstallScope + { + get + { + return this.installScopeField; + } + set + { + this.installScopeFieldSet = true; + this.installScopeField = value; + } + } + + /// + /// The minimum version of the Windows Installer required to install this package. Take the major version of the required Windows Installer + /// and multiply by a 100 then add the minor version of the Windows Installer. For example, "200" would represent Windows Installer 2.0 and + /// "405" would represent Windows Installer 4.5. For 64-bit Windows Installer packages, this property is set to 200 by default as + /// Windows Installer 2.0 was the first version to support 64-bit packages. + /// + public int InstallerVersion + { + get + { + return this.installerVersionField; + } + set + { + this.installerVersionFieldSet = true; + this.installerVersionField = value; + } + } + + /// + /// Optional keywords for browsing. + /// + public string Keywords + { + get + { + return this.keywordsField; + } + set + { + this.keywordsFieldSet = true; + this.keywordsField = value; + } + } + + /// + /// The list of language IDs (LCIDs) supported in the package. + /// + public string Languages + { + get + { + return this.languagesField; + } + set + { + this.languagesFieldSet = true; + this.languagesField = value; + } + } + + /// + /// The vendor releasing the package. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The list of platforms supported by the package. This attribute has been deprecated. + /// Specify the -arch switch at the candle.exe command line or the InstallerPlatform + /// property in a .wixproj MSBuild project. + /// + public string Platforms + { + get + { + return this.platformsField; + } + set + { + this.platformsFieldSet = true; + this.platformsField = value; + } + } + + /// + /// The platform supported by the package. Use of this attribute is discouraged; instead, + /// specify the -arch switch at the candle.exe command line or the InstallerPlatform + /// property in a .wixproj MSBuild project. + /// + public PlatformType Platform + { + get + { + return this.platformField; + } + set + { + this.platformFieldSet = true; + this.platformField = value; + } + } + + /// + /// The value of this attribute conveys whether the package should be opened as read-only. + /// A database editing tool should not modify a read-only enforced database and should + /// issue a warning at attempts to modify a read-only recommended database. + /// + public YesNoDefaultType ReadOnly + { + get + { + return this.readOnlyField; + } + set + { + this.readOnlyFieldSet = true; + this.readOnlyField = value; + } + } + + /// + /// Set to 'yes' to have short filenames in the source. + /// + public YesNoType ShortNames + { + get + { + return this.shortNamesField; + } + set + { + this.shortNamesFieldSet = true; + this.shortNamesField = value; + } + } + + /// + /// The code page integer value or web name for summary info strings only. See remarks for more information. + /// + public string SummaryCodepage + { + get + { + return this.summaryCodepageField; + } + set + { + this.summaryCodepageFieldSet = true; + this.summaryCodepageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a InstallPrivilegesType from a string. + /// + public static InstallPrivilegesType ParseInstallPrivilegesType(string value) + { + InstallPrivilegesType parsedValue; + SummaryInformation.TryParseInstallPrivilegesType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallPrivilegesType from a string. + /// + public static bool TryParseInstallPrivilegesType(string value, out InstallPrivilegesType parsedValue) + { + parsedValue = InstallPrivilegesType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("limited" == value)) + { + parsedValue = InstallPrivilegesType.limited; + } + else + { + if (("elevated" == value)) + { + parsedValue = InstallPrivilegesType.elevated; + } + else + { + parsedValue = InstallPrivilegesType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a InstallScopeType from a string. + /// + public static InstallScopeType ParseInstallScopeType(string value) + { + InstallScopeType parsedValue; + SummaryInformation.TryParseInstallScopeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallScopeType from a string. + /// + public static bool TryParseInstallScopeType(string value, out InstallScopeType parsedValue) + { + parsedValue = InstallScopeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("perMachine" == value)) + { + parsedValue = InstallScopeType.perMachine; + } + else + { + if (("perUser" == value)) + { + parsedValue = InstallScopeType.perUser; + } + else + { + parsedValue = InstallScopeType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a PlatformType from a string. + /// + public static PlatformType ParsePlatformType(string value) + { + PlatformType parsedValue; + SummaryInformation.TryParsePlatformType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PlatformType from a string. + /// + public static bool TryParsePlatformType(string value, out PlatformType parsedValue) + { + parsedValue = PlatformType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("x86" == value)) + { + parsedValue = PlatformType.x86; + } + else + { + if (("ia64" == value)) + { + parsedValue = PlatformType.ia64; + } + else + { + if (("x64" == value)) + { + parsedValue = PlatformType.x64; + } + else + { + if (("arm" == value)) + { + parsedValue = PlatformType.arm; + } + else + { + if (("intel" == value)) + { + parsedValue = PlatformType.intel; + } + else + { + if (("intel64" == value)) + { + parsedValue = PlatformType.intel64; + } + else + { + parsedValue = PlatformType.IllegalValue; + return false; + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SummaryInformation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.adminImageFieldSet) + { + if ((this.adminImageField == YesNoType.no)) + { + writer.WriteAttributeString("AdminImage", "no"); + } + if ((this.adminImageField == YesNoType.yes)) + { + writer.WriteAttributeString("AdminImage", "yes"); + } + } + if (this.commentsFieldSet) + { + writer.WriteAttributeString("Comments", this.commentsField); + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.installPrivilegesFieldSet) + { + if ((this.installPrivilegesField == InstallPrivilegesType.limited)) + { + writer.WriteAttributeString("InstallPrivileges", "limited"); + } + if ((this.installPrivilegesField == InstallPrivilegesType.elevated)) + { + writer.WriteAttributeString("InstallPrivileges", "elevated"); + } + } + if (this.installScopeFieldSet) + { + if ((this.installScopeField == InstallScopeType.perMachine)) + { + writer.WriteAttributeString("InstallScope", "perMachine"); + } + if ((this.installScopeField == InstallScopeType.perUser)) + { + writer.WriteAttributeString("InstallScope", "perUser"); + } + } + if (this.installerVersionFieldSet) + { + writer.WriteAttributeString("InstallerVersion", this.installerVersionField.ToString(CultureInfo.InvariantCulture)); + } + if (this.keywordsFieldSet) + { + writer.WriteAttributeString("Keywords", this.keywordsField); + } + if (this.languagesFieldSet) + { + writer.WriteAttributeString("Languages", this.languagesField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.platformsFieldSet) + { + writer.WriteAttributeString("Platforms", this.platformsField); + } + if (this.platformFieldSet) + { + if ((this.platformField == PlatformType.x86)) + { + writer.WriteAttributeString("Platform", "x86"); + } + if ((this.platformField == PlatformType.ia64)) + { + writer.WriteAttributeString("Platform", "ia64"); + } + if ((this.platformField == PlatformType.x64)) + { + writer.WriteAttributeString("Platform", "x64"); + } + if ((this.platformField == PlatformType.arm)) + { + writer.WriteAttributeString("Platform", "arm"); + } + if ((this.platformField == PlatformType.intel)) + { + writer.WriteAttributeString("Platform", "intel"); + } + if ((this.platformField == PlatformType.intel64)) + { + writer.WriteAttributeString("Platform", "intel64"); + } + } + if (this.readOnlyFieldSet) + { + if ((this.readOnlyField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ReadOnly", "default"); + } + if ((this.readOnlyField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ReadOnly", "no"); + } + if ((this.readOnlyField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ReadOnly", "yes"); + } + } + if (this.shortNamesFieldSet) + { + if ((this.shortNamesField == YesNoType.no)) + { + writer.WriteAttributeString("ShortNames", "no"); + } + if ((this.shortNamesField == YesNoType.yes)) + { + writer.WriteAttributeString("ShortNames", "yes"); + } + } + if (this.summaryCodepageFieldSet) + { + writer.WriteAttributeString("SummaryCodepage", this.summaryCodepageField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AdminImage" == name)) + { + this.adminImageField = Enums.ParseYesNoType(value); + this.adminImageFieldSet = true; + } + if (("Comments" == name)) + { + this.commentsField = value; + this.commentsFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoType(value); + this.compressedFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("InstallPrivileges" == name)) + { + this.installPrivilegesField = SummaryInformation.ParseInstallPrivilegesType(value); + this.installPrivilegesFieldSet = true; + } + if (("InstallScope" == name)) + { + this.installScopeField = SummaryInformation.ParseInstallScopeType(value); + this.installScopeFieldSet = true; + } + if (("InstallerVersion" == name)) + { + this.installerVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.installerVersionFieldSet = true; + } + if (("Keywords" == name)) + { + this.keywordsField = value; + this.keywordsFieldSet = true; + } + if (("Languages" == name)) + { + this.languagesField = value; + this.languagesFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Platforms" == name)) + { + this.platformsField = value; + this.platformsFieldSet = true; + } + if (("Platform" == name)) + { + this.platformField = SummaryInformation.ParsePlatformType(value); + this.platformFieldSet = true; + } + if (("ReadOnly" == name)) + { + this.readOnlyField = Enums.ParseYesNoDefaultType(value); + this.readOnlyFieldSet = true; + } + if (("ShortNames" == name)) + { + this.shortNamesField = Enums.ParseYesNoType(value); + this.shortNamesFieldSet = true; + } + if (("SummaryCodepage" == name)) + { + this.summaryCodepageField = value; + this.summaryCodepageFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallPrivilegesType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set this value to declare that the package does not require elevated privileges to install. + /// + limited, + + /// + /// Set this value to declare that the package requires elevated privileges to install. + /// This is the default value. + /// + elevated, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallScopeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set this value to declare that the package is a per-machine installation and requires elevated privileges to install. + /// Sets the ALLUSERS property to 1. + /// + perMachine, + + /// + /// Set this value to declare that the package is a per-user installation and does not require elevated privileges to install. + /// Sets the package's InstallPrivileges attribute to "limited." + /// + perUser, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum PlatformType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set this value to declare that the package is an x86 package. + /// + x86, + + /// + /// Set this value to declare that the package is an ia64 package. + /// This value requires that the InstallerVersion property be set to 200 or greater. + /// + ia64, + + /// + /// Set this value to declare that the package is an x64 package. + /// This value requires that the InstallerVersion property be set to 200 or greater. + /// + x64, + + /// + /// Set this value to declare that the package is an arm package. + /// This value requires that the InstallerVersion property be set to 500 or greater. + /// + arm, + + /// + /// This value has been deprecated. Use "x86" instead. + /// + intel, + + /// + /// This value has been deprecated. Use "ia64" instead. + /// + intel64, + } + } + + /// + /// The MsiAssemblyName table specifies the schema for the elements of a strong assembly cache name for a .NET Framework or Win32 assembly. + /// Consider using the Assembly attribute on File element to have the toolset populate these entries automatically. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AssemblyName : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name of the attribute associated with the value specified in the Value column. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Value associated with the name specified in the Name column. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AssemblyName", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Identifies the possible signer certificates used to digitally sign patches. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchCertificates : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public PatchCertificates() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalCertificate" == childName)) + { + childValue = new DigitalCertificate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchCertificates", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Digital signatures that identify installation packages in a multi-product transaction. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PackageCertificates : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public PackageCertificates() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalCertificate" == childName)) + { + childValue = new DigitalCertificate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PackageCertificates", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Adds a digital certificate. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DigitalCertificate : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for a certificate file. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The path to the certificate file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DigitalCertificate", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Reference to a DigitalCertificate element. This will force the entire referenced Fragment's contents + /// to be included in the installer database. This is only used for references when patching. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DigitalCertificateRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DigitalCertificateRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Adds a digital signature. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DigitalSignature : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + public DigitalSignature() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The path to signature's optional hash file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalCertificate" == childName)) + { + childValue = new DigitalCertificate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DigitalSignature", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Adds a system file protection update catalog file + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SFPCatalog : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string nameField; + + private bool nameFieldSet; + + private string dependencyField; + + private bool dependencyFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + public SFPCatalog() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPFile))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Filename for catalog file when installed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Used to define dependency outside of the package. + /// + public string Dependency + { + get + { + return this.dependencyField; + } + set + { + this.dependencyFieldSet = true; + this.dependencyField = value; + } + } + + /// + /// Path to catalog file in binary. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("SFPFile" == childName)) + { + childValue = new SFPFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SFPCatalog", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.dependencyFieldSet) + { + writer.WriteAttributeString("Dependency", this.dependencyField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Dependency" == name)) + { + this.dependencyField = value; + this.dependencyFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Provides a many-to-many mapping from the SFPCatalog table to the File table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SFPFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key to File Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SFPFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Adds or removes .ini file entries. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IniFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sectionField; + + private bool sectionFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for ini file. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The type of modification to be made. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Name of a property, the value of which is the full path of the folder containing the .ini file. Can be name of a directory in the Directory table, a property set by the AppSearch table, or any other property representing a full path. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// The localizable .ini file key within the section. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short name. + /// This attribute's value may now be either a short or long name. + /// If a short name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short name. + /// However, if this name collides with another file or you wish to manually specify + /// the short name, then the ShortName attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The localizable .ini file section. + /// + public string Section + { + get + { + return this.sectionField; + } + set + { + this.sectionFieldSet = true; + this.sectionField = value; + } + } + + /// + /// The short name of the in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short names + /// or the user wants to manually specify the short name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// The localizable value to be written or deleted. This attribute must be set if + /// the Action attribute's value is "addLine", "addTag", or "createLine". + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + IniFile.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("addLine" == value)) + { + parsedValue = ActionType.addLine; + } + else + { + if (("addTag" == value)) + { + parsedValue = ActionType.addTag; + } + else + { + if (("createLine" == value)) + { + parsedValue = ActionType.createLine; + } + else + { + if (("removeLine" == value)) + { + parsedValue = ActionType.removeLine; + } + else + { + if (("removeTag" == value)) + { + parsedValue = ActionType.removeTag; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IniFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.addLine)) + { + writer.WriteAttributeString("Action", "addLine"); + } + if ((this.actionField == ActionType.addTag)) + { + writer.WriteAttributeString("Action", "addTag"); + } + if ((this.actionField == ActionType.createLine)) + { + writer.WriteAttributeString("Action", "createLine"); + } + if ((this.actionField == ActionType.removeLine)) + { + writer.WriteAttributeString("Action", "removeLine"); + } + if ((this.actionField == ActionType.removeTag)) + { + writer.WriteAttributeString("Action", "removeTag"); + } + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sectionFieldSet) + { + writer.WriteAttributeString("Section", this.sectionField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = IniFile.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Section" == name)) + { + this.sectionField = value; + this.sectionFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates or updates an .ini entry. + /// + addLine, + + /// + /// Creates a new entry or appends a new comma-separated value to an existing entry. + /// + addTag, + + /// + /// Creates an .ini entry only if the entry does no already exist. + /// + createLine, + + /// + /// Removes an .ini entry. + /// + removeLine, + + /// + /// Removes a tag from an .ini entry. + /// + removeTag, + } + } + + /// + /// ODBCDataSource for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ODBCDataSource : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string driverNameField; + + private bool driverNameFieldSet; + + private RegistrationType registrationField; + + private bool registrationFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private ISchemaElement parentElement; + + public ODBCDataSource() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier of the data source. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the data source. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Required if not found as child of ODBCDriver element + /// + public string DriverName + { + get + { + return this.driverNameField; + } + set + { + this.driverNameFieldSet = true; + this.driverNameField = value; + } + } + + /// + /// Scope for which the data source should be registered. + /// + public RegistrationType Registration + { + get + { + return this.registrationField; + } + set + { + this.registrationFieldSet = true; + this.registrationField = value; + } + } + + /// + /// Set 'yes' to force this file to be key path for parent Component + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Property" == childName)) + { + childValue = new Property(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a RegistrationType from a string. + /// + public static RegistrationType ParseRegistrationType(string value) + { + RegistrationType parsedValue; + ODBCDataSource.TryParseRegistrationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RegistrationType from a string. + /// + public static bool TryParseRegistrationType(string value, out RegistrationType parsedValue) + { + parsedValue = RegistrationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("machine" == value)) + { + parsedValue = RegistrationType.machine; + } + else + { + if (("user" == value)) + { + parsedValue = RegistrationType.user; + } + else + { + parsedValue = RegistrationType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ODBCDataSource", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.driverNameFieldSet) + { + writer.WriteAttributeString("DriverName", this.driverNameField); + } + if (this.registrationFieldSet) + { + if ((this.registrationField == RegistrationType.machine)) + { + writer.WriteAttributeString("Registration", "machine"); + } + if ((this.registrationField == RegistrationType.user)) + { + writer.WriteAttributeString("Registration", "user"); + } + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DriverName" == name)) + { + this.driverNameField = value; + this.driverNameFieldSet = true; + } + if (("Registration" == name)) + { + this.registrationField = ODBCDataSource.ParseRegistrationType(value); + this.registrationFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum RegistrationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Data source is registered per machine. + /// + machine, + + /// + /// Data source is registered per user. + /// + user, + } + } + + /// + /// ODBCDriver for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ODBCDriver : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string setupFileField; + + private bool setupFileFieldSet; + + private ISchemaElement parentElement; + + public ODBCDriver() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ODBCDataSource))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the driver. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the driver. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Required if not found as child of File element + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Required if not found as child of File element or different from File attribute above + /// + public string SetupFile + { + get + { + return this.setupFileField; + } + set + { + this.setupFileFieldSet = true; + this.setupFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("ODBCDataSource" == childName)) + { + childValue = new ODBCDataSource(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ODBCDriver", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.setupFileFieldSet) + { + writer.WriteAttributeString("SetupFile", this.setupFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("SetupFile" == name)) + { + this.setupFileField = value; + this.setupFileFieldSet = true; + } + } + } + + /// + /// ODBCTranslator for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ODBCTranslator : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string setupFileField; + + private bool setupFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the translator. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the translator. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Required if not found as child of File element + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Required if not found as child of File element or different from File attribute above + /// + public string SetupFile + { + get + { + return this.setupFileField; + } + set + { + this.setupFileFieldSet = true; + this.setupFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ODBCTranslator", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.setupFileFieldSet) + { + writer.WriteAttributeString("SetupFile", this.setupFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("SetupFile" == name)) + { + this.setupFileField = value; + this.setupFileFieldSet = true; + } + } + } + + /// + /// Searches for file and assigns to fullpath value of parent Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private int minSizeField; + + private bool minSizeFieldSet; + + private int maxSizeField; + + private bool maxSizeFieldSet; + + private string minVersionField; + + private bool minVersionFieldSet; + + private string maxVersionField; + + private bool maxVersionFieldSet; + + private DateTime minDateField; + + private bool minDateFieldSet; + + private DateTime maxDateField; + + private bool maxDateFieldSet; + + private string languagesField; + + private bool languagesFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for the file search and external key into the Signature table. If this attribute value is not set then the parent element's @Id attribute is used. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// This attribute's value may now be either a short or long file name. + /// If a short file name is specified, the ShortName attribute may not be specified. + /// If you wish to manually specify the short file name, then the ShortName + /// attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// There is a Windows Installer bug which prevents the FileSearch functionality from working + /// if both a short and long file name are specified. Since the Name attribute allows either + /// a short or long name to be specified, it is the only attribute related to file names which + /// should be specified. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// The minimum size of the file. + /// + public int MinSize + { + get + { + return this.minSizeField; + } + set + { + this.minSizeFieldSet = true; + this.minSizeField = value; + } + } + + /// + /// The maximum size of the file. + /// + public int MaxSize + { + get + { + return this.maxSizeField; + } + set + { + this.maxSizeFieldSet = true; + this.maxSizeField = value; + } + } + + /// + /// The minimum version of the file. + /// + public string MinVersion + { + get + { + return this.minVersionField; + } + set + { + this.minVersionFieldSet = true; + this.minVersionField = value; + } + } + + /// + /// The maximum version of the file. + /// + public string MaxVersion + { + get + { + return this.maxVersionField; + } + set + { + this.maxVersionFieldSet = true; + this.maxVersionField = value; + } + } + + /// + /// The minimum modification date and time of the file. Formatted as YYYY-MM-DDTHH:mm:ss, where YYYY is the year, MM is month, DD is day, 'T' is literal, HH is hour, mm is minute and ss is second. + /// + public DateTime MinDate + { + get + { + return this.minDateField; + } + set + { + this.minDateFieldSet = true; + this.minDateField = value; + } + } + + /// + /// The maximum modification date and time of the file. Formatted as YYYY-MM-DDTHH:mm:ss, where YYYY is the year, MM is month, DD is day, 'T' is literal, HH is hour, mm is minute and ss is second. + /// + public DateTime MaxDate + { + get + { + return this.maxDateField; + } + set + { + this.maxDateFieldSet = true; + this.maxDateField = value; + } + } + + /// + /// The languages supported by the file. + /// + public string Languages + { + get + { + return this.languagesField; + } + set + { + this.languagesFieldSet = true; + this.languagesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.minSizeFieldSet) + { + writer.WriteAttributeString("MinSize", this.minSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maxSizeFieldSet) + { + writer.WriteAttributeString("MaxSize", this.maxSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.minVersionFieldSet) + { + writer.WriteAttributeString("MinVersion", this.minVersionField); + } + if (this.maxVersionFieldSet) + { + writer.WriteAttributeString("MaxVersion", this.maxVersionField); + } + if (this.minDateFieldSet) + { + writer.WriteAttributeString("MinDate", this.minDateField.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture.DateTimeFormat)); + } + if (this.maxDateFieldSet) + { + writer.WriteAttributeString("MaxDate", this.maxDateField.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture.DateTimeFormat)); + } + if (this.languagesFieldSet) + { + writer.WriteAttributeString("Languages", this.languagesField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("MinSize" == name)) + { + this.minSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.minSizeFieldSet = true; + } + if (("MaxSize" == name)) + { + this.maxSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxSizeFieldSet = true; + } + if (("MinVersion" == name)) + { + this.minVersionField = value; + this.minVersionFieldSet = true; + } + if (("MaxVersion" == name)) + { + this.maxVersionField = value; + this.maxVersionFieldSet = true; + } + if (("MinDate" == name)) + { + this.minDateField = Convert.ToDateTime(value, CultureInfo.InvariantCulture); + this.minDateFieldSet = true; + } + if (("MaxDate" == name)) + { + this.maxDateField = Convert.ToDateTime(value, CultureInfo.InvariantCulture); + this.maxDateFieldSet = true; + } + if (("Languages" == name)) + { + this.languagesField = value; + this.languagesFieldSet = true; + } + } + } + + /// + /// References an existing FileSearch element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specify the Id to the FileSearch to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Searches for directory and assigns to value of parent Property. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DirectorySearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private int depthField; + + private bool depthFieldSet; + + private YesNoType assignToPropertyField; + + private bool assignToPropertyFieldSet; + + private ISchemaElement parentElement; + + public DirectorySearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the directory search. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path on the user's system. Either absolute, or relative to containing directories. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Depth below the path that the installer searches for the file or directory specified by the search. See remarks for more information. + /// + public int Depth + { + get + { + return this.depthField; + } + set + { + this.depthFieldSet = true; + this.depthField = value; + } + } + + /// + /// Set the value of the outer Property to the result of this search. See remarks for more information. + /// + public YesNoType AssignToProperty + { + get + { + return this.assignToPropertyField; + } + set + { + this.assignToPropertyFieldSet = true; + this.assignToPropertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.depthFieldSet) + { + writer.WriteAttributeString("Depth", this.depthField.ToString(CultureInfo.InvariantCulture)); + } + if (this.assignToPropertyFieldSet) + { + if ((this.assignToPropertyField == YesNoType.no)) + { + writer.WriteAttributeString("AssignToProperty", "no"); + } + if ((this.assignToPropertyField == YesNoType.yes)) + { + writer.WriteAttributeString("AssignToProperty", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Depth" == name)) + { + this.depthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.depthFieldSet = true; + } + if (("AssignToProperty" == name)) + { + this.assignToPropertyField = Enums.ParseYesNoType(value); + this.assignToPropertyFieldSet = true; + } + } + } + + /// + /// References an existing DirectorySearch element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DirectorySearchRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string parentField; + + private bool parentFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ISchemaElement parentElement; + + public DirectorySearchRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Id of the search being referred to. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute is the signature of the parent directory of the file or directory in the Signature_ column. If this field is null, and the Path column does not expand to a full path, then all the fixed drives of the user's system are searched by using the Path. This field is a key into one of the following tables: the RegLocator, the IniLocator, the CompLocator, or the DrLocator tables. + /// + public string Parent + { + get + { + return this.parentField; + } + set + { + this.parentFieldSet = true; + this.parentField = value; + } + } + + /// + /// Path on the user's system. Either absolute, or relative to containing directories. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.parentFieldSet) + { + writer.WriteAttributeString("Parent", this.parentField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Parent" == name)) + { + this.parentField = value; + this.parentFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + } + } + + /// + /// Searches for file or directory and assigns to value of parent Property. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentSearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + public ComponentSearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The component ID of the component whose key path is to be used for the search. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// Must be file if last child is FileSearch element and must be directory if last child is DirectorySearch element. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + ComponentSearch.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = TypeType.directory; + } + else + { + if (("file" == value)) + { + parsedValue = TypeType.file; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.directory)) + { + writer.WriteAttributeString("Type", "directory"); + } + if ((this.typeField == TypeType.file)) + { + writer.WriteAttributeString("Type", "file"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = ComponentSearch.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The key path of the component is a directory. + /// + directory, + + /// + /// The key path of the component is a file. This is the default value. + /// + file, + } + } + + /// + /// Searches for file, directory or registry key and assigns to value of parent Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IniFileSearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private int fieldField; + + private bool fieldFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sectionField; + + private bool sectionFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + public IniFileSearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// External key into the Signature table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The field in the .ini line. If field is Null or 0, the entire line is read. + /// + public int Field + { + get + { + return this.fieldField; + } + set + { + this.fieldFieldSet = true; + this.fieldField = value; + } + } + + /// + /// The key value within the section. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short name. + /// This attribute's value may now be either a short or long name. + /// If a short name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short name. + /// However, if you wish to manually specify the short name, then the ShortName + /// attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The localizable .ini file section. + /// + public string Section + { + get + { + return this.sectionField; + } + set + { + this.sectionFieldSet = true; + this.sectionField = value; + } + } + + /// + /// The short name of the file in 8.3 format. + /// This attribute should only be set if the user wants to manually specify the short name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// Must be file if last child is FileSearch element and must be directory if last child is DirectorySearch element. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + IniFileSearch.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = TypeType.directory; + } + else + { + if (("file" == value)) + { + parsedValue = TypeType.file; + } + else + { + if (("raw" == value)) + { + parsedValue = TypeType.raw; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IniFileSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.fieldFieldSet) + { + writer.WriteAttributeString("Field", this.fieldField.ToString(CultureInfo.InvariantCulture)); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sectionFieldSet) + { + writer.WriteAttributeString("Section", this.sectionField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.directory)) + { + writer.WriteAttributeString("Type", "directory"); + } + if ((this.typeField == TypeType.file)) + { + writer.WriteAttributeString("Type", "file"); + } + if ((this.typeField == TypeType.raw)) + { + writer.WriteAttributeString("Type", "raw"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Field" == name)) + { + this.fieldField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.fieldFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Section" == name)) + { + this.sectionField = value; + this.sectionFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = IniFileSearch.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// A directory location. + /// + directory, + + /// + /// A file location. This is the default value. + /// + file, + + /// + /// A raw .ini value. + /// + raw, + } + } + + /// + /// Searches for file, directory or registry key and assigns to value of parent Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistrySearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private RootType rootField; + + private bool rootFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + public RegistrySearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Signature to be used for the file, directory or registry key being searched for. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Root key for the registry value. + /// + public RootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// Key for the registry value. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// Registry value name. If this value is null, then the value from the key's unnamed or default value, if any, is retrieved. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value must be 'file' if the child is a FileSearch element, and must be 'directory' if child is a DirectorySearch element. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. + /// The default value is based on the platform set by the -arch switch to candle.exe + /// or the InstallerPlatform property in a .wixproj MSBuild project: + /// For x86 and ARM, the default value is 'no'. + /// For x64 and IA64, the default value is 'yes'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a RootType from a string. + /// + public static RootType ParseRootType(string value) + { + RootType parsedValue; + RegistrySearch.TryParseRootType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RootType from a string. + /// + public static bool TryParseRootType(string value, out RootType parsedValue) + { + parsedValue = RootType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("HKCR" == value)) + { + parsedValue = RootType.HKCR; + } + else + { + if (("HKCU" == value)) + { + parsedValue = RootType.HKCU; + } + else + { + if (("HKLM" == value)) + { + parsedValue = RootType.HKLM; + } + else + { + if (("HKU" == value)) + { + parsedValue = RootType.HKU; + } + else + { + parsedValue = RootType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + RegistrySearch.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = TypeType.directory; + } + else + { + if (("file" == value)) + { + parsedValue = TypeType.file; + } + else + { + if (("raw" == value)) + { + parsedValue = TypeType.raw; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.directory)) + { + writer.WriteAttributeString("Type", "directory"); + } + if ((this.typeField == TypeType.file)) + { + writer.WriteAttributeString("Type", "file"); + } + if ((this.typeField == TypeType.raw)) + { + writer.WriteAttributeString("Type", "raw"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = RegistrySearch.ParseRootType(value); + this.rootFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = RegistrySearch.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum RootType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// HKEY_CLASSES_ROOT + /// + HKCR, + + /// + /// HKEY_CURRENT_USER + /// + HKCU, + + /// + /// HKEY_LOCAL_MACHINE + /// + HKLM, + + /// + /// HKEY_USERS + /// + HKU, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The registry value contains the path to a directory. + /// + directory, + + /// + /// The registry value contains the path to a file. To return the full file path you must add a FileSearch element as a child of this element; otherwise, the parent directory of the file path is returned. + /// + file, + + /// + /// Sets the raw value from the registry value. Please note that this value will contain a prefix as follows: + /// + raw, + } + } + + /// + /// References an existing RegistrySearch element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistrySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specify the Id of the RegistrySearch to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearchRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Sets the parent of a nested DirectorySearch element to CCP_DRIVE. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComplianceDrive : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public ComplianceDrive() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComplianceDrive", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Adds a row to the CCPSearch table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComplianceCheck : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public ComplianceCheck() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComplianceDrive))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComponentSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(IniFileSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearch))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ComplianceDrive" == childName)) + { + childValue = new ComplianceDrive(); + } + if (("ComponentSearch" == childName)) + { + childValue = new ComponentSearch(); + } + if (("RegistrySearch" == childName)) + { + childValue = new RegistrySearch(); + } + if (("IniFileSearch" == childName)) + { + childValue = new IniFileSearch(); + } + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComplianceCheck", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Property value for a Package or Module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Property : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private YesNoType complianceCheckField; + + private bool complianceCheckFieldSet; + + private YesNoType adminField; + + private bool adminFieldSet; + + private YesNoType secureField; + + private bool secureFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType suppressModularizationField; + + private bool suppressModularizationFieldSet; + + private ISchemaElement parentElement; + + public Property() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComplianceDrive))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComponentSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearchRef))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(IniFileSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearchRef))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ProductSearch))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for Property. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets a default value for the property. The value will be overwritten if the Property is used for a search. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Adds a row to the CCPSearch table. This attribute is only valid when this Property contains a search element. + /// + public YesNoType ComplianceCheck + { + get + { + return this.complianceCheckField; + } + set + { + this.complianceCheckFieldSet = true; + this.complianceCheckField = value; + } + } + + /// + /// Denotes that the Property is saved during + /// + public YesNoType Admin + { + get + { + return this.adminField; + } + set + { + this.adminFieldSet = true; + this.adminField = value; + } + } + + /// + /// Denotes that the Property can be passed to the server side when doing a managed installation with elevated privileges. See the + /// + public YesNoType Secure + { + get + { + return this.secureField; + } + set + { + this.secureFieldSet = true; + this.secureField = value; + } + } + + /// + /// Denotes that the Property is not logged during installation. See the + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Use to suppress modularization of this property identifier in merge modules. + /// Using this functionality is strongly discouraged; it should only be + /// necessary as a workaround of last resort in rare scenarios. + /// + public YesNoType SuppressModularization + { + get + { + return this.suppressModularizationField; + } + set + { + this.suppressModularizationFieldSet = true; + this.suppressModularizationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ComplianceDrive" == childName)) + { + childValue = new ComplianceDrive(); + } + if (("ComponentSearch" == childName)) + { + childValue = new ComponentSearch(); + } + if (("RegistrySearch" == childName)) + { + childValue = new RegistrySearch(); + } + if (("RegistrySearchRef" == childName)) + { + childValue = new RegistrySearchRef(); + } + if (("IniFileSearch" == childName)) + { + childValue = new IniFileSearch(); + } + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("ProductSearch" == childName)) + { + childValue = new ProductSearch(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Property", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.complianceCheckFieldSet) + { + if ((this.complianceCheckField == YesNoType.no)) + { + writer.WriteAttributeString("ComplianceCheck", "no"); + } + if ((this.complianceCheckField == YesNoType.yes)) + { + writer.WriteAttributeString("ComplianceCheck", "yes"); + } + } + if (this.adminFieldSet) + { + if ((this.adminField == YesNoType.no)) + { + writer.WriteAttributeString("Admin", "no"); + } + if ((this.adminField == YesNoType.yes)) + { + writer.WriteAttributeString("Admin", "yes"); + } + } + if (this.secureFieldSet) + { + if ((this.secureField == YesNoType.no)) + { + writer.WriteAttributeString("Secure", "no"); + } + if ((this.secureField == YesNoType.yes)) + { + writer.WriteAttributeString("Secure", "yes"); + } + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.suppressModularizationFieldSet) + { + if ((this.suppressModularizationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressModularization", "no"); + } + if ((this.suppressModularizationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressModularization", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("ComplianceCheck" == name)) + { + this.complianceCheckField = Enums.ParseYesNoType(value); + this.complianceCheckFieldSet = true; + } + if (("Admin" == name)) + { + this.adminField = Enums.ParseYesNoType(value); + this.adminFieldSet = true; + } + if (("Secure" == name)) + { + this.secureField = Enums.ParseYesNoType(value); + this.secureFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("SuppressModularization" == name)) + { + this.suppressModularizationField = Enums.ParseYesNoType(value); + this.suppressModularizationFieldSet = true; + } + } + } + + /// + /// Reference to a Property value. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PropertyRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier of Property to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PropertyRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Shortcut, default target is parent File, CreateFolder, or Component's Directory + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Shortcut : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string argumentsField; + + private bool argumentsFieldSet; + + private int hotkeyField; + + private bool hotkeyFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private ShowType showField; + + private bool showFieldSet; + + private string workingDirectoryField; + + private bool workingDirectoryFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string displayResourceDllField; + + private bool displayResourceDllFieldSet; + + private int displayResourceIdField; + + private bool displayResourceIdFieldSet; + + private string descriptionResourceDllField; + + private bool descriptionResourceDllFieldSet; + + private int descriptionResourceIdField; + + private bool descriptionResourceIdFieldSet; + + private ISchemaElement parentElement; + + public Shortcut() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ShortcutProperty))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the shortcut. This value will serve as the primary key for the row. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Identifier reference to Directory element where shortcut is to be created. When nested under a Component element, this attribute's value will default to the parent directory. Otherwise, this attribute is required. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short name. + /// This attribute's value may now be either a short or long name. + /// If a short name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short name. + /// However, if this name collides with another shortcut or you wish to manually specify + /// the short name, then the ShortName attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short name of the shortcut in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short names + /// or the user wants to manually specify the short name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// This attribute can only be set if this Shortcut element is nested under a Component element. + /// When nested under a Component element, this attribute's value will default to the parent directory. + /// This attribute's value is the target for a non-advertised shortcut. + /// This attribute is not valid for advertised shortcuts. + /// If you specify this value, its value should be a property identifier enclosed by square brackets ([ ]), that is expanded into the file or a folder pointed to by the shortcut. + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// The localizable description for the shortcut. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// The command-line arguments for the shortcut. Note that the resolution of properties + /// in the Arguments field is limited. A property formatted as [Property] in this field can only be resolved if the + /// property already has the intended value when the component owning the shortcut is installed. For example, for the + /// argument "[#MyDoc.doc]" to resolve to the correct value, the same process must be installing the file MyDoc.doc and + /// the component that owns the shortcut. + /// + public string Arguments + { + get + { + return this.argumentsField; + } + set + { + this.argumentsFieldSet = true; + this.argumentsField = value; + } + } + + /// + /// The hotkey for the shortcut. The low-order byte contains the virtual-key code for + /// the key, and the high-order byte contains modifier flags. This must be a non-negative number. Authors of + /// installation packages are generally recommend not to set this option, because this can add duplicate hotkeys to a + /// users desktop. In addition, the practice of assigning hotkeys to shortcuts can be problematic for users using hotkeys + /// for accessibility. + /// + public int Hotkey + { + get + { + return this.hotkeyField; + } + set + { + this.hotkeyFieldSet = true; + this.hotkeyField = value; + } + } + + /// + /// Identifier reference to Icon element. The Icon identifier should have the same extension + /// as the file that it points at. For example, a shortcut to an executable (e.g. "my.exe") should reference an Icon with identifier + /// like "MyIcon.exe" + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// Identifier reference to Icon element. + /// + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + public ShowType Show + { + get + { + return this.showField; + } + set + { + this.showFieldSet = true; + this.showField = value; + } + } + + /// + /// Directory identifier (or Property identifier that resolves to a directory) that resolves + /// to the path of the working directory for the shortcut. + /// + public string WorkingDirectory + { + get + { + return this.workingDirectoryField; + } + set + { + this.workingDirectoryFieldSet = true; + this.workingDirectoryField = value; + } + } + + /// + /// Specifies if the shortcut should be advertised or not. Note that advertised shortcuts + /// always point at a particular application, identified by a ProductCode, and should not be shared between applications. + /// Advertised shortcuts only work for the most recently installed application, and are removed when that application is + /// removed. The default value is 'no'. + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// The Formatted string providing the full path to the language neutral file containing the MUI Manifest. Generally + /// authored using [#filekey] form. When this attribute is specified, the DisplayResourceId attribute must also + /// be provided. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not populated and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is populated and + /// the install is running on Vista and above, the value in the Name attribute is ignored. + /// + public string DisplayResourceDll + { + get + { + return this.displayResourceDllField; + } + set + { + this.displayResourceDllFieldSet = true; + this.displayResourceDllField = value; + } + } + + /// + /// The display name index for the shortcut. This must be a non-negative number. When this attribute is specified, the + /// DisplayResourceDll attribute must also be provided. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is specified and + /// the install is running on Vista and above, the value in the Name attribute is ignored. + /// + public int DisplayResourceId + { + get + { + return this.displayResourceIdField; + } + set + { + this.displayResourceIdFieldSet = true; + this.displayResourceIdField = value; + } + } + + /// + /// The Formatted string providing the full path to the language neutral file containing the MUI Manifest. Generally + /// authored using [#filekey] form. When this attribute is specified, the DescriptionResourceId attribute must also + /// be provided. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is provided and + /// the install is running on Vista and above, the value in the Name attribute is ignored. + /// + public string DescriptionResourceDll + { + get + { + return this.descriptionResourceDllField; + } + set + { + this.descriptionResourceDllFieldSet = true; + this.descriptionResourceDllField = value; + } + } + + /// + /// The description name index for the shortcut. This must be a non-negative number. When this attribute is specified, + /// the DescriptionResourceDll attribute must also be populated. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is populated and the + /// install is running on Vista and above, the value in the Name attribute is ignored. + /// + public int DescriptionResourceId + { + get + { + return this.descriptionResourceIdField; + } + set + { + this.descriptionResourceIdFieldSet = true; + this.descriptionResourceIdField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("ShortcutProperty" == childName)) + { + childValue = new ShortcutProperty(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ShowType from a string. + /// + public static ShowType ParseShowType(string value) + { + ShowType parsedValue; + Shortcut.TryParseShowType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ShowType from a string. + /// + public static bool TryParseShowType(string value, out ShowType parsedValue) + { + parsedValue = ShowType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("normal" == value)) + { + parsedValue = ShowType.normal; + } + else + { + if (("minimized" == value)) + { + parsedValue = ShowType.minimized; + } + else + { + if (("maximized" == value)) + { + parsedValue = ShowType.maximized; + } + else + { + parsedValue = ShowType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Shortcut", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.argumentsFieldSet) + { + writer.WriteAttributeString("Arguments", this.argumentsField); + } + if (this.hotkeyFieldSet) + { + writer.WriteAttributeString("Hotkey", this.hotkeyField.ToString(CultureInfo.InvariantCulture)); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + if (this.showFieldSet) + { + if ((this.showField == ShowType.normal)) + { + writer.WriteAttributeString("Show", "normal"); + } + if ((this.showField == ShowType.minimized)) + { + writer.WriteAttributeString("Show", "minimized"); + } + if ((this.showField == ShowType.maximized)) + { + writer.WriteAttributeString("Show", "maximized"); + } + } + if (this.workingDirectoryFieldSet) + { + writer.WriteAttributeString("WorkingDirectory", this.workingDirectoryField); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.displayResourceDllFieldSet) + { + writer.WriteAttributeString("DisplayResourceDll", this.displayResourceDllField); + } + if (this.displayResourceIdFieldSet) + { + writer.WriteAttributeString("DisplayResourceId", this.displayResourceIdField.ToString(CultureInfo.InvariantCulture)); + } + if (this.descriptionResourceDllFieldSet) + { + writer.WriteAttributeString("DescriptionResourceDll", this.descriptionResourceDllField); + } + if (this.descriptionResourceIdFieldSet) + { + writer.WriteAttributeString("DescriptionResourceId", this.descriptionResourceIdField.ToString(CultureInfo.InvariantCulture)); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Arguments" == name)) + { + this.argumentsField = value; + this.argumentsFieldSet = true; + } + if (("Hotkey" == name)) + { + this.hotkeyField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.hotkeyFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + if (("Show" == name)) + { + this.showField = Shortcut.ParseShowType(value); + this.showFieldSet = true; + } + if (("WorkingDirectory" == name)) + { + this.workingDirectoryField = value; + this.workingDirectoryFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("DisplayResourceDll" == name)) + { + this.displayResourceDllField = value; + this.displayResourceDllFieldSet = true; + } + if (("DisplayResourceId" == name)) + { + this.displayResourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.displayResourceIdFieldSet = true; + } + if (("DescriptionResourceDll" == name)) + { + this.descriptionResourceDllField = value; + this.descriptionResourceDllFieldSet = true; + } + if (("DescriptionResourceId" == name)) + { + this.descriptionResourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.descriptionResourceIdFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ShowType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The shortcut target will be displayed using the SW_SHOWNORMAL attribute. + /// + normal, + + /// + /// The shortcut target will be displayed using the SW_SHOWMINNOACTIVE attribute. + /// + minimized, + + /// + /// The shortcut target will be displayed using the SW_SHOWMAXIMIZED attribute. + /// + maximized, + } + } + + /// + /// Property values for a shortcut. This element's functionality is available starting with MSI 5.0. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ShortcutProperty : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for MsiShortcutProperty table. If omitted, a stable identifier will be generated from the parent shortcut identifier and Key value. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A formatted string identifying the property to be set. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// A formatted string supplying the value of the property. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ShortcutProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Sets ACLs on File, Registry, or CreateFolder. When under a Registry element, this cannot be used + /// if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Permission : ISchemaElement, ISetAttributes + { + + private string domainField; + + private bool domainFieldSet; + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType specificRightsAllField; + + private bool specificRightsAllFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType appendField; + + private bool appendFieldSet; + + private YesNoType executeField; + + private bool executeFieldSet; + + private YesNoType fileAllRightsField; + + private bool fileAllRightsFieldSet; + + private YesNoType writeField; + + private bool writeFieldSet; + + private YesNoType createSubkeysField; + + private bool createSubkeysFieldSet; + + private YesNoType enumerateSubkeysField; + + private bool enumerateSubkeysFieldSet; + + private YesNoType notifyField; + + private bool notifyFieldSet; + + private YesNoType createLinkField; + + private bool createLinkFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private ISchemaElement parentElement; + + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + /// + /// Bit mask for SPECIFIC_RIGHTS_ALL from WinNT.h (0x0000FFFF). + /// + public YesNoType SpecificRightsAll + { + get + { + return this.specificRightsAllField; + } + set + { + this.specificRightsAllFieldSet = true; + this.specificRightsAllField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType Append + { + get + { + return this.appendField; + } + set + { + this.appendFieldSet = true; + this.appendField = value; + } + } + + public YesNoType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + /// + /// Bit mask for FILE_ALL_ACCESS from WinNT.h (0x001F01FF). + /// + public YesNoType FileAllRights + { + get + { + return this.fileAllRightsField; + } + set + { + this.fileAllRightsFieldSet = true; + this.fileAllRightsField = value; + } + } + + public YesNoType Write + { + get + { + return this.writeField; + } + set + { + this.writeFieldSet = true; + this.writeField = value; + } + } + + public YesNoType CreateSubkeys + { + get + { + return this.createSubkeysField; + } + set + { + this.createSubkeysFieldSet = true; + this.createSubkeysField = value; + } + } + + public YesNoType EnumerateSubkeys + { + get + { + return this.enumerateSubkeysField; + } + set + { + this.enumerateSubkeysFieldSet = true; + this.enumerateSubkeysField = value; + } + } + + public YesNoType Notify + { + get + { + return this.notifyField; + } + set + { + this.notifyFieldSet = true; + this.notifyField = value; + } + } + + public YesNoType CreateLink + { + get + { + return this.createLinkField; + } + set + { + this.createLinkFieldSet = true; + this.createLinkField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Permission", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.specificRightsAllFieldSet) + { + if ((this.specificRightsAllField == YesNoType.no)) + { + writer.WriteAttributeString("SpecificRightsAll", "no"); + } + if ((this.specificRightsAllField == YesNoType.yes)) + { + writer.WriteAttributeString("SpecificRightsAll", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.appendFieldSet) + { + if ((this.appendField == YesNoType.no)) + { + writer.WriteAttributeString("Append", "no"); + } + if ((this.appendField == YesNoType.yes)) + { + writer.WriteAttributeString("Append", "yes"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == YesNoType.no)) + { + writer.WriteAttributeString("Execute", "no"); + } + if ((this.executeField == YesNoType.yes)) + { + writer.WriteAttributeString("Execute", "yes"); + } + } + if (this.fileAllRightsFieldSet) + { + if ((this.fileAllRightsField == YesNoType.no)) + { + writer.WriteAttributeString("FileAllRights", "no"); + } + if ((this.fileAllRightsField == YesNoType.yes)) + { + writer.WriteAttributeString("FileAllRights", "yes"); + } + } + if (this.writeFieldSet) + { + if ((this.writeField == YesNoType.no)) + { + writer.WriteAttributeString("Write", "no"); + } + if ((this.writeField == YesNoType.yes)) + { + writer.WriteAttributeString("Write", "yes"); + } + } + if (this.createSubkeysFieldSet) + { + if ((this.createSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("CreateSubkeys", "no"); + } + if ((this.createSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateSubkeys", "yes"); + } + } + if (this.enumerateSubkeysFieldSet) + { + if ((this.enumerateSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("EnumerateSubkeys", "no"); + } + if ((this.enumerateSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("EnumerateSubkeys", "yes"); + } + } + if (this.notifyFieldSet) + { + if ((this.notifyField == YesNoType.no)) + { + writer.WriteAttributeString("Notify", "no"); + } + if ((this.notifyField == YesNoType.yes)) + { + writer.WriteAttributeString("Notify", "yes"); + } + } + if (this.createLinkFieldSet) + { + if ((this.createLinkField == YesNoType.no)) + { + writer.WriteAttributeString("CreateLink", "no"); + } + if ((this.createLinkField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateLink", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("SpecificRightsAll" == name)) + { + this.specificRightsAllField = Enums.ParseYesNoType(value); + this.specificRightsAllFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("Append" == name)) + { + this.appendField = Enums.ParseYesNoType(value); + this.appendFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = Enums.ParseYesNoType(value); + this.executeFieldSet = true; + } + if (("FileAllRights" == name)) + { + this.fileAllRightsField = Enums.ParseYesNoType(value); + this.fileAllRightsFieldSet = true; + } + if (("Write" == name)) + { + this.writeField = Enums.ParseYesNoType(value); + this.writeFieldSet = true; + } + if (("CreateSubkeys" == name)) + { + this.createSubkeysField = Enums.ParseYesNoType(value); + this.createSubkeysFieldSet = true; + } + if (("EnumerateSubkeys" == name)) + { + this.enumerateSubkeysField = Enums.ParseYesNoType(value); + this.enumerateSubkeysFieldSet = true; + } + if (("Notify" == name)) + { + this.notifyField = Enums.ParseYesNoType(value); + this.notifyFieldSet = true; + } + if (("CreateLink" == name)) + { + this.createLinkField = Enums.ParseYesNoType(value); + this.createLinkFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + } + } + + /// + /// Sets ACLs on File, Registry, or CreateFolder. When under a Registry element, this cannot be used + /// if the Action attribute's value is remove or removeKeyOnInstall. This element is only available + /// when installing with MSI 5.0. For downlevel support, see the PermissionEx element from the + /// WixUtilExtension. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PermissionEx : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sddlField; + + private bool sddlFieldSet; + + private ISchemaElement parentElement; + + public PermissionEx() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Condition))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this is not specified the parent element's Id attribute + /// will be used instead. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Security descriptor to apply to parent object. + /// + public string Sddl + { + get + { + return this.sddlField; + } + set + { + this.sddlFieldSet = true; + this.sddlField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PermissionEx", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sddlFieldSet) + { + writer.WriteAttributeString("Sddl", this.sddlField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Sddl" == name)) + { + this.sddlField = value; + this.sddlFieldSet = true; + } + } + } + + /// + /// Copy or move an existing file on the target machine, or copy a file that is being installed, to another destination. When + /// this element is nested under a File element, the parent file will be installed, then copied to the specified destination + /// if the parent component of the file is selected for installation or removal. When this element is nested under + /// a Component element and no FileId attribute is specified, the file to copy or move must already be on the target machine. + /// When this element is nested under a Component element and the FileId attribute is specified, the specified file is installed, + /// then copied to the specified destination if the parent component is selected for installation or removal (use + /// this option to control the copy of a file in a different component by the parent component's installation state). If the + /// specified destination directory is the same as the directory containing the original file and the name for the proposed source + /// file is the same as the original, then no action takes place. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CopyFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string fileIdField; + + private bool fileIdFieldSet; + + private string sourceDirectoryField; + + private bool sourceDirectoryFieldSet; + + private string sourcePropertyField; + + private bool sourcePropertyFieldSet; + + private string sourceNameField; + + private bool sourceNameFieldSet; + + private string destinationDirectoryField; + + private bool destinationDirectoryFieldSet; + + private string destinationPropertyField; + + private bool destinationPropertyFieldSet; + + private string destinationNameField; + + private bool destinationNameFieldSet; + + private string destinationShortNameField; + + private bool destinationShortNameFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element. Set this attribute's value to the identifier + /// of a file from a different component to copy it based on the install state of the parent component. + /// + public string FileId + { + get + { + return this.fileIdField; + } + set + { + this.fileIdFieldSet = true; + this.fileIdField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set + /// this value to the source directory from which to copy or move an existing file on the target machine. This Directory must + /// exist in the installer database at creation time. This attribute cannot be specified in conjunction with SourceProperty. + /// + public string SourceDirectory + { + get + { + return this.sourceDirectoryField; + } + set + { + this.sourceDirectoryFieldSet = true; + this.sourceDirectoryField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set + /// this value to a property that will have a value that resolves to the full path of the source directory (or full path + /// including file name if SourceName is not specified). The property does not have to exist in the installer database at + /// creation time; it could be created at installation time by a custom action, on the command line, etc. This attribute + /// cannot be specified in conjunction with SourceDirectory. + /// + public string SourceProperty + { + get + { + return this.sourcePropertyField; + } + set + { + this.sourcePropertyFieldSet = true; + this.sourcePropertyField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set + /// this value to the localizable name of the file(s) to be copied or moved. All of the files that + /// match the wild card will be removed from the specified directory. The value is a filename that may also + /// contain the wild card characters "?" for any single character or "*" for zero or more occurrences of any character. If this + /// attribute is not specified (and this element is not nested under a File element or specify a FileId attribute) then the + /// SourceProperty attribute should be set to the name of a property that will resolve to the full path of the source filename. + /// If the value of this attribute contains a "*" wildcard and the DestinationName attribute is specified, all moved or copied + /// files retain the file names from their sources. + /// + public string SourceName + { + get + { + return this.sourceNameField; + } + set + { + this.sourceNameFieldSet = true; + this.sourceNameField = value; + } + } + + /// + /// Set this value to the destination directory where an existing file on the target machine should be moved or copied to. This + /// Directory must exist in the installer database at creation time. This attribute cannot be specified in conjunction with + /// DestinationProperty. + /// + public string DestinationDirectory + { + get + { + return this.destinationDirectoryField; + } + set + { + this.destinationDirectoryFieldSet = true; + this.destinationDirectoryField = value; + } + } + + /// + /// Set this value to a property that will have a value that resolves to the full path of the destination directory. The property + /// does not have to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. This attribute cannot be specified in conjunction with DestinationDirectory. + /// + public string DestinationProperty + { + get + { + return this.destinationPropertyField; + } + set + { + this.destinationPropertyFieldSet = true; + this.destinationPropertyField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// Now set this value to the localizable name to be given to the original file after it is moved or copied. + /// If this attribute is not specified, then the destination file is given the same name as the source file. + /// If a short file name is specified, the DestinationShortName attribute may not be specified. + /// Also, if this value is a long file name, the DestinationShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short file name. + /// However, if this name collides with another file or you wish to manually specify + /// the short file name, then the DestinationShortName attribute may be specified. + /// + public string DestinationName + { + get + { + return this.destinationNameField; + } + set + { + this.destinationNameFieldSet = true; + this.destinationNameField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short file names + /// or you wish to manually specify the short file name. + /// + public string DestinationShortName + { + get + { + return this.destinationShortNameField; + } + set + { + this.destinationShortNameFieldSet = true; + this.destinationShortNameField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. In other + /// cases, if the attribute is not specified, the default value is "no" and the file is copied, not moved. Set the value to "yes" + /// in order to move the file (thus deleting the source file) instead of copying it. + /// + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CopyFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.fileIdFieldSet) + { + writer.WriteAttributeString("FileId", this.fileIdField); + } + if (this.sourceDirectoryFieldSet) + { + writer.WriteAttributeString("SourceDirectory", this.sourceDirectoryField); + } + if (this.sourcePropertyFieldSet) + { + writer.WriteAttributeString("SourceProperty", this.sourcePropertyField); + } + if (this.sourceNameFieldSet) + { + writer.WriteAttributeString("SourceName", this.sourceNameField); + } + if (this.destinationDirectoryFieldSet) + { + writer.WriteAttributeString("DestinationDirectory", this.destinationDirectoryField); + } + if (this.destinationPropertyFieldSet) + { + writer.WriteAttributeString("DestinationProperty", this.destinationPropertyField); + } + if (this.destinationNameFieldSet) + { + writer.WriteAttributeString("DestinationName", this.destinationNameField); + } + if (this.destinationShortNameFieldSet) + { + writer.WriteAttributeString("DestinationShortName", this.destinationShortNameField); + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("FileId" == name)) + { + this.fileIdField = value; + this.fileIdFieldSet = true; + } + if (("SourceDirectory" == name)) + { + this.sourceDirectoryField = value; + this.sourceDirectoryFieldSet = true; + } + if (("SourceProperty" == name)) + { + this.sourcePropertyField = value; + this.sourcePropertyFieldSet = true; + } + if (("SourceName" == name)) + { + this.sourceNameField = value; + this.sourceNameFieldSet = true; + } + if (("DestinationDirectory" == name)) + { + this.destinationDirectoryField = value; + this.destinationDirectoryFieldSet = true; + } + if (("DestinationProperty" == name)) + { + this.destinationPropertyField = value; + this.destinationPropertyFieldSet = true; + } + if (("DestinationName" == name)) + { + this.destinationNameField = value; + this.destinationNameFieldSet = true; + } + if (("DestinationShortName" == name)) + { + this.destinationShortNameField = value; + this.destinationShortNameFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + } + } + + /// + /// File specification for File table, must be child node of Component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class File : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string companionFileField; + + private bool companionFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private YesNoType readOnlyField; + + private bool readOnlyFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType systemField; + + private bool systemFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoType checksumField; + + private bool checksumFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private string bindPathField; + + private bool bindPathFieldSet; + + private int selfRegCostField; + + private bool selfRegCostFieldSet; + + private YesNoType trueTypeField; + + private bool trueTypeFieldSet; + + private string fontTitleField; + + private bool fontTitleFieldSet; + + private string defaultLanguageField; + + private bool defaultLanguageFieldSet; + + private int defaultSizeField; + + private bool defaultSizeFieldSet; + + private string defaultVersionField; + + private bool defaultVersionFieldSet; + + private AssemblyType assemblyField; + + private bool assemblyFieldSet; + + private string assemblyManifestField; + + private bool assemblyManifestFieldSet; + + private string assemblyApplicationField; + + private bool assemblyApplicationFieldSet; + + private ProcessorArchitectureType processorArchitectureField; + + private bool processorArchitectureFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private int patchGroupField; + + private bool patchGroupFieldSet; + + private YesNoType patchIgnoreField; + + private bool patchIgnoreFieldSet; + + private YesNoType patchAllowIgnoreOnErrorField; + + private bool patchAllowIgnoreOnErrorFieldSet; + + private YesNoType patchWholeFileField; + + private bool patchWholeFileFieldSet; + + private ISchemaElement parentElement; + + public File() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AssemblyName))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CopyFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDriver))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCTranslator))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TypeLib))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The unique identifier for this File element. If you omit Id, it defaults to the file name portion of the Source attribute, if specified. May be referenced as a Property by specifying [#value]. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to make this file a companion child of another file. The installation + /// state of a companion file depends not on its own file versioning information, but on the versioning of its + /// companion parent. A file that is the key path for its component can not be a companion file (that means + /// this attribute cannot be set if KeyPath="yes" for this file). The Version attribute cannot be set along + /// with this attribute since companion files are not installed based on their own version. + /// + public string CompanionFile + { + get + { + return this.companionFileField; + } + set + { + this.companionFileFieldSet = true; + this.companionFileField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// This attribute's value may now be either a short or long file name. + /// If a short file name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long file name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short file name. + /// However, if this name collides with another file or you wish to manually specify + /// the short file name, then the ShortName attribute may be specified. + /// Finally, if this attribute is omitted then its default value is the file name portion + /// of the Source attribute, if one is specified, or the value of the Id attribute, if + /// the Source attribute is omitted or doesn't contain a file name. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Set to yes in order to force this file to be the key path for the parent component. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short file names + /// or the user wants to manually specify the short file name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// Set to yes in order to have the file's read-only attribute set when it is installed on the target machine. + /// + public YesNoType ReadOnly + { + get + { + return this.readOnlyField; + } + set + { + this.readOnlyFieldSet = true; + this.readOnlyField = value; + } + } + + /// + /// Set to yes in order to have the file's hidden attribute set when it is installed on the target machine. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Set to yes in order to have the file's system attribute set when it is installed on the target machine. + /// + public YesNoType System + { + get + { + return this.systemField; + } + set + { + this.systemFieldSet = true; + this.systemField = value; + } + } + + /// + /// If a file is vital, then installation cannot proceed unless the file is successfully installed. The user will have no option to ignore an error installing this file. If an error occurs, they can merely retry to install the file or abort the installation. The default is "yes," unless the -sfdvital switch (candle.exe) or SuppressFileDefaultVital property (.wixproj) is used. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// This attribute should be set to "yes" for every executable file in the installation that has a valid checksum stored in the Portable Executable (PE) file header. Only those files that have this attribute set will be verified for valid checksum during a reinstall. + /// + public YesNoType Checksum + { + get + { + return this.checksumField; + } + set + { + this.checksumFieldSet = true; + this.checksumField = value; + } + } + + /// + /// Sets the file's source type compression. A setting of "yes" or "no" will override the setting in the Word Count Summary Property. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// A list of paths, separated by semicolons, that represent the paths to be searched to find the imported DLLs. The list is usually a list of properties, with each property enclosed inside square brackets. The value may be set to an empty string. Including this attribute will cause an entry to be generated for the file in the BindImage table. + /// + public string BindPath + { + get + { + return this.bindPathField; + } + set + { + this.bindPathFieldSet = true; + this.bindPathField = value; + } + } + + /// + /// The cost of registering the file in bytes. This must be a non-negative number. Including this attribute will cause an entry to be generated for the file in the SelfReg table. + /// + public int SelfRegCost + { + get + { + return this.selfRegCostField; + } + set + { + this.selfRegCostFieldSet = true; + this.selfRegCostField = value; + } + } + + /// + /// Causes an entry to be generated for the file in the Font table with no FontTitle specified. This attribute is intended to be used to register the file as a TrueType font. + /// + public YesNoType TrueType + { + get + { + return this.trueTypeField; + } + set + { + this.trueTypeFieldSet = true; + this.trueTypeField = value; + } + } + + /// + /// Causes an entry to be generated for the file in the Font table with the specified FontTitle. This attribute is intended to be used to register the file as a non-TrueType font. + /// + public string FontTitle + { + get + { + return this.fontTitleField; + } + set + { + this.fontTitleFieldSet = true; + this.fontTitleField = value; + } + } + + /// + /// This is the default language of this file. The linker will replace this value from the value in the file if the suppress files option is not used. + /// + public string DefaultLanguage + { + get + { + return this.defaultLanguageField; + } + set + { + this.defaultLanguageFieldSet = true; + this.defaultLanguageField = value; + } + } + + /// + /// This is the default size of this file. The linker will replace this value from the value in the file if the suppress files option is not used. + /// + public int DefaultSize + { + get + { + return this.defaultSizeField; + } + set + { + this.defaultSizeFieldSet = true; + this.defaultSizeField = value; + } + } + + /// + /// This is the default version of this file. The linker will replace this value from the value in the file if the suppress files option is not used. + /// + public string DefaultVersion + { + get + { + return this.defaultVersionField; + } + set + { + this.defaultVersionFieldSet = true; + this.defaultVersionField = value; + } + } + + /// + /// Specifies if this File is a Win32 Assembly or .NET Assembly that needs to be installed into the + /// Global Assembly Cache (GAC). If the value is '.net' or 'win32', this file must also be the key path of the Component. + /// + public AssemblyType Assembly + { + get + { + return this.assemblyField; + } + set + { + this.assemblyFieldSet = true; + this.assemblyField = value; + } + } + + /// + /// Specifies the file identifier of the manifest file that describes this assembly. + /// The manifest file should be in the same component as the assembly it describes. + /// This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'. + /// + public string AssemblyManifest + { + get + { + return this.assemblyManifestField; + } + set + { + this.assemblyManifestFieldSet = true; + this.assemblyManifestField = value; + } + } + + /// + /// Specifies the file identifier of the application file. This assembly will be isolated + /// to the same directory as the application file. + /// If this attribute is absent, the assembly will be installed to the Global Assembly Cache (GAC). + /// This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'. + /// + public string AssemblyApplication + { + get + { + return this.assemblyApplicationField; + } + set + { + this.assemblyApplicationFieldSet = true; + this.assemblyApplicationField = value; + } + } + + /// + /// Specifies the architecture for this assembly. This attribute should only be used on .NET Framework 2.0 or higher assemblies. + /// + public ProcessorArchitectureType ProcessorArchitecture + { + get + { + return this.processorArchitectureField; + } + set + { + this.processorArchitectureFieldSet = true; + this.processorArchitectureField = value; + } + } + + /// + /// The value of this attribute should correspond to the Id attribute of a Media + /// element authored elsewhere. By creating this connection between a file and + /// its media, you set the packaging options to the values specified in the Media + /// element (values such as compression level, cab embedding, etc...). Specifying + /// the DiskId attribute on the File element overrides the default DiskId attribute + /// from the parent Component element. If no DiskId attribute is specified, + /// the default is "1". This DiskId attribute is ignored when creating a merge module + /// because merge modules do not have media. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Specifies the path to the File in the build process. Overrides default source path set by parent directories and Name attribute. This attribute must be set if no source information can be gathered from parent directories. For more information, see + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// This attribute must be set for patch-added files. Each patch should be assigned a different patch group number. Patch groups + /// numbers must be greater 0 and should be assigned consecutively. For example, the first patch should use PatchGroup='1', the + /// second patch will have PatchGroup='2', etc... + /// + public int PatchGroup + { + get + { + return this.patchGroupField; + } + set + { + this.patchGroupFieldSet = true; + this.patchGroupField = value; + } + } + + /// + /// Prevents the updating of the file that is in fact changed in the upgraded image relative to the target images. + /// + public YesNoType PatchIgnore + { + get + { + return this.patchIgnoreField; + } + set + { + this.patchIgnoreFieldSet = true; + this.patchIgnoreField = value; + } + } + + /// + /// Set to indicate that the patch is non-vital. + /// + public YesNoType PatchAllowIgnoreOnError + { + get + { + return this.patchAllowIgnoreOnErrorField; + } + set + { + this.patchAllowIgnoreOnErrorFieldSet = true; + this.patchAllowIgnoreOnErrorField = value; + } + } + + /// + /// Set if the entire file should be installed rather than creating a binary patch. + /// + public YesNoType PatchWholeFile + { + get + { + return this.patchWholeFileField; + } + set + { + this.patchWholeFileFieldSet = true; + this.patchWholeFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AssemblyName" == childName)) + { + childValue = new AssemblyName(); + } + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("CopyFile" == childName)) + { + childValue = new CopyFile(); + } + if (("Shortcut" == childName)) + { + childValue = new Shortcut(); + } + if (("ODBCDriver" == childName)) + { + childValue = new ODBCDriver(); + } + if (("ODBCTranslator" == childName)) + { + childValue = new ODBCTranslator(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("Class" == childName)) + { + childValue = new Class(); + } + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("TypeLib" == childName)) + { + childValue = new TypeLib(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a AssemblyType from a string. + /// + public static AssemblyType ParseAssemblyType(string value) + { + AssemblyType parsedValue; + File.TryParseAssemblyType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a AssemblyType from a string. + /// + public static bool TryParseAssemblyType(string value, out AssemblyType parsedValue) + { + parsedValue = AssemblyType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if ((".net" == value)) + { + parsedValue = AssemblyType.net; + } + else + { + if (("no" == value)) + { + parsedValue = AssemblyType.no; + } + else + { + if (("win32" == value)) + { + parsedValue = AssemblyType.win32; + } + else + { + parsedValue = AssemblyType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a ProcessorArchitectureType from a string. + /// + public static ProcessorArchitectureType ParseProcessorArchitectureType(string value) + { + ProcessorArchitectureType parsedValue; + File.TryParseProcessorArchitectureType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ProcessorArchitectureType from a string. + /// + public static bool TryParseProcessorArchitectureType(string value, out ProcessorArchitectureType parsedValue) + { + parsedValue = ProcessorArchitectureType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("msil" == value)) + { + parsedValue = ProcessorArchitectureType.msil; + } + else + { + if (("x86" == value)) + { + parsedValue = ProcessorArchitectureType.x86; + } + else + { + if (("x64" == value)) + { + parsedValue = ProcessorArchitectureType.x64; + } + else + { + if (("ia64" == value)) + { + parsedValue = ProcessorArchitectureType.ia64; + } + else + { + parsedValue = ProcessorArchitectureType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("File", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.companionFileFieldSet) + { + writer.WriteAttributeString("CompanionFile", this.companionFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.readOnlyFieldSet) + { + if ((this.readOnlyField == YesNoType.no)) + { + writer.WriteAttributeString("ReadOnly", "no"); + } + if ((this.readOnlyField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadOnly", "yes"); + } + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.systemFieldSet) + { + if ((this.systemField == YesNoType.no)) + { + writer.WriteAttributeString("System", "no"); + } + if ((this.systemField == YesNoType.yes)) + { + writer.WriteAttributeString("System", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.checksumFieldSet) + { + if ((this.checksumField == YesNoType.no)) + { + writer.WriteAttributeString("Checksum", "no"); + } + if ((this.checksumField == YesNoType.yes)) + { + writer.WriteAttributeString("Checksum", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.bindPathFieldSet) + { + writer.WriteAttributeString("BindPath", this.bindPathField); + } + if (this.selfRegCostFieldSet) + { + writer.WriteAttributeString("SelfRegCost", this.selfRegCostField.ToString(CultureInfo.InvariantCulture)); + } + if (this.trueTypeFieldSet) + { + if ((this.trueTypeField == YesNoType.no)) + { + writer.WriteAttributeString("TrueType", "no"); + } + if ((this.trueTypeField == YesNoType.yes)) + { + writer.WriteAttributeString("TrueType", "yes"); + } + } + if (this.fontTitleFieldSet) + { + writer.WriteAttributeString("FontTitle", this.fontTitleField); + } + if (this.defaultLanguageFieldSet) + { + writer.WriteAttributeString("DefaultLanguage", this.defaultLanguageField); + } + if (this.defaultSizeFieldSet) + { + writer.WriteAttributeString("DefaultSize", this.defaultSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.defaultVersionFieldSet) + { + writer.WriteAttributeString("DefaultVersion", this.defaultVersionField); + } + if (this.assemblyFieldSet) + { + if ((this.assemblyField == AssemblyType.net)) + { + writer.WriteAttributeString("Assembly", ".net"); + } + if ((this.assemblyField == AssemblyType.no)) + { + writer.WriteAttributeString("Assembly", "no"); + } + if ((this.assemblyField == AssemblyType.win32)) + { + writer.WriteAttributeString("Assembly", "win32"); + } + } + if (this.assemblyManifestFieldSet) + { + writer.WriteAttributeString("AssemblyManifest", this.assemblyManifestField); + } + if (this.assemblyApplicationFieldSet) + { + writer.WriteAttributeString("AssemblyApplication", this.assemblyApplicationField); + } + if (this.processorArchitectureFieldSet) + { + if ((this.processorArchitectureField == ProcessorArchitectureType.msil)) + { + writer.WriteAttributeString("ProcessorArchitecture", "msil"); + } + if ((this.processorArchitectureField == ProcessorArchitectureType.x86)) + { + writer.WriteAttributeString("ProcessorArchitecture", "x86"); + } + if ((this.processorArchitectureField == ProcessorArchitectureType.x64)) + { + writer.WriteAttributeString("ProcessorArchitecture", "x64"); + } + if ((this.processorArchitectureField == ProcessorArchitectureType.ia64)) + { + writer.WriteAttributeString("ProcessorArchitecture", "ia64"); + } + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.patchGroupFieldSet) + { + writer.WriteAttributeString("PatchGroup", this.patchGroupField.ToString(CultureInfo.InvariantCulture)); + } + if (this.patchIgnoreFieldSet) + { + if ((this.patchIgnoreField == YesNoType.no)) + { + writer.WriteAttributeString("PatchIgnore", "no"); + } + if ((this.patchIgnoreField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchIgnore", "yes"); + } + } + if (this.patchAllowIgnoreOnErrorFieldSet) + { + if ((this.patchAllowIgnoreOnErrorField == YesNoType.no)) + { + writer.WriteAttributeString("PatchAllowIgnoreOnError", "no"); + } + if ((this.patchAllowIgnoreOnErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchAllowIgnoreOnError", "yes"); + } + } + if (this.patchWholeFileFieldSet) + { + if ((this.patchWholeFileField == YesNoType.no)) + { + writer.WriteAttributeString("PatchWholeFile", "no"); + } + if ((this.patchWholeFileField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchWholeFile", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("CompanionFile" == name)) + { + this.companionFileField = value; + this.companionFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("ReadOnly" == name)) + { + this.readOnlyField = Enums.ParseYesNoType(value); + this.readOnlyFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("System" == name)) + { + this.systemField = Enums.ParseYesNoType(value); + this.systemFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Checksum" == name)) + { + this.checksumField = Enums.ParseYesNoType(value); + this.checksumFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("BindPath" == name)) + { + this.bindPathField = value; + this.bindPathFieldSet = true; + } + if (("SelfRegCost" == name)) + { + this.selfRegCostField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.selfRegCostFieldSet = true; + } + if (("TrueType" == name)) + { + this.trueTypeField = Enums.ParseYesNoType(value); + this.trueTypeFieldSet = true; + } + if (("FontTitle" == name)) + { + this.fontTitleField = value; + this.fontTitleFieldSet = true; + } + if (("DefaultLanguage" == name)) + { + this.defaultLanguageField = value; + this.defaultLanguageFieldSet = true; + } + if (("DefaultSize" == name)) + { + this.defaultSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.defaultSizeFieldSet = true; + } + if (("DefaultVersion" == name)) + { + this.defaultVersionField = value; + this.defaultVersionFieldSet = true; + } + if (("Assembly" == name)) + { + this.assemblyField = File.ParseAssemblyType(value); + this.assemblyFieldSet = true; + } + if (("AssemblyManifest" == name)) + { + this.assemblyManifestField = value; + this.assemblyManifestFieldSet = true; + } + if (("AssemblyApplication" == name)) + { + this.assemblyApplicationField = value; + this.assemblyApplicationFieldSet = true; + } + if (("ProcessorArchitecture" == name)) + { + this.processorArchitectureField = File.ParseProcessorArchitectureType(value); + this.processorArchitectureFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("PatchGroup" == name)) + { + this.patchGroupField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.patchGroupFieldSet = true; + } + if (("PatchIgnore" == name)) + { + this.patchIgnoreField = Enums.ParseYesNoType(value); + this.patchIgnoreFieldSet = true; + } + if (("PatchAllowIgnoreOnError" == name)) + { + this.patchAllowIgnoreOnErrorField = Enums.ParseYesNoType(value); + this.patchAllowIgnoreOnErrorFieldSet = true; + } + if (("PatchWholeFile" == name)) + { + this.patchWholeFileField = Enums.ParseYesNoType(value); + this.patchWholeFileFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum AssemblyType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The file is a .NET Framework assembly. + /// + net, + + /// + /// The file is not a .NET Framework or Win32 assembly. This is the default value. + /// + no, + + /// + /// The file is a Win32 assembly. + /// + win32, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ProcessorArchitectureType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The file is a .NET Framework assembly that is processor-neutral. + /// + msil, + + /// + /// The file is a .NET Framework assembly for the x86 processor. + /// + x86, + + /// + /// The file is a .NET Framework assembly for the x64 processor. + /// + x64, + + /// + /// The file is a .NET Framework assembly for the ia64 processor. + /// + ia64, + } + } + + /// + /// Use several of these elements to specify each registry value in a multiString registry value. This element + /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The + /// values should go in the text area of the MultiStringValue element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MultiStringValue : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Use several of these elements to specify each registry value in a multiString registry value. This element + /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The + /// values should go in the text area of the MultiStringValue element. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MultiStringValue", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Used for organization of child RegistryValue elements or to create a registry key + /// (and optionally remove it during uninstallation). + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistryKey : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private YesNoType forceCreateOnInstallField; + + private bool forceCreateOnInstallFieldSet; + + private YesNoType forceDeleteOnUninstallField; + + private bool forceDeleteOnUninstallFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private ISchemaElement parentElement; + + public RegistryKey() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryKey))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The Action attribute has been deprecated. In most cases, you can simply omit @Action. If you need to force Windows Installer + /// to create an empty key or recursively delete the key, use the ForceCreateOnInstall or ForceDeleteOnUninstall attributes instead. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Set this attribute to 'yes' to create an empty key, if absent, when the parent component is installed. + /// This value is needed only to create an empty key with no subkeys or values. Windows Installer creates + /// keys as needed to store subkeys and values. The default is "no". + /// + public YesNoType ForceCreateOnInstall + { + get + { + return this.forceCreateOnInstallField; + } + set + { + this.forceCreateOnInstallFieldSet = true; + this.forceCreateOnInstallField = value; + } + } + + /// + /// Set this attribute to 'yes' to remove the key with all its values and subkeys when the parent component is uninstalled. + /// Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already + /// removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall. + /// The default is "no". + /// + public YesNoType ForceDeleteOnUninstall + { + get + { + return this.forceDeleteOnUninstallField; + } + set + { + this.forceDeleteOnUninstallFieldSet = true; + this.forceDeleteOnUninstallField = value; + } + } + + /// + /// The localizable key for the registry value. + /// If the parent element is a RegistryKey, this value may be omitted to use the + /// path of the parent, or if its specified it will be appended to the path of the parent. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RegistryKey" == childName)) + { + childValue = new RegistryKey(); + } + if (("RegistryValue" == childName)) + { + childValue = new RegistryValue(); + } + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RegistryKey.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("create" == value)) + { + parsedValue = ActionType.create; + } + else + { + if (("createAndRemoveOnUninstall" == value)) + { + parsedValue = ActionType.createAndRemoveOnUninstall; + } + else + { + if (("none" == value)) + { + parsedValue = ActionType.none; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistryKey", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.create)) + { + writer.WriteAttributeString("Action", "create"); + } + if ((this.actionField == ActionType.createAndRemoveOnUninstall)) + { + writer.WriteAttributeString("Action", "createAndRemoveOnUninstall"); + } + if ((this.actionField == ActionType.none)) + { + writer.WriteAttributeString("Action", "none"); + } + } + if (this.forceCreateOnInstallFieldSet) + { + if ((this.forceCreateOnInstallField == YesNoType.no)) + { + writer.WriteAttributeString("ForceCreateOnInstall", "no"); + } + if ((this.forceCreateOnInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("ForceCreateOnInstall", "yes"); + } + } + if (this.forceDeleteOnUninstallFieldSet) + { + if ((this.forceDeleteOnUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("ForceDeleteOnUninstall", "no"); + } + if ((this.forceDeleteOnUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("ForceDeleteOnUninstall", "yes"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RegistryKey.ParseActionType(value); + this.actionFieldSet = true; + } + if (("ForceCreateOnInstall" == name)) + { + this.forceCreateOnInstallField = Enums.ParseYesNoType(value); + this.forceCreateOnInstallFieldSet = true; + } + if (("ForceDeleteOnUninstall" == name)) + { + this.forceDeleteOnUninstallField = Enums.ParseYesNoType(value); + this.forceDeleteOnUninstallFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates the key, if absent, when the parent component is installed. + /// + create, + + /// + /// Creates the key, if absent, when the parent component is installed then remove the key with all its values and subkeys when the parent component is uninstalled. + /// Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already + /// removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall. + /// + createAndRemoveOnUninstall, + + /// + /// Does nothing; this element is used merely in WiX authoring for organization and does nothing to the final output. + /// This is the default value. + /// + none, + } + } + + /// + /// Used to create a registry value. For multi-string values, this can be used to prepend or append values. + /// + /// For legacy authoring: Use several of these elements to specify each registry value in a multiString registry value. This element + /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The + /// values should go in the text area of the RegistryValue element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistryValue : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private ISchemaElement parentElement; + + public RegistryValue() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MultiStringValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// The localizable key for the registry value. + /// If the parent element is a RegistryKey, this value may be omitted to use the + /// path of the parent, or if its specified it will be appended to the path of the parent. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The localizable registry value name. If this attribute is not provided the default value for the registry key will + /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not + /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Set this attribute to the localizable registry value. This value is formatted. The Windows Installer allows + /// several special values to be set for this attribute. You should not use them in WiX. Instead use appropriate + /// values in the Type attribute to get the desired behavior. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Set this attribute to the type of the desired registry key. This attribute must be specified whenever the Value + /// attribute or a child RegistryValue element is specified. This attribute + /// should only be set when the value of the Action attribute does not include the word 'remove'. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// This is the action that will be taken for this registry value. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Set this attribute to 'yes' to make this registry key the KeyPath of the parent component. + /// Only one resource (registry, file, etc) can be the KeyPath of a component. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("MultiStringValue" == childName)) + { + childValue = new MultiStringValue(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + RegistryValue.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + if (("integer" == value)) + { + parsedValue = TypeType.integer; + } + else + { + if (("binary" == value)) + { + parsedValue = TypeType.binary; + } + else + { + if (("expandable" == value)) + { + parsedValue = TypeType.expandable; + } + else + { + if (("multiString" == value)) + { + parsedValue = TypeType.multiString; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RegistryValue.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("append" == value)) + { + parsedValue = ActionType.append; + } + else + { + if (("prepend" == value)) + { + parsedValue = ActionType.prepend; + } + else + { + if (("write" == value)) + { + parsedValue = ActionType.write; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistryValue", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + if ((this.typeField == TypeType.integer)) + { + writer.WriteAttributeString("Type", "integer"); + } + if ((this.typeField == TypeType.binary)) + { + writer.WriteAttributeString("Type", "binary"); + } + if ((this.typeField == TypeType.expandable)) + { + writer.WriteAttributeString("Type", "expandable"); + } + if ((this.typeField == TypeType.multiString)) + { + writer.WriteAttributeString("Type", "multiString"); + } + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.append)) + { + writer.WriteAttributeString("Action", "append"); + } + if ((this.actionField == ActionType.prepend)) + { + writer.WriteAttributeString("Action", "prepend"); + } + if ((this.actionField == ActionType.write)) + { + writer.WriteAttributeString("Action", "write"); + } + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = RegistryValue.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RegistryValue.ParseActionType(value); + this.actionFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The value is interpreted and stored as a string (REG_SZ). + /// + @string, + + /// + /// The value is interpreted and stored as an integer (REG_DWORD). + /// + integer, + + /// + /// The value is interpreted and stored as a hexadecimal value (REG_BINARY). + /// + binary, + + /// + /// The value is interpreted and stored as an expandable string (REG_EXPAND_SZ). + /// + expandable, + + /// + /// The value is interpreted and stored as a multiple strings (REG_MULTI_SZ). + /// Please note that this value will only result in a multi-string value if there is more than one registry value + /// or the Action attribute's value is 'append' or 'prepend'. Otherwise a string value will be created. + /// + multiString, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Appends the specified value(s) to a multiString registry value. + /// + append, + + /// + /// Prepends the specified value(s) to a multiString registry value. + /// + prepend, + + /// + /// Writes a registry value. This is the default value. + /// + write, + } + } + + /// + /// Used for removing registry keys and all child keys either during install or uninstall. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveRegistryKey : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This is the action that will be taken for this registry value. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The localizable key for the registry value. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RemoveRegistryKey.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("removeOnInstall" == value)) + { + parsedValue = ActionType.removeOnInstall; + } + else + { + if (("removeOnUninstall" == value)) + { + parsedValue = ActionType.removeOnUninstall; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveRegistryKey", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.removeOnInstall)) + { + writer.WriteAttributeString("Action", "removeOnInstall"); + } + if ((this.actionField == ActionType.removeOnUninstall)) + { + writer.WriteAttributeString("Action", "removeOnUninstall"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RemoveRegistryKey.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Removes a key with all its values and subkeys when the parent component is installed. + /// + removeOnInstall, + + /// + /// Removes a key with all its values and subkeys when the parent component is uninstalled. + /// + removeOnUninstall, + } + } + + /// + /// Used to remove a registry value during installation. + /// There is no standard way to remove a single registry value during uninstall (but you can remove an entire key with RemoveRegistryKey). + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveRegistryValue : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The localizable key for the registry value. + /// If the parent element is a RegistryKey, this value may be omitted to use the + /// path of the parent, or if its specified it will be appended to the path of the parent. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The localizable registry value name. If this attribute is not provided the default value for the registry key will + /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not + /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveRegistryValue", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Registry : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + public Registry() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Registry))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This is the action that will be taken for this registry key. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The localizable key for the registry value. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// Set this attribute to 'yes' to make this registry key the KeyPath of the parent component. Only one resource (registry, + /// file, etc) can be the KeyPath of a component. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// The localizable registry value name. If this attribute is not provided the default value for the registry key will + /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not + /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// Set this attribute to the type of the desired registry key. This attribute must be specified whenever the Value + /// attribute or a child RegistryValue element is specified. This attribute + /// should only be set when the value of the Action attribute does not include the word 'remove'. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Set this attribute to the localizable registry value. This value is formatted. The Windows Installer allows + /// several special values to be set for this attribute. You should not use them in WiX. Instead use appropriate + /// values in the Type attribute to get the desired behavior. This attribute cannot be specified if the Action + /// attribute's value contains the word 'remove'. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("RegistryValue" == childName)) + { + childValue = new RegistryValue(); + } + if (("Registry" == childName)) + { + childValue = new Registry(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + Registry.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("append" == value)) + { + parsedValue = ActionType.append; + } + else + { + if (("createKey" == value)) + { + parsedValue = ActionType.createKey; + } + else + { + if (("createKeyAndRemoveKeyOnUninstall" == value)) + { + parsedValue = ActionType.createKeyAndRemoveKeyOnUninstall; + } + else + { + if (("prepend" == value)) + { + parsedValue = ActionType.prepend; + } + else + { + if (("remove" == value)) + { + parsedValue = ActionType.remove; + } + else + { + if (("removeKeyOnInstall" == value)) + { + parsedValue = ActionType.removeKeyOnInstall; + } + else + { + if (("removeKeyOnUninstall" == value)) + { + parsedValue = ActionType.removeKeyOnUninstall; + } + else + { + if (("write" == value)) + { + parsedValue = ActionType.write; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + Registry.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + if (("integer" == value)) + { + parsedValue = TypeType.integer; + } + else + { + if (("binary" == value)) + { + parsedValue = TypeType.binary; + } + else + { + if (("expandable" == value)) + { + parsedValue = TypeType.expandable; + } + else + { + if (("multiString" == value)) + { + parsedValue = TypeType.multiString; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Registry", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.append)) + { + writer.WriteAttributeString("Action", "append"); + } + if ((this.actionField == ActionType.createKey)) + { + writer.WriteAttributeString("Action", "createKey"); + } + if ((this.actionField == ActionType.createKeyAndRemoveKeyOnUninstall)) + { + writer.WriteAttributeString("Action", "createKeyAndRemoveKeyOnUninstall"); + } + if ((this.actionField == ActionType.prepend)) + { + writer.WriteAttributeString("Action", "prepend"); + } + if ((this.actionField == ActionType.remove)) + { + writer.WriteAttributeString("Action", "remove"); + } + if ((this.actionField == ActionType.removeKeyOnInstall)) + { + writer.WriteAttributeString("Action", "removeKeyOnInstall"); + } + if ((this.actionField == ActionType.removeKeyOnUninstall)) + { + writer.WriteAttributeString("Action", "removeKeyOnUninstall"); + } + if ((this.actionField == ActionType.write)) + { + writer.WriteAttributeString("Action", "write"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + if ((this.typeField == TypeType.integer)) + { + writer.WriteAttributeString("Type", "integer"); + } + if ((this.typeField == TypeType.binary)) + { + writer.WriteAttributeString("Type", "binary"); + } + if ((this.typeField == TypeType.expandable)) + { + writer.WriteAttributeString("Type", "expandable"); + } + if ((this.typeField == TypeType.multiString)) + { + writer.WriteAttributeString("Type", "multiString"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = Registry.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Registry.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Appends the specified value(s) to a multiString registry key. + /// + append, + + /// + /// Creates the key, if absent, when the parent component is installed. + /// + createKey, + + /// + /// Creates the key, if absent, when the parent component is installed then remove the key with all its values and subkeys when the parent component is uninstalled. + /// + createKeyAndRemoveKeyOnUninstall, + + /// + /// Prepends the specified value(s) to a multiString registry key. + /// + prepend, + + /// + /// Removes a registry name when the parent component is installed. + /// + remove, + + /// + /// Removes a key with all its values and subkeys when the parent component is installed. + /// + removeKeyOnInstall, + + /// + /// Removes a key with all its values and subkeys when the parent component is uninstalled. + /// + removeKeyOnUninstall, + + /// + /// Writes a registry value. + /// + write, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The value is interpreted and stored as a string (REG_SZ). + /// + @string, + + /// + /// The value is interpreted and stored as an integer (REG_DWORD). + /// + integer, + + /// + /// The value is interpreted and stored as a hexadecimal value (REG_BINARY). + /// + binary, + + /// + /// The value is interpreted and stored as an expandable string (REG_EXPAND_SZ). + /// + expandable, + + /// + /// The value is interpreted and stored as a multiple strings (REG_MULTI_SZ). + /// Please note that this value will only result in a multi-string value if there is more than one registry value + /// or the Action attribute's value is 'append' or 'prepend'. Otherwise a string value will be created. + /// + multiString, + } + } + + /// + /// Remove a file(s) if the parent component is selected for installation or removal. Multiple files can be removed + /// by specifying a wildcard for the value of the Name attribute. By default, the source + /// directory of the file is the directory of the parent component. This can be overridden by specifying the + /// Directory attribute with a value corresponding to the Id of the source directory, or by specifying the Property + /// attribute with a value corresponding to a property that will have a value that resolves to the full path + /// to the source directory. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private InstallUninstallType onField; + + private bool onFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Overrides the directory of the parent component with a specific Directory. This Directory must exist in the + /// installer database at creation time. This attribute cannot be specified in conjunction with the Property attribute. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// Overrides the directory of the parent component with the value of the specified property. The property + /// should have a value that resolves to the full path of the source directory. The property does not have + /// to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. This attribute cannot be specified in conjunction with the Directory attribute. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This value should be set to the localizable name of the file(s) to be removed. All of the files that + /// match the wild card will be removed from the specified directory. The value is a filename that may also + /// contain the wild card characters "?" for any single character or "*" for zero or more occurrences of any character. + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// This attribute's value may now be either a short or long file name. + /// If a short file name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long file name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short file name. + /// However, if you wish to manually specify the short file name, then the ShortName attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// This attribute should only be set if you want to manually specify the short file name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// This value determines the time at which the file(s) may be removed. For 'install', the file will + /// be removed only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the file will be removed only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the file will be removed in both cases. + /// + public InstallUninstallType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.onFieldSet) + { + if ((this.onField == InstallUninstallType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + if ((this.onField == InstallUninstallType.both)) + { + writer.WriteAttributeString("On", "both"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("On" == name)) + { + this.onField = Enums.ParseInstallUninstallType(value); + this.onFieldSet = true; + } + } + } + + /// + /// Remove an empty folder if the parent component is selected for installation or removal. By default, the folder + /// is the directory of the parent component. This can be overridden by specifying the Directory attribute + /// with a value corresponding to the Id of the directory, or by specifying the Property attribute with a value + /// corresponding to a property that will have a value that resolves to the full path of the folder. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFolder : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private InstallUninstallType onField; + + private bool onFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Overrides the directory of the parent component with a specific Directory. This Directory must exist in the + /// installer database at creation time. This attribute cannot be specified in conjunction with the Property attribute. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// Overrides the directory of the parent component with the value of the specified property. The property + /// should have a value that resolves to the full path of the source directory. The property does not have + /// to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. This attribute cannot be specified in conjunction with the Directory attribute. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This value determines the time at which the folder may be removed, based on the install/uninstall of the parent component. + /// For 'install', the folder will be removed only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the folder will be removed only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the folder will be removed in both cases. + /// + public InstallUninstallType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFolder", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.onFieldSet) + { + if ((this.onField == InstallUninstallType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + if ((this.onField == InstallUninstallType.both)) + { + writer.WriteAttributeString("On", "both"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("On" == name)) + { + this.onField = Enums.ParseInstallUninstallType(value); + this.onFieldSet = true; + } + } + } + + /// + /// Create folder as part of parent Component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CreateFolder : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string directoryField; + + private bool directoryFieldSet; + + private ISchemaElement parentElement; + + public CreateFolder() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier of Directory to create. Defaults to Directory of parent Component. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Shortcut" == childName)) + { + childValue = new Shortcut(); + } + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CreateFolder", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + } + } + + /// + /// Optional way for defining AppData, generally used for complex CDATA. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AppData : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Optional way for defining AppData, generally used for complex CDATA. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AppData", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Qualified published component for parent Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Category : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string qualifierField; + + private bool qualifierFieldSet; + + private string appDataField; + + private bool appDataFieldSet; + + private string featureField; + + private bool featureFieldSet; + + private ISchemaElement parentElement; + + public Category() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(AppData))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// A string GUID that represents the category of components being grouped together. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A text string that qualifies the value in the Id attribute. A qualifier is used to distinguish multiple forms of the same Component, such as a Component that is implemented in multiple languages. + /// + public string Qualifier + { + get + { + return this.qualifierField; + } + set + { + this.qualifierFieldSet = true; + this.qualifierField = value; + } + } + + /// + /// An optional localizable text describing the category. The string is commonly parsed by the application and can be displayed to the user. It should describe the category. + /// + public string AppData + { + get + { + return this.appDataField; + } + set + { + this.appDataFieldSet = true; + this.appDataField = value; + } + } + + /// + /// Feature that controls the advertisement of the category. Defaults to the primary Feature for the parent Component . + /// + public string Feature + { + get + { + return this.featureField; + } + set + { + this.featureFieldSet = true; + this.featureField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppData" == childName)) + { + childValue = new AppData(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Category", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.qualifierFieldSet) + { + writer.WriteAttributeString("Qualifier", this.qualifierField); + } + if (this.appDataFieldSet) + { + writer.WriteAttributeString("AppData", this.appDataField); + } + if (this.featureFieldSet) + { + writer.WriteAttributeString("Feature", this.featureField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Qualifier" == name)) + { + this.qualifierField = value; + this.qualifierFieldSet = true; + } + if (("AppData" == name)) + { + this.appDataField = value; + this.appDataFieldSet = true; + } + if (("Feature" == name)) + { + this.featureField = value; + this.featureFieldSet = true; + } + } + } + + /// + /// MIME content-type for an Extension + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MIME : ISchemaElement, ISetAttributes + { + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string contentTypeField; + + private bool contentTypeFieldSet; + + private string classField; + + private bool classFieldSet; + + private YesNoType defaultField; + + private bool defaultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Whether this MIME is to be advertised. The default is to match whatever the parent extension element uses. If the parent element is not advertised, then this element cannot be advertised either. + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// This is the identifier for the MIME content. It is commonly written in the form of type/format. + /// + public string ContentType + { + get + { + return this.contentTypeField; + } + set + { + this.contentTypeFieldSet = true; + this.contentTypeField = value; + } + } + + /// + /// Class ID for the COM server that is to be associated with the MIME content. + /// + public string Class + { + get + { + return this.classField; + } + set + { + this.classFieldSet = true; + this.classField = value; + } + } + + /// + /// If 'yes', become the content type for the parent Extension. The default value is 'no'. + /// + public YesNoType Default + { + get + { + return this.defaultField; + } + set + { + this.defaultFieldSet = true; + this.defaultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MIME", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.contentTypeFieldSet) + { + writer.WriteAttributeString("ContentType", this.contentTypeField); + } + if (this.classFieldSet) + { + writer.WriteAttributeString("Class", this.classField); + } + if (this.defaultFieldSet) + { + if ((this.defaultField == YesNoType.no)) + { + writer.WriteAttributeString("Default", "no"); + } + if ((this.defaultField == YesNoType.yes)) + { + writer.WriteAttributeString("Default", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("ContentType" == name)) + { + this.contentTypeField = value; + this.contentTypeFieldSet = true; + } + if (("Class" == name)) + { + this.classField = value; + this.classFieldSet = true; + } + if (("Default" == name)) + { + this.defaultField = Enums.ParseYesNoType(value); + this.defaultFieldSet = true; + } + } + } + + /// + /// Verb definition for an Extension. When advertised, this element creates a row in the + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Verb : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string commandField; + + private bool commandFieldSet; + + private string argumentField; + + private bool argumentFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string targetFileField; + + private bool targetFileFieldSet; + + private string targetPropertyField; + + private bool targetPropertyFieldSet; + + private ISchemaElement parentElement; + + /// + /// The verb for the command. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The localized text displayed on the context menu. + /// + public string Command + { + get + { + return this.commandField; + } + set + { + this.commandFieldSet = true; + this.commandField = value; + } + } + + /// + /// Value for the command arguments. Note that the resolution of properties in the + /// Argument field is limited. A property formatted as [Property] in this field can only be resolved if the property + /// already has the intended value when the component owning the verb is installed. For example, for the argument + /// "[#MyDoc.doc]" to resolve to the correct value, the same process must be installing the file MyDoc.doc and the + /// component that owns the verb. + /// + public string Argument + { + get + { + return this.argumentField; + } + set + { + this.argumentFieldSet = true; + this.argumentField = value; + } + } + + /// + /// The sequence of the commands. Only verbs for which the Sequence is specified + /// are used to prepare an ordered list for the default value of the shell key. The Verb with the lowest value in this + /// column becomes the default verb. Used only for Advertised verbs. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Either this attribute or the TargetProperty attribute must be specified for a non-advertised verb. + /// The value should be the identifier of the target file to be executed for the verb. + /// + public string TargetFile + { + get + { + return this.targetFileField; + } + set + { + this.targetFileFieldSet = true; + this.targetFileField = value; + } + } + + /// + /// Either this attribute or the TargetFile attribute must be specified for a non-advertised verb. + /// The value should be the identifier of the property which will resolve to the path to the target file to be executed for the verb. + /// + public string TargetProperty + { + get + { + return this.targetPropertyField; + } + set + { + this.targetPropertyFieldSet = true; + this.targetPropertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Verb", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.commandFieldSet) + { + writer.WriteAttributeString("Command", this.commandField); + } + if (this.argumentFieldSet) + { + writer.WriteAttributeString("Argument", this.argumentField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.targetFileFieldSet) + { + writer.WriteAttributeString("TargetFile", this.targetFileField); + } + if (this.targetPropertyFieldSet) + { + writer.WriteAttributeString("TargetProperty", this.targetPropertyField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Command" == name)) + { + this.commandField = value; + this.commandFieldSet = true; + } + if (("Argument" == name)) + { + this.argumentField = value; + this.argumentFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("TargetFile" == name)) + { + this.targetFileField = value; + this.targetFileFieldSet = true; + } + if (("TargetProperty" == name)) + { + this.targetPropertyField = value; + this.targetPropertyFieldSet = true; + } + } + } + + /// + /// Extension for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Extension : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string contentTypeField; + + private bool contentTypeFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private ISchemaElement parentElement; + + public Extension() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MIME))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Verb))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// This is simply the file extension, like "doc" or "xml". Do not include the preceding period. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The MIME type that is to be written. + /// + public string ContentType + { + get + { + return this.contentTypeField; + } + set + { + this.contentTypeFieldSet = true; + this.contentTypeField = value; + } + } + + /// + /// Whether this extension is to be advertised. The default is "no". + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MIME" == childName)) + { + childValue = new MIME(); + } + if (("Verb" == childName)) + { + childValue = new Verb(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Extension", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.contentTypeFieldSet) + { + writer.WriteAttributeString("ContentType", this.contentTypeField); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ContentType" == name)) + { + this.contentTypeField = value; + this.contentTypeFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + } + } + + /// + /// Register a type library (TypeLib). Please note that in order to properly use this + /// non-advertised, you will need use this element with Advertise='no' and also author the + /// appropriate child Interface elements by extracting them from the type library itself. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TypeLib : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private YesNoType controlField; + + private bool controlFieldSet; + + private int costField; + + private bool costFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private YesNoType hasDiskImageField; + + private bool hasDiskImageFieldSet; + + private string helpDirectoryField; + + private bool helpDirectoryFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private int languageField; + + private bool languageFieldSet; + + private int majorVersionField; + + private bool majorVersionFieldSet; + + private int minorVersionField; + + private bool minorVersionFieldSet; + + private int resourceIdField; + + private bool resourceIdFieldSet; + + private YesNoType restrictedField; + + private bool restrictedFieldSet; + + private ISchemaElement parentElement; + + public TypeLib() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The GUID that identifes the type library. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Value of 'yes' will create a row in the TypeLib table. + /// Value of 'no' will create rows in the Registry table. + /// The default value is 'no'. + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Value of 'yes' means the type library describes controls, and should not be displayed in type browsers intended for nonvisual objects. + /// This attribute can only be set if Advertise='no'. + /// + public YesNoType Control + { + get + { + return this.controlField; + } + set + { + this.controlFieldSet = true; + this.controlField = value; + } + } + + /// + /// The cost associated with the registration of the type library in bytes. This attribute cannot be set if Advertise='no'. + /// + public int Cost + { + get + { + return this.costField; + } + set + { + this.costFieldSet = true; + this.costField = value; + } + } + + /// + /// The localizable description of the type library. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Value of 'yes' means the type library exists in a persisted form on disk. This attribute can only be set if Advertise='no'. + /// + public YesNoType HasDiskImage + { + get + { + return this.hasDiskImageField; + } + set + { + this.hasDiskImageFieldSet = true; + this.hasDiskImageField = value; + } + } + + /// + /// The identifier of the Directory element for the help directory. + /// + public string HelpDirectory + { + get + { + return this.helpDirectoryField; + } + set + { + this.helpDirectoryFieldSet = true; + this.helpDirectoryField = value; + } + } + + /// + /// Value of 'yes' means the type library should not be displayed to users, although its use is not restricted. + /// Should be used by controls. Hosts should create a new type library that wraps the control with extended properties. + /// This attribute can only be set if Advertise='no'. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// The language of the type library. This must be a non-negative integer. + /// + public int Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The major version of the type library. The value should be an integer from 0 - 255. + /// + public int MajorVersion + { + get + { + return this.majorVersionField; + } + set + { + this.majorVersionFieldSet = true; + this.majorVersionField = value; + } + } + + /// + /// The minor version of the type library. The value should be an integer from 0 - 255. + /// + public int MinorVersion + { + get + { + return this.minorVersionField; + } + set + { + this.minorVersionFieldSet = true; + this.minorVersionField = value; + } + } + + /// + /// The resource id of a typelib. The value is appended to the end of the typelib path in the registry. + /// + public int ResourceId + { + get + { + return this.resourceIdField; + } + set + { + this.resourceIdFieldSet = true; + this.resourceIdField = value; + } + } + + /// + /// Value of 'yes' means the type library is restricted, and should not be displayed to users. This attribute can only be set if Advertise='no'. + /// + public YesNoType Restricted + { + get + { + return this.restrictedField; + } + set + { + this.restrictedFieldSet = true; + this.restrictedField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Class" == childName)) + { + childValue = new Class(); + } + if (("Interface" == childName)) + { + childValue = new Interface(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TypeLib", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.controlFieldSet) + { + if ((this.controlField == YesNoType.no)) + { + writer.WriteAttributeString("Control", "no"); + } + if ((this.controlField == YesNoType.yes)) + { + writer.WriteAttributeString("Control", "yes"); + } + } + if (this.costFieldSet) + { + writer.WriteAttributeString("Cost", this.costField.ToString(CultureInfo.InvariantCulture)); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.hasDiskImageFieldSet) + { + if ((this.hasDiskImageField == YesNoType.no)) + { + writer.WriteAttributeString("HasDiskImage", "no"); + } + if ((this.hasDiskImageField == YesNoType.yes)) + { + writer.WriteAttributeString("HasDiskImage", "yes"); + } + } + if (this.helpDirectoryFieldSet) + { + writer.WriteAttributeString("HelpDirectory", this.helpDirectoryField); + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.majorVersionFieldSet) + { + writer.WriteAttributeString("MajorVersion", this.majorVersionField.ToString(CultureInfo.InvariantCulture)); + } + if (this.minorVersionFieldSet) + { + writer.WriteAttributeString("MinorVersion", this.minorVersionField.ToString(CultureInfo.InvariantCulture)); + } + if (this.resourceIdFieldSet) + { + writer.WriteAttributeString("ResourceId", this.resourceIdField.ToString(CultureInfo.InvariantCulture)); + } + if (this.restrictedFieldSet) + { + if ((this.restrictedField == YesNoType.no)) + { + writer.WriteAttributeString("Restricted", "no"); + } + if ((this.restrictedField == YesNoType.yes)) + { + writer.WriteAttributeString("Restricted", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("Control" == name)) + { + this.controlField = Enums.ParseYesNoType(value); + this.controlFieldSet = true; + } + if (("Cost" == name)) + { + this.costField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.costFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("HasDiskImage" == name)) + { + this.hasDiskImageField = Enums.ParseYesNoType(value); + this.hasDiskImageFieldSet = true; + } + if (("HelpDirectory" == name)) + { + this.helpDirectoryField = value; + this.helpDirectoryFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.languageFieldSet = true; + } + if (("MajorVersion" == name)) + { + this.majorVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.majorVersionFieldSet = true; + } + if (("MinorVersion" == name)) + { + this.minorVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.minorVersionFieldSet = true; + } + if (("ResourceId" == name)) + { + this.resourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.resourceIdFieldSet = true; + } + if (("Restricted" == name)) + { + this.restrictedField = Enums.ParseYesNoType(value); + this.restrictedFieldSet = true; + } + } + } + + /// + /// ProgId registration for parent Component. If ProgId has an associated Class, it must be a child of that element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProgId : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string noOpenField; + + private bool noOpenFieldSet; + + private ISchemaElement parentElement; + + public ProgId() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ProgId))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Extension))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// For an advertised ProgId, the Id of an Icon element. For a non-advertised ProgId, this is the Id of a file containing an icon resource. + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Specifies that the associated ProgId should not be opened by users. The value is presented as a warning to users. An empty string is also valid for this attribute. + /// + public string NoOpen + { + get + { + return this.noOpenField; + } + set + { + this.noOpenFieldSet = true; + this.noOpenField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProgId" == childName)) + { + childValue = new ProgId(); + } + if (("Extension" == childName)) + { + childValue = new Extension(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProgId", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.noOpenFieldSet) + { + writer.WriteAttributeString("NoOpen", this.noOpenField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("NoOpen" == name)) + { + this.noOpenField = value; + this.noOpenFieldSet = true; + } + } + } + + /// + /// Application ID containing DCOM information for the associated application GUID. + /// If this element is nested under a Fragment, Module, or Package element, it must be + /// advertised. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AppId : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType activateAtStorageField; + + private bool activateAtStorageFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string dllSurrogateField; + + private bool dllSurrogateFieldSet; + + private string idField; + + private bool idFieldSet; + + private string localServiceField; + + private bool localServiceFieldSet; + + private string remoteServerNameField; + + private bool remoteServerNameFieldSet; + + private YesNoType runAsInteractiveUserField; + + private bool runAsInteractiveUserFieldSet; + + private string serviceParametersField; + + private bool serviceParametersFieldSet; + + private ISchemaElement parentElement; + + public AppId() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Set this value to 'yes' to configure the client to activate on the same system as persistent storage. + /// + public YesNoType ActivateAtStorage + { + get + { + return this.activateAtStorageField; + } + set + { + this.activateAtStorageFieldSet = true; + this.activateAtStorageField = value; + } + } + + /// + /// Set this value to 'yes' in order to create a normal AppId table row. Set this value to 'no' in order to + /// generate Registry rows that perform similar registration (without the often problematic Windows Installer + /// advertising behavior). + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Set this value to the description of the AppId. It can only be specified when the AppId is not being advertised. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Set this value to specify that the class is a DLL that is to be activated in a surrogate EXE + /// process, and the surrogate process to be used is the path of a surrogate EXE file specified by the value. + /// + public string DllSurrogate + { + get + { + return this.dllSurrogateField; + } + set + { + this.dllSurrogateFieldSet = true; + this.dllSurrogateField = value; + } + } + + /// + /// Set this value to the AppID GUID that corresponds to the named executable. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this value to the name of a service to allow the object to be installed as a Win32 service. + /// + public string LocalService + { + get + { + return this.localServiceField; + } + set + { + this.localServiceFieldSet = true; + this.localServiceField = value; + } + } + + /// + /// Set this value to the name of the remote server to configure the client to request the object + /// be run at a particular machine whenever an activation function is called for which a COSERVERINFO + /// structure is not specified. + /// + public string RemoteServerName + { + get + { + return this.remoteServerNameField; + } + set + { + this.remoteServerNameFieldSet = true; + this.remoteServerNameField = value; + } + } + + /// + /// Set this value to 'yes' to configure a class to run under the identity of the user currently + /// logged on and connected to the interactive desktop when activated by a remote client without + /// being written as a Win32 service. + /// + public YesNoType RunAsInteractiveUser + { + get + { + return this.runAsInteractiveUserField; + } + set + { + this.runAsInteractiveUserFieldSet = true; + this.runAsInteractiveUserField = value; + } + } + + /// + /// Set this value to the parameters to be passed to a LocalService on invocation. + /// + public string ServiceParameters + { + get + { + return this.serviceParametersField; + } + set + { + this.serviceParametersFieldSet = true; + this.serviceParametersField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Class" == childName)) + { + childValue = new Class(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AppId", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.activateAtStorageFieldSet) + { + if ((this.activateAtStorageField == YesNoType.no)) + { + writer.WriteAttributeString("ActivateAtStorage", "no"); + } + if ((this.activateAtStorageField == YesNoType.yes)) + { + writer.WriteAttributeString("ActivateAtStorage", "yes"); + } + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.dllSurrogateFieldSet) + { + writer.WriteAttributeString("DllSurrogate", this.dllSurrogateField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.localServiceFieldSet) + { + writer.WriteAttributeString("LocalService", this.localServiceField); + } + if (this.remoteServerNameFieldSet) + { + writer.WriteAttributeString("RemoteServerName", this.remoteServerNameField); + } + if (this.runAsInteractiveUserFieldSet) + { + if ((this.runAsInteractiveUserField == YesNoType.no)) + { + writer.WriteAttributeString("RunAsInteractiveUser", "no"); + } + if ((this.runAsInteractiveUserField == YesNoType.yes)) + { + writer.WriteAttributeString("RunAsInteractiveUser", "yes"); + } + } + if (this.serviceParametersFieldSet) + { + writer.WriteAttributeString("ServiceParameters", this.serviceParametersField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ActivateAtStorage" == name)) + { + this.activateAtStorageField = Enums.ParseYesNoType(value); + this.activateAtStorageFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("DllSurrogate" == name)) + { + this.dllSurrogateField = value; + this.dllSurrogateFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("LocalService" == name)) + { + this.localServiceField = value; + this.localServiceFieldSet = true; + } + if (("RemoteServerName" == name)) + { + this.remoteServerNameField = value; + this.remoteServerNameFieldSet = true; + } + if (("RunAsInteractiveUser" == name)) + { + this.runAsInteractiveUserField = Enums.ParseYesNoType(value); + this.runAsInteractiveUserFieldSet = true; + } + if (("ServiceParameters" == name)) + { + this.serviceParametersField = value; + this.serviceParametersFieldSet = true; + } + } + } + + /// + /// COM Class registration for parent Component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Class : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ContextType contextField; + + private bool contextFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string appIdField; + + private bool appIdFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private string handlerField; + + private bool handlerFieldSet; + + private string argumentField; + + private bool argumentFieldSet; + + private YesNoType relativePathField; + + private bool relativePathFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private ThreadingModelType threadingModelField; + + private bool threadingModelFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private YesNoType insertableField; + + private bool insertableFieldSet; + + private YesNoType programmableField; + + private bool programmableFieldSet; + + private string foreignServerField; + + private bool foreignServerFieldSet; + + private string serverField; + + private bool serverFieldSet; + + private YesNoType shortPathField; + + private bool shortPathFieldSet; + + private YesNoType safeForScriptingField; + + private bool safeForScriptingFieldSet; + + private YesNoType safeForInitializingField; + + private bool safeForInitializingFieldSet; + + private YesNoType controlField; + + private bool controlFieldSet; + + private ISchemaElement parentElement; + + public Class() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileTypeMask))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The Class identifier (CLSID) of a COM server. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The server context(s) for this COM server. This attribute is optional for VB6 libraries that are marked "PublicNotCreateable". + /// Class elements marked Advertised must specify at least one server context. It is most common for there to be a single value + /// for the Context attribute. + /// + public ContextType Context + { + get + { + return this.contextField; + } + set + { + this.contextFieldSet = true; + this.contextField = value; + } + } + + /// + /// Localized description associated with the Class ID and Program ID. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// This attribute is only allowed when a Class is advertised. Using this attribute will reference an Application ID + /// containing DCOM information for the associated application GUID. The value must correspond to an AppId/@Id of an + /// AppId element nested under a Fragment, Module, or Package element. To associate an AppId with a non-advertised + /// class, nest the class within a parent AppId element. + /// + public string AppId + { + get + { + return this.appIdField; + } + set + { + this.appIdFieldSet = true; + this.appIdField = value; + } + } + + /// + /// The file providing the icon associated with this CLSID. Reference to an Icon element + /// (should match the Id attribute of an Icon element). This is currently not supported if the + /// value of the Advertise attribute is "no". + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// Icon index into the icon file. + /// + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + /// + /// The default inproc handler. May be optionally provided only for Context = LocalServer or + /// LocalServer32. Value of "1" creates a 16-bit InprocHandler (appearing as the InprocHandler + /// value). Value of "2" creates a 32-bit InprocHandler (appearing as the InprocHandler32 value). + /// Value of "3" creates 16-bit as well as 32-bit InprocHandlers. A non-numeric value is treated + /// as a system file that serves as the 32-bit InprocHandler (appearing as the InprocHandler32 value). + /// + public string Handler + { + get + { + return this.handlerField; + } + set + { + this.handlerFieldSet = true; + this.handlerField = value; + } + } + + /// + /// This column is optional only when the Context column is set to "LocalServer" + /// or "LocalServer32" server context. The text is registered as the argument against + /// the OLE server and is used by OLE for invoking the server. Note that the resolution + /// of properties in the Argument field is limited. A property formatted as [Property] in + /// this field can only be resolved if the property already has the intended value when + /// the component owning the class is installed. For example, for the argument "[#MyDoc.doc]" + /// to resolve to the correct value, the same process must be installing the file MyDoc.doc and the + /// component that owns the class. + /// + public string Argument + { + get + { + return this.argumentField; + } + set + { + this.argumentFieldSet = true; + this.argumentField = value; + } + } + + /// + /// When the value is "yes", the bare file name can be used for COM servers. The installer + /// registers the file name only instead of the complete path. This enables the server in + /// the current directory to take precedence and allows multiple copies of the same component. + /// + public YesNoType RelativePath + { + get + { + return this.relativePathField; + } + set + { + this.relativePathFieldSet = true; + this.relativePathField = value; + } + } + + /// + /// Set this value to "yes" in order to create a normal Class table row. Set this value to + /// "no" in order to generate Registry rows that perform similar registration (without the + /// often problematic Windows Installer advertising behavior). + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Threading model for the CLSID. + /// + public ThreadingModelType ThreadingModel + { + get + { + return this.threadingModelField; + } + set + { + this.threadingModelFieldSet = true; + this.threadingModelField = value; + } + } + + /// + /// Version for the CLSID. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + /// + /// Specifies the CLSID may be insertable. + /// + public YesNoType Insertable + { + get + { + return this.insertableField; + } + set + { + this.insertableFieldSet = true; + this.insertableField = value; + } + } + + /// + /// Specifies the CLSID may be programmable. + /// + public YesNoType Programmable + { + get + { + return this.programmableField; + } + set + { + this.programmableFieldSet = true; + this.programmableField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no" and Server has not been specified. In addition, it may only + /// be used when the Class element is directly under the Component element. The value can be + /// that of an registry type (REG_SZ). This attribute should be used to specify foreign servers, such as mscoree.dll if needed. + /// + public string ForeignServer + { + get + { + return this.foreignServerField; + } + set + { + this.foreignServerFieldSet = true; + this.foreignServerField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no" and the ForeignServer attribute is not specified. File Id of the + /// COM server file. If this element is nested under a File element, this value defaults to + /// the value of the parent File/@Id. + /// + public string Server + { + get + { + return this.serverField; + } + set + { + this.serverFieldSet = true; + this.serverField = value; + } + } + + /// + /// Specifies whether or not to use the short path for the COM server. This can only apply when Advertise is set to 'no'. The default is 'no' meaning that it will use the long file name for the COM server. + /// + public YesNoType ShortPath + { + get + { + return this.shortPathField; + } + set + { + this.shortPathFieldSet = true; + this.shortPathField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no". + /// + public YesNoType SafeForScripting + { + get + { + return this.safeForScriptingField; + } + set + { + this.safeForScriptingFieldSet = true; + this.safeForScriptingField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no". + /// + public YesNoType SafeForInitializing + { + get + { + return this.safeForInitializingField; + } + set + { + this.safeForInitializingFieldSet = true; + this.safeForInitializingField = value; + } + } + + /// + /// Set this attribute's value to 'yes' to identify an object as an ActiveX Control. The default value is 'no'. + /// + public YesNoType Control + { + get + { + return this.controlField; + } + set + { + this.controlFieldSet = true; + this.controlField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProgId" == childName)) + { + childValue = new ProgId(); + } + if (("FileTypeMask" == childName)) + { + childValue = new FileTypeMask(); + } + if (("Interface" == childName)) + { + childValue = new Interface(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Tries to parse a ContextType from a string. + /// + public static bool TryParseContextType(string value, out ContextType parsedValue) + { + parsedValue = ContextType.None; + if (string.IsNullOrEmpty(value)) + { + return false; + } + string[] splitValue = value.Split(" \t\r\n".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries); + for (System.Collections.IEnumerator enumerator = splitValue.GetEnumerator(); enumerator.MoveNext(); + ) + { + string currentValue = ((string)(enumerator.Current)); + if (("LocalServer" == currentValue)) + { + parsedValue = (parsedValue | ContextType.LocalServer); + } + else + { + if (("LocalServer32" == currentValue)) + { + parsedValue = (parsedValue | ContextType.LocalServer32); + } + else + { + if (("InprocServer" == currentValue)) + { + parsedValue = (parsedValue | ContextType.InprocServer); + } + else + { + if (("InprocServer32" == currentValue)) + { + parsedValue = (parsedValue | ContextType.InprocServer32); + } + else + { + parsedValue = ContextType.None; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ThreadingModelType from a string. + /// + public static ThreadingModelType ParseThreadingModelType(string value) + { + ThreadingModelType parsedValue; + Class.TryParseThreadingModelType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ThreadingModelType from a string. + /// + public static bool TryParseThreadingModelType(string value, out ThreadingModelType parsedValue) + { + parsedValue = ThreadingModelType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("apartment" == value)) + { + parsedValue = ThreadingModelType.apartment; + } + else + { + if (("free" == value)) + { + parsedValue = ThreadingModelType.free; + } + else + { + if (("both" == value)) + { + parsedValue = ThreadingModelType.both; + } + else + { + if (("neutral" == value)) + { + parsedValue = ThreadingModelType.neutral; + } + else + { + if (("single" == value)) + { + parsedValue = ThreadingModelType.single; + } + else + { + if (("rental" == value)) + { + parsedValue = ThreadingModelType.rental; + } + else + { + parsedValue = ThreadingModelType.IllegalValue; + return false; + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Class", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.contextFieldSet) + { + string outputValue = ""; + if (((this.contextField & ContextType.LocalServer) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "LocalServer"); + } + if (((this.contextField & ContextType.LocalServer32) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "LocalServer32"); + } + if (((this.contextField & ContextType.InprocServer) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "InprocServer"); + } + if (((this.contextField & ContextType.InprocServer32) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "InprocServer32"); + } + writer.WriteAttributeString("Context", outputValue); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.appIdFieldSet) + { + writer.WriteAttributeString("AppId", this.appIdField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + if (this.handlerFieldSet) + { + writer.WriteAttributeString("Handler", this.handlerField); + } + if (this.argumentFieldSet) + { + writer.WriteAttributeString("Argument", this.argumentField); + } + if (this.relativePathFieldSet) + { + if ((this.relativePathField == YesNoType.no)) + { + writer.WriteAttributeString("RelativePath", "no"); + } + if ((this.relativePathField == YesNoType.yes)) + { + writer.WriteAttributeString("RelativePath", "yes"); + } + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.threadingModelFieldSet) + { + if ((this.threadingModelField == ThreadingModelType.apartment)) + { + writer.WriteAttributeString("ThreadingModel", "apartment"); + } + if ((this.threadingModelField == ThreadingModelType.free)) + { + writer.WriteAttributeString("ThreadingModel", "free"); + } + if ((this.threadingModelField == ThreadingModelType.both)) + { + writer.WriteAttributeString("ThreadingModel", "both"); + } + if ((this.threadingModelField == ThreadingModelType.neutral)) + { + writer.WriteAttributeString("ThreadingModel", "neutral"); + } + if ((this.threadingModelField == ThreadingModelType.single)) + { + writer.WriteAttributeString("ThreadingModel", "single"); + } + if ((this.threadingModelField == ThreadingModelType.rental)) + { + writer.WriteAttributeString("ThreadingModel", "rental"); + } + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + if (this.insertableFieldSet) + { + if ((this.insertableField == YesNoType.no)) + { + writer.WriteAttributeString("Insertable", "no"); + } + if ((this.insertableField == YesNoType.yes)) + { + writer.WriteAttributeString("Insertable", "yes"); + } + } + if (this.programmableFieldSet) + { + if ((this.programmableField == YesNoType.no)) + { + writer.WriteAttributeString("Programmable", "no"); + } + if ((this.programmableField == YesNoType.yes)) + { + writer.WriteAttributeString("Programmable", "yes"); + } + } + if (this.foreignServerFieldSet) + { + writer.WriteAttributeString("ForeignServer", this.foreignServerField); + } + if (this.serverFieldSet) + { + writer.WriteAttributeString("Server", this.serverField); + } + if (this.shortPathFieldSet) + { + if ((this.shortPathField == YesNoType.no)) + { + writer.WriteAttributeString("ShortPath", "no"); + } + if ((this.shortPathField == YesNoType.yes)) + { + writer.WriteAttributeString("ShortPath", "yes"); + } + } + if (this.safeForScriptingFieldSet) + { + if ((this.safeForScriptingField == YesNoType.no)) + { + writer.WriteAttributeString("SafeForScripting", "no"); + } + if ((this.safeForScriptingField == YesNoType.yes)) + { + writer.WriteAttributeString("SafeForScripting", "yes"); + } + } + if (this.safeForInitializingFieldSet) + { + if ((this.safeForInitializingField == YesNoType.no)) + { + writer.WriteAttributeString("SafeForInitializing", "no"); + } + if ((this.safeForInitializingField == YesNoType.yes)) + { + writer.WriteAttributeString("SafeForInitializing", "yes"); + } + } + if (this.controlFieldSet) + { + if ((this.controlField == YesNoType.no)) + { + writer.WriteAttributeString("Control", "no"); + } + if ((this.controlField == YesNoType.yes)) + { + writer.WriteAttributeString("Control", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Context" == name)) + { + Class.TryParseContextType(value, out this.contextField); + this.contextFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("AppId" == name)) + { + this.appIdField = value; + this.appIdFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + if (("Handler" == name)) + { + this.handlerField = value; + this.handlerFieldSet = true; + } + if (("Argument" == name)) + { + this.argumentField = value; + this.argumentFieldSet = true; + } + if (("RelativePath" == name)) + { + this.relativePathField = Enums.ParseYesNoType(value); + this.relativePathFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("ThreadingModel" == name)) + { + this.threadingModelField = Class.ParseThreadingModelType(value); + this.threadingModelFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + if (("Insertable" == name)) + { + this.insertableField = Enums.ParseYesNoType(value); + this.insertableFieldSet = true; + } + if (("Programmable" == name)) + { + this.programmableField = Enums.ParseYesNoType(value); + this.programmableFieldSet = true; + } + if (("ForeignServer" == name)) + { + this.foreignServerField = value; + this.foreignServerFieldSet = true; + } + if (("Server" == name)) + { + this.serverField = value; + this.serverFieldSet = true; + } + if (("ShortPath" == name)) + { + this.shortPathField = Enums.ParseYesNoType(value); + this.shortPathFieldSet = true; + } + if (("SafeForScripting" == name)) + { + this.safeForScriptingField = Enums.ParseYesNoType(value); + this.safeForScriptingFieldSet = true; + } + if (("SafeForInitializing" == name)) + { + this.safeForInitializingField = Enums.ParseYesNoType(value); + this.safeForInitializingFieldSet = true; + } + if (("Control" == name)) + { + this.controlField = Enums.ParseYesNoType(value); + this.controlFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + [Flags()] + public enum ContextType + { + + None = 0, + + /// + /// A 16-bit local server application. + /// + LocalServer = 1, + + /// + /// A 32-bit local server application. + /// + LocalServer32 = 2, + + /// + /// A 16-bit in-process server DLL. + /// + InprocServer = 4, + + /// + /// A 32-bit in-process server DLL. + /// + InprocServer32 = 8, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ThreadingModelType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + apartment, + + free, + + both, + + neutral, + + single, + + rental, + } + } + + /// + /// COM Interface registration for parent TypeLib. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Interface : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string baseInterfaceField; + + private bool baseInterfaceFieldSet; + + private string proxyStubClassIdField; + + private bool proxyStubClassIdFieldSet; + + private string proxyStubClassId32Field; + + private bool proxyStubClassId32FieldSet; + + private int numMethodsField; + + private bool numMethodsFieldSet; + + private YesNoType versionedField; + + private bool versionedFieldSet; + + private ISchemaElement parentElement; + + /// + /// GUID identifier for COM Interface. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for COM Interface. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Identifies the interface from which the current interface is derived. + /// + public string BaseInterface + { + get + { + return this.baseInterfaceField; + } + set + { + this.baseInterfaceFieldSet = true; + this.baseInterfaceField = value; + } + } + + /// + /// GUID CLSID for proxy stub to COM Interface. + /// + public string ProxyStubClassId + { + get + { + return this.proxyStubClassIdField; + } + set + { + this.proxyStubClassIdFieldSet = true; + this.proxyStubClassIdField = value; + } + } + + /// + /// GUID CLSID for 32-bit proxy stub to COM Interface. + /// + public string ProxyStubClassId32 + { + get + { + return this.proxyStubClassId32Field; + } + set + { + this.proxyStubClassId32FieldSet = true; + this.proxyStubClassId32Field = value; + } + } + + /// + /// Number of methods implemented on COM Interface. + /// + public int NumMethods + { + get + { + return this.numMethodsField; + } + set + { + this.numMethodsFieldSet = true; + this.numMethodsField = value; + } + } + + /// + /// Determines whether a Typelib version entry should be created with the other COM Interface registry keys. Default is 'yes'. + /// + public YesNoType Versioned + { + get + { + return this.versionedField; + } + set + { + this.versionedFieldSet = true; + this.versionedField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Interface", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.baseInterfaceFieldSet) + { + writer.WriteAttributeString("BaseInterface", this.baseInterfaceField); + } + if (this.proxyStubClassIdFieldSet) + { + writer.WriteAttributeString("ProxyStubClassId", this.proxyStubClassIdField); + } + if (this.proxyStubClassId32FieldSet) + { + writer.WriteAttributeString("ProxyStubClassId32", this.proxyStubClassId32Field); + } + if (this.numMethodsFieldSet) + { + writer.WriteAttributeString("NumMethods", this.numMethodsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.versionedFieldSet) + { + if ((this.versionedField == YesNoType.no)) + { + writer.WriteAttributeString("Versioned", "no"); + } + if ((this.versionedField == YesNoType.yes)) + { + writer.WriteAttributeString("Versioned", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("BaseInterface" == name)) + { + this.baseInterfaceField = value; + this.baseInterfaceFieldSet = true; + } + if (("ProxyStubClassId" == name)) + { + this.proxyStubClassIdField = value; + this.proxyStubClassIdFieldSet = true; + } + if (("ProxyStubClassId32" == name)) + { + this.proxyStubClassId32Field = value; + this.proxyStubClassId32FieldSet = true; + } + if (("NumMethods" == name)) + { + this.numMethodsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.numMethodsFieldSet = true; + } + if (("Versioned" == name)) + { + this.versionedField = Enums.ParseYesNoType(value); + this.versionedFieldSet = true; + } + } + } + + /// + /// FileType data for class Id registration. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileTypeMask : ISchemaElement, ISetAttributes + { + + private int offsetField; + + private bool offsetFieldSet; + + private string maskField; + + private bool maskFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Offset into file. If positive, offset is from the beginning; if negative, offset is from the end. + /// + public int Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetFieldSet = true; + this.offsetField = value; + } + } + + /// + /// Hex value that is AND'd against the bytes in the file at Offset. + /// + public string Mask + { + get + { + return this.maskField; + } + set + { + this.maskFieldSet = true; + this.maskField = value; + } + } + + /// + /// If the result of the AND'ing of Mask with the bytes in the file is Value, the file is a match for this File Type. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileTypeMask", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.offsetFieldSet) + { + writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maskFieldSet) + { + writer.WriteAttributeString("Mask", this.maskField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Offset" == name)) + { + this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.offsetFieldSet = true; + } + if (("Mask" == name)) + { + this.maskField = value; + this.maskFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Service or group of services that must start before the parent service. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceDependency : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType groupField; + + private bool groupFieldSet; + + private ISchemaElement parentElement; + + /// + /// The value of this attribute should be one of the following: + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set to 'yes' to indicate that the value in the Id attribute is the name of a group of services. + /// + public YesNoType Group + { + get + { + return this.groupField; + } + set + { + this.groupFieldSet = true; + this.groupField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceDependency", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.groupFieldSet) + { + if ((this.groupField == YesNoType.no)) + { + writer.WriteAttributeString("Group", "no"); + } + if ((this.groupField == YesNoType.yes)) + { + writer.WriteAttributeString("Group", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Group" == name)) + { + this.groupField = Enums.ParseYesNoType(value); + this.groupFieldSet = true; + } + } + } + + /// + /// Adds services for parent Component. Use the ServiceControl element to remove services. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceInstall : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private YesNoType interactiveField; + + private bool interactiveFieldSet; + + private StartType startField; + + private bool startFieldSet; + + private ErrorControlType errorControlField; + + private bool errorControlFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private string loadOrderGroupField; + + private bool loadOrderGroupFieldSet; + + private string accountField; + + private bool accountFieldSet; + + private string passwordField; + + private bool passwordFieldSet; + + private string argumentsField; + + private bool argumentsFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private YesNoType eraseDescriptionField; + + private bool eraseDescriptionFieldSet; + + private ISchemaElement parentElement; + + public ServiceInstall() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceDependency))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfig))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfigFailureActions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for this service configuration. This value will default to the Name attribute if not + /// specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This column is the string that gives the service name to install. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// This column is the localizable string that user interface programs use to identify the service. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// The Windows Installer does not currently support kernelDriver or systemDriver. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Whether or not the service interacts with the desktop. + /// + public YesNoType Interactive + { + get + { + return this.interactiveField; + } + set + { + this.interactiveFieldSet = true; + this.interactiveField = value; + } + } + + /// + /// Determines when the service should be started. The Windows Installer does not support boot or system. + /// + public StartType Start + { + get + { + return this.startField; + } + set + { + this.startFieldSet = true; + this.startField = value; + } + } + + /// + /// Determines what action should be taken on an error. + /// + public ErrorControlType ErrorControl + { + get + { + return this.errorControlField; + } + set + { + this.errorControlFieldSet = true; + this.errorControlField = value; + } + } + + /// + /// The overall install should fail if this service fails to install. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// The load ordering group that this service should be a part of. + /// + public string LoadOrderGroup + { + get + { + return this.loadOrderGroupField; + } + set + { + this.loadOrderGroupFieldSet = true; + this.loadOrderGroupField = value; + } + } + + /// + /// Fully qualified names must be used even for local accounts, e.g.: ".\LOCAL_ACCOUNT". Valid only when ServiceType is ownProcess. + /// + public string Account + { + get + { + return this.accountField; + } + set + { + this.accountFieldSet = true; + this.accountField = value; + } + } + + /// + /// The password for the account. Valid only when the account has a password. + /// + public string Password + { + get + { + return this.passwordField; + } + set + { + this.passwordFieldSet = true; + this.passwordField = value; + } + } + + /// + /// Contains any command line arguments or properties required to run the service. + /// + public string Arguments + { + get + { + return this.argumentsField; + } + set + { + this.argumentsFieldSet = true; + this.argumentsField = value; + } + } + + /// + /// Sets the description of the service. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Determines whether the existing service description will be ignored. If 'yes', the service description will be null, even if the Description attribute is set. + /// + public YesNoType EraseDescription + { + get + { + return this.eraseDescriptionField; + } + set + { + this.eraseDescriptionFieldSet = true; + this.eraseDescriptionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("ServiceDependency" == childName)) + { + childValue = new ServiceDependency(); + } + if (("ServiceConfig" == childName)) + { + childValue = new ServiceConfig(); + } + if (("ServiceConfigFailureActions" == childName)) + { + childValue = new ServiceConfigFailureActions(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + ServiceInstall.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ownProcess" == value)) + { + parsedValue = TypeType.ownProcess; + } + else + { + if (("shareProcess" == value)) + { + parsedValue = TypeType.shareProcess; + } + else + { + if (("kernelDriver" == value)) + { + parsedValue = TypeType.kernelDriver; + } + else + { + if (("systemDriver" == value)) + { + parsedValue = TypeType.systemDriver; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a StartType from a string. + /// + public static StartType ParseStartType(string value) + { + StartType parsedValue; + ServiceInstall.TryParseStartType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a StartType from a string. + /// + public static bool TryParseStartType(string value, out StartType parsedValue) + { + parsedValue = StartType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("auto" == value)) + { + parsedValue = StartType.auto; + } + else + { + if (("demand" == value)) + { + parsedValue = StartType.demand; + } + else + { + if (("disabled" == value)) + { + parsedValue = StartType.disabled; + } + else + { + if (("boot" == value)) + { + parsedValue = StartType.boot; + } + else + { + if (("system" == value)) + { + parsedValue = StartType.system; + } + else + { + parsedValue = StartType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ErrorControlType from a string. + /// + public static ErrorControlType ParseErrorControlType(string value) + { + ErrorControlType parsedValue; + ServiceInstall.TryParseErrorControlType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ErrorControlType from a string. + /// + public static bool TryParseErrorControlType(string value, out ErrorControlType parsedValue) + { + parsedValue = ErrorControlType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ignore" == value)) + { + parsedValue = ErrorControlType.ignore; + } + else + { + if (("normal" == value)) + { + parsedValue = ErrorControlType.normal; + } + else + { + if (("critical" == value)) + { + parsedValue = ErrorControlType.critical; + } + else + { + parsedValue = ErrorControlType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceInstall", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.ownProcess)) + { + writer.WriteAttributeString("Type", "ownProcess"); + } + if ((this.typeField == TypeType.shareProcess)) + { + writer.WriteAttributeString("Type", "shareProcess"); + } + if ((this.typeField == TypeType.kernelDriver)) + { + writer.WriteAttributeString("Type", "kernelDriver"); + } + if ((this.typeField == TypeType.systemDriver)) + { + writer.WriteAttributeString("Type", "systemDriver"); + } + } + if (this.interactiveFieldSet) + { + if ((this.interactiveField == YesNoType.no)) + { + writer.WriteAttributeString("Interactive", "no"); + } + if ((this.interactiveField == YesNoType.yes)) + { + writer.WriteAttributeString("Interactive", "yes"); + } + } + if (this.startFieldSet) + { + if ((this.startField == StartType.auto)) + { + writer.WriteAttributeString("Start", "auto"); + } + if ((this.startField == StartType.demand)) + { + writer.WriteAttributeString("Start", "demand"); + } + if ((this.startField == StartType.disabled)) + { + writer.WriteAttributeString("Start", "disabled"); + } + if ((this.startField == StartType.boot)) + { + writer.WriteAttributeString("Start", "boot"); + } + if ((this.startField == StartType.system)) + { + writer.WriteAttributeString("Start", "system"); + } + } + if (this.errorControlFieldSet) + { + if ((this.errorControlField == ErrorControlType.ignore)) + { + writer.WriteAttributeString("ErrorControl", "ignore"); + } + if ((this.errorControlField == ErrorControlType.normal)) + { + writer.WriteAttributeString("ErrorControl", "normal"); + } + if ((this.errorControlField == ErrorControlType.critical)) + { + writer.WriteAttributeString("ErrorControl", "critical"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.loadOrderGroupFieldSet) + { + writer.WriteAttributeString("LoadOrderGroup", this.loadOrderGroupField); + } + if (this.accountFieldSet) + { + writer.WriteAttributeString("Account", this.accountField); + } + if (this.passwordFieldSet) + { + writer.WriteAttributeString("Password", this.passwordField); + } + if (this.argumentsFieldSet) + { + writer.WriteAttributeString("Arguments", this.argumentsField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.eraseDescriptionFieldSet) + { + if ((this.eraseDescriptionField == YesNoType.no)) + { + writer.WriteAttributeString("EraseDescription", "no"); + } + if ((this.eraseDescriptionField == YesNoType.yes)) + { + writer.WriteAttributeString("EraseDescription", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = ServiceInstall.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Interactive" == name)) + { + this.interactiveField = Enums.ParseYesNoType(value); + this.interactiveFieldSet = true; + } + if (("Start" == name)) + { + this.startField = ServiceInstall.ParseStartType(value); + this.startFieldSet = true; + } + if (("ErrorControl" == name)) + { + this.errorControlField = ServiceInstall.ParseErrorControlType(value); + this.errorControlFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("LoadOrderGroup" == name)) + { + this.loadOrderGroupField = value; + this.loadOrderGroupFieldSet = true; + } + if (("Account" == name)) + { + this.accountField = value; + this.accountFieldSet = true; + } + if (("Password" == name)) + { + this.passwordField = value; + this.passwordFieldSet = true; + } + if (("Arguments" == name)) + { + this.argumentsField = value; + this.argumentsFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("EraseDescription" == name)) + { + this.eraseDescriptionField = Enums.ParseYesNoType(value); + this.eraseDescriptionFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// A Win32 service that runs its own process. + /// + ownProcess, + + /// + /// A Win32 service that shares a process. + /// + shareProcess, + + /// + /// A kernel driver service. This value is not currently supported by the Windows Installer. + /// + kernelDriver, + + /// + /// A file system driver service. This value is not currently supported by the Windows Installer. + /// + systemDriver, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum StartType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The service will start during startup of the system. + /// + auto, + + /// + /// The service will start when the service control manager calls the StartService function. + /// + demand, + + /// + /// The service can no longer be started. + /// + disabled, + + /// + /// The service is a device driver that will be started by the operating system boot loader. This value is not currently supported by the Windows Installer. + /// + boot, + + /// + /// The service is a device driver that will be started by the IoInitSystem function. This value is not currently supported by the Windows Installer. + /// + system, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ErrorControlType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Logs the error and continues with the startup operation. + /// + ignore, + + /// + /// Logs the error, displays a message box and continues the startup operation. + /// + normal, + + /// + /// Logs the error if it is possible and the system is restarted with the last configuration known to be good. If the last-known-good configuration is being started, the startup operation fails. + /// + critical, + } + } + + /// + /// Argument used in ServiceControl parent + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceArgument : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Argument used in ServiceControl parent + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceArgument", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Starts, stops, and removes services for parent Component. This element is used to control the state + /// of a service installed by the MSI or MSM file by using the start, stop and remove attributes. + /// For example, Start='install' Stop='both' Remove='uninstall' would mean: start the service on install, + /// remove the service when the product is uninstalled, and stop the service both on install and uninstall. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceControl : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private InstallUninstallType startField; + + private bool startFieldSet; + + private InstallUninstallType stopField; + + private bool stopFieldSet; + + private InstallUninstallType removeField; + + private bool removeFieldSet; + + private YesNoType waitField; + + private bool waitFieldSet; + + private ISchemaElement parentElement; + + public ServiceControl() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ServiceArgument))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the service. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Specifies whether the service should be started by the StartServices action on install, uninstall or both. + /// For 'install', the service will be started only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the service will be started only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the service will be started in both cases. + /// + public InstallUninstallType Start + { + get + { + return this.startField; + } + set + { + this.startFieldSet = true; + this.startField = value; + } + } + + /// + /// Specifies whether the service should be stopped by the StopServices action on install, uninstall or both. + /// For 'install', the service will be stopped only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the service will be stopped only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the service will be stopped in both cases. + /// + public InstallUninstallType Stop + { + get + { + return this.stopField; + } + set + { + this.stopFieldSet = true; + this.stopField = value; + } + } + + /// + /// Specifies whether the service should be removed by the DeleteServices action on install, uninstall or both. + /// For 'install', the service will be removed only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the service will be removed only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the service will be removed in both cases. + /// + public InstallUninstallType Remove + { + get + { + return this.removeField; + } + set + { + this.removeFieldSet = true; + this.removeField = value; + } + } + + /// + /// Specifies whether or not to wait for the service to complete before continuing. The default is 'yes'. + /// + public YesNoType Wait + { + get + { + return this.waitField; + } + set + { + this.waitFieldSet = true; + this.waitField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ServiceArgument" == childName)) + { + childValue = new ServiceArgument(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceControl", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.startFieldSet) + { + if ((this.startField == InstallUninstallType.install)) + { + writer.WriteAttributeString("Start", "install"); + } + if ((this.startField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("Start", "uninstall"); + } + if ((this.startField == InstallUninstallType.both)) + { + writer.WriteAttributeString("Start", "both"); + } + } + if (this.stopFieldSet) + { + if ((this.stopField == InstallUninstallType.install)) + { + writer.WriteAttributeString("Stop", "install"); + } + if ((this.stopField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("Stop", "uninstall"); + } + if ((this.stopField == InstallUninstallType.both)) + { + writer.WriteAttributeString("Stop", "both"); + } + } + if (this.removeFieldSet) + { + if ((this.removeField == InstallUninstallType.install)) + { + writer.WriteAttributeString("Remove", "install"); + } + if ((this.removeField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("Remove", "uninstall"); + } + if ((this.removeField == InstallUninstallType.both)) + { + writer.WriteAttributeString("Remove", "both"); + } + } + if (this.waitFieldSet) + { + if ((this.waitField == YesNoType.no)) + { + writer.WriteAttributeString("Wait", "no"); + } + if ((this.waitField == YesNoType.yes)) + { + writer.WriteAttributeString("Wait", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Start" == name)) + { + this.startField = Enums.ParseInstallUninstallType(value); + this.startFieldSet = true; + } + if (("Stop" == name)) + { + this.stopField = Enums.ParseInstallUninstallType(value); + this.stopFieldSet = true; + } + if (("Remove" == name)) + { + this.removeField = Enums.ParseInstallUninstallType(value); + this.removeFieldSet = true; + } + if (("Wait" == name)) + { + this.waitField = Enums.ParseYesNoType(value); + this.waitFieldSet = true; + } + } + } + + /// + /// Privilege required by service configured by ServiceConfig parent. Valid values are a + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RequiredPrivilege : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Privilege required by service configured by ServiceConfig parent. Valid values are a + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RequiredPrivilege", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Configures a service being installed or one that already exists. This element's functionality is available starting with MSI 5.0. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceConfig : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string delayedAutoStartField; + + private bool delayedAutoStartFieldSet; + + private string failureActionsWhenField; + + private bool failureActionsWhenFieldSet; + + private string preShutdownDelayField; + + private bool preShutdownDelayFieldSet; + + private YesNoType onInstallField; + + private bool onInstallFieldSet; + + private YesNoType onReinstallField; + + private bool onReinstallFieldSet; + + private YesNoType onUninstallField; + + private bool onUninstallFieldSet; + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private string serviceSidField; + + private bool serviceSidFieldSet; + + private ISchemaElement parentElement; + + public ServiceConfig() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RequiredPrivilege))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for this service configuration. This value will default to the ServiceName attribute if not + /// specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute specifies whether an auto-start service should delay its start until after all other auto-start + /// services. This attribute only affects auto-start services. Allowed values are "yes", "no" or a Formatted property that + /// resolves to "1" (for "yes") or "0" (for "no"). If this attribute is not present the setting is not configured. + /// + public string DelayedAutoStart + { + get + { + return this.delayedAutoStartField; + } + set + { + this.delayedAutoStartFieldSet = true; + this.delayedAutoStartField = value; + } + } + + /// + /// This attribute specifies when failure actions should be applied. Allowed values are "failedToStop", "failedToStopOrReturnedError" + /// or a Formatted property that resolves to "1" (for "failedToStopOrReturnedError") or "0" (for "failedToStop"). If this attribute + /// is not present the setting is not configured. + /// + public string FailureActionsWhen + { + get + { + return this.failureActionsWhenField; + } + set + { + this.failureActionsWhenFieldSet = true; + this.failureActionsWhenField = value; + } + } + + /// + /// This attribute specifies time in milliseconds that the Service Control Manager (SCM) waits after notifying the service of a system + /// shutdown. If this attribute is not present the default value, 3 minutes, is used. + /// + public string PreShutdownDelay + { + get + { + return this.preShutdownDelayField; + } + set + { + this.preShutdownDelayFieldSet = true; + this.preShutdownDelayField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall + /// and OnUninstall. + /// + public YesNoType OnInstall + { + get + { + return this.onInstallField; + } + set + { + this.onInstallFieldSet = true; + this.onInstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall + /// and OnUninstall. + /// + public YesNoType OnReinstall + { + get + { + return this.onReinstallField; + } + set + { + this.onReinstallFieldSet = true; + this.onReinstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall + /// and OnReinstall. + /// + public YesNoType OnUninstall + { + get + { + return this.onUninstallField; + } + set + { + this.onUninstallFieldSet = true; + this.onUninstallField = value; + } + } + + /// + /// Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under + /// a ServiceInstall element. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + /// + /// Specifies the service SID to apply to the service. Valid values are "none", "restricted", "unrestricted" or a Formatted property + /// that resolves to "0" (for "none"), "3" (for "restricted") or "1" (for "unrestricted"). If this attribute is not present the + /// setting is not configured. + /// + public string ServiceSid + { + get + { + return this.serviceSidField; + } + set + { + this.serviceSidFieldSet = true; + this.serviceSidField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RequiredPrivilege" == childName)) + { + childValue = new RequiredPrivilege(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceConfig", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.delayedAutoStartFieldSet) + { + writer.WriteAttributeString("DelayedAutoStart", this.delayedAutoStartField); + } + if (this.failureActionsWhenFieldSet) + { + writer.WriteAttributeString("FailureActionsWhen", this.failureActionsWhenField); + } + if (this.preShutdownDelayFieldSet) + { + writer.WriteAttributeString("PreShutdownDelay", this.preShutdownDelayField); + } + if (this.onInstallFieldSet) + { + if ((this.onInstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnInstall", "no"); + } + if ((this.onInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnInstall", "yes"); + } + } + if (this.onReinstallFieldSet) + { + if ((this.onReinstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnReinstall", "no"); + } + if ((this.onReinstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnReinstall", "yes"); + } + } + if (this.onUninstallFieldSet) + { + if ((this.onUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnUninstall", "no"); + } + if ((this.onUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnUninstall", "yes"); + } + } + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + if (this.serviceSidFieldSet) + { + writer.WriteAttributeString("ServiceSid", this.serviceSidField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("DelayedAutoStart" == name)) + { + this.delayedAutoStartField = value; + this.delayedAutoStartFieldSet = true; + } + if (("FailureActionsWhen" == name)) + { + this.failureActionsWhenField = value; + this.failureActionsWhenFieldSet = true; + } + if (("PreShutdownDelay" == name)) + { + this.preShutdownDelayField = value; + this.preShutdownDelayFieldSet = true; + } + if (("OnInstall" == name)) + { + this.onInstallField = Enums.ParseYesNoType(value); + this.onInstallFieldSet = true; + } + if (("OnReinstall" == name)) + { + this.onReinstallField = Enums.ParseYesNoType(value); + this.onReinstallFieldSet = true; + } + if (("OnUninstall" == name)) + { + this.onUninstallField = Enums.ParseYesNoType(value); + this.onUninstallFieldSet = true; + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + if (("ServiceSid" == name)) + { + this.serviceSidField = value; + this.serviceSidFieldSet = true; + } + } + } + + /// + /// Failure action for a ServiceConfigFailureActions element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Failure : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string delayField; + + private bool delayFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the action to take when the service fails. Valid values are "none", "restartComputer", "restartService", "runCommand" or a Formatted property + /// that resolves to "0" (for "none"), "1" (for "restartService"), "2" (for "restartComputer") or "3" (for "runCommand"). + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Specifies the time in milliseconds to wait before performing the value from the Action attribute. + /// + public string Delay + { + get + { + return this.delayField; + } + set + { + this.delayFieldSet = true; + this.delayField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Failure", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.delayFieldSet) + { + writer.WriteAttributeString("Delay", this.delayField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("Delay" == name)) + { + this.delayField = value; + this.delayFieldSet = true; + } + } + } + + /// + /// Configures the failure actions for a service being installed or one that already exists. This element's functionality is available starting with MSI 5.0. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceConfigFailureActions : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string commandField; + + private bool commandFieldSet; + + private YesNoType onInstallField; + + private bool onInstallFieldSet; + + private YesNoType onReinstallField; + + private bool onReinstallFieldSet; + + private YesNoType onUninstallField; + + private bool onUninstallFieldSet; + + private string rebootMessageField; + + private bool rebootMessageFieldSet; + + private string resetPeriodField; + + private bool resetPeriodFieldSet; + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private ISchemaElement parentElement; + + public ServiceConfigFailureActions() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Failure))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for this service configuration. This value will default to the ServiceName attribute if not + /// specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute specifies command to execute when a "runCommand" failure action hit. If an empty string is provided it clears + /// the existing command. If this attribute is not present the setting is not changed. + /// + public string Command + { + get + { + return this.commandField; + } + set + { + this.commandFieldSet = true; + this.commandField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall + /// and OnUninstall. + /// + public YesNoType OnInstall + { + get + { + return this.onInstallField; + } + set + { + this.onInstallFieldSet = true; + this.onInstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall + /// and OnUninstall. + /// + public YesNoType OnReinstall + { + get + { + return this.onReinstallField; + } + set + { + this.onReinstallFieldSet = true; + this.onReinstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall + /// and OnReinstall. + /// + public YesNoType OnUninstall + { + get + { + return this.onUninstallField; + } + set + { + this.onUninstallFieldSet = true; + this.onUninstallField = value; + } + } + + /// + /// Specifies the message to show for a reboot failure action. If an empty string is provided it clears any existing reboot message. If this + /// attribute is not present the setting is not changed. + /// + public string RebootMessage + { + get + { + return this.rebootMessageField; + } + set + { + this.rebootMessageFieldSet = true; + this.rebootMessageField = value; + } + } + + /// + /// Specifies the time in seconds to reset the failure count. If this attribute is not present the failure count will not be reset. + /// + public string ResetPeriod + { + get + { + return this.resetPeriodField; + } + set + { + this.resetPeriodFieldSet = true; + this.resetPeriodField = value; + } + } + + /// + /// Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under + /// a ServiceInstall element. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Failure" == childName)) + { + childValue = new Failure(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceConfigFailureActions", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.commandFieldSet) + { + writer.WriteAttributeString("Command", this.commandField); + } + if (this.onInstallFieldSet) + { + if ((this.onInstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnInstall", "no"); + } + if ((this.onInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnInstall", "yes"); + } + } + if (this.onReinstallFieldSet) + { + if ((this.onReinstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnReinstall", "no"); + } + if ((this.onReinstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnReinstall", "yes"); + } + } + if (this.onUninstallFieldSet) + { + if ((this.onUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnUninstall", "no"); + } + if ((this.onUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnUninstall", "yes"); + } + } + if (this.rebootMessageFieldSet) + { + writer.WriteAttributeString("RebootMessage", this.rebootMessageField); + } + if (this.resetPeriodFieldSet) + { + writer.WriteAttributeString("ResetPeriod", this.resetPeriodField); + } + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Command" == name)) + { + this.commandField = value; + this.commandFieldSet = true; + } + if (("OnInstall" == name)) + { + this.onInstallField = Enums.ParseYesNoType(value); + this.onInstallFieldSet = true; + } + if (("OnReinstall" == name)) + { + this.onReinstallField = Enums.ParseYesNoType(value); + this.onReinstallFieldSet = true; + } + if (("OnUninstall" == name)) + { + this.onUninstallField = Enums.ParseYesNoType(value); + this.onUninstallFieldSet = true; + } + if (("RebootMessage" == name)) + { + this.rebootMessageField = value; + this.rebootMessageFieldSet = true; + } + if (("ResetPeriod" == name)) + { + this.resetPeriodField = value; + this.resetPeriodFieldSet = true; + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + } + } + + /// + /// Environment variables added or removed for the parent component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Environment : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string separatorField; + + private bool separatorFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private PartType partField; + + private bool partFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType systemField; + + private bool systemFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for environment entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the environment variable. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value to set into the environment variable. + /// If this attribute is not set, the environment variable is removed during installation if it exists on the machine. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Optional attribute to change the separator used between values. By default a semicolon is used. + /// + public string Separator + { + get + { + return this.separatorField; + } + set + { + this.separatorFieldSet = true; + this.separatorField = value; + } + } + + /// + /// Specfies whether the environmental variable should be created, set or removed when the parent component is installed. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + public PartType Part + { + get + { + return this.partField; + } + set + { + this.partFieldSet = true; + this.partField = value; + } + } + + /// + /// Specifies that the environment variable should not be removed on uninstall. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies that the environment variable should be added to the system environment space. The default + /// is 'no' which indicates the environment variable is added to the user environment space. + /// + public YesNoType System + { + get + { + return this.systemField; + } + set + { + this.systemFieldSet = true; + this.systemField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + Environment.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("create" == value)) + { + parsedValue = ActionType.create; + } + else + { + if (("set" == value)) + { + parsedValue = ActionType.set; + } + else + { + if (("remove" == value)) + { + parsedValue = ActionType.remove; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a PartType from a string. + /// + public static PartType ParsePartType(string value) + { + PartType parsedValue; + Environment.TryParsePartType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PartType from a string. + /// + public static bool TryParsePartType(string value, out PartType parsedValue) + { + parsedValue = PartType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("all" == value)) + { + parsedValue = PartType.all; + } + else + { + if (("first" == value)) + { + parsedValue = PartType.first; + } + else + { + if (("last" == value)) + { + parsedValue = PartType.last; + } + else + { + parsedValue = PartType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Environment", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.separatorFieldSet) + { + writer.WriteAttributeString("Separator", this.separatorField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.create)) + { + writer.WriteAttributeString("Action", "create"); + } + if ((this.actionField == ActionType.set)) + { + writer.WriteAttributeString("Action", "set"); + } + if ((this.actionField == ActionType.remove)) + { + writer.WriteAttributeString("Action", "remove"); + } + } + if (this.partFieldSet) + { + if ((this.partField == PartType.all)) + { + writer.WriteAttributeString("Part", "all"); + } + if ((this.partField == PartType.first)) + { + writer.WriteAttributeString("Part", "first"); + } + if ((this.partField == PartType.last)) + { + writer.WriteAttributeString("Part", "last"); + } + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.systemFieldSet) + { + if ((this.systemField == YesNoType.no)) + { + writer.WriteAttributeString("System", "no"); + } + if ((this.systemField == YesNoType.yes)) + { + writer.WriteAttributeString("System", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Separator" == name)) + { + this.separatorField = value; + this.separatorFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = Environment.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Part" == name)) + { + this.partField = Environment.ParsePartType(value); + this.partFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("System" == name)) + { + this.systemField = Enums.ParseYesNoType(value); + this.systemFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates the environment variable if it does not exist, then set it during installation. This has no effect on the value of the environment variable if it already exists. + /// + create, + + /// + /// Creates the environment variable if it does not exist, and then set it during installation. If the environment variable exists, set it during the installation. + /// + set, + + /// + /// Removes the environment variable during an installation. + /// The installer only removes an environment variable during an installation if the name and value + /// of the variable match the entries in the Name and Value attributes. + /// If you want to remove an environment variable, regardless of its value, do not set the Value attribute. + /// + remove, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum PartType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// This value is the entire environmental variable. This is the default. + /// + all, + + /// + /// This value is prefixed. + /// + first, + + /// + /// This value is appended. + /// + last, + } + } + + /// + /// Conditions for components, controls, features, and products. The condition is specified in the inner text of the element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Condition : ISchemaElement, ISetAttributes + { + + private ActionType actionField; + + private bool actionFieldSet; + + private int levelField; + + private bool levelFieldSet; + + private string messageField; + + private bool messageFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Used only under Control elements and is required. Allows specific actions to be applied to a control based + /// on the result of this condition. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Used only under Feature elements and is required. Allows modifying the level of a Feature based on the + /// result of this condition. + /// + public int Level + { + get + { + return this.levelField; + } + set + { + this.levelFieldSet = true; + this.levelField = value; + } + } + + /// + /// Used only under Fragment or Package elements and is required. Set the value to the text to display when the + /// condition fails and the installation must be terminated. + /// + public string Message + { + get + { + return this.messageField; + } + set + { + this.messageFieldSet = true; + this.messageField = value; + } + } + + /// + /// Under a Component element, the condition becomes the condition of the component. Under a Control element, + /// the condition becomes a ControlCondition entry. Under a Feature element, the condition becomes a Condition + /// entry. Under a Fragment or Package element, the condition becomes a LaunchCondition entry. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + Condition.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("default" == value)) + { + parsedValue = ActionType.@default; + } + else + { + if (("enable" == value)) + { + parsedValue = ActionType.enable; + } + else + { + if (("disable" == value)) + { + parsedValue = ActionType.disable; + } + else + { + if (("hide" == value)) + { + parsedValue = ActionType.hide; + } + else + { + if (("show" == value)) + { + parsedValue = ActionType.show; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Condition", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.@default)) + { + writer.WriteAttributeString("Action", "default"); + } + if ((this.actionField == ActionType.enable)) + { + writer.WriteAttributeString("Action", "enable"); + } + if ((this.actionField == ActionType.disable)) + { + writer.WriteAttributeString("Action", "disable"); + } + if ((this.actionField == ActionType.hide)) + { + writer.WriteAttributeString("Action", "hide"); + } + if ((this.actionField == ActionType.show)) + { + writer.WriteAttributeString("Action", "show"); + } + } + if (this.levelFieldSet) + { + writer.WriteAttributeString("Level", this.levelField.ToString(CultureInfo.InvariantCulture)); + } + if (this.messageFieldSet) + { + writer.WriteAttributeString("Message", this.messageField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = Condition.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Level" == name)) + { + this.levelField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.levelFieldSet = true; + } + if (("Message" == name)) + { + this.messageField = value; + this.messageFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set the Control as the default. Only used under Control elements. + /// + @default, + + /// + /// Enable the Control. Only used under Control elements. + /// + enable, + + /// + /// Disable the Control. Only used under Control elements. + /// + disable, + + /// + /// Hide the Control. Only used under Control elements. + /// + hide, + + /// + /// Display the Control. Only used under Control elements. + /// + show, + } + } + + /// + /// Shared Component to be privately replicated in folder of parent Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IsolateComponent : ISchemaElement, ISetAttributes + { + + private string sharedField; + + private bool sharedFieldSet; + + private ISchemaElement parentElement; + + /// + /// Shared Component for this application Component. + /// + public string Shared + { + get + { + return this.sharedField; + } + set + { + this.sharedFieldSet = true; + this.sharedField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IsolateComponent", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sharedFieldSet) + { + writer.WriteAttributeString("Shared", this.sharedField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Shared" == name)) + { + this.sharedField = value; + this.sharedFieldSet = true; + } + } + } + + /// + /// Disk cost to reserve in a folder for running locally and/or from source. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ReserveCost : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private int runFromSourceField; + + private bool runFromSourceFieldSet; + + private int runLocalField; + + private bool runLocalFieldSet; + + private ISchemaElement parentElement; + + /// + /// A primary key that uniquely identifies this ReserveCost entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Adds the amount of disk space specified in RunFromSource or RunLocal to the volume cost of the device containing the directory. + /// If this attribute is not set, it will default to the directory of parent component. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// The number of bytes of disk space to reserve if the component is installed to run from source. + /// + public int RunFromSource + { + get + { + return this.runFromSourceField; + } + set + { + this.runFromSourceFieldSet = true; + this.runFromSourceField = value; + } + } + + /// + /// The number of bytes of disk space to reserve if the component is installed to run locally. + /// + public int RunLocal + { + get + { + return this.runLocalField; + } + set + { + this.runLocalFieldSet = true; + this.runLocalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ReserveCost", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.runFromSourceFieldSet) + { + writer.WriteAttributeString("RunFromSource", this.runFromSourceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.runLocalFieldSet) + { + writer.WriteAttributeString("RunLocal", this.runLocalField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("RunFromSource" == name)) + { + this.runFromSourceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.runFromSourceFieldSet = true; + } + if (("RunLocal" == name)) + { + this.runLocalField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.runLocalFieldSet = true; + } + } + } + + /// + /// Component for parent Directory + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Component : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private int comPlusFlagsField; + + private bool comPlusFlagsFieldSet; + + private YesNoType disableRegistryReflectionField; + + private bool disableRegistryReflectionFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string featureField; + + private bool featureFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private LocationType locationField; + + private bool locationFieldSet; + + private YesNoType multiInstanceField; + + private bool multiInstanceFieldSet; + + private YesNoType neverOverwriteField; + + private bool neverOverwriteFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType sharedField; + + private bool sharedFieldSet; + + private YesNoType sharedDllRefCountField; + + private bool sharedDllRefCountFieldSet; + + private YesNoType transitiveField; + + private bool transitiveFieldSet; + + private YesNoType uninstallWhenSupersededField; + + private bool uninstallWhenSupersededFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + public Component() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Category))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CopyFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateFolder))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Environment))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Extension))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(File))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IniFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponent))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDataSource))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDriver))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCTranslator))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Registry))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryKey))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFolder))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryKey))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ReserveCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceControl))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfig))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfigFailureActions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceInstall))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TypeLib))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Component identifier; this is the primary key for identifying components. If omitted, + /// the compiler defaults the identifier to the identifier of the resource that is the + /// explicit keypath of the component (for example, a child File element with KeyPath + /// attribute with value 'yes'. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to create a ComPlus entry. The value should be the export flags used + /// during the generation of the .msi file. For more information see the COM+ documentation + /// in the Platform SDK. + /// + public int ComPlusFlags + { + get + { + return this.comPlusFlagsField; + } + set + { + this.comPlusFlagsFieldSet = true; + this.comPlusFlagsField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to disable registry reflection on all existing and + /// new registry keys affected by this component. + /// When set to 'yes', the Windows Installer calls the RegDisableReflectionKey on each key + /// being accessed by the component. + /// This bit is available with Windows Installer version 4.0 and is ignored on 32-bit systems. + /// + public YesNoType DisableRegistryReflection + { + get + { + return this.disableRegistryReflectionField; + } + set + { + this.disableRegistryReflectionFieldSet = true; + this.disableRegistryReflectionField = value; + } + } + + /// + /// Sets the Directory of the Component. If this element is nested under a Directory element, + /// this value defaults to the value of the parent Directory/@Id. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// This attribute provides a default DiskId attribute for all child File elements. Specifying + /// the DiskId on a Component element will override any DiskId attributes set by parent Directory + /// or DirectoryRef elements. See the File element's DiskId attribute for more information about + /// the purpose of the DiskId. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Identifies a feature to which this component belongs, as a shorthand for a child + /// ComponentRef element of the Feature element. The value of this attribute should + /// correspond to the Id attribute of a Feature element authored elsewhere. Note that + /// a single component can belong to multiple features but this attribute allows you + /// to specify only a single feature. + /// + public string Feature + { + get + { + return this.featureField; + } + set + { + this.featureFieldSet = true; + this.featureField = value; + } + } + + /// + /// This value should be a guid that uniquely identifies this component's contents, language, platform, and version. + /// If omitted, the default value is '*' which indicates that the linker should generate a stable guid. + /// Generatable guids are supported only for components with a single file as the component's keypath + /// or no files and a registry value as the keypath. + /// It's also possible to set the value to an empty string to specify an unmanaged component. + /// Unmanaged components are a security vulnerability because the component cannot be removed or repaired + /// by Windows Installer (it is essentially an unpatchable, permanent component). Therefore, a guid should + /// always be specified for any component which contains resources that may need to be patched in the future. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// If this attribute's value is set to 'yes', then the Directory of this Component is used + /// as the KeyPath. To set a Registry value or File as the KeyPath of a component, set the + /// KeyPath attribute to 'yes' on one of those child elements. If KeyPath is not set to 'yes' for the + /// Component or for a child Registry value or File, WiX will look at the child elements under the + /// Component in sequential order and try to automatically select one of them as a key path. Allowing + /// WiX to automatically select a key path can be dangerous because adding or removing child elements + /// under the Component can inadvertantly cause the key path to change, which can lead to + /// installation problems. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// Optional value that specifies the location that the component can be run from. + /// + public LocationType Location + { + get + { + return this.locationField; + } + set + { + this.locationFieldSet = true; + this.locationField = value; + } + } + + /// + /// If this attribute is set to 'yes', a new Component/@Guid will be generated for each + /// instance transform. Ensure that all of the resources contained in a multi-instance + /// Component will be installed to different paths based on the instance Property; otherwise, + /// the Component Rules will be violated. + /// + public YesNoType MultiInstance + { + get + { + return this.multiInstanceField; + } + set + { + this.multiInstanceFieldSet = true; + this.multiInstanceField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer does not install or reinstall the + /// component if a key path file or a key path registry entry for the component already + /// exists. The application does register itself as a client of the component. Use this + /// flag only for components that are being registered by the Registry table. Do not use + /// this flag for components registered by the AppId, Class, Extension, ProgId, MIME, and + /// Verb tables. + /// + public YesNoType NeverOverwrite + { + get + { + return this.neverOverwriteField; + } + set + { + this.neverOverwriteFieldSet = true; + this.neverOverwriteField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer does not remove the component during + /// an uninstall. The installer registers an extra system client for the component in + /// the Windows Installer registry settings (which basically just means that at least one + /// product is always referencing this component). Note that this option differs from the + /// behavior of not setting a guid because although the component is permanent, it is still + /// patchable (because Windows Installer still tracks it), it's just not uninstallable. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// If this attribute's value is set to 'yes', enables advanced patching semantics for + /// Components that are shared across multiple Products. Specifically, the Windows Installer + /// will cache the shared files to improve patch uninstall. This functionality is available + /// in Windows Installer 4.5 and later. + /// + public YesNoType Shared + { + get + { + return this.sharedField; + } + set + { + this.sharedFieldSet = true; + this.sharedField = value; + } + } + + /// + /// If this attribute's value is set to 'yes', the installer increments the reference count + /// in the shared DLL registry of the component's key file. If this bit is not set, the + /// installer increments the reference count only if the reference count already exists. + /// + public YesNoType SharedDllRefCount + { + get + { + return this.sharedDllRefCountField; + } + set + { + this.sharedDllRefCountFieldSet = true; + this.sharedDllRefCountField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer reevaluates the value of the statement + /// in the Condition upon a reinstall. If the value was previously False and has changed to + /// True, the installer installs the component. If the value was previously True and has + /// changed to False, the installer removes the component even if the component has other + /// products as clients. + /// + public YesNoType Transitive + { + get + { + return this.transitiveField; + } + set + { + this.transitiveFieldSet = true; + this.transitiveField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer will uninstall the Component's files + /// and registry keys when it is superseded by a patch. This functionality is available in + /// Windows Installer 4.5 and later. + /// + public YesNoType UninstallWhenSuperseded + { + get + { + return this.uninstallWhenSupersededField; + } + set + { + this.uninstallWhenSupersededFieldSet = true; + this.uninstallWhenSupersededField = value; + } + } + + /// + /// Set this attribute to 'yes' to mark this as a 64-bit component. This attribute facilitates + /// the installation of packages that include both 32-bit and 64-bit components. If this is a 64-bit + /// component replacing a 32-bit component, set this attribute to 'yes' and assign a new GUID in the Guid attribute. + /// The default value is based on the platform set by the -arch switch to candle.exe + /// or the InstallerPlatform property in a .wixproj MSBuild project: + /// For x86 and ARM, the default value is 'no'. + /// For x64 and IA64, the default value is 'yes'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Category" == childName)) + { + childValue = new Category(); + } + if (("Class" == childName)) + { + childValue = new Class(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("CopyFile" == childName)) + { + childValue = new CopyFile(); + } + if (("CreateFolder" == childName)) + { + childValue = new CreateFolder(); + } + if (("Environment" == childName)) + { + childValue = new Environment(); + } + if (("Extension" == childName)) + { + childValue = new Extension(); + } + if (("File" == childName)) + { + childValue = new File(); + } + if (("IniFile" == childName)) + { + childValue = new IniFile(); + } + if (("Interface" == childName)) + { + childValue = new Interface(); + } + if (("IsolateComponent" == childName)) + { + childValue = new IsolateComponent(); + } + if (("ODBCDataSource" == childName)) + { + childValue = new ODBCDataSource(); + } + if (("ODBCDriver" == childName)) + { + childValue = new ODBCDriver(); + } + if (("ODBCTranslator" == childName)) + { + childValue = new ODBCTranslator(); + } + if (("ProgId" == childName)) + { + childValue = new ProgId(); + } + if (("Registry" == childName)) + { + childValue = new Registry(); + } + if (("RegistryKey" == childName)) + { + childValue = new RegistryKey(); + } + if (("RegistryValue" == childName)) + { + childValue = new RegistryValue(); + } + if (("RemoveFile" == childName)) + { + childValue = new RemoveFile(); + } + if (("RemoveFolder" == childName)) + { + childValue = new RemoveFolder(); + } + if (("RemoveRegistryKey" == childName)) + { + childValue = new RemoveRegistryKey(); + } + if (("RemoveRegistryValue" == childName)) + { + childValue = new RemoveRegistryValue(); + } + if (("ReserveCost" == childName)) + { + childValue = new ReserveCost(); + } + if (("ServiceControl" == childName)) + { + childValue = new ServiceControl(); + } + if (("ServiceConfig" == childName)) + { + childValue = new ServiceConfig(); + } + if (("ServiceConfigFailureActions" == childName)) + { + childValue = new ServiceConfigFailureActions(); + } + if (("ServiceInstall" == childName)) + { + childValue = new ServiceInstall(); + } + if (("Shortcut" == childName)) + { + childValue = new Shortcut(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("TypeLib" == childName)) + { + childValue = new TypeLib(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a LocationType from a string. + /// + public static LocationType ParseLocationType(string value) + { + LocationType parsedValue; + Component.TryParseLocationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a LocationType from a string. + /// + public static bool TryParseLocationType(string value, out LocationType parsedValue) + { + parsedValue = LocationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("local" == value)) + { + parsedValue = LocationType.local; + } + else + { + if (("source" == value)) + { + parsedValue = LocationType.source; + } + else + { + if (("either" == value)) + { + parsedValue = LocationType.either; + } + else + { + parsedValue = LocationType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Component", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.comPlusFlagsFieldSet) + { + writer.WriteAttributeString("ComPlusFlags", this.comPlusFlagsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.disableRegistryReflectionFieldSet) + { + if ((this.disableRegistryReflectionField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRegistryReflection", "no"); + } + if ((this.disableRegistryReflectionField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRegistryReflection", "yes"); + } + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.featureFieldSet) + { + writer.WriteAttributeString("Feature", this.featureField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.locationFieldSet) + { + if ((this.locationField == LocationType.local)) + { + writer.WriteAttributeString("Location", "local"); + } + if ((this.locationField == LocationType.source)) + { + writer.WriteAttributeString("Location", "source"); + } + if ((this.locationField == LocationType.either)) + { + writer.WriteAttributeString("Location", "either"); + } + } + if (this.multiInstanceFieldSet) + { + if ((this.multiInstanceField == YesNoType.no)) + { + writer.WriteAttributeString("MultiInstance", "no"); + } + if ((this.multiInstanceField == YesNoType.yes)) + { + writer.WriteAttributeString("MultiInstance", "yes"); + } + } + if (this.neverOverwriteFieldSet) + { + if ((this.neverOverwriteField == YesNoType.no)) + { + writer.WriteAttributeString("NeverOverwrite", "no"); + } + if ((this.neverOverwriteField == YesNoType.yes)) + { + writer.WriteAttributeString("NeverOverwrite", "yes"); + } + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.sharedFieldSet) + { + if ((this.sharedField == YesNoType.no)) + { + writer.WriteAttributeString("Shared", "no"); + } + if ((this.sharedField == YesNoType.yes)) + { + writer.WriteAttributeString("Shared", "yes"); + } + } + if (this.sharedDllRefCountFieldSet) + { + if ((this.sharedDllRefCountField == YesNoType.no)) + { + writer.WriteAttributeString("SharedDllRefCount", "no"); + } + if ((this.sharedDllRefCountField == YesNoType.yes)) + { + writer.WriteAttributeString("SharedDllRefCount", "yes"); + } + } + if (this.transitiveFieldSet) + { + if ((this.transitiveField == YesNoType.no)) + { + writer.WriteAttributeString("Transitive", "no"); + } + if ((this.transitiveField == YesNoType.yes)) + { + writer.WriteAttributeString("Transitive", "yes"); + } + } + if (this.uninstallWhenSupersededFieldSet) + { + if ((this.uninstallWhenSupersededField == YesNoType.no)) + { + writer.WriteAttributeString("UninstallWhenSuperseded", "no"); + } + if ((this.uninstallWhenSupersededField == YesNoType.yes)) + { + writer.WriteAttributeString("UninstallWhenSuperseded", "yes"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ComPlusFlags" == name)) + { + this.comPlusFlagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.comPlusFlagsFieldSet = true; + } + if (("DisableRegistryReflection" == name)) + { + this.disableRegistryReflectionField = Enums.ParseYesNoType(value); + this.disableRegistryReflectionFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("Feature" == name)) + { + this.featureField = value; + this.featureFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("Location" == name)) + { + this.locationField = Component.ParseLocationType(value); + this.locationFieldSet = true; + } + if (("MultiInstance" == name)) + { + this.multiInstanceField = Enums.ParseYesNoType(value); + this.multiInstanceFieldSet = true; + } + if (("NeverOverwrite" == name)) + { + this.neverOverwriteField = Enums.ParseYesNoType(value); + this.neverOverwriteFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Shared" == name)) + { + this.sharedField = Enums.ParseYesNoType(value); + this.sharedFieldSet = true; + } + if (("SharedDllRefCount" == name)) + { + this.sharedDllRefCountField = Enums.ParseYesNoType(value); + this.sharedDllRefCountFieldSet = true; + } + if (("Transitive" == name)) + { + this.transitiveField = Enums.ParseYesNoType(value); + this.transitiveFieldSet = true; + } + if (("UninstallWhenSuperseded" == name)) + { + this.uninstallWhenSupersededField = Enums.ParseYesNoType(value); + this.uninstallWhenSupersededFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum LocationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Prevents the component from running from the source or the network (this is the default behavior if this attribute is not set). + /// + local, + + /// + /// Enforces that the component can only be run from the source (it cannot be run from the user's computer). + /// + source, + + /// + /// Allows the component to run from source or locally. + /// + either, + } + } + + /// + /// Groups together multiple components to be used in other locations. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private ISchemaElement parentElement; + + public ComponentGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the ComponentGroup. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets the default directory identifier for child Component elements. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// Used to set the default file system source for child Component elements. For more information, see + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + } + } + + /// + /// Create a reference to a ComponentGroup in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the ComponentGroup to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to make the parent feature of this component + /// the primary feature for this component. Components may belong to multiple features. + /// By designating a feature as the primary feature of a component, you ensure that + /// whenever a component is selected for install-on-demand (IOD), the primary feature + /// will be the one to install it. This attribute should only be set if a component + /// actually nests under multiple features. If a component nests under only one feature, + /// that feature is the primary feature for the component. You cannot set more than one + /// feature as the primary feature of a given component. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Used only for PatchFamilies to include all changes between the baseline and upgraded packages in a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class All : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Used only for PatchFamilies to include all changes between the baseline and upgraded packages in a patch. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("All", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Used only for PatchFamilies to include only a binary table entry in a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BinaryRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Binary element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BinaryRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Used only for PatchFamilies to include only a icon table entry in a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IconRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Icon element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IconRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a Feature element in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Component element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to make the parent feature of this component + /// the primary feature for this component. Components may belong to multiple features. + /// By designating a feature as the primary feature of a component, you ensure that + /// whenever a component is selected for install-on-demand (IOD), the primary feature + /// will be the one to install it. This attribute should only be set if a component + /// actually nests under multiple features. If a component nests under only one feature, + /// that feature is the primary feature for the component. You cannot set more than one + /// feature as the primary feature of a given component. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Merge directive to bring in a merge module that will be redirected to the parent directory. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Merge : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private YesNoType fileCompressionField; + + private bool fileCompressionFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + public Merge() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ConfigurationData))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The unique identifier for the Merge element in the source code. Referenced by the MergeRef/@Id. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The value of this attribute should correspond to the Id attribute of a + /// Media element authored elsewhere. By creating this connection between the merge module and Media + /// element, you set the packaging options to the values specified in the Media + /// element (values such as compression level, cab embedding, etc...). + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Specifies if the files in the merge module should be compressed. + /// + public YesNoType FileCompression + { + get + { + return this.fileCompressionField; + } + set + { + this.fileCompressionFieldSet = true; + this.fileCompressionField = value; + } + } + + /// + /// Specifies the decimal LCID or localization token for the language to merge the Module in as. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// Path to the source location of the merge module. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ConfigurationData" == childName)) + { + childValue = new ConfigurationData(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Merge", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.fileCompressionFieldSet) + { + if ((this.fileCompressionField == YesNoType.no)) + { + writer.WriteAttributeString("FileCompression", "no"); + } + if ((this.fileCompressionField == YesNoType.yes)) + { + writer.WriteAttributeString("FileCompression", "yes"); + } + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("FileCompression" == name)) + { + this.fileCompressionField = Enums.ParseYesNoType(value); + this.fileCompressionFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + /// + /// Merge reference to connect a Merge Module to parent Feature + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MergeRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The unique identifier for the Merge element to be referenced. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies whether the feature containing this MergeRef is the primary feature for advertising the merge module's components. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MergeRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Data to use as input to a configurable merge module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ConfigurationData : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name of the item in the ModuleConfiguration table. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Value to be passed to configurable merge module. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ConfigurationData", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Directory layout for the product. Also specifies the mappings between source and target directories. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Directory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string componentGuidGenerationSeedField; + + private bool componentGuidGenerationSeedFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string fileSourceField; + + private bool fileSourceFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private string shortSourceNameField; + + private bool shortSourceNameFieldSet; + + private string sourceNameField; + + private bool sourceNameFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + public Directory() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Merge))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// This value is the unique identifier of the directory entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The Component Guid Generation Seed is a guid that must be used when a Component with the generate guid directive ("*") + /// is not rooted in a standard Windows Installer directory (for example, ProgramFilesFolder or CommonFilesFolder). + /// It is recommended that this attribute be avoided and that developers install their Components under standard + /// directories with unique names instead (for example, "ProgramFilesFolder\Company Name Product Name Version"). It is + /// important to note that once a directory is assigned a Component Guid Generation Seed the value must not change until + /// (and must be changed when) the path to that directory, including itself and all parent directories, changes. + /// + public string ComponentGuidGenerationSeed + { + get + { + return this.componentGuidGenerationSeedField; + } + set + { + this.componentGuidGenerationSeedFieldSet = true; + this.componentGuidGenerationSeedField = value; + } + } + + /// + /// Sets the default disk identifier for the files contained in this directory. + /// This attribute's value may be overridden by a child Component, Directory, + /// Merge or File element. See the File or Merge elements' DiskId attribute for + /// more information. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Used to set the file system source for this directory's child elements. For more information, see + /// + public string FileSource + { + get + { + return this.fileSourceField; + } + set + { + this.fileSourceFieldSet = true; + this.fileSourceField = value; + } + } + + /// + /// The name of the directory. + /// + /// Do not specify this attribute if this directory represents + /// the same directory as the parent (see the Windows Installer SDK's + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short name of the directory in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short directory names + /// or the user wants to manually specify the short directory name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// The short name of the directory on the source media in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short directory names + /// or the user wants to manually specify the short source directory name. + /// + public string ShortSourceName + { + get + { + return this.shortSourceNameField; + } + set + { + this.shortSourceNameFieldSet = true; + this.shortSourceNameField = value; + } + } + + /// + /// The name of the directory on the source media. + /// If this attribute is not specified, Windows Installer will default to the Name attribute. + /// + /// In prior versions of the WiX toolset, this attribute specified the short source directory name. + /// This attribute's value may now be either a short or long directory name. + /// If a short directory name is specified, the ShortSourceName attribute may not be specified. + /// If a long directory name is specified, the LongSource attribute may not be specified. + /// Also, if this value is a long directory name, the ShortSourceName attribute may be omitted to + /// allow WiX to attempt to generate a unique short directory name. + /// However, if this name collides with another directory or you wish to manually specify + /// the short directory name, then the ShortSourceName attribute may be specified. + /// + public string SourceName + { + get + { + return this.sourceNameField; + } + set + { + this.sourceNameFieldSet = true; + this.sourceNameField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("Merge" == childName)) + { + childValue = new Merge(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Directory", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.componentGuidGenerationSeedFieldSet) + { + writer.WriteAttributeString("ComponentGuidGenerationSeed", this.componentGuidGenerationSeedField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.fileSourceFieldSet) + { + writer.WriteAttributeString("FileSource", this.fileSourceField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.shortSourceNameFieldSet) + { + writer.WriteAttributeString("ShortSourceName", this.shortSourceNameField); + } + if (this.sourceNameFieldSet) + { + writer.WriteAttributeString("SourceName", this.sourceNameField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ComponentGuidGenerationSeed" == name)) + { + this.componentGuidGenerationSeedField = value; + this.componentGuidGenerationSeedFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("FileSource" == name)) + { + this.fileSourceField = value; + this.fileSourceFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("ShortSourceName" == name)) + { + this.shortSourceNameField = value; + this.shortSourceNameFieldSet = true; + } + if (("SourceName" == name)) + { + this.sourceNameField = value; + this.sourceNameFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + /// + /// Create a reference to a Directory element in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DirectoryRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string fileSourceField; + + private bool fileSourceFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + public DirectoryRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Merge))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the Directory element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets the default disk identifier for the files contained in this directory. + /// This attribute's value may be overridden by a child Component, Directory, + /// Merge or File element. See the File or Merge elements' DiskId attribute for + /// more information. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Used to set the file system source for this DirectoryRef's child elements. For more information, see + /// + public string FileSource + { + get + { + return this.fileSourceField; + } + set + { + this.fileSourceFieldSet = true; + this.fileSourceField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("Merge" == childName)) + { + childValue = new Merge(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectoryRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.fileSourceFieldSet) + { + writer.WriteAttributeString("FileSource", this.fileSourceField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("FileSource" == name)) + { + this.fileSourceField = value; + this.fileSourceFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UpgradeVersion : ISchemaElement, ISetAttributes + { + + private string minimumField; + + private bool minimumFieldSet; + + private string maximumField; + + private bool maximumFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string removeFeaturesField; + + private bool removeFeaturesFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private YesNoType migrateFeaturesField; + + private bool migrateFeaturesFieldSet; + + private YesNoType onlyDetectField; + + private bool onlyDetectFieldSet; + + private YesNoType ignoreRemoveFailureField; + + private bool ignoreRemoveFailureFieldSet; + + private YesNoType includeMinimumField; + + private bool includeMinimumFieldSet; + + private YesNoType includeMaximumField; + + private bool includeMaximumFieldSet; + + private YesNoType excludeLanguagesField; + + private bool excludeLanguagesFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the lower bound on the range of product versions to be detected by FindRelatedProducts. + /// + public string Minimum + { + get + { + return this.minimumField; + } + set + { + this.minimumFieldSet = true; + this.minimumField = value; + } + } + + /// + /// Specifies the upper boundary of the range of product versions detected by FindRelatedProducts. + /// + public string Maximum + { + get + { + return this.maximumField; + } + set + { + this.maximumFieldSet = true; + this.maximumField = value; + } + } + + /// + /// Specifies the set of languages detected by FindRelatedProducts. Enter a list of numeric language identifiers (LANGID) separated by commas (,). Leave this value null to specify all languages. Set ExcludeLanguages to "yes" in order detect all languages, excluding the languages listed in this value. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The installer sets the REMOVE property to features specified in this column. The features to be removed can be determined at run time. The Formatted string entered in this field must evaluate to a comma-delimited list of feature names. For example: [Feature1],[Feature2],[Feature3]. No features are removed if the field contains formatted text that evaluates to an empty string. The installer sets REMOVE=ALL only if the Remove field is empty. + /// + public string RemoveFeatures + { + get + { + return this.removeFeaturesField; + } + set + { + this.removeFeaturesFieldSet = true; + this.removeFeaturesField = value; + } + } + + /// + /// When the FindRelatedProducts action detects a related product installed on the system, it appends the product code to the property specified in this field. Windows Installer documentation for the + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// Set to "yes" to migrate feature states from upgraded products by enabling the logic in the MigrateFeatureStates action. + /// + public YesNoType MigrateFeatures + { + get + { + return this.migrateFeaturesField; + } + set + { + this.migrateFeaturesFieldSet = true; + this.migrateFeaturesField = value; + } + } + + /// + /// Set to "yes" to detect products and applications but do not uninstall. + /// + public YesNoType OnlyDetect + { + get + { + return this.onlyDetectField; + } + set + { + this.onlyDetectFieldSet = true; + this.onlyDetectField = value; + } + } + + /// + /// Set to "yes" to continue installation upon failure to remove a product or application. + /// + public YesNoType IgnoreRemoveFailure + { + get + { + return this.ignoreRemoveFailureField; + } + set + { + this.ignoreRemoveFailureFieldSet = true; + this.ignoreRemoveFailureField = value; + } + } + + /// + /// Set to "no" to make the range of versions detected exclude the value specified in Minimum. This attribute is "yes" by default. + /// + public YesNoType IncludeMinimum + { + get + { + return this.includeMinimumField; + } + set + { + this.includeMinimumFieldSet = true; + this.includeMinimumField = value; + } + } + + /// + /// Set to "yes" to make the range of versions detected include the value specified in Maximum. + /// + public YesNoType IncludeMaximum + { + get + { + return this.includeMaximumField; + } + set + { + this.includeMaximumFieldSet = true; + this.includeMaximumField = value; + } + } + + /// + /// Set to "yes" to detect all languages, excluding the languages listed in the Language attribute. + /// + public YesNoType ExcludeLanguages + { + get + { + return this.excludeLanguagesField; + } + set + { + this.excludeLanguagesFieldSet = true; + this.excludeLanguagesField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UpgradeVersion", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.minimumFieldSet) + { + writer.WriteAttributeString("Minimum", this.minimumField); + } + if (this.maximumFieldSet) + { + writer.WriteAttributeString("Maximum", this.maximumField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.removeFeaturesFieldSet) + { + writer.WriteAttributeString("RemoveFeatures", this.removeFeaturesField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.migrateFeaturesFieldSet) + { + if ((this.migrateFeaturesField == YesNoType.no)) + { + writer.WriteAttributeString("MigrateFeatures", "no"); + } + if ((this.migrateFeaturesField == YesNoType.yes)) + { + writer.WriteAttributeString("MigrateFeatures", "yes"); + } + } + if (this.onlyDetectFieldSet) + { + if ((this.onlyDetectField == YesNoType.no)) + { + writer.WriteAttributeString("OnlyDetect", "no"); + } + if ((this.onlyDetectField == YesNoType.yes)) + { + writer.WriteAttributeString("OnlyDetect", "yes"); + } + } + if (this.ignoreRemoveFailureFieldSet) + { + if ((this.ignoreRemoveFailureField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "no"); + } + if ((this.ignoreRemoveFailureField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "yes"); + } + } + if (this.includeMinimumFieldSet) + { + if ((this.includeMinimumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMinimum", "no"); + } + if ((this.includeMinimumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMinimum", "yes"); + } + } + if (this.includeMaximumFieldSet) + { + if ((this.includeMaximumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMaximum", "no"); + } + if ((this.includeMaximumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMaximum", "yes"); + } + } + if (this.excludeLanguagesFieldSet) + { + if ((this.excludeLanguagesField == YesNoType.no)) + { + writer.WriteAttributeString("ExcludeLanguages", "no"); + } + if ((this.excludeLanguagesField == YesNoType.yes)) + { + writer.WriteAttributeString("ExcludeLanguages", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Minimum" == name)) + { + this.minimumField = value; + this.minimumFieldSet = true; + } + if (("Maximum" == name)) + { + this.maximumField = value; + this.maximumFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("RemoveFeatures" == name)) + { + this.removeFeaturesField = value; + this.removeFeaturesFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("MigrateFeatures" == name)) + { + this.migrateFeaturesField = Enums.ParseYesNoType(value); + this.migrateFeaturesFieldSet = true; + } + if (("OnlyDetect" == name)) + { + this.onlyDetectField = Enums.ParseYesNoType(value); + this.onlyDetectFieldSet = true; + } + if (("IgnoreRemoveFailure" == name)) + { + this.ignoreRemoveFailureField = Enums.ParseYesNoType(value); + this.ignoreRemoveFailureFieldSet = true; + } + if (("IncludeMinimum" == name)) + { + this.includeMinimumField = Enums.ParseYesNoType(value); + this.includeMinimumFieldSet = true; + } + if (("IncludeMaximum" == name)) + { + this.includeMaximumField = Enums.ParseYesNoType(value); + this.includeMaximumFieldSet = true; + } + if (("ExcludeLanguages" == name)) + { + this.excludeLanguagesField = Enums.ParseYesNoType(value); + this.excludeLanguagesFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Upgrade info for a particular UpgradeCode + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Upgrade : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public Upgrade() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UpgradeVersion))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// This value specifies the upgrade code for the products that are to be detected by the FindRelatedProducts action. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("UpgradeVersion" == childName)) + { + childValue = new UpgradeVersion(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Upgrade", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// A feature for the Feature table. Features are the smallest installable unit. See msi.chm for more + /// detailed information on the myriad installation options for a feature. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Feature : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private AbsentType absentField; + + private bool absentFieldSet; + + private AllowAdvertiseType allowAdvertiseField; + + private bool allowAdvertiseFieldSet; + + private string configurableDirectoryField; + + private bool configurableDirectoryFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string displayField; + + private bool displayFieldSet; + + private InstallDefaultType installDefaultField; + + private bool installDefaultFieldSet; + + private int levelField; + + private bool levelFieldSet; + + private string titleField; + + private bool titleFieldSet; + + private TypicalDefaultType typicalDefaultField; + + private bool typicalDefaultFieldSet; + + private ISchemaElement parentElement; + + public Feature() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier of the feature. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute determines if a user will have the option to set a feature to absent in the user interface. + /// + public AbsentType Absent + { + get + { + return this.absentField; + } + set + { + this.absentFieldSet = true; + this.absentField = value; + } + } + + /// + /// This attribute determines the possible advertise states for this feature. + /// + public AllowAdvertiseType AllowAdvertise + { + get + { + return this.allowAdvertiseField; + } + set + { + this.allowAdvertiseFieldSet = true; + this.allowAdvertiseField = value; + } + } + + /// + /// Specify the Id of a Directory that can be configured by the user at installation time. This identifier + /// must be a public property and therefore completely uppercase. + /// + public string ConfigurableDirectory + { + get + { + return this.configurableDirectoryField; + } + set + { + this.configurableDirectoryFieldSet = true; + this.configurableDirectoryField = value; + } + } + + /// + /// Longer string of text describing the feature. This localizable string is displayed by the + /// Text Control of the Selection Dialog. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Determines the initial display of this feature in the feature tree. + /// This attribute's value should be one of the following: + /// + public string Display + { + get + { + return this.displayField; + } + set + { + this.displayFieldSet = true; + this.displayField = value; + } + } + + /// + /// This attribute determines the default install/run location of a feature. This attribute cannot be specified + /// if the value of the FollowParent attribute is 'yes' since that would ask the installer to force this feature + /// to follow the parent installation state and simultaneously favor a particular installation state just for this feature. + /// + public InstallDefaultType InstallDefault + { + get + { + return this.installDefaultField; + } + set + { + this.installDefaultFieldSet = true; + this.installDefaultField = value; + } + } + + /// + /// Sets the install level of this feature. A value of 0 will disable the feature. Processing the + /// Condition Table can modify the level value (this is set via the Condition child element). The + /// default value is "1". + /// + public int Level + { + get + { + return this.levelField; + } + set + { + this.levelFieldSet = true; + this.levelField = value; + } + } + + /// + /// Short string of text identifying the feature. This string is listed as an item by the + /// SelectionTree control of the Selection Dialog. + /// + public string Title + { + get + { + return this.titleField; + } + set + { + this.titleFieldSet = true; + this.titleField = value; + } + } + + /// + /// This attribute determines the default advertise state of the feature. + /// + public TypicalDefaultType TypicalDefault + { + get + { + return this.typicalDefaultField; + } + set + { + this.typicalDefaultFieldSet = true; + this.typicalDefaultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("MergeRef" == childName)) + { + childValue = new MergeRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a AbsentType from a string. + /// + public static AbsentType ParseAbsentType(string value) + { + AbsentType parsedValue; + Feature.TryParseAbsentType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a AbsentType from a string. + /// + public static bool TryParseAbsentType(string value, out AbsentType parsedValue) + { + parsedValue = AbsentType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("allow" == value)) + { + parsedValue = AbsentType.allow; + } + else + { + if (("disallow" == value)) + { + parsedValue = AbsentType.disallow; + } + else + { + parsedValue = AbsentType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a AllowAdvertiseType from a string. + /// + public static AllowAdvertiseType ParseAllowAdvertiseType(string value) + { + AllowAdvertiseType parsedValue; + Feature.TryParseAllowAdvertiseType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a AllowAdvertiseType from a string. + /// + public static bool TryParseAllowAdvertiseType(string value, out AllowAdvertiseType parsedValue) + { + parsedValue = AllowAdvertiseType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = AllowAdvertiseType.no; + } + else + { + if (("system" == value)) + { + parsedValue = AllowAdvertiseType.system; + } + else + { + if (("yes" == value)) + { + parsedValue = AllowAdvertiseType.yes; + } + else + { + parsedValue = AllowAdvertiseType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a InstallDefaultType from a string. + /// + public static InstallDefaultType ParseInstallDefaultType(string value) + { + InstallDefaultType parsedValue; + Feature.TryParseInstallDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallDefaultType from a string. + /// + public static bool TryParseInstallDefaultType(string value, out InstallDefaultType parsedValue) + { + parsedValue = InstallDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("followParent" == value)) + { + parsedValue = InstallDefaultType.followParent; + } + else + { + if (("local" == value)) + { + parsedValue = InstallDefaultType.local; + } + else + { + if (("source" == value)) + { + parsedValue = InstallDefaultType.source; + } + else + { + parsedValue = InstallDefaultType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a TypicalDefaultType from a string. + /// + public static TypicalDefaultType ParseTypicalDefaultType(string value) + { + TypicalDefaultType parsedValue; + Feature.TryParseTypicalDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypicalDefaultType from a string. + /// + public static bool TryParseTypicalDefaultType(string value, out TypicalDefaultType parsedValue) + { + parsedValue = TypicalDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("advertise" == value)) + { + parsedValue = TypicalDefaultType.advertise; + } + else + { + if (("install" == value)) + { + parsedValue = TypicalDefaultType.install; + } + else + { + parsedValue = TypicalDefaultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Feature", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.absentFieldSet) + { + if ((this.absentField == AbsentType.allow)) + { + writer.WriteAttributeString("Absent", "allow"); + } + if ((this.absentField == AbsentType.disallow)) + { + writer.WriteAttributeString("Absent", "disallow"); + } + } + if (this.allowAdvertiseFieldSet) + { + if ((this.allowAdvertiseField == AllowAdvertiseType.no)) + { + writer.WriteAttributeString("AllowAdvertise", "no"); + } + if ((this.allowAdvertiseField == AllowAdvertiseType.system)) + { + writer.WriteAttributeString("AllowAdvertise", "system"); + } + if ((this.allowAdvertiseField == AllowAdvertiseType.yes)) + { + writer.WriteAttributeString("AllowAdvertise", "yes"); + } + } + if (this.configurableDirectoryFieldSet) + { + writer.WriteAttributeString("ConfigurableDirectory", this.configurableDirectoryField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.displayFieldSet) + { + writer.WriteAttributeString("Display", this.displayField); + } + if (this.installDefaultFieldSet) + { + if ((this.installDefaultField == InstallDefaultType.followParent)) + { + writer.WriteAttributeString("InstallDefault", "followParent"); + } + if ((this.installDefaultField == InstallDefaultType.local)) + { + writer.WriteAttributeString("InstallDefault", "local"); + } + if ((this.installDefaultField == InstallDefaultType.source)) + { + writer.WriteAttributeString("InstallDefault", "source"); + } + } + if (this.levelFieldSet) + { + writer.WriteAttributeString("Level", this.levelField.ToString(CultureInfo.InvariantCulture)); + } + if (this.titleFieldSet) + { + writer.WriteAttributeString("Title", this.titleField); + } + if (this.typicalDefaultFieldSet) + { + if ((this.typicalDefaultField == TypicalDefaultType.advertise)) + { + writer.WriteAttributeString("TypicalDefault", "advertise"); + } + if ((this.typicalDefaultField == TypicalDefaultType.install)) + { + writer.WriteAttributeString("TypicalDefault", "install"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Absent" == name)) + { + this.absentField = Feature.ParseAbsentType(value); + this.absentFieldSet = true; + } + if (("AllowAdvertise" == name)) + { + this.allowAdvertiseField = Feature.ParseAllowAdvertiseType(value); + this.allowAdvertiseFieldSet = true; + } + if (("ConfigurableDirectory" == name)) + { + this.configurableDirectoryField = value; + this.configurableDirectoryFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Display" == name)) + { + this.displayField = value; + this.displayFieldSet = true; + } + if (("InstallDefault" == name)) + { + this.installDefaultField = Feature.ParseInstallDefaultType(value); + this.installDefaultFieldSet = true; + } + if (("Level" == name)) + { + this.levelField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.levelFieldSet = true; + } + if (("Title" == name)) + { + this.titleField = value; + this.titleFieldSet = true; + } + if (("TypicalDefault" == name)) + { + this.typicalDefaultField = Feature.ParseTypicalDefaultType(value); + this.typicalDefaultFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum AbsentType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Allows the user interface to display an option to change the feature state to Absent. + /// + allow, + + /// + /// Prevents the user interface from displaying an option to change the feature state + /// to Absent by setting the msidbFeatureAttributesUIDisallowAbsent attribute. This will force the feature + /// to the installation state, whether or not the feature is visible in the UI. + /// + disallow, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum AllowAdvertiseType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Prevents this feature from being advertised by setting the msidbFeatureAttributesDisallowAdvertise attribute. + /// + no, + + /// + /// Prevents advertising for this feature if the operating system shell does not support Windows Installer + /// descriptors by setting the msidbFeatureAttributesNoUnsupportedAdvertise attribute. + /// + system, + + /// + /// Allows the feature to be advertised. + /// + yes, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Forces the feature to follow the same installation state as its parent feature. + /// + followParent, + + /// + /// Favors installing this feature locally by setting the msidbFeatureAttributesFavorLocal attribute. + /// + local, + + /// + /// Favors running this feature from source by setting the msidbFeatureAttributesFavorSource attribute. + /// + source, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypicalDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Sets the feature to be advertised by setting the msidbFeatureAttributesFavorAdvertise attribute. + /// This value cannot be set if the value of the AllowAdvertise attribute is 'no' since that would ask the installer to + /// disallow the advertised state for this feature while at the same time favoring it. + /// + advertise, + + /// + /// Sets the feature to the default non-advertised installation option. + /// + install, + } + } + + /// + /// Groups together multiple components, features, and merges to be used in other locations. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FeatureGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public FeatureGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the FeatureGroup. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("MergeRef" == childName)) + { + childValue = new MergeRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FeatureGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a FeatureGroup in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FeatureGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType ignoreParentField; + + private bool ignoreParentFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the FeatureGroup to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Normally feature group references that end up nested under a parent element create a + /// connection to that parent. This behavior is undesirable when trying to simply reference + /// to a FeatureGroup in a different Fragment. Specify 'yes' to have this feature group + /// reference not create a connection to its parent. The default is 'no'. + /// + public YesNoType IgnoreParent + { + get + { + return this.ignoreParentField; + } + set + { + this.ignoreParentFieldSet = true; + this.ignoreParentField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to make the parent feature of this group + /// the primary feature for any components and merges contained in the group. + /// Features may belong to multiple features. By designating a feature as the + /// primary feature of a component or merge, you ensure that whenever a component is + /// selected for install-on-demand (IOD), the primary feature will be the one to install + /// it. This attribute should only be set if a component actually nests under multiple + /// features. If a component nests under only one feature, that feature is the primary + /// feature for the component. You cannot set more than one feature as the primary + /// feature of a given component. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FeatureGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.ignoreParentFieldSet) + { + if ((this.ignoreParentField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreParent", "no"); + } + if ((this.ignoreParentField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreParent", "yes"); + } + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IgnoreParent" == name)) + { + this.ignoreParentField = Enums.ParseYesNoType(value); + this.ignoreParentFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Create a reference to a Feature element in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FeatureRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType ignoreParentField; + + private bool ignoreParentFieldSet; + + private ISchemaElement parentElement; + + public FeatureRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the Feature element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Normally feature references that are nested under a parent element create a connection to that + /// parent. This behavior is undesirable when trying to simply reference a Feature in a different + /// Fragment. Specify 'yes' to have this feature reference not create a connection to its parent. + /// The default is 'no'. + /// + public YesNoType IgnoreParent + { + get + { + return this.ignoreParentField; + } + set + { + this.ignoreParentFieldSet = true; + this.ignoreParentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("FeatureGroup" == childName)) + { + childValue = new FeatureGroup(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("MergeRef" == childName)) + { + childValue = new MergeRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FeatureRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.ignoreParentFieldSet) + { + if ((this.ignoreParentField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreParent", "no"); + } + if ((this.ignoreParentField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreParent", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IgnoreParent" == name)) + { + this.ignoreParentField = Enums.ParseYesNoType(value); + this.ignoreParentFieldSet = true; + } + } + } + + /// + /// Media element describes a disk that makes up the source media for the installation. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Media : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string cabinetField; + + private bool cabinetFieldSet; + + private CompressionLevelType compressionLevelField; + + private bool compressionLevelFieldSet; + + private string diskPromptField; + + private bool diskPromptFieldSet; + + private YesNoType embedCabField; + + private bool embedCabFieldSet; + + private string layoutField; + + private bool layoutFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private string volumeLabelField; + + private bool volumeLabelFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private ISchemaElement parentElement; + + public Media() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalSignature))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchBaseline))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Disk identifier for Media table. This number must be equal to or greater than 1. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The name of the cabinet if some or all of the files stored on the media are in a cabinet file. If no cabinets are used, this attribute must not be set. + /// + public string Cabinet + { + get + { + return this.cabinetField; + } + set + { + this.cabinetFieldSet = true; + this.cabinetField = value; + } + } + + /// + /// Indicates the compression level for the Media's cabinet. This attribute can + /// only be used in conjunction with the Cabinet attribute. The default is 'mszip'. + /// + public CompressionLevelType CompressionLevel + { + get + { + return this.compressionLevelField; + } + set + { + this.compressionLevelFieldSet = true; + this.compressionLevelField = value; + } + } + + /// + /// The disk name, which is usually the visible text printed on the disk. This localizable text is used to prompt the user when this disk needs to be inserted. This value will be used in the "[1]" of the DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. + /// + public string DiskPrompt + { + get + { + return this.diskPromptField; + } + set + { + this.diskPromptFieldSet = true; + this.diskPromptField = value; + } + } + + /// + /// Instructs the binder to embed the cabinet in the product if 'yes'. This attribute can only be specified in conjunction with the Cabinet attribute. + /// + public YesNoType EmbedCab + { + get + { + return this.embedCabField; + } + set + { + this.embedCabFieldSet = true; + this.embedCabField = value; + } + } + + /// + /// This attribute specifies the root directory for the uncompressed files that + /// are a part of this Media element. By default, the src will be the output + /// directory for the final image. The default value ensures the binder generates + /// an installable image. If a relative path is specified in the src attribute, + /// the value will be appended to the image's output directory. If an absolute + /// path is provided, that path will be used without modification. The latter two + /// options are provided to ease the layout of an image onto multiple medias (CDs/DVDs). + /// + public string Layout + { + get + { + return this.layoutField; + } + set + { + this.layoutFieldSet = true; + this.layoutField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// The label attributed to the volume. This is the volume label returned + /// by the GetVolumeInformation function. If the SourceDir property refers + /// to a removable (floppy or CD-ROM) volume, then this volume label is + /// used to verify that the proper disk is in the drive before attempting + /// to install files. The entry in this column must match the volume label + /// of the physical media. + /// + public string VolumeLabel + { + get + { + return this.volumeLabelField; + } + set + { + this.volumeLabelFieldSet = true; + this.volumeLabelField = value; + } + } + + /// + /// Optional property that identifies the source of the embedded cabinet. + /// If a cabinet is specified for a patch, this property should be defined + /// and unique to each patch so that the embedded cabinet containing patched + /// and new files can be located in the patch package. If the cabinet is not + /// embedded - this is not typical - the cabinet can be found in the directory + /// referenced in this column. If empty, the external cabinet must be located + /// in the SourceDir directory. + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalSignature" == childName)) + { + childValue = new DigitalSignature(); + } + if (("PatchBaseline" == childName)) + { + childValue = new PatchBaseline(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Media", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.cabinetFieldSet) + { + writer.WriteAttributeString("Cabinet", this.cabinetField); + } + if (this.compressionLevelFieldSet) + { + if ((this.compressionLevelField == CompressionLevelType.high)) + { + writer.WriteAttributeString("CompressionLevel", "high"); + } + if ((this.compressionLevelField == CompressionLevelType.low)) + { + writer.WriteAttributeString("CompressionLevel", "low"); + } + if ((this.compressionLevelField == CompressionLevelType.medium)) + { + writer.WriteAttributeString("CompressionLevel", "medium"); + } + if ((this.compressionLevelField == CompressionLevelType.mszip)) + { + writer.WriteAttributeString("CompressionLevel", "mszip"); + } + if ((this.compressionLevelField == CompressionLevelType.none)) + { + writer.WriteAttributeString("CompressionLevel", "none"); + } + } + if (this.diskPromptFieldSet) + { + writer.WriteAttributeString("DiskPrompt", this.diskPromptField); + } + if (this.embedCabFieldSet) + { + if ((this.embedCabField == YesNoType.no)) + { + writer.WriteAttributeString("EmbedCab", "no"); + } + if ((this.embedCabField == YesNoType.yes)) + { + writer.WriteAttributeString("EmbedCab", "yes"); + } + } + if (this.layoutFieldSet) + { + writer.WriteAttributeString("Layout", this.layoutField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.volumeLabelFieldSet) + { + writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Cabinet" == name)) + { + this.cabinetField = value; + this.cabinetFieldSet = true; + } + if (("CompressionLevel" == name)) + { + this.compressionLevelField = Enums.ParseCompressionLevelType(value); + this.compressionLevelFieldSet = true; + } + if (("DiskPrompt" == name)) + { + this.diskPromptField = value; + this.diskPromptFieldSet = true; + } + if (("EmbedCab" == name)) + { + this.embedCabField = Enums.ParseYesNoType(value); + this.embedCabFieldSet = true; + } + if (("Layout" == name)) + { + this.layoutField = value; + this.layoutFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("VolumeLabel" == name)) + { + this.volumeLabelField = value; + this.volumeLabelFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + } + } + + /// + /// MediaTeplate element describes information to automatically assign files to cabinets. + /// A maximumum number of cabinets created is 999. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MediaTemplate : ISchemaElement, ISetAttributes + { + + private string cabinetTemplateField; + + private bool cabinetTemplateFieldSet; + + private CompressionLevelType compressionLevelField; + + private bool compressionLevelFieldSet; + + private string diskPromptField; + + private bool diskPromptFieldSet; + + private YesNoType embedCabField; + + private bool embedCabFieldSet; + + private string volumeLabelField; + + private bool volumeLabelFieldSet; + + private int maximumUncompressedMediaSizeField; + + private bool maximumUncompressedMediaSizeFieldSet; + + private int maximumCabinetSizeForLargeFileSplittingField; + + private bool maximumCabinetSizeForLargeFileSplittingFieldSet; + + private ISchemaElement parentElement; + + /// + /// Templated name of the cabinet if some or all of the files stored on the media are in + /// a cabinet file. This name must begin with either a letter or an underscore, contain + /// maximum of five characters and {0} in the cabinet name part and must end three character extension. + /// The default is cab{0}.cab. + /// + public string CabinetTemplate + { + get + { + return this.cabinetTemplateField; + } + set + { + this.cabinetTemplateFieldSet = true; + this.cabinetTemplateField = value; + } + } + + /// + /// Indicates the compression level for the Media's cabinet. This attribute can + /// only be used in conjunction with the Cabinet attribute. The default is 'mszip'. + /// + public CompressionLevelType CompressionLevel + { + get + { + return this.compressionLevelField; + } + set + { + this.compressionLevelFieldSet = true; + this.compressionLevelField = value; + } + } + + /// + /// The disk name, which is usually the visible text printed on the disk. This localizable text is used + /// to prompt the user when this disk needs to be inserted. This value will be used in the "[1]" of the + /// DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. + /// + public string DiskPrompt + { + get + { + return this.diskPromptField; + } + set + { + this.diskPromptFieldSet = true; + this.diskPromptField = value; + } + } + + /// + /// Instructs the binder to embed the cabinets in the product if 'yes'. + /// + public YesNoType EmbedCab + { + get + { + return this.embedCabField; + } + set + { + this.embedCabFieldSet = true; + this.embedCabField = value; + } + } + + /// + /// The label attributed to the volume. This is the volume label returned + /// by the GetVolumeInformation function. If the SourceDir property refers + /// to a removable (floppy or CD-ROM) volume, then this volume label is + /// used to verify that the proper disk is in the drive before attempting + /// to install files. The entry in this column must match the volume label + /// of the physical media. + /// + public string VolumeLabel + { + get + { + return this.volumeLabelField; + } + set + { + this.volumeLabelFieldSet = true; + this.volumeLabelField = value; + } + } + + /// + /// Size of uncompressed files in each cabinet, in megabytes. WIX_MUMS environment variable + /// can be used to override this value. Default value is 200 MB. + /// + public int MaximumUncompressedMediaSize + { + get + { + return this.maximumUncompressedMediaSizeField; + } + set + { + this.maximumUncompressedMediaSizeFieldSet = true; + this.maximumUncompressedMediaSizeField = value; + } + } + + /// + /// Maximum size of cabinet files in megabytes for large files. This attribute is used for packaging + /// files that are larger than MaximumUncompressedMediaSize into smaller cabinets. If cabinet size + /// exceed this value, then setting this attribute will cause the file to be split into multiple + /// cabinets of this maximum size. For simply controlling cabinet size without file splitting use + /// MaximumUncompressedMediaSize attribute. Setting this attribute will disable smart cabbing feature + /// for this Fragment / Package. Setting WIX_MCSLFS environment variable can be used to override this + /// value. Minimum allowed value of this attribute is 20 MB. Maximum allowed value and the Default + /// value of this attribute is 2048 MB (2 GB). + /// + public int MaximumCabinetSizeForLargeFileSplitting + { + get + { + return this.maximumCabinetSizeForLargeFileSplittingField; + } + set + { + this.maximumCabinetSizeForLargeFileSplittingFieldSet = true; + this.maximumCabinetSizeForLargeFileSplittingField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a CompressionLevelType from a string. + /// + public static CompressionLevelType ParseCompressionLevelType(string value) + { + CompressionLevelType parsedValue; + MediaTemplate.TryParseCompressionLevelType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CompressionLevelType from a string. + /// + public static bool TryParseCompressionLevelType(string value, out CompressionLevelType parsedValue) + { + parsedValue = CompressionLevelType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("high" == value)) + { + parsedValue = CompressionLevelType.high; + } + else + { + if (("low" == value)) + { + parsedValue = CompressionLevelType.low; + } + else + { + if (("medium" == value)) + { + parsedValue = CompressionLevelType.medium; + } + else + { + if (("mszip" == value)) + { + parsedValue = CompressionLevelType.mszip; + } + else + { + if (("none" == value)) + { + parsedValue = CompressionLevelType.none; + } + else + { + parsedValue = CompressionLevelType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MediaTemplate", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.cabinetTemplateFieldSet) + { + writer.WriteAttributeString("CabinetTemplate", this.cabinetTemplateField); + } + if (this.compressionLevelFieldSet) + { + if ((this.compressionLevelField == CompressionLevelType.high)) + { + writer.WriteAttributeString("CompressionLevel", "high"); + } + if ((this.compressionLevelField == CompressionLevelType.low)) + { + writer.WriteAttributeString("CompressionLevel", "low"); + } + if ((this.compressionLevelField == CompressionLevelType.medium)) + { + writer.WriteAttributeString("CompressionLevel", "medium"); + } + if ((this.compressionLevelField == CompressionLevelType.mszip)) + { + writer.WriteAttributeString("CompressionLevel", "mszip"); + } + if ((this.compressionLevelField == CompressionLevelType.none)) + { + writer.WriteAttributeString("CompressionLevel", "none"); + } + } + if (this.diskPromptFieldSet) + { + writer.WriteAttributeString("DiskPrompt", this.diskPromptField); + } + if (this.embedCabFieldSet) + { + if ((this.embedCabField == YesNoType.no)) + { + writer.WriteAttributeString("EmbedCab", "no"); + } + if ((this.embedCabField == YesNoType.yes)) + { + writer.WriteAttributeString("EmbedCab", "yes"); + } + } + if (this.volumeLabelFieldSet) + { + writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); + } + if (this.maximumUncompressedMediaSizeFieldSet) + { + writer.WriteAttributeString("MaximumUncompressedMediaSize", this.maximumUncompressedMediaSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maximumCabinetSizeForLargeFileSplittingFieldSet) + { + writer.WriteAttributeString("MaximumCabinetSizeForLargeFileSplitting", this.maximumCabinetSizeForLargeFileSplittingField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("CabinetTemplate" == name)) + { + this.cabinetTemplateField = value; + this.cabinetTemplateFieldSet = true; + } + if (("CompressionLevel" == name)) + { + this.compressionLevelField = MediaTemplate.ParseCompressionLevelType(value); + this.compressionLevelFieldSet = true; + } + if (("DiskPrompt" == name)) + { + this.diskPromptField = value; + this.diskPromptFieldSet = true; + } + if (("EmbedCab" == name)) + { + this.embedCabField = Enums.ParseYesNoType(value); + this.embedCabFieldSet = true; + } + if (("VolumeLabel" == name)) + { + this.volumeLabelField = value; + this.volumeLabelFieldSet = true; + } + if (("MaximumUncompressedMediaSize" == name)) + { + this.maximumUncompressedMediaSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maximumUncompressedMediaSizeFieldSet = true; + } + if (("MaximumCabinetSizeForLargeFileSplitting" == name)) + { + this.maximumCabinetSizeForLargeFileSplittingField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maximumCabinetSizeForLargeFileSplittingFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum CompressionLevelType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + high, + + low, + + medium, + + mszip, + + none, + } + } + + /// + /// This element has been deprecated. + /// Use the Binary/@SuppressModularization, CustomAction/@SuppressModularization, or Property/@SuppressModularization attributes instead. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IgnoreModularization : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the item to ignore modularization for. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The type of the item to ignore modularization for. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + IgnoreModularization.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Action" == value)) + { + parsedValue = TypeType.Action; + } + else + { + if (("Property" == value)) + { + parsedValue = TypeType.Property; + } + else + { + if (("Directory" == value)) + { + parsedValue = TypeType.Directory; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IgnoreModularization", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.Action)) + { + writer.WriteAttributeString("Type", "Action"); + } + if ((this.typeField == TypeType.Property)) + { + writer.WriteAttributeString("Type", "Property"); + } + if ((this.typeField == TypeType.Directory)) + { + writer.WriteAttributeString("Type", "Directory"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = IgnoreModularization.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Action, + + Property, + + Directory, + } + } + + /// + /// Specifies a custom action to be added to the MSI CustomAction table. Various combinations of the attributes for this element + /// correspond to different custom action types. For more information about custom actions see the + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomAction : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string binaryKeyField; + + private bool binaryKeyFieldSet; + + private string fileKeyField; + + private bool fileKeyFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string dllEntryField; + + private bool dllEntryFieldSet; + + private string exeCommandField; + + private bool exeCommandFieldSet; + + private string jScriptCallField; + + private bool jScriptCallFieldSet; + + private string vBScriptCallField; + + private bool vBScriptCallFieldSet; + + private ScriptType scriptField; + + private bool scriptFieldSet; + + private YesNoType suppressModularizationField; + + private bool suppressModularizationFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string errorField; + + private bool errorFieldSet; + + private ReturnType returnField; + + private bool returnFieldSet; + + private ExecuteType executeField; + + private bool executeFieldSet; + + private YesNoType impersonateField; + + private bool impersonateFieldSet; + + private YesNoType patchUninstallField; + + private bool patchUninstallFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private YesNoType terminalServerAwareField; + + private bool terminalServerAwareFieldSet; + + private YesNoType hideTargetField; + + private bool hideTargetFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the custom action. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute is a reference to a Binary element with matching Id attribute. That binary stream contains + /// the custom action for use during install. The custom action will not be installed into a target directory. This attribute is + /// typically used with the DllEntry attribute to specify the custom action DLL to use for a type 1 custom action, with the ExeCommand + /// attribute to specify a type 17 custom action that runs an embedded executable, or with the VBScriptCall or JScriptCall attributes + /// to specify a type 5 or 6 custom action. + /// + public string BinaryKey + { + get + { + return this.binaryKeyField; + } + set + { + this.binaryKeyFieldSet = true; + this.binaryKeyField = value; + } + } + + /// + /// This attribute specifies a reference to a File element with matching Id attribute that + /// will execute the custom action code in the file after the file is installed. This + /// attribute is typically used with the ExeCommand attribute to specify a type 18 custom action + /// that runs an installed executable, with the DllEntry attribute to specify an installed custom + /// action DLL to use for a type 17 custom action, or with the VBScriptCall or JScriptCall + /// attributes to specify a type 21 or 22 custom action. + /// + public string FileKey + { + get + { + return this.fileKeyField; + } + set + { + this.fileKeyFieldSet = true; + this.fileKeyField = value; + } + } + + /// + /// This attribute specifies a reference to a Property element with matching Id attribute that specifies the Property + /// to be used or updated on execution of this custom action. This attribute is + /// typically used with the Value attribute to create a type 51 custom action that parses + /// the text in Value and places it into the specified Property. This attribute is also used with + /// the ExeCommand attribute to create a type 50 custom action that uses the value of the + /// given property to specify the path to the executable. Type 51 custom actions are often useful to + /// pass values to a deferred custom action. + /// See + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This attribute specifies a reference to a Directory element with matching Id attribute containing a directory path. + /// This attribute is typically used with the ExeCommand attribute to specify the source executable for a type 34 + /// custom action, or with the Value attribute to specify a formatted string to place in the specified Directory + /// table entry in a type 35 custom action. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// This attribute specifies the name of a function in a custom action to execute. + /// This attribute is used with the BinaryKey attribute to create a type 1 custom + /// action, or with the FileKey attribute to create a type 17 custom action. + /// + public string DllEntry + { + get + { + return this.dllEntryField; + } + set + { + this.dllEntryFieldSet = true; + this.dllEntryField = value; + } + } + + /// + /// This attribute specifies the command line parameters to supply to an externally + /// run executable. This attribute is typically used with the BinaryKey attribute for a type 2 custom action, + /// the FileKey attribute for a type 18 custom action, the Property attribute for a type 50 custom action, + /// or the Directory attribute for a type 34 custom action that specify the executable to run. + /// + public string ExeCommand + { + get + { + return this.exeCommandField; + } + set + { + this.exeCommandFieldSet = true; + this.exeCommandField = value; + } + } + + /// + /// This attribute specifies the name of the JScript function to execute in a script. The script must be + /// provided in a Binary element identified by the BinaryKey attribute described above. In other words, this + /// attribute must be specified in conjunction with the BinaryKey attribute. + /// + public string JScriptCall + { + get + { + return this.jScriptCallField; + } + set + { + this.jScriptCallFieldSet = true; + this.jScriptCallField = value; + } + } + + /// + /// This attribute specifies the name of the VBScript Subroutine to execute in a script. The script must be + /// provided in a Binary element identified by the BinaryKey attribute described above. In other words, this + /// attribute must be specified in conjunction with the BinaryKey attribute. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string VBScriptCall + { + get + { + return this.vBScriptCallField; + } + set + { + this.vBScriptCallFieldSet = true; + this.vBScriptCallField = value; + } + } + + /// + /// Creates a type 37 or 38 custom action. The text of the element should contain the script to be embedded in the package. + /// + public ScriptType Script + { + get + { + return this.scriptField; + } + set + { + this.scriptFieldSet = true; + this.scriptField = value; + } + } + + /// + /// Use to suppress modularization of this custom action name in merge modules. + /// This should only be necessary for table-driven custom actions because the + /// table name which they interact with cannot be modularized, so there can only + /// be one instance of the table. + /// + public YesNoType SuppressModularization + { + get + { + return this.suppressModularizationField; + } + set + { + this.suppressModularizationFieldSet = true; + this.suppressModularizationField = value; + } + } + + /// + /// This attribute specifies a string value to use in the custom action. This attribute + /// must be used with the Property attribute to set the property as part of a + /// type 51 custom action or with the Directory attribute to set a directory path in that + /// table in a type 35 custom action. The value can be a literal value or derived from a + /// Property element using the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// This attribute specifies an index in the MSI Error table to use as an error message for a + /// type 19 custom action that displays the error message and aborts a product's installation. + /// + public string Error + { + get + { + return this.errorField; + } + set + { + this.errorFieldSet = true; + this.errorField = value; + } + } + + /// + /// Set this attribute to set the return behavior of the custom action. + /// + public ReturnType Return + { + get + { + return this.returnField; + } + set + { + this.returnFieldSet = true; + this.returnField = value; + } + } + + /// + /// This attribute indicates the scheduling of the custom action. + /// + public ExecuteType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + /// + /// This attribute specifies whether the Windows Installer, which executes as LocalSystem, + /// should impersonate the user context of the installing user when executing this custom action. + /// Typically the value should be 'yes', except when the custom action needs elevated privileges + /// to apply changes to the machine. + /// + public YesNoType Impersonate + { + get + { + return this.impersonateField; + } + set + { + this.impersonateFieldSet = true; + this.impersonateField = value; + } + } + + /// + /// This attribute specifies that the Windows Installer, execute the custom action only when + /// a patch is being uninstalled. These custom actions should also be conditioned using the + /// MSIPATCHREMOVE property to ensure proper down level (less than Windows Installer 4.5) + /// behavior. + /// + public YesNoType PatchUninstall + { + get + { + return this.patchUninstallField; + } + set + { + this.patchUninstallFieldSet = true; + this.patchUninstallField = value; + } + } + + /// + /// Specifies that a script custom action targets a 64-bit platform. Valid only when used with + /// the Script, VBScriptCall, and JScriptCall attributes. + /// The default value is based on the platform set by the -arch switch to candle.exe + /// or the InstallerPlatform property in a .wixproj MSBuild project: + /// For x86 and ARM, the default value is 'no'. + /// For x64 and IA64, the default value is 'yes'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + /// + /// This attribute specifies controls whether the custom action will impersonate the + /// installing user during per-machine installs on Terminal Server machines. + /// Deferred execution custom actions that do not specify this attribute, or explicitly set it 'no', + /// will run with no user impersonation on Terminal Server machines during + /// per-machine installations. This attribute is only applicable when installing on the + /// Windows Server 2003 family. + /// + public YesNoType TerminalServerAware + { + get + { + return this.terminalServerAwareField; + } + set + { + this.terminalServerAwareFieldSet = true; + this.terminalServerAwareField = value; + } + } + + /// + /// Ensures the installer does not log the CustomActionData for the deferred custom action. + /// + public YesNoType HideTarget + { + get + { + return this.hideTargetField; + } + set + { + this.hideTargetFieldSet = true; + this.hideTargetField = value; + } + } + + /// + /// The text node is only valid if the Script attribute is specified. In that case, the text node contains the script to embed. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ScriptType from a string. + /// + public static ScriptType ParseScriptType(string value) + { + ScriptType parsedValue; + CustomAction.TryParseScriptType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ScriptType from a string. + /// + public static bool TryParseScriptType(string value, out ScriptType parsedValue) + { + parsedValue = ScriptType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("jscript" == value)) + { + parsedValue = ScriptType.jscript; + } + else + { + if (("vbscript" == value)) + { + parsedValue = ScriptType.vbscript; + } + else + { + parsedValue = ScriptType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a ReturnType from a string. + /// + public static ReturnType ParseReturnType(string value) + { + ReturnType parsedValue; + CustomAction.TryParseReturnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ReturnType from a string. + /// + public static bool TryParseReturnType(string value, out ReturnType parsedValue) + { + parsedValue = ReturnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("asyncNoWait" == value)) + { + parsedValue = ReturnType.asyncNoWait; + } + else + { + if (("asyncWait" == value)) + { + parsedValue = ReturnType.asyncWait; + } + else + { + if (("check" == value)) + { + parsedValue = ReturnType.check; + } + else + { + if (("ignore" == value)) + { + parsedValue = ReturnType.ignore; + } + else + { + parsedValue = ReturnType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a ExecuteType from a string. + /// + public static ExecuteType ParseExecuteType(string value) + { + ExecuteType parsedValue; + CustomAction.TryParseExecuteType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ExecuteType from a string. + /// + public static bool TryParseExecuteType(string value, out ExecuteType parsedValue) + { + parsedValue = ExecuteType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("commit" == value)) + { + parsedValue = ExecuteType.commit; + } + else + { + if (("deferred" == value)) + { + parsedValue = ExecuteType.deferred; + } + else + { + if (("firstSequence" == value)) + { + parsedValue = ExecuteType.firstSequence; + } + else + { + if (("immediate" == value)) + { + parsedValue = ExecuteType.immediate; + } + else + { + if (("oncePerProcess" == value)) + { + parsedValue = ExecuteType.oncePerProcess; + } + else + { + if (("rollback" == value)) + { + parsedValue = ExecuteType.rollback; + } + else + { + if (("secondSequence" == value)) + { + parsedValue = ExecuteType.secondSequence; + } + else + { + parsedValue = ExecuteType.IllegalValue; + return false; + } + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomAction", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.binaryKeyFieldSet) + { + writer.WriteAttributeString("BinaryKey", this.binaryKeyField); + } + if (this.fileKeyFieldSet) + { + writer.WriteAttributeString("FileKey", this.fileKeyField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.dllEntryFieldSet) + { + writer.WriteAttributeString("DllEntry", this.dllEntryField); + } + if (this.exeCommandFieldSet) + { + writer.WriteAttributeString("ExeCommand", this.exeCommandField); + } + if (this.jScriptCallFieldSet) + { + writer.WriteAttributeString("JScriptCall", this.jScriptCallField); + } + if (this.vBScriptCallFieldSet) + { + writer.WriteAttributeString("VBScriptCall", this.vBScriptCallField); + } + if (this.scriptFieldSet) + { + if ((this.scriptField == ScriptType.jscript)) + { + writer.WriteAttributeString("Script", "jscript"); + } + if ((this.scriptField == ScriptType.vbscript)) + { + writer.WriteAttributeString("Script", "vbscript"); + } + } + if (this.suppressModularizationFieldSet) + { + if ((this.suppressModularizationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressModularization", "no"); + } + if ((this.suppressModularizationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressModularization", "yes"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.errorFieldSet) + { + writer.WriteAttributeString("Error", this.errorField); + } + if (this.returnFieldSet) + { + if ((this.returnField == ReturnType.asyncNoWait)) + { + writer.WriteAttributeString("Return", "asyncNoWait"); + } + if ((this.returnField == ReturnType.asyncWait)) + { + writer.WriteAttributeString("Return", "asyncWait"); + } + if ((this.returnField == ReturnType.check)) + { + writer.WriteAttributeString("Return", "check"); + } + if ((this.returnField == ReturnType.ignore)) + { + writer.WriteAttributeString("Return", "ignore"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == ExecuteType.commit)) + { + writer.WriteAttributeString("Execute", "commit"); + } + if ((this.executeField == ExecuteType.deferred)) + { + writer.WriteAttributeString("Execute", "deferred"); + } + if ((this.executeField == ExecuteType.firstSequence)) + { + writer.WriteAttributeString("Execute", "firstSequence"); + } + if ((this.executeField == ExecuteType.immediate)) + { + writer.WriteAttributeString("Execute", "immediate"); + } + if ((this.executeField == ExecuteType.oncePerProcess)) + { + writer.WriteAttributeString("Execute", "oncePerProcess"); + } + if ((this.executeField == ExecuteType.rollback)) + { + writer.WriteAttributeString("Execute", "rollback"); + } + if ((this.executeField == ExecuteType.secondSequence)) + { + writer.WriteAttributeString("Execute", "secondSequence"); + } + } + if (this.impersonateFieldSet) + { + if ((this.impersonateField == YesNoType.no)) + { + writer.WriteAttributeString("Impersonate", "no"); + } + if ((this.impersonateField == YesNoType.yes)) + { + writer.WriteAttributeString("Impersonate", "yes"); + } + } + if (this.patchUninstallFieldSet) + { + if ((this.patchUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("PatchUninstall", "no"); + } + if ((this.patchUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchUninstall", "yes"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + if (this.terminalServerAwareFieldSet) + { + if ((this.terminalServerAwareField == YesNoType.no)) + { + writer.WriteAttributeString("TerminalServerAware", "no"); + } + if ((this.terminalServerAwareField == YesNoType.yes)) + { + writer.WriteAttributeString("TerminalServerAware", "yes"); + } + } + if (this.hideTargetFieldSet) + { + if ((this.hideTargetField == YesNoType.no)) + { + writer.WriteAttributeString("HideTarget", "no"); + } + if ((this.hideTargetField == YesNoType.yes)) + { + writer.WriteAttributeString("HideTarget", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("BinaryKey" == name)) + { + this.binaryKeyField = value; + this.binaryKeyFieldSet = true; + } + if (("FileKey" == name)) + { + this.fileKeyField = value; + this.fileKeyFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DllEntry" == name)) + { + this.dllEntryField = value; + this.dllEntryFieldSet = true; + } + if (("ExeCommand" == name)) + { + this.exeCommandField = value; + this.exeCommandFieldSet = true; + } + if (("JScriptCall" == name)) + { + this.jScriptCallField = value; + this.jScriptCallFieldSet = true; + } + if (("VBScriptCall" == name)) + { + this.vBScriptCallField = value; + this.vBScriptCallFieldSet = true; + } + if (("Script" == name)) + { + this.scriptField = CustomAction.ParseScriptType(value); + this.scriptFieldSet = true; + } + if (("SuppressModularization" == name)) + { + this.suppressModularizationField = Enums.ParseYesNoType(value); + this.suppressModularizationFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Error" == name)) + { + this.errorField = value; + this.errorFieldSet = true; + } + if (("Return" == name)) + { + this.returnField = CustomAction.ParseReturnType(value); + this.returnFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = CustomAction.ParseExecuteType(value); + this.executeFieldSet = true; + } + if (("Impersonate" == name)) + { + this.impersonateField = Enums.ParseYesNoType(value); + this.impersonateFieldSet = true; + } + if (("PatchUninstall" == name)) + { + this.patchUninstallField = Enums.ParseYesNoType(value); + this.patchUninstallFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + if (("TerminalServerAware" == name)) + { + this.terminalServerAwareField = Enums.ParseYesNoType(value); + this.terminalServerAwareFieldSet = true; + } + if (("HideTarget" == name)) + { + this.hideTargetField = Enums.ParseYesNoType(value); + this.hideTargetFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ScriptType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + jscript, + + vbscript, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ReturnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Indicates that the custom action will run asyncronously and execution may continue after the installer terminates. + /// + asyncNoWait, + + /// + /// Indicates that the custom action will run asynchronously but the installer will wait for the return code at sequence end. + /// + asyncWait, + + /// + /// Indicates that the custom action will run synchronously and the return code will be checked for success. This is the default. + /// + check, + + /// + /// Indicates that the custom action will run synchronously and the return code will not be checked. + /// + ignore, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ExecuteType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Indicates that the custom action will run after successful completion of the installation script (at the end of the installation). + /// + commit, + + /// + /// Indicates that the custom action runs in-script (possibly with elevated privileges). + /// + deferred, + + /// + /// Indicates that the custom action will only run in the first sequence that runs it. + /// + firstSequence, + + /// + /// Indicates that the custom action will run during normal processing time with user privileges. This is the default. + /// + immediate, + + /// + /// Indicates that the custom action will only run in the first sequence that runs it in the same process. + /// + oncePerProcess, + + /// + /// Indicates that a custom action will run in the rollback sequence when a failure + /// occurs during installation, usually to undo changes made by a deferred custom action. + /// + rollback, + + /// + /// Indicates that a custom action should be run a second time if it was previously run in an earlier sequence. + /// + secondSequence, + } + } + + /// + /// This will cause the entire contents of the Fragment containing the referenced CustomAction to be + /// included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomActionRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the CustomAction to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomActionRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Sets a Directory to a particular value. This is accomplished by creating a Type 51 custom action that is appropriately scheduled in + /// the InstallUISequence and InstallExecuteSequence. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SetDirectory : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string idField; + + private bool idFieldSet; + + private SequenceType sequenceField; + + private bool sequenceFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// By default the action is "Set" + Id attribute's value. This optional attribute can override the action name in the case + /// where multiple SetDirectory elements target the same Id (probably with mutually exclusive conditions). + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// This attribute specifies a reference to a Directory element with matching Id attribute. The path of the Directory will be set to + /// the Value attribute. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Controls which sequences the Directory assignment is sequenced in. + /// For 'execute', the assignment is scheduled in the InstallExecuteSequence. + /// For 'ui', the assignment is scheduled in the InstallUISequence. + /// For 'first', the assignment is scheduled in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped at install time. + /// For 'both', the assignment is scheduled in both the InstallUISequence and the InstallExecuteSequence. + /// The default is 'both'. + /// + public SequenceType Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// This attribute specifies a string value to assign to the Directory. The value can be a literal value or derived from a + /// Property element using the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The condition that determines whether the Directory is set. If the condition evaluates to false, the SetDirectory is skipped. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SetDirectory", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sequenceFieldSet) + { + if ((this.sequenceField == SequenceType.both)) + { + writer.WriteAttributeString("Sequence", "both"); + } + if ((this.sequenceField == SequenceType.first)) + { + writer.WriteAttributeString("Sequence", "first"); + } + if ((this.sequenceField == SequenceType.execute)) + { + writer.WriteAttributeString("Sequence", "execute"); + } + if ((this.sequenceField == SequenceType.ui)) + { + writer.WriteAttributeString("Sequence", "ui"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Enums.ParseSequenceType(value); + this.sequenceFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Sets a Property to a particular value. This is accomplished by creating a Type 51 custom action that is appropriately scheduled in + /// the InstallUISequence and InstallExecuteSequence. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SetProperty : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private string idField; + + private bool idFieldSet; + + private SequenceType sequenceField; + + private bool sequenceFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// By default the action is "Set" + Id attribute's value. This optional attribute can override the action name in the case + /// where multiple SetProperty elements target the same Id (probably with mutually exclusive conditions). + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The name of the standard or custom action after which this action should be performed. Mutually exclusive with the Before attribute. A Before or After attribute is required when setting a Property. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The name of the standard or custom action before which this action should be performed. Mutually exclusive with the After attribute. A Before or After attribute is required when setting a Property. + /// + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + /// + /// This attribute specifies the Property to set to the Value. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Controls which sequences the Property assignment is sequenced in. + /// For 'execute', the assignment is scheduled in the InstallExecuteSequence. + /// For 'ui', the assignment is scheduled in the InstallUISequence. + /// For 'first', the assignment is scheduled in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped at install time. + /// For 'both', the assignment is scheduled in both the InstallUISequence and the InstallExecuteSequence. + /// The default is 'both'. + /// + public SequenceType Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// This attribute specifies a string value to assign to the Property. The value can be a literal value or derived from a + /// Property element using the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The condition that determines whether the Property is set. If the condition evaluates to false, the Set is skipped. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SetProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sequenceFieldSet) + { + if ((this.sequenceField == SequenceType.both)) + { + writer.WriteAttributeString("Sequence", "both"); + } + if ((this.sequenceField == SequenceType.first)) + { + writer.WriteAttributeString("Sequence", "first"); + } + if ((this.sequenceField == SequenceType.execute)) + { + writer.WriteAttributeString("Sequence", "execute"); + } + if ((this.sequenceField == SequenceType.ui)) + { + writer.WriteAttributeString("Sequence", "ui"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Enums.ParseSequenceType(value); + this.sequenceFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// This will cause the entire contents of the Fragment containing the referenced PatchFamily to be + /// used in the process of creating a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamilyRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PatchFamily to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies the ProductCode of the product that this family applies to. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamilyRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + } + } + + /// + /// Sets the ProductID property to the full product identifier. This action must be sequenced before the user interface wizard in the InstallUISequence table and before the RegisterUser action in the InstallExecuteSequence table. If the product identifier has already been validated successfully, the ValidateProductID action does nothing. The ValidateProductID action always returns a success, whether or not the product identifier is valid, so that the product identifier can be entered on the command line the first time the product is run. The product identifier can be validated without having the user reenter this information by setting the PIDKEY property on the command line or by using a transform. The display of the dialog box requesting the user to enter the product identifier can then be made conditional upon the presence of the ProductID property, which is set when the PIDKEY property is validated. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ValidateProductID : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ValidateProductID", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Initiates the internal installation costing process. Any standard or custom actions that affect costing should be sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action. Then call the CostFinalize action following the CostInitialize action to make all final cost calculations available to the installer through the Component table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CostInitialize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CostInitialize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Initiates dynamic costing of standard installation actions. Any standard or custom actions that affect costing should sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action. Then call the CostFinalize action following the FileCost action to make all final cost calculations available to the installer through the Component table. The CostInitialize action must be executed before the FileCost action. The installer then determines the disk-space cost of every file in the File table, on a per-component basis, taking both volume clustering and the presence of existing files that may need to be overwritten into account. All actions that consume or release disk space are also considered. If an existing file is found, a file version check is performed to determine whether the new file actually needs to be installed or not. If the existing file is of an equal or greater version number, the existing file is not overwritten and no disk-space cost is incurred. In all cases, the installer uses the results of version number checking to set the installation state of each file. The FileCost action initializes cost calculation with the installer. Actual dynamic costing does not occur until the CostFinalize action is executed. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileCost : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileCost", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Installs a copy of a component (commonly a shared DLL) into a private location for use by a specific application (typically an .exe). This isolates the application from other copies of the component that may be installed to a shared location on the computer. The action refers to each record of the IsolatedComponent table and associates the files of the component listed in the Component_Shared field with the component listed in the Component_Application field. The installer installs the files of Component_Shared into the same directory as Component_Application. The installer generates a file in this directory, zero bytes in length, having the short filename name of the key file for Component_Application (typically this is the same file name as the .exe) appended with .local. The IsolatedComponent action does not affect the installation of Component_Application. Uninstalling Component_Application also removes the Component_Shared files and the .local file from the directory. The IsolateComponents action can be used only in the InstallUISequence table and the InstallExecuteSequence table. This action must come after the CostInitialize action and before the CostFinalize action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IsolateComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IsolateComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Ends the internal installation costing process begun by the CostInitialize action. Any standard or custom actions that affect costing should be sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action and then call the CostFinalize action to make all final cost calculations available to the installer through the Component table. The CostFinalize action must be executed before starting any user interface sequence which allows the user to view or modify Feature table selections or directories. The CostFinalize action queries the Condition table to determine which features are scheduled to be installed. Costing is done for each component in the Component table. The CostFinalize action also verifies that all the target directories are writable before allowing the installation to continue. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CostFinalize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CostFinalize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Checks for existing ODBC drivers and sets the target directory for each new driver to the location of an existing driver. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SetODBCFolders : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SetODBCFolders", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Used for upgrading or installing over an existing application. Reads feature states from existing application and sets these feature states for the pending installation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MigrateFeatureStates : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MigrateFeatureStates", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Initiates the execution sequence. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExecuteAction : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExecuteAction", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Verifies that all costed volumes have enough space for the installation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallValidate : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallValidate", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Marks the beginning of a sequence of actions that change the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallInitialize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallInitialize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Ensures the needed amount of space exists in the registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AllocateRegistrySpace : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AllocateRegistrySpace", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers and unregisters components, their key paths, and the component clients. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProcessComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProcessComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the unadvertisement of components listed in the PublishComponent table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnpublishComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnpublishComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the unadvertisement of CLR and Win32 assemblies that are being removed. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiUnpublishAssemblies : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiUnpublishAssemblies", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes selection-state and feature-component mapping information from the registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnpublishFeatures : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnpublishFeatures", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Stops system services. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class StopServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("StopServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Stops a service and removes its registration from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DeleteServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DeleteServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes COM+ applications from the registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterComPlus : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterComPlus", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Unregisters all modules listed in the SelfReg table that are scheduled to be uninstalled. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SelfUnregModules : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SelfUnregModules", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Unregisters type libraries from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterTypeLibraries : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterTypeLibraries", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes the data sources, translators, and drivers listed for removal during the installation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveODBC : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveODBC", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes registration information about installed fonts from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterFonts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterFonts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes a registry value that has been authored into the registry table if the associated component was installed locally or as run from source, and is now set to be uninstalled. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveRegistryValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveRegistryValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the removal of COM class information from the system registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterClassInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterClassInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the removal of extension-related information from the system registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterExtensionInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterExtensionInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the unregistration of OLE ProgId information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterProgIdInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterProgIdInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Unregisters MIME-related registry information from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterMIMEInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterMIMEInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes .ini file information specified for removal in the RemoveIniFile table if the component is set to be installed locally or run from source. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveIniValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveIniValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the removal of an advertised shortcut whose feature is selected for uninstallation or a nonadvertised shortcut whose component is selected for uninstallation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveShortcuts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveShortcuts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Modifies the values of environment variables. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveEnvironmentStrings : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveEnvironmentStrings", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Deletes files installed by the DuplicateFiles action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveDuplicateFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveDuplicateFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes files previously installed by the InstallFiles action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes any folders linked to components set to be removed or run from source. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFolders : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFolders", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Creates empty folders for components that are set to be installed. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CreateFolders : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CreateFolders", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Locates existing files on the system and moves or copies those files to a new location. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MoveFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MoveFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Copies the product database to the administrative installation point. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallAdminPackage : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallAdminPackage", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Copies files specified in the File table from the source directory to the destination directory. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Duplicates files installed by the InstallFiles action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DuplicateFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DuplicateFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Queries the Patch table to determine which patches are to be applied. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Binds each executable or DLL that must be bound to the DLLs imported by it. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BindImage : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BindImage", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the creation of shortcuts. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CreateShortcuts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CreateShortcuts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the registration of COM class information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterClassInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterClassInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the registration of extension related information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterExtensionInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterExtensionInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the registration of OLE ProgId information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterProgIdInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterProgIdInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers MIME-related registry information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterMIMEInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterMIMEInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Sets up an application's registry information. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WriteRegistryValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WriteRegistryValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Writes the .ini file information that the application needs written to its .ini files. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WriteIniValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WriteIniValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Modifies the values of environment variables. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WriteEnvironmentStrings : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WriteEnvironmentStrings", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers installed fonts with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterFonts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterFonts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Installs the drivers, translators, and data sources in the ODBCDriver table, ODBCTranslator table, and ODBCDataSource table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallODBC : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallODBC", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers type libraries with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterTypeLibraries : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterTypeLibraries", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Processes all modules listed in the SelfReg table and registers all installed modules with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SelfRegModules : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SelfRegModules", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers COM+ applications. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterComPlus : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterComPlus", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers a service for the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Starts system services. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class StartServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("StartServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers the user information with the installer to identify the user of a product. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterUser : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterUser", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers the product information with the installer. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterProduct : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterProduct", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the advertisement of the components from the PublishComponent table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PublishComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PublishComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the advertisement of CLR and Win32 assemblies. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiPublishAssemblies : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiPublishAssemblies", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Writes each feature's state into the system registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PublishFeatures : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PublishFeatures", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the advertisement of the product information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PublishProduct : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PublishProduct", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Marks the end of a sequence of actions that change the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallFinalize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallFinalize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Uses file signatures to search for existing versions of products. The AppSearch action may use this information to determine where upgrades are to be installed. The AppSearch action can also be used to set a property to the existing value of an registry or .ini file entry. AppSearch should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents The AppSearch action from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The AppSearch action searches for file signatures using the CompLocator table first, the RegLocator table next, then the IniLocator table, and finally the DrLocator table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AppSearch : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AppSearch", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Uses file signatures to validate that qualifying products are installed on a system before an upgrade installation is performed. The CCPSearch action should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents the CCPSearch action from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The CCPSearch action must come before the RMCCPSearch action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CCPSearch : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CCPSearch", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Uses file signatures to validate that qualifying products are installed on a system before an upgrade installation is performed. The RMCCPSearch action should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents RMCCPSearch from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The RMCCPSearch action requires the CCP_DRIVE property to be set to the root path on the removable volume that has the installation for any of the qualifying products. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RMCCPSearch : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RMCCPSearch", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Queries the LaunchCondition table and evaluates each conditional statement recorded there. If any of these conditional statements fail, an error message is displayed to the user and the installation is terminated. The LaunchConditions action is optional. This action is normally the first in the sequence, but the AppSearch Action may be sequenced before the LaunchConditions action. If there are launch conditions that do not apply to all installation modes, the appropriate installation mode property should be used in a conditional expression in the appropriate sequence table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class LaunchConditions : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("LaunchConditions", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Runs through each record of the Upgrade table in sequence and compares the upgrade code, product version, and language in each row to products installed on the system. When FindRelatedProducts detects a correspondence between the upgrade information and an installed product, it appends the product code to the property specified in the ActionProperty column of the UpgradeTable. The FindRelatedProducts action only runs the first time the product is installed. The FindRelatedProducts action does not run during maintenance mode or uninstallation. FindRelatedProducts should be authored into the InstallUISequence table and InstallExecuteSequence tables. The installer prevents FindRelatedProducts from running in InstallExecuteSequence if the action has already run in InstallUISequence. The FindRelatedProducts action must come before the MigrateFeatureStates action and the RemoveExistingProducts action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FindRelatedProducts : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FindRelatedProducts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Runs a script containing all operations spooled since either the start of the installation or the last InstallExecute action, or InstallExecuteAgain action. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallExecute : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallExecute", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Runs a script containing all operations spooled since either the start of the installation or the last InstallExecute action, or InstallExecuteAgain action. Should only be used after InstallExecute. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallExecuteAgain : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallExecuteAgain", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Disables rollback for the remainder of the installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DisableRollback : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DisableRollback", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Goes through the product codes listed in the ActionProperty column of the Upgrade table and removes the products in sequence. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveExistingProducts : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveExistingProducts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Prompts the user to restart the system at the end of installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ScheduleReboot : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ScheduleReboot", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Prompts the user for a restart of the system during the installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ForceReboot : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ForceReboot", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Determines the location of the source and sets the SourceDir property if the source has not been resolved yet. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ResolveSource : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ResolveSource", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Use to sequence a custom action. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Custom : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private ExitType onExitField; + + private bool onExitFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The action to which the Custom element applies. + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Mutually exclusive with Before, After, and Sequence attributes + /// + public ExitType OnExit + { + get + { + return this.onExitField; + } + set + { + this.onExitFieldSet = true; + this.onExitField = value; + } + } + + /// + /// The name of the standard or custom action before which this action should be performed. Mutually exclusive with OnExit, After, and Sequence attributes + /// + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + /// + /// The name of the standard or custom action after which this action should be performed. Mutually exclusive with Before, OnExit, and Sequence attributes + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// If "yes", the sequencing of this action may be overridden by sequencing elsewhere. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + /// + /// The sequence number for this action. Mutually exclusive with Before, After, and OnExit attributes + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Text node specifies the condition of the action. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Custom", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.onExitFieldSet) + { + if ((this.onExitField == ExitType.success)) + { + writer.WriteAttributeString("OnExit", "success"); + } + if ((this.onExitField == ExitType.cancel)) + { + writer.WriteAttributeString("OnExit", "cancel"); + } + if ((this.onExitField == ExitType.error)) + { + writer.WriteAttributeString("OnExit", "error"); + } + if ((this.onExitField == ExitType.suspend)) + { + writer.WriteAttributeString("OnExit", "suspend"); + } + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("OnExit" == name)) + { + this.onExitField = Enums.ParseExitType(value); + this.onExitFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Show : ISchemaElement, ISetAttributes + { + + private string dialogField; + + private bool dialogFieldSet; + + private ExitType onExitField; + + private bool onExitFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + public string Dialog + { + get + { + return this.dialogField; + } + set + { + this.dialogFieldSet = true; + this.dialogField = value; + } + } + + /// + /// mutually exclusive with Before, After, and Sequence attributes + /// + public ExitType OnExit + { + get + { + return this.onExitField; + } + set + { + this.onExitFieldSet = true; + this.onExitField = value; + } + } + + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// If "yes", the sequencing of this dialog may be overridden by sequencing elsewhere. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Show", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.dialogFieldSet) + { + writer.WriteAttributeString("Dialog", this.dialogField); + } + if (this.onExitFieldSet) + { + if ((this.onExitField == ExitType.success)) + { + writer.WriteAttributeString("OnExit", "success"); + } + if ((this.onExitField == ExitType.cancel)) + { + writer.WriteAttributeString("OnExit", "cancel"); + } + if ((this.onExitField == ExitType.error)) + { + writer.WriteAttributeString("OnExit", "error"); + } + if ((this.onExitField == ExitType.suspend)) + { + writer.WriteAttributeString("OnExit", "suspend"); + } + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Dialog" == name)) + { + this.dialogField = value; + this.dialogFieldSet = true; + } + if (("OnExit" == name)) + { + this.onExitField = Enums.ParseExitType(value); + this.onExitFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallUISequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public InstallUISequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Show))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ScheduleReboot))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FindRelatedProducts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RMCCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ValidateProductID))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MigrateFeatureStates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExecuteAction))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("Show" == childName)) + { + childValue = new Show(); + } + if (("ScheduleReboot" == childName)) + { + childValue = new ScheduleReboot(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if (("FindRelatedProducts" == childName)) + { + childValue = new FindRelatedProducts(); + } + if (("AppSearch" == childName)) + { + childValue = new AppSearch(); + } + if (("CCPSearch" == childName)) + { + childValue = new CCPSearch(); + } + if (("RMCCPSearch" == childName)) + { + childValue = new RMCCPSearch(); + } + if (("ValidateProductID" == childName)) + { + childValue = new ValidateProductID(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("IsolateComponents" == childName)) + { + childValue = new IsolateComponents(); + } + if (("ResolveSource" == childName)) + { + childValue = new ResolveSource(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("MigrateFeatureStates" == childName)) + { + childValue = new MigrateFeatureStates(); + } + if (("ExecuteAction" == childName)) + { + childValue = new ExecuteAction(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallUISequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public InstallExecuteSequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ScheduleReboot))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ForceReboot))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FindRelatedProducts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RMCCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ValidateProductID))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetODBCFolders))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MigrateFeatureStates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AllocateRegistrySpace))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProcessComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnpublishComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnpublishFeatures))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(StopServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DeleteServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterComPlus))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SelfUnregModules))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterTypeLibraries))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveODBC))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterFonts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterClassInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterExtensionInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterProgIdInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterMIMEInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveIniValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveShortcuts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveEnvironmentStrings))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveDuplicateFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFolders))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateFolders))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MoveFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DuplicateFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BindImage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateShortcuts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterClassInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterExtensionInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProgIdInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterMIMEInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteRegistryValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteIniValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteEnvironmentStrings))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterFonts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallODBC))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterTypeLibraries))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SelfRegModules))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterComPlus))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(StartServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterUser))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProduct))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishFeatures))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishProduct))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveExistingProducts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DisableRollback))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallExecute))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallExecuteAgain))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPublishAssemblies))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiUnpublishAssemblies))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("ScheduleReboot" == childName)) + { + childValue = new ScheduleReboot(); + } + if (("ForceReboot" == childName)) + { + childValue = new ForceReboot(); + } + if (("ResolveSource" == childName)) + { + childValue = new ResolveSource(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if (("FindRelatedProducts" == childName)) + { + childValue = new FindRelatedProducts(); + } + if (("AppSearch" == childName)) + { + childValue = new AppSearch(); + } + if (("CCPSearch" == childName)) + { + childValue = new CCPSearch(); + } + if (("RMCCPSearch" == childName)) + { + childValue = new RMCCPSearch(); + } + if (("ValidateProductID" == childName)) + { + childValue = new ValidateProductID(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("IsolateComponents" == childName)) + { + childValue = new IsolateComponents(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("SetODBCFolders" == childName)) + { + childValue = new SetODBCFolders(); + } + if (("MigrateFeatureStates" == childName)) + { + childValue = new MigrateFeatureStates(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("AllocateRegistrySpace" == childName)) + { + childValue = new AllocateRegistrySpace(); + } + if (("ProcessComponents" == childName)) + { + childValue = new ProcessComponents(); + } + if (("UnpublishComponents" == childName)) + { + childValue = new UnpublishComponents(); + } + if (("UnpublishFeatures" == childName)) + { + childValue = new UnpublishFeatures(); + } + if (("StopServices" == childName)) + { + childValue = new StopServices(); + } + if (("DeleteServices" == childName)) + { + childValue = new DeleteServices(); + } + if (("UnregisterComPlus" == childName)) + { + childValue = new UnregisterComPlus(); + } + if (("SelfUnregModules" == childName)) + { + childValue = new SelfUnregModules(); + } + if (("UnregisterTypeLibraries" == childName)) + { + childValue = new UnregisterTypeLibraries(); + } + if (("RemoveODBC" == childName)) + { + childValue = new RemoveODBC(); + } + if (("UnregisterFonts" == childName)) + { + childValue = new UnregisterFonts(); + } + if (("RemoveRegistryValues" == childName)) + { + childValue = new RemoveRegistryValues(); + } + if (("UnregisterClassInfo" == childName)) + { + childValue = new UnregisterClassInfo(); + } + if (("UnregisterExtensionInfo" == childName)) + { + childValue = new UnregisterExtensionInfo(); + } + if (("UnregisterProgIdInfo" == childName)) + { + childValue = new UnregisterProgIdInfo(); + } + if (("UnregisterMIMEInfo" == childName)) + { + childValue = new UnregisterMIMEInfo(); + } + if (("RemoveIniValues" == childName)) + { + childValue = new RemoveIniValues(); + } + if (("RemoveShortcuts" == childName)) + { + childValue = new RemoveShortcuts(); + } + if (("RemoveEnvironmentStrings" == childName)) + { + childValue = new RemoveEnvironmentStrings(); + } + if (("RemoveDuplicateFiles" == childName)) + { + childValue = new RemoveDuplicateFiles(); + } + if (("RemoveFiles" == childName)) + { + childValue = new RemoveFiles(); + } + if (("RemoveFolders" == childName)) + { + childValue = new RemoveFolders(); + } + if (("CreateFolders" == childName)) + { + childValue = new CreateFolders(); + } + if (("MoveFiles" == childName)) + { + childValue = new MoveFiles(); + } + if (("InstallFiles" == childName)) + { + childValue = new InstallFiles(); + } + if (("DuplicateFiles" == childName)) + { + childValue = new DuplicateFiles(); + } + if (("PatchFiles" == childName)) + { + childValue = new PatchFiles(); + } + if (("BindImage" == childName)) + { + childValue = new BindImage(); + } + if (("CreateShortcuts" == childName)) + { + childValue = new CreateShortcuts(); + } + if (("RegisterClassInfo" == childName)) + { + childValue = new RegisterClassInfo(); + } + if (("RegisterExtensionInfo" == childName)) + { + childValue = new RegisterExtensionInfo(); + } + if (("RegisterProgIdInfo" == childName)) + { + childValue = new RegisterProgIdInfo(); + } + if (("RegisterMIMEInfo" == childName)) + { + childValue = new RegisterMIMEInfo(); + } + if (("WriteRegistryValues" == childName)) + { + childValue = new WriteRegistryValues(); + } + if (("WriteIniValues" == childName)) + { + childValue = new WriteIniValues(); + } + if (("WriteEnvironmentStrings" == childName)) + { + childValue = new WriteEnvironmentStrings(); + } + if (("RegisterFonts" == childName)) + { + childValue = new RegisterFonts(); + } + if (("InstallODBC" == childName)) + { + childValue = new InstallODBC(); + } + if (("RegisterTypeLibraries" == childName)) + { + childValue = new RegisterTypeLibraries(); + } + if (("SelfRegModules" == childName)) + { + childValue = new SelfRegModules(); + } + if (("RegisterComPlus" == childName)) + { + childValue = new RegisterComPlus(); + } + if (("InstallServices" == childName)) + { + childValue = new InstallServices(); + } + if (("StartServices" == childName)) + { + childValue = new StartServices(); + } + if (("RegisterUser" == childName)) + { + childValue = new RegisterUser(); + } + if (("RegisterProduct" == childName)) + { + childValue = new RegisterProduct(); + } + if (("PublishComponents" == childName)) + { + childValue = new PublishComponents(); + } + if (("PublishFeatures" == childName)) + { + childValue = new PublishFeatures(); + } + if (("PublishProduct" == childName)) + { + childValue = new PublishProduct(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("RemoveExistingProducts" == childName)) + { + childValue = new RemoveExistingProducts(); + } + if (("DisableRollback" == childName)) + { + childValue = new DisableRollback(); + } + if (("InstallExecute" == childName)) + { + childValue = new InstallExecute(); + } + if (("InstallExecuteAgain" == childName)) + { + childValue = new InstallExecuteAgain(); + } + if (("MsiPublishAssemblies" == childName)) + { + childValue = new MsiPublishAssemblies(); + } + if (("MsiUnpublishAssemblies" == childName)) + { + childValue = new MsiUnpublishAssemblies(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AdminUISequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public AdminUISequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Show))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExecuteAction))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallAdminPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("Show" == childName)) + { + childValue = new Show(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("ExecuteAction" == childName)) + { + childValue = new ExecuteAction(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("InstallAdminPackage" == childName)) + { + childValue = new InstallAdminPackage(); + } + if (("InstallFiles" == childName)) + { + childValue = new InstallFiles(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AdminUISequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AdminExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public AdminExecuteSequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallAdminPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("InstallAdminPackage" == childName)) + { + childValue = new InstallAdminPackage(); + } + if (("InstallFiles" == childName)) + { + childValue = new InstallFiles(); + } + if (("PatchFiles" == childName)) + { + childValue = new PatchFiles(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if (("ResolveSource" == childName)) + { + childValue = new ResolveSource(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AdminExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AdvertiseExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public AdvertiseExecuteSequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateShortcuts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterClassInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterExtensionInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterMIMEInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProgIdInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishFeatures))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishProduct))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPublishAssemblies))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("CreateShortcuts" == childName)) + { + childValue = new CreateShortcuts(); + } + if (("RegisterClassInfo" == childName)) + { + childValue = new RegisterClassInfo(); + } + if (("RegisterExtensionInfo" == childName)) + { + childValue = new RegisterExtensionInfo(); + } + if (("RegisterMIMEInfo" == childName)) + { + childValue = new RegisterMIMEInfo(); + } + if (("RegisterProgIdInfo" == childName)) + { + childValue = new RegisterProgIdInfo(); + } + if (("PublishComponents" == childName)) + { + childValue = new PublishComponents(); + } + if (("PublishFeatures" == childName)) + { + childValue = new PublishFeatures(); + } + if (("PublishProduct" == childName)) + { + childValue = new PublishProduct(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("MsiPublishAssemblies" == childName)) + { + childValue = new MsiPublishAssemblies(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AdvertiseExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Binary data used for CustomAction elements and UI controls. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Binary : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private YesNoType suppressModularizationField; + + private bool suppressModularizationFieldSet; + + private ISchemaElement parentElement; + + public Binary() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The Id cannot be longer than 55 characters. In order to prevent errors in cases where the Id is modularized, it should not be longer than 18 characters. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path to the binary file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Use to suppress modularization of this Binary identifier in merge modules. + /// + public YesNoType SuppressModularization + { + get + { + return this.suppressModularizationField; + } + set + { + this.suppressModularizationFieldSet = true; + this.suppressModularizationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Binary", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.suppressModularizationFieldSet) + { + if ((this.suppressModularizationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressModularization", "no"); + } + if ((this.suppressModularizationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressModularization", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("SuppressModularization" == name)) + { + this.suppressModularizationField = Enums.ParseYesNoType(value); + this.suppressModularizationFieldSet = true; + } + } + } + + /// + /// Icon used for Shortcut, ProgId, or Class elements (but not UI controls) + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Icon : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + /// + /// The Id cannot be longer than 55 characters. In order to prevent errors in cases where the Id is modularized, it should not be longer than 18 characters. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path to the icon file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Icon", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedChainer : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string commandLineField; + + private bool commandLineFieldSet; + + private string binarySourceField; + + private bool binarySourceFieldSet; + + private string fileSourceField; + + private bool fileSourceFieldSet; + + private string propertySourceField; + + private bool propertySourceFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for embedded chainer. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Value to append to the transaction handle and passed to the chainer executable. + /// + public string CommandLine + { + get + { + return this.commandLineField; + } + set + { + this.commandLineFieldSet = true; + this.commandLineField = value; + } + } + + /// + /// Reference to the Binary element that contains the chainer executable. Mutually exclusive with + /// the FileSource and PropertySource attributes. + /// + public string BinarySource + { + get + { + return this.binarySourceField; + } + set + { + this.binarySourceFieldSet = true; + this.binarySourceField = value; + } + } + + /// + /// Reference to the File element that is the chainer executable. Mutually exclusive with + /// the BinarySource and PropertySource attributes. + /// + public string FileSource + { + get + { + return this.fileSourceField; + } + set + { + this.fileSourceFieldSet = true; + this.fileSourceField = value; + } + } + + /// + /// Reference to a Property that resolves to the full path to the chainer executable. Mutually exclusive with + /// the BinarySource and FileSource attributes. + /// + public string PropertySource + { + get + { + return this.propertySourceField; + } + set + { + this.propertySourceFieldSet = true; + this.propertySourceField = value; + } + } + + /// + /// Element value is the condition. CDATA may be used to when a condition contains many XML characters + /// that must be escaped. It is important to note that each EmbeddedChainer element must have a mutually exclusive condition + /// to ensure that only one embedded chainer will execute at a time. If the conditions are not mutually exclusive the chainer + /// that executes is undeterministic. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedChainer", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.commandLineFieldSet) + { + writer.WriteAttributeString("CommandLine", this.commandLineField); + } + if (this.binarySourceFieldSet) + { + writer.WriteAttributeString("BinarySource", this.binarySourceField); + } + if (this.fileSourceFieldSet) + { + writer.WriteAttributeString("FileSource", this.fileSourceField); + } + if (this.propertySourceFieldSet) + { + writer.WriteAttributeString("PropertySource", this.propertySourceField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("CommandLine" == name)) + { + this.commandLineField = value; + this.commandLineFieldSet = true; + } + if (("BinarySource" == name)) + { + this.binarySourceField = value; + this.binarySourceFieldSet = true; + } + if (("FileSource" == name)) + { + this.fileSourceField = value; + this.fileSourceFieldSet = true; + } + if (("PropertySource" == name)) + { + this.propertySourceField = value; + this.propertySourceFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Reference to an EmbeddedChainer element. This will force the entire referenced Fragment's contents + /// to be included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedChainerRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedChainerRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Element value is the condition. Use CDATA if message contains delimiter characters. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedUI : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType ignoreFatalExitField; + + private bool ignoreFatalExitFieldSet; + + private YesNoType ignoreErrorField; + + private bool ignoreErrorFieldSet; + + private YesNoType ignoreWarningField; + + private bool ignoreWarningFieldSet; + + private YesNoType ignoreUserField; + + private bool ignoreUserFieldSet; + + private YesNoType ignoreInfoField; + + private bool ignoreInfoFieldSet; + + private YesNoType ignoreFilesInUseField; + + private bool ignoreFilesInUseFieldSet; + + private YesNoType ignoreResolveSourceField; + + private bool ignoreResolveSourceFieldSet; + + private YesNoType ignoreOutOfDiskSpaceField; + + private bool ignoreOutOfDiskSpaceFieldSet; + + private YesNoType ignoreActionStartField; + + private bool ignoreActionStartFieldSet; + + private YesNoType ignoreActionDataField; + + private bool ignoreActionDataFieldSet; + + private YesNoType ignoreProgressField; + + private bool ignoreProgressFieldSet; + + private YesNoType ignoreCommonDataField; + + private bool ignoreCommonDataFieldSet; + + private YesNoType ignoreInitializeField; + + private bool ignoreInitializeFieldSet; + + private YesNoType ignoreTerminateField; + + private bool ignoreTerminateFieldSet; + + private YesNoType ignoreShowDialogField; + + private bool ignoreShowDialogFieldSet; + + private YesNoType ignoreRMFilesInUseField; + + private bool ignoreRMFilesInUseFieldSet; + + private YesNoType ignoreInstallStartField; + + private bool ignoreInstallStartFieldSet; + + private YesNoType ignoreInstallEndField; + + private bool ignoreInstallEndFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private YesNoType supportBasicUIField; + + private bool supportBasicUIFieldSet; + + private ISchemaElement parentElement; + + public EmbeddedUI() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(EmbeddedUIResource))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for embedded UI.If this attribute is not specified the Name attribute or the file name + /// portion of the SourceFile attribute will be used. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_FATALEXIT messages. + /// + public YesNoType IgnoreFatalExit + { + get + { + return this.ignoreFatalExitField; + } + set + { + this.ignoreFatalExitFieldSet = true; + this.ignoreFatalExitField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_ERROR messages. + /// + public YesNoType IgnoreError + { + get + { + return this.ignoreErrorField; + } + set + { + this.ignoreErrorFieldSet = true; + this.ignoreErrorField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_WARNING messages. + /// + public YesNoType IgnoreWarning + { + get + { + return this.ignoreWarningField; + } + set + { + this.ignoreWarningFieldSet = true; + this.ignoreWarningField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_USER messages. + /// + public YesNoType IgnoreUser + { + get + { + return this.ignoreUserField; + } + set + { + this.ignoreUserFieldSet = true; + this.ignoreUserField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INFO messages. + /// + public YesNoType IgnoreInfo + { + get + { + return this.ignoreInfoField; + } + set + { + this.ignoreInfoFieldSet = true; + this.ignoreInfoField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_FILESINUSE messages. + /// + public YesNoType IgnoreFilesInUse + { + get + { + return this.ignoreFilesInUseField; + } + set + { + this.ignoreFilesInUseFieldSet = true; + this.ignoreFilesInUseField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_RESOLVESOURCE messages. + /// + public YesNoType IgnoreResolveSource + { + get + { + return this.ignoreResolveSourceField; + } + set + { + this.ignoreResolveSourceFieldSet = true; + this.ignoreResolveSourceField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_OUTOFDISKSPACE messages. + /// + public YesNoType IgnoreOutOfDiskSpace + { + get + { + return this.ignoreOutOfDiskSpaceField; + } + set + { + this.ignoreOutOfDiskSpaceFieldSet = true; + this.ignoreOutOfDiskSpaceField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_ACTIONSTART messages. + /// + public YesNoType IgnoreActionStart + { + get + { + return this.ignoreActionStartField; + } + set + { + this.ignoreActionStartFieldSet = true; + this.ignoreActionStartField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_ACTIONDATA messages. + /// + public YesNoType IgnoreActionData + { + get + { + return this.ignoreActionDataField; + } + set + { + this.ignoreActionDataFieldSet = true; + this.ignoreActionDataField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_PROGRESS messages. + /// + public YesNoType IgnoreProgress + { + get + { + return this.ignoreProgressField; + } + set + { + this.ignoreProgressFieldSet = true; + this.ignoreProgressField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_COMMONDATA messages. + /// + public YesNoType IgnoreCommonData + { + get + { + return this.ignoreCommonDataField; + } + set + { + this.ignoreCommonDataFieldSet = true; + this.ignoreCommonDataField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INITIALIZE messages. + /// + public YesNoType IgnoreInitialize + { + get + { + return this.ignoreInitializeField; + } + set + { + this.ignoreInitializeFieldSet = true; + this.ignoreInitializeField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_TERMINATE messages. + /// + public YesNoType IgnoreTerminate + { + get + { + return this.ignoreTerminateField; + } + set + { + this.ignoreTerminateFieldSet = true; + this.ignoreTerminateField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_SHOWDIALOG messages. + /// + public YesNoType IgnoreShowDialog + { + get + { + return this.ignoreShowDialogField; + } + set + { + this.ignoreShowDialogFieldSet = true; + this.ignoreShowDialogField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_RMFILESINUSE messages. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType IgnoreRMFilesInUse + { + get + { + return this.ignoreRMFilesInUseField; + } + set + { + this.ignoreRMFilesInUseFieldSet = true; + this.ignoreRMFilesInUseField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INSTALLSTART messages. + /// + public YesNoType IgnoreInstallStart + { + get + { + return this.ignoreInstallStartField; + } + set + { + this.ignoreInstallStartFieldSet = true; + this.ignoreInstallStartField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INSTALLEND messages. + /// + public YesNoType IgnoreInstallEnd + { + get + { + return this.ignoreInstallEndField; + } + set + { + this.ignoreInstallEndFieldSet = true; + this.ignoreInstallEndField = value; + } + } + + /// + /// The name for the embedded UI DLL when it is extracted from the package and executed. (Windows Installer + /// does not support the typical short filename and long filename combination for embedded UI files as it + /// does for other kinds of files.) If this attribute is not specified the file name portion of the SourceFile + /// attribute will be used. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Path to the binary file that is the embedded UI. This must be a DLL that exports the following + /// three entry points: InitializeEmbeddedUI, EmbeddedUIHandler and ShutdownEmbeddedUI. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// Set yes to allow the Windows Installer to display the embedded UI during basic UI level installation. + /// + public YesNoType SupportBasicUI + { + get + { + return this.supportBasicUIField; + } + set + { + this.supportBasicUIFieldSet = true; + this.supportBasicUIField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("EmbeddedUIResource" == childName)) + { + childValue = new EmbeddedUIResource(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedUI", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.ignoreFatalExitFieldSet) + { + if ((this.ignoreFatalExitField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreFatalExit", "no"); + } + if ((this.ignoreFatalExitField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreFatalExit", "yes"); + } + } + if (this.ignoreErrorFieldSet) + { + if ((this.ignoreErrorField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreError", "no"); + } + if ((this.ignoreErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreError", "yes"); + } + } + if (this.ignoreWarningFieldSet) + { + if ((this.ignoreWarningField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreWarning", "no"); + } + if ((this.ignoreWarningField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreWarning", "yes"); + } + } + if (this.ignoreUserFieldSet) + { + if ((this.ignoreUserField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreUser", "no"); + } + if ((this.ignoreUserField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreUser", "yes"); + } + } + if (this.ignoreInfoFieldSet) + { + if ((this.ignoreInfoField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInfo", "no"); + } + if ((this.ignoreInfoField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInfo", "yes"); + } + } + if (this.ignoreFilesInUseFieldSet) + { + if ((this.ignoreFilesInUseField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreFilesInUse", "no"); + } + if ((this.ignoreFilesInUseField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreFilesInUse", "yes"); + } + } + if (this.ignoreResolveSourceFieldSet) + { + if ((this.ignoreResolveSourceField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreResolveSource", "no"); + } + if ((this.ignoreResolveSourceField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreResolveSource", "yes"); + } + } + if (this.ignoreOutOfDiskSpaceFieldSet) + { + if ((this.ignoreOutOfDiskSpaceField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreOutOfDiskSpace", "no"); + } + if ((this.ignoreOutOfDiskSpaceField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreOutOfDiskSpace", "yes"); + } + } + if (this.ignoreActionStartFieldSet) + { + if ((this.ignoreActionStartField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreActionStart", "no"); + } + if ((this.ignoreActionStartField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreActionStart", "yes"); + } + } + if (this.ignoreActionDataFieldSet) + { + if ((this.ignoreActionDataField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreActionData", "no"); + } + if ((this.ignoreActionDataField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreActionData", "yes"); + } + } + if (this.ignoreProgressFieldSet) + { + if ((this.ignoreProgressField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreProgress", "no"); + } + if ((this.ignoreProgressField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreProgress", "yes"); + } + } + if (this.ignoreCommonDataFieldSet) + { + if ((this.ignoreCommonDataField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreCommonData", "no"); + } + if ((this.ignoreCommonDataField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreCommonData", "yes"); + } + } + if (this.ignoreInitializeFieldSet) + { + if ((this.ignoreInitializeField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInitialize", "no"); + } + if ((this.ignoreInitializeField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInitialize", "yes"); + } + } + if (this.ignoreTerminateFieldSet) + { + if ((this.ignoreTerminateField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreTerminate", "no"); + } + if ((this.ignoreTerminateField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreTerminate", "yes"); + } + } + if (this.ignoreShowDialogFieldSet) + { + if ((this.ignoreShowDialogField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreShowDialog", "no"); + } + if ((this.ignoreShowDialogField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreShowDialog", "yes"); + } + } + if (this.ignoreRMFilesInUseFieldSet) + { + if ((this.ignoreRMFilesInUseField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreRMFilesInUse", "no"); + } + if ((this.ignoreRMFilesInUseField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreRMFilesInUse", "yes"); + } + } + if (this.ignoreInstallStartFieldSet) + { + if ((this.ignoreInstallStartField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInstallStart", "no"); + } + if ((this.ignoreInstallStartField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInstallStart", "yes"); + } + } + if (this.ignoreInstallEndFieldSet) + { + if ((this.ignoreInstallEndField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInstallEnd", "no"); + } + if ((this.ignoreInstallEndField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInstallEnd", "yes"); + } + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.supportBasicUIFieldSet) + { + if ((this.supportBasicUIField == YesNoType.no)) + { + writer.WriteAttributeString("SupportBasicUI", "no"); + } + if ((this.supportBasicUIField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportBasicUI", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IgnoreFatalExit" == name)) + { + this.ignoreFatalExitField = Enums.ParseYesNoType(value); + this.ignoreFatalExitFieldSet = true; + } + if (("IgnoreError" == name)) + { + this.ignoreErrorField = Enums.ParseYesNoType(value); + this.ignoreErrorFieldSet = true; + } + if (("IgnoreWarning" == name)) + { + this.ignoreWarningField = Enums.ParseYesNoType(value); + this.ignoreWarningFieldSet = true; + } + if (("IgnoreUser" == name)) + { + this.ignoreUserField = Enums.ParseYesNoType(value); + this.ignoreUserFieldSet = true; + } + if (("IgnoreInfo" == name)) + { + this.ignoreInfoField = Enums.ParseYesNoType(value); + this.ignoreInfoFieldSet = true; + } + if (("IgnoreFilesInUse" == name)) + { + this.ignoreFilesInUseField = Enums.ParseYesNoType(value); + this.ignoreFilesInUseFieldSet = true; + } + if (("IgnoreResolveSource" == name)) + { + this.ignoreResolveSourceField = Enums.ParseYesNoType(value); + this.ignoreResolveSourceFieldSet = true; + } + if (("IgnoreOutOfDiskSpace" == name)) + { + this.ignoreOutOfDiskSpaceField = Enums.ParseYesNoType(value); + this.ignoreOutOfDiskSpaceFieldSet = true; + } + if (("IgnoreActionStart" == name)) + { + this.ignoreActionStartField = Enums.ParseYesNoType(value); + this.ignoreActionStartFieldSet = true; + } + if (("IgnoreActionData" == name)) + { + this.ignoreActionDataField = Enums.ParseYesNoType(value); + this.ignoreActionDataFieldSet = true; + } + if (("IgnoreProgress" == name)) + { + this.ignoreProgressField = Enums.ParseYesNoType(value); + this.ignoreProgressFieldSet = true; + } + if (("IgnoreCommonData" == name)) + { + this.ignoreCommonDataField = Enums.ParseYesNoType(value); + this.ignoreCommonDataFieldSet = true; + } + if (("IgnoreInitialize" == name)) + { + this.ignoreInitializeField = Enums.ParseYesNoType(value); + this.ignoreInitializeFieldSet = true; + } + if (("IgnoreTerminate" == name)) + { + this.ignoreTerminateField = Enums.ParseYesNoType(value); + this.ignoreTerminateFieldSet = true; + } + if (("IgnoreShowDialog" == name)) + { + this.ignoreShowDialogField = Enums.ParseYesNoType(value); + this.ignoreShowDialogFieldSet = true; + } + if (("IgnoreRMFilesInUse" == name)) + { + this.ignoreRMFilesInUseField = Enums.ParseYesNoType(value); + this.ignoreRMFilesInUseFieldSet = true; + } + if (("IgnoreInstallStart" == name)) + { + this.ignoreInstallStartField = Enums.ParseYesNoType(value); + this.ignoreInstallStartFieldSet = true; + } + if (("IgnoreInstallEnd" == name)) + { + this.ignoreInstallEndField = Enums.ParseYesNoType(value); + this.ignoreInstallEndFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("SupportBasicUI" == name)) + { + this.supportBasicUIField = Enums.ParseYesNoType(value); + this.supportBasicUIFieldSet = true; + } + } + } + + /// + /// Defines a resource for use by the embedded UI. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedUIResource : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the embedded UI resource. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The name for the resource when it is extracted from the package for use by the embedded UI DLL. (Windows + /// Installer does not support the typical short filename and long filename combination for embedded UI files + /// as it does for other kinds of files.) If this attribute is not specified the Id attribute will be used. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Path to the binary file that is the embedded UI resource. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedUIResource", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Error : ISchemaElement, ISetAttributes + { + + private int idField; + + private bool idFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Number of the error for which a message is being provided. See MSI SDK for error definitions. + /// + public int Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Element value is Message, use CDATA if message contains delimiter characters + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Error", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.idFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Publish : ISchemaElement, ISetAttributes + { + + private string controlField; + + private bool controlFieldSet; + + private string dialogField; + + private bool dialogFieldSet; + + private string eventField; + + private bool eventFieldSet; + + private string orderField; + + private bool orderFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The parent Control for this Publish element, should only be specified when this element is a child of the UI element. + /// + public string Control + { + get + { + return this.controlField; + } + set + { + this.controlFieldSet = true; + this.controlField = value; + } + } + + /// + /// The parent Dialog for this Publish element, should only be specified when this element is a child of the UI element. + /// This attribute will create a reference to the specified Dialog, so an additional DialogRef is not necessary. + /// + public string Dialog + { + get + { + return this.dialogField; + } + set + { + this.dialogFieldSet = true; + this.dialogField = value; + } + } + + /// + /// Set this attribute's value to one of the standard control events to trigger that event. + /// Either this attribute or the Property attribute must be set, but not both at the same time. + /// + public string Event + { + get + { + return this.eventField; + } + set + { + this.eventFieldSet = true; + this.eventField = value; + } + } + + /// + /// This attribute should only need to be set if this element is nested under a UI element in order to + /// control the order in which this publish event will be started. + /// If this element is nested under a Control element, the default value will be one greater than any + /// previous Publish element's order (the first element's default value is 1). + /// If this element is nested under a UI element, the default value is always 1 (it does not get a + /// default value based on any previous Publish elements). + /// + public string Order + { + get + { + return this.orderField; + } + set + { + this.orderFieldSet = true; + this.orderField = value; + } + } + + /// + /// Set this attribute's value to a property name to set that property. + /// Either this attribute or the Event attribute must be set, but not both at the same time. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// If the Property attribute is specified, set the value of this attribute to the new value for the property. + /// To set a property to null, do not set this attribute (the ControlEvent Argument column will be set to '{}'). + /// Otherwise, this attribute's value should be the argument for the event specified in the Event attribute. + /// If the event doesn't take an attribute, a common value to use is "0". + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The element value is the optional Condition expression. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Publish", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.controlFieldSet) + { + writer.WriteAttributeString("Control", this.controlField); + } + if (this.dialogFieldSet) + { + writer.WriteAttributeString("Dialog", this.dialogField); + } + if (this.eventFieldSet) + { + writer.WriteAttributeString("Event", this.eventField); + } + if (this.orderFieldSet) + { + writer.WriteAttributeString("Order", this.orderField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Control" == name)) + { + this.controlField = value; + this.controlFieldSet = true; + } + if (("Dialog" == name)) + { + this.dialogField = value; + this.dialogFieldSet = true; + } + if (("Event" == name)) + { + this.eventField = value; + this.eventFieldSet = true; + } + if (("Order" == name)) + { + this.orderField = value; + this.orderFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Sets attributes for events in the EventMapping table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Subscribe : ISchemaElement, ISetAttributes + { + + private string eventField; + + private bool eventFieldSet; + + private string attributeField; + + private bool attributeFieldSet; + + private ISchemaElement parentElement; + + /// + /// must be one of the standard control events' + /// + public string Event + { + get + { + return this.eventField; + } + set + { + this.eventFieldSet = true; + this.eventField = value; + } + } + + /// + /// if not present can only handle enable, disable, hide, unhide events + /// + public string Attribute + { + get + { + return this.attributeField; + } + set + { + this.attributeFieldSet = true; + this.attributeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Subscribe", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.eventFieldSet) + { + writer.WriteAttributeString("Event", this.eventField); + } + if (this.attributeFieldSet) + { + writer.WriteAttributeString("Attribute", this.attributeField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Event" == name)) + { + this.eventField = value; + this.eventFieldSet = true; + } + if (("Attribute" == name)) + { + this.attributeField = value; + this.attributeFieldSet = true; + } + } + } + + /// + /// An alternative to using the Text attribute when the value contains special XML characters like <, >, or &. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Text : ISchemaElement, ISetAttributes + { + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Instructs the text to be imported from a file instead of the element value during the binding process. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Text", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Contains the controls that appear on each dialog. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Control : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string typeField; + + private bool typeFieldSet; + + private string xField; + + private bool xFieldSet; + + private string yField; + + private bool yFieldSet; + + private string widthField; + + private bool widthFieldSet; + + private string heightField; + + private bool heightFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string textField; + + private bool textFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private string toolTipField; + + private bool toolTipFieldSet; + + private string checkBoxValueField; + + private bool checkBoxValueFieldSet; + + private string checkBoxPropertyRefField; + + private bool checkBoxPropertyRefFieldSet; + + private YesNoType tabSkipField; + + private bool tabSkipFieldSet; + + private YesNoType defaultField; + + private bool defaultFieldSet; + + private YesNoType cancelField; + + private bool cancelFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType disabledField; + + private bool disabledFieldSet; + + private YesNoType sunkenField; + + private bool sunkenFieldSet; + + private YesNoType indirectField; + + private bool indirectFieldSet; + + private YesNoType integerField; + + private bool integerFieldSet; + + private YesNoType rightToLeftField; + + private bool rightToLeftFieldSet; + + private YesNoType rightAlignedField; + + private bool rightAlignedFieldSet; + + private YesNoType leftScrollField; + + private bool leftScrollFieldSet; + + private YesNoType transparentField; + + private bool transparentFieldSet; + + private YesNoType noPrefixField; + + private bool noPrefixFieldSet; + + private YesNoType noWrapField; + + private bool noWrapFieldSet; + + private YesNoType formatSizeField; + + private bool formatSizeFieldSet; + + private YesNoType userLanguageField; + + private bool userLanguageFieldSet; + + private YesNoType multilineField; + + private bool multilineFieldSet; + + private YesNoType passwordField; + + private bool passwordFieldSet; + + private YesNoType progressBlocksField; + + private bool progressBlocksFieldSet; + + private YesNoType removableField; + + private bool removableFieldSet; + + private YesNoType fixedField; + + private bool fixedFieldSet; + + private YesNoType remoteField; + + private bool remoteFieldSet; + + private YesNoType cDROMField; + + private bool cDROMFieldSet; + + private YesNoType rAMDiskField; + + private bool rAMDiskFieldSet; + + private YesNoType floppyField; + + private bool floppyFieldSet; + + private YesNoType showRollbackCostField; + + private bool showRollbackCostFieldSet; + + private YesNoType sortedField; + + private bool sortedFieldSet; + + private YesNoType comboListField; + + private bool comboListFieldSet; + + private YesNoType imageField; + + private bool imageFieldSet; + + private IconSizeType iconSizeField; + + private bool iconSizeFieldSet; + + private YesNoType fixedSizeField; + + private bool fixedSizeFieldSet; + + private YesNoType iconField; + + private bool iconFieldSet; + + private YesNoType bitmapField; + + private bool bitmapFieldSet; + + private YesNoType pushLikeField; + + private bool pushLikeFieldSet; + + private YesNoType hasBorderField; + + private bool hasBorderFieldSet; + + private YesNoType elevationShieldField; + + private bool elevationShieldFieldSet; + + private ISchemaElement parentElement; + + public Control() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Text))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ComboBox))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListBox))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListView))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RadioButtonGroup))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Binary))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Publish))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Subscribe))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Combined with the Dialog Id to make up the primary key of the Control table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The type of the control. Could be one of the following: Billboard, Bitmap, CheckBox, ComboBox, DirectoryCombo, DirectoryList, Edit, GroupBox, Hyperlink, Icon, Line, ListBox, ListView, MaskedEdit, PathEdit, ProgressBar, PushButton, RadioButtonGroup, ScrollableText, SelectionTree, Text, VolumeCostList, VolumeSelectCombo + /// + public string Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Horizontal coordinate of the upper-left corner of the rectangular boundary of the control. This must be a non-negative number. + /// + public string X + { + get + { + return this.xField; + } + set + { + this.xFieldSet = true; + this.xField = value; + } + } + + /// + /// Vertical coordinate of the upper-left corner of the rectangular boundary of the control. This must be a non-negative number. + /// + public string Y + { + get + { + return this.yField; + } + set + { + this.yFieldSet = true; + this.yField = value; + } + } + + /// + /// Width of the rectangular boundary of the control. This must be a non-negative number. + /// + public string Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + /// + /// Height of the rectangular boundary of the control. This must be a non-negative number. + /// + public string Height + { + get + { + return this.heightField; + } + set + { + this.heightFieldSet = true; + this.heightField = value; + } + } + + /// + /// The name of a defined property to be linked to this control. This column is required for active controls. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// A localizable string used to set the initial text contained in a control. This attribute can contain a formatted string that is processed at install time to insert the values of properties using [PropertyName] syntax. Also supported are environment variables, file installation paths, and component installation directories; see + /// + public string Text + { + get + { + return this.textField; + } + set + { + this.textFieldSet = true; + this.textField = value; + } + } + + /// + /// This attribute is reserved for future use. There is no need to use this until Windows Installer uses it for something. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// The string used for the Tooltip. + /// + public string ToolTip + { + get + { + return this.toolTipField; + } + set + { + this.toolTipFieldSet = true; + this.toolTipField = value; + } + } + + /// + /// This attribute is only valid for CheckBox Controls. When set, the linked Property will be set to this value when the check box is checked. + /// + public string CheckBoxValue + { + get + { + return this.checkBoxValueField; + } + set + { + this.checkBoxValueFieldSet = true; + this.checkBoxValueField = value; + } + } + + /// + /// This attribute is only valid for CheckBox controls. The value is the name of a Property that was already used as the Property for another CheckBox control. The Property attribute cannot be specified. The attribute exists to support multiple checkboxes on different dialogs being tied to the same property. + /// + public string CheckBoxPropertyRef + { + get + { + return this.checkBoxPropertyRefField; + } + set + { + this.checkBoxPropertyRefFieldSet = true; + this.checkBoxPropertyRefField = value; + } + } + + /// + /// Set this attribute to "yes" to cause this Control to be skipped in the tab sequence. + /// + public YesNoType TabSkip + { + get + { + return this.tabSkipField; + } + set + { + this.tabSkipFieldSet = true; + this.tabSkipField = value; + } + } + + /// + /// Set this attribute to "yes" to cause this Control to be invoked by the return key. + /// + public YesNoType Default + { + get + { + return this.defaultField; + } + set + { + this.defaultFieldSet = true; + this.defaultField = value; + } + } + + /// + /// Set this attribute to "yes" to cause this Control to be invoked by the escape key. + /// + public YesNoType Cancel + { + get + { + return this.cancelField; + } + set + { + this.cancelFieldSet = true; + this.cancelField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be hidden. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be disabled. + /// + public YesNoType Disabled + { + get + { + return this.disabledField; + } + set + { + this.disabledFieldSet = true; + this.disabledField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be sunken. + /// + public YesNoType Sunken + { + get + { + return this.sunkenField; + } + set + { + this.sunkenFieldSet = true; + this.sunkenField = value; + } + } + + /// + /// Specifies whether the value displayed or changed by this control is referenced indirectly. If this bit is set, the control displays or changes the value of the property that has the identifier listed in the Property column of the Control table. + /// + public YesNoType Indirect + { + get + { + return this.indirectField; + } + set + { + this.indirectFieldSet = true; + this.indirectField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the linked Property value for the Control to be treated as an integer. Otherwise, the Property will be treated as a string. + /// + public YesNoType Integer + { + get + { + return this.integerField; + } + set + { + this.integerFieldSet = true; + this.integerField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to display from right to left. + /// + public YesNoType RightToLeft + { + get + { + return this.rightToLeftField; + } + set + { + this.rightToLeftFieldSet = true; + this.rightToLeftField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be right aligned. + /// + public YesNoType RightAligned + { + get + { + return this.rightAlignedField; + } + set + { + this.rightAlignedFieldSet = true; + this.rightAlignedField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the scroll bar to display on the left side of the Control. + /// + public YesNoType LeftScroll + { + get + { + return this.leftScrollField; + } + set + { + this.leftScrollFieldSet = true; + this.leftScrollField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType Transparent + { + get + { + return this.transparentField; + } + set + { + this.transparentFieldSet = true; + this.transparentField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType NoPrefix + { + get + { + return this.noPrefixField; + } + set + { + this.noPrefixFieldSet = true; + this.noPrefixField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType NoWrap + { + get + { + return this.noWrapField; + } + set + { + this.noWrapFieldSet = true; + this.noWrapField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType FormatSize + { + get + { + return this.formatSizeField; + } + set + { + this.formatSizeFieldSet = true; + this.formatSizeField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType UserLanguage + { + get + { + return this.userLanguageField; + } + set + { + this.userLanguageFieldSet = true; + this.userLanguageField = value; + } + } + + /// + /// This attribute is only valid for Edit Controls. + /// + public YesNoType Multiline + { + get + { + return this.multilineField; + } + set + { + this.multilineFieldSet = true; + this.multilineField = value; + } + } + + /// + /// This attribute is only valid for Edit Controls. + /// + public YesNoType Password + { + get + { + return this.passwordField; + } + set + { + this.passwordFieldSet = true; + this.passwordField = value; + } + } + + /// + /// This attribute is only valid for ProgressBar Controls. + /// + public YesNoType ProgressBlocks + { + get + { + return this.progressBlocksField; + } + set + { + this.progressBlocksFieldSet = true; + this.progressBlocksField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Removable + { + get + { + return this.removableField; + } + set + { + this.removableFieldSet = true; + this.removableField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Fixed + { + get + { + return this.fixedField; + } + set + { + this.fixedFieldSet = true; + this.fixedField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Remote + { + get + { + return this.remoteField; + } + set + { + this.remoteFieldSet = true; + this.remoteField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType CDROM + { + get + { + return this.cDROMField; + } + set + { + this.cDROMFieldSet = true; + this.cDROMField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType RAMDisk + { + get + { + return this.rAMDiskField; + } + set + { + this.rAMDiskFieldSet = true; + this.rAMDiskField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Floppy + { + get + { + return this.floppyField; + } + set + { + this.floppyFieldSet = true; + this.floppyField = value; + } + } + + /// + /// This attribute is only valid for VolumeCostList Controls. + /// + public YesNoType ShowRollbackCost + { + get + { + return this.showRollbackCostField; + } + set + { + this.showRollbackCostFieldSet = true; + this.showRollbackCostField = value; + } + } + + /// + /// This attribute is only valid for ListBox, ListView, and ComboBox Controls. Set + /// the value of this attribute to "yes" to have entries appear in the order specified under the Control. + /// If the attribute value is "no" or absent the entries in the control will appear in alphabetical order. + /// + public YesNoType Sorted + { + get + { + return this.sortedField; + } + set + { + this.sortedFieldSet = true; + this.sortedField = value; + } + } + + /// + /// This attribute is only valid for ComboBox Controls. + /// + public YesNoType ComboList + { + get + { + return this.comboListField; + } + set + { + this.comboListFieldSet = true; + this.comboListField = value; + } + } + + /// + /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. + /// + public YesNoType Image + { + get + { + return this.imageField; + } + set + { + this.imageFieldSet = true; + this.imageField = value; + } + } + + /// + /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. + /// + public IconSizeType IconSize + { + get + { + return this.iconSizeField; + } + set + { + this.iconSizeFieldSet = true; + this.iconSizeField = value; + } + } + + /// + /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. + /// + public YesNoType FixedSize + { + get + { + return this.fixedSizeField; + } + set + { + this.fixedSizeFieldSet = true; + this.fixedSizeField = value; + } + } + + /// + /// This attribute is only valid for RadioButton and PushButton Controls. + /// + public YesNoType Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// This attribute is only valid for RadioButton and PushButton Controls. + /// + public YesNoType Bitmap + { + get + { + return this.bitmapField; + } + set + { + this.bitmapFieldSet = true; + this.bitmapField = value; + } + } + + /// + /// This attribute is only valid for RadioButton and Checkbox Controls. + /// + public YesNoType PushLike + { + get + { + return this.pushLikeField; + } + set + { + this.pushLikeFieldSet = true; + this.pushLikeField = value; + } + } + + /// + /// This attribute is only valid for RadioButton Controls. + /// + public YesNoType HasBorder + { + get + { + return this.hasBorderField; + } + set + { + this.hasBorderFieldSet = true; + this.hasBorderField = value; + } + } + + /// + /// This attribute is only valid for PushButton controls. + /// Set this attribute to "yes" to add the User Account Control (UAC) elevation icon (shield icon) to the PushButton control. + /// If this attribute's value is "yes" and the installation is not yet running with elevated privileges, + /// the pushbutton control is created using the User Account Control (UAC) elevation icon (shield icon). + /// If this attribute's value is "yes" and the installation is already running with elevated privileges, + /// the pushbutton control is created using the other icon attributes. + /// Otherwise, the pushbutton control is created using the other icon attributes. + /// + public YesNoType ElevationShield + { + get + { + return this.elevationShieldField; + } + set + { + this.elevationShieldFieldSet = true; + this.elevationShieldField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Text" == childName)) + { + childValue = new Text(); + } + if (("ComboBox" == childName)) + { + childValue = new ComboBox(); + } + if (("ListBox" == childName)) + { + childValue = new ListBox(); + } + if (("ListView" == childName)) + { + childValue = new ListView(); + } + if (("RadioButtonGroup" == childName)) + { + childValue = new RadioButtonGroup(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("Publish" == childName)) + { + childValue = new Publish(); + } + if (("Subscribe" == childName)) + { + childValue = new Subscribe(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a IconSizeType from a string. + /// + public static IconSizeType ParseIconSizeType(string value) + { + IconSizeType parsedValue; + Control.TryParseIconSizeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IconSizeType from a string. + /// + public static bool TryParseIconSizeType(string value, out IconSizeType parsedValue) + { + parsedValue = IconSizeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("16" == value)) + { + parsedValue = IconSizeType.Item16; + } + else + { + if (("32" == value)) + { + parsedValue = IconSizeType.Item32; + } + else + { + if (("48" == value)) + { + parsedValue = IconSizeType.Item48; + } + else + { + parsedValue = IconSizeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Control", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.typeFieldSet) + { + writer.WriteAttributeString("Type", this.typeField); + } + if (this.xFieldSet) + { + writer.WriteAttributeString("X", this.xField); + } + if (this.yFieldSet) + { + writer.WriteAttributeString("Y", this.yField); + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField); + } + if (this.heightFieldSet) + { + writer.WriteAttributeString("Height", this.heightField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.textFieldSet) + { + writer.WriteAttributeString("Text", this.textField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.toolTipFieldSet) + { + writer.WriteAttributeString("ToolTip", this.toolTipField); + } + if (this.checkBoxValueFieldSet) + { + writer.WriteAttributeString("CheckBoxValue", this.checkBoxValueField); + } + if (this.checkBoxPropertyRefFieldSet) + { + writer.WriteAttributeString("CheckBoxPropertyRef", this.checkBoxPropertyRefField); + } + if (this.tabSkipFieldSet) + { + if ((this.tabSkipField == YesNoType.no)) + { + writer.WriteAttributeString("TabSkip", "no"); + } + if ((this.tabSkipField == YesNoType.yes)) + { + writer.WriteAttributeString("TabSkip", "yes"); + } + } + if (this.defaultFieldSet) + { + if ((this.defaultField == YesNoType.no)) + { + writer.WriteAttributeString("Default", "no"); + } + if ((this.defaultField == YesNoType.yes)) + { + writer.WriteAttributeString("Default", "yes"); + } + } + if (this.cancelFieldSet) + { + if ((this.cancelField == YesNoType.no)) + { + writer.WriteAttributeString("Cancel", "no"); + } + if ((this.cancelField == YesNoType.yes)) + { + writer.WriteAttributeString("Cancel", "yes"); + } + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.disabledFieldSet) + { + if ((this.disabledField == YesNoType.no)) + { + writer.WriteAttributeString("Disabled", "no"); + } + if ((this.disabledField == YesNoType.yes)) + { + writer.WriteAttributeString("Disabled", "yes"); + } + } + if (this.sunkenFieldSet) + { + if ((this.sunkenField == YesNoType.no)) + { + writer.WriteAttributeString("Sunken", "no"); + } + if ((this.sunkenField == YesNoType.yes)) + { + writer.WriteAttributeString("Sunken", "yes"); + } + } + if (this.indirectFieldSet) + { + if ((this.indirectField == YesNoType.no)) + { + writer.WriteAttributeString("Indirect", "no"); + } + if ((this.indirectField == YesNoType.yes)) + { + writer.WriteAttributeString("Indirect", "yes"); + } + } + if (this.integerFieldSet) + { + if ((this.integerField == YesNoType.no)) + { + writer.WriteAttributeString("Integer", "no"); + } + if ((this.integerField == YesNoType.yes)) + { + writer.WriteAttributeString("Integer", "yes"); + } + } + if (this.rightToLeftFieldSet) + { + if ((this.rightToLeftField == YesNoType.no)) + { + writer.WriteAttributeString("RightToLeft", "no"); + } + if ((this.rightToLeftField == YesNoType.yes)) + { + writer.WriteAttributeString("RightToLeft", "yes"); + } + } + if (this.rightAlignedFieldSet) + { + if ((this.rightAlignedField == YesNoType.no)) + { + writer.WriteAttributeString("RightAligned", "no"); + } + if ((this.rightAlignedField == YesNoType.yes)) + { + writer.WriteAttributeString("RightAligned", "yes"); + } + } + if (this.leftScrollFieldSet) + { + if ((this.leftScrollField == YesNoType.no)) + { + writer.WriteAttributeString("LeftScroll", "no"); + } + if ((this.leftScrollField == YesNoType.yes)) + { + writer.WriteAttributeString("LeftScroll", "yes"); + } + } + if (this.transparentFieldSet) + { + if ((this.transparentField == YesNoType.no)) + { + writer.WriteAttributeString("Transparent", "no"); + } + if ((this.transparentField == YesNoType.yes)) + { + writer.WriteAttributeString("Transparent", "yes"); + } + } + if (this.noPrefixFieldSet) + { + if ((this.noPrefixField == YesNoType.no)) + { + writer.WriteAttributeString("NoPrefix", "no"); + } + if ((this.noPrefixField == YesNoType.yes)) + { + writer.WriteAttributeString("NoPrefix", "yes"); + } + } + if (this.noWrapFieldSet) + { + if ((this.noWrapField == YesNoType.no)) + { + writer.WriteAttributeString("NoWrap", "no"); + } + if ((this.noWrapField == YesNoType.yes)) + { + writer.WriteAttributeString("NoWrap", "yes"); + } + } + if (this.formatSizeFieldSet) + { + if ((this.formatSizeField == YesNoType.no)) + { + writer.WriteAttributeString("FormatSize", "no"); + } + if ((this.formatSizeField == YesNoType.yes)) + { + writer.WriteAttributeString("FormatSize", "yes"); + } + } + if (this.userLanguageFieldSet) + { + if ((this.userLanguageField == YesNoType.no)) + { + writer.WriteAttributeString("UserLanguage", "no"); + } + if ((this.userLanguageField == YesNoType.yes)) + { + writer.WriteAttributeString("UserLanguage", "yes"); + } + } + if (this.multilineFieldSet) + { + if ((this.multilineField == YesNoType.no)) + { + writer.WriteAttributeString("Multiline", "no"); + } + if ((this.multilineField == YesNoType.yes)) + { + writer.WriteAttributeString("Multiline", "yes"); + } + } + if (this.passwordFieldSet) + { + if ((this.passwordField == YesNoType.no)) + { + writer.WriteAttributeString("Password", "no"); + } + if ((this.passwordField == YesNoType.yes)) + { + writer.WriteAttributeString("Password", "yes"); + } + } + if (this.progressBlocksFieldSet) + { + if ((this.progressBlocksField == YesNoType.no)) + { + writer.WriteAttributeString("ProgressBlocks", "no"); + } + if ((this.progressBlocksField == YesNoType.yes)) + { + writer.WriteAttributeString("ProgressBlocks", "yes"); + } + } + if (this.removableFieldSet) + { + if ((this.removableField == YesNoType.no)) + { + writer.WriteAttributeString("Removable", "no"); + } + if ((this.removableField == YesNoType.yes)) + { + writer.WriteAttributeString("Removable", "yes"); + } + } + if (this.fixedFieldSet) + { + if ((this.fixedField == YesNoType.no)) + { + writer.WriteAttributeString("Fixed", "no"); + } + if ((this.fixedField == YesNoType.yes)) + { + writer.WriteAttributeString("Fixed", "yes"); + } + } + if (this.remoteFieldSet) + { + if ((this.remoteField == YesNoType.no)) + { + writer.WriteAttributeString("Remote", "no"); + } + if ((this.remoteField == YesNoType.yes)) + { + writer.WriteAttributeString("Remote", "yes"); + } + } + if (this.cDROMFieldSet) + { + if ((this.cDROMField == YesNoType.no)) + { + writer.WriteAttributeString("CDROM", "no"); + } + if ((this.cDROMField == YesNoType.yes)) + { + writer.WriteAttributeString("CDROM", "yes"); + } + } + if (this.rAMDiskFieldSet) + { + if ((this.rAMDiskField == YesNoType.no)) + { + writer.WriteAttributeString("RAMDisk", "no"); + } + if ((this.rAMDiskField == YesNoType.yes)) + { + writer.WriteAttributeString("RAMDisk", "yes"); + } + } + if (this.floppyFieldSet) + { + if ((this.floppyField == YesNoType.no)) + { + writer.WriteAttributeString("Floppy", "no"); + } + if ((this.floppyField == YesNoType.yes)) + { + writer.WriteAttributeString("Floppy", "yes"); + } + } + if (this.showRollbackCostFieldSet) + { + if ((this.showRollbackCostField == YesNoType.no)) + { + writer.WriteAttributeString("ShowRollbackCost", "no"); + } + if ((this.showRollbackCostField == YesNoType.yes)) + { + writer.WriteAttributeString("ShowRollbackCost", "yes"); + } + } + if (this.sortedFieldSet) + { + if ((this.sortedField == YesNoType.no)) + { + writer.WriteAttributeString("Sorted", "no"); + } + if ((this.sortedField == YesNoType.yes)) + { + writer.WriteAttributeString("Sorted", "yes"); + } + } + if (this.comboListFieldSet) + { + if ((this.comboListField == YesNoType.no)) + { + writer.WriteAttributeString("ComboList", "no"); + } + if ((this.comboListField == YesNoType.yes)) + { + writer.WriteAttributeString("ComboList", "yes"); + } + } + if (this.imageFieldSet) + { + if ((this.imageField == YesNoType.no)) + { + writer.WriteAttributeString("Image", "no"); + } + if ((this.imageField == YesNoType.yes)) + { + writer.WriteAttributeString("Image", "yes"); + } + } + if (this.iconSizeFieldSet) + { + if ((this.iconSizeField == IconSizeType.Item16)) + { + writer.WriteAttributeString("IconSize", "16"); + } + if ((this.iconSizeField == IconSizeType.Item32)) + { + writer.WriteAttributeString("IconSize", "32"); + } + if ((this.iconSizeField == IconSizeType.Item48)) + { + writer.WriteAttributeString("IconSize", "48"); + } + } + if (this.fixedSizeFieldSet) + { + if ((this.fixedSizeField == YesNoType.no)) + { + writer.WriteAttributeString("FixedSize", "no"); + } + if ((this.fixedSizeField == YesNoType.yes)) + { + writer.WriteAttributeString("FixedSize", "yes"); + } + } + if (this.iconFieldSet) + { + if ((this.iconField == YesNoType.no)) + { + writer.WriteAttributeString("Icon", "no"); + } + if ((this.iconField == YesNoType.yes)) + { + writer.WriteAttributeString("Icon", "yes"); + } + } + if (this.bitmapFieldSet) + { + if ((this.bitmapField == YesNoType.no)) + { + writer.WriteAttributeString("Bitmap", "no"); + } + if ((this.bitmapField == YesNoType.yes)) + { + writer.WriteAttributeString("Bitmap", "yes"); + } + } + if (this.pushLikeFieldSet) + { + if ((this.pushLikeField == YesNoType.no)) + { + writer.WriteAttributeString("PushLike", "no"); + } + if ((this.pushLikeField == YesNoType.yes)) + { + writer.WriteAttributeString("PushLike", "yes"); + } + } + if (this.hasBorderFieldSet) + { + if ((this.hasBorderField == YesNoType.no)) + { + writer.WriteAttributeString("HasBorder", "no"); + } + if ((this.hasBorderField == YesNoType.yes)) + { + writer.WriteAttributeString("HasBorder", "yes"); + } + } + if (this.elevationShieldFieldSet) + { + if ((this.elevationShieldField == YesNoType.no)) + { + writer.WriteAttributeString("ElevationShield", "no"); + } + if ((this.elevationShieldField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevationShield", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = value; + this.typeFieldSet = true; + } + if (("X" == name)) + { + this.xField = value; + this.xFieldSet = true; + } + if (("Y" == name)) + { + this.yField = value; + this.yFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = value; + this.widthFieldSet = true; + } + if (("Height" == name)) + { + this.heightField = value; + this.heightFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Text" == name)) + { + this.textField = value; + this.textFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("ToolTip" == name)) + { + this.toolTipField = value; + this.toolTipFieldSet = true; + } + if (("CheckBoxValue" == name)) + { + this.checkBoxValueField = value; + this.checkBoxValueFieldSet = true; + } + if (("CheckBoxPropertyRef" == name)) + { + this.checkBoxPropertyRefField = value; + this.checkBoxPropertyRefFieldSet = true; + } + if (("TabSkip" == name)) + { + this.tabSkipField = Enums.ParseYesNoType(value); + this.tabSkipFieldSet = true; + } + if (("Default" == name)) + { + this.defaultField = Enums.ParseYesNoType(value); + this.defaultFieldSet = true; + } + if (("Cancel" == name)) + { + this.cancelField = Enums.ParseYesNoType(value); + this.cancelFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Disabled" == name)) + { + this.disabledField = Enums.ParseYesNoType(value); + this.disabledFieldSet = true; + } + if (("Sunken" == name)) + { + this.sunkenField = Enums.ParseYesNoType(value); + this.sunkenFieldSet = true; + } + if (("Indirect" == name)) + { + this.indirectField = Enums.ParseYesNoType(value); + this.indirectFieldSet = true; + } + if (("Integer" == name)) + { + this.integerField = Enums.ParseYesNoType(value); + this.integerFieldSet = true; + } + if (("RightToLeft" == name)) + { + this.rightToLeftField = Enums.ParseYesNoType(value); + this.rightToLeftFieldSet = true; + } + if (("RightAligned" == name)) + { + this.rightAlignedField = Enums.ParseYesNoType(value); + this.rightAlignedFieldSet = true; + } + if (("LeftScroll" == name)) + { + this.leftScrollField = Enums.ParseYesNoType(value); + this.leftScrollFieldSet = true; + } + if (("Transparent" == name)) + { + this.transparentField = Enums.ParseYesNoType(value); + this.transparentFieldSet = true; + } + if (("NoPrefix" == name)) + { + this.noPrefixField = Enums.ParseYesNoType(value); + this.noPrefixFieldSet = true; + } + if (("NoWrap" == name)) + { + this.noWrapField = Enums.ParseYesNoType(value); + this.noWrapFieldSet = true; + } + if (("FormatSize" == name)) + { + this.formatSizeField = Enums.ParseYesNoType(value); + this.formatSizeFieldSet = true; + } + if (("UserLanguage" == name)) + { + this.userLanguageField = Enums.ParseYesNoType(value); + this.userLanguageFieldSet = true; + } + if (("Multiline" == name)) + { + this.multilineField = Enums.ParseYesNoType(value); + this.multilineFieldSet = true; + } + if (("Password" == name)) + { + this.passwordField = Enums.ParseYesNoType(value); + this.passwordFieldSet = true; + } + if (("ProgressBlocks" == name)) + { + this.progressBlocksField = Enums.ParseYesNoType(value); + this.progressBlocksFieldSet = true; + } + if (("Removable" == name)) + { + this.removableField = Enums.ParseYesNoType(value); + this.removableFieldSet = true; + } + if (("Fixed" == name)) + { + this.fixedField = Enums.ParseYesNoType(value); + this.fixedFieldSet = true; + } + if (("Remote" == name)) + { + this.remoteField = Enums.ParseYesNoType(value); + this.remoteFieldSet = true; + } + if (("CDROM" == name)) + { + this.cDROMField = Enums.ParseYesNoType(value); + this.cDROMFieldSet = true; + } + if (("RAMDisk" == name)) + { + this.rAMDiskField = Enums.ParseYesNoType(value); + this.rAMDiskFieldSet = true; + } + if (("Floppy" == name)) + { + this.floppyField = Enums.ParseYesNoType(value); + this.floppyFieldSet = true; + } + if (("ShowRollbackCost" == name)) + { + this.showRollbackCostField = Enums.ParseYesNoType(value); + this.showRollbackCostFieldSet = true; + } + if (("Sorted" == name)) + { + this.sortedField = Enums.ParseYesNoType(value); + this.sortedFieldSet = true; + } + if (("ComboList" == name)) + { + this.comboListField = Enums.ParseYesNoType(value); + this.comboListFieldSet = true; + } + if (("Image" == name)) + { + this.imageField = Enums.ParseYesNoType(value); + this.imageFieldSet = true; + } + if (("IconSize" == name)) + { + this.iconSizeField = Control.ParseIconSizeType(value); + this.iconSizeFieldSet = true; + } + if (("FixedSize" == name)) + { + this.fixedSizeField = Enums.ParseYesNoType(value); + this.fixedSizeFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = Enums.ParseYesNoType(value); + this.iconFieldSet = true; + } + if (("Bitmap" == name)) + { + this.bitmapField = Enums.ParseYesNoType(value); + this.bitmapFieldSet = true; + } + if (("PushLike" == name)) + { + this.pushLikeField = Enums.ParseYesNoType(value); + this.pushLikeFieldSet = true; + } + if (("HasBorder" == name)) + { + this.hasBorderField = Enums.ParseYesNoType(value); + this.hasBorderFieldSet = true; + } + if (("ElevationShield" == name)) + { + this.elevationShieldField = Enums.ParseYesNoType(value); + this.elevationShieldFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum IconSizeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Item16, + + Item32, + + Item48, + } + } + + /// + /// Billboard to display during install of a Feature + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Billboard : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string featureField; + + private bool featureFieldSet; + + private ISchemaElement parentElement; + + public Billboard() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Control))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the Billboard. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Feature whose state determines if the Billboard is shown. + /// + public string Feature + { + get + { + return this.featureField; + } + set + { + this.featureFieldSet = true; + this.featureField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Control" == childName)) + { + childValue = new Control(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Billboard", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.featureFieldSet) + { + writer.WriteAttributeString("Feature", this.featureField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Feature" == name)) + { + this.featureField = value; + this.featureFieldSet = true; + } + } + } + + /// + /// Billboard action during which child Billboards are displayed + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BillboardAction : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public BillboardAction() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Billboard))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Action name that determines when the Billboard should be shown. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Billboard" == childName)) + { + childValue = new Billboard(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BillboardAction", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Defines a dialog box in the Dialog Table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Dialog : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private int xField; + + private bool xFieldSet; + + private int yField; + + private bool yFieldSet; + + private int widthField; + + private bool widthFieldSet; + + private int heightField; + + private bool heightFieldSet; + + private string titleField; + + private bool titleFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType modelessField; + + private bool modelessFieldSet; + + private YesNoType noMinimizeField; + + private bool noMinimizeFieldSet; + + private YesNoType systemModalField; + + private bool systemModalFieldSet; + + private YesNoType keepModelessField; + + private bool keepModelessFieldSet; + + private YesNoType trackDiskSpaceField; + + private bool trackDiskSpaceFieldSet; + + private YesNoType customPaletteField; + + private bool customPaletteFieldSet; + + private YesNoType rightToLeftField; + + private bool rightToLeftFieldSet; + + private YesNoType rightAlignedField; + + private bool rightAlignedFieldSet; + + private YesNoType leftScrollField; + + private bool leftScrollFieldSet; + + private YesNoType errorDialogField; + + private bool errorDialogFieldSet; + + private ISchemaElement parentElement; + + public Dialog() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Control))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the dialog. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Horizontal placement of the dialog box as a percentage of screen width. The default value is 50. + /// + public int X + { + get + { + return this.xField; + } + set + { + this.xFieldSet = true; + this.xField = value; + } + } + + /// + /// Vertical placement of the dialog box as a percentage of screen height. The default value is 50. + /// + public int Y + { + get + { + return this.yField; + } + set + { + this.yFieldSet = true; + this.yField = value; + } + } + + /// + /// The width of the dialog box in dialog units. + /// + public int Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + /// + /// The height of the dialog box in dialog units. + /// + public int Height + { + get + { + return this.heightField; + } + set + { + this.heightFieldSet = true; + this.heightField = value; + } + } + + /// + /// The title of the dialog box. + /// + public string Title + { + get + { + return this.titleField; + } + set + { + this.titleFieldSet = true; + this.titleField = value; + } + } + + /// + /// Used to hide the dialog. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Used to set the dialog as modeless. + /// + public YesNoType Modeless + { + get + { + return this.modelessField; + } + set + { + this.modelessFieldSet = true; + this.modelessField = value; + } + } + + /// + /// Used to specify if the dialog can be minimized. + /// + public YesNoType NoMinimize + { + get + { + return this.noMinimizeField; + } + set + { + this.noMinimizeFieldSet = true; + this.noMinimizeField = value; + } + } + + /// + /// Used to set the dialog as system modal. + /// + public YesNoType SystemModal + { + get + { + return this.systemModalField; + } + set + { + this.systemModalFieldSet = true; + this.systemModalField = value; + } + } + + /// + /// Keep modeless dialogs alive when this dialog is created through DoAction. + /// + public YesNoType KeepModeless + { + get + { + return this.keepModelessField; + } + set + { + this.keepModelessFieldSet = true; + this.keepModelessField = value; + } + } + + /// + /// Have the dialog periodically call the installer to check if available disk space has changed. + /// + public YesNoType TrackDiskSpace + { + get + { + return this.trackDiskSpaceField; + } + set + { + this.trackDiskSpaceFieldSet = true; + this.trackDiskSpaceField = value; + } + } + + /// + /// Used to specify if pictures in the dialog box are rendered with a custom palette. + /// + public YesNoType CustomPalette + { + get + { + return this.customPaletteField; + } + set + { + this.customPaletteFieldSet = true; + this.customPaletteField = value; + } + } + + /// + /// Used to specify if the text in the dialog should be displayed in right to left reading order. + /// + public YesNoType RightToLeft + { + get + { + return this.rightToLeftField; + } + set + { + this.rightToLeftFieldSet = true; + this.rightToLeftField = value; + } + } + + /// + /// Align text on the right. + /// + public YesNoType RightAligned + { + get + { + return this.rightAlignedField; + } + set + { + this.rightAlignedFieldSet = true; + this.rightAlignedField = value; + } + } + + /// + /// Used to align the scroll bar on the left. + /// + public YesNoType LeftScroll + { + get + { + return this.leftScrollField; + } + set + { + this.leftScrollFieldSet = true; + this.leftScrollField = value; + } + } + + /// + /// Specifies this dialog as an error dialog. + /// + public YesNoType ErrorDialog + { + get + { + return this.errorDialogField; + } + set + { + this.errorDialogFieldSet = true; + this.errorDialogField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Control" == childName)) + { + childValue = new Control(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Dialog", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.xFieldSet) + { + writer.WriteAttributeString("X", this.xField.ToString(CultureInfo.InvariantCulture)); + } + if (this.yFieldSet) + { + writer.WriteAttributeString("Y", this.yField.ToString(CultureInfo.InvariantCulture)); + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField.ToString(CultureInfo.InvariantCulture)); + } + if (this.heightFieldSet) + { + writer.WriteAttributeString("Height", this.heightField.ToString(CultureInfo.InvariantCulture)); + } + if (this.titleFieldSet) + { + writer.WriteAttributeString("Title", this.titleField); + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.modelessFieldSet) + { + if ((this.modelessField == YesNoType.no)) + { + writer.WriteAttributeString("Modeless", "no"); + } + if ((this.modelessField == YesNoType.yes)) + { + writer.WriteAttributeString("Modeless", "yes"); + } + } + if (this.noMinimizeFieldSet) + { + if ((this.noMinimizeField == YesNoType.no)) + { + writer.WriteAttributeString("NoMinimize", "no"); + } + if ((this.noMinimizeField == YesNoType.yes)) + { + writer.WriteAttributeString("NoMinimize", "yes"); + } + } + if (this.systemModalFieldSet) + { + if ((this.systemModalField == YesNoType.no)) + { + writer.WriteAttributeString("SystemModal", "no"); + } + if ((this.systemModalField == YesNoType.yes)) + { + writer.WriteAttributeString("SystemModal", "yes"); + } + } + if (this.keepModelessFieldSet) + { + if ((this.keepModelessField == YesNoType.no)) + { + writer.WriteAttributeString("KeepModeless", "no"); + } + if ((this.keepModelessField == YesNoType.yes)) + { + writer.WriteAttributeString("KeepModeless", "yes"); + } + } + if (this.trackDiskSpaceFieldSet) + { + if ((this.trackDiskSpaceField == YesNoType.no)) + { + writer.WriteAttributeString("TrackDiskSpace", "no"); + } + if ((this.trackDiskSpaceField == YesNoType.yes)) + { + writer.WriteAttributeString("TrackDiskSpace", "yes"); + } + } + if (this.customPaletteFieldSet) + { + if ((this.customPaletteField == YesNoType.no)) + { + writer.WriteAttributeString("CustomPalette", "no"); + } + if ((this.customPaletteField == YesNoType.yes)) + { + writer.WriteAttributeString("CustomPalette", "yes"); + } + } + if (this.rightToLeftFieldSet) + { + if ((this.rightToLeftField == YesNoType.no)) + { + writer.WriteAttributeString("RightToLeft", "no"); + } + if ((this.rightToLeftField == YesNoType.yes)) + { + writer.WriteAttributeString("RightToLeft", "yes"); + } + } + if (this.rightAlignedFieldSet) + { + if ((this.rightAlignedField == YesNoType.no)) + { + writer.WriteAttributeString("RightAligned", "no"); + } + if ((this.rightAlignedField == YesNoType.yes)) + { + writer.WriteAttributeString("RightAligned", "yes"); + } + } + if (this.leftScrollFieldSet) + { + if ((this.leftScrollField == YesNoType.no)) + { + writer.WriteAttributeString("LeftScroll", "no"); + } + if ((this.leftScrollField == YesNoType.yes)) + { + writer.WriteAttributeString("LeftScroll", "yes"); + } + } + if (this.errorDialogFieldSet) + { + if ((this.errorDialogField == YesNoType.no)) + { + writer.WriteAttributeString("ErrorDialog", "no"); + } + if ((this.errorDialogField == YesNoType.yes)) + { + writer.WriteAttributeString("ErrorDialog", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("X" == name)) + { + this.xField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.xFieldSet = true; + } + if (("Y" == name)) + { + this.yField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.yFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.widthFieldSet = true; + } + if (("Height" == name)) + { + this.heightField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.heightFieldSet = true; + } + if (("Title" == name)) + { + this.titleField = value; + this.titleFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Modeless" == name)) + { + this.modelessField = Enums.ParseYesNoType(value); + this.modelessFieldSet = true; + } + if (("NoMinimize" == name)) + { + this.noMinimizeField = Enums.ParseYesNoType(value); + this.noMinimizeFieldSet = true; + } + if (("SystemModal" == name)) + { + this.systemModalField = Enums.ParseYesNoType(value); + this.systemModalFieldSet = true; + } + if (("KeepModeless" == name)) + { + this.keepModelessField = Enums.ParseYesNoType(value); + this.keepModelessFieldSet = true; + } + if (("TrackDiskSpace" == name)) + { + this.trackDiskSpaceField = Enums.ParseYesNoType(value); + this.trackDiskSpaceFieldSet = true; + } + if (("CustomPalette" == name)) + { + this.customPaletteField = Enums.ParseYesNoType(value); + this.customPaletteFieldSet = true; + } + if (("RightToLeft" == name)) + { + this.rightToLeftField = Enums.ParseYesNoType(value); + this.rightToLeftFieldSet = true; + } + if (("RightAligned" == name)) + { + this.rightAlignedField = Enums.ParseYesNoType(value); + this.rightAlignedFieldSet = true; + } + if (("LeftScroll" == name)) + { + this.leftScrollField = Enums.ParseYesNoType(value); + this.leftScrollFieldSet = true; + } + if (("ErrorDialog" == name)) + { + this.errorDialogField = Enums.ParseYesNoType(value); + this.errorDialogFieldSet = true; + } + } + } + + /// + /// Reference to a Dialog. This will cause the entire referenced section's contents + /// to be included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DialogRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Dialog to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DialogRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProgressText : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string templateField; + + private bool templateFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// used to format ActionData messages from action processing + /// + public string Template + { + get + { + return this.templateField; + } + set + { + this.templateFieldSet = true; + this.templateField = value; + } + } + + /// + /// Element value is progress message text for action + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProgressText", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.templateFieldSet) + { + writer.WriteAttributeString("Template", this.templateField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("Template" == name)) + { + this.templateField = value; + this.templateFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TextStyle : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string faceNameField; + + private bool faceNameFieldSet; + + private string sizeField; + + private bool sizeFieldSet; + + private int redField; + + private bool redFieldSet; + + private int greenField; + + private bool greenFieldSet; + + private int blueField; + + private bool blueFieldSet; + + private YesNoType boldField; + + private bool boldFieldSet; + + private YesNoType italicField; + + private bool italicFieldSet; + + private YesNoType underlineField; + + private bool underlineFieldSet; + + private YesNoType strikeField; + + private bool strikeFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public string FaceName + { + get + { + return this.faceNameField; + } + set + { + this.faceNameFieldSet = true; + this.faceNameField = value; + } + } + + public string Size + { + get + { + return this.sizeField; + } + set + { + this.sizeFieldSet = true; + this.sizeField = value; + } + } + + /// + /// 0 to 255 + /// + public int Red + { + get + { + return this.redField; + } + set + { + this.redFieldSet = true; + this.redField = value; + } + } + + /// + /// 0 to 255 + /// + public int Green + { + get + { + return this.greenField; + } + set + { + this.greenFieldSet = true; + this.greenField = value; + } + } + + /// + /// 0 to 255 + /// + public int Blue + { + get + { + return this.blueField; + } + set + { + this.blueFieldSet = true; + this.blueField = value; + } + } + + public YesNoType Bold + { + get + { + return this.boldField; + } + set + { + this.boldFieldSet = true; + this.boldField = value; + } + } + + public YesNoType Italic + { + get + { + return this.italicField; + } + set + { + this.italicFieldSet = true; + this.italicField = value; + } + } + + public YesNoType Underline + { + get + { + return this.underlineField; + } + set + { + this.underlineFieldSet = true; + this.underlineField = value; + } + } + + public YesNoType Strike + { + get + { + return this.strikeField; + } + set + { + this.strikeFieldSet = true; + this.strikeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TextStyle", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.faceNameFieldSet) + { + writer.WriteAttributeString("FaceName", this.faceNameField); + } + if (this.sizeFieldSet) + { + writer.WriteAttributeString("Size", this.sizeField); + } + if (this.redFieldSet) + { + writer.WriteAttributeString("Red", this.redField.ToString(CultureInfo.InvariantCulture)); + } + if (this.greenFieldSet) + { + writer.WriteAttributeString("Green", this.greenField.ToString(CultureInfo.InvariantCulture)); + } + if (this.blueFieldSet) + { + writer.WriteAttributeString("Blue", this.blueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.boldFieldSet) + { + if ((this.boldField == YesNoType.no)) + { + writer.WriteAttributeString("Bold", "no"); + } + if ((this.boldField == YesNoType.yes)) + { + writer.WriteAttributeString("Bold", "yes"); + } + } + if (this.italicFieldSet) + { + if ((this.italicField == YesNoType.no)) + { + writer.WriteAttributeString("Italic", "no"); + } + if ((this.italicField == YesNoType.yes)) + { + writer.WriteAttributeString("Italic", "yes"); + } + } + if (this.underlineFieldSet) + { + if ((this.underlineField == YesNoType.no)) + { + writer.WriteAttributeString("Underline", "no"); + } + if ((this.underlineField == YesNoType.yes)) + { + writer.WriteAttributeString("Underline", "yes"); + } + } + if (this.strikeFieldSet) + { + if ((this.strikeField == YesNoType.no)) + { + writer.WriteAttributeString("Strike", "no"); + } + if ((this.strikeField == YesNoType.yes)) + { + writer.WriteAttributeString("Strike", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("FaceName" == name)) + { + this.faceNameField = value; + this.faceNameFieldSet = true; + } + if (("Size" == name)) + { + this.sizeField = value; + this.sizeFieldSet = true; + } + if (("Red" == name)) + { + this.redField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.redFieldSet = true; + } + if (("Green" == name)) + { + this.greenField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.greenFieldSet = true; + } + if (("Blue" == name)) + { + this.blueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.blueFieldSet = true; + } + if (("Bold" == name)) + { + this.boldField = Enums.ParseYesNoType(value); + this.boldFieldSet = true; + } + if (("Italic" == name)) + { + this.italicField = Enums.ParseYesNoType(value); + this.italicFieldSet = true; + } + if (("Underline" == name)) + { + this.underlineField = Enums.ParseYesNoType(value); + this.underlineFieldSet = true; + } + if (("Strike" == name)) + { + this.strikeField = Enums.ParseYesNoType(value); + this.strikeFieldSet = true; + } + } + } + + /// + /// The value (and optional text) associated with an item in a ComboBox, ListBox, or ListView. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ListItem : ISchemaElement, ISetAttributes + { + + private string valueField; + + private bool valueFieldSet; + + private string textField; + + private bool textFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private ISchemaElement parentElement; + + /// + /// The value assigned to the associated ComboBox, ListBox, or ListView property if this item is selected. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The localizable, visible text to be assigned to the item. + /// If not specified, this will default to the value of the Value attribute. + /// + public string Text + { + get + { + return this.textField; + } + set + { + this.textFieldSet = true; + this.textField = value; + } + } + + /// + /// The identifier of the Binary (not Icon) element containing the icon to associate with this item. + /// This value is only valid when nested under a ListView element. + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ListItem", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.textFieldSet) + { + writer.WriteAttributeString("Text", this.textField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Text" == name)) + { + this.textField = value; + this.textFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + } + } + + /// + /// Set of items for a particular ListBox control tied to an install Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ListBox : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public ListBox() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ListItem" == childName)) + { + childValue = new ListItem(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ListBox", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Set of items for a particular ComboBox control tied to an install Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComboBox : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public ComboBox() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ListItem" == childName)) + { + childValue = new ListItem(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComboBox", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Set of items for a particular ListView control tied to an install Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ListView : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public ListView() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ListItem" == childName)) + { + childValue = new ListItem(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ListView", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Text or Icon plus Value that is assigned to the Property of the parent Control (RadioButtonGroup). + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RadioButton : ISchemaElement, ISetAttributes + { + + private string bitmapField; + + private bool bitmapFieldSet; + + private string heightField; + + private bool heightFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private string textField; + + private bool textFieldSet; + + private string toolTipField; + + private bool toolTipFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string widthField; + + private bool widthFieldSet; + + private string xField; + + private bool xFieldSet; + + private string yField; + + private bool yFieldSet; + + private ISchemaElement parentElement; + + /// + /// This attribute defines the bitmap displayed with the radio button. The value of the attribute creates a reference + /// to a Binary element that represents the bitmap. This attribute is mutually exclusive with the Icon and Text + /// attributes. + /// + public string Bitmap + { + get + { + return this.bitmapField; + } + set + { + this.bitmapFieldSet = true; + this.bitmapField = value; + } + } + + public string Height + { + get + { + return this.heightField; + } + set + { + this.heightFieldSet = true; + this.heightField = value; + } + } + + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// This attribute defines the icon displayed with the radio button. The value of the attribute creates a reference + /// to a Binary element that represents the icon. This attribute is mutually exclusive with the Bitmap and Text + /// attributes. + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// Text displayed with the radio button. This attribute is mutually exclusive with the Bitmap and Icon attributes. + /// + public string Text + { + get + { + return this.textField; + } + set + { + this.textFieldSet = true; + this.textField = value; + } + } + + public string ToolTip + { + get + { + return this.toolTipField; + } + set + { + this.toolTipFieldSet = true; + this.toolTipField = value; + } + } + + /// + /// Value assigned to the associated control Property when this radio button is selected. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public string Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + public string X + { + get + { + return this.xField; + } + set + { + this.xFieldSet = true; + this.xField = value; + } + } + + public string Y + { + get + { + return this.yField; + } + set + { + this.yFieldSet = true; + this.yField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RadioButton", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.bitmapFieldSet) + { + writer.WriteAttributeString("Bitmap", this.bitmapField); + } + if (this.heightFieldSet) + { + writer.WriteAttributeString("Height", this.heightField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.textFieldSet) + { + writer.WriteAttributeString("Text", this.textField); + } + if (this.toolTipFieldSet) + { + writer.WriteAttributeString("ToolTip", this.toolTipField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField); + } + if (this.xFieldSet) + { + writer.WriteAttributeString("X", this.xField); + } + if (this.yFieldSet) + { + writer.WriteAttributeString("Y", this.yField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Bitmap" == name)) + { + this.bitmapField = value; + this.bitmapFieldSet = true; + } + if (("Height" == name)) + { + this.heightField = value; + this.heightFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("Text" == name)) + { + this.textField = value; + this.textFieldSet = true; + } + if (("ToolTip" == name)) + { + this.toolTipField = value; + this.toolTipFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = value; + this.widthFieldSet = true; + } + if (("X" == name)) + { + this.xField = value; + this.xFieldSet = true; + } + if (("Y" == name)) + { + this.yField = value; + this.yFieldSet = true; + } + } + } + + /// + /// Set of radio buttons tied to the specified Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RadioButtonGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public RadioButtonGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RadioButton))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RadioButton" == childName)) + { + childValue = new RadioButton(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RadioButtonGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Text associated with certain controls + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UIText : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Element value is text, may use CDATA if needed to escape XML delimiters + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UIText", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Reference to a UI element. This will force the entire referenced Fragment's contents + /// to be included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UIRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UIRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Enclosing element to compartmentalize UI specifications. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UI : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public UI() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedUI))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Error))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgressText))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BillboardAction))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComboBox))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ListBox))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ListView))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RadioButtonGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TextStyle))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIText))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Dialog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DialogRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Publish))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("EmbeddedUI" == childName)) + { + childValue = new EmbeddedUI(); + } + if (("Error" == childName)) + { + childValue = new Error(); + } + if (("ProgressText" == childName)) + { + childValue = new ProgressText(); + } + if (("BillboardAction" == childName)) + { + childValue = new BillboardAction(); + } + if (("ComboBox" == childName)) + { + childValue = new ComboBox(); + } + if (("ListBox" == childName)) + { + childValue = new ListBox(); + } + if (("ListView" == childName)) + { + childValue = new ListView(); + } + if (("RadioButtonGroup" == childName)) + { + childValue = new RadioButtonGroup(); + } + if (("TextStyle" == childName)) + { + childValue = new TextStyle(); + } + if (("UIText" == childName)) + { + childValue = new UIText(); + } + if (("Dialog" == childName)) + { + childValue = new Dialog(); + } + if (("DialogRef" == childName)) + { + childValue = new DialogRef(); + } + if (("Publish" == childName)) + { + childValue = new Publish(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UI", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Defines a custom table for use from a custom action. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomTable : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType bootstrapperApplicationDataField; + + private bool bootstrapperApplicationDataFieldSet; + + private ISchemaElement parentElement; + + public CustomTable() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Column))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Row))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the custom table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Indicates the table data is transformed into the bootstrapper application data manifest. + /// + public YesNoType BootstrapperApplicationData + { + get + { + return this.bootstrapperApplicationDataField; + } + set + { + this.bootstrapperApplicationDataFieldSet = true; + this.bootstrapperApplicationDataField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Column" == childName)) + { + childValue = new Column(); + } + if (("Row" == childName)) + { + childValue = new Row(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomTable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.bootstrapperApplicationDataFieldSet) + { + if ((this.bootstrapperApplicationDataField == YesNoType.no)) + { + writer.WriteAttributeString("BootstrapperApplicationData", "no"); + } + if ((this.bootstrapperApplicationDataField == YesNoType.yes)) + { + writer.WriteAttributeString("BootstrapperApplicationData", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("BootstrapperApplicationData" == name)) + { + this.bootstrapperApplicationDataField = Enums.ParseYesNoType(value); + this.bootstrapperApplicationDataFieldSet = true; + } + } + } + + /// + /// Column definition for a Custom Table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Column : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryKeyField; + + private bool primaryKeyFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private int widthField; + + private bool widthFieldSet; + + private YesNoType nullableField; + + private bool nullableFieldSet; + + private YesNoType localizableField; + + private bool localizableFieldSet; + + private long minValueField; + + private bool minValueFieldSet; + + private long maxValueField; + + private bool maxValueFieldSet; + + private string keyTableField; + + private bool keyTableFieldSet; + + private int keyColumnField; + + private bool keyColumnFieldSet; + + private CategoryType categoryField; + + private bool categoryFieldSet; + + private string setField; + + private bool setFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private ModularizeType modularizeField; + + private bool modularizeFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the column. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Whether this column is a primary key. + /// + public YesNoType PrimaryKey + { + get + { + return this.primaryKeyField; + } + set + { + this.primaryKeyFieldSet = true; + this.primaryKeyField = value; + } + } + + /// + /// The type of this column. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Width of this column. + /// + public int Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + /// + /// Whether this column can be left null. + /// + public YesNoType Nullable + { + get + { + return this.nullableField; + } + set + { + this.nullableFieldSet = true; + this.nullableField = value; + } + } + + /// + /// Whether this column can be localized. + /// + public YesNoType Localizable + { + get + { + return this.localizableField; + } + set + { + this.localizableFieldSet = true; + this.localizableField = value; + } + } + + /// + /// Minimum value for a numeric value, date or version in this column. + /// + public long MinValue + { + get + { + return this.minValueField; + } + set + { + this.minValueFieldSet = true; + this.minValueField = value; + } + } + + /// + /// Maximum value for a numeric value, date or version in this column. + /// + public long MaxValue + { + get + { + return this.maxValueField; + } + set + { + this.maxValueFieldSet = true; + this.maxValueField = value; + } + } + + /// + /// Table in which this column is an external key. Can be semicolon delimited. + /// + public string KeyTable + { + get + { + return this.keyTableField; + } + set + { + this.keyTableFieldSet = true; + this.keyTableField = value; + } + } + + /// + /// Column in the table in KeyTable attribute. + /// + public int KeyColumn + { + get + { + return this.keyColumnField; + } + set + { + this.keyColumnFieldSet = true; + this.keyColumnField = value; + } + } + + /// + /// Category of this column. + /// This attribute must be specified with a value of 'Binary' if the Type attribute's value is 'binary'. + /// + public CategoryType Category + { + get + { + return this.categoryField; + } + set + { + this.categoryFieldSet = true; + this.categoryField = value; + } + } + + /// + /// Semicolon delimited list of permissible values. + /// + public string Set + { + get + { + return this.setField; + } + set + { + this.setFieldSet = true; + this.setField = value; + } + } + + /// + /// Description of this column. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// How this column should be modularized, if at all. + /// + public ModularizeType Modularize + { + get + { + return this.modularizeField; + } + set + { + this.modularizeFieldSet = true; + this.modularizeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + Column.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("binary" == value)) + { + parsedValue = TypeType.binary; + } + else + { + if (("int" == value)) + { + parsedValue = TypeType.@int; + } + else + { + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a CategoryType from a string. + /// + public static CategoryType ParseCategoryType(string value) + { + CategoryType parsedValue; + Column.TryParseCategoryType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CategoryType from a string. + /// + public static bool TryParseCategoryType(string value, out CategoryType parsedValue) + { + parsedValue = CategoryType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Text" == value)) + { + parsedValue = CategoryType.text; + } + else + { + if (("UpperCase" == value)) + { + parsedValue = CategoryType.upperCase; + } + else + { + if (("LowerCase" == value)) + { + parsedValue = CategoryType.lowerCase; + } + else + { + if (("Integer" == value)) + { + parsedValue = CategoryType.integer; + } + else + { + if (("DoubleInteger" == value)) + { + parsedValue = CategoryType.doubleInteger; + } + else + { + if (("TimeDate" == value)) + { + parsedValue = CategoryType.timeDate; + } + else + { + if (("Identifier" == value)) + { + parsedValue = CategoryType.identifier; + } + else + { + if (("Property" == value)) + { + parsedValue = CategoryType.property; + } + else + { + if (("Filename" == value)) + { + parsedValue = CategoryType.filename; + } + else + { + if (("WildCardFilename" == value)) + { + parsedValue = CategoryType.wildCardFilename; + } + else + { + if (("Path" == value)) + { + parsedValue = CategoryType.path; + } + else + { + if (("Paths" == value)) + { + parsedValue = CategoryType.paths; + } + else + { + if (("AnyPath" == value)) + { + parsedValue = CategoryType.anyPath; + } + else + { + if (("DefaultDir" == value)) + { + parsedValue = CategoryType.defaultDir; + } + else + { + if (("RegPath" == value)) + { + parsedValue = CategoryType.regPath; + } + else + { + if (("Formatted" == value)) + { + parsedValue = CategoryType.formatted; + } + else + { + if (("FormattedSddl" == value)) + { + parsedValue = CategoryType.formattedSddl; + } + else + { + if (("Template" == value)) + { + parsedValue = CategoryType.template; + } + else + { + if (("Condition" == value)) + { + parsedValue = CategoryType.condition; + } + else + { + if (("Guid" == value)) + { + parsedValue = CategoryType.guid; + } + else + { + if (("Version" == value)) + { + parsedValue = CategoryType.version; + } + else + { + if (("Language" == value)) + { + parsedValue = CategoryType.language; + } + else + { + if (("Binary" == value)) + { + parsedValue = CategoryType.binary; + } + else + { + if (("CustomSource" == value)) + { + parsedValue = CategoryType.customSource; + } + else + { + if (("Cabinet" == value)) + { + parsedValue = CategoryType.cabinet; + } + else + { + if (("Shortcut" == value)) + { + parsedValue = CategoryType.shortcut; + } + else + { + parsedValue = CategoryType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a ModularizeType from a string. + /// + public static ModularizeType ParseModularizeType(string value) + { + ModularizeType parsedValue; + Column.TryParseModularizeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ModularizeType from a string. + /// + public static bool TryParseModularizeType(string value, out ModularizeType parsedValue) + { + parsedValue = ModularizeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("None" == value)) + { + parsedValue = ModularizeType.None; + } + else + { + if (("Column" == value)) + { + parsedValue = ModularizeType.Column; + } + else + { + if (("Condition" == value)) + { + parsedValue = ModularizeType.Condition; + } + else + { + if (("Icon" == value)) + { + parsedValue = ModularizeType.Icon; + } + else + { + if (("Property" == value)) + { + parsedValue = ModularizeType.Property; + } + else + { + if (("SemicolonDelimited" == value)) + { + parsedValue = ModularizeType.SemicolonDelimited; + } + else + { + parsedValue = ModularizeType.IllegalValue; + return false; + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Column", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryKeyFieldSet) + { + if ((this.primaryKeyField == YesNoType.no)) + { + writer.WriteAttributeString("PrimaryKey", "no"); + } + if ((this.primaryKeyField == YesNoType.yes)) + { + writer.WriteAttributeString("PrimaryKey", "yes"); + } + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.binary)) + { + writer.WriteAttributeString("Type", "binary"); + } + if ((this.typeField == TypeType.@int)) + { + writer.WriteAttributeString("Type", "int"); + } + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField.ToString(CultureInfo.InvariantCulture)); + } + if (this.nullableFieldSet) + { + if ((this.nullableField == YesNoType.no)) + { + writer.WriteAttributeString("Nullable", "no"); + } + if ((this.nullableField == YesNoType.yes)) + { + writer.WriteAttributeString("Nullable", "yes"); + } + } + if (this.localizableFieldSet) + { + if ((this.localizableField == YesNoType.no)) + { + writer.WriteAttributeString("Localizable", "no"); + } + if ((this.localizableField == YesNoType.yes)) + { + writer.WriteAttributeString("Localizable", "yes"); + } + } + if (this.minValueFieldSet) + { + writer.WriteAttributeString("MinValue", this.minValueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maxValueFieldSet) + { + writer.WriteAttributeString("MaxValue", this.maxValueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.keyTableFieldSet) + { + writer.WriteAttributeString("KeyTable", this.keyTableField); + } + if (this.keyColumnFieldSet) + { + writer.WriteAttributeString("KeyColumn", this.keyColumnField.ToString(CultureInfo.InvariantCulture)); + } + if (this.categoryFieldSet) + { + if ((this.categoryField == CategoryType.text)) + { + writer.WriteAttributeString("Category", "text"); + } + if ((this.categoryField == CategoryType.upperCase)) + { + writer.WriteAttributeString("Category", "upperCase"); + } + if ((this.categoryField == CategoryType.lowerCase)) + { + writer.WriteAttributeString("Category", "lowerCase"); + } + if ((this.categoryField == CategoryType.integer)) + { + writer.WriteAttributeString("Category", "integer"); + } + if ((this.categoryField == CategoryType.doubleInteger)) + { + writer.WriteAttributeString("Category", "doubleInteger"); + } + if ((this.categoryField == CategoryType.timeDate)) + { + writer.WriteAttributeString("Category", "timeDate"); + } + if ((this.categoryField == CategoryType.identifier)) + { + writer.WriteAttributeString("Category", "identifier"); + } + if ((this.categoryField == CategoryType.property)) + { + writer.WriteAttributeString("Category", "property"); + } + if ((this.categoryField == CategoryType.filename)) + { + writer.WriteAttributeString("Category", "filename"); + } + if ((this.categoryField == CategoryType.wildCardFilename)) + { + writer.WriteAttributeString("Category", "wildCardFilename"); + } + if ((this.categoryField == CategoryType.path)) + { + writer.WriteAttributeString("Category", "path"); + } + if ((this.categoryField == CategoryType.paths)) + { + writer.WriteAttributeString("Category", "paths"); + } + if ((this.categoryField == CategoryType.anyPath)) + { + writer.WriteAttributeString("Category", "anyPath"); + } + if ((this.categoryField == CategoryType.defaultDir)) + { + writer.WriteAttributeString("Category", "defaultDir"); + } + if ((this.categoryField == CategoryType.regPath)) + { + writer.WriteAttributeString("Category", "regPath"); + } + if ((this.categoryField == CategoryType.formatted)) + { + writer.WriteAttributeString("Category", "formatted"); + } + if ((this.categoryField == CategoryType.formattedSddl)) + { + writer.WriteAttributeString("Category", "formattedSddl"); + } + if ((this.categoryField == CategoryType.template)) + { + writer.WriteAttributeString("Category", "template"); + } + if ((this.categoryField == CategoryType.condition)) + { + writer.WriteAttributeString("Category", "condition"); + } + if ((this.categoryField == CategoryType.guid)) + { + writer.WriteAttributeString("Category", "guid"); + } + if ((this.categoryField == CategoryType.version)) + { + writer.WriteAttributeString("Category", "version"); + } + if ((this.categoryField == CategoryType.language)) + { + writer.WriteAttributeString("Category", "language"); + } + if ((this.categoryField == CategoryType.binary)) + { + writer.WriteAttributeString("Category", "Binary"); + } + if ((this.categoryField == CategoryType.customSource)) + { + writer.WriteAttributeString("Category", "customSource"); + } + if ((this.categoryField == CategoryType.cabinet)) + { + writer.WriteAttributeString("Category", "cabinet"); + } + if ((this.categoryField == CategoryType.shortcut)) + { + writer.WriteAttributeString("Category", "shortcut"); + } + } + if (this.setFieldSet) + { + writer.WriteAttributeString("Set", this.setField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.modularizeFieldSet) + { + if ((this.modularizeField == ModularizeType.None)) + { + writer.WriteAttributeString("Modularize", "None"); + } + if ((this.modularizeField == ModularizeType.Column)) + { + writer.WriteAttributeString("Modularize", "Column"); + } + if ((this.modularizeField == ModularizeType.Condition)) + { + writer.WriteAttributeString("Modularize", "Condition"); + } + if ((this.modularizeField == ModularizeType.Icon)) + { + writer.WriteAttributeString("Modularize", "Icon"); + } + if ((this.modularizeField == ModularizeType.Property)) + { + writer.WriteAttributeString("Modularize", "Property"); + } + if ((this.modularizeField == ModularizeType.SemicolonDelimited)) + { + writer.WriteAttributeString("Modularize", "SemicolonDelimited"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("PrimaryKey" == name)) + { + this.primaryKeyField = Enums.ParseYesNoType(value); + this.primaryKeyFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Column.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.widthFieldSet = true; + } + if (("Nullable" == name)) + { + this.nullableField = Enums.ParseYesNoType(value); + this.nullableFieldSet = true; + } + if (("Localizable" == name)) + { + this.localizableField = Enums.ParseYesNoType(value); + this.localizableFieldSet = true; + } + if (("MinValue" == name)) + { + this.minValueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.minValueFieldSet = true; + } + if (("MaxValue" == name)) + { + this.maxValueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxValueFieldSet = true; + } + if (("KeyTable" == name)) + { + this.keyTableField = value; + this.keyTableFieldSet = true; + } + if (("KeyColumn" == name)) + { + this.keyColumnField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.keyColumnFieldSet = true; + } + if (("Category" == name)) + { + this.categoryField = Column.ParseCategoryType(value); + this.categoryFieldSet = true; + } + if (("Set" == name)) + { + this.setField = value; + this.setFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Modularize" == name)) + { + this.modularizeField = Column.ParseModularizeType(value); + this.modularizeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Column contains a path to a file that will be inserted into the column as a binary object. + /// If this value is set, the Category attribute must also be set with a value of 'Binary' to pass ICE validation. + /// + binary, + + /// + /// Column contains an integer or datetime value (the MinValue and MaxValue attributes should also be set). + /// + @int, + + /// + /// Column contains a non-localizable string value. + /// + @string, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum CategoryType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + text, + + upperCase, + + lowerCase, + + integer, + + doubleInteger, + + timeDate, + + identifier, + + property, + + filename, + + wildCardFilename, + + path, + + paths, + + anyPath, + + defaultDir, + + regPath, + + formatted, + + formattedSddl, + + template, + + condition, + + guid, + + version, + + language, + + binary, + + customSource, + + cabinet, + + shortcut, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ModularizeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Column should not be modularized. This is the default value. + /// + None, + + /// + /// Column should be modularized. + /// + Column, + + /// + /// Column is a condition and should be modularized. + /// + Condition, + + /// + /// When the column is an primary or foreign key to the Icon table it should be modularized special. + /// + Icon, + + /// + /// Any Properties in the column should be modularized. + /// + Property, + + /// + /// Semi-colon list of keys, all of which need to be modularized. + /// + SemicolonDelimited, + } + } + + /// + /// Row data for a Custom Table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Row : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public Row() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Data))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Data" == childName)) + { + childValue = new Data(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Row", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Used for a Custom Table. Specifies the data for the parent Row and specified Column. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Data : ISchemaElement, ISetAttributes + { + + private string columnField; + + private bool columnFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies in which column to insert this data. + /// + public string Column + { + get + { + return this.columnField; + } + set + { + this.columnFieldSet = true; + this.columnField = value; + } + } + + /// + /// A data value + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Data", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.columnFieldSet) + { + writer.WriteAttributeString("Column", this.columnField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Column" == name)) + { + this.columnField = value; + this.columnFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Use this element to ensure that a table appears in the installer database, even if its empty. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EnsureTable : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EnsureTable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// This element exposes advanced WiX functionality. Use this element to declare WiX variables + /// from directly within your authoring. WiX variables are not resolved until the final msi/msm/pcp + /// file is actually generated. WiX variables do not persist into the msi/msm/pcp file, so they cannot + /// be used when an MSI file is being installed; it's a WiX-only concept. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WixVariable : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the variable. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this value to 'yes' in order to make the variable's value overridable either by + /// another WixVariable entry or via the command-line option -d<name>=<value> + /// for light.exe. If the same variable is declared overridable in multiple places it + /// will cause an error (since WiX won't know which value is correct). The default value + /// is 'no'. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + /// + /// The value of the variable. The value cannot be an empty string because that would + /// make it possible to accidentally set a column to null. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WixVariable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Use this element to contain definitions for instance transforms. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstanceTransforms : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public InstanceTransforms() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Instance))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The Id of the Property who's value should change for each instance. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Instance" == childName)) + { + childValue = new Instance(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstanceTransforms", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Defines an instance transform for your product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Instance : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string productNameField; + + private bool productNameFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identity of the instance transform. This value will define the name by which the instance + /// should be referred to on the command line. In addition, the value of the this attribute will + /// determine what the value of the property specified in Property attribute on InstanceTransforms + /// will change to for each instance. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The ProductCode for this instance. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// The ProductName for this instance. + /// + public string ProductName + { + get + { + return this.productNameField; + } + set + { + this.productNameFieldSet = true; + this.productNameField = value; + } + } + + /// + /// The UpgradeCode for this instance. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Instance", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.productNameFieldSet) + { + writer.WriteAttributeString("ProductName", this.productNameField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("ProductName" == name)) + { + this.productNameField = value; + this.productNameFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + } + } + + /// + /// Simplifies authoring for major upgrades, including support for preventing downgrades. + /// + /// The parent Package element must have valid UpgradeCode and Version attributes. + /// + /// When the FindRelatedProducts action detects a related product installed on the system, + /// it appends the product code to the property named WIX_UPGRADE_DETECTED. After the + /// FindRelatedProducts action is run, the value of the WIX_UPGRADE_DETECTED property is a + /// list of product codes, separated by semicolons (;), detected on the system. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MajorUpgrade : ISchemaElement, ISetAttributes + { + + private YesNoType allowDowngradesField; + + private bool allowDowngradesFieldSet; + + private YesNoType allowSameVersionUpgradesField; + + private bool allowSameVersionUpgradesFieldSet; + + private YesNoType disallowField; + + private bool disallowFieldSet; + + private string downgradeErrorMessageField; + + private bool downgradeErrorMessageFieldSet; + + private string disallowUpgradeErrorMessageField; + + private bool disallowUpgradeErrorMessageFieldSet; + + private YesNoType migrateFeaturesField; + + private bool migrateFeaturesFieldSet; + + private YesNoType ignoreLanguageField; + + private bool ignoreLanguageFieldSet; + + private YesNoType ignoreRemoveFailureField; + + private bool ignoreRemoveFailureFieldSet; + + private string removeFeaturesField; + + private bool removeFeaturesFieldSet; + + private ScheduleType scheduleField; + + private bool scheduleFieldSet; + + private ISchemaElement parentElement; + + /// + /// When set to no (the default), products with lower version numbers are blocked from + /// installing when a product with a higher version is installed; the DowngradeErrorMessage + /// attribute must also be specified. + /// + /// When set to yes, any version can be installed over any other version. + /// + public YesNoType AllowDowngrades + { + get + { + return this.allowDowngradesField; + } + set + { + this.allowDowngradesFieldSet = true; + this.allowDowngradesField = value; + } + } + + /// + /// When set to no (the default), installing a product with the same version and upgrade code + /// (but different product code) is allowed and treated by MSI as two products. When set to yes, + /// WiX sets the msidbUpgradeAttributesVersionMaxInclusive attribute, which tells MSI to treat + /// a product with the same version as a major upgrade. + /// + /// This is useful when two product versions differ only in the fourth version field. MSI + /// specifically ignores that field when comparing product versions, so two products that + /// differ only in the fourth version field are the same product and need this attribute set to + /// yes to be detected. + /// + /// Note that because MSI ignores the fourth product version field, setting this attribute to + /// yes also allows downgrades when the first three product version fields are identical. + /// For example, product version 1.0.0.1 will "upgrade" 1.0.0.2998 because they're seen as the + /// same version (1.0.0). That could reintroduce serious bugs so the safest choice is to change + /// the first three version fields and omit this attribute to get the default of no. + /// + /// This attribute cannot be "yes" when AllowDowngrades is also "yes" -- AllowDowngrades + /// already allows two products with the same version number to upgrade each other. + /// + public YesNoType AllowSameVersionUpgrades + { + get + { + return this.allowSameVersionUpgradesField; + } + set + { + this.allowSameVersionUpgradesFieldSet = true; + this.allowSameVersionUpgradesField = value; + } + } + + /// + /// When set to yes, products with higer version numbers are blocked from + /// installing when a product with a lower version is installed; the UpgradeErrorMessage + /// attribute must also be specified. + /// + /// When set to no (the default), any version can be installed over any lower version. + /// + public YesNoType Disallow + { + get + { + return this.disallowField; + } + set + { + this.disallowFieldSet = true; + this.disallowField = value; + } + } + + /// + /// The message displayed if users try to install a product with a lower version number + /// when a product with a higher version is installed. Used only when AllowDowngrades + /// is no (the default). + /// + public string DowngradeErrorMessage + { + get + { + return this.downgradeErrorMessageField; + } + set + { + this.downgradeErrorMessageFieldSet = true; + this.downgradeErrorMessageField = value; + } + } + + /// + /// The message displayed if users try to install a product with a higer version number + /// when a product with a lower version is installed. Used only when Disallow + /// is yes. + /// + public string DisallowUpgradeErrorMessage + { + get + { + return this.disallowUpgradeErrorMessageField; + } + set + { + this.disallowUpgradeErrorMessageFieldSet = true; + this.disallowUpgradeErrorMessageField = value; + } + } + + /// + /// When set to yes (the default), the MigrateFeatureStates standard action will set the + /// feature states of the upgrade product to those of the installed product. + /// + /// When set to no, the installed features have no effect on the upgrade installation. + /// + public YesNoType MigrateFeatures + { + get + { + return this.migrateFeaturesField; + } + set + { + this.migrateFeaturesFieldSet = true; + this.migrateFeaturesField = value; + } + } + + /// + /// When set to yes, the Upgrade table rows will match any product with the same UpgradeCode. + /// + /// When set to no (the default), the Upgrade table rows will match only products with the + /// same UpgradeCode and ProductLanguage. + /// + public YesNoType IgnoreLanguage + { + get + { + return this.ignoreLanguageField; + } + set + { + this.ignoreLanguageFieldSet = true; + this.ignoreLanguageField = value; + } + } + + /// + /// When set to yes, failures removing the installed product during the upgrade will be + /// ignored. + /// + /// When set to no (the default), failures removing the installed product during the upgrade + /// will be considered a failure and, depending on the scheduling, roll back the upgrade. + /// + public YesNoType IgnoreRemoveFailure + { + get + { + return this.ignoreRemoveFailureField; + } + set + { + this.ignoreRemoveFailureFieldSet = true; + this.ignoreRemoveFailureField = value; + } + } + + /// + /// A formatted string that contains the list of features to remove from the installed + /// product. The default is to remove all features. Note that if you use formatted property + /// values that evaluate to an empty string, no features will be removed; only omitting + /// this attribute defaults to removing all features. + /// + public string RemoveFeatures + { + get + { + return this.removeFeaturesField; + } + set + { + this.removeFeaturesFieldSet = true; + this.removeFeaturesField = value; + } + } + + /// + /// Determines the scheduling of the RemoveExistingProducts standard action, which is when + /// the installed product is removed. The default is "afterInstallValidate" which removes + /// the installed product entirely before installing the upgrade product. It's slowest but + /// gives the most flexibility in changing components and features in the upgrade product. + /// + /// For more information, see + /// + public ScheduleType Schedule + { + get + { + return this.scheduleField; + } + set + { + this.scheduleFieldSet = true; + this.scheduleField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ScheduleType from a string. + /// + public static ScheduleType ParseScheduleType(string value) + { + ScheduleType parsedValue; + MajorUpgrade.TryParseScheduleType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ScheduleType from a string. + /// + public static bool TryParseScheduleType(string value, out ScheduleType parsedValue) + { + parsedValue = ScheduleType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("afterInstallValidate" == value)) + { + parsedValue = ScheduleType.afterInstallValidate; + } + else + { + if (("afterInstallInitialize" == value)) + { + parsedValue = ScheduleType.afterInstallInitialize; + } + else + { + if (("afterInstallExecute" == value)) + { + parsedValue = ScheduleType.afterInstallExecute; + } + else + { + if (("afterInstallExecuteAgain" == value)) + { + parsedValue = ScheduleType.afterInstallExecuteAgain; + } + else + { + if (("afterInstallFinalize" == value)) + { + parsedValue = ScheduleType.afterInstallFinalize; + } + else + { + parsedValue = ScheduleType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MajorUpgrade", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.allowDowngradesFieldSet) + { + if ((this.allowDowngradesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowDowngrades", "no"); + } + if ((this.allowDowngradesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowDowngrades", "yes"); + } + } + if (this.allowSameVersionUpgradesFieldSet) + { + if ((this.allowSameVersionUpgradesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowSameVersionUpgrades", "no"); + } + if ((this.allowSameVersionUpgradesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowSameVersionUpgrades", "yes"); + } + } + if (this.disallowFieldSet) + { + if ((this.disallowField == YesNoType.no)) + { + writer.WriteAttributeString("Disallow", "no"); + } + if ((this.disallowField == YesNoType.yes)) + { + writer.WriteAttributeString("Disallow", "yes"); + } + } + if (this.downgradeErrorMessageFieldSet) + { + writer.WriteAttributeString("DowngradeErrorMessage", this.downgradeErrorMessageField); + } + if (this.disallowUpgradeErrorMessageFieldSet) + { + writer.WriteAttributeString("DisallowUpgradeErrorMessage", this.disallowUpgradeErrorMessageField); + } + if (this.migrateFeaturesFieldSet) + { + if ((this.migrateFeaturesField == YesNoType.no)) + { + writer.WriteAttributeString("MigrateFeatures", "no"); + } + if ((this.migrateFeaturesField == YesNoType.yes)) + { + writer.WriteAttributeString("MigrateFeatures", "yes"); + } + } + if (this.ignoreLanguageFieldSet) + { + if ((this.ignoreLanguageField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreLanguage", "no"); + } + if ((this.ignoreLanguageField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreLanguage", "yes"); + } + } + if (this.ignoreRemoveFailureFieldSet) + { + if ((this.ignoreRemoveFailureField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "no"); + } + if ((this.ignoreRemoveFailureField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "yes"); + } + } + if (this.removeFeaturesFieldSet) + { + writer.WriteAttributeString("RemoveFeatures", this.removeFeaturesField); + } + if (this.scheduleFieldSet) + { + if ((this.scheduleField == ScheduleType.afterInstallValidate)) + { + writer.WriteAttributeString("Schedule", "afterInstallValidate"); + } + if ((this.scheduleField == ScheduleType.afterInstallInitialize)) + { + writer.WriteAttributeString("Schedule", "afterInstallInitialize"); + } + if ((this.scheduleField == ScheduleType.afterInstallExecute)) + { + writer.WriteAttributeString("Schedule", "afterInstallExecute"); + } + if ((this.scheduleField == ScheduleType.afterInstallExecuteAgain)) + { + writer.WriteAttributeString("Schedule", "afterInstallExecuteAgain"); + } + if ((this.scheduleField == ScheduleType.afterInstallFinalize)) + { + writer.WriteAttributeString("Schedule", "afterInstallFinalize"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("AllowDowngrades" == name)) + { + this.allowDowngradesField = Enums.ParseYesNoType(value); + this.allowDowngradesFieldSet = true; + } + if (("AllowSameVersionUpgrades" == name)) + { + this.allowSameVersionUpgradesField = Enums.ParseYesNoType(value); + this.allowSameVersionUpgradesFieldSet = true; + } + if (("Disallow" == name)) + { + this.disallowField = Enums.ParseYesNoType(value); + this.disallowFieldSet = true; + } + if (("DowngradeErrorMessage" == name)) + { + this.downgradeErrorMessageField = value; + this.downgradeErrorMessageFieldSet = true; + } + if (("DisallowUpgradeErrorMessage" == name)) + { + this.disallowUpgradeErrorMessageField = value; + this.disallowUpgradeErrorMessageFieldSet = true; + } + if (("MigrateFeatures" == name)) + { + this.migrateFeaturesField = Enums.ParseYesNoType(value); + this.migrateFeaturesFieldSet = true; + } + if (("IgnoreLanguage" == name)) + { + this.ignoreLanguageField = Enums.ParseYesNoType(value); + this.ignoreLanguageFieldSet = true; + } + if (("IgnoreRemoveFailure" == name)) + { + this.ignoreRemoveFailureField = Enums.ParseYesNoType(value); + this.ignoreRemoveFailureFieldSet = true; + } + if (("RemoveFeatures" == name)) + { + this.removeFeaturesField = value; + this.removeFeaturesFieldSet = true; + } + if (("Schedule" == name)) + { + this.scheduleField = MajorUpgrade.ParseScheduleType(value); + this.scheduleFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ScheduleType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// (Default) Schedules RemoveExistingProducts after the InstallValidate standard + /// action. This scheduling removes the installed product entirely before installing + /// the upgrade product. It's slowest but gives the most flexibility in changing + /// components and features in the upgrade product. Note that if the installation + /// of the upgrade product fails, the machine will have neither version installed. + /// + afterInstallValidate, + + /// + /// Schedules RemoveExistingProducts after the InstallInitialize standard action. + /// This is similar to the afterInstallValidate scheduling, but if the installation + /// of the upgrade product fails, Windows Installer also rolls back the removal of + /// the installed product -- in other words, reinstalls it. + /// + afterInstallInitialize, + + /// + /// Schedules RemoveExistingProducts between the InstallExecute and InstallFinalize standard actions. + /// This scheduling installs the upgrade product "on top of" the installed product then lets + /// RemoveExistingProducts uninstall any components that don't also exist in the upgrade product. + /// Note that this scheduling requires strict adherence to the component rules because it relies + /// on component reference counts to be accurate during installation of the upgrade product and + /// removal of the installed product. For more information, see + /// + afterInstallExecute, + + /// + /// Schedules RemoveExistingProducts between the InstallExecuteAgain and InstallFinalize standard actions. + /// This is identical to the afterInstallExecute scheduling but after the InstallExecuteAgain standard + /// action instead of InstallExecute. + /// + afterInstallExecuteAgain, + + /// + /// Schedules RemoveExistingProducts after the InstallFinalize standard action. This is similar to the + /// afterInstallExecute and afterInstallExecuteAgain schedulings but takes place outside the + /// installation transaction so if installation of the upgrade product fails, Windows Installer does + /// not roll back the removal of the installed product, so the machine will have both versions + /// installed. + /// + afterInstallFinalize, + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProductSearch : ISchemaElement, ISetAttributes + { + + private string minimumField; + + private bool minimumFieldSet; + + private string maximumField; + + private bool maximumFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private YesNoType includeMinimumField; + + private bool includeMinimumFieldSet; + + private YesNoType includeMaximumField; + + private bool includeMaximumFieldSet; + + private YesNoType excludeLanguagesField; + + private bool excludeLanguagesFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the lower bound on the range of product versions to be detected by FindRelatedProducts. + /// + public string Minimum + { + get + { + return this.minimumField; + } + set + { + this.minimumFieldSet = true; + this.minimumField = value; + } + } + + /// + /// Specifies the upper boundary of the range of product versions detected by FindRelatedProducts. + /// + public string Maximum + { + get + { + return this.maximumField; + } + set + { + this.maximumFieldSet = true; + this.maximumField = value; + } + } + + /// + /// Specifies the set of languages detected by FindRelatedProducts. Enter a list of numeric language identifiers (LANGID) separated by commas (,). Leave this value null to specify all languages. Set ExcludeLanguages to "yes" in order detect all languages, excluding the languages listed in this value. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// Set to "no" to make the range of versions detected exclude the value specified in Minimum. This attribute is "yes" by default. + /// + public YesNoType IncludeMinimum + { + get + { + return this.includeMinimumField; + } + set + { + this.includeMinimumFieldSet = true; + this.includeMinimumField = value; + } + } + + /// + /// Set to "yes" to make the range of versions detected include the value specified in Maximum. + /// + public YesNoType IncludeMaximum + { + get + { + return this.includeMaximumField; + } + set + { + this.includeMaximumFieldSet = true; + this.includeMaximumField = value; + } + } + + /// + /// Set to "yes" to detect all languages, excluding the languages listed in the Language attribute. + /// + public YesNoType ExcludeLanguages + { + get + { + return this.excludeLanguagesField; + } + set + { + this.excludeLanguagesFieldSet = true; + this.excludeLanguagesField = value; + } + } + + /// + /// This value specifies the upgrade code for the products that are to be detected by the FindRelatedProducts action. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.minimumFieldSet) + { + writer.WriteAttributeString("Minimum", this.minimumField); + } + if (this.maximumFieldSet) + { + writer.WriteAttributeString("Maximum", this.maximumField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.includeMinimumFieldSet) + { + if ((this.includeMinimumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMinimum", "no"); + } + if ((this.includeMinimumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMinimum", "yes"); + } + } + if (this.includeMaximumFieldSet) + { + if ((this.includeMaximumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMaximum", "no"); + } + if ((this.includeMaximumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMaximum", "yes"); + } + } + if (this.excludeLanguagesFieldSet) + { + if ((this.excludeLanguagesField == YesNoType.no)) + { + writer.WriteAttributeString("ExcludeLanguages", "no"); + } + if ((this.excludeLanguagesField == YesNoType.yes)) + { + writer.WriteAttributeString("ExcludeLanguages", "yes"); + } + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Minimum" == name)) + { + this.minimumField = value; + this.minimumFieldSet = true; + } + if (("Maximum" == name)) + { + this.maximumField = value; + this.maximumFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("IncludeMinimum" == name)) + { + this.includeMinimumField = Enums.ParseYesNoType(value); + this.includeMinimumFieldSet = true; + } + if (("IncludeMaximum" == name)) + { + this.includeMaximumField = Enums.ParseYesNoType(value); + this.includeMaximumFieldSet = true; + } + if (("ExcludeLanguages" == name)) + { + this.excludeLanguagesField = Enums.ParseYesNoType(value); + this.excludeLanguagesFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } +} diff --git a/src/heat/TypeLibraryHarvester.cs b/src/heat/TypeLibraryHarvester.cs new file mode 100644 index 00000000..4a271a35 --- /dev/null +++ b/src/heat/TypeLibraryHarvester.cs @@ -0,0 +1,93 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Globalization; + using System.Runtime.InteropServices; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from a type library file. + /// + internal class TypeLibraryHarvester + { + /// + /// Harvest the registry values written by RegisterTypeLib. + /// + /// The file to harvest registry values from. + /// The harvested registry values. + public Wix.RegistryValue[] HarvestRegistryValues(string path) + { + using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) + { + NativeMethods.RegisterTypeLibrary(path); + + return registryHarvester.HarvestRegistry(); + } + } + + /// + /// Parses a hexadecimal version string into a Version object. + /// + /// Hexadecimal version string, for example "1.A.3C.F241" + /// Version object, or null if versionString is not a valid hex version. + public static Version ParseHexVersion(string versionString) + { + if (String.IsNullOrEmpty(versionString)) + { + return null; + } + + int[] versionNumbers = new int[4]; + string[] versionNumberStrings = versionString.Split('.'); + + for (int i = 0; i < versionNumbers.Length && i < versionNumberStrings.Length; i++) + { + if (!Int32.TryParse(versionNumberStrings[i], NumberStyles.HexNumber, CultureInfo.InvariantCulture, out versionNumbers[i])) + { + return null; + } + } + + return new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]); + } + + /// + /// Native methods for registering type libraries. + /// + private sealed class NativeMethods + { + /// + /// Registers a type library. + /// + /// The type library file to register. + internal static void RegisterTypeLibrary(string typeLibraryFile) + { + IntPtr ptlib; + + LoadTypeLib(typeLibraryFile, out ptlib); + + RegisterTypeLib(ptlib, typeLibraryFile, null); + } + + /// + /// Loads and registers a type library. + /// + /// Contains the name of the file from which LoadTypeLib should attempt to load a type library. + /// On return, contains a pointer to a pointer to the loaded type library. + /// LoadTypeLib will not register the type library if the path of the type library is specified. + [DllImport("oleaut32.dll", PreserveSig = false)] + private static extern void LoadTypeLib([MarshalAs(UnmanagedType.BStr)] string szFile, out IntPtr pptlib); + + /// + /// Adds information about a type library to the system registry. + /// + /// Pointer to the type library being registered. + /// Fully qualified path specification for the type library being registered. + /// Directory in which the Help file for the library being registered can be found. Can be Null. + [DllImport("oleaut32.dll", PreserveSig = false)] + private static extern void RegisterTypeLib(IntPtr ptlib, [MarshalAs(UnmanagedType.BStr)] string szFullPath, [MarshalAs(UnmanagedType.BStr)] string szHelpDir); + } + } +} diff --git a/src/heat/UtilFinalizeHarvesterMutator.cs b/src/heat/UtilFinalizeHarvesterMutator.cs new file mode 100644 index 00000000..3e9f1ce7 --- /dev/null +++ b/src/heat/UtilFinalizeHarvesterMutator.cs @@ -0,0 +1,1185 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.Specialized; + using System.Globalization; + using System.IO; + using System.Runtime.InteropServices; + using System.Text; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The finalize harvester mutator for the WiX Toolset Utility Extension. + /// + internal class UtilFinalizeHarvesterMutator : BaseMutatorExtension + { + private ArrayList components; + private ArrayList directories; + private SortedList directoryPaths; + private Hashtable filePaths; + private ArrayList files; + private ArrayList registryValues; + private bool suppressCOMElements; + private bool suppressVB6COMElements; + private string preprocessorVariable; + + /// + /// Instantiate a new UtilFinalizeHarvesterMutator. + /// + public UtilFinalizeHarvesterMutator() + { + this.components = new ArrayList(); + this.directories = new ArrayList(); + this.directoryPaths = new SortedList(); + this.filePaths = new Hashtable(); + this.files = new ArrayList(); + this.registryValues = new ArrayList(); + } + + /// + /// Gets or sets the preprocessor variable for substitution. + /// + /// The preprocessor variable for substitution. + public string PreprocessorVariable + { + get { return this.preprocessorVariable; } + set { this.preprocessorVariable = value; } + } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public override int Sequence + { + get { return 2000; } + } + + /// + /// Gets or sets the option to suppress COM elements. + /// + /// The option to suppress COM elements. + public bool SuppressCOMElements + { + get { return this.suppressCOMElements; } + set { this.suppressCOMElements = value; } + } + + /// + /// Gets or sets the option to suppress VB6 COM elements. + /// + /// The option to suppress VB6 COM elements. + public bool SuppressVB6COMElements + { + get { return this.suppressVB6COMElements; } + set { this.suppressVB6COMElements = value; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.components.Clear(); + this.directories.Clear(); + this.directoryPaths.Clear(); + this.filePaths.Clear(); + this.files.Clear(); + this.registryValues.Clear(); + + // index elements in this wix document + this.IndexElement(wix); + + this.MutateDirectories(); + this.MutateFiles(); + this.MutateRegistryValues(); + + // must occur after all the registry values have been formatted + this.MutateComponents(); + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is Wix.Component) + { + // Component elements only need to be indexed if COM registry values will be strongly typed + if (!this.suppressCOMElements) + { + this.components.Add(element); + } + } + else if (element is Wix.Directory) + { + this.directories.Add(element); + } + else if (element is Wix.File) + { + this.files.Add(element); + } + else if (element is Wix.RegistryValue) + { + this.registryValues.Add(element); + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the components. + /// + private void MutateComponents() + { + if (this.suppressVB6COMElements) + { + // Search for VB6 specific COM registrations + foreach (Wix.Component component in this.components) + { + ArrayList vb6RegistryValues = new ArrayList(); + + foreach (Wix.RegistryValue registryValue in component[typeof(Wix.RegistryValue)]) + { + if (Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root) + { + string[] parts = registryValue.Key.Split('\\'); + + if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 CLSID {D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731}", StringComparison.OrdinalIgnoreCase)) + { + if (!vb6RegistryValues.Contains(registryValue)) + { + vb6RegistryValues.Add(registryValue); + } + } + } + } + else if (String.Equals(parts[0], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(parts[1], "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + if (!vb6RegistryValues.Contains(registryValue)) + { + vb6RegistryValues.Add(registryValue); + } + } + } + } + else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + // Search for any Interfaces that reference the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (3 <= parts.Length) + { + if (String.Equals(parts[2], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + if (String.Equals(registryValue.Value, "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(registryValue.Value, "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + // Having found a match we have to loop through again finding the matching Interface entries + foreach (Wix.RegistryValue regValue in component[typeof(Wix.RegistryValue)]) + { + if (Wix.RegistryValue.ActionType.write == regValue.Action && Wix.RegistryRootType.HKCR == regValue.Root) + { + string[] rvparts = regValue.Key.Split('\\'); + if (String.Equals(rvparts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + if (2 <= rvparts.Length) + { + if (String.Equals(rvparts[1], parts[1], StringComparison.OrdinalIgnoreCase)) + { + if (!vb6RegistryValues.Contains(regValue)) + { + vb6RegistryValues.Add(regValue); + } + } + } + } + } + } + } + } + } + } + } + } + + // Remove all the VB6 specific COM registry values + foreach (Object entry in vb6RegistryValues) + { + component.RemoveChild((Wix.RegistryValue)entry); + } + } + } + + foreach (Wix.Component component in this.components) + { + SortedList indexedElements = CollectionsUtil.CreateCaseInsensitiveSortedList(); + SortedList indexedRegistryValues = CollectionsUtil.CreateCaseInsensitiveSortedList(); + List duplicateRegistryValues = new List(); + + // index all the File elements + foreach (Wix.File file in component[typeof(Wix.File)]) + { + indexedElements.Add(String.Concat("file/", file.Id), file); + } + + // group all the registry values by the COM element they would correspond to and + // create a COM element for each group + foreach (Wix.RegistryValue registryValue in component[typeof(Wix.RegistryValue)]) + { + if (!String.IsNullOrEmpty(registryValue.Key) && Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root && Wix.RegistryValue.TypeType.@string == registryValue.Type) + { + string index = null; + string[] parts = registryValue.Key.Split('\\'); + + // create a COM element for COM registration and index it + if (1 <= parts.Length) + { + if (String.Equals(parts[0], "AppID", StringComparison.OrdinalIgnoreCase)) + { + // only work with GUID AppIds here + if (2 <= parts.Length && parts[1].StartsWith("{", StringComparison.Ordinal) && parts[1].EndsWith("}", StringComparison.Ordinal)) + { + index = String.Concat(parts[0], '/', parts[1]); + + if (!indexedElements.Contains(index)) + { + Wix.AppId appId = new Wix.AppId(); + appId.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + indexedElements.Add(index, appId); + } + } + } + else if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + if (2 <= parts.Length) + { + index = String.Concat(parts[0], '/', parts[1]); + + if (!indexedElements.Contains(index)) + { + Wix.Class wixClass = new Wix.Class(); + wixClass.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + indexedElements.Add(index, wixClass); + } + } + } + else if (String.Equals(parts[0], "Component Categories", StringComparison.OrdinalIgnoreCase)) + { + // If this is the .NET Component Category it should not end up in the authoring. Therefore, add + // the registry key to the duplicate list to ensure it gets removed later. + if (String.Equals(parts[1], "{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}", StringComparison.OrdinalIgnoreCase)) + { + duplicateRegistryValues.Add(registryValue); + } + else + { + // TODO: add support for Component Categories to the compiler. + } + } + else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + if (2 <= parts.Length) + { + index = String.Concat(parts[0], '/', parts[1]); + + if (!indexedElements.Contains(index)) + { + Wix.Interface wixInterface = new Wix.Interface(); + wixInterface.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + indexedElements.Add(index, wixInterface); + } + } + } + else if (String.Equals(parts[0], "TypeLib", StringComparison.Ordinal)) + { + if (3 <= parts.Length) + { + // use a special index to ensure progIds are processed before classes + index = String.Concat(".typelib/", parts[1], '/', parts[2]); + + if (!indexedElements.Contains(index)) + { + Version version = TypeLibraryHarvester.ParseHexVersion(parts[2]); + if (version != null) + { + Wix.TypeLib typeLib = new Wix.TypeLib(); + typeLib.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + typeLib.MajorVersion = version.Major; + typeLib.MinorVersion = version.Minor; + indexedElements.Add(index, typeLib); + } + else // not a valid type library registry value + { + index = null; + } + } + } + } + else if (parts[0].StartsWith(".", StringComparison.Ordinal)) + { + // extension + } + else // ProgId (hopefully) + { + // use a special index to ensure progIds are processed before classes + index = String.Concat(".progid/", parts[0]); + + if (!indexedElements.Contains(index)) + { + Wix.ProgId progId = new Wix.ProgId(); + progId.Id = parts[0]; + indexedElements.Add(index, progId); + } + } + } + + // index the RegistryValue element according to the COM element it corresponds to + if (null != index) + { + SortedList registryValues = (SortedList)indexedRegistryValues[index]; + + if (null == registryValues) + { + registryValues = CollectionsUtil.CreateCaseInsensitiveSortedList(); + indexedRegistryValues.Add(index, registryValues); + } + + try + { + registryValues.Add(String.Concat(registryValue.Key, '/', registryValue.Name), registryValue); + } + catch (ArgumentException) + { + duplicateRegistryValues.Add(registryValue); + + if (String.IsNullOrEmpty(registryValue.Value)) + { + this.Core.Messaging.Write(HarvesterWarnings.DuplicateDllRegistryEntry(String.Concat(registryValue.Key, '/', registryValue.Name), component.Id)); + } + else + { + this.Core.Messaging.Write(HarvesterWarnings.DuplicateDllRegistryEntry(String.Concat(registryValue.Key, '/', registryValue.Name), registryValue.Value, component.Id)); + } + } + } + } + } + + foreach (Wix.RegistryValue removeRegistryEntry in duplicateRegistryValues) + { + component.RemoveChild(removeRegistryEntry); + } + + // set various values on the COM elements from their corresponding registry values + Hashtable indexedProcessedRegistryValues = new Hashtable(); + foreach (DictionaryEntry entry in indexedRegistryValues) + { + Wix.ISchemaElement element = (Wix.ISchemaElement)indexedElements[entry.Key]; + string parentIndex = null; + SortedList registryValues = (SortedList)entry.Value; + + // element-specific variables (for really tough situations) + string classAppId = null; + bool threadingModelSet = false; + + foreach (Wix.RegistryValue registryValue in registryValues.Values) + { + string[] parts = registryValue.Key.ToLower(CultureInfo.InvariantCulture).Split('\\'); + bool processed = false; + + if (element is Wix.AppId) + { + Wix.AppId appId = (Wix.AppId)element; + + if (2 == parts.Length) + { + if (null == registryValue.Name) + { + appId.Description = registryValue.Value; + processed = true; + } + } + } + else if (element is Wix.Class) + { + Wix.Class wixClass = (Wix.Class)element; + + if (2 == parts.Length) + { + if (null == registryValue.Name) + { + wixClass.Description = registryValue.Value; + processed = true; + } + else if (String.Equals(registryValue.Name, "AppID", StringComparison.OrdinalIgnoreCase)) + { + classAppId = registryValue.Value; + processed = true; + } + } + else if (3 == parts.Length) + { + Wix.Class.ContextType contextType = Wix.Class.ContextType.None; + + switch (parts[2]) + { + case "control": + wixClass.Control = Wix.YesNoType.yes; + processed = true; + break; + case "inprochandler": + if (null == registryValue.Name) + { + if (null == wixClass.Handler) + { + wixClass.Handler = "1"; + processed = true; + } + else if ("2" == wixClass.Handler) + { + wixClass.Handler = "3"; + processed = true; + } + } + break; + case "inprochandler32": + if (null == registryValue.Name) + { + if (null == wixClass.Handler) + { + wixClass.Handler = "2"; + processed = true; + } + else if ("1" == wixClass.Handler) + { + wixClass.Handler = "3"; + processed = true; + } + } + break; + case "inprocserver": + contextType = Wix.Class.ContextType.InprocServer; + break; + case "inprocserver32": + contextType = Wix.Class.ContextType.InprocServer32; + break; + case "insertable": + wixClass.Insertable = Wix.YesNoType.yes; + processed = true; + break; + case "localserver": + contextType = Wix.Class.ContextType.LocalServer; + break; + case "localserver32": + contextType = Wix.Class.ContextType.LocalServer32; + break; + case "progid": + if (null == registryValue.Name) + { + Wix.ProgId progId = (Wix.ProgId)indexedElements[String.Concat(".progid/", registryValue.Value)]; + + // verify that the versioned ProgId appears under this Class element + // if not, toss the entire element + if (null == progId || wixClass != progId.ParentElement) + { + element = null; + } + else + { + processed = true; + } + } + break; + case "programmable": + wixClass.Programmable = Wix.YesNoType.yes; + processed = true; + break; + case "typelib": + if (null == registryValue.Name) + { + foreach (DictionaryEntry indexedEntry in indexedElements) + { + string key = (string)indexedEntry.Key; + Wix.ISchemaElement possibleTypeLib = (Wix.ISchemaElement)indexedEntry.Value; + + if (key.StartsWith(".typelib/", StringComparison.Ordinal) && + 0 == String.Compare(key, 9, registryValue.Value, 0, registryValue.Value.Length, StringComparison.OrdinalIgnoreCase)) + { + // ensure the TypeLib is nested under the same thing we want the Class under + if (null == parentIndex || indexedElements[parentIndex] == possibleTypeLib.ParentElement) + { + parentIndex = key; + processed = true; + } + } + } + } + break; + case "version": + if (null == registryValue.Name) + { + wixClass.Version = registryValue.Value; + processed = true; + } + break; + case "versionindependentprogid": + if (null == registryValue.Name) + { + Wix.ProgId progId = (Wix.ProgId)indexedElements[String.Concat(".progid/", registryValue.Value)]; + + // verify that the version independent ProgId appears somewhere + // under this Class element - if not, toss the entire element + if (null == progId || wixClass != progId.ParentElement) + { + // check the parent of the parent + if (null == progId || null == progId.ParentElement || wixClass != progId.ParentElement.ParentElement) + { + element = null; + } + } + + processed = true; + } + break; + } + + if (Wix.Class.ContextType.None != contextType) + { + wixClass.Context |= contextType; + + if (null == registryValue.Name) + { + if ((registryValue.Value.StartsWith("[!", StringComparison.Ordinal) || registryValue.Value.StartsWith("[#", StringComparison.Ordinal)) + && registryValue.Value.EndsWith("]", StringComparison.Ordinal)) + { + parentIndex = String.Concat("file/", registryValue.Value.Substring(2, registryValue.Value.Length - 3)); + processed = true; + } + else if (String.Equals(Path.GetFileName(registryValue.Value), "mscoree.dll", StringComparison.OrdinalIgnoreCase)) + { + wixClass.ForeignServer = "mscoree.dll"; + processed = true; + } + else if (String.Equals(Path.GetFileName(registryValue.Value), "msvbvm60.dll", StringComparison.OrdinalIgnoreCase)) + { + wixClass.ForeignServer = "msvbvm60.dll"; + processed = true; + } + else + { + // Some servers are specifying relative paths (which the above code doesn't find) + // If there's any ambiguity leave it alone and let the developer figure it out when it breaks in the compiler + + bool possibleDuplicate = false; + string possibleParentIndex = null; + + foreach (Wix.File file in this.files) + { + if (String.Equals(registryValue.Value, Path.GetFileName(file.Source), StringComparison.OrdinalIgnoreCase)) + { + if (null == possibleParentIndex) + { + possibleParentIndex = String.Concat("file/", file.Id); + } + else + { + possibleDuplicate = true; + break; + } + } + } + + if (!possibleDuplicate) + { + if (null == possibleParentIndex) + { + wixClass.ForeignServer = registryValue.Value; + processed = true; + } + else + { + parentIndex = possibleParentIndex; + wixClass.RelativePath = Wix.YesNoType.yes; + processed = true; + } + } + } + } + else if (String.Equals(registryValue.Name, "ThreadingModel", StringComparison.OrdinalIgnoreCase)) + { + Wix.Class.ThreadingModelType threadingModel; + + if (String.Equals(registryValue.Value, "apartment", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.apartment; + processed = true; + } + else if (String.Equals(registryValue.Value, "both", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.both; + processed = true; + } + else if (String.Equals(registryValue.Value, "free", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.free; + processed = true; + } + else if (String.Equals(registryValue.Value, "neutral", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.neutral; + processed = true; + } + else if (String.Equals(registryValue.Value, "rental", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.rental; + processed = true; + } + else if (String.Equals(registryValue.Value, "single", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.single; + processed = true; + } + else + { + continue; + } + + if (!threadingModelSet || wixClass.ThreadingModel == threadingModel) + { + wixClass.ThreadingModel = threadingModel; + threadingModelSet = true; + } + else + { + element = null; + break; + } + } + } + } + else if (4 == parts.Length) + { + if (String.Equals(parts[2], "implemented categories", StringComparison.Ordinal)) + { + switch (parts[3]) + { + case "{7dd95801-9882-11cf-9fa9-00aa006c42c4}": + wixClass.SafeForScripting = Wix.YesNoType.yes; + processed = true; + break; + case "{7dd95802-9882-11cf-9fa9-00aa006c42c4}": + wixClass.SafeForInitializing = Wix.YesNoType.yes; + processed = true; + break; + } + } + } + } + else if (element is Wix.Interface) + { + Wix.Interface wixInterface = (Wix.Interface)element; + + if (2 == parts.Length && null == registryValue.Name) + { + wixInterface.Name = registryValue.Value; + processed = true; + } + else if (3 == parts.Length) + { + switch (parts[2]) + { + case "proxystubclsid": + if (null == registryValue.Name) + { + wixInterface.ProxyStubClassId = registryValue.Value.ToUpper(CultureInfo.InvariantCulture); + processed = true; + } + break; + case "proxystubclsid32": + if (null == registryValue.Name) + { + wixInterface.ProxyStubClassId32 = registryValue.Value.ToUpper(CultureInfo.InvariantCulture); + processed = true; + } + break; + case "nummethods": + if (null == registryValue.Name) + { + wixInterface.NumMethods = Convert.ToInt32(registryValue.Value, CultureInfo.InvariantCulture); + processed = true; + } + break; + case "typelib": + if (String.Equals("Version", registryValue.Name, StringComparison.OrdinalIgnoreCase)) + { + parentIndex = String.Concat(parentIndex, registryValue.Value); + processed = true; + } + else if (null == registryValue.Name) // TypeLib guid + { + parentIndex = String.Concat(".typelib/", registryValue.Value, '/', parentIndex); + processed = true; + } + break; + } + } + } + else if (element is Wix.ProgId) + { + Wix.ProgId progId = (Wix.ProgId)element; + + if (null == registryValue.Name) + { + if (1 == parts.Length) + { + progId.Description = registryValue.Value; + processed = true; + } + else if (2 == parts.Length) + { + if (String.Equals(parts[1], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + parentIndex = String.Concat("CLSID/", registryValue.Value); + processed = true; + } + else if (String.Equals(parts[1], "CurVer", StringComparison.OrdinalIgnoreCase)) + { + // If a progId points to its own ProgId with CurVer, it isn't meaningful, so ignore it + if (!String.Equals(progId.Id, registryValue.Value, StringComparison.OrdinalIgnoreCase)) + { + // this registry value should usually be processed second so the + // version independent ProgId should be under the versioned one + parentIndex = String.Concat(".progid/", registryValue.Value); + processed = true; + } + } + } + } + } + else if (element is Wix.TypeLib) + { + Wix.TypeLib typeLib = (Wix.TypeLib)element; + + if (null == registryValue.Name) + { + if (3 == parts.Length) + { + typeLib.Description = registryValue.Value; + processed = true; + } + else if (4 == parts.Length) + { + if (String.Equals(parts[3], "flags", StringComparison.OrdinalIgnoreCase)) + { + int flags = Convert.ToInt32(registryValue.Value, CultureInfo.InvariantCulture); + + if (0x1 == (flags & 0x1)) + { + typeLib.Restricted = Wix.YesNoType.yes; + } + + if (0x2 == (flags & 0x2)) + { + typeLib.Control = Wix.YesNoType.yes; + } + + if (0x4 == (flags & 0x4)) + { + typeLib.Hidden = Wix.YesNoType.yes; + } + + if (0x8 == (flags & 0x8)) + { + typeLib.HasDiskImage = Wix.YesNoType.yes; + } + + processed = true; + } + else if (String.Equals(parts[3], "helpdir", StringComparison.OrdinalIgnoreCase)) + { + if (registryValue.Value.StartsWith("[", StringComparison.Ordinal) && (registryValue.Value.EndsWith("]", StringComparison.Ordinal) + || registryValue.Value.EndsWith("]\\", StringComparison.Ordinal))) + { + typeLib.HelpDirectory = registryValue.Value.Substring(1, registryValue.Value.LastIndexOf(']') - 1); + } + else if (0 == String.Compare(registryValue.Value, Environment.SystemDirectory, StringComparison.OrdinalIgnoreCase)) // VB6 DLLs register their help directory as SystemFolder + { + typeLib.HelpDirectory = "SystemFolder"; + } + else if (null != component.Directory) // -sfrag has not been specified + { + typeLib.HelpDirectory = component.Directory; + } + else if (component.ParentElement is Wix.Directory) // -sfrag has been specified + { + typeLib.HelpDirectory = ((Wix.Directory)component.ParentElement).Id; + } + else if (component.ParentElement is Wix.DirectoryRef) // -sfrag has been specified + { + typeLib.HelpDirectory = ((Wix.DirectoryRef)component.ParentElement).Id; + } + + //If the helpdir has not matched a known directory, drop it because it cannot be resolved. + processed = true; + } + } + else if (5 == parts.Length && String.Equals("win32", parts[4], StringComparison.OrdinalIgnoreCase)) + { + typeLib.Language = Convert.ToInt32(parts[3], CultureInfo.InvariantCulture); + + if ((registryValue.Value.StartsWith("[!", StringComparison.Ordinal) || registryValue.Value.StartsWith("[#", StringComparison.Ordinal)) + && registryValue.Value.EndsWith("]", StringComparison.Ordinal)) + { + parentIndex = String.Concat("file/", registryValue.Value.Substring(2, registryValue.Value.Length - 3)); + } + + processed = true; + } + } + } + + // index the processed registry values by their corresponding COM element + if (processed) + { + indexedProcessedRegistryValues.Add(registryValue, element); + } + } + + // parent the COM element + if (null != element) + { + if (null != parentIndex) + { + Wix.IParentElement parentElement = (Wix.IParentElement)indexedElements[parentIndex]; + + if (null != parentElement) + { + parentElement.AddChild(element); + } + } + else if (0 < indexedProcessedRegistryValues.Count) + { + component.AddChild(element); + } + + // special handling for AppID since it doesn't fit the general model + if (null != classAppId) + { + Wix.AppId appId = (Wix.AppId)indexedElements[String.Concat("AppID/", classAppId)]; + + // move the Class element under the AppId (and put the AppId under its old parent) + if (null != appId) + { + // move the AppId element + ((Wix.IParentElement)appId.ParentElement).RemoveChild(appId); + ((Wix.IParentElement)element.ParentElement).AddChild(appId); + + // move the Class element + ((Wix.IParentElement)element.ParentElement).RemoveChild(element); + appId.AddChild(element); + } + } + } + } + + // remove the RegistryValue elements which were converted into COM elements + // that were successfully nested under the Component element + foreach (DictionaryEntry entry in indexedProcessedRegistryValues) + { + Wix.ISchemaElement element = (Wix.ISchemaElement)entry.Value; + Wix.RegistryValue registryValue = (Wix.RegistryValue)entry.Key; + + while (null != element) + { + if (element == component) + { + ((Wix.IParentElement)registryValue.ParentElement).RemoveChild(registryValue); + break; + } + + element = element.ParentElement; + } + } + } + } + + /// + /// Mutate the directories. + /// + private void MutateDirectories() + { + foreach (Wix.Directory directory in this.directories) + { + string path = directory.FileSource; + + // create a new directory element without the FileSource attribute + if (null != path) + { + Wix.Directory newDirectory = new Wix.Directory(); + + newDirectory.Id = directory.Id; + newDirectory.Name = directory.Name; + + foreach (Wix.ISchemaElement element in directory.Children) + { + newDirectory.AddChild(element); + } + + ((Wix.IParentElement)directory.ParentElement).AddChild(newDirectory); + ((Wix.IParentElement)directory.ParentElement).RemoveChild(directory); + + if (null != newDirectory.Id) + { + this.directoryPaths[path.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[", newDirectory.Id, "]"); + } + } + } + } + + /// + /// Mutate the files. + /// + private void MutateFiles() + { + string sourceDirSubstitution = this.preprocessorVariable; + if (sourceDirSubstitution != null) + { + string prefix = "$("; + if (sourceDirSubstitution.StartsWith("wix.", StringComparison.Ordinal)) + { + prefix = "!("; + } + sourceDirSubstitution = String.Concat(prefix, sourceDirSubstitution, ")"); + } + + foreach (Wix.File file in this.files) + { + if (null != file.Id && null != file.Source) + { + string fileSource = this.Core.ResolveFilePath(file.Source); + + // index the long path + this.filePaths[fileSource.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[#", file.Id, "]"); + + // index the long path as a URL for assembly harvesting + Uri fileUri = new Uri(fileSource); + this.filePaths[fileUri.ToString().ToLower(CultureInfo.InvariantCulture)] = String.Concat("file:///[#", file.Id, "]"); + + // index the short path + string shortPath = NativeMethods.GetShortPathName(fileSource); + this.filePaths[shortPath.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[!", file.Id, "]"); + + // escape literal $ characters + file.Source = file.Source.Replace("$", "$$"); + + if (null != sourceDirSubstitution && file.Source.StartsWith("SourceDir\\", StringComparison.Ordinal)) + { + file.Source = file.Source.Substring(9).Insert(0, sourceDirSubstitution); + } + } + } + } + + /// + /// Mutate an individual registry string, according to a collection of replacement items. + /// + /// The string to mutate. + /// The collection of items to replace within the string. + /// The mutated registry string. + private string MutateRegistryString(string value, ICollection replace) + { + int index; + string lowercaseValue = value.ToLower(CultureInfo.InvariantCulture); + + foreach (DictionaryEntry entry in replace) + { + while (0 <= (index = lowercaseValue.IndexOf((string)entry.Key, StringComparison.Ordinal))) + { + value = value.Remove(index, ((string)entry.Key).Length); + value = value.Insert(index, (string)entry.Value); + lowercaseValue = value.ToLower(CultureInfo.InvariantCulture); + } + } + + return value; + } + + /// + /// Mutate the registry values. + /// + private void MutateRegistryValues() + { + if (this.SuppressVB6COMElements && this.SuppressCOMElements) + { + var vb6RegistryValues = new List(); + foreach (Wix.RegistryValue registryValue in this.registryValues) + { + if (IsVb6RegistryValue(registryValue)) + { + if (!vb6RegistryValues.Contains(registryValue)) + { + vb6RegistryValues.Add(registryValue); + } + } + } + + // Remove all the VB6 specific COM registry values + foreach (var reg in vb6RegistryValues) + { + if (reg.ParentElement is Wix.Component component) + { + component.RemoveChild(reg); + } + this.registryValues.Remove(reg); + } + } + + + ArrayList reversedDirectoryPaths = new ArrayList(); + + // reverse the indexed directory paths to ensure the longest paths are found first + foreach (DictionaryEntry entry in this.directoryPaths) + { + reversedDirectoryPaths.Insert(0, entry); + } + + foreach (Wix.RegistryValue registryValue in this.registryValues) + { + // Multi-string values are stored as children - their "Value" member is null + if (Wix.RegistryValue.TypeType.multiString == registryValue.Type) + { + foreach (Wix.MultiStringValue multiStringValue in registryValue.Children) + { + // first replace file paths with their MSI tokens + multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)this.filePaths); + // next replace directory paths with their MSI tokens + multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)reversedDirectoryPaths); + } + } + else + { + // first replace file paths with their MSI tokens + registryValue.Value = this.MutateRegistryString(registryValue.Value, (ICollection)this.filePaths); + // next replace directory paths with their MSI tokens + registryValue.Value = this.MutateRegistryString(registryValue.Value, (ICollection)reversedDirectoryPaths); + } + } + } + + private static bool IsVb6RegistryValue(Wix.RegistryValue registryValue) + { + if (Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root) + { + string[] parts = registryValue.Key.Split('\\'); + if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 CLSID {D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731}", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + } + else if (String.Equals(parts[0], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(parts[1], "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + } + else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + // Search for any Interfaces that reference the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (3 <= parts.Length) + { + if (String.Equals(parts[2], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + if (String.Equals(registryValue.Value, "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(registryValue.Value, "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + } + } + } + return false; + } + + /// + /// The native methods for grabbing machine-specific short file paths. + /// + private class NativeMethods + { + /// + /// Gets the short name for a file. + /// + /// Fullpath to file on disk. + /// Short name for file. + internal static string GetShortPathName(string fullPath) + { + var bufferSize = (int)GetShortPathName(fullPath, null, 0); + if (0 == bufferSize) + { + int err = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); + throw new System.Runtime.InteropServices.COMException(String.Concat("Failed to get short path buffer size for file: ", fullPath), err); + } + + bufferSize += 1; + var shortPath = new StringBuilder(bufferSize, bufferSize); + + uint result = GetShortPathName(fullPath, shortPath, bufferSize); + + if (0 == result) + { + int err = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); + throw new System.Runtime.InteropServices.COMException(String.Concat("Failed to get short path name for file: ", fullPath), err); + } + + return shortPath.ToString(); + } + + /// + /// Gets the short name for a file. + /// + /// Long path to convert to short path. + /// Short path from long path. + /// Size of short path. + /// zero if success. + [DllImport("kernel32.dll", EntryPoint = "GetShortPathNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static extern uint GetShortPathName(string longPath, StringBuilder shortPath, [MarshalAs(UnmanagedType.U4)]int buffer); + } + } +} diff --git a/src/heat/UtilHarvesterMutator.cs b/src/heat/UtilHarvesterMutator.cs new file mode 100644 index 00000000..59fb9a93 --- /dev/null +++ b/src/heat/UtilHarvesterMutator.cs @@ -0,0 +1,218 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.IO; + using System.Reflection; + using System.Runtime.InteropServices; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The WiX Toolset harvester mutator. + /// + internal class UtilHarvesterMutator : BaseMutatorExtension + { + // Flags for SetErrorMode() native method. + private const UInt32 SEM_FAILCRITICALERRORS = 0x0001; + private const UInt32 SEM_NOGPFAULTERRORBOX = 0x0002; + private const UInt32 SEM_NOALIGNMENTFAULTEXCEPT = 0x0004; + private const UInt32 SEM_NOOPENFILEERRORBOX = 0x8000; + + // Remember whether we were able to call OaEnablePerUserTLibRegistration + private bool calledPerUserTLibReg; + + /// + /// allow process to handle serious system errors. + /// + [DllImport("Kernel32.dll")] + private static extern void SetErrorMode(UInt32 uiMode); + + /// + /// enable the RegisterTypeLib API to use the appropriate override mapping for non-admin users on Vista + /// + [DllImport("Oleaut32.dll")] + private static extern void OaEnablePerUserTLibRegistration(); + + public UtilHarvesterMutator() + { + this.calledPerUserTLibReg = false; + + SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); + + try + { + OaEnablePerUserTLibRegistration(); + this.calledPerUserTLibReg = true; + } + catch (EntryPointNotFoundException) + { + } + } + + /// + /// Gets the sequence of this mutator extension. + /// + /// The sequence of this mutator extension. + public override int Sequence + { + get { return 100; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.MutateElement(null, wix); + } + + /// + /// Mutate an element. + /// + /// The parent of the element to mutate. + /// The element to mutate. + private void MutateElement(Wix.IParentElement parentElement, Wix.ISchemaElement element) + { + if (element is Wix.File) + { + this.MutateFile(parentElement, (Wix.File)element); + } + + // mutate the child elements + if (element is Wix.IParentElement) + { + ArrayList childElements = new ArrayList(); + + // copy the child elements to a temporary array (to allow them to be deleted/moved) + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + childElements.Add(childElement); + } + + foreach (Wix.ISchemaElement childElement in childElements) + { + this.MutateElement((Wix.IParentElement)element, childElement); + } + } + } + + /// + /// Mutate a file. + /// + /// The parent of the element to mutate. + /// The file to mutate. + private void MutateFile(Wix.IParentElement parentElement, Wix.File file) + { + if (null != file.Source) + { + string fileExtension = Path.GetExtension(file.Source); + string fileSource = this.Core.ResolveFilePath(file.Source); + + if (String.Equals(".ax", fileExtension, StringComparison.OrdinalIgnoreCase) || // DirectShow filter + String.Equals(".dll", fileExtension, StringComparison.OrdinalIgnoreCase) || + String.Equals(".exe", fileExtension, StringComparison.OrdinalIgnoreCase) || + String.Equals(".ocx", fileExtension, StringComparison.OrdinalIgnoreCase)) // ActiveX + { + // try the assembly harvester + try + { + AssemblyHarvester assemblyHarvester = new AssemblyHarvester(); + + this.Core.Messaging.Write(HarvesterVerboses.HarvestingAssembly(fileSource)); + Wix.RegistryValue[] registryValues = assemblyHarvester.HarvestRegistryValues(fileSource); + + foreach (Wix.RegistryValue registryValue in registryValues) + { + parentElement.AddChild(registryValue); + } + + // also try self-reg since we could have a mixed-mode assembly + this.HarvestSelfReg(parentElement, fileSource); + } + catch (BadImageFormatException) // not an assembly, try raw DLL. + { + this.HarvestSelfReg(parentElement, fileSource); + } + catch (Exception ex) + { + this.Core.Messaging.Write(HarvesterWarnings.AssemblyHarvestFailed(fileSource, ex.Message)); + } + } + else if (String.Equals(".olb", fileExtension, StringComparison.OrdinalIgnoreCase) || // type library + String.Equals(".tlb", fileExtension, StringComparison.OrdinalIgnoreCase)) // type library + { + // try the type library harvester + try + { + TypeLibraryHarvester typeLibHarvester = new TypeLibraryHarvester(); + + this.Core.Messaging.Write(HarvesterVerboses.HarvestingTypeLib(fileSource)); + Wix.RegistryValue[] registryValues = typeLibHarvester.HarvestRegistryValues(fileSource); + + foreach (Wix.RegistryValue registryValue in registryValues) + { + parentElement.AddChild(registryValue); + } + } + catch (COMException ce) + { + // 0x8002801C (TYPE_E_REGISTRYACCESS) + // If we don't have permission to harvest typelibs, it's likely because we're on + // Vista or higher and aren't an Admin, or don't have the appropriate QFE installed. + if (!this.calledPerUserTLibReg && (0x8002801c == unchecked((uint)ce.ErrorCode))) + { + this.Core.Messaging.Write(WarningMessages.InsufficientPermissionHarvestTypeLib()); + } + else if (0x80029C4A == unchecked((uint)ce.ErrorCode)) // generic can't load type library + { + this.Core.Messaging.Write(HarvesterWarnings.TypeLibLoadFailed(fileSource, ce.Message)); + } + } + } + } + } + + /// + /// Calls self-reg harvester. + /// + /// The parent element. + /// The file source. + private void HarvestSelfReg(Wix.IParentElement parentElement, string fileSource) + { + // try the self-reg harvester + try + { + DllHarvester dllHarvester = new DllHarvester(); + + this.Core.Messaging.Write(HarvesterVerboses.HarvestingSelfReg(fileSource)); + Wix.RegistryValue[] registryValues = dllHarvester.HarvestRegistryValues(fileSource); + + foreach (Wix.RegistryValue registryValue in registryValues) + { + parentElement.AddChild(registryValue); + } + } + catch (TargetInvocationException tie) + { + if (tie.InnerException is EntryPointNotFoundException) + { + // No DllRegisterServer(), which is fine by me. + } + else + { + this.Core.Messaging.Write(HarvesterWarnings.SelfRegHarvestFailed(fileSource, tie.Message)); + } + } + catch (Exception ex) + { + this.Core.Messaging.Write(HarvesterWarnings.SelfRegHarvestFailed(fileSource, ex.Message)); + } + } + } +} diff --git a/src/heat/UtilHeatExtension.cs b/src/heat/UtilHeatExtension.cs new file mode 100644 index 00000000..7296a3b3 --- /dev/null +++ b/src/heat/UtilHeatExtension.cs @@ -0,0 +1,405 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using System.IO; + using WixToolset.Core.Burn.Interfaces; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// A utility heat extension for the WiX Toolset Harvester application. + /// + internal class UtilHeatExtension : BaseHeatExtension + { + public UtilHeatExtension(IServiceProvider serviceProvider) + { + this.PayloadHarvester = serviceProvider.GetService(); + } + + private IPayloadHarvester PayloadHarvester { get; } + + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public override HeatCommandLineOption[] CommandLineTypes + { + get + { + return new HeatCommandLineOption[] + { + new HeatCommandLineOption("dir", "harvest a directory"), + new HeatCommandLineOption("file", "harvest a file"), + new HeatCommandLineOption("exepackagepayload", "harvest a bundle payload as ExePackagePayload"), + new HeatCommandLineOption("msupackagepayload", "harvest a bundle payload as MsuPackagePayload"), + new HeatCommandLineOption("perf", "harvest performance counters"), + new HeatCommandLineOption("reg", "harvest a .reg file"), + new HeatCommandLineOption("-ag", "autogenerate component guids at compile time"), + new HeatCommandLineOption("-cg ", "component group name (cannot contain spaces e.g -cg MyComponentGroup)"), + new HeatCommandLineOption("-dr ", "directory reference to root directories (cannot contain spaces e.g. -dr MyAppDirRef)"), + new HeatCommandLineOption("-var ", "substitute File/@Source=\"SourceDir\" with a preprocessor or a wix variable" + Environment.NewLine + + "(e.g. -var var.MySource will become File/@Source=\"$(var.MySource)\\myfile.txt\" and " + Environment.NewLine + + "-var wix.MySource will become File/@Source=\"!(wix.MySource)\\myfile.txt\""), + new HeatCommandLineOption("-gg", "generate guids now"), + new HeatCommandLineOption("-g1", "generated guids are not in brackets"), + new HeatCommandLineOption("-ke", "keep empty directories"), + new HeatCommandLineOption("-scom", "suppress COM elements"), + new HeatCommandLineOption("-sfrag", "suppress fragments"), + new HeatCommandLineOption("-srd", "suppress harvesting the root directory as an element"), + new HeatCommandLineOption("-svb6", "suppress VB6 COM elements"), + new HeatCommandLineOption("-sreg", "suppress registry harvesting"), + new HeatCommandLineOption("-suid", "suppress unique identifiers for files, components, & directories"), + new HeatCommandLineOption("-t", "transform harvested output with XSL file"), + new HeatCommandLineOption("-template", "use template, one of: fragment,module,product"), + }; + } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public override void ParseOptions(string type, string[] args) + { + bool active = false; + IHarvesterExtension harvesterExtension = null; + bool suppressHarvestingRegistryValues = false; + UtilFinalizeHarvesterMutator utilFinalizeHarvesterMutator = new UtilFinalizeHarvesterMutator(); + UtilMutator utilMutator = new UtilMutator(); + List transformMutators = new List(); + GenerateType generateType = GenerateType.Components; + + // select the harvester + switch (type) + { + case "dir": + harvesterExtension = new DirectoryHarvester(); + active = true; + break; + case "file": + harvesterExtension = new FileHarvester(); + active = true; + break; + case "exepackagepayload": + harvesterExtension = new PayloadHarvester(this.PayloadHarvester, WixBundlePackageType.Exe); + active = true; + break; + case "msupackagepayload": + harvesterExtension = new PayloadHarvester(this.PayloadHarvester, WixBundlePackageType.Msu); + active = true; + break; + case "perf": + harvesterExtension = new PerformanceCategoryHarvester(); + active = true; + break; + case "reg": + harvesterExtension = new RegFileHarvester(); + active = true; + break; + } + + // set default settings + utilMutator.CreateFragments = true; + utilMutator.SetUniqueIdentifiers = true; + + // parse the options + for (int i = 0; i < args.Length; i++) + { + string commandSwitch = args[i]; + + if (null == commandSwitch || 0 == commandSwitch.Length) // skip blank arguments + { + continue; + } + + if ('-' == commandSwitch[0] || '/' == commandSwitch[0]) + { + string truncatedCommandSwitch = commandSwitch.Substring(1); + + if ("ag" == truncatedCommandSwitch) + { + utilMutator.AutogenerateGuids = true; + } + else if ("cg" == truncatedCommandSwitch) + { + utilMutator.ComponentGroupName = this.GetArgumentParameter(args, i); + + if (this.Core.Messaging.EncounteredError) + { + return; + } + } + else if ("dr" == truncatedCommandSwitch) + { + string dr = this.GetArgumentParameter(args, i); + + if (this.Core.Messaging.EncounteredError) + { + return; + } + + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).RootedDirectoryRef = dr; + } + else if (harvesterExtension is FileHarvester) + { + ((FileHarvester)harvesterExtension).RootedDirectoryRef = dr; + } + } + else if ("gg" == truncatedCommandSwitch) + { + utilMutator.GenerateGuids = true; + } + else if ("g1" == truncatedCommandSwitch) + { + utilMutator.GuidFormat = "D"; + } + else if ("ke" == truncatedCommandSwitch) + { + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).KeepEmptyDirectories = true; + } + else if (active) + { + // TODO: error message - not applicable to file harvester + } + } + else if ("scom" == truncatedCommandSwitch) + { + if (active) + { + utilFinalizeHarvesterMutator.SuppressCOMElements = true; + } + else + { + // TODO: error message - not applicable + } + } + else if ("svb6" == truncatedCommandSwitch) + { + if (active) + { + utilFinalizeHarvesterMutator.SuppressVB6COMElements = true; + } + else + { + // TODO: error message - not applicable + } + } + else if ("sfrag" == truncatedCommandSwitch) + { + utilMutator.CreateFragments = false; + } + else if ("srd" == truncatedCommandSwitch) + { + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).SuppressRootDirectory = true; + } + else if (harvesterExtension is FileHarvester) + { + ((FileHarvester)harvesterExtension).SuppressRootDirectory = true; + } + } + else if ("sreg" == truncatedCommandSwitch) + { + suppressHarvestingRegistryValues = true; + } + else if ("suid" == truncatedCommandSwitch) + { + utilMutator.SetUniqueIdentifiers = false; + + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).SetUniqueIdentifiers = false; + } + else if (harvesterExtension is FileHarvester) + { + ((FileHarvester)harvesterExtension).SetUniqueIdentifiers = false; + } + } + else if (truncatedCommandSwitch.StartsWith("t:", StringComparison.Ordinal) || "t" == truncatedCommandSwitch) + { + string xslFile; + if (truncatedCommandSwitch.StartsWith("t:", StringComparison.Ordinal)) + { + this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("t:", "t")); + xslFile = truncatedCommandSwitch.Substring(2); + } + else + { + xslFile = this.GetArgumentParameter(args, i, true); + } + + if (0 <= xslFile.IndexOf('\"')) + { + this.Core.Messaging.Write(ErrorMessages.PathCannotContainQuote(xslFile)); + return; + } + + try + { + xslFile = Path.GetFullPath(xslFile); + } + catch (Exception e) + { + this.Core.Messaging.Write(ErrorMessages.InvalidCommandLineFileName(xslFile, e.Message)); + return; + } + + transformMutators.Add(new UtilTransformMutator(xslFile, transformMutators.Count)); + } + else if (truncatedCommandSwitch.StartsWith("template:", StringComparison.Ordinal) || "template" == truncatedCommandSwitch) + { + string template; + if(truncatedCommandSwitch.StartsWith("template:", StringComparison.Ordinal)) + { + this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("template:", "template")); + template = truncatedCommandSwitch.Substring(9); + } + else + { + template = this.GetArgumentParameter(args, i); + } + + switch (template) + { + case "fragment": + utilMutator.TemplateType = TemplateType.Fragment; + break; + case "module": + utilMutator.TemplateType = TemplateType.Module; + break; + case "product": + utilMutator.TemplateType = TemplateType.Package ; + break; + default: + // TODO: error + break; + } + } + else if ("var" == truncatedCommandSwitch) + { + if (active) + { + utilFinalizeHarvesterMutator.PreprocessorVariable = this.GetArgumentParameter(args, i); + + if (this.Core.Messaging.EncounteredError) + { + return; + } + } + } + else if ("generate" == truncatedCommandSwitch) + { + if (harvesterExtension is DirectoryHarvester) + { + string genType = this.GetArgumentParameter(args, i).ToUpperInvariant(); + switch (genType) + { + case "COMPONENTS": + generateType = GenerateType.Components; + break; + case "PAYLOADGROUP": + generateType = GenerateType.PayloadGroup; + break; + default: + throw new WixException(HarvesterErrors.InvalidDirectoryOutputType(genType)); + } + } + else + { + // TODO: error message - not applicable + } + } + } + } + + // set the appropriate harvester extension + if (active) + { + this.Core.Harvester.Extension = harvesterExtension; + + if (!suppressHarvestingRegistryValues) + { + this.Core.Mutator.AddExtension(new UtilHarvesterMutator()); + } + + this.Core.Mutator.AddExtension(utilFinalizeHarvesterMutator); + + if (harvesterExtension is DirectoryHarvester directoryHarvester) + { + directoryHarvester.GenerateType = generateType; + this.Core.Harvester.Core.RootDirectory = this.Core.Harvester.Core.ExtensionArgument; + } + else if (harvesterExtension is FileHarvester) + { + if (((FileHarvester)harvesterExtension).SuppressRootDirectory) + { + this.Core.Harvester.Core.RootDirectory = Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument)); + } + else + { + this.Core.Harvester.Core.RootDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument))); + + // GetDirectoryName() returns null for root paths such as "c:\", so make sure to support that as well + if (null == this.Core.Harvester.Core.RootDirectory) + { + this.Core.Harvester.Core.RootDirectory = Path.GetPathRoot(Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument))); + } + } + } + } + + // set the mutator + this.Core.Mutator.AddExtension(utilMutator); + + // add the transforms + foreach (UtilTransformMutator transformMutator in transformMutators) + { + this.Core.Mutator.AddExtension(transformMutator); + } + } + + private string GetArgumentParameter(string[] args, int index) + { + return this.GetArgumentParameter(args, index, false); + } + + private string GetArgumentParameter(string[] args, int index, bool allowSpaces) + { + string truncatedCommandSwitch = args[index]; + string commandSwitchValue = args[index + 1]; + + //increment the index to the switch value + index++; + + if (IsValidArg(args, index) && !String.IsNullOrEmpty(commandSwitchValue.Trim())) + { + if (!allowSpaces && commandSwitchValue.Contains(" ")) + { + this.Core.Messaging.Write(HarvesterErrors.SpacesNotAllowedInArgumentValue(truncatedCommandSwitch, commandSwitchValue)); + } + else + { + return commandSwitchValue; + } + } + else + { + this.Core.Messaging.Write(HarvesterErrors.ArgumentRequiresValue(truncatedCommandSwitch)); + } + + return null; + } + } +} diff --git a/src/heat/UtilMutator.cs b/src/heat/UtilMutator.cs new file mode 100644 index 00000000..3ba3a8eb --- /dev/null +++ b/src/heat/UtilMutator.cs @@ -0,0 +1,633 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The template type. + /// + internal enum TemplateType + { + /// + /// A fragment template. + /// + Fragment, + + /// + /// A module template. + /// + Module, + + /// + /// A product template. + /// + Package + } + + /// + /// The mutator for the WiX Toolset Internet Information Services Extension. + /// + internal class UtilMutator : BaseMutatorExtension + { + private ArrayList components; + private ArrayList componentGroups; + private string componentGroupName; + private bool createFragments; + private ArrayList directories; + private ArrayList directoryRefs; + private ArrayList files; + private ArrayList features; + private SortedList fragments; + private bool autogenerateGuids; + private bool generateGuids; + private string guidFormat = "B"; // Defaults to guid in {} + private Wix.IParentElement rootElement; + private bool setUniqueIdentifiers; + private TemplateType templateType; + + /// + /// Instantiate a new UtilMutator. + /// + public UtilMutator() + { + this.components = new ArrayList(); + this.componentGroups = new ArrayList(); + this.directories = new ArrayList(); + this.directoryRefs = new ArrayList(); + this.features = new ArrayList(); + this.files = new ArrayList(); + this.fragments = new SortedList(); + } + + /// + /// Gets or sets the value of the component group name. + /// + /// The component group name. + public string ComponentGroupName + { + get { return this.componentGroupName; } + set { this.componentGroupName = value; } + } + + /// + /// Gets or sets the option to create fragments. + /// + /// The option to create fragments. + public bool CreateFragments + { + get { return this.createFragments; } + set { this.createFragments = value; } + } + + /// + /// Gets or sets the option to autogenerate component guids at compile time. + /// + /// The option to autogenerate component guids. + public bool AutogenerateGuids + { + get { return this.autogenerateGuids; } + set { this.autogenerateGuids = value; } + } + + /// + /// Gets or sets the option to generate missing guids. + /// + /// The option to generate missing guids. + public bool GenerateGuids + { + get { return this.generateGuids; } + set { this.generateGuids = value; } + } + + /// + /// Gets or sets the option to set the format of guids. + /// D - 32 digits separated by hyphens: + /// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + /// B - 32 digits separated by hyphens, enclosed in brackets: + /// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} + /// + /// Guid format either B or D. + public string GuidFormat + { + get { return this.guidFormat; } + set { this.guidFormat = value; } + } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public override int Sequence + { + get { return 1000; } + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Gets or sets the template type. + /// + /// The template type. + public TemplateType TemplateType + { + get { return this.templateType; } + set { this.templateType = value; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.components.Clear(); + this.directories.Clear(); + this.directoryRefs.Clear(); + this.features.Clear(); + this.files.Clear(); + this.fragments.Clear(); + this.rootElement = null; + + // index elements in this wix document + this.IndexElement(wix); + + this.MutateWix(wix); + + this.MutateFiles(); + + this.MutateDirectories(); + + this.MutateComponents(); + + if (null != this.componentGroupName) + { + this.CreateComponentGroup(wix); + } + + // add the components to the product feature after all the identifiers have been set + if (TemplateType.Package == this.templateType) + { + Wix.Feature feature = (Wix.Feature)this.features[0]; + + foreach (Wix.ComponentGroup group in this.componentGroups) + { + Wix.ComponentGroupRef componentGroupRef = new Wix.ComponentGroupRef(); + componentGroupRef.Id = group.Id; + + feature.AddChild(componentGroupRef); + } + } + else if (TemplateType.Module == this.templateType) + { + foreach (Wix.ISchemaElement element in wix.Children) + { + if (element is Wix.Module) + { + foreach (Wix.ComponentGroup group in this.componentGroups) + { + Wix.ComponentGroupRef componentGroupRef = new Wix.ComponentGroupRef(); + componentGroupRef.Id = group.Id; + + ((Wix.IParentElement)element).AddChild(componentGroupRef); + } + break; + } + } + } + + //if(!this.createFragments && TemplateType.Package + foreach (Wix.Fragment fragment in this.fragments.Values) + { + wix.AddChild(fragment); + } + } + + /// + /// Creates a component group with a given name. + /// + /// The Wix document element. + private void CreateComponentGroup(Wix.Wix wix) + { + Wix.ComponentGroup componentGroup = new Wix.ComponentGroup(); + componentGroup.Id = this.componentGroupName; + this.componentGroups.Add(componentGroup); + + Wix.Fragment cgFragment = new Wix.Fragment(); + cgFragment.AddChild(componentGroup); + wix.AddChild(cgFragment); + + int componentCount = 0; + for (; componentCount < this.components.Count; componentCount++) + { + Wix.Component c = this.components[componentCount] as Wix.Component; + + if (this.createFragments) + { + if (c.ParentElement is Wix.Directory) + { + Wix.Directory parentDirectory = c.ParentElement as Wix.Directory; + + componentGroup.AddChild(c); + c.Directory = parentDirectory.Id; + parentDirectory.RemoveChild(c); + } + else if (c.ParentElement is Wix.DirectoryRef) + { + Wix.DirectoryRef parentDirectory = c.ParentElement as Wix.DirectoryRef; + + componentGroup.AddChild(c); + c.Directory = parentDirectory.Id; + parentDirectory.RemoveChild(c); + + // Remove whole fragment if moving the component to the component group just leaves an empty DirectoryRef + if (0 < this.fragments.Count && parentDirectory.ParentElement is Wix.Fragment) + { + Wix.Fragment parentFragment = parentDirectory.ParentElement as Wix.Fragment; + int childCount = 0; + foreach (Wix.ISchemaElement element in parentFragment.Children) + { + childCount++; + } + + // Component should always have an Id but the SortedList creation allows for null and bases the name on the fragment count which we cannot reverse engineer here. + if (1 == childCount && !String.IsNullOrEmpty(c.Id)) + { + int removeIndex = this.fragments.IndexOfKey(String.Concat("Component:", c.Id)); + if (0 <= removeIndex) + { + this.fragments.RemoveAt(removeIndex); + } + } + } + } + } + else + { + Wix.ComponentRef componentRef = new Wix.ComponentRef(); + componentRef.Id = c.Id; + componentGroup.AddChild(componentRef); + } + } + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is Wix.Component) + { + this.components.Add(element); + } + else if (element is Wix.ComponentGroup) + { + this.componentGroups.Add(element); + } + else if (element is Wix.Directory) + { + this.directories.Add(element); + } + else if (element is Wix.DirectoryRef) + { + this.directoryRefs.Add(element); + } + else if (element is Wix.Feature) + { + this.features.Add(element); + } + else if (element is Wix.File) + { + this.files.Add(element); + } + else if (element is Wix.Module || element is Wix.PatchCreation || element is Wix.Package) + { + Debug.Assert(null == this.rootElement); + this.rootElement = (Wix.IParentElement)element; + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the components. + /// + private void MutateComponents() + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("Component", this.Core); + if (TemplateType.Module == this.templateType) + { + identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; + } + + foreach (Wix.Component component in this.components) + { + if (null == component.Id) + { + string firstFileId = string.Empty; + + // attempt to create a possible identifier from the first file identifier in the component + foreach (Wix.File file in component[typeof(Wix.File)]) + { + firstFileId = file.Id; + break; + } + + if (string.IsNullOrEmpty(firstFileId)) + { + firstFileId = this.GetGuid(); + } + + component.Id = identifierGenerator.GetIdentifier(firstFileId); + } + + if (null == component.Guid) + { + if (this.AutogenerateGuids) + { + component.Guid = "*"; + } + else + { + component.Guid = this.GetGuid(); + } + } + + if (this.createFragments && component.ParentElement is Wix.Directory) + { + Wix.Directory directory = (Wix.Directory)component.ParentElement; + + // parent directory must have an identifier to create a reference to it + if (null == directory.Id) + { + break; + } + + if (this.rootElement is Wix.Module) + { + // add a ComponentRef for the Component + Wix.ComponentRef componentRef = new Wix.ComponentRef(); + componentRef.Id = component.Id; + this.rootElement.AddChild(componentRef); + } + + // create a new Fragment + Wix.Fragment fragment = new Wix.Fragment(); + this.fragments.Add(String.Concat("Component:", (null != component.Id ? component.Id : this.fragments.Count.ToString())), fragment); + + // create a new DirectoryRef + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = directory.Id; + fragment.AddChild(directoryRef); + + // move the Component from the the Directory to the DirectoryRef + directory.RemoveChild(component); + directoryRef.AddChild(component); + } + } + } + + /// + /// Mutate the directories. + /// + private void MutateDirectories() + { + if (!this.setUniqueIdentifiers) + { + // assign all identifiers before fragmenting (because fragmenting requires them all to be present) + IdentifierGenerator identifierGenerator = new IdentifierGenerator("Directory", this.Core); + if (TemplateType.Module == this.templateType) + { + identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; + } + + foreach (Wix.Directory directory in this.directories) + { + if (null == directory.Id) + { + directory.Id = identifierGenerator.GetIdentifier(directory.Name); + } + } + } + + if (this.createFragments) + { + foreach (Wix.Directory directory in this.directories) + { + if (directory.ParentElement is Wix.Directory) + { + Wix.Directory parentDirectory = (Wix.Directory)directory.ParentElement; + + // parent directory must have an identifier to create a reference to it + if (null == parentDirectory.Id) + { + return; + } + + // create a new Fragment + Wix.Fragment fragment = new Wix.Fragment(); + this.fragments.Add(String.Concat("Directory:", ("TARGETDIR" == directory.Id ? null : (null != directory.Id ? directory.Id : this.fragments.Count.ToString()))), fragment); + + // create a new DirectoryRef + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = parentDirectory.Id; + fragment.AddChild(directoryRef); + + // move the Directory from the parent Directory to DirectoryRef + parentDirectory.RemoveChild(directory); + directoryRef.AddChild(directory); + } + else if (directory.ParentElement is Wix.Fragment) + { + // When creating fragments, remove any top-level Directory elements; + // the fragments should be pulled in by their DirectoryRefs instead. + Wix.Fragment parent = (Wix.Fragment)directory.ParentElement; + parent.RemoveChild(directory); + + // Remove the fragment if it is empty. + if (parent.Children.GetEnumerator().Current == null && parent.ParentElement != null) + { + ((Wix.IParentElement)parent.ParentElement).RemoveChild(parent); + } + } + else if (directory.ParentElement == this.rootElement) + { + // create a new Fragment + Wix.Fragment fragment = new Wix.Fragment(); + this.fragments.Add(String.Concat("Directory:", ("TARGETDIR" == directory.Id ? null : (null != directory.Id ? directory.Id : this.fragments.Count.ToString()))), fragment); + + // move the Directory from the root element to the Fragment + this.rootElement.RemoveChild(directory); + fragment.AddChild(directory); + } + } + } + } + + /// + /// Mutate the files. + /// + private void MutateFiles() + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("File", this.Core); + if (TemplateType.Module == this.templateType) + { + identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; + } + + foreach (Wix.File file in this.files) + { + if (null == file.Id) + { + file.Id = identifierGenerator.GetIdentifier(Path.GetFileName(file.Source)); + } + } + } + + /// + /// Mutate a Wix element. + /// + /// The Wix element to mutate. + private void MutateWix(Wix.Wix wix) + { + if (TemplateType.Fragment != this.templateType) + { + if (null != this.rootElement || 0 != this.features.Count) + { + throw new Exception("The template option cannot be used with Feature, Package, or Module elements present."); + } + + // create a package element although it won't always be used + Wix.SummaryInformation package = new Wix.SummaryInformation(); + if (TemplateType.Module == this.templateType) + { + package.Id = this.GetGuid(); + } + else + { + package.Compressed = Wix.YesNoType.yes; + } + + package.InstallerVersion = 200; + + Wix.Directory targetDir = new Wix.Directory(); + targetDir.Id = "TARGETDIR"; + targetDir.Name = "SourceDir"; + + foreach (Wix.DirectoryRef directoryRef in this.directoryRefs) + { + if (String.Equals(directoryRef.Id, "TARGETDIR", StringComparison.OrdinalIgnoreCase)) + { + Wix.IParentElement parent = directoryRef.ParentElement as Wix.IParentElement; + + foreach (Wix.ISchemaElement element in directoryRef.Children) + { + targetDir.AddChild(element); + } + + parent.RemoveChild(directoryRef); + + if (null != ((Wix.ISchemaElement)parent).ParentElement) + { + int i = 0; + + foreach (Wix.ISchemaElement element in parent.Children) + { + i++; + } + + if (0 == i) + { + Wix.IParentElement supParent = (Wix.IParentElement)((Wix.ISchemaElement)parent).ParentElement; + supParent.RemoveChild((Wix.ISchemaElement)parent); + } + } + + break; + } + } + + if (TemplateType.Module == this.templateType) + { + Wix.Module module = new Wix.Module(); + module.Id = "PUT-MODULE-NAME-HERE"; + module.Language = "1033"; + module.Version = "1.0.0.0"; + + package.Manufacturer = "PUT-COMPANY-NAME-HERE"; + module.AddChild(package); + module.AddChild(targetDir); + + wix.AddChild(module); + this.rootElement = module; + } + else // product + { + Wix.Package product = new Wix.Package(); + product.Id = this.GetGuid(); + product.Language = "1033"; + product.Manufacturer = "PUT-COMPANY-NAME-HERE"; + product.Name = "PUT-PRODUCT-NAME-HERE"; + product.UpgradeCode = this.GetGuid(); + product.Version = "1.0.0.0"; + product.AddChild(package); + product.AddChild(targetDir); + + Wix.Media media = new Wix.Media(); + media.Id = "1"; + media.Cabinet = "product.cab"; + media.EmbedCab = Wix.YesNoType.yes; + product.AddChild(media); + + Wix.Feature feature = new Wix.Feature(); + feature.Id = "ProductFeature"; + feature.Title = "PUT-FEATURE-TITLE-HERE"; + feature.Level = 1; + product.AddChild(feature); + this.features.Add(feature); + + wix.AddChild(product); + this.rootElement = product; + } + } + } + + /// + /// Get a generated guid or a placeholder for a guid. + /// + /// A generated guid or placeholder. + private string GetGuid() + { + if (this.generateGuids) + { + return Guid.NewGuid().ToString(this.guidFormat, CultureInfo.InvariantCulture).ToUpper(CultureInfo.InvariantCulture); + } + else + { + return "PUT-GUID-HERE"; + } + } + } +} diff --git a/src/heat/UtilTransformMutator.cs b/src/heat/UtilTransformMutator.cs new file mode 100644 index 00000000..f4dda3c5 --- /dev/null +++ b/src/heat/UtilTransformMutator.cs @@ -0,0 +1,77 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using System.Xml; + using System.Xml.Xsl; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + internal class UtilTransformMutator : BaseMutatorExtension + { + private string transform; + private int transformSequence; + + /// + /// Instantiate a new UtilTransformMutator. + /// + /// Path to the XSL transform file. + /// Order in which the transform should be applied, + /// relative to other transforms. + public UtilTransformMutator(string transform, int transformSequence) + { + this.transform = transform; + this.transformSequence = transformSequence; + } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public override int Sequence + { + get { return 3000 + this.transformSequence; } + } + + /// + /// Mutate a WiX document as a string. + /// + /// The Wix document element as a string. + /// The mutated Wix document as a string. + public override string Mutate(string wixString) + { + try + { + XslCompiledTransform xslt = new XslCompiledTransform(); + xslt.Load(this.transform, XsltSettings.TrustedXslt, new XmlUrlResolver()); + + using (XmlTextReader xmlReader = new XmlTextReader(new StringReader(wixString))) + { + using (StringWriter stringWriter = new StringWriter()) + { + XmlWriterSettings xmlSettings = new XmlWriterSettings(); + xmlSettings.Indent = true; + xmlSettings.IndentChars = " "; + xmlSettings.OmitXmlDeclaration = true; + + using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + xslt.Transform(xmlReader, xmlWriter); + } + + wixString = stringWriter.ToString(); + } + } + } + catch (Exception ex) + { + this.Core.Messaging.Write(HarvesterErrors.ErrorTransformingHarvestedWiX(this.transform, ex.Message)); + return null; + } + + return wixString; + } + } +} diff --git a/src/heat/VSHeatExtension.cs b/src/heat/VSHeatExtension.cs new file mode 100644 index 00000000..7c0539bf --- /dev/null +++ b/src/heat/VSHeatExtension.cs @@ -0,0 +1,229 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// Defines generated element types. + /// + internal enum GenerateType + { + /// Generate Components. + Components, + + /// Generate a Container with Payloads. + Container, + + /// Generate a Bundle PackageGroups. + PackageGroup, + + /// Generate a PayloadGroup with Payloads. + PayloadGroup, + } + + /// + /// VS-related extensions for the WiX Toolset Harvester application. + /// + internal class VSHeatExtension : BaseHeatExtension + { + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public override HeatCommandLineOption[] CommandLineTypes + { + get + { + return new HeatCommandLineOption[] + { + new HeatCommandLineOption("project", "harvest outputs of a VS project"), + new HeatCommandLineOption("-configuration", "configuration to set when harvesting the project"), + new HeatCommandLineOption("-directoryid", "overridden directory id for generated directory elements"), + new HeatCommandLineOption("-generate", Environment.NewLine + + " specify what elements to generate, one of:" + Environment.NewLine + + " components, container, payloadgroup, packagegroup" + Environment.NewLine + + " (default is components)"), + new HeatCommandLineOption("-msbuildbinpath", "msbuild bin directory path"), + new HeatCommandLineOption("-platform", "platform to set when harvesting the project"), + new HeatCommandLineOption("-pog", Environment.NewLine + + " specify output group of VS project, one of:" + Environment.NewLine + + " " + String.Join(",", VSProjectHarvester.GetOutputGroupNames()) + Environment.NewLine + + " This option may be repeated for multiple output groups."), + new HeatCommandLineOption("-projectname", "overridden project name to use in variables"), + new HeatCommandLineOption("-usetoolsversion", "ignore msbuildbinpath if project specifies known msbuild version"), + new HeatCommandLineOption("-wixvar", "generate binder variables instead of preprocessor variables"), + }; + } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public override void ParseOptions(string type, string[] args) + { + if ("project" == type) + { + string[] allOutputGroups = VSProjectHarvester.GetOutputGroupNames(); + bool suppressUniqueId = false; + bool generateWixVars = false; + bool useToolsVersion = false; + GenerateType generateType = GenerateType.Components; + string directoryIds = null; + string msbuildBinPath = null; + string projectName = null; + string configuration = null; + string platform = null; + ArrayList outputGroups = new ArrayList(); + + for (int i = 0; i < args.Length; i++) + { + if ("-configuration" == args[i]) + { + configuration = args[++i]; + } + else if ("-directoryid" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidDirectoryId(args[i])); + } + + directoryIds = args[i]; + } + else if ("-generate" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidProjectOutputType(args[i])); + } + + string genType = args[i].ToUpperInvariant(); + switch(genType) + { + case "CONTAINER": + generateType = GenerateType.Container; + break; + case "COMPONENTS": + generateType = GenerateType.Components; + break; + case "PACKAGEGROUP": + generateType = GenerateType.PackageGroup; + break; + case "PAYLOADGROUP": + generateType = GenerateType.PayloadGroup; + break; + default: + throw new WixException(HarvesterErrors.InvalidProjectOutputType(genType)); + } + } + else if ("-msbuildbinpath" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.ArgumentRequiresValue(args[i-1])); + } + + msbuildBinPath = args[i]; + } + else if ("-platform" == args[i]) + { + platform = args[++i]; + } + else if ("-pog" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(args[i])); + } + + string pogName = args[i]; + bool found = false; + foreach (string availableOutputGroup in allOutputGroups) + { + if (String.Equals(pogName, availableOutputGroup, StringComparison.Ordinal)) + { + outputGroups.Add(availableOutputGroup); + found = true; + break; + } + } + + if (!found) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(pogName)); + } + } + else if (args[i].StartsWith("-pog:", StringComparison.Ordinal)) + { + this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("pog:", "pog")); + + string pogName = args[i].Substring(5); + bool found = false; + foreach (string availableOutputGroup in allOutputGroups) + { + if (String.Equals(pogName, availableOutputGroup, StringComparison.Ordinal)) + { + outputGroups.Add(availableOutputGroup); + found = true; + break; + } + } + + if (!found) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(pogName)); + } + } + else if ("-projectname" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidProjectName(args[i])); + } + + projectName = args[i]; + } + else if ("-suid" == args[i]) + { + suppressUniqueId = true; + } + else if ("-usetoolsversion" == args[i]) + { + useToolsVersion = true; + } + else if ("-wixvar" == args[i]) + { + generateWixVars = true; + } + } + + if (outputGroups.Count == 0) + { + throw new WixException(HarvesterErrors.NoOutputGroupSpecified()); + } + + VSProjectHarvester harvester = new VSProjectHarvester( + (string[]) outputGroups.ToArray(typeof(string))); + + harvester.SetUniqueIdentifiers = !suppressUniqueId; + harvester.GenerateWixVars = generateWixVars; + harvester.GenerateType = generateType; + harvester.DirectoryIds = directoryIds; + harvester.MsbuildBinPath = msbuildBinPath; + harvester.ProjectName = projectName; + harvester.Configuration = configuration; + harvester.Platform = platform; + harvester.UseToolsVersion = String.IsNullOrEmpty(msbuildBinPath) || useToolsVersion; + + this.Core.Harvester.Extension = harvester; + } + } + } +} diff --git a/src/heat/VSProjectHarvester.cs b/src/heat/VSProjectHarvester.cs new file mode 100644 index 00000000..115ee828 --- /dev/null +++ b/src/heat/VSProjectHarvester.cs @@ -0,0 +1,1455 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using System.Reflection; + using System.Collections; + using System.Collections.Generic; + using System.Globalization; + using System.Text.RegularExpressions; + using System.Xml; + using WixToolset.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for the outputs of a VS project. + /// + internal class VSProjectHarvester : BaseHarvesterExtension + { + // These format strings are used for generated element identifiers. + // {0} = project name + // {1} = POG name + // {2} = file name + private const string DirectoryIdFormat = "{0}.{1}"; + private const string ComponentIdFormat = "{0}.{1}.{2}"; + private const string FileIdFormat = "{0}.{1}.{2}"; + private const string VariableFormat = "$(var.{0}.{1})"; + private const string WixVariableFormat = "!(wix.{0}.{1})"; + + private const string ComponentPrefix = "cmp"; + private const string DirectoryPrefix = "dir"; + private const string FilePrefix = "fil"; + + private string projectGUID; + private string directoryIds; + private string directoryRefSeed; + private string projectName; + private string configuration; + private string platform; + private bool setUniqueIdentifiers; + private GenerateType generateType; + private bool generateWixVars; + + + private static readonly ProjectOutputGroup[] allOutputGroups = new ProjectOutputGroup[] + { + new ProjectOutputGroup("Binaries", "BuiltProjectOutputGroup", "TargetDir"), + new ProjectOutputGroup("Symbols", "DebugSymbolsProjectOutputGroup", "TargetDir"), + new ProjectOutputGroup("Documents", "DocumentationProjectOutputGroup", "ProjectDir"), + new ProjectOutputGroup("Satellites", "SatelliteDllsProjectOutputGroup", "TargetDir"), + new ProjectOutputGroup("Sources", "SourceFilesProjectOutputGroup", "ProjectDir"), + new ProjectOutputGroup("Content", "ContentFilesProjectOutputGroup", "ProjectDir"), + }; + + private string[] outputGroups; + + /// + /// Instantiate a new VSProjectHarvester. + /// + /// List of project output groups to harvest. + public VSProjectHarvester(string[] outputGroups) + { + if (outputGroups == null) + { + throw new ArgumentNullException("outputGroups"); + } + + this.outputGroups = outputGroups; + } + + /// + /// Gets or sets the configuration to set when harvesting. + /// + /// The configuration to set when harvesting. + public string Configuration + { + get { return this.configuration; } + set { this.configuration = value; } + } + + public string DirectoryIds + { + get { return this.directoryIds; } + set { this.directoryIds = value; } + } + + /// + /// Gets or sets what type of elements are to be generated. + /// + /// The type of elements being generated. + public GenerateType GenerateType + { + get { return this.generateType; } + set { this.generateType = value; } + } + + /// + /// Gets or sets whether or not to use wix variables. + /// + /// Whether or not to use wix variables. + public bool GenerateWixVars + { + get { return this.generateWixVars; } + set { this.generateWixVars = value; } + } + + /// + /// Gets or sets the location to load MSBuild from. + /// + public string MsbuildBinPath { get; set; } + + /// + /// Gets or sets the platform to set when harvesting. + /// + /// The platform to set when harvesting. + public string Platform + { + get { return this.platform; } + set { this.platform = value; } + } + + /// + /// Gets or sets the project name to use in wix variables. + /// + /// The project name to use in wix variables. + public string ProjectName + { + get { return this.projectName; } + set { this.projectName = value; } + } + + /// + /// Gets or sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Gets or sets whether to ignore MsbuildBinPath when the project file specifies a known MSBuild version. + /// + public bool UseToolsVersion { get; set; } + + /// + /// Gets a list of friendly output group names that will be recognized on the command-line. + /// + /// Array of output group names. + public static string[] GetOutputGroupNames() + { + string[] names = new string[VSProjectHarvester.allOutputGroups.Length]; + for (int i = 0; i < names.Length; i++) + { + names[i] = VSProjectHarvester.allOutputGroups[i].Name; + } + return names; + } + + /// + /// Harvest a VS project. + /// + /// The path of the VS project file. + /// The harvested directory. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + if (!System.IO.File.Exists(argument)) + { + throw new FileNotFoundException(argument); + } + + // Match specified output group names to available POG structures + // and collect list of build output groups to pass to MSBuild. + ProjectOutputGroup[] pogs = new ProjectOutputGroup[this.outputGroups.Length]; + string[] buildOutputGroups = new string[this.outputGroups.Length]; + for (int i = 0; i < this.outputGroups.Length; i++) + { + foreach (ProjectOutputGroup pog in VSProjectHarvester.allOutputGroups) + { + if (pog.Name == this.outputGroups[i]) + { + pogs[i] = pog; + buildOutputGroups[i] = pog.BuildOutputGroup; + } + } + + if (buildOutputGroups[i] == null) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(this.outputGroups[i])); + } + } + + string projectFile = Path.GetFullPath(argument); + + IDictionary buildOutputs = this.GetProjectBuildOutputs(projectFile, buildOutputGroups); + + ArrayList fragmentList = new ArrayList(); + + for (int i = 0; i < pogs.Length; i++) + { + this.HarvestProjectOutputGroup(projectFile, buildOutputs, pogs[i], fragmentList); + } + + return (Wix.Fragment[]) fragmentList.ToArray(typeof(Wix.Fragment)); + } + + /// + /// Runs MSBuild on a project file to get the list of filenames for the specified output groups. + /// + /// VS MSBuild project file to load. + /// List of MSBuild output group names. + /// Dictionary mapping output group names to lists of filenames in the group. + private IDictionary GetProjectBuildOutputs(string projectFile, string[] buildOutputGroups) + { + MSBuildProject project = this.GetMsbuildProject(projectFile); + + project.Load(projectFile); + + IDictionary buildOutputs = new Hashtable(); + + string originalDirectory = System.IO.Directory.GetCurrentDirectory(); + System.IO.Directory.SetCurrentDirectory(Path.GetDirectoryName(projectFile)); + bool buildSuccess = false; + try + { + buildSuccess = project.Build(projectFile, buildOutputGroups, buildOutputs); + } + finally + { + System.IO.Directory.SetCurrentDirectory(originalDirectory); + } + + if (!buildSuccess) + { + throw new WixException(HarvesterErrors.BuildFailed()); + } + + this.projectGUID = project.GetEvaluatedProperty("ProjectGuid"); + + if (null == this.projectGUID) + { + throw new WixException(HarvesterErrors.BuildFailed()); + } + + IDictionary newDictionary = new Dictionary(); + foreach (string buildOutput in buildOutputs.Keys) + { + IEnumerable buildOutputFiles = buildOutputs[buildOutput] as IEnumerable; + + bool hasFiles = false; + + foreach (object file in buildOutputFiles) + { + hasFiles = true; + break; + } + + // Try the item group if no outputs + if (!hasFiles) + { + IEnumerable itemFiles = project.GetEvaluatedItemsByName(String.Concat(buildOutput, "Output")); + List itemFileList = new List(); + + // Get each BuildItem and add the file path to our list + foreach (object itemFile in itemFiles) + { + itemFileList.Add(project.GetBuildItem(itemFile)); + } + + // Use our list for this build output + newDictionary.Add(buildOutput, itemFileList); + } + else + { + newDictionary.Add(buildOutput, buildOutputFiles); + } + } + + return newDictionary; + } + + /// + /// Creates WiX fragments for files in one output group. + /// + /// VS MSBuild project file. + /// Dictionary of build outputs retrieved from an MSBuild run on the project file. + /// Project output group parameters. + /// List to which generated fragments will be added. + /// Count of harvested files. + private int HarvestProjectOutputGroup(string projectFile, IDictionary buildOutputs, ProjectOutputGroup pog, IList fragmentList) + { + string projectName = Path.GetFileNameWithoutExtension(projectFile); + string projectBaseDir = null; + + if (this.ProjectName != null) + { + projectName = this.ProjectName; + } + + string sanitizedProjectName = this.Core.CreateIdentifierFromFilename(projectName); + + Wix.IParentElement harvestParent; + + if (this.GenerateType == GenerateType.Container) + { + Wix.Container container = new Wix.Container(); + harvestParent = container; + + container.Name = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else if (this.GenerateType == GenerateType.PayloadGroup) + { + Wix.PayloadGroup payloadGroup = new Wix.PayloadGroup(); + harvestParent = payloadGroup; + + payloadGroup.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else if (this.GenerateType == GenerateType.PackageGroup) + { + Wix.PackageGroup packageGroup = new Wix.PackageGroup(); + harvestParent = packageGroup; + + packageGroup.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else + { + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + harvestParent = directoryRef; + + if (!String.IsNullOrEmpty(this.directoryIds)) + { + directoryRef.Id = this.directoryIds; + } + else if (this.setUniqueIdentifiers) + { + directoryRef.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else + { + directoryRef.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name)); + } + + this.directoryRefSeed = this.Core.GenerateIdentifier(DirectoryPrefix, this.projectGUID, pog.Name); + } + + IEnumerable pogFiles = buildOutputs[pog.BuildOutputGroup] as IEnumerable; + if (pogFiles == null) + { + throw new WixException(HarvesterErrors.MissingProjectOutputGroup( + projectFile, pog.BuildOutputGroup)); + } + + if (pog.FileSource == "ProjectDir") + { + projectBaseDir = Path.GetDirectoryName(projectFile) + "\\"; + } + + int harvestCount = this.HarvestProjectOutputGroupFiles(projectBaseDir, projectName, pog.Name, pog.FileSource, pogFiles, harvestParent); + + if (this.GenerateType == GenerateType.Container) + { + // harvestParent must be a Container at this point + Wix.Container container = harvestParent as Wix.Container; + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(container); + fragmentList.Add(fragment); + } + else if (this.GenerateType == GenerateType.PackageGroup) + { + // harvestParent must be a PackageGroup at this point + Wix.PackageGroup packageGroup = harvestParent as Wix.PackageGroup; + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(packageGroup); + fragmentList.Add(fragment); + } + else if (this.GenerateType == GenerateType.PayloadGroup) + { + // harvestParent must be a Container at this point + Wix.PayloadGroup payloadGroup = harvestParent as Wix.PayloadGroup; + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(payloadGroup); + fragmentList.Add(fragment); + } + else + { + // harvestParent must be a DirectoryRef at this point + Wix.DirectoryRef directoryRef = harvestParent as Wix.DirectoryRef; + + if (harvestCount > 0) + { + Wix.Fragment drf = new Wix.Fragment(); + drf.AddChild(directoryRef); + fragmentList.Add(drf); + } + + Wix.ComponentGroup cg = new Wix.ComponentGroup(); + + if (this.setUniqueIdentifiers || !String.IsNullOrEmpty(this.directoryIds)) + { + cg.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else + { + cg.Id = directoryRef.Id; + } + + if (harvestCount > 0) + { + this.AddComponentsToComponentGroup(directoryRef, cg); + } + + Wix.Fragment cgf = new Wix.Fragment(); + cgf.AddChild(cg); + fragmentList.Add(cgf); + } + + return harvestCount; + } + + /// + /// Add all Components in an element tree to a ComponentGroup. + /// + /// Parent of an element tree that will be searched for Components. + /// The ComponentGroup the Components will be added to. + private void AddComponentsToComponentGroup(Wix.IParentElement parent, Wix.ComponentGroup cg) + { + foreach (Wix.ISchemaElement childElement in parent.Children) + { + Wix.Component c = childElement as Wix.Component; + if (c != null) + { + Wix.ComponentRef cr = new Wix.ComponentRef(); + cr.Id = c.Id; + cg.AddChild(cr); + } + else + { + Wix.IParentElement p = childElement as Wix.IParentElement; + if (p != null) + { + this.AddComponentsToComponentGroup(p, cg); + } + } + } + } + + /// + /// Harvest files from one output group of a VS project. + /// + /// The base directory of the files. + /// Name of the project, to be used as a prefix for generated identifiers. + /// Name of the project output group, used for generating identifiers for WiX elements. + /// The ProjectOutputGroup file source. + /// The files from one output group to harvest. + /// The parent element that will contain the components of the harvested files. + /// The number of files harvested. + private int HarvestProjectOutputGroupFiles(string baseDir, string projectName, string pogName, string pogFileSource, IEnumerable outputGroupFiles, Wix.IParentElement parent) + { + int fileCount = 0; + + Wix.ISchemaElement exeFile = null; + Wix.ISchemaElement dllFile = null; + Wix.ISchemaElement appConfigFile = null; + + // Keep track of files inserted + // Files can have different absolute paths but get mapped to the same SourceFile + // after the project variables have been used. For example, a WiX project that + // is building multiple cultures will have many output MSIs/MSMs, but will all get + // mapped to $(var.ProjName.TargetDir)\ProjName.msm. These duplicates would + // prevent generated code from compiling. + Dictionary seenList = new Dictionary(); + + foreach (object output in outputGroupFiles) + { + string filePath = output.ToString(); + string fileName = Path.GetFileName(filePath); + string fileDir = Path.GetDirectoryName(filePath); + string link = null; + + MethodInfo getMetadataMethod = output.GetType().GetMethod("GetMetadata"); + if (getMetadataMethod != null) + { + link = (string)getMetadataMethod.Invoke(output, new object[] { "Link" }); + if (!String.IsNullOrEmpty(link)) + { + fileDir = Path.GetDirectoryName(Path.Combine(baseDir, link)); + } + } + + Wix.IParentElement parentDir = parent; + // Ignore Containers and PayloadGroups because they do not have a nested structure. + if (baseDir != null && !String.Equals(Path.GetDirectoryName(baseDir), fileDir, StringComparison.OrdinalIgnoreCase) + && this.GenerateType != GenerateType.Container && this.GenerateType != GenerateType.PackageGroup && this.GenerateType != GenerateType.PayloadGroup) + { + Uri baseUri = new Uri(baseDir); + Uri relativeUri = baseUri.MakeRelativeUri(new Uri(fileDir)); + parentDir = this.GetSubDirElement(parentDir, relativeUri); + } + + string parentDirId = null; + + if (parentDir is Wix.DirectoryRef) + { + parentDirId = this.directoryRefSeed; + } + else if (parentDir is Wix.Directory) + { + parentDirId = ((Wix.Directory)parentDir).Id; + } + + if (this.GenerateType == GenerateType.Container || this.GenerateType == GenerateType.PayloadGroup) + { + Wix.Payload payload = new Wix.Payload(); + + this.HarvestProjectOutputGroupPayloadFile(baseDir, projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, payload, seenList); + } + else if (this.GenerateType == GenerateType.PackageGroup) + { + this.HarvestProjectOutputGroupPackage(projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, seenList); + } + else + { + Wix.Component component = new Wix.Component(); + Wix.File file = new Wix.File(); + + this.HarvestProjectOutputGroupFile(baseDir, projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, parentDirId, component, file, seenList); + + if (String.Equals(Path.GetExtension(file.Source), ".exe", StringComparison.OrdinalIgnoreCase)) + { + exeFile = file; + } + else if (String.Equals(Path.GetExtension(file.Source), ".dll", StringComparison.OrdinalIgnoreCase)) + { + dllFile = file; + } + else if (file.Source.EndsWith("app.config", StringComparison.OrdinalIgnoreCase)) + { + appConfigFile = file; + } + } + + fileCount++; + } + + // if there was no exe file found fallback on the dll file found + if (exeFile == null && dllFile != null) + { + exeFile = dllFile; + } + + // Special case for the app.config file in the Binaries POG... + // The POG refers to the files in the OBJ directory, while the + // generated WiX code references them in the bin directory. + // The app.config file gets renamed to match the exe name. + if ("Binaries" == pogName && null != exeFile && null != appConfigFile) + { + if (appConfigFile is Wix.File) + { + Wix.File appConfigFileAsWixFile = appConfigFile as Wix.File; + Wix.File exeFileAsWixFile = exeFile as Wix.File; + // Case insensitive replace + appConfigFileAsWixFile.Source = Regex.Replace(appConfigFileAsWixFile.Source, @"app\.config", Path.GetFileName(exeFileAsWixFile.Source) + ".config", RegexOptions.IgnoreCase); + } + } + + return fileCount; + } + + private void HarvestProjectOutputGroupFile(string baseDir, string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, string parentDirId, Wix.Component component, Wix.File file, Dictionary seenList) + { + string varFormat = VariableFormat; + if (this.generateWixVars) + { + varFormat = WixVariableFormat; + } + + if (pogName.Equals("Satellites", StringComparison.OrdinalIgnoreCase)) + { + Wix.Directory locDirectory = new Wix.Directory(); + + locDirectory.Name = Path.GetFileName(Path.GetDirectoryName(Path.GetFullPath(filePath))); + file.Source = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", locDirectory.Name, "\\", Path.GetFileName(filePath)); + + if (!seenList.ContainsKey(file.Source)) + { + parentDir.AddChild(locDirectory); + locDirectory.AddChild(component); + component.AddChild(file); + seenList.Add(file.Source, true); + + if (this.setUniqueIdentifiers) + { + locDirectory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, parentDirId, locDirectory.Name); + file.Id = this.Core.GenerateIdentifier(FilePrefix, locDirectory.Id, fileName); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, locDirectory.Id, file.Id); + } + else + { + locDirectory.Id = this.Core.CreateIdentifierFromFilename(String.Format(DirectoryIdFormat, (parentDir is Wix.DirectoryRef) ? ((Wix.DirectoryRef)parentDir).Id : parentDirId, locDirectory.Name)); + file.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.FileIdFormat, projectName, pogName, String.Concat(locDirectory.Name, ".", fileName))); + component.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.ComponentIdFormat, projectName, pogName, String.Concat(locDirectory.Name, ".", fileName))); + } + } + } + else + { + file.Source = GenerateSourceFilePath(baseDir, projectName, pogFileSource, filePath, link, varFormat); + + if (!seenList.ContainsKey(file.Source)) + { + component.AddChild(file); + parentDir.AddChild(component); + seenList.Add(file.Source, true); + + if (this.setUniqueIdentifiers) + { + file.Id = this.Core.GenerateIdentifier(FilePrefix, parentDirId, fileName); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, parentDirId, file.Id); + } + else + { + file.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.FileIdFormat, projectName, pogName, fileName)); + component.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.ComponentIdFormat, projectName, pogName, fileName)); + } + } + } + } + + private void HarvestProjectOutputGroupPackage(string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, Dictionary seenList) + { + string varFormat = VariableFormat; + if (this.generateWixVars) + { + varFormat = WixVariableFormat; + } + + if (pogName.Equals("Binaries", StringComparison.OrdinalIgnoreCase)) + { + if (String.Equals(Path.GetExtension(filePath), ".exe", StringComparison.OrdinalIgnoreCase)) + { + Wix.ExePackage exePackage = new Wix.ExePackage(); + exePackage.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); + if (!seenList.ContainsKey(exePackage.SourceFile)) + { + parentDir.AddChild(exePackage); + seenList.Add(exePackage.SourceFile, true); + } + } + else if (String.Equals(Path.GetExtension(filePath), ".msi", StringComparison.OrdinalIgnoreCase)) + { + Wix.MsiPackage msiPackage = new Wix.MsiPackage(); + msiPackage.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); + if (!seenList.ContainsKey(msiPackage.SourceFile)) + { + parentDir.AddChild(msiPackage); + seenList.Add(msiPackage.SourceFile, true); + } + } + } + } + + private void HarvestProjectOutputGroupPayloadFile(string baseDir, string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, Wix.Payload file, Dictionary seenList) + { + string varFormat = VariableFormat; + if (this.generateWixVars) + { + varFormat = WixVariableFormat; + } + + if (pogName.Equals("Satellites", StringComparison.OrdinalIgnoreCase)) + { + string locDirectoryName = Path.GetFileName(Path.GetDirectoryName(Path.GetFullPath(filePath))); + file.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", locDirectoryName, "\\", Path.GetFileName(filePath)); + + if (!seenList.ContainsKey(file.SourceFile)) + { + parentDir.AddChild(file); + seenList.Add(file.SourceFile, true); + } + } + else + { + file.SourceFile = GenerateSourceFilePath(baseDir, projectName, pogFileSource, filePath, link, varFormat); + + if (!seenList.ContainsKey(file.SourceFile)) + { + parentDir.AddChild(file); + seenList.Add(file.SourceFile, true); + } + } + } + + /// + /// Helper function to generates a source file path when harvesting files. + /// + /// + /// + /// + /// + /// + /// + /// + private static string GenerateSourceFilePath(string baseDir, string projectName, string pogFileSource, string filePath, string link, string varFormat) + { + string ret; + + if (null == baseDir && !String.IsNullOrEmpty(link)) + { + // This needs to be the absolute path as a link can be located anywhere. + ret = filePath; + } + else if (null == baseDir) + { + ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); + } + else if (filePath.StartsWith(baseDir, StringComparison.OrdinalIgnoreCase)) + { + ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", filePath.Substring(baseDir.Length)); + } + else + { + // come up with a relative path to the file + Uri sourcePathUri = new Uri(filePath); + Uri baseDirUri = new Uri(baseDir); + Uri sourceRelativeUri = baseDirUri.MakeRelativeUri(sourcePathUri); + string relativePath = sourceRelativeUri.ToString().Replace('/', Path.DirectorySeparatorChar); + if (!sourceRelativeUri.UserEscaped) + { + relativePath = Uri.UnescapeDataString(relativePath); + } + + ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", relativePath); + } + + return ret; + } + + /// + /// Gets a Directory element corresponding to a relative subdirectory within the project, + /// either by locating a suitable existing Directory or creating a new one. + /// + /// The parent element which the subdirectory is relative to. + /// Relative path of the subdirectory. + /// Directory element for the relative path. + private Wix.IParentElement GetSubDirElement(Wix.IParentElement parentDir, Uri relativeUri) + { + string[] segments = relativeUri.ToString().Split('\\', '/'); + string firstSubDirName = Uri.UnescapeDataString(segments[0]); + DirectoryAttributeAccessor subDir = null; + + if (String.Equals(firstSubDirName, "..", StringComparison.Ordinal)) + { + return parentDir; + } + + Type directoryType; + Type directoryRefType; + if (parentDir is Wix.Directory || parentDir is Wix.DirectoryRef) + { + directoryType = typeof(Wix.Directory); + directoryRefType = typeof(Wix.DirectoryRef); + } + else + { + throw new ArgumentException("GetSubDirElement parentDir"); + } + + // Search for an existing directory element. + foreach (Wix.ISchemaElement childElement in parentDir.Children) + { + if(VSProjectHarvester.AreTypesEquivalent(childElement.GetType(), directoryType)) + { + DirectoryAttributeAccessor childDir = new DirectoryAttributeAccessor(childElement); + if (String.Equals(childDir.Name, firstSubDirName, StringComparison.OrdinalIgnoreCase)) + { + subDir = childDir; + break; + } + } + } + + if (subDir == null) + { + string parentId = null; + DirectoryAttributeAccessor parentDirectory = null; + DirectoryAttributeAccessor parentDirectoryRef = null; + + if (VSProjectHarvester.AreTypesEquivalent(parentDir.GetType(), directoryType)) + { + parentDirectory = new DirectoryAttributeAccessor((Wix.ISchemaElement)parentDir); + } + else if (VSProjectHarvester.AreTypesEquivalent(parentDir.GetType(), directoryRefType)) + { + parentDirectoryRef = new DirectoryAttributeAccessor((Wix.ISchemaElement)parentDir); + } + + if (parentDirectory != null) + { + parentId = parentDirectory.Id; + } + else if (parentDirectoryRef != null) + { + if (this.setUniqueIdentifiers) + { + //Use the GUID of the project instead of the project name to help keep things stable. + parentId = this.directoryRefSeed; + } + else + { + parentId = parentDirectoryRef.Id; + } + } + + Wix.ISchemaElement newDirectory = (Wix.ISchemaElement)directoryType.GetConstructor(new Type[] { }).Invoke(null); + subDir = new DirectoryAttributeAccessor(newDirectory); + + if (this.setUniqueIdentifiers) + { + subDir.Id = this.Core.GenerateIdentifier(DirectoryPrefix, parentId, firstSubDirName); + } + else + { + subDir.Id = String.Format(DirectoryIdFormat, parentId, firstSubDirName); + } + + subDir.Name = firstSubDirName; + + parentDir.AddChild(subDir.Element); + } + + if (segments.Length == 1) + { + return subDir.ElementAsParent; + } + else + { + Uri nextRelativeUri = new Uri(Uri.UnescapeDataString(relativeUri.ToString()).Substring(firstSubDirName.Length + 1), UriKind.Relative); + return this.GetSubDirElement(subDir.ElementAsParent, nextRelativeUri); + } + } + + private MSBuildProject GetMsbuildProject(string projectFile) + { + XmlDocument document = new XmlDocument(); + try + { + document.Load(projectFile); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadProject(projectFile, e.Message)); + } + + string version = null; + + if (this.UseToolsVersion) + { + foreach (XmlNode child in document.ChildNodes) + { + if (String.Equals(child.Name, "Project", StringComparison.Ordinal) && child.Attributes != null) + { + XmlNode toolsVersionAttribute = child.Attributes["ToolsVersion"]; + if (toolsVersionAttribute != null) + { + version = toolsVersionAttribute.Value; + this.Core.Messaging.Write(HarvesterVerboses.FoundToolsVersion(version)); + + break; + } + } + } + + switch (version) + { + case "4.0": + version = "4.0.0.0"; + break; + case "12.0": + version = "12.0.0.0"; + break; + case "14.0": + version = "14.0.0.0"; + break; + default: + if (String.IsNullOrEmpty(this.MsbuildBinPath)) + { + throw new WixException(HarvesterErrors.MsbuildBinPathRequired(version ?? "(none)")); + } + + version = null; + break; + } + } + + var project = this.ConstructMsbuild40Project(version); + return project; + } + + private Assembly ResolveFromMsbuildBinPath(object sender, ResolveEventArgs args) + { + var assemblyName = new AssemblyName(args.Name); + + var assemblyPath = Path.Combine(this.MsbuildBinPath, $"{assemblyName.Name}.dll"); + if (!File.Exists(assemblyPath)) + { + return null; + } + + return Assembly.LoadFrom(assemblyPath); + } + + private MSBuildProject ConstructMsbuild40Project(string loadVersion) + { + const string MSBuildEngineAssemblyName = "Microsoft.Build, Version={0}, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + const string MSBuildFrameworkAssemblyName = "Microsoft.Build.Framework, Version={0}, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + Assembly msbuildAssembly; + Assembly msbuildFrameworkAssembly; + + if (loadVersion == null) + { + this.Core.Messaging.Write(HarvesterVerboses.LoadingProjectWithBinPath(this.MsbuildBinPath)); + AppDomain.CurrentDomain.AssemblyResolve += this.ResolveFromMsbuildBinPath; + + try + { + msbuildAssembly = Assembly.Load("Microsoft.Build"); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + + try + { + msbuildFrameworkAssembly = Assembly.Load("Microsoft.Build.Framework"); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + } + else + { + this.Core.Messaging.Write(HarvesterVerboses.LoadingProjectWithVersion(loadVersion)); + + try + { + msbuildAssembly = Assembly.Load(String.Format(MSBuildEngineAssemblyName, loadVersion)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + + try + { + msbuildFrameworkAssembly = Assembly.Load(String.Format(MSBuildFrameworkAssemblyName, loadVersion)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + } + + Type projectType; + Type buildItemType; + + Type buildManagerType; + Type buildParametersType; + Type buildRequestDataFlagsType; + Type buildRequestDataType; + Type hostServicesType; + Type projectCollectionType; + Type projectInstanceType; + + Type writeHandlerType; + Type colorSetterType; + Type colorResetterType; + Type loggerVerbosityType; + Type consoleLoggerType; + Type iLoggerType; + + try + { + buildItemType = msbuildAssembly.GetType("Microsoft.Build.Execution.ProjectItemInstance", true); + projectType = msbuildAssembly.GetType("Microsoft.Build.Evaluation.Project", true); + + buildManagerType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildManager", true); + buildParametersType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildParameters", true); + buildRequestDataFlagsType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildRequestDataFlags", true); + buildRequestDataType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildRequestData", true); + hostServicesType = msbuildAssembly.GetType("Microsoft.Build.Execution.HostServices", true); + projectCollectionType = msbuildAssembly.GetType("Microsoft.Build.Evaluation.ProjectCollection", true); + projectInstanceType = msbuildAssembly.GetType("Microsoft.Build.Execution.ProjectInstance", true); + + writeHandlerType = msbuildAssembly.GetType("Microsoft.Build.Logging.WriteHandler", true); + colorSetterType = msbuildAssembly.GetType("Microsoft.Build.Logging.ColorSetter", true); + colorResetterType = msbuildAssembly.GetType("Microsoft.Build.Logging.ColorResetter", true); + loggerVerbosityType = msbuildFrameworkAssembly.GetType("Microsoft.Build.Framework.LoggerVerbosity", true); + consoleLoggerType = msbuildAssembly.GetType("Microsoft.Build.Logging.ConsoleLogger", true); + iLoggerType = msbuildFrameworkAssembly.GetType("Microsoft.Build.Framework.ILogger", true); + } + catch (TargetInvocationException tie) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildEngine(tie.InnerException.Message)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildEngine(e.Message)); + } + + MSBuild40Types types = new MSBuild40Types(); + types.buildManagerType = buildManagerType; + types.buildParametersType = buildParametersType; + types.buildRequestDataFlagsType = buildRequestDataFlagsType; + types.buildRequestDataType = buildRequestDataType; + types.hostServicesType = hostServicesType; + types.projectCollectionType = projectCollectionType; + types.projectInstanceType = projectInstanceType; + types.writeHandlerType = writeHandlerType; + types.colorSetterType = colorSetterType; + types.colorResetterType = colorResetterType; + types.loggerVerbosityType = loggerVerbosityType; + types.consoleLoggerType = consoleLoggerType; + types.iLoggerType = iLoggerType; + return new MSBuild40Project(null, projectType, buildItemType, loadVersion, types, this.Core, this.configuration, this.platform); + } + + private static bool AreTypesEquivalent(Type a, Type b) + { + return (a == b) || (a.IsAssignableFrom(b) && b.IsAssignableFrom(a)); + } + + private abstract class MSBuildProject + { + protected Type projectType; + protected Type buildItemType; + protected object project; + private string loadVersion; + + public MSBuildProject(object project, Type projectType, Type buildItemType, string loadVersion) + { + this.project = project; + this.projectType = projectType; + this.buildItemType = buildItemType; + this.loadVersion = loadVersion; + } + + public string LoadVersion + { + get { return this.loadVersion; } + } + + public abstract bool Build(string projectFileName, string[] targetNames, IDictionary targetOutputs); + + public abstract MSBuildProjectItemType GetBuildItem(object buildItem); + + public abstract IEnumerable GetEvaluatedItemsByName(string itemName); + + public abstract string GetEvaluatedProperty(string propertyName); + + public abstract void Load(string projectFileName); + } + + private abstract class MSBuildProjectItemType + { + public MSBuildProjectItemType(object buildItem) + { + this.buildItem = buildItem; + } + + public abstract override string ToString(); + + public abstract string GetMetadata(string name); + + protected object buildItem; + } + + + private struct MSBuild40Types + { + public Type buildManagerType; + public Type buildParametersType; + public Type buildRequestDataFlagsType; + public Type buildRequestDataType; + public Type hostServicesType; + public Type projectCollectionType; + public Type projectInstanceType; + public Type writeHandlerType; + public Type colorSetterType; + public Type colorResetterType; + public Type loggerVerbosityType; + public Type consoleLoggerType; + public Type iLoggerType; + } + + private class MSBuild40Project : MSBuildProject + { + private MSBuild40Types types; + private object projectCollection; + private object currentProjectInstance; + private object buildManager; + private object buildParameters; + private IHarvesterCore harvesterCore; + + public MSBuild40Project(object project, Type projectType, Type buildItemType, string loadVersion, MSBuild40Types types, IHarvesterCore harvesterCore, string configuration, string platform) + : base(project, projectType, buildItemType, loadVersion) + { + this.types = types; + this.harvesterCore = harvesterCore; + + this.buildParameters = this.types.buildParametersType.GetConstructor(new Type[] { }).Invoke(null); + + try + { + var loggers = this.CreateLoggers(); + + // this.buildParameters.Loggers = loggers; + this.types.buildParametersType.GetProperty("Loggers").SetValue(this.buildParameters, loggers, null); + } + catch (TargetInvocationException tie) + { + if (this.harvesterCore != null) + { + this.harvesterCore.Messaging.Write(HarvesterWarnings.NoLogger(tie.InnerException.Message)); + } + } + catch (Exception e) + { + if (this.harvesterCore != null) + { + this.harvesterCore.Messaging.Write(HarvesterWarnings.NoLogger(e.Message)); + } + } + + this.buildManager = this.types.buildManagerType.GetConstructor(new Type[] { }).Invoke(null); + + if (configuration != null || platform != null) + { + Dictionary globalVariables = new Dictionary(); + if (configuration != null) + { + globalVariables.Add("Configuration", configuration); + } + + if (platform != null) + { + globalVariables.Add("Platform", platform); + } + + this.projectCollection = this.types.projectCollectionType.GetConstructor(new Type[] { typeof(IDictionary) }).Invoke(new object[] { globalVariables }); + } + else + { + this.projectCollection = this.types.projectCollectionType.GetConstructor(new Type[] {}).Invoke(null); + } + } + + private object CreateLoggers() + { + var logger = new HarvestLogger(this.harvesterCore.Messaging); + var loggerVerbosity = Enum.Parse(this.types.loggerVerbosityType, "Minimal"); + var writeHandler = Delegate.CreateDelegate(this.types.writeHandlerType, logger, nameof(logger.LogMessage)); + var colorSetter = Delegate.CreateDelegate(this.types.colorSetterType, logger, nameof(logger.SetColor)); + var colorResetter = Delegate.CreateDelegate(this.types.colorResetterType, logger, nameof(logger.ResetColor)); + + var consoleLoggerCtor = this.types.consoleLoggerType.GetConstructor(new Type[] { + this.types.loggerVerbosityType, + this.types.writeHandlerType, + this.types.colorSetterType, + this.types.colorResetterType, + }); + var consoleLogger = consoleLoggerCtor.Invoke(new object[] { loggerVerbosity, writeHandler, colorSetter, colorResetter }); + + var loggers = Array.CreateInstance(this.types.iLoggerType, 1); + loggers.SetValue(consoleLogger, 0); + + return loggers; + } + + public override bool Build(string projectFileName, string[] targetNames, IDictionary targetOutputs) + { + try + { + // this.buildManager.BeginBuild(this.buildParameters); + this.types.buildManagerType.GetMethod("BeginBuild", new Type[] { this.types.buildParametersType }).Invoke(this.buildManager, new object[] { this.buildParameters }); + + // buildRequestData = new BuildRequestData(this.currentProjectInstance, targetNames, null, BuildRequestData.BuildRequestDataFlags.ReplaceExistingProjectInstance); + ConstructorInfo buildRequestDataCtor = this.types.buildRequestDataType.GetConstructor( + new Type[] + { + this.types.projectInstanceType, typeof(string[]), this.types.hostServicesType, this.types.buildRequestDataFlagsType + }); + object buildRequestDataFlags = this.types.buildRequestDataFlagsType.GetField("ReplaceExistingProjectInstance").GetRawConstantValue(); + object buildRequestData = buildRequestDataCtor.Invoke(new object[] { this.currentProjectInstance, targetNames, null, buildRequestDataFlags }); + + // BuildSubmission submission = this.buildManager.PendBuildRequest(buildRequestData); + object submission = this.types.buildManagerType.GetMethod("PendBuildRequest", new Type[] { this.types.buildRequestDataType }) + .Invoke(this.buildManager, new object[] { buildRequestData }); + + // BuildResult buildResult = submission.Execute(); + object buildResult = submission.GetType().GetMethod("Execute", new Type[] { }).Invoke(submission, null); + + // bool buildSucceeded = buildResult.OverallResult == BuildResult.Success; + object overallResult = buildResult.GetType().GetProperty("OverallResult").GetValue(buildResult, null); + bool buildSucceeded = String.Equals(overallResult.ToString(), "Success", StringComparison.Ordinal); + + // this.buildManager.EndBuild(); + this.types.buildManagerType.GetMethod("EndBuild", new Type[] { }).Invoke(this.buildManager, null); + + // fill in empty lists for each target so that heat will look at the item group later + foreach (string target in targetNames) + { + targetOutputs.Add(target, new List()); + } + + return buildSucceeded; + } + catch (TargetInvocationException tie) + { + throw new WixException(HarvesterErrors.CannotBuildProject(projectFileName, tie.InnerException.Message)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotBuildProject(projectFileName, e.Message)); + } + } + + public override MSBuildProjectItemType GetBuildItem(object buildItem) + { + return new MSBuild40ProjectItemType(buildItem); + } + + public override IEnumerable GetEvaluatedItemsByName(string itemName) + { + MethodInfo getEvaluatedItem = this.types.projectInstanceType.GetMethod("GetItems", new Type[] { typeof(string) }); + return (IEnumerable)getEvaluatedItem.Invoke(this.currentProjectInstance, new object[] { itemName }); + } + + public override string GetEvaluatedProperty(string propertyName) + { + MethodInfo getProperty = this.types.projectInstanceType.GetMethod("GetPropertyValue", new Type[] { typeof(string) }); + return (string)getProperty.Invoke(this.currentProjectInstance, new object[] { propertyName }); + } + + public override void Load(string projectFileName) + { + try + { + //this.project = this.projectCollection.LoadProject(projectFileName); + this.project = this.types.projectCollectionType.GetMethod("LoadProject", new Type[] { typeof(string) }).Invoke(this.projectCollection, new object[] { projectFileName }); + + // this.currentProjectInstance = this.project.CreateProjectInstance(); + MethodInfo createProjectInstanceMethod = this.projectType.GetMethod("CreateProjectInstance", new Type[] { }); + this.currentProjectInstance = createProjectInstanceMethod.Invoke(this.project, null); + } + catch (TargetInvocationException tie) + { + throw new WixException(HarvesterErrors.CannotLoadProject(projectFileName, tie.InnerException.Message)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadProject(projectFileName, e.Message)); + } + } + } + + private class MSBuild40ProjectItemType : MSBuildProjectItemType + { + public MSBuild40ProjectItemType(object buildItem) + : base(buildItem) + { + } + + public override string ToString() + { + PropertyInfo includeProperty = this.buildItem.GetType().GetProperty("EvaluatedInclude"); + return (string)includeProperty.GetValue(this.buildItem, null); + } + + public override string GetMetadata(string name) + { + MethodInfo getMetadataMethod = this.buildItem.GetType().GetMethod("GetMetadataValue"); + if (null != getMetadataMethod) + { + return (string)getMetadataMethod.Invoke(this.buildItem, new object[] { name }); + } + return string.Empty; + } + } + + /// + /// Used internally in the VSProjectHarvester class to encapsulate + /// the settings for a particular MSBuild "project output group". + /// + private struct ProjectOutputGroup + { + public readonly string Name; + public readonly string BuildOutputGroup; + public readonly string FileSource; + + /// + /// Creates a new project output group. + /// + /// Friendly name used by heat. + /// MSBuild's name of the project output group. + /// VS directory token containing the files of the POG. + public ProjectOutputGroup(string name, string buildOutputGroup, string fileSource) + { + this.Name = name; + this.BuildOutputGroup = buildOutputGroup; + this.FileSource = fileSource; + } + } + + /// + /// Internal class for getting and setting common attrbiutes on + /// directory elements. + /// + internal class DirectoryAttributeAccessor + { + public Wix.ISchemaElement directoryElement; + + public DirectoryAttributeAccessor(Wix.ISchemaElement directoryElement) + { + this.directoryElement = directoryElement; + } + + /// + /// Gets the element as a ISchemaElement. + /// + public Wix.ISchemaElement Element + { + get { return this.directoryElement; } + } + + /// + /// Gets the element as a IParentElement. + /// + public Wix.IParentElement ElementAsParent + { + get { return (Wix.IParentElement)this.directoryElement; } + } + + /// + /// Gets or sets the Id attrbiute. + /// + public string Id + { + get + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + return wixDirectory.Id; + } + else if (this.directoryElement is Wix.DirectoryRef wixDirectoryRef) + { + return wixDirectoryRef.Id; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Id")); + } + } + set + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + wixDirectory.Id = value; + } + else if (this.directoryElement is Wix.DirectoryRef wixDirectoryRef) + { + wixDirectoryRef.Id = value; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Id")); + } + } + } + + /// + /// Gets or sets the Name attribute. + /// + public string Name + { + get + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + return wixDirectory.Name; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Name")); + } + } + set + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + wixDirectory.Name = value; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Name")); + } + } + } + } + + internal class HarvestLogger + { + public HarvestLogger(IMessaging messaging) + { + this.Color = ConsoleColor.Black; + this.Messaging = messaging; + } + + private ConsoleColor Color { get; set; } + private IMessaging Messaging { get; } + + public void LogMessage(string message) + { + if (this.Color == ConsoleColor.Red) + { + this.Messaging.Write(HarvesterErrors.BuildErrorDuringHarvesting(message)); + } + } + + public void SetColor(ConsoleColor color) + { + this.Color = color; + } + + public void ResetColor() + { + this.Color = ConsoleColor.Black; + } + } + } +} diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj index 08cf61c0..650203b0 100644 --- a/src/heat/heat.csproj +++ b/src/heat/heat.csproj @@ -20,13 +20,31 @@ + + + True + True + WixHarvesterStrings.resx + + + + + + ResXFileCodeGenerator + WixHarvesterStrings.Designer.cs + + + + + + - + diff --git a/src/test/WixToolsetTest.Heat/HeatRunner.cs b/src/test/WixToolsetTest.Heat/HeatRunner.cs new file mode 100644 index 00000000..287698a9 --- /dev/null +++ b/src/test/WixToolsetTest.Heat/HeatRunner.cs @@ -0,0 +1,92 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Harvesters +{ + using System; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Core; + using WixToolset.Core.Burn; + using WixToolset.Core.TestPackage; + using WixToolset.Data; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters; + + /// + /// Utility class to emulate heat.exe. + /// + public static class HeatRunner + { + /// + /// Emulates calling heat.exe. + /// + /// + /// + /// + /// + public static int Execute(string[] args, out List messages, bool warningsAsErrors = true) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var task = Execute(args, serviceProvider, out messages, warningsAsErrors: warningsAsErrors); + return task.Result; + } + + /// + /// Emulates calling wix.exe with standard backends. + /// This overload always treats warnings as errors. + /// + /// + /// + public static WixRunnerResult Execute(params string[] args) + { + return Execute(true, args); + } + + /// + /// Emulates calling wix.exe with standard backends. + /// + /// + /// + /// + public static WixRunnerResult Execute(bool warningsAsErrors, params string[] args) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var exitCode = Execute(args, serviceProvider, out var messages, warningsAsErrors: warningsAsErrors); + return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; + } + + /// + /// Emulates calling wix.exe with standard backends. + /// + /// + /// + /// + /// + /// + public static Task Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List messages, bool warningsAsErrors = true) + { + coreProvider.AddBundleBackend(); + + var listener = new TestMessageListener(); + + messages = listener.Messages; + + var messaging = coreProvider.GetService(); + messaging.SetListener(listener); + + if (warningsAsErrors) + { + messaging.WarningsAsError = true; + } + + var arguments = coreProvider.GetService(); + arguments.Populate(args); + + var commandLine = HeatCommandLineFactory.CreateCommandLine(coreProvider); + var command = commandLine.ParseStandardCommandLine(arguments); + return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); + } + } +} diff --git a/src/test/WixToolsetTest.Heat/PayloadTests.cs b/src/test/WixToolsetTest.Heat/PayloadTests.cs new file mode 100644 index 00000000..8072f50d --- /dev/null +++ b/src/test/WixToolsetTest.Heat/PayloadTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Harvesters +{ + using System; + using System.IO; + using WixBuildTools.TestSupport; + using Xunit; + + public class PayloadTests + { + [Fact] + public void CanHarvestExePackagePayload() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var outputFilePath = Path.Combine(baseFolder, "test.wxs"); + + var result = HeatRunner.Execute(new[] + { + "exepackagepayload", + Path.Combine(folder, ".Data", "burn.exe"), + "-o", outputFilePath, + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(outputFilePath)); + + var expected = File.ReadAllText(Path.Combine(folder, "Payload", "HarvestedExePackagePayload.wxs")).Replace("\r\n", "\n"); + var actual = File.ReadAllText(outputFilePath).Replace("\r\n", "\n"); + Assert.Equal(expected, actual); + } + } + + [Fact] + public void CanHarvestMsuPackagePayload() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var outputFilePath = Path.Combine(baseFolder, "test.wxs"); + + var result = HeatRunner.Execute(new[] + { + "msupackagepayload", + Path.Combine(folder, ".Data", "Windows8.1-KB2937592-x86.msu"), + "-o", outputFilePath, + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(outputFilePath)); + + var expected = File.ReadAllText(Path.Combine(folder, "Payload", "HarvestedMsuPackagePayload.wxs")).Replace("\r\n", "\n"); + var actual = File.ReadAllText(outputFilePath).Replace("\r\n", "\n"); + Assert.Equal(expected, actual); + } + } + } +} diff --git a/src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu b/src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu new file mode 100644 index 00000000..c39f53b0 Binary files /dev/null and b/src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu differ diff --git a/src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe b/src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe new file mode 100644 index 00000000..2a4f423f Binary files /dev/null and b/src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe differ diff --git a/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs b/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs new file mode 100644 index 00000000..40100f22 --- /dev/null +++ b/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs b/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs new file mode 100644 index 00000000..f203fe27 --- /dev/null +++ b/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj b/src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj new file mode 100644 index 00000000..4af6749c --- /dev/null +++ b/src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj @@ -0,0 +1,28 @@ + + + + + + netcoreapp3.1 + false + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3-55-g6feb From 03d5c46cbbb94f73ac468709345fc6a0e50def8d Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 22 Apr 2021 17:57:31 -0700 Subject: Move Tools into wix --- .editorconfig | 37 - README.md | 4 - Tools.sln | 105 - Tools.v3.ncrunchsolution | 6 - appveyor.cmd | 52 - appveyor.yml | 46 - nuget.config | 17 - src/.editorconfig | 37 + src/Directory.Build.props | 27 - src/Directory.Build.targets | 51 - src/Directory.csproj.props | 13 - src/Directory.csproj.targets | 26 - src/Directory.vcxproj.props | 111 - src/Directory.wixproj.props | 14 - src/ThmViewerPackage/Package.wxs | 30 - src/ThmViewerPackage/ThmViewerPackage.wixproj | 35 - src/ThmViewerPackage/packages.config | 4 - src/WixToolset.BuildTasks/AssemblyInfo.cs | 7 - src/WixToolset.BuildTasks/BuildException.cs | 26 - src/WixToolset.BuildTasks/Common.cs | 39 - src/WixToolset.BuildTasks/ConvertReferences.cs | 89 - .../CreateItemAvoidingInference.cs | 46 - .../CreateProjectReferenceDefineConstants.cs | 271 - .../FileSearchHelperMethods.cs | 56 - .../GenerateCompileWithObjectPath.cs | 145 - src/WixToolset.BuildTasks/GetCabList.cs | 81 - src/WixToolset.BuildTasks/GetLooseFileList.cs | 225 - src/WixToolset.BuildTasks/HeatDirectory.cs | 96 - src/WixToolset.BuildTasks/HeatFile.cs | 88 - src/WixToolset.BuildTasks/HeatProject.cs | 110 - src/WixToolset.BuildTasks/HeatTask.cs | 91 - src/WixToolset.BuildTasks/HeatTask_InProc.cs | 20 - src/WixToolset.BuildTasks/Insignia.cs | 120 - .../MsbuildMessageListener.cs | 68 - .../RefreshBundleGeneratedFile.cs | 128 - src/WixToolset.BuildTasks/RefreshGeneratedFile.cs | 114 - src/WixToolset.BuildTasks/ResolveWixReferences.cs | 212 - src/WixToolset.BuildTasks/ToolsetTask.cs | 153 - src/WixToolset.BuildTasks/ToolsetTask_InProc.cs | 79 - src/WixToolset.BuildTasks/WixAssignCulture.cs | 229 - src/WixToolset.BuildTasks/WixBuild.cs | 135 - src/WixToolset.BuildTasks/WixBuild_InProc.cs | 28 - src/WixToolset.BuildTasks/WixCommandLineBuilder.cs | 177 - .../WixToolset.BuildTasks.csproj | 39 - .../WixToolset.BuildTasks.net461.v3.ncrunchproject | 5 - ...lset.BuildTasks.netcoreapp2.1.v3.ncrunchproject | 5 - src/WixToolset.Sdk/Sdk/Sdk.props | 23 - src/WixToolset.Sdk/Sdk/Sdk.targets | 15 - src/WixToolset.Sdk/WixToolset.Sdk.csproj | 38 - src/WixToolset.Sdk/WixToolset.Sdk.nuspec | 18 - .../WixToolset.Sdk.v3.ncrunchproject | 5 - src/WixToolset.Sdk/build/WixToolset.Sdk.props | 8 - src/WixToolset.Sdk/tools/wix.ca.targets | 123 - src/WixToolset.Sdk/tools/wix.harvest.targets | 515 - src/WixToolset.Sdk/tools/wix.signing.targets | 370 - src/WixToolset.Sdk/tools/wix.targets | 1083 - src/dotnet-wix/DotnetToolSettings.xml | 6 - src/dotnet-wix/dotnet-wix.csproj | 28 - src/dotnet-wix/dotnet-wix.nuspec | 20 - src/dotnet-wix/dotnet-wix.v3.ncrunchproject | 5 - src/heat/AssemblyHarvester.cs | 41 - src/heat/Data/HarvesterErrors.cs | 205 - src/heat/Data/HarvesterVerboses.cs | 62 - src/heat/Data/HarvesterWarnings.cs | 79 - src/heat/Data/HeatCommandLineOption.cs | 31 - src/heat/Data/IHeatCommandLine.cs | 12 - src/heat/DirectoryHarvester.cs | 308 - src/heat/DllHarvester.cs | 106 - src/heat/Extensibility/BaseHarvesterExtension.cs | 26 - src/heat/Extensibility/BaseHeatExtension.cs | 55 - src/heat/Extensibility/BaseMutatorExtension.cs | 202 - src/heat/Extensibility/IHarvester.cs | 31 - src/heat/Extensibility/IHarvesterCore.cs | 51 - src/heat/Extensibility/IHarvesterExtension.cs | 14 - src/heat/Extensibility/IHeatCore.cs | 29 - src/heat/Extensibility/IHeatExtension.cs | 16 - src/heat/Extensibility/IMutator.cs | 44 - src/heat/Extensibility/IMutatorExtension.cs | 18 - src/heat/FileHarvester.cs | 156 - src/heat/Harvester.cs | 65 - src/heat/HarvesterCore.cs | 76 - src/heat/HeatCommand.cs | 275 - src/heat/HeatCommandLine.cs | 91 - src/heat/HeatCommandLineFactory.cs | 27 - src/heat/HeatCore.cs | 45 - src/heat/HelpCommand.cs | 97 - src/heat/IIsFinalizeHarvesterMutator.cs | 160 - src/heat/IIsHarvesterMutator.cs | 429 - src/heat/IIsHeatExtension.cs | 80 - src/heat/IIsWebSiteHarvester.cs | 439 - src/heat/Mutator.cs | 93 - src/heat/PayloadHarvester.cs | 129 - src/heat/PerformanceCategoryHarvester.cs | 207 - src/heat/Program.cs | 78 - src/heat/RegFileHarvester.cs | 438 - src/heat/RegistryHarvester.cs | 477 - src/heat/Serialize/CodeDomInterfaces.cs | 96 - src/heat/Serialize/CodeDomReader.cs | 162 - src/heat/Serialize/ElementCollection.cs | 618 - src/heat/Serialize/WixHarvesterStrings.Designer.cs | 153 - src/heat/Serialize/WixHarvesterStrings.resx | 150 - src/heat/Serialize/iis.cs | 5915 -- src/heat/Serialize/util.cs | 11462 ---- src/heat/Serialize/vs.cs | 1574 - src/heat/Serialize/wix.cs | 57740 ------------------- src/heat/TypeLibraryHarvester.cs | 93 - src/heat/UtilFinalizeHarvesterMutator.cs | 1185 - src/heat/UtilHarvesterMutator.cs | 218 - src/heat/UtilHeatExtension.cs | 405 - src/heat/UtilMutator.cs | 633 - src/heat/UtilTransformMutator.cs | 77 - src/heat/VSHeatExtension.cs | 229 - src/heat/VSProjectHarvester.cs | 1455 - src/heat/app.config | 10 - src/heat/heat.csproj | 54 - src/heat/heat.exe.manifest | 20 - src/heat/heat.net461.v3.ncrunchproject | 5 - src/heat/heat.netcoreapp2.1.v3.ncrunchproject | 5 - src/samples/ThmViewerPackage/Package.wxs | 30 + .../ThmViewerPackage/ThmViewerPackage.wixproj | 35 + src/samples/ThmViewerPackage/packages.config | 4 + src/samples/thmviewer/Resources/LoremIpsum.rtf | Bin 0 -> 4870 bytes src/samples/thmviewer/Resources/thm.xml | 11 + src/samples/thmviewer/display.cpp | 354 + src/samples/thmviewer/load.cpp | 221 + src/samples/thmviewer/packages.config | 8 + src/samples/thmviewer/precomp.cpp | 3 + src/samples/thmviewer/precomp.h | 70 + src/samples/thmviewer/resource.h | 16 + src/samples/thmviewer/thmviewer.cpp | 543 + src/samples/thmviewer/thmviewer.manifest | 19 + src/samples/thmviewer/thmviewer.rc | 12 + src/samples/thmviewer/thmviewer.v3.ncrunchproject | 7 + src/samples/thmviewer/thmviewer.vcxproj | 88 + src/samples/thmviewer/thmviewer.vcxproj.filters | 56 + .../WixBuildTaskFixture.cs | 67 - .../WixToolsetTest.BuildTasks.csproj | 35 - .../WixToolsetTest.BuildTasks.v3.ncrunchproject | 8 - src/test/WixToolsetTest.Heat/HeatRunner.cs | 92 - src/test/WixToolsetTest.Heat/PayloadTests.cs | 66 - .../TestData/.Data/Windows8.1-KB2937592-x86.msu | Bin 309544 -> 0 bytes .../WixToolsetTest.Heat/TestData/.Data/burn.exe | Bin 463360 -> 0 bytes .../Payload/HarvestedExePackagePayload.wxs | 6 - .../Payload/HarvestedMsuPackagePayload.wxs | 6 - .../WixToolsetTest.Heat/WixToolsetTest.Heat.csproj | 28 - src/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 442 - src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | 375 - src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs | 98 - src/test/WixToolsetTest.Sdk/README.md | 5 - .../HeatFileMultipleFilesSameFileName.wixproj | 58 - .../MyProgram.json | 1 - .../MyProgram.txt | 1 - .../HeatFileMultipleFilesSameFileName/Package.wxs | 18 - .../HeatFilePackage/HeatFilePackage.wixproj | 53 - .../TestData/HeatFilePackage/Package.wxs | 17 - .../HeatProjectPreSdkStyle.wixproj | 50 - .../HeatProject/HeatProjectPreSdkStyle/Package.wxs | 17 - .../HeatProjectSdkStyle.wixproj | 50 - .../HeatProject/HeatProjectSdkStyle/Package.wxs | 17 - .../TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs | 8 - .../HeatProject/SdkStyleCs/SdkStyleCs.csproj | 8 - .../ToolsVersion4Cs/Properties/AssemblyInfo.cs | 11 - .../ToolsVersion4Cs/ToolsVersion4Cs.csproj | 36 - .../MergeMsiPackage/MergeMsiPackage.wixproj | 44 - .../MergeModule/MergeMsiPackage/Package.wxs | 17 - .../MergeModule/SimpleMergeModule/MergeModule.wxs | 19 - .../SimpleMergeModule/SimpleMergeModule.wixproj | 42 - .../SimpleMergeModule/data/MergeModule.txt | 1 - .../MsiPackage/MsiPackage.wixproj | 50 - .../MsiPackage/Package.de-de.wxl | 11 - .../MsiPackage/Package.en-us.wxl | 11 - .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 16 - .../MsiPackage/PackageComponents.wxs | 10 - .../MsiPackage/data/test.txt | 1 - .../MultiCulturalMsiPackage.sln | 31 - .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 46 - .../SimpleMsiPackage/MsiPackage/Package.en-us.wxl | 11 - .../SimpleMsiPackage/MsiPackage/Package.wxs | 19 - .../MsiPackage/PackageComponents.wxs | 10 - .../SimpleMsiPackage/MsiPackage/data/test.txt | 1 - .../SimpleMsiPackage/SimpleBundle/Bundle.wxs | 11 - .../SimpleBundle/SimpleBundle.wixproj | 42 - .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 39 - .../SimpleMsiPackage/UncompressedBundle/Bundle.wxs | 11 - .../UncompressedBundle/UncompressedBundle.wixproj | 42 - .../WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj | 59 - .../WixToolsetTest.Sdk.v3.ncrunchproject | 8 - src/thmviewer/Resources/LoremIpsum.rtf | Bin 4870 -> 0 bytes src/thmviewer/Resources/thm.xml | 11 - src/thmviewer/display.cpp | 354 - src/thmviewer/load.cpp | 221 - src/thmviewer/packages.config | 8 - src/thmviewer/precomp.cpp | 3 - src/thmviewer/precomp.h | 70 - src/thmviewer/resource.h | 16 - src/thmviewer/thmviewer.cpp | 543 - src/thmviewer/thmviewer.manifest | 19 - src/thmviewer/thmviewer.rc | 12 - src/thmviewer/thmviewer.v3.ncrunchproject | 7 - src/thmviewer/thmviewer.vcxproj | 88 - src/thmviewer/thmviewer.vcxproj.filters | 56 - src/version.json | 11 + src/wix/ConsoleMessageListener.cs | 90 - src/wix/Directory.Build.props | 27 + src/wix/Directory.Build.targets | 51 + src/wix/Directory.csproj.props | 13 + src/wix/Directory.csproj.targets | 26 + src/wix/Directory.vcxproj.props | 111 + src/wix/Directory.wixproj.props | 14 + src/wix/Program.cs | 92 - src/wix/README-Tools.md | 4 + src/wix/Tools.sln | 105 + src/wix/Tools.v3.ncrunchsolution | 6 + src/wix/WixToolset.BuildTasks/AssemblyInfo.cs | 7 + src/wix/WixToolset.BuildTasks/BuildException.cs | 26 + src/wix/WixToolset.BuildTasks/Common.cs | 39 + src/wix/WixToolset.BuildTasks/ConvertReferences.cs | 89 + .../CreateItemAvoidingInference.cs | 46 + .../CreateProjectReferenceDefineConstants.cs | 271 + .../FileSearchHelperMethods.cs | 56 + .../GenerateCompileWithObjectPath.cs | 145 + src/wix/WixToolset.BuildTasks/GetCabList.cs | 81 + src/wix/WixToolset.BuildTasks/GetLooseFileList.cs | 225 + src/wix/WixToolset.BuildTasks/HeatDirectory.cs | 96 + src/wix/WixToolset.BuildTasks/HeatFile.cs | 88 + src/wix/WixToolset.BuildTasks/HeatProject.cs | 110 + src/wix/WixToolset.BuildTasks/HeatTask.cs | 91 + src/wix/WixToolset.BuildTasks/HeatTask_InProc.cs | 20 + src/wix/WixToolset.BuildTasks/Insignia.cs | 120 + .../MsbuildMessageListener.cs | 68 + .../RefreshBundleGeneratedFile.cs | 128 + .../WixToolset.BuildTasks/RefreshGeneratedFile.cs | 114 + .../WixToolset.BuildTasks/ResolveWixReferences.cs | 212 + src/wix/WixToolset.BuildTasks/ToolsetTask.cs | 153 + .../WixToolset.BuildTasks/ToolsetTask_InProc.cs | 79 + src/wix/WixToolset.BuildTasks/WixAssignCulture.cs | 229 + src/wix/WixToolset.BuildTasks/WixBuild.cs | 135 + src/wix/WixToolset.BuildTasks/WixBuild_InProc.cs | 28 + .../WixToolset.BuildTasks/WixCommandLineBuilder.cs | 177 + .../WixToolset.BuildTasks.csproj | 39 + .../WixToolset.BuildTasks.net461.v3.ncrunchproject | 5 + ...lset.BuildTasks.netcoreapp2.1.v3.ncrunchproject | 5 + src/wix/WixToolset.Sdk/Sdk/Sdk.props | 23 + src/wix/WixToolset.Sdk/Sdk/Sdk.targets | 15 + src/wix/WixToolset.Sdk/WixToolset.Sdk.csproj | 38 + src/wix/WixToolset.Sdk/WixToolset.Sdk.nuspec | 18 + .../WixToolset.Sdk.v3.ncrunchproject | 5 + src/wix/WixToolset.Sdk/build/WixToolset.Sdk.props | 8 + src/wix/WixToolset.Sdk/tools/wix.ca.targets | 123 + src/wix/WixToolset.Sdk/tools/wix.harvest.targets | 515 + src/wix/WixToolset.Sdk/tools/wix.signing.targets | 370 + src/wix/WixToolset.Sdk/tools/wix.targets | 1083 + src/wix/app.config | 8 - src/wix/appveyor-Tools.cmd | 52 + src/wix/appveyor-Tools.yml | 46 + src/wix/dotnet-wix/DotnetToolSettings.xml | 6 + src/wix/dotnet-wix/dotnet-wix.csproj | 28 + src/wix/dotnet-wix/dotnet-wix.nuspec | 20 + src/wix/dotnet-wix/dotnet-wix.v3.ncrunchproject | 5 + src/wix/heat/AssemblyHarvester.cs | 41 + src/wix/heat/Data/HarvesterErrors.cs | 205 + src/wix/heat/Data/HarvesterVerboses.cs | 62 + src/wix/heat/Data/HarvesterWarnings.cs | 79 + src/wix/heat/Data/HeatCommandLineOption.cs | 31 + src/wix/heat/Data/IHeatCommandLine.cs | 12 + src/wix/heat/DirectoryHarvester.cs | 308 + src/wix/heat/DllHarvester.cs | 106 + .../heat/Extensibility/BaseHarvesterExtension.cs | 26 + src/wix/heat/Extensibility/BaseHeatExtension.cs | 55 + src/wix/heat/Extensibility/BaseMutatorExtension.cs | 202 + src/wix/heat/Extensibility/IHarvester.cs | 31 + src/wix/heat/Extensibility/IHarvesterCore.cs | 51 + src/wix/heat/Extensibility/IHarvesterExtension.cs | 14 + src/wix/heat/Extensibility/IHeatCore.cs | 29 + src/wix/heat/Extensibility/IHeatExtension.cs | 16 + src/wix/heat/Extensibility/IMutator.cs | 44 + src/wix/heat/Extensibility/IMutatorExtension.cs | 18 + src/wix/heat/FileHarvester.cs | 156 + src/wix/heat/Harvester.cs | 65 + src/wix/heat/HarvesterCore.cs | 76 + src/wix/heat/HeatCommand.cs | 275 + src/wix/heat/HeatCommandLine.cs | 91 + src/wix/heat/HeatCommandLineFactory.cs | 27 + src/wix/heat/HeatCore.cs | 45 + src/wix/heat/HelpCommand.cs | 97 + src/wix/heat/IIsFinalizeHarvesterMutator.cs | 160 + src/wix/heat/IIsHarvesterMutator.cs | 429 + src/wix/heat/IIsHeatExtension.cs | 80 + src/wix/heat/IIsWebSiteHarvester.cs | 439 + src/wix/heat/Mutator.cs | 93 + src/wix/heat/PayloadHarvester.cs | 129 + src/wix/heat/PerformanceCategoryHarvester.cs | 207 + src/wix/heat/Program.cs | 78 + src/wix/heat/RegFileHarvester.cs | 438 + src/wix/heat/RegistryHarvester.cs | 477 + src/wix/heat/Serialize/CodeDomInterfaces.cs | 96 + src/wix/heat/Serialize/CodeDomReader.cs | 162 + src/wix/heat/Serialize/ElementCollection.cs | 618 + .../heat/Serialize/WixHarvesterStrings.Designer.cs | 153 + src/wix/heat/Serialize/WixHarvesterStrings.resx | 150 + src/wix/heat/Serialize/iis.cs | 5915 ++ src/wix/heat/Serialize/util.cs | 11462 ++++ src/wix/heat/Serialize/vs.cs | 1574 + src/wix/heat/Serialize/wix.cs | 57740 +++++++++++++++++++ src/wix/heat/TypeLibraryHarvester.cs | 93 + src/wix/heat/UtilFinalizeHarvesterMutator.cs | 1185 + src/wix/heat/UtilHarvesterMutator.cs | 218 + src/wix/heat/UtilHeatExtension.cs | 405 + src/wix/heat/UtilMutator.cs | 633 + src/wix/heat/UtilTransformMutator.cs | 77 + src/wix/heat/VSHeatExtension.cs | 229 + src/wix/heat/VSProjectHarvester.cs | 1455 + src/wix/heat/app.config | 10 + src/wix/heat/heat.csproj | 54 + src/wix/heat/heat.exe.manifest | 20 + src/wix/heat/heat.net461.v3.ncrunchproject | 5 + src/wix/heat/heat.netcoreapp2.1.v3.ncrunchproject | 5 + src/wix/nuget-Tools.config | 17 + .../WixBuildTaskFixture.cs | 67 + .../WixToolsetTest.BuildTasks.csproj | 35 + .../WixToolsetTest.BuildTasks.v3.ncrunchproject | 8 + src/wix/test/WixToolsetTest.Heat/HeatRunner.cs | 92 + src/wix/test/WixToolsetTest.Heat/PayloadTests.cs | 66 + .../TestData/.Data/Windows8.1-KB2937592-x86.msu | Bin 0 -> 309544 bytes .../WixToolsetTest.Heat/TestData/.Data/burn.exe | Bin 0 -> 463360 bytes .../Payload/HarvestedExePackagePayload.wxs | 6 + .../Payload/HarvestedMsuPackagePayload.wxs | 6 + .../WixToolsetTest.Heat/WixToolsetTest.Heat.csproj | 28 + src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs | 442 + .../test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs | 375 + .../test/WixToolsetTest.Sdk/MsbuildUtilities.cs | 98 + src/wix/test/WixToolsetTest.Sdk/README.md | 5 + .../HeatFileMultipleFilesSameFileName.wixproj | 58 + .../MyProgram.json | 1 + .../MyProgram.txt | 1 + .../HeatFileMultipleFilesSameFileName/Package.wxs | 18 + .../HeatFilePackage/HeatFilePackage.wixproj | 53 + .../TestData/HeatFilePackage/Package.wxs | 17 + .../HeatProjectPreSdkStyle.wixproj | 50 + .../HeatProject/HeatProjectPreSdkStyle/Package.wxs | 17 + .../HeatProjectSdkStyle.wixproj | 50 + .../HeatProject/HeatProjectSdkStyle/Package.wxs | 17 + .../TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs | 8 + .../HeatProject/SdkStyleCs/SdkStyleCs.csproj | 8 + .../ToolsVersion4Cs/Properties/AssemblyInfo.cs | 11 + .../ToolsVersion4Cs/ToolsVersion4Cs.csproj | 36 + .../MergeMsiPackage/MergeMsiPackage.wixproj | 44 + .../MergeModule/MergeMsiPackage/Package.wxs | 17 + .../MergeModule/SimpleMergeModule/MergeModule.wxs | 19 + .../SimpleMergeModule/SimpleMergeModule.wixproj | 42 + .../SimpleMergeModule/data/MergeModule.txt | 1 + .../MsiPackage/MsiPackage.wixproj | 50 + .../MsiPackage/Package.de-de.wxl | 11 + .../MsiPackage/Package.en-us.wxl | 11 + .../MultiCulturalMsiPackage/MsiPackage/Package.wxs | 16 + .../MsiPackage/PackageComponents.wxs | 10 + .../MsiPackage/data/test.txt | 1 + .../MultiCulturalMsiPackage.sln | 31 + .../SimpleMsiPackage/MsiPackage/MsiPackage.wixproj | 46 + .../SimpleMsiPackage/MsiPackage/Package.en-us.wxl | 11 + .../SimpleMsiPackage/MsiPackage/Package.wxs | 19 + .../MsiPackage/PackageComponents.wxs | 10 + .../SimpleMsiPackage/MsiPackage/data/test.txt | 1 + .../SimpleMsiPackage/SimpleBundle/Bundle.wxs | 11 + .../SimpleBundle/SimpleBundle.wixproj | 42 + .../TestData/SimpleMsiPackage/SimpleMsiPackage.sln | 39 + .../SimpleMsiPackage/UncompressedBundle/Bundle.wxs | 11 + .../UncompressedBundle/UncompressedBundle.wixproj | 42 + .../WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj | 59 + .../WixToolsetTest.Sdk.v3.ncrunchproject | 8 + src/wix/wix.csproj | 39 - src/wix/wix.exe.manifest | 18 - src/wix/wix.net461.v3.ncrunchproject | 5 - src/wix/wix.netcoreapp2.1.v3.ncrunchproject | 5 - src/wix/wix/ConsoleMessageListener.cs | 90 + src/wix/wix/Program.cs | 92 + src/wix/wix/app.config | 8 + src/wix/wix/wix.csproj | 39 + src/wix/wix/wix.exe.manifest | 18 + src/wix/wix/wix.net461.v3.ncrunchproject | 5 + src/wix/wix/wix.netcoreapp2.1.v3.ncrunchproject | 5 + version.json | 11 - 382 files changed, 96469 insertions(+), 96469 deletions(-) delete mode 100644 .editorconfig delete mode 100644 README.md delete mode 100644 Tools.sln delete mode 100644 Tools.v3.ncrunchsolution delete mode 100644 appveyor.cmd delete mode 100644 appveyor.yml delete mode 100644 nuget.config create mode 100644 src/.editorconfig delete mode 100644 src/Directory.Build.props delete mode 100644 src/Directory.Build.targets delete mode 100644 src/Directory.csproj.props delete mode 100644 src/Directory.csproj.targets delete mode 100644 src/Directory.vcxproj.props delete mode 100644 src/Directory.wixproj.props delete mode 100644 src/ThmViewerPackage/Package.wxs delete mode 100644 src/ThmViewerPackage/ThmViewerPackage.wixproj delete mode 100644 src/ThmViewerPackage/packages.config delete mode 100644 src/WixToolset.BuildTasks/AssemblyInfo.cs delete mode 100644 src/WixToolset.BuildTasks/BuildException.cs delete mode 100644 src/WixToolset.BuildTasks/Common.cs delete mode 100644 src/WixToolset.BuildTasks/ConvertReferences.cs delete mode 100644 src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs delete mode 100644 src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs delete mode 100644 src/WixToolset.BuildTasks/FileSearchHelperMethods.cs delete mode 100644 src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs delete mode 100644 src/WixToolset.BuildTasks/GetCabList.cs delete mode 100644 src/WixToolset.BuildTasks/GetLooseFileList.cs delete mode 100644 src/WixToolset.BuildTasks/HeatDirectory.cs delete mode 100644 src/WixToolset.BuildTasks/HeatFile.cs delete mode 100644 src/WixToolset.BuildTasks/HeatProject.cs delete mode 100644 src/WixToolset.BuildTasks/HeatTask.cs delete mode 100644 src/WixToolset.BuildTasks/HeatTask_InProc.cs delete mode 100644 src/WixToolset.BuildTasks/Insignia.cs delete mode 100644 src/WixToolset.BuildTasks/MsbuildMessageListener.cs delete mode 100644 src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs delete mode 100644 src/WixToolset.BuildTasks/RefreshGeneratedFile.cs delete mode 100644 src/WixToolset.BuildTasks/ResolveWixReferences.cs delete mode 100644 src/WixToolset.BuildTasks/ToolsetTask.cs delete mode 100644 src/WixToolset.BuildTasks/ToolsetTask_InProc.cs delete mode 100644 src/WixToolset.BuildTasks/WixAssignCulture.cs delete mode 100644 src/WixToolset.BuildTasks/WixBuild.cs delete mode 100644 src/WixToolset.BuildTasks/WixBuild_InProc.cs delete mode 100644 src/WixToolset.BuildTasks/WixCommandLineBuilder.cs delete mode 100644 src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj delete mode 100644 src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject delete mode 100644 src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject delete mode 100644 src/WixToolset.Sdk/Sdk/Sdk.props delete mode 100644 src/WixToolset.Sdk/Sdk/Sdk.targets delete mode 100644 src/WixToolset.Sdk/WixToolset.Sdk.csproj delete mode 100644 src/WixToolset.Sdk/WixToolset.Sdk.nuspec delete mode 100644 src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject delete mode 100644 src/WixToolset.Sdk/build/WixToolset.Sdk.props delete mode 100644 src/WixToolset.Sdk/tools/wix.ca.targets delete mode 100644 src/WixToolset.Sdk/tools/wix.harvest.targets delete mode 100644 src/WixToolset.Sdk/tools/wix.signing.targets delete mode 100644 src/WixToolset.Sdk/tools/wix.targets delete mode 100644 src/dotnet-wix/DotnetToolSettings.xml delete mode 100644 src/dotnet-wix/dotnet-wix.csproj delete mode 100644 src/dotnet-wix/dotnet-wix.nuspec delete mode 100644 src/dotnet-wix/dotnet-wix.v3.ncrunchproject delete mode 100644 src/heat/AssemblyHarvester.cs delete mode 100644 src/heat/Data/HarvesterErrors.cs delete mode 100644 src/heat/Data/HarvesterVerboses.cs delete mode 100644 src/heat/Data/HarvesterWarnings.cs delete mode 100644 src/heat/Data/HeatCommandLineOption.cs delete mode 100644 src/heat/Data/IHeatCommandLine.cs delete mode 100644 src/heat/DirectoryHarvester.cs delete mode 100644 src/heat/DllHarvester.cs delete mode 100644 src/heat/Extensibility/BaseHarvesterExtension.cs delete mode 100644 src/heat/Extensibility/BaseHeatExtension.cs delete mode 100644 src/heat/Extensibility/BaseMutatorExtension.cs delete mode 100644 src/heat/Extensibility/IHarvester.cs delete mode 100644 src/heat/Extensibility/IHarvesterCore.cs delete mode 100644 src/heat/Extensibility/IHarvesterExtension.cs delete mode 100644 src/heat/Extensibility/IHeatCore.cs delete mode 100644 src/heat/Extensibility/IHeatExtension.cs delete mode 100644 src/heat/Extensibility/IMutator.cs delete mode 100644 src/heat/Extensibility/IMutatorExtension.cs delete mode 100644 src/heat/FileHarvester.cs delete mode 100644 src/heat/Harvester.cs delete mode 100644 src/heat/HarvesterCore.cs delete mode 100644 src/heat/HeatCommand.cs delete mode 100644 src/heat/HeatCommandLine.cs delete mode 100644 src/heat/HeatCommandLineFactory.cs delete mode 100644 src/heat/HeatCore.cs delete mode 100644 src/heat/HelpCommand.cs delete mode 100644 src/heat/IIsFinalizeHarvesterMutator.cs delete mode 100644 src/heat/IIsHarvesterMutator.cs delete mode 100644 src/heat/IIsHeatExtension.cs delete mode 100644 src/heat/IIsWebSiteHarvester.cs delete mode 100644 src/heat/Mutator.cs delete mode 100644 src/heat/PayloadHarvester.cs delete mode 100644 src/heat/PerformanceCategoryHarvester.cs delete mode 100644 src/heat/Program.cs delete mode 100644 src/heat/RegFileHarvester.cs delete mode 100644 src/heat/RegistryHarvester.cs delete mode 100644 src/heat/Serialize/CodeDomInterfaces.cs delete mode 100644 src/heat/Serialize/CodeDomReader.cs delete mode 100644 src/heat/Serialize/ElementCollection.cs delete mode 100644 src/heat/Serialize/WixHarvesterStrings.Designer.cs delete mode 100644 src/heat/Serialize/WixHarvesterStrings.resx delete mode 100644 src/heat/Serialize/iis.cs delete mode 100644 src/heat/Serialize/util.cs delete mode 100644 src/heat/Serialize/vs.cs delete mode 100644 src/heat/Serialize/wix.cs delete mode 100644 src/heat/TypeLibraryHarvester.cs delete mode 100644 src/heat/UtilFinalizeHarvesterMutator.cs delete mode 100644 src/heat/UtilHarvesterMutator.cs delete mode 100644 src/heat/UtilHeatExtension.cs delete mode 100644 src/heat/UtilMutator.cs delete mode 100644 src/heat/UtilTransformMutator.cs delete mode 100644 src/heat/VSHeatExtension.cs delete mode 100644 src/heat/VSProjectHarvester.cs delete mode 100644 src/heat/app.config delete mode 100644 src/heat/heat.csproj delete mode 100644 src/heat/heat.exe.manifest delete mode 100644 src/heat/heat.net461.v3.ncrunchproject delete mode 100644 src/heat/heat.netcoreapp2.1.v3.ncrunchproject create mode 100644 src/samples/ThmViewerPackage/Package.wxs create mode 100644 src/samples/ThmViewerPackage/ThmViewerPackage.wixproj create mode 100644 src/samples/ThmViewerPackage/packages.config create mode 100644 src/samples/thmviewer/Resources/LoremIpsum.rtf create mode 100644 src/samples/thmviewer/Resources/thm.xml create mode 100644 src/samples/thmviewer/display.cpp create mode 100644 src/samples/thmviewer/load.cpp create mode 100644 src/samples/thmviewer/packages.config create mode 100644 src/samples/thmviewer/precomp.cpp create mode 100644 src/samples/thmviewer/precomp.h create mode 100644 src/samples/thmviewer/resource.h create mode 100644 src/samples/thmviewer/thmviewer.cpp create mode 100644 src/samples/thmviewer/thmviewer.manifest create mode 100644 src/samples/thmviewer/thmviewer.rc create mode 100644 src/samples/thmviewer/thmviewer.v3.ncrunchproject create mode 100644 src/samples/thmviewer/thmviewer.vcxproj create mode 100644 src/samples/thmviewer/thmviewer.vcxproj.filters delete mode 100644 src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs delete mode 100644 src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj delete mode 100644 src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject delete mode 100644 src/test/WixToolsetTest.Heat/HeatRunner.cs delete mode 100644 src/test/WixToolsetTest.Heat/PayloadTests.cs delete mode 100644 src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu delete mode 100644 src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe delete mode 100644 src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs delete mode 100644 src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs delete mode 100644 src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj delete mode 100644 src/test/WixToolsetTest.Sdk/MsbuildFixture.cs delete mode 100644 src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs delete mode 100644 src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs delete mode 100644 src/test/WixToolsetTest.Sdk/README.md delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs delete mode 100644 src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj delete mode 100644 src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj delete mode 100644 src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject delete mode 100644 src/thmviewer/Resources/LoremIpsum.rtf delete mode 100644 src/thmviewer/Resources/thm.xml delete mode 100644 src/thmviewer/display.cpp delete mode 100644 src/thmviewer/load.cpp delete mode 100644 src/thmviewer/packages.config delete mode 100644 src/thmviewer/precomp.cpp delete mode 100644 src/thmviewer/precomp.h delete mode 100644 src/thmviewer/resource.h delete mode 100644 src/thmviewer/thmviewer.cpp delete mode 100644 src/thmviewer/thmviewer.manifest delete mode 100644 src/thmviewer/thmviewer.rc delete mode 100644 src/thmviewer/thmviewer.v3.ncrunchproject delete mode 100644 src/thmviewer/thmviewer.vcxproj delete mode 100644 src/thmviewer/thmviewer.vcxproj.filters create mode 100644 src/version.json delete mode 100644 src/wix/ConsoleMessageListener.cs create mode 100644 src/wix/Directory.Build.props create mode 100644 src/wix/Directory.Build.targets create mode 100644 src/wix/Directory.csproj.props create mode 100644 src/wix/Directory.csproj.targets create mode 100644 src/wix/Directory.vcxproj.props create mode 100644 src/wix/Directory.wixproj.props delete mode 100644 src/wix/Program.cs create mode 100644 src/wix/README-Tools.md create mode 100644 src/wix/Tools.sln create mode 100644 src/wix/Tools.v3.ncrunchsolution create mode 100644 src/wix/WixToolset.BuildTasks/AssemblyInfo.cs create mode 100644 src/wix/WixToolset.BuildTasks/BuildException.cs create mode 100644 src/wix/WixToolset.BuildTasks/Common.cs create mode 100644 src/wix/WixToolset.BuildTasks/ConvertReferences.cs create mode 100644 src/wix/WixToolset.BuildTasks/CreateItemAvoidingInference.cs create mode 100644 src/wix/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs create mode 100644 src/wix/WixToolset.BuildTasks/FileSearchHelperMethods.cs create mode 100644 src/wix/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs create mode 100644 src/wix/WixToolset.BuildTasks/GetCabList.cs create mode 100644 src/wix/WixToolset.BuildTasks/GetLooseFileList.cs create mode 100644 src/wix/WixToolset.BuildTasks/HeatDirectory.cs create mode 100644 src/wix/WixToolset.BuildTasks/HeatFile.cs create mode 100644 src/wix/WixToolset.BuildTasks/HeatProject.cs create mode 100644 src/wix/WixToolset.BuildTasks/HeatTask.cs create mode 100644 src/wix/WixToolset.BuildTasks/HeatTask_InProc.cs create mode 100644 src/wix/WixToolset.BuildTasks/Insignia.cs create mode 100644 src/wix/WixToolset.BuildTasks/MsbuildMessageListener.cs create mode 100644 src/wix/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs create mode 100644 src/wix/WixToolset.BuildTasks/RefreshGeneratedFile.cs create mode 100644 src/wix/WixToolset.BuildTasks/ResolveWixReferences.cs create mode 100644 src/wix/WixToolset.BuildTasks/ToolsetTask.cs create mode 100644 src/wix/WixToolset.BuildTasks/ToolsetTask_InProc.cs create mode 100644 src/wix/WixToolset.BuildTasks/WixAssignCulture.cs create mode 100644 src/wix/WixToolset.BuildTasks/WixBuild.cs create mode 100644 src/wix/WixToolset.BuildTasks/WixBuild_InProc.cs create mode 100644 src/wix/WixToolset.BuildTasks/WixCommandLineBuilder.cs create mode 100644 src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj create mode 100644 src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject create mode 100644 src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject create mode 100644 src/wix/WixToolset.Sdk/Sdk/Sdk.props create mode 100644 src/wix/WixToolset.Sdk/Sdk/Sdk.targets create mode 100644 src/wix/WixToolset.Sdk/WixToolset.Sdk.csproj create mode 100644 src/wix/WixToolset.Sdk/WixToolset.Sdk.nuspec create mode 100644 src/wix/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject create mode 100644 src/wix/WixToolset.Sdk/build/WixToolset.Sdk.props create mode 100644 src/wix/WixToolset.Sdk/tools/wix.ca.targets create mode 100644 src/wix/WixToolset.Sdk/tools/wix.harvest.targets create mode 100644 src/wix/WixToolset.Sdk/tools/wix.signing.targets create mode 100644 src/wix/WixToolset.Sdk/tools/wix.targets delete mode 100644 src/wix/app.config create mode 100644 src/wix/appveyor-Tools.cmd create mode 100644 src/wix/appveyor-Tools.yml create mode 100644 src/wix/dotnet-wix/DotnetToolSettings.xml create mode 100644 src/wix/dotnet-wix/dotnet-wix.csproj create mode 100644 src/wix/dotnet-wix/dotnet-wix.nuspec create mode 100644 src/wix/dotnet-wix/dotnet-wix.v3.ncrunchproject create mode 100644 src/wix/heat/AssemblyHarvester.cs create mode 100644 src/wix/heat/Data/HarvesterErrors.cs create mode 100644 src/wix/heat/Data/HarvesterVerboses.cs create mode 100644 src/wix/heat/Data/HarvesterWarnings.cs create mode 100644 src/wix/heat/Data/HeatCommandLineOption.cs create mode 100644 src/wix/heat/Data/IHeatCommandLine.cs create mode 100644 src/wix/heat/DirectoryHarvester.cs create mode 100644 src/wix/heat/DllHarvester.cs create mode 100644 src/wix/heat/Extensibility/BaseHarvesterExtension.cs create mode 100644 src/wix/heat/Extensibility/BaseHeatExtension.cs create mode 100644 src/wix/heat/Extensibility/BaseMutatorExtension.cs create mode 100644 src/wix/heat/Extensibility/IHarvester.cs create mode 100644 src/wix/heat/Extensibility/IHarvesterCore.cs create mode 100644 src/wix/heat/Extensibility/IHarvesterExtension.cs create mode 100644 src/wix/heat/Extensibility/IHeatCore.cs create mode 100644 src/wix/heat/Extensibility/IHeatExtension.cs create mode 100644 src/wix/heat/Extensibility/IMutator.cs create mode 100644 src/wix/heat/Extensibility/IMutatorExtension.cs create mode 100644 src/wix/heat/FileHarvester.cs create mode 100644 src/wix/heat/Harvester.cs create mode 100644 src/wix/heat/HarvesterCore.cs create mode 100644 src/wix/heat/HeatCommand.cs create mode 100644 src/wix/heat/HeatCommandLine.cs create mode 100644 src/wix/heat/HeatCommandLineFactory.cs create mode 100644 src/wix/heat/HeatCore.cs create mode 100644 src/wix/heat/HelpCommand.cs create mode 100644 src/wix/heat/IIsFinalizeHarvesterMutator.cs create mode 100644 src/wix/heat/IIsHarvesterMutator.cs create mode 100644 src/wix/heat/IIsHeatExtension.cs create mode 100644 src/wix/heat/IIsWebSiteHarvester.cs create mode 100644 src/wix/heat/Mutator.cs create mode 100644 src/wix/heat/PayloadHarvester.cs create mode 100644 src/wix/heat/PerformanceCategoryHarvester.cs create mode 100644 src/wix/heat/Program.cs create mode 100644 src/wix/heat/RegFileHarvester.cs create mode 100644 src/wix/heat/RegistryHarvester.cs create mode 100644 src/wix/heat/Serialize/CodeDomInterfaces.cs create mode 100644 src/wix/heat/Serialize/CodeDomReader.cs create mode 100644 src/wix/heat/Serialize/ElementCollection.cs create mode 100644 src/wix/heat/Serialize/WixHarvesterStrings.Designer.cs create mode 100644 src/wix/heat/Serialize/WixHarvesterStrings.resx create mode 100644 src/wix/heat/Serialize/iis.cs create mode 100644 src/wix/heat/Serialize/util.cs create mode 100644 src/wix/heat/Serialize/vs.cs create mode 100644 src/wix/heat/Serialize/wix.cs create mode 100644 src/wix/heat/TypeLibraryHarvester.cs create mode 100644 src/wix/heat/UtilFinalizeHarvesterMutator.cs create mode 100644 src/wix/heat/UtilHarvesterMutator.cs create mode 100644 src/wix/heat/UtilHeatExtension.cs create mode 100644 src/wix/heat/UtilMutator.cs create mode 100644 src/wix/heat/UtilTransformMutator.cs create mode 100644 src/wix/heat/VSHeatExtension.cs create mode 100644 src/wix/heat/VSProjectHarvester.cs create mode 100644 src/wix/heat/app.config create mode 100644 src/wix/heat/heat.csproj create mode 100644 src/wix/heat/heat.exe.manifest create mode 100644 src/wix/heat/heat.net461.v3.ncrunchproject create mode 100644 src/wix/heat/heat.netcoreapp2.1.v3.ncrunchproject create mode 100644 src/wix/nuget-Tools.config create mode 100644 src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs create mode 100644 src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj create mode 100644 src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject create mode 100644 src/wix/test/WixToolsetTest.Heat/HeatRunner.cs create mode 100644 src/wix/test/WixToolsetTest.Heat/PayloadTests.cs create mode 100644 src/wix/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu create mode 100644 src/wix/test/WixToolsetTest.Heat/TestData/.Data/burn.exe create mode 100644 src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs create mode 100644 src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs create mode 100644 src/wix/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs create mode 100644 src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs create mode 100644 src/wix/test/WixToolsetTest.Sdk/MsbuildUtilities.cs create mode 100644 src/wix/test/WixToolsetTest.Sdk/README.md create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs create mode 100644 src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj create mode 100644 src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject delete mode 100644 src/wix/wix.csproj delete mode 100644 src/wix/wix.exe.manifest delete mode 100644 src/wix/wix.net461.v3.ncrunchproject delete mode 100644 src/wix/wix.netcoreapp2.1.v3.ncrunchproject create mode 100644 src/wix/wix/ConsoleMessageListener.cs create mode 100644 src/wix/wix/Program.cs create mode 100644 src/wix/wix/app.config create mode 100644 src/wix/wix/wix.csproj create mode 100644 src/wix/wix/wix.exe.manifest create mode 100644 src/wix/wix/wix.net461.v3.ncrunchproject create mode 100644 src/wix/wix/wix.netcoreapp2.1.v3.ncrunchproject delete mode 100644 version.json diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 1d72e683..00000000 --- a/.editorconfig +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -# -# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig -# then update all of the repos. - -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true - -[*.{cs,vb}] -dotnet_sort_system_directives_first = true - -[*.cs] -csharp_indent_case_contents = true : error -csharp_indent_switch_labels = true : error -csharp_new_line_before_open_brace = all -csharp_prefer_braces = true : error -csharp_style_expression_bodied_methods = when_on_single_line : suggestion -csharp_style_expression_bodied_constructors = when_on_single_line : suggestion -csharp_style_expression_bodied_operators = when_on_single_line : suggestion -csharp_style_expression_bodied_properties = when_on_single_line : suggestion -csharp_style_expression_bodied_indexers = when_on_single_line : suggestion -csharp_style_expression_bodied_accessors = when_on_single_line : suggestion -csharp_style_var_elsewhere = true : suggestion -csharp_style_var_for_built_in_types = true : suggestion -csharp_style_var_when_type_is_apparent = true : suggestion -dotnet_style_qualification_for_event = true : error -dotnet_style_qualification_for_field = true : error -dotnet_style_qualification_for_method = true : error -dotnet_style_qualification_for_property = true : error - -[*.targets] -indent_size = 2 diff --git a/README.md b/README.md deleted file mode 100644 index a806dbde..00000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Tools - -Command line tools and MSBuild integration - diff --git a/Tools.sln b/Tools.sln deleted file mode 100644 index 23f8a4d9..00000000 --- a/Tools.sln +++ /dev/null @@ -1,105 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30011.22 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.BuildTasks", "src\test\WixToolsetTest.BuildTasks\WixToolsetTest.BuildTasks.csproj", "{4B0098A4-B581-4D04-BA1E-6DC2370A7D43}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wix", "src\wix\wix.csproj", "{DA5CA026-6165-48C4-BDA5-BB4B17D56A18}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.BuildTasks", "src\WixToolset.BuildTasks\WixToolset.BuildTasks.csproj", "{65141CE1-0BDD-41EF-8043-35B96C423CB6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-wix", "src\dotnet-wix\dotnet-wix.csproj", "{938BCA04-610B-4B99-9CB7-02BF7397A972}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Sdk", "src\WixToolset.Sdk\WixToolset.Sdk.csproj", "{0DF5D4CF-8457-469D-8288-13775E984F70}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{449BE9B0-422F-4039-A030-BDD3E7D97878}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thmviewer", "src\thmviewer\thmviewer.vcxproj", "{95228C13-97F5-484A-B4A2-ECF4618B0881}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "heat", "src\heat\heat.csproj", "{B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Sdk", "src\test\WixToolsetTest.Sdk\WixToolsetTest.Sdk.csproj", "{7B610B7B-C69D-4A4C-9D65-F304C44479E7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|x86.ActiveCfg = Debug|Any CPU - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|x86.Build.0 = Debug|Any CPU - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.Build.0 = Release|Any CPU - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|x86.ActiveCfg = Release|Any CPU - {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|x86.Build.0 = Release|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|x86.ActiveCfg = Debug|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|x86.Build.0 = Debug|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.Build.0 = Release|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|x86.ActiveCfg = Release|Any CPU - {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|x86.Build.0 = Release|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|x86.ActiveCfg = Debug|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|x86.Build.0 = Debug|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.Build.0 = Release|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|x86.ActiveCfg = Release|Any CPU - {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|x86.Build.0 = Release|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.Build.0 = Debug|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|x86.ActiveCfg = Debug|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|x86.Build.0 = Debug|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.ActiveCfg = Release|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.Build.0 = Release|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|x86.ActiveCfg = Release|Any CPU - {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|x86.Build.0 = Release|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|x86.ActiveCfg = Debug|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|x86.Build.0 = Debug|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.Build.0 = Release|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.ActiveCfg = Release|Any CPU - {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.Build.0 = Release|Any CPU - {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.Build.0 = Debug|Win32 - {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.ActiveCfg = Debug|Win32 - {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.Build.0 = Debug|Win32 - {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|Any CPU.ActiveCfg = Release|Win32 - {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.ActiveCfg = Release|Win32 - {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.Build.0 = Release|Win32 - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|x86.ActiveCfg = Debug|Any CPU - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|x86.Build.0 = Debug|Any CPU - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|Any CPU.Build.0 = Release|Any CPU - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.ActiveCfg = Release|Any CPU - {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.Build.0 = Release|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|x86.ActiveCfg = Debug|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|x86.Build.0 = Debug|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|Any CPU.Build.0 = Release|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|x86.ActiveCfg = Release|Any CPU - {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AEB88B8C-8C84-4E97-9886-30CBDD32B34B} - EndGlobalSection -EndGlobal diff --git a/Tools.v3.ncrunchsolution b/Tools.v3.ncrunchsolution deleted file mode 100644 index 10420ac9..00000000 --- a/Tools.v3.ncrunchsolution +++ /dev/null @@ -1,6 +0,0 @@ - - - True - True - - \ No newline at end of file diff --git a/appveyor.cmd b/appveyor.cmd deleted file mode 100644 index 504b2e9d..00000000 --- a/appveyor.cmd +++ /dev/null @@ -1,52 +0,0 @@ -@setlocal -@pushd %~dp0 -@set _C=Release -@if /i "%1"=="debug" set _C=Debug -@set _P=%~dp0build\%_C%\publish -@set _RCO=/S /R:1 /W:1 /NP /XO /NS /NC /NFL /NDL /NJH /NJS - -:: Restore -nuget restore || exit /b - -:: Build -msbuild -p:Configuration=%_C% || exit /b - -:: Test -dotnet test -c %_C% --no-build src\test\WixToolsetTest.BuildTasks || exit /b - -dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp3.1 src\wix || exit /b - -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix || exit /b -robocopy %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% /XF Microsoft.Build.*.dll -robocopy %_P%\WixToolset.Sdk\separate\net461\x86\heat %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% -robocopy %_P%\WixToolset.Sdk\separate\net461\x86\wix %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% - -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix || exit /b -robocopy %_P%\WixToolset.Sdk\separate\net461\x64\buildtasks %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% /XF Microsoft.Build.*.dll -robocopy %_P%\WixToolset.Sdk\separate\net461\x64\heat %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% -robocopy %_P%\WixToolset.Sdk\separate\net461\x64\wix %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% - -dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\buildtasks\ -f netcoreapp3.1 src\WixToolset.BuildTasks || exit /b -dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\heat\ -f netcoreapp3.1 src\heat || exit /b -dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\wix\ -f netcoreapp3.1 src\wix || exit /b -robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\buildtasks %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% /XF Microsoft.Build.*.dll -robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\heat %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% -robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\wix %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% - -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\ src\WixToolset.Sdk || exit /b -dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\broken\net461\ -f net461 -r linux-x64 src\wix || exit /b - -dotnet test -c %_C% src\test\WixToolsetTest.Sdk || exit /b - -:: Pack -dotnet pack -c %_C% src\dotnet-wix || exit /b -dotnet pack -c %_C% src\WixToolset.Sdk || exit /b - -msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj || exit /b - -@popd -@endlocal diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 8fea070e..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -# -# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml -# then update all of the repos. - -branches: - only: - - master - - develop - -image: Visual Studio 2019 - -version: 0.0.0.{build} -configuration: Release - -environment: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - NUGET_XMLDOC_MODE: skip - -build_script: - - appveyor.cmd - -test: off - -pull_requests: - do_not_increment_build_number: true - -nuget: - disable_publish_on_pr: true - -skip_branch_with_pr: true -skip_tags: true - -artifacts: -- path: build\Release\**\*.msi - name: msi -- path: build\Release\**\*.nupkg - name: nuget -- path: build\Release\**\*.snupkg - name: snupkg - -notifications: -- provider: Slack - incoming_webhook: - secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA= diff --git a/nuget.config b/nuget.config deleted file mode 100644 index 81117c3d..00000000 --- a/nuget.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 00000000..1d72e683 --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,37 @@ +# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig +# then update all of the repos. + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.{cs,vb}] +dotnet_sort_system_directives_first = true + +[*.cs] +csharp_indent_case_contents = true : error +csharp_indent_switch_labels = true : error +csharp_new_line_before_open_brace = all +csharp_prefer_braces = true : error +csharp_style_expression_bodied_methods = when_on_single_line : suggestion +csharp_style_expression_bodied_constructors = when_on_single_line : suggestion +csharp_style_expression_bodied_operators = when_on_single_line : suggestion +csharp_style_expression_bodied_properties = when_on_single_line : suggestion +csharp_style_expression_bodied_indexers = when_on_single_line : suggestion +csharp_style_expression_bodied_accessors = when_on_single_line : suggestion +csharp_style_var_elsewhere = true : suggestion +csharp_style_var_for_built_in_types = true : suggestion +csharp_style_var_when_type_is_apparent = true : suggestion +dotnet_style_qualification_for_event = true : error +dotnet_style_qualification_for_field = true : error +dotnet_style_qualification_for_method = true : error +dotnet_style_qualification_for_property = true : error + +[*.targets] +indent_size = 2 diff --git a/src/Directory.Build.props b/src/Directory.Build.props deleted file mode 100644 index b3c6287c..00000000 --- a/src/Directory.Build.props +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Debug - false - MSB3246 - - $(MSBuildProjectName) - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) - $(BaseOutputPath)obj\$(ProjectName)\ - $(BaseOutputPath)$(Configuration)\ - - WiX Toolset Team - WiX Toolset - Copyright (c) .NET Foundation and contributors. All rights reserved. - MS-RL - WiX Toolset - - - - - diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets deleted file mode 100644 index 2fcc765a..00000000 --- a/src/Directory.Build.targets +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - true - $(SolutionPath) - $(NCrunchOriginalSolutionPath) - - - - - - - $([System.IO.File]::ReadAllText($(TheSolutionPath))) - $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) - (?<="[PackageName]", ")(.*)(?=", ") - - - - - - %(Identity) - $(SolutionFileContent.Contains('\%(Identity).csproj')) - - - - - $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) - $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) - - - - - - - - - - - - - - diff --git a/src/Directory.csproj.props b/src/Directory.csproj.props deleted file mode 100644 index 81d24ad1..00000000 --- a/src/Directory.csproj.props +++ /dev/null @@ -1,13 +0,0 @@ - - - - - true - true - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) - false - - diff --git a/src/Directory.csproj.targets b/src/Directory.csproj.targets deleted file mode 100644 index c3270426..00000000 --- a/src/Directory.csproj.targets +++ /dev/null @@ -1,26 +0,0 @@ - - - - - false - $(OutputPath)\$(AssemblyName).xml - - - - - $(PrivateRepositoryUrl.Replace('.git','')) - - $(MSBuildProjectName).nuspec - $(OutputPath)..\ - $(NuspecProperties);Id=$(PackageId);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description);Title=$(Title) - $(NuspecProperties);Version=$(PackageVersion);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl);ProjectFolder=$(MSBuildProjectDirectory)\;ProjectUrl=$(ProjectUrl) - true - snupkg - - - - diff --git a/src/Directory.vcxproj.props b/src/Directory.vcxproj.props deleted file mode 100644 index bcf26c57..00000000 --- a/src/Directory.vcxproj.props +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Win32 - $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ - $(OutputPath)$(Platform)\ - - - $(Company) - $(Copyright) - - win-x86;win-x64;win-arm64 - native,Version=v0.0 - - - - $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) - - - - - $(DisableSpecificCompilerWarnings) - Level4 - $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - Use - precomp.h - StdCall - true - false - -YlprecompDefine - /Zc:threadSafeInit- %(AdditionalOptions) - true - - - $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) - $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) - - - $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) - - - $(ProjectSubSystem) - $(ProjectModuleDefinitionFile) - $(ResourceOnlyDll) - true - $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) - $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) - /IGNORE:4099 %(AdditionalOptions) - - - - - - NoExtensions - - - - - CDecl - - - - - OldStyle - true - true - - - - - Disabled - EnableFastChecks - _DEBUG;DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebug - - - - - - MultiThreadedDebugDll - - - - - MinSpace - NDEBUG;%(PreprocessorDefinitions) - true - true - MultiThreaded - - - true - true - - - - - - MultiThreadedDll - - - - - $(LinkKeyFile) - $(LinkDelaySign) - - - diff --git a/src/Directory.wixproj.props b/src/Directory.wixproj.props deleted file mode 100644 index a0aaa658..00000000 --- a/src/Directory.wixproj.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - $(DefineConstants);CompanyName=$(Company) - - - - - - - - diff --git a/src/ThmViewerPackage/Package.wxs b/src/ThmViewerPackage/Package.wxs deleted file mode 100644 index cb2139cf..00000000 --- a/src/ThmViewerPackage/Package.wxs +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ThmViewerPackage/ThmViewerPackage.wixproj b/src/ThmViewerPackage/ThmViewerPackage.wixproj deleted file mode 100644 index 23d24654..00000000 --- a/src/ThmViewerPackage/ThmViewerPackage.wixproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - 59c4b122-5167-445b-8fc4-09dcd4eced89 - thmviewer - Package - - - - - - - - - - - - - thmviewer - {95228C13-97F5-484A-B4A2-ECF4618B0881} - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - diff --git a/src/ThmViewerPackage/packages.config b/src/ThmViewerPackage/packages.config deleted file mode 100644 index 7e55f706..00000000 --- a/src/ThmViewerPackage/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/WixToolset.BuildTasks/AssemblyInfo.cs b/src/WixToolset.BuildTasks/AssemblyInfo.cs deleted file mode 100644 index ae52fce8..00000000 --- a/src/WixToolset.BuildTasks/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] diff --git a/src/WixToolset.BuildTasks/BuildException.cs b/src/WixToolset.BuildTasks/BuildException.cs deleted file mode 100644 index 953134ba..00000000 --- a/src/WixToolset.BuildTasks/BuildException.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Globalization; - - class BuildException : Exception - { - public BuildException() - { - } - - public BuildException(string message) : base(message) - { - } - - public BuildException(string message, Exception innerException) : base(message, innerException) - { - } - - public BuildException(string format, params string[] args) : this(String.Format(CultureInfo.CurrentCulture, format, args)) - { - } - } -} diff --git a/src/WixToolset.BuildTasks/Common.cs b/src/WixToolset.BuildTasks/Common.cs deleted file mode 100644 index c5b709c2..00000000 --- a/src/WixToolset.BuildTasks/Common.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Text.RegularExpressions; - - /// - /// Common WixTasks utility methods and types. - /// - public static class ToolsCommon - { - /// Metadata key name to turn off harvesting of project references. - public const string DoNotHarvest = "DoNotHarvest"; - - private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); - private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters - - /// - /// Return an identifier based on passed file/directory name - /// - /// File/directory name to generate identifer from - /// A version of the name that is a legal identifier. - /// This is duplicated from WiX's Common class. - public static string GetIdentifierFromName(string name) - { - string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". - - // MSI identifiers must begin with an alphabetic character or an - // underscore. Prefix all other values with an underscore. - if (AddPrefix.IsMatch(name)) - { - result = String.Concat("_", result); - } - - return result; - } - } -} diff --git a/src/WixToolset.BuildTasks/ConvertReferences.cs b/src/WixToolset.BuildTasks/ConvertReferences.cs deleted file mode 100644 index 3fdc78d1..00000000 --- a/src/WixToolset.BuildTasks/ConvertReferences.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// This task assigns Culture metadata to files based on the value of the Culture attribute on the - /// WixLocalization element inside the file. - /// - public class ConvertReferences : Task - { - private string projectOutputGroups; - private ITaskItem[] projectReferences; - private ITaskItem[] harvestItems; - - /// - /// The total list of cabs in this database - /// - [Output] - public ITaskItem[] HarvestItems - { - get { return this.harvestItems; } - } - - /// - /// The project output groups to harvest. - /// - [Required] - public string ProjectOutputGroups - { - get { return this.projectOutputGroups; } - set { this.projectOutputGroups = value; } - } - - /// - /// All the project references in the project. - /// - [Required] - public ITaskItem[] ProjectReferences - { - get { return this.projectReferences; } - set { this.projectReferences = value; } - } - - /// - /// Gets a complete list of external cabs referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - List newItems = new List(); - - foreach(ITaskItem item in this.ProjectReferences) - { - Dictionary newItemMetadeta = new Dictionary(); - - if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) - { - continue; - } - - string refTargetDir = item.GetMetadata("RefTargetDir"); - if (!String.IsNullOrEmpty(refTargetDir)) - { - newItemMetadeta.Add("DirectoryIds", refTargetDir); - } - - string refName = item.GetMetadata("Name"); - if (!String.IsNullOrEmpty(refName)) - { - newItemMetadeta.Add("ProjectName", refName); - } - - newItemMetadeta.Add("ProjectOutputGroups", this.ProjectOutputGroups); - - ITaskItem newItem = new TaskItem(item.ItemSpec, newItemMetadeta); - newItems.Add(newItem); - } - - this.harvestItems = newItems.ToArray(); - - return true; - } - } -} diff --git a/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs b/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs deleted file mode 100644 index 3441bd85..00000000 --- a/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// This task assigns Culture metadata to files based on the value of the Culture attribute on the - /// WixLocalization element inside the file. - /// - public class CreateItemAvoidingInference : Task - { - /// - /// The properties to converty to items. - /// - [Required] - public string InputProperties { get; set; } - - /// - /// The output items. - /// - [Output] - public ITaskItem[] OuputItems { get; private set; } - - /// - /// Gets a complete list of external cabs referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - var newItems = new List(); - - foreach (var property in this.InputProperties.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) - { - newItems.Add(new TaskItem(property)); - } - - this.OuputItems = newItems.ToArray(); - - return true; - } - } -} diff --git a/src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs b/src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs deleted file mode 100644 index 7cda6b01..00000000 --- a/src/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// An MSBuild task to create a list of preprocessor defines to be passed to candle from the - /// list of referenced projects. - /// - public sealed class CreateProjectReferenceDefineConstants : Task - { - private ITaskItem[] defineConstants; - private ITaskItem[] projectConfigurations; - private ITaskItem[] projectReferencePaths; - - [Output] - public ITaskItem[] DefineConstants - { - get { return this.defineConstants; } - } - - [Required] - public ITaskItem[] ProjectReferencePaths - { - get { return this.projectReferencePaths; } - set { this.projectReferencePaths = value; } - } - - public ITaskItem[] ProjectConfigurations - { - get { return this.projectConfigurations; } - set { this.projectConfigurations = value; } - } - - public override bool Execute() - { - List outputItems = new List(); - Dictionary defineConstants = new Dictionary(); - - for (int i = 0; i < this.ProjectReferencePaths.Length; i++) - { - ITaskItem item = this.ProjectReferencePaths[i]; - - string configuration = item.GetMetadata("Configuration"); - string fullConfiguration = item.GetMetadata("FullConfiguration"); - string platform = item.GetMetadata("Platform"); - - string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); - string projectDir = Path.GetDirectoryName(projectPath) + Path.DirectorySeparatorChar; - string projectExt = Path.GetExtension(projectPath); - string projectFileName = Path.GetFileName(projectPath); - string projectName = Path.GetFileNameWithoutExtension(projectPath); - - string referenceName = CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName); - - string targetPath = item.GetMetadata("FullPath"); - string targetDir = Path.GetDirectoryName(targetPath) + Path.DirectorySeparatorChar; - string targetExt = Path.GetExtension(targetPath); - string targetFileName = Path.GetFileName(targetPath); - string targetName = Path.GetFileNameWithoutExtension(targetPath); - - // If there is no configuration metadata on the project reference task item, - // check for any additional configuration data provided in the optional task property. - if (String.IsNullOrEmpty(fullConfiguration)) - { - fullConfiguration = this.FindProjectConfiguration(projectName); - if (!String.IsNullOrEmpty(fullConfiguration)) - { - string[] typeAndPlatform = fullConfiguration.Split('|'); - configuration = typeAndPlatform[0]; - platform = (typeAndPlatform.Length > 1 ? typeAndPlatform[1] : String.Empty); - } - } - - // write out the platform/configuration defines - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.Configuration", referenceName)] = configuration; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.FullConfiguration", referenceName)] = fullConfiguration; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.Platform", referenceName)] = platform; - - // write out the ProjectX defines - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectDir", referenceName)] = projectDir; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectExt", referenceName)] = projectExt; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectFileName", referenceName)] = projectFileName; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectName", referenceName)] = projectName; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectPath", referenceName)] = projectPath; - - // write out the TargetX defines - string targetDirDefine = String.Format(CultureInfo.InvariantCulture, "{0}.TargetDir", referenceName); - if (defineConstants.ContainsKey(targetDirDefine)) - { - //if target dir was already defined, redefine it as the common root shared by multiple references from the same project - string commonDir = FindCommonRoot(targetDir, defineConstants[targetDirDefine]); - if (!String.IsNullOrEmpty(commonDir)) - { - targetDir = commonDir; - } - } - defineConstants[targetDirDefine] = CreateProjectReferenceDefineConstants.EnsureEndsWithBackslash(targetDir); - - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetExt", referenceName)] = targetExt; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetFileName", referenceName)] = targetFileName; - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetName", referenceName)] = targetName; - - //if target path was already defined, append to it creating a list of multiple references from the same project - string targetPathDefine = String.Format(CultureInfo.InvariantCulture, "{0}.TargetPath", referenceName); - if (defineConstants.ContainsKey(targetPathDefine)) - { - string oldTargetPath = defineConstants[targetPathDefine]; - if (!targetPath.Equals(oldTargetPath, StringComparison.OrdinalIgnoreCase)) - { - defineConstants[targetPathDefine] += ";" + targetPath; - } - - //If there was only one targetpath we need to create its culture specific define - if (!oldTargetPath.Contains(";")) - { - string oldSubFolder = FindSubfolder(oldTargetPath, targetDir, targetFileName); - if (!String.IsNullOrEmpty(oldSubFolder)) - { - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.{1}.TargetPath", referenceName, oldSubFolder.Replace('\\', '_'))] = oldTargetPath; - } - } - - // Create a culture specific define - string subFolder = FindSubfolder(targetPath, targetDir, targetFileName); - if (!String.IsNullOrEmpty(subFolder)) - { - defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.{1}.TargetPath", referenceName, subFolder.Replace('\\', '_'))] = targetPath; - } - - } - else - { - defineConstants[targetPathDefine] = targetPath; - } - } - - foreach (KeyValuePair define in defineConstants) - { - outputItems.Add(new TaskItem(String.Format(CultureInfo.InvariantCulture, "{0}={1}", define.Key, define.Value))); - } - - this.defineConstants = outputItems.ToArray(); - - return true; - } - - public static string GetProjectPath(ITaskItem[] projectReferencePaths, int i) - { - return projectReferencePaths[i].GetMetadata("MSBuildSourceProjectFile"); - } - - public static string GetReferenceName(ITaskItem item, string projectName) - { - string referenceName = item.GetMetadata("Name"); - if (String.IsNullOrEmpty(referenceName)) - { - referenceName = projectName; - } - - // We cannot have an equals sign in the variable name because it - // messes with the preprocessor definitions on the command line. - referenceName = referenceName.Replace('=', '_'); - - // We cannot have a double quote on the command line because it - // there is no way to escape it on the command line. - referenceName = referenceName.Replace('\"', '_'); - - // We cannot have parens in the variable name because the WiX - // preprocessor will not be able to parse it. - referenceName = referenceName.Replace('(', '_'); - referenceName = referenceName.Replace(')', '_'); - - return referenceName; - } - - /// - /// Look through the configuration data in the ProjectConfigurations property - /// to find the configuration for a project, if available. - /// - /// Name of the project that is being searched for. - /// Full configuration spec, for example "Release|Win32". - private string FindProjectConfiguration(string projectName) - { - string configuration = String.Empty; - - if (this.ProjectConfigurations != null) - { - foreach (ITaskItem configItem in this.ProjectConfigurations) - { - string configProject = configItem.ItemSpec; - if (configProject.Length > projectName.Length && - configProject.StartsWith(projectName) && - configProject[projectName.Length] == '=') - { - configuration = configProject.Substring(projectName.Length + 1); - break; - } - } - } - - return configuration; - } - - /// - /// Finds the common root between two paths - /// - /// - /// - /// common root on success, empty string on failure - private static string FindCommonRoot(string path1, string path2) - { - path1 = path1.TrimEnd(Path.DirectorySeparatorChar); - path2 = path2.TrimEnd(Path.DirectorySeparatorChar); - - while (!String.IsNullOrEmpty(path1)) - { - for (string searchPath = path2; !String.IsNullOrEmpty(searchPath); searchPath = Path.GetDirectoryName(searchPath)) - { - if (path1.Equals(searchPath, StringComparison.OrdinalIgnoreCase)) - { - return searchPath; - } - } - - path1 = Path.GetDirectoryName(path1); - } - - return path1; - } - - /// - /// Finds the subfolder of a path, excluding a root and filename. - /// - /// Path to examine - /// Root that must be present - /// - /// - private static string FindSubfolder(string path, string rootPath, string fileName) - { - if (Path.GetFileName(path).Equals(fileName, StringComparison.OrdinalIgnoreCase)) - { - path = Path.GetDirectoryName(path); - } - - if (path.StartsWith(rootPath, StringComparison.OrdinalIgnoreCase)) - { - // cut out the root and return the subpath - return path.Substring(rootPath.Length).Trim(Path.DirectorySeparatorChar); - } - - return String.Empty; - } - - private static string EnsureEndsWithBackslash(string dir) - { - if (dir[dir.Length - 1] != Path.DirectorySeparatorChar) - { - dir += Path.DirectorySeparatorChar; - } - - return dir; - } - } -} diff --git a/src/WixToolset.BuildTasks/FileSearchHelperMethods.cs b/src/WixToolset.BuildTasks/FileSearchHelperMethods.cs deleted file mode 100644 index 397c9d7c..00000000 --- a/src/WixToolset.BuildTasks/FileSearchHelperMethods.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.IO; - - /// - /// Contains helper methods on searching for files - /// - public static class FileSearchHelperMethods - { - /// - /// Searches for the existence of a file in multiple directories. - /// Search is satisfied if default file path is valid and exists. If not, - /// file name is extracted from default path and combined with each of the directories - /// looking to see if it exists. If not found, input default path is returned. - /// - /// Array of directories to look in, without filenames in them - /// Default path - to use if not found - /// File path if file found. Empty string if not found - public static string SearchFilePaths(string[] directories, string defaultFullPath) - { - if (String.IsNullOrEmpty(defaultFullPath)) - { - return String.Empty; - } - - if (File.Exists(defaultFullPath)) - { - return defaultFullPath; - } - - if (directories == null) - { - return string.Empty; - } - - string fileName = Path.GetFileName(defaultFullPath); - foreach (string currentPath in directories) - { - if (String.IsNullOrEmpty(currentPath) || String.IsNullOrEmpty(currentPath.Trim())) - { - continue; - } - - if (File.Exists(Path.Combine(currentPath, fileName))) - { - return Path.Combine(currentPath, fileName); - } - } - - return String.Empty; - } - } -} diff --git a/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs b/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs deleted file mode 100644 index a5f76618..00000000 --- a/src/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.IO; - using System.Security.Cryptography; - using System.Text; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// This task generates metadata on the for compile output objects. - /// - public class GenerateCompileWithObjectPath : Task - { - /// - /// The list of files to generate outputs for. - /// - [Required] - public ITaskItem[] Compile - { - get; - set; - } - - /// - /// The list of files with ObjectPath metadata. - /// - [Output] - public ITaskItem[] CompileWithObjectPath - { - get; - private set; - } - - /// - /// The folder under which all ObjectPaths should reside. - /// - [Required] - public string IntermediateOutputPath - { - get; - set; - } - - /// - /// Generate an identifier by hashing data from the row. - /// - /// Three letter or less prefix for generated row identifier. - /// Information to hash. - /// The generated identifier. - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] - public static string GenerateIdentifier(string prefix, params string[] args) - { - string stringData = String.Join("|", args); - byte[] data = Encoding.Unicode.GetBytes(stringData); - - // hash the data - byte[] hash; - - using (SHA1 sha1 = new SHA1CryptoServiceProvider()) - { - hash = sha1.ComputeHash(data); - } - - // build up the identifier - StringBuilder identifier = new StringBuilder(35, 35); - identifier.Append(prefix); - - // hard coded to 16 as that is the most bytes that can be used to meet the length requirements. SHA1 is 20 bytes. - for (int i = 0; i < 16; i++) - { - identifier.Append(hash[i].ToString("X2", CultureInfo.InvariantCulture.NumberFormat)); - } - - return identifier.ToString(); - } - - /// - /// Gets the full path of the directory in which the file is found. - /// - /// The file from which to extract the directory. - /// The generated identifier. - private static string GetDirectory(ITaskItem file) - { - return file.GetMetadata("RootDir") + file.GetMetadata("Directory"); - } - - /// - /// Sets the object path to use for the file. - /// - /// The file on which to set the ObjectPath metadata. - /// - /// For the same input path it will return the same ObjectPath. Case is not ignored, however that isn't a problem. - /// - private void SetObjectPath(ITaskItem file) - { - // If the source file is in the project directory or in the intermediate directory, use the intermediate directory. - if (string.IsNullOrEmpty(file.GetMetadata("RelativeDir")) || string.Compare(file.GetMetadata("RelativeDir"), this.IntermediateOutputPath, StringComparison.OrdinalIgnoreCase) == 0) - { - file.SetMetadata("ObjectPath", this.IntermediateOutputPath); - } - // Otherwise use a subdirectory of the intermediate directory. The subfolder's name is based on the full path of the folder containing the source file. - else - { - file.SetMetadata("ObjectPath", Path.Combine(this.IntermediateOutputPath, GenerateIdentifier("pth", GetDirectory(file))) + Path.DirectorySeparatorChar); - } - } - - /// - /// Gets a complete list of external cabs referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - if (string.IsNullOrEmpty(this.IntermediateOutputPath)) - { - this.Log.LogError("IntermediateOutputPath parameter is required and cannot be empty"); - return false; - } - - if (this.Compile == null || this.Compile.Length == 0) - { - return true; - } - - this.CompileWithObjectPath = new ITaskItem[this.Compile.Length]; - for (int i = 0; i < this.Compile.Length; ++i) - { - this.CompileWithObjectPath[i] = new TaskItem(this.Compile[i].ItemSpec, this.Compile[i].CloneCustomMetadata()); - - // Do not overwrite the ObjectPath metadata if it already was set. - if (string.IsNullOrEmpty(this.CompileWithObjectPath[i].GetMetadata("ObjectPath"))) - { - this.SetObjectPath(this.CompileWithObjectPath[i]); - } - } - - return true; - } - } -} diff --git a/src/WixToolset.BuildTasks/GetCabList.cs b/src/WixToolset.BuildTasks/GetCabList.cs deleted file mode 100644 index 33fa5b37..00000000 --- a/src/WixToolset.BuildTasks/GetCabList.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.IO; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - using WixToolset.Dtf.WindowsInstaller; - - /// - /// This task assigns Culture metadata to files based on the value of the Culture attribute on the - /// WixLocalization element inside the file. - /// - public class GetCabList : Task - { - private ITaskItem database; - private ITaskItem[] cabList; - - /// - /// The list of database files to find cabs in - /// - [Required] - public ITaskItem Database - { - get { return this.database; } - set { this.database = value; } - } - - /// - /// The total list of cabs in this database - /// - [Output] - public ITaskItem[] CabList - { - get { return this.cabList; } - } - - /// - /// Gets a complete list of external cabs referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - string databaseFile = this.database.ItemSpec; - Object []args = { }; - System.Collections.Generic.List cabNames = new System.Collections.Generic.List(); - - // If the file doesn't exist, no cabs to return, so exit now - if (!File.Exists(databaseFile)) - { - return true; - } - - using (Database database = new Database(databaseFile)) - { - // If the media table doesn't exist, no cabs to return, so exit now - if (null == database.Tables["Media"]) - { - return true; - } - - System.Collections.IList records = database.ExecuteQuery("SELECT `Cabinet` FROM `Media`", args); - - foreach (string cabName in records) - { - if (String.IsNullOrEmpty(cabName) || cabName.StartsWith("#", StringComparison.Ordinal)) - { - continue; - } - - cabNames.Add(new TaskItem(Path.Combine(Path.GetDirectoryName(databaseFile), cabName))); - } - } - - this.cabList = cabNames.ToArray(); - - return true; - } - } -} diff --git a/src/WixToolset.BuildTasks/GetLooseFileList.cs b/src/WixToolset.BuildTasks/GetLooseFileList.cs deleted file mode 100644 index d1eb62c1..00000000 --- a/src/WixToolset.BuildTasks/GetLooseFileList.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using System.IO; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - using WixToolset.Dtf.WindowsInstaller; - - /// - /// This task assigns Culture metadata to files based on the value of the Culture attribute on the - /// WixLocalization element inside the file. - /// - public class GetLooseFileList : Task - { - private ITaskItem database; - private ITaskItem[] looseFileList; - - internal const int MsidbFileAttributesNoncompressed = 8192; - internal const int MsidbFileAttributesCompressed = 16384; - - /// - /// The list of database files to find Loose Files in - /// - [Required] - public ITaskItem Database - { - get { return this.database; } - set { this.database = value; } - } - - /// - /// The total list of Loose Files in this database - /// - [Output] - public ITaskItem[] LooseFileList - { - get { return this.looseFileList; } - } - - /// - /// Takes the "defaultDir" column - /// - /// Returns the corresponding sourceDir. - public string SourceDirFromDefaultDir(string defaultDir) - { - string sourceDir; - - string[] splitted = defaultDir.Split(':'); - - if (1 == splitted.Length) - { - sourceDir = splitted[0]; - } - else - { - sourceDir = splitted[1]; - } - - splitted = sourceDir.Split('|'); - - if (1 == splitted.Length) - { - sourceDir = splitted[0]; - } - else - { - sourceDir = splitted[1]; - } - - return sourceDir; - } - - /// - /// Takes the "FileName" column - /// - /// Returns the corresponding source file name. - public string SourceFileFromFileName(string fileName) - { - string sourceFile; - - string[] splitted = fileName.Split('|'); - - if (1 == splitted.Length) - { - sourceFile = splitted[0]; - } - else - { - sourceFile = splitted[1]; - } - - return sourceFile; - } - - /// - /// Gets a complete list of external Loose Files referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - string databaseFile = this.database.ItemSpec; - Object []emptyArgs = { }; - System.Collections.Generic.List looseFileNames = new System.Collections.Generic.List(); - Dictionary ComponentFullDirectory = new Dictionary(); - Dictionary DirectoryIdDefaultDir = new Dictionary(); - Dictionary DirectoryIdParent = new Dictionary(); - Dictionary DirectoryIdFullSource = new Dictionary(); - int i; - string databaseDir = Path.GetDirectoryName(databaseFile); - - // If the file doesn't exist, no Loose Files to return, so exit now - if (!File.Exists(databaseFile)) - { - return true; - } - - using (Database database = new Database(databaseFile)) - { - bool compressed = false; - if (2 == (database.SummaryInfo.WordCount & 2)) - { - compressed = true; - } - - // If the media table doesn't exist, no Loose Files to return, so exit now - if (null == database.Tables["File"]) - { - return true; - } - - // Only setup all these helpful indexes if the database is marked as uncompressed. If it's marked as compressed, files are stored at the root, - // so none of these indexes will be used - if (!compressed) - { - if (null == database.Tables["Directory"] || null == database.Tables["Component"]) - { - return true; - } - - System.Collections.IList directoryRecords = database.ExecuteQuery("SELECT `Directory`,`Directory_Parent`,`DefaultDir` FROM `Directory`", emptyArgs); - - // First setup a simple index from DirectoryId to DefaultDir - for (i = 0; i < directoryRecords.Count; i += 3) - { - string directoryId = (string)(directoryRecords[i]); - string directoryParent = (string)(directoryRecords[i + 1]); - string defaultDir = (string)(directoryRecords[i + 2]); - - string sourceDir = this.SourceDirFromDefaultDir(defaultDir); - - DirectoryIdDefaultDir[directoryId] = sourceDir; - DirectoryIdParent[directoryId] = directoryParent; - } - - // Setup an index from directory Id to the full source path - for (i = 0; i < directoryRecords.Count; i += 3) - { - string directoryId = (string)(directoryRecords[i]); - string directoryParent = (string)(directoryRecords[i + 1]); - string defaultDir = (string)(directoryRecords[i + 2]); - - string sourceDir = DirectoryIdDefaultDir[directoryId]; - - // The TARGETDIR case - if (String.IsNullOrEmpty(directoryParent)) - { - DirectoryIdFullSource[directoryId] = databaseDir; - } - else - { - string tempDirectoryParent = directoryParent; - - while (!String.IsNullOrEmpty(tempDirectoryParent) && !String.IsNullOrEmpty(DirectoryIdParent[tempDirectoryParent])) - { - sourceDir = Path.Combine(DirectoryIdDefaultDir[tempDirectoryParent], sourceDir); - - tempDirectoryParent = DirectoryIdParent[tempDirectoryParent]; - } - - DirectoryIdFullSource[directoryId] = Path.Combine(databaseDir, sourceDir); - } - } - - // Setup an index from component Id to full directory path - System.Collections.IList componentRecords = database.ExecuteQuery("SELECT `Component`,`Directory_` FROM `Component`", emptyArgs); - - for (i = 0; i < componentRecords.Count; i += 2) - { - string componentId = (string)(componentRecords[i]); - string componentDir = (string)(componentRecords[i + 1]); - - ComponentFullDirectory[componentId] = DirectoryIdFullSource[componentDir]; - } - } - - System.Collections.IList fileRecords = database.ExecuteQuery("SELECT `Component_`,`FileName`,`Attributes` FROM `File`", emptyArgs); - - for (i = 0; i < fileRecords.Count; i += 3) - { - string componentId = (string)(fileRecords[i]); - string fileName = this.SourceFileFromFileName((string)(fileRecords[i + 1])); - int attributes = (int)(fileRecords[i + 2]); - - // If the whole database is marked uncompressed, use the directory layout made above - if ((!compressed && MsidbFileAttributesCompressed != (attributes & MsidbFileAttributesCompressed))) - { - looseFileNames.Add(new TaskItem(Path.GetFullPath(Path.Combine(ComponentFullDirectory[componentId], fileName)))); - } - // If the database is marked as compressed, put files at the root - else if (compressed && (MsidbFileAttributesNoncompressed == (attributes & MsidbFileAttributesNoncompressed))) - { - looseFileNames.Add(new TaskItem(Path.GetFullPath(Path.Combine(databaseDir, fileName)))); - } - } - } - - this.looseFileList = looseFileNames.ToArray(); - - return true; - } - } -} diff --git a/src/WixToolset.BuildTasks/HeatDirectory.cs b/src/WixToolset.BuildTasks/HeatDirectory.cs deleted file mode 100644 index 79da303a..00000000 --- a/src/WixToolset.BuildTasks/HeatDirectory.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using Microsoft.Build.Framework; - - public sealed class HeatDirectory : HeatTask - { - private string directory; - private bool keepEmptyDirectories; - private bool suppressCom; - private bool suppressRootDirectory; - private bool suppressRegistry; - private string template; - private string componentGroupName; - private string directoryRefId; - private string preprocessorVariable; - - public string ComponentGroupName - { - get { return this.componentGroupName; } - set { this.componentGroupName = value; } - } - - [Required] - public string Directory - { - get { return this.directory; } - set { this.directory = value; } - } - - public string DirectoryRefId - { - get { return this.directoryRefId; } - set { this.directoryRefId = value; } - } - - public bool KeepEmptyDirectories - { - get { return this.keepEmptyDirectories; } - set { this.keepEmptyDirectories = value; } - } - - public string PreprocessorVariable - { - get { return this.preprocessorVariable; } - set { this.preprocessorVariable = value; } - } - - public bool SuppressCom - { - get { return this.suppressCom; } - set { this.suppressCom = value; } - } - - public bool SuppressRootDirectory - { - get { return this.suppressRootDirectory; } - set { this.suppressRootDirectory = value; } - } - - public bool SuppressRegistry - { - get { return this.suppressRegistry; } - set { this.suppressRegistry = value; } - } - - public string Template - { - get { return this.template; } - set { this.template = value; } - } - - protected override string OperationName - { - get { return "dir"; } - } - - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - commandLineBuilder.AppendSwitch(this.OperationName); - commandLineBuilder.AppendFileNameIfNotNull(this.Directory); - - commandLineBuilder.AppendSwitchIfNotNull("-cg ", this.ComponentGroupName); - commandLineBuilder.AppendSwitchIfNotNull("-dr ", this.DirectoryRefId); - commandLineBuilder.AppendIfTrue("-ke", this.KeepEmptyDirectories); - commandLineBuilder.AppendIfTrue("-scom", this.SuppressCom); - commandLineBuilder.AppendIfTrue("-sreg", this.SuppressRegistry); - commandLineBuilder.AppendIfTrue("-srd", this.SuppressRootDirectory); - commandLineBuilder.AppendSwitchIfNotNull("-template ", this.Template); - commandLineBuilder.AppendSwitchIfNotNull("-var ", this.PreprocessorVariable); - - base.BuildCommandLine(commandLineBuilder); - } - } -} diff --git a/src/WixToolset.BuildTasks/HeatFile.cs b/src/WixToolset.BuildTasks/HeatFile.cs deleted file mode 100644 index 57fe579d..00000000 --- a/src/WixToolset.BuildTasks/HeatFile.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using Microsoft.Build.Framework; - - public sealed class HeatFile : HeatTask - { - private string file; - private bool suppressCom; - private bool suppressRegistry; - private bool suppressRootDirectory; - private string template; - private string componentGroupName; - private string directoryRefId; - private string preprocessorVariable; - - public string ComponentGroupName - { - get { return this.componentGroupName; } - set { this.componentGroupName = value; } - } - - public string DirectoryRefId - { - get { return this.directoryRefId; } - set { this.directoryRefId = value; } - } - - [Required] - public string File - { - get { return this.file; } - set { this.file = value; } - } - - public string PreprocessorVariable - { - get { return this.preprocessorVariable; } - set { this.preprocessorVariable = value; } - } - - public bool SuppressCom - { - get { return this.suppressCom; } - set { this.suppressCom = value; } - } - - public bool SuppressRegistry - { - get { return this.suppressRegistry; } - set { this.suppressRegistry = value; } - } - - public bool SuppressRootDirectory - { - get { return this.suppressRootDirectory; } - set { this.suppressRootDirectory = value; } - } - - public string Template - { - get { return this.template; } - set { this.template = value; } - } - - protected override string OperationName - { - get { return "file"; } - } - - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - commandLineBuilder.AppendSwitch(this.OperationName); - commandLineBuilder.AppendFileNameIfNotNull(this.File); - - commandLineBuilder.AppendSwitchIfNotNull("-cg ", this.ComponentGroupName); - commandLineBuilder.AppendSwitchIfNotNull("-dr ", this.DirectoryRefId); - commandLineBuilder.AppendIfTrue("-scom", this.SuppressCom); - commandLineBuilder.AppendIfTrue("-srd", this.SuppressRootDirectory); - commandLineBuilder.AppendIfTrue("-sreg", this.SuppressRegistry); - commandLineBuilder.AppendSwitchIfNotNull("-template ", this.Template); - commandLineBuilder.AppendSwitchIfNotNull("-var ", this.PreprocessorVariable); - - base.BuildCommandLine(commandLineBuilder); - } - } -} diff --git a/src/WixToolset.BuildTasks/HeatProject.cs b/src/WixToolset.BuildTasks/HeatProject.cs deleted file mode 100644 index 3833a754..00000000 --- a/src/WixToolset.BuildTasks/HeatProject.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using Microsoft.Build.Framework; - - public sealed class HeatProject : HeatTask - { - private string configuration; - private string directoryIds; - private string generateType; - private bool generateWixVariables; - private string platform; - private string project; - private string projectName; - private string[] projectOutputGroups; - - public string Configuration - { - get { return this.configuration; } - set { this.configuration = value; } - } - - public string DirectoryIds - { - get { return this.directoryIds; } - set { this.directoryIds = value; } - } - - public bool GenerateWixVariables - { - get { return this.generateWixVariables; } - set { this.generateWixVariables = value; } - } - - public string GenerateType - { - get { return this.generateType; } - set { this.generateType = value; } - } - - public string MsbuildBinPath { get; set; } - - public string Platform - { - get { return this.platform; } - set { this.platform = value; } - } - - [Required] - public string Project - { - get { return this.project; } - set { this.project = value; } - } - - public string ProjectName - { - get { return this.projectName; } - set { this.projectName = value; } - } - - public string[] ProjectOutputGroups - { - get - { - return this.projectOutputGroups; - } - set - { - this.projectOutputGroups = value; - - // If it's just one string and it contains semicolons, let's - // split it into separate items. - if (this.projectOutputGroups.Length == 1) - { - this.projectOutputGroups = this.projectOutputGroups[0].Split(new char[] { ';' }); - } - } - } - - public bool UseToolsVersion { get; set; } - - protected override string OperationName - { - get { return "project"; } - } - - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - commandLineBuilder.AppendSwitch(this.OperationName); - commandLineBuilder.AppendFileNameIfNotNull(this.Project); - - commandLineBuilder.AppendSwitchIfNotNull("-configuration ", this.Configuration); - commandLineBuilder.AppendSwitchIfNotNull("-directoryid ", this.DirectoryIds); - commandLineBuilder.AppendSwitchIfNotNull("-generate ", this.GenerateType); - commandLineBuilder.AppendSwitchIfNotNull("-msbuildbinpath ", this.MsbuildBinPath); - commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.Platform); - commandLineBuilder.AppendArrayIfNotNull("-pog ", this.ProjectOutputGroups); - commandLineBuilder.AppendSwitchIfNotNull("-projectname ", this.ProjectName); - commandLineBuilder.AppendIfTrue("-wixvar", this.GenerateWixVariables); - -#if !NETCOREAPP - commandLineBuilder.AppendIfTrue("-usetoolsversion", this.UseToolsVersion); -#endif - - base.BuildCommandLine(commandLineBuilder); - } - } -} diff --git a/src/WixToolset.BuildTasks/HeatTask.cs b/src/WixToolset.BuildTasks/HeatTask.cs deleted file mode 100644 index 18c08342..00000000 --- a/src/WixToolset.BuildTasks/HeatTask.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using Microsoft.Build.Framework; - - /// - /// A base MSBuild task to run the WiX harvester. - /// Specific harvester tasks should extend this class. - /// - public abstract partial class HeatTask : ToolsetTask - { - private bool autogenerageGuids; - private bool generateGuidsNow; - private ITaskItem outputFile; - private bool suppressFragments; - private bool suppressUniqueIds; - private string[] transforms; - - public HeatTask() - { - this.RunAsSeparateProcess = true; - } - - public bool AutogenerateGuids - { - get { return this.autogenerageGuids; } - set { this.autogenerageGuids = value; } - } - - public bool GenerateGuidsNow - { - get { return this.generateGuidsNow; } - set { this.generateGuidsNow = value; } - } - - [Required] - [Output] - public ITaskItem OutputFile - { - get { return this.outputFile; } - set { this.outputFile = value; } - } - - public bool SuppressFragments - { - get { return this.suppressFragments; } - set { this.suppressFragments = value; } - } - - public bool SuppressUniqueIds - { - get { return this.suppressUniqueIds; } - set { this.suppressUniqueIds = value; } - } - - public string[] Transforms - { - get { return this.transforms; } - set { this.transforms = value; } - } - - protected sealed override string ToolName => "heat.exe"; - - /// - /// Gets the name of the heat operation performed by the task. - /// - /// This is the first parameter passed on the heat.exe command-line. - /// The name of the heat operation performed by the task. - protected abstract string OperationName - { - get; - } - - /// - /// Builds a command line from options in this task. - /// - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - base.BuildCommandLine(commandLineBuilder); - - commandLineBuilder.AppendIfTrue("-ag", this.AutogenerateGuids); - commandLineBuilder.AppendIfTrue("-gg", this.GenerateGuidsNow); - commandLineBuilder.AppendIfTrue("-sfrag", this.SuppressFragments); - commandLineBuilder.AppendIfTrue("-suid", this.SuppressUniqueIds); - commandLineBuilder.AppendArrayIfNotNull("-t ", this.Transforms); - commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); - commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); - } - } -} diff --git a/src/WixToolset.BuildTasks/HeatTask_InProc.cs b/src/WixToolset.BuildTasks/HeatTask_InProc.cs deleted file mode 100644 index 48ee9e02..00000000 --- a/src/WixToolset.BuildTasks/HeatTask_InProc.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#if !NETCOREAPP -namespace WixToolset.BuildTasks -{ - using System; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Extensibility.Services; - - public partial class HeatTask - { - public override bool RunAsSeparateProcess { get => true; } - - protected sealed override string TaskShortName => "HEAT"; - - protected sealed override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken) => throw new NotImplementedException(); - } -} -#endif diff --git a/src/WixToolset.BuildTasks/Insignia.cs b/src/WixToolset.BuildTasks/Insignia.cs deleted file mode 100644 index d89770db..00000000 --- a/src/WixToolset.BuildTasks/Insignia.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Diagnostics; - using System.Globalization; - using System.IO; - using System.Text; - - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - -#if false - /// - /// An MSBuild task to run the WiX transform generator. - /// - public sealed class Insignia : WixToolTask - { - private const string InsigniaToolName = "insignia.exe"; - - /// - /// Gets or sets the path to the database to inscribe. - /// - public ITaskItem DatabaseFile { get; set; } - - /// - /// Gets or sets the path to the bundle to inscribe. - /// - public ITaskItem BundleFile { get; set; } - - /// - /// Gets or sets the path to the original bundle that contains the attached container. - /// - public ITaskItem OriginalBundleFile { get; set; } - - /// - /// Gets or sets the path to output the inscribed result. - /// - [Required] - public ITaskItem OutputFile { get; set; } - - /// - /// Gets or sets the output. Only set if insignia does work. - /// - [Output] - public ITaskItem Output { get; set; } - - /// - /// Get the name of the executable. - /// - /// The ToolName is used with the ToolPath to get the location of Insignia.exe. - /// The name of the executable. - protected override string ToolName - { - get { return InsigniaToolName; } - } - - /// - /// Get the path to the executable. - /// - /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). - /// The full path to the executable or simply Insignia.exe if it's expected to be in the system path. - protected override string GenerateFullPathToTool() - { - // If there's not a ToolPath specified, it has to be in the system path. - if (String.IsNullOrEmpty(this.ToolPath)) - { - return InsigniaToolName; - } - - return Path.Combine(Path.GetFullPath(this.ToolPath), InsigniaToolName); - } - - /// - /// Builds a command line from options in this task. - /// - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - base.BuildCommandLine(commandLineBuilder); - - commandLineBuilder.AppendSwitchIfNotNull("-im ", this.DatabaseFile); - if (null != this.OriginalBundleFile) - { - commandLineBuilder.AppendSwitchIfNotNull("-ab ", this.BundleFile); - commandLineBuilder.AppendFileNameIfNotNull(this.OriginalBundleFile); - } - else - { - commandLineBuilder.AppendSwitchIfNotNull("-ib ", this.BundleFile); - } - - commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); - commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); - } - - /// - /// Executes a tool in-process by loading the tool assembly and invoking its entrypoint. - /// - /// Path to the tool to be executed; must be a managed executable. - /// Commands to be written to a response file. - /// Commands to be passed directly on the command-line. - /// The tool exit code. - protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) - { - int returnCode = base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); - if (0 == returnCode) // successfully did work. - { - this.Output = this.OutputFile; - } - else if (-1 == returnCode) // no work done. - { - returnCode = 0; - } - - return returnCode; - } - } -#endif -} diff --git a/src/WixToolset.BuildTasks/MsbuildMessageListener.cs b/src/WixToolset.BuildTasks/MsbuildMessageListener.cs deleted file mode 100644 index f186d721..00000000 --- a/src/WixToolset.BuildTasks/MsbuildMessageListener.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#if !NETCOREAPP -namespace WixToolset.BuildTasks -{ - using System; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - - public sealed class MsbuildMessageListener : IMessageListener - { - public MsbuildMessageListener(TaskLoggingHelper logger, string shortName, string longName) - { - this.Logger = logger; - this.ShortAppName = shortName; - this.LongAppName = longName; - } - - public string ShortAppName { get; } - - public string LongAppName { get; } - - private TaskLoggingHelper Logger { get; } - - public void Write(Message message) - { - var code = this.ShortAppName + message.Id.ToString(); - var file = message.SourceLineNumbers?.FileName ?? this.LongAppName; - var lineNumber = message.SourceLineNumbers?.LineNumber ?? 0; - switch (message.Level) - { - case MessageLevel.Error: - this.Logger.LogError(null, code, null, file, lineNumber, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); - break; - - case MessageLevel.Verbose: - this.Logger.LogMessage(null, code, null, file, lineNumber, 0, 0, 0, MessageImportance.Low, message.ResourceNameOrFormat, message.MessageArgs); - break; - - case MessageLevel.Warning: - this.Logger.LogWarning(null, code, null, file, lineNumber, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); - break; - - default: - if (message.Id > 0) - { - this.Logger.LogMessage(null, code, null, file, lineNumber, 0, 0, 0, MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs); - } - else - { - this.Logger.LogMessage(MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs); - } - break; - } - } - - public void Write(string message) - { - this.Logger.LogMessage(MessageImportance.Low, message); - } - - public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; - } -} -#endif diff --git a/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs b/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs deleted file mode 100644 index 7663e6df..00000000 --- a/src/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections; - using System.Globalization; - using System.IO; - using System.Xml; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// This task refreshes the generated file for bundle projects. - /// - public class RefreshBundleGeneratedFile : Task - { - private ITaskItem[] generatedFiles; - private ITaskItem[] projectReferencePaths; - - /// - /// The list of files to generate. - /// - [Required] - public ITaskItem[] GeneratedFiles - { - get { return this.generatedFiles; } - set { this.generatedFiles = value; } - } - - /// - /// All the project references in the project. - /// - [Required] - public ITaskItem[] ProjectReferencePaths - { - get { return this.projectReferencePaths; } - set { this.projectReferencePaths = value; } - } - - /// - /// Gets a complete list of external cabs referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - ArrayList payloadGroupRefs = new ArrayList(); - ArrayList packageGroupRefs = new ArrayList(); - for (int i = 0; i < this.ProjectReferencePaths.Length; i++) - { - ITaskItem item = this.ProjectReferencePaths[i]; - - if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) - { - continue; - } - - string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); - string projectName = Path.GetFileNameWithoutExtension(projectPath); - string referenceName = ToolsCommon.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); - - string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); - foreach (string pog in pogs) - { - if (!String.IsNullOrEmpty(pog)) - { - // TODO: Add payload group references and package group references once heat is generating them - ////payloadGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); - packageGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); - } - } - } - - XmlDocument doc = new XmlDocument(); - - XmlProcessingInstruction head = doc.CreateProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); - doc.AppendChild(head); - - XmlElement rootElement = doc.CreateElement("Wix"); - rootElement.SetAttribute("xmlns", "http://wixtoolset.org/schemas/v4/wxs"); - doc.AppendChild(rootElement); - - XmlElement fragment = doc.CreateElement("Fragment"); - rootElement.AppendChild(fragment); - - XmlElement payloadGroup = doc.CreateElement("PayloadGroup"); - payloadGroup.SetAttribute("Id", "Bundle.Generated.Payloads"); - fragment.AppendChild(payloadGroup); - - XmlElement packageGroup = doc.CreateElement("PackageGroup"); - packageGroup.SetAttribute("Id", "Bundle.Generated.Packages"); - fragment.AppendChild(packageGroup); - - foreach (string payloadGroupRef in payloadGroupRefs) - { - XmlElement payloadGroupRefElement = doc.CreateElement("PayloadGroupRef"); - payloadGroupRefElement.SetAttribute("Id", payloadGroupRef); - payloadGroup.AppendChild(payloadGroupRefElement); - } - - foreach (string packageGroupRef in packageGroupRefs) - { - XmlElement packageGroupRefElement = doc.CreateElement("PackageGroupRef"); - packageGroupRefElement.SetAttribute("Id", packageGroupRef); - packageGroup.AppendChild(packageGroupRefElement); - } - - foreach (ITaskItem item in this.GeneratedFiles) - { - string fullPath = item.GetMetadata("FullPath"); - - payloadGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath) + ".Payloads"); - packageGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath) + ".Packages"); - try - { - doc.Save(fullPath); - } - catch (Exception e) - { - // e.Message will be something like: "Access to the path 'fullPath' is denied." - this.Log.LogMessage(MessageImportance.High, "Unable to save generated file to '{0}'. {1}", fullPath, e.Message); - } - } - - return true; - } - } -} diff --git a/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs b/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs deleted file mode 100644 index c57e3f0f..00000000 --- a/src/WixToolset.BuildTasks/RefreshGeneratedFile.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections; - using System.Globalization; - using System.IO; - using System.Xml; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// This task refreshes the generated file that contains ComponentGroupRefs - /// to harvested output. - /// - public class RefreshGeneratedFile : Task - { - private ITaskItem[] generatedFiles; - private ITaskItem[] projectReferencePaths; - - /// - /// The list of files to generate. - /// - [Required] - public ITaskItem[] GeneratedFiles - { - get { return this.generatedFiles; } - set { this.generatedFiles = value; } - } - - /// - /// All the project references in the project. - /// - [Required] - public ITaskItem[] ProjectReferencePaths - { - get { return this.projectReferencePaths; } - set { this.projectReferencePaths = value; } - } - - /// - /// Gets a complete list of external cabs referenced by the given installer database file. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - ArrayList componentGroupRefs = new ArrayList(); - for (int i = 0; i < this.ProjectReferencePaths.Length; i++) - { - ITaskItem item = this.ProjectReferencePaths[i]; - - if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) - { - continue; - } - - string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); - string projectName = Path.GetFileNameWithoutExtension(projectPath); - string referenceName = ToolsCommon.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); - - string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); - foreach (string pog in pogs) - { - if (!String.IsNullOrEmpty(pog)) - { - componentGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); - } - } - } - - XmlDocument doc = new XmlDocument(); - - XmlProcessingInstruction head = doc.CreateProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); - doc.AppendChild(head); - - XmlElement rootElement = doc.CreateElement("Wix"); - rootElement.SetAttribute("xmlns", "http://wixtoolset.org/schemas/v4/wxs"); - doc.AppendChild(rootElement); - - XmlElement fragment = doc.CreateElement("Fragment"); - rootElement.AppendChild(fragment); - - XmlElement componentGroup = doc.CreateElement("ComponentGroup"); - componentGroup.SetAttribute("Id", "Product.Generated"); - fragment.AppendChild(componentGroup); - - foreach (string componentGroupRef in componentGroupRefs) - { - XmlElement componentGroupRefElement = doc.CreateElement("ComponentGroupRef"); - componentGroupRefElement.SetAttribute("Id", componentGroupRef); - componentGroup.AppendChild(componentGroupRefElement); - } - - foreach (ITaskItem item in this.GeneratedFiles) - { - string fullPath = item.GetMetadata("FullPath"); - - componentGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath)); - try - { - doc.Save(fullPath); - } - catch (Exception e) - { - // e.Message will be something like: "Access to the path 'fullPath' is denied." - this.Log.LogMessage(MessageImportance.High, "Unable to save generated file to '{0}'. {1}", fullPath, e.Message); - } - } - - return true; - } - } -} diff --git a/src/WixToolset.BuildTasks/ResolveWixReferences.cs b/src/WixToolset.BuildTasks/ResolveWixReferences.cs deleted file mode 100644 index 9b8cfe6f..00000000 --- a/src/WixToolset.BuildTasks/ResolveWixReferences.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using Microsoft.Build.Utilities; - using Microsoft.Build.Framework; - using System.IO; - - /// - /// This task searches for paths to references using the order specified in SearchPaths. - /// - public class ResolveWixReferences : Task - { - /// - /// Token value used in SearchPaths to indicate that the item's HintPath metadata should - /// be searched as a full file path to resolve the reference. - /// Must match wix.targets, case sensitive. - /// - private const string HintPathToken = "{HintPathFromItem}"; - - /// - /// Token value used in SearchPaths to indicate that the item's Identity should - /// be searched as a full file path to resolve the reference. - /// Must match wix.targets, case sensitive. - /// - private const string RawFileNameToken = "{RawFileName}"; - - /// - /// The list of references to resolve. - /// - [Required] - public ITaskItem[] WixReferences - { - get; - set; - } - - /// - /// The directories or special locations that are searched to find the files - /// on disk that represent the references. The order in which the search paths are listed - /// is important. For each reference, the list of paths is searched from left to right. - /// When a file that represents the reference is found, that search stops and the search - /// for the next reference starts. - /// - /// This parameter accepts the following types of values: - /// A directory path. - /// {HintPathFromItem}: Specifies that the task will examine the HintPath metadata - /// of the base item. - /// TODO : {CandidateAssemblyFiles}: Specifies that the task will examine the files - /// passed in through the CandidateAssemblyFiles parameter. - /// TODO : {Registry:_AssemblyFoldersBase_, _RuntimeVersion_, _AssemblyFoldersSuffix_}: - /// TODO : {AssemblyFolders}: Specifies the task will use the Visual Studio.NET 2003 - /// finding-assemblies-from-registry scheme. - /// TODO : {GAC}: Specifies the task will search in the GAC. - /// {RawFileName}: Specifies the task will consider the Include value of the item to be - /// an exact path and file name. - /// - public string[] SearchPaths - { - get; - set; - } - - /// - /// The filename extension(s) to be checked when searching. - /// - public string[] SearchFilenameExtensions - { - get; - set; - } - - /// - /// Output items that contain the same metadata as input references and have been resolved to full paths. - /// - [Output] - public ITaskItem[] ResolvedWixReferences - { - get; - private set; - } - - /// - /// Resolves reference paths by searching for referenced items using the specified SearchPaths. - /// - /// True on success, or throws an exception on failure. - public override bool Execute() - { - List resolvedReferences = new List(); - - foreach (ITaskItem reference in this.WixReferences) - { - ITaskItem resolvedReference = ResolveWixReferences.ResolveReference(reference, this.SearchPaths, this.SearchFilenameExtensions, this.Log); - - this.Log.LogMessage(MessageImportance.Low, "Resolved path {0}", resolvedReference.ItemSpec); - resolvedReferences.Add(resolvedReference); - } - - this.ResolvedWixReferences = resolvedReferences.ToArray(); - return true; - } - - /// - /// Resolves a single reference item by searcheing for referenced items using the specified SearchPaths. - /// This method is made public so the resolution logic can be reused by other tasks. - /// - /// The referenced item. - /// The paths to search. - /// Filename extensions to check. - /// Logging helper. - /// The resolved reference item, or the original reference if it could not be resolved. - public static ITaskItem ResolveReference(ITaskItem reference, string[] searchPaths, string[] searchFilenameExtensions, TaskLoggingHelper log) - { - if (reference == null) - { - throw new ArgumentNullException("reference"); - } - - if (searchPaths == null) - { - // Nothing to search, so just return the original reference item. - return reference; - } - - if (searchFilenameExtensions == null) - { - searchFilenameExtensions = new string[] { }; - } - - // Copy all the metadata from the source - TaskItem resolvedReference = new TaskItem(reference); - log.LogMessage(MessageImportance.Low, "WixReference: {0}", reference.ItemSpec); - - // Now find the resolved path based on our order of precedence - foreach (string searchPath in searchPaths) - { - log.LogMessage(MessageImportance.Low, "Trying {0}", searchPath); - if (searchPath.Equals(HintPathToken, StringComparison.Ordinal)) - { - string path = reference.GetMetadata("HintPath"); - log.LogMessage(MessageImportance.Low, "Trying path {0}", path); - if (File.Exists(path)) - { - resolvedReference.ItemSpec = path; - break; - } - } - else if (searchPath.Equals(RawFileNameToken, StringComparison.Ordinal)) - { - log.LogMessage(MessageImportance.Low, "Trying path {0}", resolvedReference.ItemSpec); - if (File.Exists(resolvedReference.ItemSpec)) - { - break; - } - - if (ResolveWixReferences.ResolveFilenameExtensions(resolvedReference, - resolvedReference.ItemSpec, searchFilenameExtensions, log)) - { - break; - } - } - else - { - string path = Path.Combine(searchPath, Path.GetFileName(reference.ItemSpec)); - log.LogMessage(MessageImportance.Low, "Trying path {0}", path); - if (File.Exists(path)) - { - resolvedReference.ItemSpec = path; - break; - } - - if (ResolveWixReferences.ResolveFilenameExtensions(resolvedReference, - path, searchFilenameExtensions, log)) - { - break; - } - } - } - - // Normalize the item path - resolvedReference.ItemSpec = resolvedReference.GetMetadata("FullPath"); - - return resolvedReference; - } - - /// - /// Helper method for checking filename extensions when resolving references. - /// - /// The reference being resolved. - /// Full filename path without extension. - /// Filename extensions to check. - /// Logging helper. - /// True if the item was resolved, else false. - private static bool ResolveFilenameExtensions(ITaskItem reference, string basePath, string[] filenameExtensions, TaskLoggingHelper log) - { - foreach (string filenameExtension in filenameExtensions) - { - string path = basePath + filenameExtension; - log.LogMessage(MessageImportance.Low, "Trying path {0}", path); - if (File.Exists(path)) - { - reference.ItemSpec = path; - return true; - } - } - - return false; - } - } -} diff --git a/src/WixToolset.BuildTasks/ToolsetTask.cs b/src/WixToolset.BuildTasks/ToolsetTask.cs deleted file mode 100644 index d48f2a20..00000000 --- a/src/WixToolset.BuildTasks/ToolsetTask.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.IO; - using System.Runtime.InteropServices; - using Microsoft.Build.Utilities; - - public abstract partial class ToolsetTask : ToolTask - { - private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; - - /// - /// Gets or sets additional options that are appended the the tool command-line. - /// - /// - /// This allows the task to support extended options in the tool which are not - /// explicitly implemented as properties on the task. - /// - public string AdditionalOptions { get; set; } - - /// - /// Gets or sets whether to display the logo. - /// - public bool NoLogo { get; set; } - - /// - /// Gets or sets a flag indicating whether the task - /// should be run as separate process or in-proc. - /// - public virtual bool RunAsSeparateProcess { get; set; } - - /// - /// Gets or sets whether all warnings should be suppressed. - /// - public bool SuppressAllWarnings { get; set; } - - /// - /// Gets or sets a list of specific warnings to be suppressed. - /// - public string[] SuppressSpecificWarnings { get; set; } - - /// - /// Gets or sets whether all warnings should be treated as errors. - /// - public bool TreatWarningsAsErrors { get; set; } - - /// - /// Gets or sets a list of specific warnings to treat as errors. - /// - public string[] TreatSpecificWarningsAsErrors { get; set; } - - /// - /// Gets or sets whether to display verbose output. - /// - public bool VerboseOutput { get; set; } - - private string DefaultToolFullPath => Path.Combine(Path.GetDirectoryName(ThisDllPath), this.ToolExe); - - private string ToolFullPath - { - get - { - if (String.IsNullOrEmpty(this.ToolPath)) - { - return this.DefaultToolFullPath; - } - return Path.Combine(this.ToolPath, this.ToolExe); - } - } - - /// - /// Get the path to the executable. - /// - /// - /// ToolTask only calls GenerateFullPathToTool when the ToolPath property is not set. - /// WiX never sets the ToolPath property, but the user can through $(WixToolDir). - /// If we return only a file name, ToolTask will search the system paths for it. - /// - protected sealed override string GenerateFullPathToTool() - { -#if !NETCOREAPP - if (!this.RunAsSeparateProcess) - { - // We need to return a path that exists, so if we're not actually going to run the tool then just return this dll path. - return ThisDllPath; - } - return this.DefaultToolFullPath; -#else - if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath)) - { - return toolFullPath; - } - return DotnetFullPath; -#endif - } - - protected sealed override string GenerateResponseFileCommands() - { - var commandLineBuilder = new WixCommandLineBuilder(); - this.BuildCommandLine(commandLineBuilder); - return commandLineBuilder.ToString(); - } - - /// - /// Builds a command line from options in this and derivative tasks. - /// - /// - /// Derivative classes should call BuildCommandLine() on the base class to ensure that common command line options are added to the command. - /// - protected virtual void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); - commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); - commandLineBuilder.AppendIfTrue("-sw", this.SuppressAllWarnings); - commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput); - commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors); - commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); - } - -#if NETCOREAPP - private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet"; - - protected override string GenerateCommandLineCommands() - { - if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath)) - { - return null; - } - else - { - return $"exec \"{toolFullPath}\""; - } - } - - private static bool IsSelfExecutable(string proposedToolFullPath, out string toolFullPath) - { - var toolFullPathWithoutExtension = Path.Combine(Path.GetDirectoryName(proposedToolFullPath), Path.GetFileNameWithoutExtension(proposedToolFullPath)); - var exeExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : String.Empty; - var exeToolFullPath = $"{toolFullPathWithoutExtension}{exeExtension}"; - if (File.Exists(exeToolFullPath)) - { - toolFullPath = exeToolFullPath; - return true; - } - - toolFullPath = $"{toolFullPathWithoutExtension}.dll"; - return false; - } -#endif - } -} diff --git a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs b/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs deleted file mode 100644 index fcf4aea9..00000000 --- a/src/WixToolset.BuildTasks/ToolsetTask_InProc.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#if !NETCOREAPP -namespace WixToolset.BuildTasks -{ - using System; - using System.Runtime.InteropServices; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Build.Framework; - using WixToolset.Core; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - - public partial class ToolsetTask - { - protected sealed override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) - { - if (this.RunAsSeparateProcess) - { - return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); - } - - return this.ExecuteInProc($"{commandLineCommands} {responseFileCommands}"); - } - - private int ExecuteInProc(string commandLineString) - { - this.Log.LogMessage(MessageImportance.Normal, $"({this.ToolName}){commandLineString}"); - - var listener = new MsbuildMessageListener(this.Log, this.TaskShortName, this.BuildEngine.ProjectFileOfTaskNode); - var exitCode = -1; - - try - { - var coreProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - - var messaging = coreProvider.GetService(); - messaging.SetListener(listener); - - exitCode = this.ExecuteCoreAsync(coreProvider, commandLineString, CancellationToken.None).GetAwaiter().GetResult(); - } - catch (WixException e) - { - listener.Write(e.Error); - } - catch (Exception e) - { - this.Log.LogErrorFromException(e, showStackTrace: true, showDetail: true, null); - - if (e is NullReferenceException || e is SEHException) - { - throw; - } - } - - if (exitCode == 0 && this.Log.HasLoggedErrors) - { - exitCode = -1; - } - return exitCode; - } - - protected sealed override void LogToolCommand(string message) - { - // Only log this if we're actually going to do it. - if (this.RunAsSeparateProcess) - { - base.LogToolCommand(message); - } - } - - protected abstract Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken); - - protected abstract string TaskShortName { get; } - } -} -#endif diff --git a/src/WixToolset.BuildTasks/WixAssignCulture.cs b/src/WixToolset.BuildTasks/WixAssignCulture.cs deleted file mode 100644 index a8baa62f..00000000 --- a/src/WixToolset.BuildTasks/WixAssignCulture.cs +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.IO; - using System.Xml; - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// This task assigns Culture metadata to files based on the value of the Culture attribute on the - /// WixLocalization element inside the file. - /// - public class WixAssignCulture : Task - { - private const string CultureAttributeName = "Culture"; - private const string OutputFolderMetadataName = "OutputFolder"; - private const string InvariantCultureIdentifier = "neutral"; - private const string NullCultureIdentifier = "null"; - - /// - /// The list of cultures to build. Cultures are specified in the following form: - /// primary culture,first fallback culture, second fallback culture;... - /// Culture groups are seperated by semi-colons - /// Culture precedence within a culture group is evaluated from left to right where fallback cultures are - /// separated with commas. - /// The first (primary) culture in a culture group will be used as the output sub-folder. - /// - public string Cultures { get; set; } - - /// - /// The list of files to apply culture information to. - /// - [Required] - public ITaskItem[] Files - { - get; - set; - } - - /// - /// The files that had culture information applied - /// - [Output] - public ITaskItem[] CultureGroups - { - get; - private set; - } - - /// - /// Applies culture information to the files specified by the Files property. - /// This task intentionally does not validate that strings are valid Cultures so that we can support - /// psuedo-loc. - /// - /// True upon completion of the task execution. - public override bool Execute() - { - // First, process the culture group list the user specified in the cultures property - List cultureGroups = new List(); - - if (!String.IsNullOrEmpty(this.Cultures)) - { - // Get rid of extra quotes - this.Cultures = this.Cultures.Trim('\"'); - - foreach (string cultureGroupString in this.Cultures.Split(';')) - { - if (0 == cultureGroupString.Length) - { - // MSBuild v2.0.50727 cannnot handle "" items - // for the invariant culture we require the neutral keyword - continue; - } - CultureGroup cultureGroup = new CultureGroup(cultureGroupString); - cultureGroups.Add(cultureGroup); - } - } - else - { - // Only process the EmbeddedResource items if cultures was unspecified - foreach (ITaskItem file in this.Files) - { - // Ignore non-wxls - if (!String.Equals(file.GetMetadata("Extension"), ".wxl", StringComparison.OrdinalIgnoreCase)) - { - Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}. The file type is not supported.", file.ItemSpec); - return false; - } - XmlDocument wxlFile = new XmlDocument(); - - try - { - wxlFile.Load(file.ItemSpec); - } - catch (FileNotFoundException) - { - Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}. The file was not found.", file.ItemSpec); - return false; - } - catch (Exception e) - { - Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}: {1}", file.ItemSpec, e.Message); - return false; - } - - // Take the culture value and try using it to create a culture. - XmlAttribute cultureAttr = wxlFile.DocumentElement.Attributes[WixAssignCulture.CultureAttributeName]; - string wxlCulture = null == cultureAttr ? String.Empty : cultureAttr.Value; - if (0 == wxlCulture.Length) - { - // We use a keyword for the invariant culture because MSBuild v2.0.50727 cannnot handle "" items - wxlCulture = InvariantCultureIdentifier; - } - - // We found the culture for the WXL, we now need to determine if it maps to a culture group specified - // in the Cultures property or if we need to create a new one. - Log.LogMessage(MessageImportance.Low, "Culture \"{0}\" from EmbeddedResource {1}.", wxlCulture, file.ItemSpec); - - bool cultureGroupExists = false; - foreach (CultureGroup cultureGroup in cultureGroups) - { - foreach (string culture in cultureGroup.Cultures) - { - if (String.Equals(wxlCulture, culture, StringComparison.OrdinalIgnoreCase)) - { - cultureGroupExists = true; - break; - } - } - } - - // The WXL didn't match a culture group we already have so create a new one. - if (!cultureGroupExists) - { - cultureGroups.Add(new CultureGroup(wxlCulture)); - } - } - } - - // If we didn't create any culture groups the culture was unspecificed and no WXLs were included - // Build an unlocalized target in the output folder - if (cultureGroups.Count == 0) - { - cultureGroups.Add(new CultureGroup()); - } - - List cultureGroupItems = new List(); - - if (1 == cultureGroups.Count && 0 == this.Files.Length) - { - // Maintain old behavior, if only one culturegroup is specified and no WXL, output to the default folder - TaskItem cultureGroupItem = new TaskItem(cultureGroups[0].ToString()); - cultureGroupItem.SetMetadata(OutputFolderMetadataName, CultureGroup.DefaultFolder); - cultureGroupItems.Add(cultureGroupItem); - } - else - { - foreach (CultureGroup cultureGroup in cultureGroups) - { - TaskItem cultureGroupItem = new TaskItem(cultureGroup.ToString()); - cultureGroupItem.SetMetadata(OutputFolderMetadataName, cultureGroup.OutputFolder); - cultureGroupItems.Add(cultureGroupItem); - Log.LogMessage("Culture: {0}", cultureGroup.ToString()); - } - } - - this.CultureGroups = cultureGroupItems.ToArray(); - return true; - } - - private class CultureGroup - { - /// - /// TargetPath already has a '\', do not double it! - /// - public const string DefaultFolder = ""; - - /// - /// Initialize a null culture group - /// - public CultureGroup() - { - } - - public CultureGroup(string cultureGroupString) - { - Debug.Assert(!String.IsNullOrEmpty(cultureGroupString)); - foreach (string cultureString in cultureGroupString.Split(',')) - { - this.Cultures.Add(cultureString); - } - } - - public List Cultures { get; } = new List(); - - public string OutputFolder - { - get - { - string result = DefaultFolder; - if (this.Cultures.Count > 0 && - !this.Cultures[0].Equals(InvariantCultureIdentifier, StringComparison.OrdinalIgnoreCase)) - { - result = this.Cultures[0] + "\\"; - } - - return result; - } - } - - public override string ToString() - { - if (this.Cultures.Count > 0) - { - return String.Join(";", this.Cultures); - } - - // We use a keyword for a null culture because MSBuild cannnot handle "" items - // Null is different from neutral. For neutral we still want to do WXL - // filtering in Light. - return NullCultureIdentifier; - } - } - } -} diff --git a/src/WixToolset.BuildTasks/WixBuild.cs b/src/WixToolset.BuildTasks/WixBuild.cs deleted file mode 100644 index dbff7e81..00000000 --- a/src/WixToolset.BuildTasks/WixBuild.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using Microsoft.Build.Framework; - - /// - /// An MSBuild task to run the WiX compiler. - /// - public sealed partial class WixBuild : ToolsetTask - { - public string[] Cultures { get; set; } - - public string[] DefineConstants { get; set; } - - public ITaskItem[] Extensions { get; set; } - - public string ExtensionDirectory { get; set; } - - public string[] IncludeSearchPaths { get; set; } - - public string InstallerPlatform { get; set; } - - [Required] - public ITaskItem IntermediateDirectory { get; set; } - - public ITaskItem[] LocalizationFiles { get; set; } - - public ITaskItem[] LibraryFiles { get; set; } - - [Output] - [Required] - public ITaskItem OutputFile { get; set; } - - public string OutputType { get; set; } - - public ITaskItem PdbFile { get; set; } - - public string PdbType { get; set; } - - public bool Pedantic { get; set; } - - [Required] - public ITaskItem[] SourceFiles { get; set; } - - public string[] ReferencePaths { get; set; } - - - public ITaskItem[] BindInputPaths { get; set; } - - public bool BindFiles { get; set; } - - public ITaskItem BindContentsFile { get; set; } - - public ITaskItem BindOutputsFile { get; set; } - - public ITaskItem BindBuiltOutputsFile { get; set; } - - public string CabinetCachePath { get; set; } - - public int CabinetCreationThreadCount { get; set; } - - public string DefaultCompressionLevel { get; set; } - - [Output] - public ITaskItem UnreferencedSymbolsFile { get; set; } - - public ITaskItem WixProjectFile { get; set; } - public string[] WixVariables { get; set; } - - public bool SuppressValidation { get; set; } - - public string[] SuppressIces { get; set; } - - public string AdditionalCub { get; set; } - - protected override string ToolName => "wix.exe"; - - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - commandLineBuilder.AppendTextUnquoted("build"); - - commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform); - commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); - commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); - commandLineBuilder.AppendSwitchIfNotNull("-pdb ", this.PdbFile); - commandLineBuilder.AppendSwitchIfNotNull("-pdbType ", this.PdbType); - commandLineBuilder.AppendArrayIfNotNull("-culture ", this.Cultures); - commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); - commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); - commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); - commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); - commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); - commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); - commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); - commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); - commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile); - commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile); - commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile); - commandLineBuilder.AppendSwitchIfNotNull("-defaultcompressionlevel ", this.DefaultCompressionLevel); - - base.BuildCommandLine(commandLineBuilder); - - commandLineBuilder.AppendIfTrue("-bindFiles", this.BindFiles); - commandLineBuilder.AppendArrayIfNotNull("-bindPath ", this.CalculateBindPathStrings()); - commandLineBuilder.AppendArrayIfNotNull("-loc ", this.LocalizationFiles); - commandLineBuilder.AppendArrayIfNotNull("-lib ", this.LibraryFiles); - commandLineBuilder.AppendTextIfNotWhitespace(this.AdditionalOptions); - commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); - } - - private IEnumerable CalculateBindPathStrings() - { - if (null != this.BindInputPaths) - { - foreach (var item in this.BindInputPaths) - { - var path = item.GetMetadata("FullPath"); - - var bindName = item.GetMetadata("BindName"); - if (!String.IsNullOrEmpty(bindName)) - { - yield return String.Concat(bindName, "=", path); - } - else - { - yield return path; - } - } - } - } - } -} diff --git a/src/WixToolset.BuildTasks/WixBuild_InProc.cs b/src/WixToolset.BuildTasks/WixBuild_InProc.cs deleted file mode 100644 index 9cba0f62..00000000 --- a/src/WixToolset.BuildTasks/WixBuild_InProc.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#if !NETCOREAPP -namespace WixToolset.BuildTasks -{ - using System; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Core.Burn; - using WixToolset.Core.WindowsInstaller; - using WixToolset.Extensibility.Services; - - public partial class WixBuild - { - protected override string TaskShortName => "WIX"; - - protected override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken) - { - coreProvider.AddWindowsInstallerBackend() - .AddBundleBackend(); - - var commandLine = coreProvider.GetService(); - var command = commandLine.CreateCommand(commandLineString); - return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); - } - } -} -#endif diff --git a/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs b/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs deleted file mode 100644 index a979dbb0..00000000 --- a/src/WixToolset.BuildTasks/WixCommandLineBuilder.cs +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.BuildTasks -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - - /// - /// Helper class for appending the command line arguments. - /// - public class WixCommandLineBuilder : CommandLineBuilder - { - internal const int Unspecified = -1; - - /// - /// Append a switch to the command line if the value has been specified. - /// - /// Switch to append. - /// Value specified by the user. - public void AppendIfSpecified(string switchName, int value) - { - if (value != Unspecified) - { - this.AppendSwitchIfNotNull(switchName, value.ToString(CultureInfo.InvariantCulture)); - } - } - - /// - /// Append a switch to the command line if the condition is true. - /// - /// Switch to append. - /// Condition specified by the user. - public void AppendIfTrue(string switchName, bool condition) - { - if (condition) - { - this.AppendSwitch(switchName); - } - } - - /// - /// Append a switch to the command line if any values in the array have been specified. - /// - /// Switch to append. - /// Values specified by the user. - public void AppendArrayIfNotNull(string switchName, IEnumerable values) - { - if (values != null) - { - foreach (ITaskItem value in values) - { - this.AppendSwitchIfNotNull(switchName, value); - } - } - } - - /// - /// Append a switch to the command line if any values in the array have been specified. - /// - /// Switch to append. - /// Values specified by the user. - public void AppendArrayIfNotNull(string switchName, IEnumerable values) - { - if (values != null) - { - foreach (string value in values) - { - this.AppendSwitchIfNotNull(switchName, value); - } - } - } - - /// - /// Build the extensions argument. Each extension is searched in the current folder, user defined search - /// directories (ReferencePath), HintPath, and under Wix Extension Directory in that order. - /// The order of precedence is based off of that described in Microsoft.Common.Targets's SearchPaths - /// property for the ResolveAssemblyReferences task. - /// - /// The list of extensions to include. - /// Evaluated default folder for Wix Extensions - /// User defined reference directories to search in - public void AppendExtensions(ITaskItem[] extensions, string wixExtensionDirectory, string [] referencePaths) - { - if (extensions == null) - { - return; - } - - foreach (ITaskItem extension in extensions) - { - string className = extension.GetMetadata("Class"); - - string fileName = Path.GetFileName(extension.ItemSpec); - - if (String.IsNullOrEmpty(Path.GetExtension(fileName))) - { - fileName += ".dll"; - } - - // First try reference paths - var resolvedPath = FileSearchHelperMethods.SearchFilePaths(referencePaths, fileName); - - if (String.IsNullOrEmpty(resolvedPath)) - { - // Now try HintPath - resolvedPath = extension.GetMetadata("HintPath"); - - if (!File.Exists(resolvedPath)) - { - // Now try the item itself - resolvedPath = extension.ItemSpec; - - if (String.IsNullOrEmpty(Path.GetExtension(resolvedPath))) - { - resolvedPath += ".dll"; - } - - if (!File.Exists(resolvedPath)) - { - if (!String.IsNullOrEmpty(wixExtensionDirectory)) - { - // Now try the extension directory - resolvedPath = Path.Combine(wixExtensionDirectory, Path.GetFileName(resolvedPath)); - } - - if (!File.Exists(resolvedPath)) - { - // Extension wasn't found, just set it to the extension name passed in - resolvedPath = extension.ItemSpec; - } - } - } - } - - if (String.IsNullOrEmpty(className)) - { - this.AppendSwitchIfNotNull("-ext ", resolvedPath); - } - else - { - this.AppendSwitchIfNotNull("-ext ", className + ", " + resolvedPath); - } - } - } - - /// - /// Append arbitrary text to the command-line if specified. - /// - /// Text to append. - public void AppendTextIfNotNull(string textToAppend) - { - if (!String.IsNullOrEmpty(textToAppend)) - { - this.AppendSpaceIfNotEmpty(); - this.AppendTextUnquoted(textToAppend); - } - } - - /// - /// Append arbitrary text to the command-line if specified. - /// - /// Text to append. - public void AppendTextIfNotWhitespace(string textToAppend) - { - if (!String.IsNullOrWhiteSpace(textToAppend)) - { - this.AppendSpaceIfNotEmpty(); - this.AppendTextUnquoted(textToAppend); - } - } - } -} diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj deleted file mode 100644 index 3a1c7f4c..00000000 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - netcoreapp3.1;net461 - - WiX Toolset MSBuild Tasks - embedded - true - win-x86 - - AnyCPU - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject b/src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/WixToolset.Sdk/Sdk/Sdk.props b/src/WixToolset.Sdk/Sdk/Sdk.props deleted file mode 100644 index c517a1cf..00000000 --- a/src/WixToolset.Sdk/Sdk/Sdk.props +++ /dev/null @@ -1,23 +0,0 @@ - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) - - - - .NETFramework,Version=v4.8 - true - true - true - - - - - - - diff --git a/src/WixToolset.Sdk/Sdk/Sdk.targets b/src/WixToolset.Sdk/Sdk/Sdk.targets deleted file mode 100644 index e21cf5c6..00000000 --- a/src/WixToolset.Sdk/Sdk/Sdk.targets +++ /dev/null @@ -1,15 +0,0 @@ - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - $(DefaultItemExcludes);$(BaseOutputPath)** - $(DefaultItemExcludes);$(BaseIntermediateOutputPath)** - $(DefaultItemExcludesInProjectFolder);**/.*/** - - diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.csproj b/src/WixToolset.Sdk/WixToolset.Sdk.csproj deleted file mode 100644 index 2374bf86..00000000 --- a/src/WixToolset.Sdk/WixToolset.Sdk.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - netcoreapp3.1 - false - WiX Toolset MSBuild integration - $(MSBuildThisFileName).nuspec - $(OutputPath)publish\WixToolset.Sdk\ - Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) - - - - - - - - - - - - - - - - - - $(GenerateNuspecDependsOn);SetNuspecVersion - - - - - - $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) - - - diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.nuspec b/src/WixToolset.Sdk/WixToolset.Sdk.nuspec deleted file mode 100644 index 591b63a6..00000000 --- a/src/WixToolset.Sdk/WixToolset.Sdk.nuspec +++ /dev/null @@ -1,18 +0,0 @@ - - - - $id$ - $version$ - $authors$ - $authors$ - false - $description$ - $copyright$ - - - - - - - - diff --git a/src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject b/src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/WixToolset.Sdk/build/WixToolset.Sdk.props b/src/WixToolset.Sdk/build/WixToolset.Sdk.props deleted file mode 100644 index b453361b..00000000 --- a/src/WixToolset.Sdk/build/WixToolset.Sdk.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) - - diff --git a/src/WixToolset.Sdk/tools/wix.ca.targets b/src/WixToolset.Sdk/tools/wix.ca.targets deleted file mode 100644 index 4578c2d8..00000000 --- a/src/WixToolset.Sdk/tools/wix.ca.targets +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - true - - $(TargetName).CA$(TargetExt) - - $(MSBuildThisFileDirectory) - $(WixSdkPath)x86\ - $(WixSdkPath)x64\ - - $(WixSdkPath)MakeSfxCA.exe - $(WixSdkX64Path)SfxCA.dll - $(WixSdkX86Path)SfxCA.dll - - - - - - - - - - - - - - - - - - - @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.Sdk/tools/wix.harvest.targets b/src/WixToolset.Sdk/tools/wix.harvest.targets deleted file mode 100644 index f3ec760b..00000000 --- a/src/WixToolset.Sdk/tools/wix.harvest.targets +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - - - $(WixToolDir) - - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - true - false - true - false - - - - - - false - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - $(IntermediateOutputPath)Product.Generated.wxs - $(IntermediateOutputPath)Bundle.Generated.wxs - $(MSBuildBinPath) - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - $(HarvestNoLogo) - $(HarvestSuppressAllWarnings) - $(HarvestSuppressSpecificWarnings) - $(HarvestTreatWarningsAsErrors) - $(HarvestTreatSpecificWarningsAsErrors) - $(HarvestVerboseOutput) - $(HarvestAutogenerateGuids) - $(HarvestGenerateGuidsNow) - $(HarvestSuppressFragments) - $(HarvestSuppressUniqueIds) - $(HarvestTransforms) - - - - - - ConvertReferences; - ConvertBundleReferences; - HarvestProjects; - HarvestDirectory; - HarvestFile; - GenerateCode; - - - - - - - - RefreshGeneratedFile; - RefreshBundleGeneratedFile - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - %(_MSBuildProjectReferenceExistent.RefTargetDir) - Binaries;Symbols;Sources;Content;Satellites;Documents - %(_MSBuildProjectReferenceExistent.Name) - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> - Binaries;Symbols;Sources;Content;Satellites;Documents - payloadgroup - $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs - - - - - - - - - - <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - $(HarvestProjectsTransforms) - $(HarvestProjectsProjectOutputGroups) - $(HarvestProjectsDirectoryIds) - - - - - CombineHarvestProjects - - - - - - - - - - - - - - - - - $(HarvestDirectoryTransforms) - $(HarvestDirectoryComponentGroupName) - $(HarvestDirectoryDirectoryRefId) - $(HarvestDirectoryKeepEmptyDirectories) - $(HarvestDirectoryPreprocessorVariable) - $(HarvestDirectorySuppressCom) - $(HarvestDirectorySuppressRootDirectory) - $(HarvestDirectorySuppressRegistry) - - - - - - GetHarvestDirectoryContent - - - - - - - - - - - - - - - - - - - - - - - - - - $(HarvestFileTransforms) - $(HarvestFileComponentGroupName) - $(HarvestFileDirectoryRefId) - $(HarvestFilePreprocessorVariable) - $(HarvestFileSuppressCom) - $(HarvestFileSuppressRegistry) - $(HarvestFileSuppressRootDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.Sdk/tools/wix.signing.targets b/src/WixToolset.Sdk/tools/wix.signing.targets deleted file mode 100644 index 7c25175f..00000000 --- a/src/WixToolset.Sdk/tools/wix.signing.targets +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - $(MSBuildProjectFile).Signed.txt - $(IntermediateOutputPath)$(SignedFileName) - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - GetMsmsToSign; - InternalSignMsm; - - - GetCabsToSign; - GetMsiToSign; - InternalSignCabs; - InscribeMsi; - InternalSignMsi; - - - GetContainersToSign; - InternalSignContainers; - InscribeBundleEngine; - InternalSignBundleEngine; - InscribeBundle; - InternalSignBundle; - - - - WixBuild; - CalculateSignTargetFiles; - BeforeSigning; - $(InternalSignDependsOn); - AfterSigning - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/WixToolset.Sdk/tools/wix.targets b/src/WixToolset.Sdk/tools/wix.targets deleted file mode 100644 index 5044bf5e..00000000 --- a/src/WixToolset.Sdk/tools/wix.targets +++ /dev/null @@ -1,1083 +0,0 @@ - - - - - - true - - - - - - - - - - $(MSBuildThisFileDirectory)netcoreapp3.1\ - $(MSBuildThisFileDirectory)net461\x86\ - $(MSBuildThisFileDirectory)net461\x64\ - $(WixBinDir)WixToolset.BuildTasks.dll - $(WixBinDir64)WixToolset.BuildTasks.dll - - - - $(MSBuildThisFileDirectory)wix.harvest.targets - $(MSBuildThisFileDirectory)wix.signing.targets - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildAllProjects);$(WixHarvestTargetsPath) - $(MSBuildAllProjects);$(WixSigningTargetsPath) - $(MSBuildAllProjects);$(CustomBeforeWixTargets) - $(MSBuildAllProjects);$(CustomAfterWixTargets) - - - - - - .wxs - wix - wix - - - $(MSBuildProjectName) - $(OutputName) - - - Package - - - full - - - - - .msi - .msm - .pcp - .wixlib - .exe - .wixipl - - - - - - - $(TargetDir) - $(PdbOutputDir)\ - - - $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) - - - $(TargetName).wixpdb - - - $(TargetPdbDir)$(TargetPdbFileName) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildProjectFile).BindContentsFileList.txt - $(MSBuildProjectFile).BindOutputsFileList.txt - $(MSBuildProjectFile).BindBuiltOutputsFileList.txt - - - - $(IntermediateOutputPath)cabcache\ - - - - $(WixBinDir) - - - - - - - - - - - - $(NoLogo) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - $(Platform) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - $(NoLogo) - $(BindFiles) - $(Pedantic) - $(SuppressAllWarnings) - $(SuppressSpecificWarnings) - $(SuppressSchemaValidation) - $(SuppressIntermediateFileVersionMatching) - $(TreatWarningsAsErrors) - $(TreatSpecificWarningsAsErrors) - $(VerboseOutput) - - - - - - - - - - - - - - - - - - <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. - <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) - - - - - - - - - - - - - - - - - BuildOnlySettings; - PrepareForBuild; - PreBuildEvent; - - WixBuild; - Signing; - - GetTargetPath; - PrepareForRun; - IncrementalClean; - PostBuildEvent - - - - - - - - - - BeforeResolveReferences; - AssignProjectConfiguration; - ResolveProjectReferences; - ResolveWixLibraryReferences; - ResolveWixExtensionReferences; - AfterResolveReferences - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AssignTargetPaths - - - - - - - - - ResolveReferences; - BeforeCompile; - _TimeStampBeforeCompile; - - CalculateDefineConstants; - Harvest; - - GenerateCompileWithObjectPath; - - AssignTargetPaths; - ReadPreviousBindInputsAndBuiltOutputs; - - CoreWixBuild; - - UpdateLinkFileWrites; - _TimeStampAfterCompile; - AfterCompile - - - - - - - - - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) - - $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) - - - - - - - - - - - ResolveReferences - - - - - - Configuration=$(ConfigurationName); - OutDir=$(OutDir); - Platform=$(PlatformName); - ProjectDir=$(ProjectDir); - ProjectExt=$(ProjectExt); - ProjectFileName=$(ProjectFileName); - ProjectName=$(ProjectName); - ProjectPath=$(ProjectPath); - TargetDir=$(TargetDir); - TargetExt=$(TargetExt); - TargetFileName=$(TargetFileName); - TargetName=$(TargetName); - TargetPath=$(TargetPath); - - - - - $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) - $(SolutionDefineConstants);SolutionDir=$(SolutionDir) - $(SolutionDefineConstants);SolutionExt=$(SolutionExt) - $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) - $(SolutionDefineConstants);SolutionName=$(SolutionName) - $(SolutionDefineConstants);SolutionPath=$(SolutionPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> - <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> - - - - @(_CulturedTargetPath) - @(_CulturedTargetPdbPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(TargetPath) - $(TargetFileName) - - - - - - PrepareForBuild;AssignTargetPaths - - - - - - - - - - - - - <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> - - - - - - - %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) - - - - - - - AssignTargetPaths - - - - - - - - - - - - - - - - true - - - - true - true - $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) - - - - - - - - - <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> - <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/dotnet-wix/DotnetToolSettings.xml b/src/dotnet-wix/DotnetToolSettings.xml deleted file mode 100644 index a7a87fb2..00000000 --- a/src/dotnet-wix/DotnetToolSettings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/dotnet-wix/dotnet-wix.csproj b/src/dotnet-wix/dotnet-wix.csproj deleted file mode 100644 index 710ab5cd..00000000 --- a/src/dotnet-wix/dotnet-wix.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - netcoreapp3.1 - false - WiX Toolset Command-line interface - $(MSBuildThisFileName).nuspec - $(OutputPath)publish\dotnet-wix\ - Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) - - - - - - - - $(GenerateNuspecDependsOn);SetNuspecVersion - - - - - - $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) - - - diff --git a/src/dotnet-wix/dotnet-wix.nuspec b/src/dotnet-wix/dotnet-wix.nuspec deleted file mode 100644 index 66d42c75..00000000 --- a/src/dotnet-wix/dotnet-wix.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - $id$ - $version$ - $authors$ - $authors$ - false - $description$ - $copyright$ - - - - - - - - - - diff --git a/src/dotnet-wix/dotnet-wix.v3.ncrunchproject b/src/dotnet-wix/dotnet-wix.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/dotnet-wix/dotnet-wix.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/heat/AssemblyHarvester.cs b/src/heat/AssemblyHarvester.cs deleted file mode 100644 index be61f275..00000000 --- a/src/heat/AssemblyHarvester.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Reflection; - using System.Runtime.InteropServices; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring from an assembly file. - /// - internal class AssemblyHarvester - { - /// - /// Harvest the registry values written by RegisterAssembly. - /// - /// The file to harvest registry values from. - /// The harvested registry values. - public Wix.RegistryValue[] HarvestRegistryValues(string path) - { -#if NETCOREAPP - throw new PlatformNotSupportedException(); -#else - RegistrationServices regSvcs = new RegistrationServices(); - Assembly assembly = Assembly.LoadFrom(path); - - // must call this before overriding registry hives to prevent binding failures - // on exported types during RegisterAssembly - assembly.GetExportedTypes(); - - using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) - { - regSvcs.RegisterAssembly(assembly, AssemblyRegistrationFlags.SetCodeBase); - - return registryHarvester.HarvestRegistry(); - } -#endif - } - } -} diff --git a/src/heat/Data/HarvesterErrors.cs b/src/heat/Data/HarvesterErrors.cs deleted file mode 100644 index a8a3055a..00000000 --- a/src/heat/Data/HarvesterErrors.cs +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Data -{ - using System; - using System.Resources; - using WixToolset.Data; - -#pragma warning disable 1591 // TODO: add documentation - public static class HarvesterErrors - { - public static Message ArgumentRequiresValue(string argument) - { - return Message(null, Ids.ArgumentRequiresValue, "The argument '{0}' does not have a value specified and it is required.", argument); - } - - public static Message BuildErrorDuringHarvesting(string buildError) - { - return Message(null, Ids.BuildErrorDuringHarvesting, "Build error during harvesting: {0}", buildError); - } - - public static Message BuildFailed() - { - return Message(null, Ids.BuildFailed, "Build failed."); - } - - public static Message CannotBuildProject(string projectFile, string innerExceptionMessage) - { - return Message(null, Ids.CannotBuildProject, "Failed to build project {0}: {1}", projectFile, innerExceptionMessage); - } - - public static Message CannotHarvestWebSite() - { - return Message(null, Ids.CannotHarvestWebSite, "Cannot harvest website. On Windows Vista, you must install IIS 6 Management Compatibility."); - } - - public static Message CannotLoadMSBuildAssembly(string innerExceptionMessage) - { - return Message(null, Ids.CannotLoadMSBuildAssembly, "Failed to load MSBuild assembly: {0}", innerExceptionMessage); - } - - public static Message CannotLoadMSBuildEngine(string innerExceptionMessage) - { - return Message(null, Ids.CannotLoadMSBuildEngine, "Failed to load MSBuild engine: {0}", innerExceptionMessage); - } - - public static Message CannotLoadMSBuildWrapperAssembly(string innerExceptionMessage) - { - return Message(null, Ids.CannotLoadMSBuildWrapperAssembly, "Failed to load MSBuild wrapper assembly: {0}", innerExceptionMessage); - } - - public static Message CannotLoadMSBuildWrapperObject(string innerExceptionMessage) - { - return Message(null, Ids.CannotLoadMSBuildWrapperObject, "Failed to load MSBuild wrapper object: {0}", innerExceptionMessage); - } - - public static Message CannotLoadMSBuildWrapperType(string innerExceptionMessage) - { - return Message(null, Ids.CannotLoadMSBuildWrapperType, "Failed to load MSBuild wrapper type: {0}", innerExceptionMessage); - } - - public static Message CannotLoadProject(string projectFile, string innerExceptionMessage) - { - return Message(null, Ids.CannotLoadProject, "Failed to load project {0}: {1}", projectFile, innerExceptionMessage); - } - - public static Message DirectoryAttributeAccessorBadType(string attributeName) - { - return Message(null, Ids.DirectoryAttributeAccessorBadType, "DirectoryAttributeAccessor tried to access an invalid element type for attribute '{0'}.", attributeName); - } - - public static Message DirectoryNotFound(string directory) - { - return Message(null, Ids.DirectoryNotFound, "The directory '{0}' could not be found.", directory); - } - - public static Message EmptyDirectory(string directory) - { - return Message(null, Ids.EmptyDirectory, "The directory '{0}' did not contain any files or sub-directories and since empty directories are not being kept, there was nothing to harvest.", directory); - } - - public static Message ErrorTransformingHarvestedWiX(string transform, string message) - { - return Message(null, Ids.ErrorTransformingHarvestedWiX, "Error applying transform {0} to harvested WiX: {1}", transform, message); - } - - public static Message FileNotFound(string file) - { - return Message(null, Ids.FileNotFound, "The file '{0}' cannot be found.", file); - } - - public static Message InsufficientPermissionHarvestWebSite() - { - return Message(null, Ids.InsufficientPermissionHarvestWebSite, "Not enough permissions to harvest website. On Windows Vista, you must run Heat elevated."); - } - - public static Message InvalidDirectoryId(string generateType) - { - return Message(null, Ids.InvalidDirectoryId, "Invalid directory ID: {0}. Check that it doesn't start with a hyphen or slash.", generateType); - } - - public static Message InvalidDirectoryOutputType(string generateType) - { - return Message(null, Ids.InvalidOutputType, "Invalid generated type: {0}. Must be one of: components, payloadgroup.", generateType); - } - - public static Message InvalidOutputGroup(string outputGroup) - { - return Message(null, Ids.InvalidOutputGroup, "Invalid project output group: {0}.", outputGroup); - } - - public static Message InvalidProjectOutputType(string generateType) - { - return Message(null, Ids.InvalidOutputType, "Invalid generated type: {0}. Must be one of: components, container, payloadgroup, packagegroup.", generateType); - } - - public static Message InvalidProjectName(string generateType) - { - return Message(null, Ids.InvalidProjectName, "Invalid project name: {0}. Check that it doesn't start with a hyphen or slash.", generateType); - } - - public static Message MissingProjectOutputGroup(string projectFile, string outputGroup) - { - return Message(null, Ids.MissingProjectOutputGroup, "Missing project output group '{1}' in project {0}.", projectFile, outputGroup); - } - - public static Message MsbuildBinPathRequired(string version) - { - return Message(null, Ids.MsbuildBinPathRequired, "MSBuildBinPath required for ToolsVersion '{0}'", version); - } - - public static Message NoOutputGroupSpecified() - { - return Message(null, Ids.NoOutputGroupSpecified, "No project output group specified."); - } - - public static Message PerformanceCategoryNotFound(string key) - { - return Message(null, Ids.PerformanceCategoryNotFound, "Performance category '{0}' not found.", key); - } - - public static Message SpacesNotAllowedInArgumentValue(string arg, string value) - { - return Message(null, Ids.SpacesNotAllowedInArgumentValue, "The switch '{0}' does not allow the spaces from the value. Please remove the spaces in from the value: {1}", arg, value); - } - - public static Message UnableToOpenRegistryKey(string key) - { - return Message(null, Ids.UnableToOpenRegistryKey, "Unable to open registry key '{0}'.", key); - } - - public static Message UnsupportedPerformanceCounterType(string key) - { - return Message(null, Ids.UnsupportedPerformanceCounterType, "Unsupported performance counter type '{0}'.", key); - } - - public static Message WebSiteNotFound(string webSiteDescription) - { - return Message(null, Ids.WebSiteNotFound, "The web site '{0}' could not be found. Please check that the web site exists, and that it is spelled correctly (please note, you must use the correct case).", webSiteDescription); - } - - private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) - { - return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); - } - - private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) - { - return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); - } - - public enum Ids - { - DirectoryNotFound = 5052, - EmptyDirectory = 5053, - ErrorTransformingHarvestedWiX = 5055, - UnableToOpenRegistryKey = 5056, - SpacesNotAllowedInArgumentValue = 5057, - ArgumentRequiresValue = 5058, - FileNotFound = 5059, - PerformanceCategoryNotFound = 5060, - UnsupportedPerformanceCounterType = 5061, - WebSiteNotFound = 5158, - InsufficientPermissionHarvestWebSite = 5159, - CannotHarvestWebSite = 5160, - InvalidOutputGroup = 5301, - NoOutputGroupSpecified = 5302, - CannotLoadMSBuildAssembly = 5303, - CannotLoadMSBuildEngine = 5304, - CannotLoadProject = 5305, - CannotBuildProject = 5306, - BuildFailed = 5307, - MissingProjectOutputGroup = 5308, - DirectoryAttributeAccessorBadType = 5309, - InvalidOutputType = 5310, - InvalidDirectoryId = 5311, - InvalidProjectName = 5312, - BuildErrorDuringHarvesting = 5313, - CannotLoadMSBuildWrapperAssembly = 5314, - CannotLoadMSBuildWrapperType = 5315, - CannotLoadMSBuildWrapperObject = 5316, - MsbuildBinPathRequired = 5317, - } - } -} diff --git a/src/heat/Data/HarvesterVerboses.cs b/src/heat/Data/HarvesterVerboses.cs deleted file mode 100644 index 72de2351..00000000 --- a/src/heat/Data/HarvesterVerboses.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Data -{ - using System; - using System.Resources; - using WixToolset.Data; - -#pragma warning disable 1591 // TODO: add documentation - public static class HarvesterVerboses - { - public static Message FoundToolsVersion(string toolsVersion) - { - return Message(null, Ids.FoundToolsVersion, "Found ToolsVersion {0} inside project file.", toolsVersion); - } - - public static Message HarvestingAssembly(string fileName) - { - return Message(null, Ids.HarvestingAssembly, "Trying to harvest {0} as an assembly.", fileName); - } - - public static Message HarvestingSelfReg(string fileName) - { - return Message(null, Ids.HarvestingSelfReg, "Trying to harvest self-registration information from native DLL {0}.", fileName); - } - - public static Message HarvestingTypeLib(string fileName) - { - return Message(null, Ids.HarvestingTypeLib, "Trying to harvest type-library information from native DLL {0}.", fileName); - } - - public static Message LoadingProjectWithBinPath(string msbuildBinPath) - { - return Message(null, Ids.LoadingProjectWithBinPath, "Loading project using MSBuild bin path {0}.", msbuildBinPath); - } - - public static Message LoadingProjectWithVersion(string msbuildVersion) - { - return Message(null, Ids.LoadingProjectWithVersion, "Loading project using MSBuild version {0}.", msbuildVersion); - } - - private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) - { - return new Message(sourceLineNumber, MessageLevel.Verbose, (int)id, format, args); - } - - private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) - { - return new Message(sourceLineNumber, MessageLevel.Verbose, (int)id, resourceManager, resourceName, args); - } - - public enum Ids - { - HarvestingAssembly = 5100, - HarvestingSelfReg = 5101, - HarvestingTypeLib = 5102, - LoadingProjectWithVersion = 5378, - FoundToolsVersion = 5379, - LoadingProjectWithBinPath = 5380, - } - } -} diff --git a/src/heat/Data/HarvesterWarnings.cs b/src/heat/Data/HarvesterWarnings.cs deleted file mode 100644 index 80ee5c31..00000000 --- a/src/heat/Data/HarvesterWarnings.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Data -{ - using System; - using System.Resources; - using WixToolset.Data; - -#pragma warning disable 1591 // TODO: add documentation - public static class HarvesterWarnings - { - public static Message AssemblyHarvestFailed(string file, string message) - { - return Message(null, Ids.AssemblyHarvestFailed, "Could not harvest data from a file that was expected to be an assembly: {0}. If this file is not an assembly you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); - } - - public static Message DuplicateDllRegistryEntry(string registryKey, string componentId) - { - return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{1}'.", registryKey, componentId); - } - - public static Message DuplicateDllRegistryEntry(string registryKey, string registryKeyValue, string componentId) - { - return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{2}'. The registry key value '{1}' will not be harvested.", registryKey, registryKeyValue, componentId); - } - - public static Message EncounteredNullDirectoryForWebSite(string directory) - { - return Message(null, Ids.EncounteredNullDirectoryForWebSite, "Could not harvest website directory: {0}. Please update the output with the appropriate directory ID before using.", directory); - } - - public static Message NoLogger(string exceptionMessage) - { - return Message(null, Ids.NoLogger, "Failed to set loggers: {0}", exceptionMessage); - } - - public static Message NoProjectConfiguration(string exceptionMessage) - { - return Message(null, Ids.NoProjectConfiguration, "Failed to set project configuration and platform: {0}", exceptionMessage); - } - - public static Message SelfRegHarvestFailed(string file, string message) - { - return Message(null, Ids.SelfRegHarvestFailed, "Could not harvest data from a file that was expected to be a SelfReg DLL: {0}. If this file does not support SelfReg you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); - } - - public static Message TypeLibLoadFailed(string file, string message) - { - return Message(null, Ids.TypeLibLoadFailed, "Could not load file that was expected to be a type library based off of file extension: {0}. If this file is not a type library you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the load failure: {1}", file, message); - } - - public static Message UnsupportedRegistryType(string registryValue, int regFileLineNumber, string unsupportedType) - { - return Message(null, Ids.UnsupportedRegistryType, "Ignoring the registry value '{0}' found on line {1}, because it is of a type unsupported by Windows Installer ({2}).", registryValue, regFileLineNumber, unsupportedType); - } - - private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) - { - return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); - } - - private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) - { - return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args); - } - - public enum Ids - { - SelfRegHarvestFailed = 5150, - AssemblyHarvestFailed = 5151, - TypeLibLoadFailed = 5152, - DuplicateDllRegistryEntry = 5156, - UnsupportedRegistryType = 5157, - NoProjectConfiguration = 5398, - NoLogger = 5399, - EncounteredNullDirectoryForWebSite = 5400, - } - } -} diff --git a/src/heat/Data/HeatCommandLineOption.cs b/src/heat/Data/HeatCommandLineOption.cs deleted file mode 100644 index 5815abf0..00000000 --- a/src/heat/Data/HeatCommandLineOption.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Data -{ - /// - /// A command line option. - /// - public struct HeatCommandLineOption - { - /// - /// The option name used on the command line. - /// - public string Option; - - /// - /// Description shown in Help command. - /// - public string Description; - - /// - /// Instantiates a new CommandLineOption. - /// - /// The option name. - /// The description of the option. - public HeatCommandLineOption(string option, string description) - { - this.Option = option; - this.Description = description; - } - } -} diff --git a/src/heat/Data/IHeatCommandLine.cs b/src/heat/Data/IHeatCommandLine.cs deleted file mode 100644 index 9198468d..00000000 --- a/src/heat/Data/IHeatCommandLine.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Data -{ - using WixToolset.Extensibility.Data; - -#pragma warning disable 1591 // TODO: add documentation - public interface IHeatCommandLine - { - ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments); - } -} diff --git a/src/heat/DirectoryHarvester.cs b/src/heat/DirectoryHarvester.cs deleted file mode 100644 index 090d67ab..00000000 --- a/src/heat/DirectoryHarvester.cs +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.IO; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring for a directory from the file system. - /// - internal class DirectoryHarvester : BaseHarvesterExtension - { - private FileHarvester fileHarvester; - - private const string ComponentPrefix = "cmp"; - private const string DirectoryPrefix = "dir"; - private const string FilePrefix = "fil"; - - /// - /// Instantiate a new DirectoryHarvester. - /// - public DirectoryHarvester() - { - this.fileHarvester = new FileHarvester(); - this.SetUniqueIdentifiers = true; - } - - /// - /// Gets or sets what type of elements are to be generated. - /// - /// The type of elements being generated. - public GenerateType GenerateType { get; set; } - - /// - /// Gets or sets the option to keep empty directories. - /// - /// The option to keep empty directories. - public bool KeepEmptyDirectories { get; set; } - - /// - /// Gets or sets the rooted DirectoryRef Id if the user has supplied it. - /// - /// The DirectoryRef Id to use as the root. - public string RootedDirectoryRef { get; set; } - - /// - /// Gets of sets the option to set unique identifiers. - /// - /// The option to set unique identifiers. - public bool SetUniqueIdentifiers { get; set; } - - /// - /// Gets or sets the option to suppress including the root directory as an element. - /// - /// The option to suppress including the root directory as an element. - public bool SuppressRootDirectory { get; set; } - - /// - /// Harvest a directory. - /// - /// The path of the directory. - /// The harvested directory. - public override Wix.Fragment[] Harvest(string argument) - { - if (null == argument) - { - throw new ArgumentNullException("argument"); - } - - Wix.IParentElement harvestParent = this.HarvestDirectory(argument, true, this.GenerateType); - Wix.ISchemaElement harvestElement; - - if (this.GenerateType == GenerateType.PayloadGroup) - { - Wix.PayloadGroup payloadGroup = (Wix.PayloadGroup)harvestParent; - payloadGroup.Id = this.RootedDirectoryRef; - harvestElement = payloadGroup; - } - else - { - Wix.Directory directory = (Wix.Directory)harvestParent; - - Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); - directoryRef.Id = this.RootedDirectoryRef; - - if (this.SuppressRootDirectory) - { - foreach (Wix.ISchemaElement element in directory.Children) - { - directoryRef.AddChild(element); - } - } - else - { - directoryRef.AddChild(directory); - } - harvestElement = directoryRef; - } - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(harvestElement); - - return new Wix.Fragment[] { fragment }; - } - - /// - /// Harvest a directory. - /// - /// The path of the directory. - /// The option to harvest child directories and files. - /// The harvested directory. - public Wix.Directory HarvestDirectory(string path, bool harvestChildren) - { - if (null == path) - { - throw new ArgumentNullException("path"); - } - - return (Wix.Directory)this.HarvestDirectory(path, harvestChildren, GenerateType.Components); - } - - /// - /// Harvest a directory. - /// - /// The path of the directory. - /// The option to harvest child directories and files. - /// The type to generate. - /// The harvested directory. - private Wix.IParentElement HarvestDirectory(string path, bool harvestChildren, GenerateType generateType) - { - if (File.Exists(path)) - { - throw new WixException(ErrorMessages.ExpectedDirectoryGotFile("dir", path)); - } - - if (null == this.RootedDirectoryRef) - { - this.RootedDirectoryRef = "TARGETDIR"; - } - - // use absolute paths - path = Path.GetFullPath(path); - - // Remove any trailing separator to ensure Path.GetFileName() will return the directory name. - path = path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - - Wix.IParentElement harvestParent; - if (generateType == GenerateType.PayloadGroup) - { - harvestParent = new Wix.PayloadGroup(); - } - else - { - Wix.Directory directory = new Wix.Directory(); - directory.Name = Path.GetFileName(path); - directory.FileSource = path; - - if (this.SetUniqueIdentifiers) - { - if (this.SuppressRootDirectory) - { - directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, this.RootedDirectoryRef); - } - else - { - directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, this.RootedDirectoryRef, directory.Name); - } - } - harvestParent = directory; - } - - if (harvestChildren) - { - try - { - int fileCount = this.HarvestDirectory(path, "SourceDir\\", harvestParent, generateType); - - if (generateType != GenerateType.PayloadGroup) - { - // its an error to not harvest anything with the option to keep empty directories off - if (0 == fileCount && !this.KeepEmptyDirectories) - { - throw new WixException(HarvesterErrors.EmptyDirectory(path)); - } - } - } - catch (DirectoryNotFoundException) - { - throw new WixException(HarvesterErrors.DirectoryNotFound(path)); - } - } - - return harvestParent; - } - - /// - /// Harvest a directory. - /// - /// The path of the directory. - /// The relative path that will be used when harvesting. - /// The directory for this path. - /// - /// The number of files harvested. - private int HarvestDirectory(string path, string relativePath, Wix.IParentElement harvestParent, GenerateType generateType) - { - int fileCount = 0; - Wix.Directory directory = generateType != GenerateType.PayloadGroup ? (Wix.Directory)harvestParent : null; - - // harvest the child directories - foreach (string childDirectoryPath in Directory.GetDirectories(path)) - { - var childDirectoryName = Path.GetFileName(childDirectoryPath); - Wix.IParentElement newParent; - Wix.Directory childDirectory = null; - - if (generateType == GenerateType.PayloadGroup) - { - newParent = harvestParent; - } - else - { - childDirectory = new Wix.Directory(); - newParent = childDirectory; - - childDirectory.Name = childDirectoryName; - childDirectory.FileSource = childDirectoryPath; - - if (this.SetUniqueIdentifiers) - { - childDirectory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, directory.Id, childDirectory.Name); - } - } - - int childFileCount = this.HarvestDirectory(childDirectoryPath, String.Concat(relativePath, childDirectoryName, "\\"), newParent, generateType); - - if (generateType != GenerateType.PayloadGroup) - { - // keep the directory if it contained any files (or empty directories are being kept) - if (0 < childFileCount || this.KeepEmptyDirectories) - { - directory.AddChild(childDirectory); - } - } - - fileCount += childFileCount; - } - - // harvest the files - string[] files = Directory.GetFiles(path); - if (0 < files.Length) - { - foreach (string filePath in Directory.GetFiles(path)) - { - string fileName = Path.GetFileName(filePath); - string source = String.Concat(relativePath, fileName); - - Wix.ISchemaElement newChild; - if (generateType == GenerateType.PayloadGroup) - { - Wix.Payload payload = new Wix.Payload(); - newChild = payload; - - payload.SourceFile = source; - } - else - { - Wix.Component component = new Wix.Component(); - newChild = component; - - Wix.File file = this.fileHarvester.HarvestFile(filePath); - file.Source = source; - - if (this.SetUniqueIdentifiers) - { - file.Id = this.Core.GenerateIdentifier(FilePrefix, directory.Id, fileName); - component.Id = this.Core.GenerateIdentifier(ComponentPrefix, directory.Id, file.Id); - } - - component.AddChild(file); - } - - harvestParent.AddChild(newChild); - } - } - else if (generateType != GenerateType.PayloadGroup && 0 == fileCount && this.KeepEmptyDirectories) - { - Wix.Component component = new Wix.Component(); - component.KeyPath = Wix.YesNoType.yes; - - if (this.SetUniqueIdentifiers) - { - component.Id = this.Core.GenerateIdentifier(ComponentPrefix, directory.Id); - } - - Wix.CreateFolder createFolder = new Wix.CreateFolder(); - component.AddChild(createFolder); - - directory.AddChild(component); - } - - return fileCount + files.Length; - } - } -} diff --git a/src/heat/DllHarvester.cs b/src/heat/DllHarvester.cs deleted file mode 100644 index 723e44ee..00000000 --- a/src/heat/DllHarvester.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Reflection; - using System.Reflection.Emit; - using System.Runtime.InteropServices; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring from a native DLL file. - /// - internal class DllHarvester - { - /// - /// Harvest the registry values written by calling DllRegisterServer on the specified file. - /// - /// The file to harvest registry values from. - /// The harvested registry values. - public Wix.RegistryValue[] HarvestRegistryValues(string file) - { - // load the DLL - NativeMethods.LoadLibrary(file); - - using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) - { - try - { - DynamicPInvoke(file, "DllRegisterServer", typeof(int), null, null); - - return registryHarvester.HarvestRegistry(); - } - catch (TargetInvocationException e) - { - e.Data["file"] = file; - throw; - } - } - } - - /// - /// Dynamically PInvokes into a DLL. - /// - /// Dynamic link library containing the entry point. - /// Entry point into dynamic link library. - /// Return type of entry point. - /// Type of parameters to entry point. - /// Value of parameters to entry point. - /// Value from invoked code. - private static object DynamicPInvoke(string dll, string entryPoint, Type returnType, Type[] parameterTypes, object[] parameterValues) - { -#if NETCOREAPP - throw new PlatformNotSupportedException(); -#else - AssemblyName assemblyName = new AssemblyName(); - assemblyName.Name = "wixTempAssembly"; - - AssemblyBuilder dynamicAssembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); - ModuleBuilder dynamicModule = dynamicAssembly.DefineDynamicModule("wixTempModule"); - - MethodBuilder dynamicMethod = dynamicModule.DefinePInvokeMethod(entryPoint, dll, MethodAttributes.Static | MethodAttributes.Public | MethodAttributes.PinvokeImpl, CallingConventions.Standard, returnType, parameterTypes, CallingConvention.Winapi, CharSet.Ansi); - dynamicModule.CreateGlobalFunctions(); - - MethodInfo methodInfo = dynamicModule.GetMethod(entryPoint); - return methodInfo.Invoke(null, parameterValues); -#endif - } - - /// - /// Native methods for loading libraries. - /// - private sealed class NativeMethods - { - private const UInt32 LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008; - - /// - /// Load a DLL library. - /// - /// The file name of the executable module. - /// If the function succeeds, the return value is a handle to the mapped executable module. - internal static IntPtr LoadLibrary(string file) - { - IntPtr dllHandle = LoadLibraryEx(file, IntPtr.Zero, NativeMethods.LOAD_WITH_ALTERED_SEARCH_PATH); - - if (IntPtr.Zero == dllHandle) - { - int lastError = Marshal.GetLastWin32Error(); - throw new Exception(String.Format("Unable to load file: {0}, error: {1}", file, lastError)); - } - - return dllHandle; - } - - /// - /// Maps the specified executable module into the address space of the calling process. - /// - /// The file name of the executable module. - /// This parameter is reserved for future use. It must be NULL. - /// Action to take when loading the module. - /// If the function succeeds, the return value is a handle to the mapped executable module. - [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)] - private static extern IntPtr LoadLibraryEx(string file, IntPtr fileHandle, UInt32 flags); - } - } -} diff --git a/src/heat/Extensibility/BaseHarvesterExtension.cs b/src/heat/Extensibility/BaseHarvesterExtension.cs deleted file mode 100644 index 02696d5b..00000000 --- a/src/heat/Extensibility/BaseHarvesterExtension.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The base harvester extension. Any of these methods can be overridden to change - /// the behavior of the harvester. - /// - public abstract class BaseHarvesterExtension : IHarvesterExtension - { - /// - /// Gets or sets the harvester core for the extension. - /// - /// The harvester core for the extension. - public IHarvesterCore Core { get; set; } - - /// - /// Harvest a WiX document. - /// - /// The argument for harvesting. - /// The harvested Fragments. - public abstract Wix.Fragment[] Harvest(string argument); - } -} diff --git a/src/heat/Extensibility/BaseHeatExtension.cs b/src/heat/Extensibility/BaseHeatExtension.cs deleted file mode 100644 index b76aaf62..00000000 --- a/src/heat/Extensibility/BaseHeatExtension.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using System; - using WixToolset.Harvesters.Data; - - /// - /// An extension for the WiX Toolset Harvester application. - /// - public abstract class BaseHeatExtension : IHeatExtension - { - /// - /// Gets or sets the heat core for the extension. - /// - /// The heat core for the extension. - public IHeatCore Core { get; set; } - - /// - /// Gets the supported command line types for this extension. - /// - /// The supported command line types for this extension. - public virtual HeatCommandLineOption[] CommandLineTypes - { - get { return null; } - } - - /// - /// Parse the command line options for this extension. - /// - /// The active harvester type. - /// The option arguments. - public virtual void ParseOptions(string type, string[] args) - { - } - - /// - /// Determines if the index refers to an argument. - /// - /// - /// - /// - public static bool IsValidArg(string[] args, int index) - { - if (args.Length <= index || String.IsNullOrEmpty(args[index]) || '/' == args[index][0] || '-' == args[index][0]) - { - return false; - } - else - { - return true; - } - } - } -} diff --git a/src/heat/Extensibility/BaseMutatorExtension.cs b/src/heat/Extensibility/BaseMutatorExtension.cs deleted file mode 100644 index c36a8ed1..00000000 --- a/src/heat/Extensibility/BaseMutatorExtension.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using System; - using System.Collections.Generic; - using System.Text; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The base mutator extension. Any of these methods can be overridden to change - /// the behavior of the mutator. - /// - public abstract class BaseMutatorExtension : IMutatorExtension - { - /// - /// Gets or sets the mutator core for the extension. - /// - /// The mutator core for the extension. - public IHarvesterCore Core { get; set; } - - /// - /// Gets the sequence of the extension. - /// - /// The sequence of the extension. - public abstract int Sequence { get; } - - /// - /// Mutate a WiX document. - /// - /// The Wix document element. - public virtual void Mutate(Wix.Wix wix) - { - } - - /// - /// Mutate a WiX document as a string. - /// - /// The Wix document element as a string. - /// The mutated Wix document as a string. - public virtual string Mutate(string wixString) - { - return wixString; - } - - /// - /// Generate unique MSI identifiers. - /// - protected class IdentifierGenerator - { - /// - /// - /// - public const int MaxProductIdentifierLength = 72; - - /// - /// - /// - public const int MaxModuleIdentifierLength = 35; - - private string baseName; - private int maxLength; - private Dictionary existingIdentifiers; - private Dictionary possibleIdentifiers; - private IHarvesterCore harvesterCore; - - /// - /// Instantiate a new IdentifierGenerator. - /// - /// The base resource name to use if a resource name contains no usable characters. - /// - public IdentifierGenerator(string baseName, IHarvesterCore harvesterCore) - { - this.baseName = baseName; - this.maxLength = IdentifierGenerator.MaxProductIdentifierLength; - this.existingIdentifiers = new Dictionary(StringComparer.OrdinalIgnoreCase); - this.possibleIdentifiers = new Dictionary(StringComparer.OrdinalIgnoreCase); - this.harvesterCore = harvesterCore; - } - - /// - /// Gets or sets the maximum length for generated identifiers. - /// - /// Maximum length for generated identifiers. (Default is 72.) - public int MaxIdentifierLength - { - get { return this.maxLength; } - set { this.maxLength = value; } - } - - /// - /// Index an existing identifier for collision detection. - /// - /// The identifier. - public void IndexExistingIdentifier(string identifier) - { - if (null == identifier) - { - throw new ArgumentNullException("identifier"); - } - - this.existingIdentifiers[identifier] = null; - } - - /// - /// Index a resource name for collision detection. - /// - /// The resource name. - public void IndexName(string name) - { - if (null == name) - { - throw new ArgumentNullException("name"); - } - - string identifier = this.CreateIdentifier(name, 0); - - if (this.possibleIdentifiers.ContainsKey(identifier)) - { - this.possibleIdentifiers[identifier] = String.Empty; - } - else - { - this.possibleIdentifiers.Add(identifier, null); - } - } - - /// - /// Get the identifier for the given resource name. - /// - /// The resource name. - /// A legal MSI identifier. - public string GetIdentifier(string name) - { - if (null == name) - { - throw new ArgumentNullException("name"); - } - - for (int i = 0; i <= Int32.MaxValue; i++) - { - string identifier = this.CreateIdentifier(name, i); - - if (this.existingIdentifiers.ContainsKey(identifier) || // already used - (0 == i && 0 != this.possibleIdentifiers.Count && null != this.possibleIdentifiers[identifier]) || // needs an index because its duplicated - (0 != i && this.possibleIdentifiers.ContainsKey(identifier))) // collides with another possible identifier - { - continue; - } - else // use this identifier - { - this.existingIdentifiers.Add(identifier, null); - - return identifier; - } - } - - throw new InvalidOperationException("Could not find a unique identifier for the given resource name."); - } - - /// - /// Create a legal MSI identifier from a resource name and an index. - /// - /// The name of the resource for which an identifier should be created. - /// An index to append to the end of the identifier to make it unique. - /// A legal MSI identifier. - public string CreateIdentifier(string name, int index) - { - if (null == name) - { - throw new ArgumentNullException("name"); - } - - StringBuilder identifier = new StringBuilder(); - - // Convert the name to a standard MSI identifier - identifier.Append(this.harvesterCore.CreateIdentifierFromFilename(name)); - - // no legal identifier characters were found, use the base id instead - if (0 == identifier.Length) - { - identifier.Append(this.baseName); - } - - // truncate the identifier if it's too long (reserve 3 characters for up to 99 collisions) - int adjustedMaxLength = this.MaxIdentifierLength - (index != 0 ? 3 : 0); - if (adjustedMaxLength < identifier.Length) - { - identifier.Length = adjustedMaxLength; - } - - // if the index is not zero, then append it to the identifier name - if (0 != index) - { - identifier.AppendFormat("_{0}", index); - } - - return identifier.ToString(); - } - } - } -} diff --git a/src/heat/Extensibility/IHarvester.cs b/src/heat/Extensibility/IHarvester.cs deleted file mode 100644 index 6d363b50..00000000 --- a/src/heat/Extensibility/IHarvester.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Interface for the harvester. - /// - public interface IHarvester - { - /// - /// Gets or sets the harvester core for the extension. - /// - /// The harvester core for the extension. - IHarvesterCore Core { get; } - - /// - /// Gets or sets the extension. - /// - /// The extension. - IHarvesterExtension Extension { get; set; } - - /// - /// Harvest wix authoring. - /// - /// The argument for harvesting. - /// The harvested wix authoring. - Wix.Wix Harvest(string argument); - } -} diff --git a/src/heat/Extensibility/IHarvesterCore.cs b/src/heat/Extensibility/IHarvesterCore.cs deleted file mode 100644 index 3c34b8a1..00000000 --- a/src/heat/Extensibility/IHarvesterCore.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using WixToolset.Extensibility.Services; - - /// - /// The WiX Toolset harvester core. - /// - public interface IHarvesterCore - { - /// - /// - /// - IMessaging Messaging { get; set; } - - /// - /// Gets or sets the value of the extension argument passed to heat. - /// - /// The extension argument. - string ExtensionArgument { get; set; } - - /// - /// Gets or sets the value of the root directory that is being harvested. - /// - /// The root directory being harvested. - string RootDirectory { get; set; } - - /// - /// Create an identifier based on passed file name - /// - /// File name to generate identifer from - /// - string CreateIdentifierFromFilename(string filename); - - /// - /// Generate an identifier by hashing data from the row. - /// - /// Three letter or less prefix for generated row identifier. - /// Information to hash. - /// The generated identifier. - string GenerateIdentifier(string prefix, params string[] args); - - /// - /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". - /// - /// The Wix.File.Source value with "SourceDir\". - /// The full path of the file. - string ResolveFilePath(string fileSource); - } -} diff --git a/src/heat/Extensibility/IHarvesterExtension.cs b/src/heat/Extensibility/IHarvesterExtension.cs deleted file mode 100644 index 5125ea32..00000000 --- a/src/heat/Extensibility/IHarvesterExtension.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using Wix = WixToolset.Harvesters.Serialize; - -#pragma warning disable 1591 // TODO: add documentation - public interface IHarvesterExtension - { - IHarvesterCore Core { get; set; } - - Wix.Fragment[] Harvest(string argument); - } -} diff --git a/src/heat/Extensibility/IHeatCore.cs b/src/heat/Extensibility/IHeatCore.cs deleted file mode 100644 index 0aa01b62..00000000 --- a/src/heat/Extensibility/IHeatCore.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using WixToolset.Extensibility.Services; - - /// - /// The WiX Toolset Harvester application core. - /// - public interface IHeatCore - { - /// - /// Gets the harvester. - /// - /// The harvester. - IHarvester Harvester { get; } - - /// - /// - /// - IMessaging Messaging { get; } - - /// - /// Gets the mutator. - /// - /// The mutator. - IMutator Mutator { get; } - } -} diff --git a/src/heat/Extensibility/IHeatExtension.cs b/src/heat/Extensibility/IHeatExtension.cs deleted file mode 100644 index 8a00da37..00000000 --- a/src/heat/Extensibility/IHeatExtension.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using WixToolset.Harvesters.Data; - -#pragma warning disable 1591 // TODO: add documentation - public interface IHeatExtension - { - IHeatCore Core { get; set; } - - HeatCommandLineOption[] CommandLineTypes { get; } - - void ParseOptions(string type, string[] args); - } -} diff --git a/src/heat/Extensibility/IMutator.cs b/src/heat/Extensibility/IMutator.cs deleted file mode 100644 index c936339e..00000000 --- a/src/heat/Extensibility/IMutator.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Interface for a mutator. - /// - public interface IMutator - { - /// - /// Gets or sets the harvester core for the extension. - /// - /// The harvester core for the extension. - IHarvesterCore Core { get; } - - /// - /// Gets or sets the value of the extension argument passed to heat. - /// - /// The extension argument. - string ExtensionArgument { get; } - - /// - /// Adds a mutator extension. - /// - /// The mutator extension to add. - void AddExtension(IMutatorExtension mutatorExtension); - - /// - /// Mutate a WiX document. - /// - /// The Wix document element. - /// true if mutation was successful - bool Mutate(Wix.Wix wix); - - /// - /// Mutate a WiX document. - /// - /// The Wix document as a string. - /// The mutated Wix document as a string if mutation was successful, else null. - string Mutate(string wixString); - } -} diff --git a/src/heat/Extensibility/IMutatorExtension.cs b/src/heat/Extensibility/IMutatorExtension.cs deleted file mode 100644 index b81f586e..00000000 --- a/src/heat/Extensibility/IMutatorExtension.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Extensibility -{ - using Wix = WixToolset.Harvesters.Serialize; - -#pragma warning disable 1591 // TODO: add documentation - public interface IMutatorExtension - { - IHarvesterCore Core { get; set; } - - int Sequence { get; } - - void Mutate(Wix.Wix wix); - - string Mutate(string wixString); - } -} diff --git a/src/heat/FileHarvester.cs b/src/heat/FileHarvester.cs deleted file mode 100644 index 8bb1a155..00000000 --- a/src/heat/FileHarvester.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.IO; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring for a file from the file system. - /// - internal class FileHarvester : BaseHarvesterExtension - { - private string rootedDirectoryRef; - private bool setUniqueIdentifiers; - private bool suppressRootDirectory; - - private static readonly string ComponentPrefix = "cmp"; - private static readonly string DirectoryPrefix = "dir"; - private static readonly string FilePrefix = "fil"; - - /// - /// Instantiate a new FileHarvester. - /// - public FileHarvester() - { - this.setUniqueIdentifiers = true; - this.suppressRootDirectory = false; - } - - /// - /// Gets or sets the rooted DirectoryRef Id if the user has supplied it. - /// - /// The DirectoryRef Id to use as the root. - public string RootedDirectoryRef - { - get { return this.rootedDirectoryRef; } - set { this.rootedDirectoryRef = value; } - } - - /// - /// Gets of sets the option to set unique identifiers. - /// - /// The option to set unique identifiers. - public bool SetUniqueIdentifiers - { - get { return this.setUniqueIdentifiers; } - set { this.setUniqueIdentifiers = value; } - } - - /// - /// Gets or sets the option to suppress including the root directory as an element. - /// - /// The option to suppress including the root directory as an element. - public bool SuppressRootDirectory - { - get { return this.suppressRootDirectory; } - set { this.suppressRootDirectory = value; } - } - - /// - /// Harvest a file. - /// - /// The path of the file. - /// A harvested file. - public override Wix.Fragment[] Harvest(string argument) - { - if (null == argument) - { - throw new ArgumentNullException("argument"); - } - - if (null == this.rootedDirectoryRef) - { - this.rootedDirectoryRef = "TARGETDIR"; - } - - string fullPath = Path.GetFullPath(argument); - - Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); - directoryRef.Id = this.rootedDirectoryRef; - - Wix.File file = this.HarvestFile(fullPath); - - if (!this.suppressRootDirectory) - { - file.Source = String.Concat("SourceDir\\", Path.GetFileName(Path.GetDirectoryName(fullPath)), "\\", Path.GetFileName(fullPath)); - } - - Wix.Component component = new Wix.Component(); - component.AddChild(file); - - Wix.Directory directory = new Wix.Directory(); - - if (this.suppressRootDirectory) - { - directoryRef.AddChild(component); - } - else - { - string directoryPath = Path.GetDirectoryName(Path.GetFullPath(argument)); - directory.Name = Path.GetFileName(directoryPath); - - if (this.setUniqueIdentifiers) - { - directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, directoryRef.Id, directory.Name); - } - directory.AddChild(component); - directoryRef.AddChild(directory); - } - - if (this.setUniqueIdentifiers) - { - file.Id = this.Core.GenerateIdentifier(FilePrefix, (this.suppressRootDirectory) ? directoryRef.Id : directory.Id, Path.GetFileName(file.Source)); - component.Id = this.Core.GenerateIdentifier(ComponentPrefix, (this.suppressRootDirectory) ? directoryRef.Id : directory.Id, file.Id); - } - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(directoryRef); - - return new Wix.Fragment[] { fragment }; - } - - /// - /// Harvest a file. - /// - /// The path of the file. - /// A harvested file. - public Wix.File HarvestFile(string path) - { - if (null == path) - { - throw new ArgumentNullException("path"); - } - - if (!File.Exists(path)) - { - throw new WixException(HarvesterErrors.FileNotFound(path)); - } - - Wix.File file = new Wix.File(); - - // use absolute paths - path = Path.GetFullPath(path); - - file.KeyPath = Wix.YesNoType.yes; - - file.Source = String.Concat("SourceDir\\", Path.GetFileName(path)); - - return file; - } - } -} diff --git a/src/heat/Harvester.cs b/src/heat/Harvester.cs deleted file mode 100644 index 791c1cb2..00000000 --- a/src/heat/Harvester.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using WixToolset.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The WiX Toolset harvester. - /// - internal class Harvester : IHarvester - { - private IHarvesterExtension harvesterExtension; - - public IHarvesterCore Core { get; set; } - - public IHarvesterExtension Extension - { - get - { - return this.harvesterExtension; - } - set - { - if (null != this.harvesterExtension) - { - throw new InvalidOperationException("Multiple harvester extensions specified."); - } - - this.harvesterExtension = value; - } - } - - public Wix.Wix Harvest(string argument) - { - if (null == argument) - { - throw new ArgumentNullException("argument"); - } - - if (null == this.harvesterExtension) - { - throw new WixException(ErrorMessages.HarvestTypeNotFound()); - } - - this.harvesterExtension.Core = this.Core; - - Wix.Fragment[] fragments = this.harvesterExtension.Harvest(argument); - if (null == fragments || 0 == fragments.Length) - { - return null; - } - - Wix.Wix wix = new Wix.Wix(); - foreach (Wix.Fragment fragment in fragments) - { - wix.AddChild(fragment); - } - - return wix; - } - } -} diff --git a/src/heat/HarvesterCore.cs b/src/heat/HarvesterCore.cs deleted file mode 100644 index 92b34ab0..00000000 --- a/src/heat/HarvesterCore.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.IO; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Extensibility; - - /// - /// The WiX Toolset harvester core. - /// - internal class HarvesterCore : IHarvesterCore - { - public IMessaging Messaging { get; set; } - - public IParseHelper ParseHelper { get; set; } - - /// - /// Gets or sets the value of the extension argument passed to heat. - /// - /// The extension argument. - public string ExtensionArgument { get; set; } - - /// - /// Gets or sets the value of the root directory that is being harvested. - /// - /// The root directory being harvested. - public string RootDirectory { get; set; } - - /// - /// Create an identifier based on passed file name - /// - /// File name to generate identifer from - /// - public string CreateIdentifierFromFilename(string filename) - { - return this.ParseHelper.CreateIdentifierFromFilename(filename).Id; - } - - /// - /// Generate an identifier by hashing data from the row. - /// - /// Three letter or less prefix for generated row identifier. - /// Information to hash. - /// The generated identifier. - public string GenerateIdentifier(string prefix, params string[] args) - { - return this.ParseHelper.CreateIdentifier(prefix, args).Id; - } - - /// - /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". - /// - /// The Wix.File.Source value with "SourceDir\". - /// The full path of the file. - public string ResolveFilePath(string fileSource) - { - if (fileSource.StartsWith("SourceDir\\", StringComparison.Ordinal)) - { - string file = Path.GetFullPath(this.RootDirectory); - if (File.Exists(file)) - { - return file; - } - else - { - fileSource = fileSource.Substring(10); - fileSource = Path.Combine(Path.GetFullPath(this.RootDirectory), fileSource); - } - } - - return fileSource; - } - } -} diff --git a/src/heat/HeatCommand.cs b/src/heat/HeatCommand.cs deleted file mode 100644 index 99f27521..00000000 --- a/src/heat/HeatCommand.cs +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Runtime.InteropServices; - using System.Threading; - using System.Threading.Tasks; - using System.Xml; - using WixToolset.Data; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - internal class HeatCommand : ICommandLineCommand - { - public HeatCommand(string harvestType, IList extensions, IServiceProvider serviceProvider) - { - this.Extensions = extensions; - this.Messaging = serviceProvider.GetService(); - this.ServiceProvider = serviceProvider; - - this.ExtensionType = harvestType; - this.ExtensionOptions.Add(harvestType); - } - - private string ExtensionArgument { get; set; } - - private List ExtensionOptions { get; } = new List(); - - private string ExtensionType { get; } - - private IList Extensions { get; } - - private int Indent { get; set; } = 4; - - private IMessaging Messaging { get; } - - private string OutputFile { get; set; } - - private IServiceProvider ServiceProvider { get; } - - public bool ShowLogo { get; private set; } - - public bool StopParsing { get; private set; } - - public Task ExecuteAsync(CancellationToken cancellationToken) - { - var exitCode = this.Harvest(); - return Task.FromResult(exitCode); - } - - public bool TryParseArgument(ICommandLineParser parser, string arg) - { - if (this.ExtensionArgument == null) - { - this.ExtensionArgument = arg; - } - else if ('-' == arg[0] || '/' == arg[0]) - { - string parameter = arg.Substring(1); - if ("nologo" == parameter) - { - this.ShowLogo = false; - } - else if ("o" == parameter || "out" == parameter) - { - this.OutputFile = parser.GetNextArgumentAsFilePathOrError(arg); - - if (String.IsNullOrEmpty(this.OutputFile)) - { - return false; - } - } - else if ("swall" == parameter) - { - this.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("swall", "sw")); - this.Messaging.SuppressAllWarnings = true; - } - else if (parameter.StartsWith("sw")) - { - string paramArg = parameter.Substring(2); - try - { - if (0 == paramArg.Length) - { - this.Messaging.SuppressAllWarnings = true; - } - else - { - int suppressWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat); - if (0 >= suppressWarning) - { - this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); - } - - this.Messaging.SuppressWarningMessage(suppressWarning); - } - } - catch (FormatException) - { - this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); - } - catch (OverflowException) - { - this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); - } - } - else if ("wxall" == parameter) - { - this.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("wxall", "wx")); - this.Messaging.WarningsAsError = true; - } - else if (parameter.StartsWith("wx")) - { - string paramArg = parameter.Substring(2); - try - { - if (0 == paramArg.Length) - { - this.Messaging.WarningsAsError = true; - } - else - { - int elevateWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat); - if (0 >= elevateWarning) - { - this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); - } - - this.Messaging.ElevateWarningMessage(elevateWarning); - } - } - catch (FormatException) - { - this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); - } - catch (OverflowException) - { - this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); - } - } - else if ("v" == parameter) - { - this.Messaging.ShowVerboseMessages = true; - } - else if ("indent" == parameter) - { - try - { - this.Indent = Int32.Parse(parser.GetNextArgumentOrError(arg), CultureInfo.InvariantCulture); - } - catch - { - throw new ArgumentException("Invalid numeric argument.", parameter); - } - } - } - - this.ExtensionOptions.Add(arg); - return true; - } - - private int Harvest() - { - try - { - if (String.IsNullOrEmpty(this.ExtensionArgument)) - { - this.Messaging.Write(ErrorMessages.HarvestSourceNotSpecified()); - } - else if (String.IsNullOrEmpty(this.OutputFile)) - { - this.Messaging.Write(ErrorMessages.OutputTargetNotSpecified()); - } - - // exit if there was an error parsing the core command line - if (this.Messaging.EncounteredError) - { - return this.Messaging.LastErrorNumber; - } - - if (this.ShowLogo) - { - HelpCommand.DisplayToolHeader(); - } - - var heatCore = new HeatCore(this.ServiceProvider, this.ExtensionArgument); - - // parse the extension's command line arguments - var extensionOptionsArray = this.ExtensionOptions.ToArray(); - foreach (var heatExtension in this.Extensions) - { - heatExtension.Core = heatCore; - heatExtension.ParseOptions(this.ExtensionType, extensionOptionsArray); - } - - // exit if there was an error parsing the command line (otherwise the logo appears after error messages) - if (this.Messaging.EncounteredError) - { - return this.Messaging.LastErrorNumber; - } - - // harvest the output - Wix.Wix wix = heatCore.Harvester.Harvest(this.ExtensionArgument); - if (null == wix) - { - return this.Messaging.LastErrorNumber; - } - - // mutate the output - if (!heatCore.Mutator.Mutate(wix)) - { - return this.Messaging.LastErrorNumber; - } - - XmlWriterSettings xmlSettings = new XmlWriterSettings(); - xmlSettings.Indent = true; - xmlSettings.IndentChars = new string(' ', this.Indent); - xmlSettings.OmitXmlDeclaration = true; - - string wixString; - using (StringWriter stringWriter = new StringWriter()) - { - using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) - { - wix.OutputXml(xmlWriter); - } - - wixString = stringWriter.ToString(); - } - - string mutatedWixString = heatCore.Mutator.Mutate(wixString); - if (String.IsNullOrEmpty(mutatedWixString)) - { - return this.Messaging.LastErrorNumber; - } - - Directory.CreateDirectory(Path.GetDirectoryName(this.OutputFile)); - - using (StreamWriter streamWriter = new StreamWriter(this.OutputFile, false, System.Text.Encoding.UTF8)) - { - xmlSettings.OmitXmlDeclaration = false; - xmlSettings.Encoding = System.Text.Encoding.UTF8; - using (XmlWriter xmlWriter = XmlWriter.Create(streamWriter, xmlSettings)) - { - xmlWriter.WriteStartDocument(); - xmlWriter.Flush(); - } - - streamWriter.WriteLine(); - streamWriter.Write(mutatedWixString); - } - } - catch (WixException we) - { - this.Messaging.Write(we.Error); - } - catch (Exception e) - { - this.Messaging.Write(ErrorMessages.UnexpectedException(e)); - if (e is NullReferenceException || e is SEHException) - { - throw; - } - } - - return this.Messaging.LastErrorNumber; - } - } -} diff --git a/src/heat/HeatCommandLine.cs b/src/heat/HeatCommandLine.cs deleted file mode 100644 index b11dda4e..00000000 --- a/src/heat/HeatCommandLine.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections.Generic; - using System.Linq; - using WixToolset.Data; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - internal class HeatCommandLine : IHeatCommandLine - { - private readonly List extensions; - private readonly IMessaging messaging; - private readonly IServiceProvider serviceProvider; - - public HeatCommandLine(IServiceProvider serviceProvider, IEnumerable heatExtensions) - { - this.extensions = new List { new IIsHeatExtension(), new UtilHeatExtension(serviceProvider), new VSHeatExtension() }; - if (heatExtensions != null) - { - this.extensions.AddRange(heatExtensions); - } - this.messaging = serviceProvider.GetService(); - this.serviceProvider = serviceProvider; - } - - public ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments) - { - ICommandLineCommand command = null; - var parser = arguments.Parse(); - - while (command?.StopParsing != true && - String.IsNullOrEmpty(parser.ErrorArgument) && - parser.TryGetNextSwitchOrArgument(out var arg)) - { - if (String.IsNullOrWhiteSpace(arg)) // skip blank arguments. - { - continue; - } - - // First argument must be the command or global switch (that creates a command). - if (command == null) - { - if (!this.TryParseUnknownCommandArg(arg, parser, out command)) - { - parser.ReportErrorArgument(arg, ErrorMessages.HarvestTypeNotFound(arg)); - } - } - else if (!command.TryParseArgument(parser, arg)) - { - parser.ReportErrorArgument(arg); - } - } - - return command ?? new HelpCommand(this.extensions); - } - - public bool TryParseUnknownCommandArg(string arg, ICommandLineParser parser, out ICommandLineCommand command) - { - command = null; - - if (parser.IsSwitch(arg)) - { - var parameter = arg.Substring(1); - switch (parameter.ToLowerInvariant()) - { - case "?": - case "h": - case "help": - command = new HelpCommand(this.extensions); - return true; - } - } - - foreach (var heatExtension in this.extensions) - { - if (heatExtension.CommandLineTypes.Any(o => o.Option == arg)) - { - command = new HeatCommand(arg, this.extensions, this.serviceProvider); - return true; - } - } - - return false; - } - } -} diff --git a/src/heat/HeatCommandLineFactory.cs b/src/heat/HeatCommandLineFactory.cs deleted file mode 100644 index 44291e48..00000000 --- a/src/heat/HeatCommandLineFactory.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections.Generic; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - /// - /// Extension methods to use Harvesters services. - /// - public class HeatCommandLineFactory - { - /// - /// Creates service. - /// - /// - /// - /// - public static IHeatCommandLine CreateCommandLine(IServiceProvider serviceProvider, IEnumerable heatExtensions = null) - { - return new HeatCommandLine(serviceProvider, heatExtensions); - } - } -} diff --git a/src/heat/HeatCore.cs b/src/heat/HeatCore.cs deleted file mode 100644 index 578c4aab..00000000 --- a/src/heat/HeatCore.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Extensibility; - - /// - /// The WiX Toolset Harvester application core. - /// - internal class HeatCore : IHeatCore - { - /// - /// Instantiates a new HeatCore. - /// - /// The service provider. - /// The extension argument. - public HeatCore(IServiceProvider serviceProvider, string extensionArgument) - { - this.Messaging = serviceProvider.GetService(); - var harvesterCore = new HarvesterCore - { - ExtensionArgument = extensionArgument, - Messaging = this.Messaging, - ParseHelper = serviceProvider.GetService(), - }; - - this.Harvester = new Harvester - { - Core = harvesterCore, - }; - this.Mutator = new Mutator - { - Core = harvesterCore, - }; - } - - public IHarvester Harvester { get; } - - public IMessaging Messaging { get; } - - public IMutator Mutator { get; } - } -} diff --git a/src/heat/HelpCommand.cs b/src/heat/HelpCommand.cs deleted file mode 100644 index bd2bcc24..00000000 --- a/src/heat/HelpCommand.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Diagnostics; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - internal class HelpCommand : ICommandLineCommand - { - const string HelpMessageOptionFormat = " {0,-7} {1}"; - - public HelpCommand(IList extensions) - { - this.Extensions = extensions; - } - - private IList Extensions { get; } - - public bool ShowLogo => false; - - public bool StopParsing => true; - - public Task ExecuteAsync(CancellationToken cancellationToken) - { - var exitCode = this.DisplayHelp(); - return Task.FromResult(exitCode); - } - - public static void DisplayToolHeader() - { - var wixcopAssembly = typeof(HelpCommand).Assembly; - var fv = FileVersionInfo.GetVersionInfo(wixcopAssembly.Location); - - Console.WriteLine("WiX Toolset Harvester version {0}", fv.FileVersion); - Console.WriteLine("Copyright (C) .NET Foundation and contributors. All rights reserved."); - Console.WriteLine(); - } - - public bool TryParseArgument(ICommandLineParser parser, string argument) => true; - - private int DisplayHelp() - { - DisplayToolHeader(); - - // output the harvest types alphabetically - SortedList harvestOptions = new SortedList(); - foreach (var heatExtension in this.Extensions) - { - foreach (HeatCommandLineOption commandLineOption in heatExtension.CommandLineTypes) - { - harvestOptions.Add(commandLineOption.Option, commandLineOption); - } - } - - harvestOptions.Add("-nologo", new HeatCommandLineOption("-nologo", "skip printing heat logo information")); - harvestOptions.Add("-indent ", new HeatCommandLineOption("-indent ", "indentation multiple (overrides default of 4)")); - harvestOptions.Add("-o[ut]", new HeatCommandLineOption("-out", "specify output file (default: write to current directory)")); - harvestOptions.Add("-sw", new HeatCommandLineOption("-sw", "suppress all warnings or a specific message ID\r\n (example: -sw1011 -sw1012)")); - harvestOptions.Add("-swall", new HeatCommandLineOption("-swall", "suppress all warnings (deprecated)")); - harvestOptions.Add("-v", new HeatCommandLineOption("-v", "verbose output")); - harvestOptions.Add("-wx[N]", new HeatCommandLineOption("-wx[N]", "treat all warnings or a specific message ID as an error\r\n (example: -wx1011 -wx1012)")); - harvestOptions.Add("-wxall", new HeatCommandLineOption("-wxall", "treat all warnings as errors (deprecated)")); - - foreach (HeatCommandLineOption commandLineOption in harvestOptions.Values) - { - if (!commandLineOption.Option.StartsWith("-")) - { - Console.WriteLine(HelpMessageOptionFormat, commandLineOption.Option, commandLineOption.Description); - } - } - - Console.WriteLine(); - Console.WriteLine("Options:"); - - foreach (HeatCommandLineOption commandLineOption in harvestOptions.Values) - { - if (commandLineOption.Option.StartsWith("-")) - { - Console.WriteLine(HelpMessageOptionFormat, commandLineOption.Option, commandLineOption.Description); - } - } - - Console.WriteLine(HelpMessageOptionFormat, "-? | -help", "this help information"); - Console.WriteLine("For more information see: https://wixtoolset.org/"); - - return 0; - } - } -} diff --git a/src/heat/IIsFinalizeHarvesterMutator.cs b/src/heat/IIsFinalizeHarvesterMutator.cs deleted file mode 100644 index 17d3bef4..00000000 --- a/src/heat/IIsFinalizeHarvesterMutator.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.Collections.Specialized; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - using IIs = Serialize.IIs; - - /// - /// The finalize harvester mutator for the WiX Toolset Internet Information Services Extension. - /// - internal class IIsFinalizeHarvesterMutator : BaseMutatorExtension - { - private Hashtable directoryPaths; - private Hashtable filePaths; - private ArrayList webFilters; - private ArrayList webSites; - private ArrayList webVirtualDirs; - - /// - /// Instantiate a new IIsFinalizeHarvesterMutator. - /// - public IIsFinalizeHarvesterMutator() - { - this.directoryPaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); - this.filePaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); - this.webFilters = new ArrayList(); - this.webSites = new ArrayList(); - this.webVirtualDirs = new ArrayList(); - } - - /// - /// Gets the sequence of this mutator extension. - /// - /// The sequence of this mutator extension. - public override int Sequence - { - get { return 1900; } - } - - /// - /// Mutate a WiX document. - /// - /// The Wix document element. - public override void Mutate(Wix.Wix wix) - { - this.directoryPaths.Clear(); - this.filePaths.Clear(); - this.webFilters.Clear(); - this.webSites.Clear(); - this.webVirtualDirs.Clear(); - - this.IndexElement(wix); - - this.MutateWebFilters(); - this.MutateWebSites(); - this.MutateWebVirtualDirs(); - } - - /// - /// Index an element. - /// - /// The element to index. - private void IndexElement(Wix.ISchemaElement element) - { - if (element is IIs.WebFilter) - { - this.webFilters.Add(element); - } - else if (element is IIs.WebSite) - { - this.webSites.Add(element); - } - else if (element is IIs.WebVirtualDir) - { - this.webVirtualDirs.Add(element); - } - else if (element is Wix.Directory) - { - Wix.Directory directory = (Wix.Directory)element; - - if (null != directory.Id && null != directory.FileSource) - { - this.directoryPaths.Add(directory.FileSource, directory.Id); - } - } - else if (element is Wix.File) - { - Wix.File file = (Wix.File)element; - - if (null != file.Id && null != file.Source) - { - this.filePaths[file.Source] = String.Concat("[#", file.Id, "]"); - } - } - - // index the child elements - if (element is Wix.IParentElement) - { - foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) - { - this.IndexElement(childElement); - } - } - } - - /// - /// Mutate the WebFilters. - /// - private void MutateWebFilters() - { - foreach (IIs.WebFilter webFilter in this.webFilters) - { - webFilter.Path = (string)this.filePaths[webFilter.Path]; - } - } - - /// - /// Mutate the WebSites. - /// - private void MutateWebSites() - { - foreach (IIs.WebSite webSite in this.webSites) - { - string path = (string)this.directoryPaths[webSite.Directory]; - if (null == path) - { - this.Core.Messaging.Write(HarvesterWarnings.EncounteredNullDirectoryForWebSite(path)); - } - else - { - webSite.Directory = path; - } - } - } - - /// - /// Mutate the WebVirtualDirs. - /// - private void MutateWebVirtualDirs() - { - foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) - { - string path = (string)this.directoryPaths[webVirtualDir.Directory]; - if (null == path) - { - this.Core.Messaging.Write(HarvesterWarnings.EncounteredNullDirectoryForWebSite(path)); - } - else - { - webVirtualDir.Directory = path; - } - } - } - } -} diff --git a/src/heat/IIsHarvesterMutator.cs b/src/heat/IIsHarvesterMutator.cs deleted file mode 100644 index 76d94b6a..00000000 --- a/src/heat/IIsHarvesterMutator.cs +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.Collections.Specialized; - using System.IO; - using WixToolset.Harvesters.Extensibility; - using IIs = Serialize.IIs; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The harvester mutator for the WiX Toolset Internet Information Services Extension. - /// - internal class IIsHarvesterMutator : BaseMutatorExtension - { - private ArrayList components; - private DirectoryHarvester directoryHarvester; - private Hashtable directoryPaths; - private FileHarvester fileHarvester; - private Wix.IParentElement rootElement; - private bool setUniqueIdentifiers; - private ArrayList webAddresses; - private ArrayList webDirs; - private ArrayList webDirProperties; - private ArrayList webFilters; - private ArrayList webSites; - private ArrayList webVirtualDirs; - - /// - /// Instantiate a new IIsHarvesterMutator. - /// - public IIsHarvesterMutator() - { - this.components = new ArrayList(); - this.directoryHarvester = new DirectoryHarvester(); - this.directoryPaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); - this.fileHarvester = new FileHarvester(); - this.webAddresses = new ArrayList(); - this.webDirs = new ArrayList(); - this.webDirProperties = new ArrayList(); - this.webFilters = new ArrayList(); - this.webSites = new ArrayList(); - this.webVirtualDirs = new ArrayList(); - } - - /// - /// Gets the sequence of this mutator extension. - /// - /// The sequence of this mutator extension. - public override int Sequence - { - get { return 100; } - } - - /// - /// Gets of sets the option to set unique identifiers. - /// - /// The option to set unique identifiers. - public bool SetUniqueIdentifiers - { - get { return this.setUniqueIdentifiers; } - set { this.setUniqueIdentifiers = value; } - } - - /// - /// Mutate a WiX document. - /// - /// The Wix document element. - public override void Mutate(Wix.Wix wix) - { - this.components.Clear(); - this.directoryPaths.Clear(); - this.webAddresses.Clear(); - this.webDirs.Clear(); - this.webDirProperties.Clear(); - this.webFilters.Clear(); - this.webSites.Clear(); - this.webVirtualDirs.Clear(); - this.rootElement = null; - - this.IndexElement(wix); - - this.MutateWebAddresses(); - - this.MutateWebDirs(); - - this.MutateWebDirProperties(); - - this.MutateWebSites(); - - this.MutateWebVirtualDirs(); - - // this must come after the web virtual dirs in case they harvest a directory containing a web filter file - this.MutateWebFilters(); - - // this must come after the web site identifiers are created - this.MutateComponents(); - } - - /// - /// Harvest a new directory or return one that was previously harvested. - /// - /// The path of the directory. - /// The option to harvest the children of the directory. - /// The harvested directory. - private Wix.Directory HarvestUniqueDirectory(string path, bool harvestChildren) - { - if (this.directoryPaths.Contains(path)) - { - return (Wix.Directory)this.directoryPaths[path]; - } - else - { - Wix.Directory directory = this.directoryHarvester.HarvestDirectory(path, harvestChildren); - - this.rootElement.AddChild(directory); - - // index this new directory and all of its children - this.IndexElement(directory); - - return directory; - } - } - - /// - /// Index an element. - /// - /// The element to index. - private void IndexElement(Wix.ISchemaElement element) - { - if (element is IIs.WebAddress) - { - this.webAddresses.Add(element); - } - else if (element is IIs.WebDir) - { - this.webDirs.Add(element); - } - else if (element is IIs.WebDirProperties) - { - this.webDirProperties.Add(element); - } - else if (element is IIs.WebFilter) - { - this.webFilters.Add(element); - } - else if (element is IIs.WebSite) - { - this.webSites.Add(element); - } - else if (element is IIs.WebVirtualDir) - { - this.webVirtualDirs.Add(element); - } - else if (element is Wix.Component) - { - this.components.Add(element); - } - else if (element is Wix.Directory) - { - Wix.Directory directory = (Wix.Directory)element; - - if (null != directory.FileSource) - { - this.directoryPaths.Add(directory.FileSource, directory); - } - } - else if (element is Wix.Fragment || element is Wix.Module || element is Wix.PatchCreation || element is Wix.Package) - { - this.rootElement = (Wix.IParentElement)element; - } - - // index the child elements - if (element is Wix.IParentElement) - { - foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) - { - this.IndexElement(childElement); - } - } - } - - /// - /// Mutate the Component elements. - /// - private void MutateComponents() - { - if (this.setUniqueIdentifiers) - { - IdentifierGenerator identifierGenerator = new IdentifierGenerator("Component", this.Core); - - // index all the existing identifiers - foreach (Wix.Component component in this.components) - { - if (null != component.Id) - { - identifierGenerator.IndexExistingIdentifier(component.Id); - } - } - - // index all the web site identifiers - foreach (IIs.WebSite webSite in this.webSites) - { - if (webSite.ParentElement is Wix.Component) - { - identifierGenerator.IndexName(webSite.Id); - } - } - - // create an identifier for each component based on its child web site identifier - foreach (IIs.WebSite webSite in this.webSites) - { - Wix.Component component = webSite.ParentElement as Wix.Component; - - if (null != component) - { - component.Id = identifierGenerator.GetIdentifier(webSite.Id); - } - } - } - } - - /// - /// Mutate the WebAddress elements. - /// - private void MutateWebAddresses() - { - if (this.setUniqueIdentifiers) - { - IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebAddress", this.Core); - - // index all the existing identifiers and names - foreach (IIs.WebAddress webAddress in this.webAddresses) - { - if (null != webAddress.Id) - { - identifierGenerator.IndexExistingIdentifier(webAddress.Id); - } - else - { - identifierGenerator.IndexName(String.Concat(webAddress.IP, "_", webAddress.Port)); - } - } - - foreach (IIs.WebAddress webAddress in this.webAddresses) - { - if (null == webAddress.Id) - { - webAddress.Id = identifierGenerator.GetIdentifier(String.Concat(webAddress.IP, "_", webAddress.Port)); - } - } - } - } - - /// - /// Mutate the WebDir elements. - /// - private void MutateWebDirs() - { - if (this.setUniqueIdentifiers) - { - IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebDir", this.Core); - - // index all the existing identifiers and names - foreach (IIs.WebDir webDir in this.webDirs) - { - if (null != webDir.Id) - { - identifierGenerator.IndexExistingIdentifier(webDir.Id); - } - else - { - identifierGenerator.IndexName(webDir.Path); - } - } - - foreach (IIs.WebDir webDir in this.webDirs) - { - if (null == webDir.Id) - { - webDir.Id = identifierGenerator.GetIdentifier(webDir.Path); - } - } - } - } - - /// - /// Mutate the WebDirProperties elements. - /// - private void MutateWebDirProperties() - { - if (this.setUniqueIdentifiers) - { - IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebDirProperties", this.Core); - - // index all the existing identifiers and names - foreach (IIs.WebDirProperties webDirProperties in this.webDirProperties) - { - if (null != webDirProperties.Id) - { - identifierGenerator.IndexExistingIdentifier(webDirProperties.Id); - } - } - - foreach (IIs.WebDirProperties webDirProperties in this.webDirProperties) - { - if (null == webDirProperties.Id) - { - webDirProperties.Id = identifierGenerator.GetIdentifier(String.Empty); - } - } - } - } - - /// - /// Mutate the WebFilter elements. - /// - private void MutateWebFilters() - { - IdentifierGenerator identifierGenerator = null; - - if (this.setUniqueIdentifiers) - { - identifierGenerator = new IdentifierGenerator("WebFilter", this.Core); - - // index all the existing identifiers and names - foreach (IIs.WebFilter webFilter in this.webFilters) - { - if (null != webFilter.Id) - { - identifierGenerator.IndexExistingIdentifier(webFilter.Id); - } - else - { - identifierGenerator.IndexName(webFilter.Name); - } - } - } - - foreach (IIs.WebFilter webFilter in this.webFilters) - { - if (this.setUniqueIdentifiers && null == webFilter.Id) - { - webFilter.Id = identifierGenerator.GetIdentifier(webFilter.Name); - } - - // harvest the file for this WebFilter - Wix.Directory directory = this.HarvestUniqueDirectory(Path.GetDirectoryName(webFilter.Path), false); - - Wix.Component component = new Wix.Component(); - directory.AddChild(component); - - Wix.File file = this.fileHarvester.HarvestFile(webFilter.Path); - component.AddChild(file); - } - } - - /// - /// Mutate the WebSite elements. - /// - private void MutateWebSites() - { - if (this.setUniqueIdentifiers) - { - IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebSite", this.Core); - - // index all the existing identifiers and names - foreach (IIs.WebSite webSite in this.webSites) - { - if (null != webSite.Id) - { - identifierGenerator.IndexExistingIdentifier(webSite.Id); - } - else - { - identifierGenerator.IndexName(webSite.Description); - } - } - - foreach (IIs.WebSite webSite in this.webSites) - { - if (null == webSite.Id) - { - webSite.Id = identifierGenerator.GetIdentifier(webSite.Description); - } - } - } - } - - /// - /// Mutate the WebVirtualDir elements. - /// - private void MutateWebVirtualDirs() - { - IdentifierGenerator identifierGenerator = null; - - if (this.setUniqueIdentifiers) - { - identifierGenerator = new IdentifierGenerator("WebVirtualDir", this.Core); - - // index all the existing identifiers and names - foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) - { - if (null != webVirtualDir.Id) - { - identifierGenerator.IndexExistingIdentifier(webVirtualDir.Id); - } - else - { - identifierGenerator.IndexName(webVirtualDir.Alias); - } - } - } - - foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) - { - if (this.setUniqueIdentifiers && null == webVirtualDir.Id) - { - webVirtualDir.Id = identifierGenerator.GetIdentifier(webVirtualDir.Alias); - } - - // harvest the directory for this WebVirtualDir - this.HarvestUniqueDirectory(webVirtualDir.Directory, true); - } - } - } -} diff --git a/src/heat/IIsHeatExtension.cs b/src/heat/IIsHeatExtension.cs deleted file mode 100644 index 94e11a68..00000000 --- a/src/heat/IIsHeatExtension.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - /// - /// An IIS harvesting extension for the WiX Toolset Harvester application. - /// - internal class IIsHeatExtension : BaseHeatExtension - { - /// - /// Gets the supported command line types for this extension. - /// - /// The supported command line types for this extension. - public override HeatCommandLineOption[] CommandLineTypes - { - get - { - return new HeatCommandLineOption[] - { - new HeatCommandLineOption("website", "harvest an IIS web site"), - }; - } - } - - /// - /// Parse the command line options for this extension. - /// - /// The active harvester type. - /// The option arguments. - public override void ParseOptions(string type, string[] args) - { - bool active = false; - IHarvesterExtension harvesterExtension = null; - IIsHarvesterMutator iisHarvesterMutator = new IIsHarvesterMutator(); - - // select the harvester - switch (type) - { - case "website": - harvesterExtension = new IIsWebSiteHarvester(); - active = true; - break; - } - - // set default settings - iisHarvesterMutator.SetUniqueIdentifiers = true; - - // parse the options - foreach (string arg in args) - { - if (null == arg || 0 == arg.Length) // skip blank arguments - { - continue; - } - - if ('-' == arg[0] || '/' == arg[0]) - { - string parameter = arg.Substring(1); - - if ("suid" == parameter) - { - iisHarvesterMutator.SetUniqueIdentifiers = false; - } - } - } - - // set the appropriate harvester extension - if (active) - { - this.Core.Harvester.Extension = harvesterExtension; - this.Core.Mutator.AddExtension(iisHarvesterMutator); - this.Core.Mutator.AddExtension(new IIsFinalizeHarvesterMutator()); - this.Core.Mutator.AddExtension(new UtilFinalizeHarvesterMutator()); - } - } - } -} diff --git a/src/heat/IIsWebSiteHarvester.cs b/src/heat/IIsWebSiteHarvester.cs deleted file mode 100644 index 86861b16..00000000 --- a/src/heat/IIsWebSiteHarvester.cs +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.DirectoryServices; - using System.Globalization; - using System.Runtime.InteropServices; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using IIs = WixToolset.Harvesters.Serialize.IIs; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The web site harvester for the WiX Toolset Internet Information Services Extension. - /// - internal class IIsWebSiteHarvester : BaseHarvesterExtension - { - /// - /// Harvest a WiX document. - /// - /// The argument for harvesting. - /// The harvested Fragment. - public override Wix.Fragment[] Harvest(string argument) - { - DirectoryHarvester directoryHarvester = new DirectoryHarvester(); - directoryHarvester.Core = this.Core; - directoryHarvester.KeepEmptyDirectories = true; - - IIsWebSiteHarvester iisWebSiteHarvester = new IIsWebSiteHarvester(); - iisWebSiteHarvester.Core = this.Core; - - IIs.WebSite webSite = iisWebSiteHarvester.HarvestWebSite(argument); - - Wix.Component component = new Wix.Component(); - component.AddChild(new Wix.CreateFolder()); - component.AddChild(webSite); - - this.Core.RootDirectory = webSite.Directory; - Wix.Directory directory = directoryHarvester.HarvestDirectory(webSite.Directory, true); - directory.AddChild(component); - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(directory); - - return new Wix.Fragment[] { fragment }; - } - - /// - /// Harvest a web site. - /// - /// The name of the web site. - /// The harvested web site. - public IIs.WebSite HarvestWebSite(string name) - { - try - { - DirectoryEntry directoryEntry = new DirectoryEntry("IIS://localhost/W3SVC"); - - foreach (DirectoryEntry childEntry in directoryEntry.Children) - { - if ("IIsWebServer" == childEntry.SchemaClassName) - { - if (String.Equals((string)childEntry.Properties["ServerComment"].Value, name, StringComparison.OrdinalIgnoreCase)) - { - return this.HarvestWebSite(childEntry); - } - } - } - } - catch (COMException ce) - { - // 0x8007005 - access denied - // If we don't have permission to harvest a website, it's likely because we're on - // Vista or higher and aren't an Admin. - if ((0x80070005 == unchecked((uint)ce.ErrorCode))) - { - throw new WixException(HarvesterErrors.InsufficientPermissionHarvestWebSite()); - } - // 0x80005000 - unknown error - else if ((0x80005000 == unchecked((uint)ce.ErrorCode))) - { - throw new WixException(HarvesterErrors.CannotHarvestWebSite()); - } - } - - throw new WixException(HarvesterErrors.WebSiteNotFound(name)); - } - - /// - /// Harvest a web site. - /// - /// The web site directory entry. - /// The harvested web site. - private IIs.WebSite HarvestWebSite(DirectoryEntry webSiteEntry) - { - IIs.WebSite webSite = new IIs.WebSite(); - - foreach (string propertyName in webSiteEntry.Properties.PropertyNames) - { - PropertyValueCollection property = webSiteEntry.Properties[propertyName]; - PropertyValueCollection parentProperty = webSiteEntry.Parent.Properties[propertyName]; - - if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) - { - switch (propertyName) - { - case "SecureBindings": - IIs.WebAddress secureWebAddress = this.HarvestBindings(propertyName, property); - if (null != secureWebAddress) - { - webSite.AddChild(secureWebAddress); - } - break; - case "ServerBindings": - IIs.WebAddress webAddress = this.HarvestBindings(propertyName, property); - if (null != webAddress) - { - webSite.AddChild(webAddress); - } - break; - case "ServerComment": - webSite.Description = (string)property.Value; - break; - } - } - } - - foreach (DirectoryEntry childEntry in webSiteEntry.Children) - { - switch (childEntry.SchemaClassName) - { - case "IIsFilters": - string loadOrder = (string)childEntry.Properties["FilterLoadOrder"].Value; - if (loadOrder.Length > 0) - { - string[] filterNames = loadOrder.Split(",".ToCharArray()); - - for (int i = 0; i < filterNames.Length; i++) - { - using (DirectoryEntry webFilterEntry = new DirectoryEntry(String.Concat(childEntry.Path, '/', filterNames[i]))) - { - IIs.WebFilter webFilter = this.HarvestWebFilter(webFilterEntry); - - webFilter.LoadOrder = (i + 1).ToString(CultureInfo.InvariantCulture); - - webSite.AddChild(webFilter); - } - } - } - break; - case "IIsWebDirectory": - this.HarvestWebDirectory(childEntry, webSite); - break; - case "IIsWebVirtualDir": - foreach (string propertyName in childEntry.Properties.PropertyNames) - { - PropertyValueCollection property = childEntry.Properties[propertyName]; - - switch (propertyName) - { - case "Path": - webSite.Directory = (string)property.Value; - break; - } - } - - IIs.WebDirProperties webDirProps = this.HarvestWebDirProperties(childEntry); - if (null != webDirProps) - { - webSite.AddChild(webDirProps); - } - - foreach (DirectoryEntry child2Entry in childEntry.Children) - { - switch (child2Entry.SchemaClassName) - { - case "IIsWebDirectory": - this.HarvestWebDirectory(child2Entry, webSite); - break; - case "IIsWebVirtualDir": - this.HarvestWebVirtualDir(child2Entry, webSite); - break; - } - } - break; - } - } - - return webSite; - } - - /// - /// Harvest bindings. - /// - /// The property name of the bindings property. - /// The bindings property. - /// The harvested bindings. - private IIs.WebAddress HarvestBindings(string propertyName, PropertyValueCollection bindingsProperty) - { - if (1 == bindingsProperty.Count) - { - IIs.WebAddress webAddress = new IIs.WebAddress(); - - string[] bindings = ((string)bindingsProperty[0]).Split(":".ToCharArray()); - - if (0 < bindings[0].Length) - { - webAddress.IP = bindings[0]; - } - - if (0 < bindings[1].Length) - { - webAddress.Port = bindings[1]; - } - - if (0 < bindings[2].Length) - { - webAddress.Header = bindings[2]; - } - - if ("SecureBindings" == propertyName) - { - webAddress.Secure = IIs.YesNoType.yes; - } - - return webAddress; - } - - return null; - } - - /// - /// Harvest a web directory. - /// - /// The web directory directory entry. - /// The parent web site. - private void HarvestWebDirectory(DirectoryEntry webDirectoryEntry, IIs.WebSite webSite) - { - foreach (DirectoryEntry childEntry in webDirectoryEntry.Children) - { - switch (childEntry.SchemaClassName) - { - case "IIsWebDirectory": - this.HarvestWebDirectory(childEntry, webSite); - break; - case "IIsWebVirtualDir": - this.HarvestWebVirtualDir(childEntry, webSite); - break; - } - } - - IIs.WebDirProperties webDirProperties = this.HarvestWebDirProperties(webDirectoryEntry); - - if (null != webDirProperties) - { - IIs.WebDir webDir = new IIs.WebDir(); - - int indexOfRoot = webDirectoryEntry.Path.IndexOf("ROOT/", StringComparison.OrdinalIgnoreCase); - webDir.Path = webDirectoryEntry.Path.Substring(indexOfRoot + 5); - - webDir.AddChild(webDirProperties); - - webSite.AddChild(webDir); - } - } - - /// - /// Harvest a web filter. - /// - /// The web filter directory entry. - /// The harvested web filter. - private IIs.WebFilter HarvestWebFilter(DirectoryEntry webFilterEntry) - { - IIs.WebFilter webFilter = new IIs.WebFilter(); - - webFilter.Name = webFilterEntry.Name; - - foreach (string propertyName in webFilterEntry.Properties.PropertyNames) - { - PropertyValueCollection property = webFilterEntry.Properties[propertyName]; - - switch (propertyName) - { - case "FilterDescription": - webFilter.Description = (string)property.Value; - break; - case "FilterFlags": - webFilter.Flags = (int)property.Value; - break; - case "FilterPath": - webFilter.Path = (string)property.Value; - break; - } - } - - return webFilter; - } - - /// - /// Harvest a web directory's properties. - /// - /// The web directory directory entry. - /// The harvested web directory's properties. - private IIs.WebDirProperties HarvestWebDirProperties(DirectoryEntry directoryEntry) - { - bool foundProperties = false; - IIs.WebDirProperties webDirProperties = new IIs.WebDirProperties(); - - // Cannot read properties for "iisadmin" site. - if (String.Equals("iisadmin", directoryEntry.Name, StringComparison.OrdinalIgnoreCase) && - String.Equals("ROOT", directoryEntry.Parent.Name, StringComparison.OrdinalIgnoreCase)) - { - return null; - } - - foreach (string propertyName in directoryEntry.Properties.PropertyNames) - { - PropertyValueCollection property = directoryEntry.Properties[propertyName]; - PropertyValueCollection parentProperty = directoryEntry.Parent.Properties[propertyName]; - - if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) - { - switch (propertyName) - { - case "AccessFlags": - int access = (int)property.Value; - - if (0x1 == (access & 0x1)) - { - webDirProperties.Read = IIs.YesNoType.yes; - } - - if (0x2 == (access & 0x2)) - { - webDirProperties.Write = IIs.YesNoType.yes; - } - - if (0x4 == (access & 0x4)) - { - webDirProperties.Execute = IIs.YesNoType.yes; - } - - if (0x200 == (access & 0x200)) - { - webDirProperties.Script = IIs.YesNoType.yes; - } - - foundProperties = true; - break; - case "AuthFlags": - int authorization = (int)property.Value; - - if (0x1 == (authorization & 0x1)) - { - webDirProperties.AnonymousAccess = IIs.YesNoType.yes; - } - - if (0x2 == (authorization & 0x2)) - { - webDirProperties.BasicAuthentication = IIs.YesNoType.yes; - } - - if (0x4 == (authorization & 0x4)) - { - webDirProperties.WindowsAuthentication = IIs.YesNoType.yes; - } - - if (0x10 == (authorization & 0x10)) - { - webDirProperties.DigestAuthentication = IIs.YesNoType.yes; - } - - if (0x40 == (authorization & 0x40)) - { - webDirProperties.PassportAuthentication = IIs.YesNoType.yes; - } - - foundProperties = true; - break; - } - } - } - - return foundProperties ? webDirProperties : null; - } - - /// - /// Harvest a web virtual directory. - /// - /// The web virtual directory directory entry. - /// The parent web site. - private void HarvestWebVirtualDir(DirectoryEntry webVirtualDirEntry, IIs.WebSite webSite) - { - IIs.WebVirtualDir webVirtualDir = new IIs.WebVirtualDir(); - - foreach (string propertyName in webVirtualDirEntry.Properties.PropertyNames) - { - PropertyValueCollection property = webVirtualDirEntry.Properties[propertyName]; - PropertyValueCollection parentProperty = webVirtualDirEntry.Parent.Properties[propertyName]; - - if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) - { - switch (propertyName) - { - case "Path": - webVirtualDir.Directory = (string)property.Value; - break; - } - } - } - - int indexOfRoot = webVirtualDirEntry.Path.IndexOf("ROOT/", StringComparison.OrdinalIgnoreCase); - webVirtualDir.Alias = webVirtualDirEntry.Path.Substring(indexOfRoot + 5); - - IIs.WebDirProperties webDirProps = this.HarvestWebDirProperties(webVirtualDirEntry); - if (webDirProps != null) - { - webVirtualDir.AddChild(webDirProps); - } - - foreach (DirectoryEntry childEntry in webVirtualDirEntry.Children) - { - switch (childEntry.SchemaClassName) - { - case "IIsWebDirectory": - this.HarvestWebDirectory(childEntry, webSite); - break; - case "IIsWebVirtualDir": - this.HarvestWebVirtualDir(childEntry, webSite); - break; - } - } - - webSite.AddChild(webVirtualDir); - } - } -} diff --git a/src/heat/Mutator.cs b/src/heat/Mutator.cs deleted file mode 100644 index 8c63882d..00000000 --- a/src/heat/Mutator.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The WiX Toolset mutator. - /// - internal class Mutator : IMutator - { - private SortedList extensions; - private string extensionArgument; - - /// - /// Instantiate a new mutator. - /// - public Mutator() - { - this.extensions = new SortedList(); - } - - public IHarvesterCore Core { get; set; } - - public string ExtensionArgument - { - get { return this.extensionArgument; } - set { this.extensionArgument = value; } - } - - public void AddExtension(IMutatorExtension mutatorExtension) - { - this.extensions.Add(mutatorExtension.Sequence, mutatorExtension); - } - - public bool Mutate(Wix.Wix wix) - { - bool encounteredError = false; - - try - { - foreach (IMutatorExtension mutatorExtension in this.extensions.Values) - { - if (null == mutatorExtension.Core) - { - mutatorExtension.Core = this.Core; - } - - mutatorExtension.Mutate(wix); - } - } - finally - { - encounteredError = this.Core.Messaging.EncounteredError; - } - - // return the Wix document element only if mutation completed successfully - return !encounteredError; - } - - public string Mutate(string wixString) - { - bool encounteredError = false; - - try - { - foreach (IMutatorExtension mutatorExtension in this.extensions.Values) - { - if (null == mutatorExtension.Core) - { - mutatorExtension.Core = this.Core; - } - - wixString = mutatorExtension.Mutate(wixString); - - if (String.IsNullOrEmpty(wixString) || this.Core.Messaging.EncounteredError) - { - break; - } - } - } - finally - { - encounteredError = this.Core.Messaging.EncounteredError; - } - - return encounteredError ? null : wixString; - } - } -} diff --git a/src/heat/PayloadHarvester.cs b/src/heat/PayloadHarvester.cs deleted file mode 100644 index 4bf625d1..00000000 --- a/src/heat/PayloadHarvester.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.IO; - using WixToolset.Core.Burn.Interfaces; - using WixToolset.Data; - using WixToolset.Data.Symbols; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring for a payload from the file system. - /// - internal class PayloadHarvester : BaseHarvesterExtension - { - private bool setUniqueIdentifiers; - private WixBundlePackageType packageType; - - private IPayloadHarvester payloadHarvester; - - /// - /// Instantiate a new PayloadHarvester. - /// - public PayloadHarvester(IPayloadHarvester payloadHarvester, WixBundlePackageType packageType) - { - this.payloadHarvester = payloadHarvester; - - this.packageType = packageType; - this.setUniqueIdentifiers = true; - } - - /// - /// Gets of sets the option to set unique identifiers. - /// - /// The option to set unique identifiers. - public bool SetUniqueIdentifiers - { - get { return this.setUniqueIdentifiers; } - set { this.setUniqueIdentifiers = value; } - } - - /// - /// Harvest a payload. - /// - /// The path of the payload. - /// A harvested payload. - public override Wix.Fragment[] Harvest(string argument) - { - if (null == argument) - { - throw new ArgumentNullException("argument"); - } - - string fullPath = Path.GetFullPath(argument); - - var remotePayload = this.HarvestRemotePayload(fullPath); - - var fragment = new Wix.Fragment(); - fragment.AddChild(remotePayload); - - return new Wix.Fragment[] { fragment }; - } - - /// - /// Harvest a payload. - /// - /// The path of the payload. - /// A harvested payload. - public Wix.RemotePayload HarvestRemotePayload(string path) - { - if (null == path) - { - throw new ArgumentNullException("path"); - } - - if (!File.Exists(path)) - { - throw new WixException(HarvesterErrors.FileNotFound(path)); - } - - Wix.RemotePayload remotePayload; - - switch (this.packageType) - { - case WixBundlePackageType.Exe: - remotePayload = new Wix.ExePackagePayload(); - break; - case WixBundlePackageType.Msu: - remotePayload = new Wix.MsuPackagePayload(); - break; - default: - throw new NotImplementedException(); - } - - var payloadSymbol = new WixBundlePayloadSymbol - { - SourceFile = new IntermediateFieldPathValue { Path = path }, - }; - - this.payloadHarvester.HarvestStandardInformation(payloadSymbol); - - if (payloadSymbol.FileSize.HasValue) - { - remotePayload.Size = payloadSymbol.FileSize.Value; - } - remotePayload.Hash = payloadSymbol.Hash; - - if (!String.IsNullOrEmpty(payloadSymbol.Version)) - { - remotePayload.Version = payloadSymbol.Version; - } - - if (!String.IsNullOrEmpty(payloadSymbol.Description)) - { - remotePayload.Description = payloadSymbol.Description; - } - - if (!String.IsNullOrEmpty(payloadSymbol.DisplayName)) - { - remotePayload.ProductName = payloadSymbol.DisplayName; - } - - return remotePayload; - } - } -} diff --git a/src/heat/PerformanceCategoryHarvester.cs b/src/heat/PerformanceCategoryHarvester.cs deleted file mode 100644 index d9c46001..00000000 --- a/src/heat/PerformanceCategoryHarvester.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Linq; - using System.Diagnostics; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Util = WixToolset.Harvesters.Serialize.Util; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring for a file from the file system. - /// - internal class PerformanceCategoryHarvester : BaseHarvesterExtension - { - /// - /// Harvest a performance category. - /// - /// The name of the performance category. - /// A harvested performance category. - public override Wix.Fragment[] Harvest(string argument) - { - if (null == argument) - { - throw new ArgumentNullException("argument"); - } - - Util.PerformanceCategory perf = this.HarvestPerformanceCategory(argument); - - Wix.Component component = new Wix.Component(); - component.Id = this.Core.CreateIdentifierFromFilename(argument); - component.KeyPath = Wix.YesNoType.yes; - component.AddChild(perf); - - Wix.Directory directory = new Wix.Directory(); - directory.Id = "TARGETDIR"; - //directory.Name = directory.Id; - directory.AddChild(component); - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(directory); - - return new Wix.Fragment[] { fragment }; - } - - /// - /// Harvest a performance category. - /// - /// The name of the performance category. - /// A harvested file. - public Util.PerformanceCategory HarvestPerformanceCategory(string category) - { - if (null == category) - { - throw new ArgumentNullException("category"); - } - - if (PerformanceCounterCategory.Exists(category)) - { - Util.PerformanceCategory perfCategory = new Util.PerformanceCategory(); - - // Get the performance counter category and set the appropriate WiX attributes - PerformanceCounterCategory pcc = PerformanceCounterCategory.GetCategories().Single(c => string.Equals(c.CategoryName, category)); - perfCategory.Id = this.Core.CreateIdentifierFromFilename(pcc.CategoryName); - perfCategory.Name = pcc.CategoryName; - perfCategory.Help = pcc.CategoryHelp; - if (PerformanceCounterCategoryType.MultiInstance == pcc.CategoryType) - { - perfCategory.MultiInstance = Util.YesNoType.yes; - } - - // If it's multi-instance, check if there are any instances and get counters from there; else we get - // the counters straight up. For multi-instance, GetCounters() fails if there are any instances. If there - // are no instances, then GetCounters(instance) can't be called since there is no instance. Instances - // will exist for each counter even if only one of the counters was "intialized." - string[] instances = pcc.GetInstanceNames(); - bool hasInstances = instances.Length > 0; - PerformanceCounter[] counters = hasInstances - ? pcc.GetCounters(instances.First()) - : pcc.GetCounters(); - - foreach (PerformanceCounter counter in counters) - { - Util.PerformanceCounter perfCounter = new Util.PerformanceCounter(); - - // Get the performance counter and set the appropriate WiX attributes - perfCounter.Name = counter.CounterName; - perfCounter.Type = this.CounterTypeToWix(counter.CounterType); - perfCounter.Help = counter.CounterHelp; - - perfCategory.AddChild(perfCounter); - } - - return perfCategory; - } - else - { - throw new WixException(HarvesterErrors.PerformanceCategoryNotFound(category)); - } - } - - /// - /// Get the WiX performance counter type. - /// - /// The performance counter value to get. - /// The WiX performance counter type. - private Util.PerformanceCounterTypesType CounterTypeToWix(PerformanceCounterType pct) - { - Util.PerformanceCounterTypesType type; - - switch (pct) - { - case PerformanceCounterType.AverageBase: - type = Util.PerformanceCounterTypesType.averageBase; - break; - case PerformanceCounterType.AverageCount64: - type = Util.PerformanceCounterTypesType.averageCount64; - break; - case PerformanceCounterType.AverageTimer32: - type = Util.PerformanceCounterTypesType.averageTimer32; - break; - case PerformanceCounterType.CounterDelta32: - type = Util.PerformanceCounterTypesType.counterDelta32; - break; - case PerformanceCounterType.CounterTimerInverse: - type = Util.PerformanceCounterTypesType.counterTimerInverse; - break; - case PerformanceCounterType.SampleFraction: - type = Util.PerformanceCounterTypesType.sampleFraction; - break; - case PerformanceCounterType.Timer100Ns: - type = Util.PerformanceCounterTypesType.timer100Ns; - break; - case PerformanceCounterType.CounterTimer: - type = Util.PerformanceCounterTypesType.counterTimer; - break; - case PerformanceCounterType.RawFraction: - type = Util.PerformanceCounterTypesType.rawFraction; - break; - case PerformanceCounterType.Timer100NsInverse: - type = Util.PerformanceCounterTypesType.timer100NsInverse; - break; - case PerformanceCounterType.CounterMultiTimer: - type = Util.PerformanceCounterTypesType.counterMultiTimer; - break; - case PerformanceCounterType.CounterMultiTimer100Ns: - type = Util.PerformanceCounterTypesType.counterMultiTimer100Ns; - break; - case PerformanceCounterType.CounterMultiTimerInverse: - type = Util.PerformanceCounterTypesType.counterMultiTimerInverse; - break; - case PerformanceCounterType.CounterMultiTimer100NsInverse: - type = Util.PerformanceCounterTypesType.counterMultiTimer100NsInverse; - break; - case PerformanceCounterType.ElapsedTime: - type = Util.PerformanceCounterTypesType.elapsedTime; - break; - case PerformanceCounterType.SampleBase: - type = Util.PerformanceCounterTypesType.sampleBase; - break; - case PerformanceCounterType.RawBase: - type = Util.PerformanceCounterTypesType.rawBase; - break; - case PerformanceCounterType.CounterMultiBase: - type = Util.PerformanceCounterTypesType.counterMultiBase; - break; - case PerformanceCounterType.RateOfCountsPerSecond64: - type = Util.PerformanceCounterTypesType.rateOfCountsPerSecond64; - break; - case PerformanceCounterType.RateOfCountsPerSecond32: - type = Util.PerformanceCounterTypesType.rateOfCountsPerSecond32; - break; - case PerformanceCounterType.CountPerTimeInterval64: - type = Util.PerformanceCounterTypesType.countPerTimeInterval64; - break; - case PerformanceCounterType.CountPerTimeInterval32: - type = Util.PerformanceCounterTypesType.countPerTimeInterval32; - break; - case PerformanceCounterType.SampleCounter: - type = Util.PerformanceCounterTypesType.sampleCounter; - break; - case PerformanceCounterType.CounterDelta64: - type = Util.PerformanceCounterTypesType.counterDelta64; - break; - case PerformanceCounterType.NumberOfItems64: - type = Util.PerformanceCounterTypesType.numberOfItems64; - break; - case PerformanceCounterType.NumberOfItems32: - type = Util.PerformanceCounterTypesType.numberOfItems32; - break; - case PerformanceCounterType.NumberOfItemsHEX64: - type = Util.PerformanceCounterTypesType.numberOfItemsHEX64; - break; - case PerformanceCounterType.NumberOfItemsHEX32: - type = Util.PerformanceCounterTypesType.numberOfItemsHEX32; - break; - default: - throw new WixException(HarvesterErrors.UnsupportedPerformanceCounterType(pct.ToString())); - } - - return type; - } - } -} diff --git a/src/heat/Program.cs b/src/heat/Program.cs deleted file mode 100644 index d0bcf19f..00000000 --- a/src/heat/Program.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.Heat -{ - using System; - using System.Runtime.InteropServices; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Core; - using WixToolset.Core.Burn; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters; - using WixToolset.Tools.Core; - - /// - /// Wix Toolset Harvester. - /// - public sealed class Program - { - /// - /// The main entry point for the application. - /// - /// Commandline arguments for the application. - /// Returns the application error code. - [MTAThread] - public static async Task Main(string[] args) - { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() - .AddBundleBackend(); - var listener = new ConsoleMessageListener("HEAT", "heat.exe"); - - try - { - var program = new Program(); - return await program.Run(serviceProvider, listener, args); - } - catch (WixException e) - { - listener.Write(e.Error); - - return e.Error.Id; - } - catch (Exception e) - { - listener.Write(ErrorMessages.UnexpectedException(e)); - - if (e is NullReferenceException || e is SEHException) - { - throw; - } - - return e.HResult; - } - } - - /// - /// Run the application with the given arguments. - /// - /// Service provider to use throughout this execution. - /// The commandline arguments. - /// Returns the application error code. - public Task Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args) - { - var messaging = serviceProvider.GetService(); - messaging.SetListener(listener); - - var arguments = serviceProvider.GetService(); - arguments.Populate(args); - - var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider); - var command = commandLine.ParseStandardCommandLine(arguments); - return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); - } - } -} diff --git a/src/heat/RegFileHarvester.cs b/src/heat/RegFileHarvester.cs deleted file mode 100644 index a3d181f2..00000000 --- a/src/heat/RegFileHarvester.cs +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.Globalization; - using System.IO; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring for a reg file. - /// - internal class RegFileHarvester : BaseHarvesterExtension - { - private static readonly string ComponentPrefix = "cmp"; - - /// - /// Current line in the reg file being processed. - /// - private int currentLineNumber = 0; - - /// - /// Flag indicating whether this is a unicode registry file. - /// - private bool unicodeRegistry; - - /// - /// Harvest a file. - /// - /// The path of the file. - /// A harvested file. - public override Wix.Fragment[] Harvest(string argument) - { - if (null == argument) - { - throw new ArgumentNullException("argument"); - } - - // Harvest the keys from the registry file - Wix.Fragment fragment = this.HarvestRegFile(argument); - - return new Wix.Fragment[] { fragment }; - } - - /// - /// Harvest a reg file. - /// - /// The path of the file. - /// A harvested registy file. - public Wix.Fragment HarvestRegFile(string path) - { - if (null == path) - { - throw new ArgumentNullException("path"); - } - - if (!File.Exists(path)) - { - throw new WixException(HarvesterErrors.FileNotFound(path)); - } - - Wix.Directory directory = new Wix.Directory(); - directory.Id = "TARGETDIR"; - - // Use absolute paths - path = Path.GetFullPath(path); - FileInfo file = new FileInfo(path); - - using (StreamReader sr = file.OpenText()) - { - string line; - this.currentLineNumber = 0; - - while (null != (line = this.GetNextLine(sr))) - { - if (line.StartsWith(@"Windows Registry Editor Version 5.00")) - { - this.unicodeRegistry = true; - } - else if (line.StartsWith(@"REGEDIT4")) - { - this.unicodeRegistry = false; - } - else if (line.StartsWith(@"[HKEY_CLASSES_ROOT\")) - { - this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKCR, line.Substring(19, line.Length - 20)); - } - else if (line.StartsWith(@"[HKEY_CURRENT_USER\")) - { - this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKCU, line.Substring(19, line.Length - 20)); - } - else if (line.StartsWith(@"[HKEY_LOCAL_MACHINE\")) - { - this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKLM, line.Substring(20, line.Length - 21)); - } - else if (line.StartsWith(@"[HKEY_USERS\")) - { - this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKU, line.Substring(12, line.Length - 13)); - } - } - } - - Console.WriteLine("Processing complete"); - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(directory); - - return fragment; - } - - /// - /// Converts the registry key to a WiX component element. - /// - /// The registry file stream. - /// A WiX directory reference. - /// The root key. - /// The current line. - private void ConvertKey(StreamReader sr, ref Wix.Directory directory, Wix.RegistryRootType root, string line) - { - Wix.Component component = new Wix.Component(); - - component.Id = this.Core.GenerateIdentifier(ComponentPrefix, line); - component.KeyPath = Wix.YesNoType.yes; - - this.ConvertValues(sr, ref component, root, line); - directory.AddChild(component); - } - - /// - /// Converts the registry values to WiX regisry key element. - /// - /// The registry file stream. - /// A WiX component reference. - /// The root key. - /// The current line. - private void ConvertValues(StreamReader sr, ref Wix.Component component, Wix.RegistryRootType root, string line) - { - string name = null; - string value = null; - Wix.RegistryValue.TypeType type; - Wix.RegistryKey registryKey = new Wix.RegistryKey(); - - registryKey.Root = root; - registryKey.Key = line; - - while (this.GetValue(sr, ref name, ref value, out type)) - { - Wix.RegistryValue registryValue = new Wix.RegistryValue(); - ArrayList charArray; - - // Don't specifiy name for default attribute - if (!string.IsNullOrEmpty(name)) - { - registryValue.Name = name; - } - - registryValue.Type = type; - - switch (type) - { - case Wix.RegistryValue.TypeType.binary: - registryValue.Value = value.Replace(",", string.Empty).ToUpper(); - break; - - case Wix.RegistryValue.TypeType.integer: - registryValue.Value = Int32.Parse(value, NumberStyles.HexNumber).ToString(); - break; - - case Wix.RegistryValue.TypeType.expandable: - charArray = this.ConvertCharList(value); - value = string.Empty; - - // create the string, remove the terminating null - for (int i = 0; i < charArray.Count; i++) - { - if ('\0' != (char)charArray[i]) - { - value += charArray[i]; - } - } - - registryValue.Value = value; - break; - - case Wix.RegistryValue.TypeType.multiString: - charArray = this.ConvertCharList(value); - value = string.Empty; - - // Convert the character array to a string so we can simply split it at the nulls, ignore the final null null. - for (int i = 0; i < (charArray.Count - 2); i++) - { - value += charArray[i]; - } - - // Although the value can use [~] the preffered way is to use MultiStringValue - string[] parts = value.Split("\0".ToCharArray()); - foreach (string part in parts) - { - Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); - multiStringValue.Content = part; - registryValue.AddChild(multiStringValue); - } - - break; - - case Wix.RegistryValue.TypeType.@string: - // Remove \\ and \" - value = value.ToString().Replace("\\\"", "\""); - value = value.ToString().Replace(@"\\", @"\"); - // Escape [ and ] - value = value.ToString().Replace(@"[", @"[\[]"); - value = value.ToString().Replace(@"]", @"[\]]"); - // This undoes the duplicate escaping caused by the second replace - value = value.ToString().Replace(@"[\[[\]]", @"[\[]"); - // Escape $ - value = value.ToString().Replace(@"$", @"$$"); - - registryValue.Value = value; - break; - - default: - throw new ApplicationException(String.Format("Did not recognize the type of reg value on line {0}", this.currentLineNumber)); - } - - registryKey.AddChild(registryValue); - } - - // Make sure empty keys are created - if (null == value) - { - registryKey.ForceCreateOnInstall = Wix.YesNoType.yes; - } - - component.AddChild(registryKey); - } - - /// - /// Parse a value from a line. - /// - /// Reader for the reg file. - /// Name of the value. - /// Value of the value. - /// Type of the value. - /// true if the value can be parsed, false otherwise. - private bool GetValue(StreamReader sr, ref string name, ref string value, out Wix.RegistryValue.TypeType type) - { - string line = this.GetNextLine(sr); - - if (null == line || 0 == line.Length) - { - type = 0; - return false; - } - - string[] parts; - - if (line.StartsWith("@")) - { - // Special case for default value - parts = line.Trim().Split("=".ToCharArray(), 2); - - name = null; - } - else - { - parts = line.Trim().Split("=".ToCharArray()); - - // It is valid to have an '=' in the name or the data. This is probably a string so the separator will be '"="'. - if (2 != parts.Length) - { - string[] stringSeparator = new string[] { "\"=\"" }; - parts = line.Trim().Split(stringSeparator, StringSplitOptions.None); - - if (2 != parts.Length) - { - // Line still no parsed correctly - throw new ApplicationException(String.Format("Cannot parse value: {0} at line {1}.", line, this.currentLineNumber)); - } - - // Put back quotes stripped by Split() - parts[0] += "\""; - parts[1] = "\"" + parts[1]; - } - - name = parts[0].Substring(1, parts[0].Length - 2); - } - - if (parts[1].StartsWith("hex:")) - { - // binary - value = parts[1].Substring(4); - type = Wix.RegistryValue.TypeType.binary; - } - else if (parts[1].StartsWith("dword:")) - { - // dword - value = parts[1].Substring(6); - type = Wix.RegistryValue.TypeType.integer; - } - else if (parts[1].StartsWith("hex(2):")) - { - // expandable string - value = parts[1].Substring(7); - type = Wix.RegistryValue.TypeType.expandable; - } - else if (parts[1].StartsWith("hex(7):")) - { - // multi-string - value = parts[1].Substring(7); - type = Wix.RegistryValue.TypeType.multiString; - } - else if (parts[1].StartsWith("hex(")) - { - // Give a better error when we find something that isn't supported - // by specifying the type that isn't supported. - string unsupportedType = ""; - - if (parts[1].StartsWith("hex(0")) { unsupportedType = "REG_NONE"; } - else if (parts[1].StartsWith("hex(6")) { unsupportedType = "REG_LINK"; } - else if (parts[1].StartsWith("hex(8")) { unsupportedType = "REG_RESOURCE_LIST"; } - else if (parts[1].StartsWith("hex(9")) { unsupportedType = "REG_FULL_RESOURCE_DESCRIPTOR"; } - else if (parts[1].StartsWith("hex(a")) { unsupportedType = "REG_RESOURCE_REQUIREMENTS_LIST"; } - else if (parts[1].StartsWith("hex(b")) { unsupportedType = "REG_QWORD"; } - - // REG_NONE(0), REG_LINK(6), REG_RESOURCE_LIST(8), REG_FULL_RESOURCE_DESCRIPTOR(9), REG_RESOURCE_REQUIREMENTS_LIST(a), REG_QWORD(b) - this.Core.Messaging.Write(HarvesterWarnings.UnsupportedRegistryType(parts[0], this.currentLineNumber, unsupportedType)); - - type = 0; - return false; - } - else if (parts[1].StartsWith("\"")) - { - // string - value = parts[1].Substring(1, parts[1].Length - 2); - type = Wix.RegistryValue.TypeType.@string; - } - else - { - // unsupported value - throw new ApplicationException(String.Format("Unsupported registry value {0} at line {1}.", line, this.currentLineNumber)); - } - - return true; - } - - /// - /// Get the next line from the reg file input stream. - /// - /// Reader for the reg file. - /// The next line. - private string GetNextLine(StreamReader sr) - { - string line; - string totalLine = null; - - while (null != (line = sr.ReadLine())) - { - bool stop = true; - - this.currentLineNumber++; - line = line.Trim(); - Console.Write("Processing line: {0}\r", this.currentLineNumber); - - if (line.EndsWith("\\")) - { - stop = false; - line = line.Substring(0, line.Length - 1); - } - - if (null == totalLine) - { - // first line - totalLine = line; - } - else - { - // other lines - totalLine += line; - } - - // break if there is no more info for this line - if (stop) - { - break; - } - } - - return totalLine; - } - - /// - /// Convert a character list into the proper WiX format for either unicode or ansi lists. - /// - /// List of characters. - /// Array of characters. - private ArrayList ConvertCharList(string charList) - { - if (string.IsNullOrEmpty(charList)) - { - return new ArrayList(); - } - - string[] strChars = charList.Split(",".ToCharArray()); - - ArrayList charArray = new ArrayList(); - - if (this.unicodeRegistry) - { - if (0 != strChars.Length % 2) - { - throw new ApplicationException(String.Format("Problem parsing Expandable string data at line {0}, its probably not Unicode.", this.currentLineNumber)); - } - - for (int i = 0; i < strChars.Length; i += 2) - { - string chars = strChars[i + 1] + strChars[i]; - int unicodeInt = Int32.Parse(chars, NumberStyles.HexNumber); - char unicodeChar = (char)unicodeInt; - charArray.Add(unicodeChar); - } - } - else - { - for (int i = 0; i < strChars.Length; i++) - { - char charValue = (char)Int32.Parse(strChars[i], NumberStyles.HexNumber); - charArray.Add(charValue); - } - } - - return charArray; - } - } -} diff --git a/src/heat/RegistryHarvester.cs b/src/heat/RegistryHarvester.cs deleted file mode 100644 index d416236c..00000000 --- a/src/heat/RegistryHarvester.cs +++ /dev/null @@ -1,477 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.Diagnostics; - using System.Globalization; - using System.Runtime.InteropServices; - using System.Text; - using Microsoft.Win32; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring from the registry. - /// - internal class RegistryHarvester : IDisposable - { - private const string HKCRPathInHKLM = @"Software\Classes"; - private string remappedPath; - private static readonly int majorOSVersion = Environment.OSVersion.Version.Major; - private RegistryKey regKeyToOverride = Registry.LocalMachine; - private IntPtr regRootToOverride = NativeMethods.HkeyLocalMachine; - - /// - /// Instantiate a new RegistryHarvester. - /// - /// Set to true to remap the entire registry to a private location for this process. - public RegistryHarvester(bool remap) - { - // Detect OS major version and set the hive to use when - // redirecting registry writes. We want to redirect registry - // writes to HKCU on Windows Vista and higher to avoid UAC - // problems, and to HKLM on downlevel OS's. - if (majorOSVersion >= 6) - { - this.regKeyToOverride = Registry.CurrentUser; - this.regRootToOverride = NativeMethods.HkeyCurrentUser; - } - - // create a path in the registry for redirected keys which is process-specific - if (remap) - { - this.remappedPath = String.Concat(@"SOFTWARE\WiX\heat\", Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture)); - - // remove the previous remapped key if it exists - this.RemoveRemappedKey(); - - // remap the registry roots supported by MSI - // note - order is important here - the hive being used to redirect - // to must be overridden last to avoid creating the other override - // hives in the wrong location in the registry. For example, if HKLM is - // the redirect destination, overriding it first will cause other hives - // to be overridden under HKLM\Software\WiX\heat\HKLM\Software\WiX\HKCR - // instead of under HKLM\Software\WiX\heat\HKCR - if (majorOSVersion < 6) - { - this.RemapRegistryKey(NativeMethods.HkeyClassesRoot, String.Concat(this.remappedPath, @"\\HKEY_CLASSES_ROOT")); - this.RemapRegistryKey(NativeMethods.HkeyCurrentUser, String.Concat(this.remappedPath, @"\\HKEY_CURRENT_USER")); - this.RemapRegistryKey(NativeMethods.HkeyUsers, String.Concat(this.remappedPath, @"\\HKEY_USERS")); - this.RemapRegistryKey(NativeMethods.HkeyLocalMachine, String.Concat(this.remappedPath, @"\\HKEY_LOCAL_MACHINE")); - } - else - { - this.RemapRegistryKey(NativeMethods.HkeyClassesRoot, String.Concat(this.remappedPath, @"\\HKEY_CLASSES_ROOT")); - this.RemapRegistryKey(NativeMethods.HkeyLocalMachine, String.Concat(this.remappedPath, @"\\HKEY_LOCAL_MACHINE")); - this.RemapRegistryKey(NativeMethods.HkeyUsers, String.Concat(this.remappedPath, @"\\HKEY_USERS")); - this.RemapRegistryKey(NativeMethods.HkeyCurrentUser, String.Concat(this.remappedPath, @"\\HKEY_CURRENT_USER")); - - // Typelib registration on Windows Vista requires that the key - // HKLM\Software\Classes exist, so add it to the remapped root - Registry.LocalMachine.CreateSubKey(HKCRPathInHKLM); - } - } - } - - /// - /// Close the RegistryHarvester and remove any remapped registry keys. - /// - public void Close() - { - // note - order is important here - we must quit overriding the hive - // being used to redirect first - if (majorOSVersion < 6) - { - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyLocalMachine, IntPtr.Zero); - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyClassesRoot, IntPtr.Zero); - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyCurrentUser, IntPtr.Zero); - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyUsers, IntPtr.Zero); - } - else - { - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyCurrentUser, IntPtr.Zero); - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyClassesRoot, IntPtr.Zero); - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyLocalMachine, IntPtr.Zero); - NativeMethods.OverrideRegistryKey(NativeMethods.HkeyUsers, IntPtr.Zero); - } - - this.RemoveRemappedKey(); - } - - /// - /// Dispose the RegistryHarvester. - /// - public void Dispose() - { - this.Close(); - } - - /// - /// Harvest all registry roots supported by Windows Installer. - /// - /// The registry keys and values in the registry. - public Wix.RegistryValue[] HarvestRegistry() - { - ArrayList registryValues = new ArrayList(); - - this.HarvestRegistryKey(Registry.ClassesRoot, registryValues); - this.HarvestRegistryKey(Registry.CurrentUser, registryValues); - this.HarvestRegistryKey(Registry.LocalMachine, registryValues); - this.HarvestRegistryKey(Registry.Users, registryValues); - - return (Wix.RegistryValue[])registryValues.ToArray(typeof(Wix.RegistryValue)); - } - - /// - /// Harvest a registry key. - /// - /// The path of the registry key to harvest. - /// The registry keys and values under the key. - public Wix.RegistryValue[] HarvestRegistryKey(string path) - { - RegistryKey registryKey = null; - ArrayList registryValues = new ArrayList(); - - string[] parts = GetPathParts(path); - - try - { - switch (parts[0]) - { - case "HKEY_CLASSES_ROOT": - registryKey = Registry.ClassesRoot; - break; - case "HKEY_CURRENT_USER": - registryKey = Registry.CurrentUser; - break; - case "HKEY_LOCAL_MACHINE": - registryKey = Registry.LocalMachine; - break; - case "HKEY_USERS": - registryKey = Registry.Users; - break; - default: - // TODO: put a better exception here - throw new Exception(); - } - - if (1 < parts.Length) - { - registryKey = registryKey.OpenSubKey(parts[1]); - - if (null == registryKey) - { - throw new WixException(HarvesterErrors.UnableToOpenRegistryKey(parts[1])); - } - } - - this.HarvestRegistryKey(registryKey, registryValues); - } - finally - { - if (null != registryKey) - { - registryKey.Close(); - } - } - - return (Wix.RegistryValue[])registryValues.ToArray(typeof(Wix.RegistryValue)); - } - - /// - /// Gets the parts of a registry key's path. - /// - /// The registry key path. - /// The root and key parts of the registry key path. - private static string[] GetPathParts(string path) - { - return path.Split(@"\".ToCharArray(), 2); - } - - /// - /// Harvest a registry key. - /// - /// The registry key to harvest. - /// The collected registry values. - private void HarvestRegistryKey(RegistryKey registryKey, ArrayList registryValues) - { - // harvest the sub-keys - foreach (string subKeyName in registryKey.GetSubKeyNames()) - { - using (RegistryKey subKey = registryKey.OpenSubKey(subKeyName)) - { - this.HarvestRegistryKey(subKey, registryValues); - } - } - - string[] parts = GetPathParts(registryKey.Name); - - Wix.RegistryRootType root; - switch (parts[0]) - { - case "HKEY_CLASSES_ROOT": - root = Wix.RegistryRootType.HKCR; - break; - case "HKEY_CURRENT_USER": - root = Wix.RegistryRootType.HKCU; - break; - case "HKEY_LOCAL_MACHINE": - // HKLM\Software\Classes is equivalent to HKCR - if (1 < parts.Length && parts[1].StartsWith(HKCRPathInHKLM, StringComparison.OrdinalIgnoreCase)) - { - root = Wix.RegistryRootType.HKCR; - parts[1] = parts[1].Remove(0, HKCRPathInHKLM.Length); - - if (0 < parts[1].Length) - { - parts[1] = parts[1].TrimStart('\\'); - } - - if (String.IsNullOrEmpty(parts[1])) - { - parts = new [] { parts[0] }; - } - } - else - { - root = Wix.RegistryRootType.HKLM; - } - break; - case "HKEY_USERS": - root = Wix.RegistryRootType.HKU; - break; - default: - // TODO: put a better exception here - throw new Exception(); - } - - // harvest the values - foreach (string valueName in registryKey.GetValueNames()) - { - Wix.RegistryValue registryValue = new Wix.RegistryValue(); - - registryValue.Action = Wix.RegistryValue.ActionType.write; - - registryValue.Root = root; - - if (1 < parts.Length) - { - registryValue.Key = parts[1]; - } - - if (null != valueName && 0 < valueName.Length) - { - registryValue.Name = valueName; - } - - object value = registryKey.GetValue(valueName); - - if (value is byte[]) // binary - { - StringBuilder hexadecimalValue = new StringBuilder(); - - // convert the byte array to hexadecimal - foreach (byte byteValue in (byte[])value) - { - hexadecimalValue.Append(byteValue.ToString("X2", CultureInfo.InvariantCulture.NumberFormat)); - } - - registryValue.Type = Wix.RegistryValue.TypeType.binary; - registryValue.Value = hexadecimalValue.ToString(); - } - else if (value is int) // integer - { - registryValue.Type = Wix.RegistryValue.TypeType.integer; - registryValue.Value = ((int)value).ToString(CultureInfo.InvariantCulture); - } - else if (value is string[]) // multi-string - { - registryValue.Type = Wix.RegistryValue.TypeType.multiString; - - if (0 == ((string[])value).Length) - { - Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); - - multiStringValue.Content = String.Empty; - - registryValue.AddChild(multiStringValue); - } - else - { - foreach (string multiStringValueContent in (string[])value) - { - Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); - - multiStringValue.Content = multiStringValueContent; - - registryValue.AddChild(multiStringValue); - } - } - } - else if (value is string) // string, expandable (there is no way to differentiate a string and expandable value in .NET 1.1) - { - registryValue.Type = Wix.RegistryValue.TypeType.@string; - registryValue.Value = (string)value; - } - else - { - // TODO: put a better exception here - throw new Exception(); - } - - registryValues.Add(registryValue); - } - - // If there were no subkeys and no values, we still need an element for this empty registry key. - // But specifically avoid SOFTWARE\Classes because it shouldn't be harvested as an empty key. - if (parts.Length > 1 && registryKey.SubKeyCount == 0 && registryKey.ValueCount == 0 && - !String.Equals(parts[1], HKCRPathInHKLM, StringComparison.OrdinalIgnoreCase)) - { - Wix.RegistryValue emptyRegistryKey = new Wix.RegistryValue(); - emptyRegistryKey.Root = root; - emptyRegistryKey.Key = parts[1]; - emptyRegistryKey.Type = Wix.RegistryValue.TypeType.@string; - emptyRegistryKey.Value = String.Empty; - emptyRegistryKey.Action = Wix.RegistryValue.ActionType.write; - registryValues.Add(emptyRegistryKey); - } - } - - /// - /// Remap a registry key to an alternative location. - /// - /// The registry key to remap. - /// The path to remap the registry key to under HKLM. - private void RemapRegistryKey(IntPtr registryKey, string remappedPath) - { - IntPtr remappedKey = IntPtr.Zero; - - try - { - remappedKey = NativeMethods.OpenRegistryKey(this.regRootToOverride, remappedPath); - - NativeMethods.OverrideRegistryKey(registryKey, remappedKey); - } - finally - { - if (IntPtr.Zero != remappedKey) - { - NativeMethods.CloseRegistryKey(remappedKey); - } - } - } - - /// - /// Remove the remapped registry key. - /// - private void RemoveRemappedKey() - { - try - { - this.regKeyToOverride.DeleteSubKeyTree(this.remappedPath); - } - catch (ArgumentException) - { - // ignore the error where the key does not exist - } - } - - /// - /// The native methods for re-mapping registry keys. - /// - private sealed class NativeMethods - { - internal static readonly IntPtr HkeyClassesRoot = (IntPtr)unchecked((Int32)0x80000000); - internal static readonly IntPtr HkeyCurrentUser = (IntPtr)unchecked((Int32)0x80000001); - internal static readonly IntPtr HkeyLocalMachine = (IntPtr)unchecked((Int32)0x80000002); - internal static readonly IntPtr HkeyUsers = (IntPtr)unchecked((Int32)0x80000003); - - private const uint GenericRead = 0x80000000; - private const uint GenericWrite = 0x40000000; - private const uint GenericExecute = 0x20000000; - private const uint GenericAll = 0x10000000; - private const uint StandardRightsAll = 0x001F0000; - - /// - /// Opens a registry key. - /// - /// Base key to open. - /// Path to subkey to open. - /// Handle to new key. - internal static IntPtr OpenRegistryKey(IntPtr key, string path) - { - IntPtr newKey = IntPtr.Zero; - uint disposition = 0; - uint sam = StandardRightsAll | GenericRead | GenericWrite | GenericExecute | GenericAll; - - if (0 != RegCreateKeyEx(key, path, 0, null, 0, sam, 0, out newKey, out disposition)) - { - throw new Exception(); - } - - return newKey; - } - - /// - /// Closes a previously open registry key. - /// - /// Handle to key to close. - internal static void CloseRegistryKey(IntPtr key) - { - if (0 != RegCloseKey(key)) - { - throw new Exception(); - } - } - - /// - /// Override a registry key. - /// - /// Handle of the key to override. - /// Handle to override key. - internal static void OverrideRegistryKey(IntPtr key, IntPtr newKey) - { - if (0 != RegOverridePredefKey(key, newKey)) - { - throw new Exception(); - } - } - - /// - /// Interop to RegCreateKeyW. - /// - /// Handle to base key. - /// Subkey to create. - /// Always 0 - /// Just pass null. - /// Just pass 0. - /// Rights to registry key. - /// Just pass null. - /// Opened key. - /// Whether key was opened or created. - /// Handle to registry key. - [DllImport("advapi32.dll", EntryPoint = "RegCreateKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private static extern int RegCreateKeyEx(IntPtr key, string subkey, uint reserved, string className, uint options, uint desiredSam, uint securityAttributes, out IntPtr openedKey, out uint disposition); - - /// - /// Interop to RegCloseKey. - /// - /// Handle to key to close. - /// 0 if success. - [DllImport("advapi32.dll", EntryPoint = "RegCloseKey", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private static extern int RegCloseKey(IntPtr key); - - /// - /// Interop to RegOverridePredefKey. - /// - /// Handle to key to override. - /// Handle to override key. - /// 0 if success. - [DllImport("advapi32.dll", EntryPoint = "RegOverridePredefKey", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private static extern int RegOverridePredefKey(IntPtr key, IntPtr newKey); - } - } -} diff --git a/src/heat/Serialize/CodeDomInterfaces.cs b/src/heat/Serialize/CodeDomInterfaces.cs deleted file mode 100644 index bd674db6..00000000 --- a/src/heat/Serialize/CodeDomInterfaces.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Serialize -{ - using System; - using System.Collections; - using System.Xml; - - /// - /// Interface for generated schema elements. - /// - public interface ISchemaElement - { - /// - /// Gets and sets the parent of this element. May be null. - /// - /// An ISchemaElement that has this element as a child. - ISchemaElement ParentElement - { - get; - set; - } - - /// - /// Outputs xml representing this element, including the associated attributes - /// and any nested elements. - /// - /// XmlWriter to be used when outputting the element. - void OutputXml(XmlWriter writer); - } - - /// - /// Interface for generated schema elements. Implemented by elements that have child - /// elements. - /// - public interface IParentElement - { - /// - /// Gets an enumerable collection of the children of this element. - /// - /// An enumerable collection of the children of this element. - IEnumerable Children - { - get; - } - - /// - /// Gets an enumerable collection of the children of this element, filtered - /// by the passed in type. - /// - /// The type of children to retrieve. - IEnumerable this[Type childType] - { - get; - } - - /// - /// Adds a child to this element. - /// - /// Child to add. - void AddChild(ISchemaElement child); - - /// - /// Removes a child from this element. - /// - /// Child to remove. - void RemoveChild(ISchemaElement child); - } - - /// - /// Interface for generated schema elements. Implemented by classes with attributes. - /// - public interface ISetAttributes - { - /// - /// Sets the attribute with the given name to the given value. The value here is - /// a string, and is converted to the strongly-typed version inside this method. - /// - /// The name of the attribute to set. - /// The value to assign to the attribute. - void SetAttribute(string name, string value); - } - - /// - /// Interface for generated schema elements. Implemented by classes with children. - /// - public interface ICreateChildren - { - /// - /// Creates an instance of the child with the passed in name. - /// - /// String matching the element name of the child when represented in XML. - /// An instance of that child. - ISchemaElement CreateChild(string childName); - } -} diff --git a/src/heat/Serialize/CodeDomReader.cs b/src/heat/Serialize/CodeDomReader.cs deleted file mode 100644 index 0741bf68..00000000 --- a/src/heat/Serialize/CodeDomReader.cs +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Serialize -{ - using System; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Reflection; - using System.Xml; - using WixToolset.Harvesters.Extensibility.Serialize; - - /// - /// Class used for reading XML files in to the CodeDom. - /// - public class CodeDomReader - { - private Assembly[] assemblies; - - /// - /// Creates a new CodeDomReader, using the current assembly. - /// - public CodeDomReader() - { - this.assemblies = new Assembly[] { Assembly.GetExecutingAssembly() }; - } - - /// - /// Creates a new CodeDomReader, and takes in a list of assemblies in which to - /// look for elements. - /// - /// Assemblies in which to look for types that correspond - /// to elements. - public CodeDomReader(Assembly[] assemblies) - { - this.assemblies = assemblies; - } - - /// - /// Loads an XML file into a strongly-typed code dom. - /// - /// File to load into the code dom. - /// The strongly-typed object at the root of the tree. - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] - public ISchemaElement Load(string filePath) - { - XmlDocument document = new XmlDocument(); - document.Load(filePath); - ISchemaElement schemaElement = null; - - foreach (XmlNode node in document.ChildNodes) - { - XmlElement element = node as XmlElement; - if (element != null) - { - if (schemaElement != null) - { - throw new InvalidOperationException(WixHarvesterStrings.EXP_MultipleRootElementsFoundInFile); - } - - schemaElement = this.CreateObjectFromElement(element); - this.ParseObjectFromElement(schemaElement, element); - } - } - return schemaElement; - } - - /// - /// Sets an attribute on an ISchemaElement. - /// - /// Schema element to set attribute on. - /// Name of the attribute to set. - /// Value to set on the attribute. - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] - private static void SetAttributeOnObject(ISchemaElement schemaElement, string name, string value) - { - ISetAttributes setAttributes = schemaElement as ISetAttributes; - if (setAttributes == null) - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_ISchemaElementDoesnotImplementISetAttribute, schemaElement.GetType().FullName)); - } - else - { - setAttributes.SetAttribute(name, value); - } - } - - /// - /// Parses an ISchemaElement from the XmlElement. - /// - /// ISchemaElement to fill in. - /// XmlElement to parse from. - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] - private void ParseObjectFromElement(ISchemaElement schemaElement, XmlElement element) - { - foreach (XmlAttribute attribute in element.Attributes) - { - SetAttributeOnObject(schemaElement, attribute.LocalName, attribute.Value); - } - - foreach (XmlNode node in element.ChildNodes) - { - XmlElement childElement = node as XmlElement; - if (childElement != null) - { - ISchemaElement childSchemaElement = null; - ICreateChildren createChildren = schemaElement as ICreateChildren; - if (createChildren == null) - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_ISchemaElementDoesnotImplementICreateChildren, element.LocalName)); - } - else - { - childSchemaElement = createChildren.CreateChild(childElement.LocalName); - } - - if (childSchemaElement == null) - { - childSchemaElement = this.CreateObjectFromElement(childElement); - if (childSchemaElement == null) - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_XmlElementDoesnotHaveISchemaElement, childElement.LocalName)); - } - } - - this.ParseObjectFromElement(childSchemaElement, childElement); - IParentElement parentElement = (IParentElement)schemaElement; - parentElement.AddChild(childSchemaElement); - } - else - { - XmlText childText = node as XmlText; - if (childText != null) - { - SetAttributeOnObject(schemaElement, "Content", childText.Value); - } - } - } - } - - /// - /// Creates an object from an XML element by digging through the assembly list. - /// - /// XML Element to create an ISchemaElement from. - /// A constructed ISchemaElement. - private ISchemaElement CreateObjectFromElement(XmlElement element) - { - ISchemaElement schemaElement = null; - foreach (Assembly assembly in this.assemblies) - { - foreach (Type type in assembly.GetTypes()) - { - if (type.FullName.EndsWith(element.LocalName, StringComparison.Ordinal) - && typeof(ISchemaElement).IsAssignableFrom(type)) - { - schemaElement = (ISchemaElement)Activator.CreateInstance(type); - } - } - } - return schemaElement; - } - } -} diff --git a/src/heat/Serialize/ElementCollection.cs b/src/heat/Serialize/ElementCollection.cs deleted file mode 100644 index bacbafbd..00000000 --- a/src/heat/Serialize/ElementCollection.cs +++ /dev/null @@ -1,618 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters.Serialize -{ - using System; - using System.Collections; - using System.Globalization; - using WixToolset.Harvesters.Extensibility.Serialize; - - /// - /// Collection used in the CodeDOM for the children of a given element. Provides type-checking - /// on the allowed children to ensure that only allowed types are added. - /// - public class ElementCollection : ICollection, IEnumerable - { - private CollectionType collectionType; - private int totalContainedItems; - private int containersUsed; - private ArrayList items; - - /// - /// Creates a new element collection. - /// - /// Type of the collection to create. - public ElementCollection(CollectionType collectionType) - { - this.collectionType = collectionType; - this.items = new ArrayList(); - } - - /// - /// Enum representing types of XML collections. - /// - public enum CollectionType - { - /// - /// A choice type, corresponding to the XSD choice element. - /// - Choice, - - /// - /// A sequence type, corresponding to the XSD sequence element. - /// - Sequence - } - - /// - /// Gets the type of collection. - /// - /// The type of collection. - public CollectionType Type - { - get { return this.collectionType; } - } - - /// - /// Gets the count of child elements in this collection (counts ISchemaElements, not nested collections). - /// - /// The count of child elements in this collection (counts ISchemaElements, not nested collections). - public int Count - { - get { return this.totalContainedItems; } - } - - /// - /// Gets the flag specifying whether this collection is synchronized. Always returns false. - /// - /// The flag specifying whether this collection is synchronized. Always returns false. - public bool IsSynchronized - { - get { return false; } - } - - /// - /// Gets an object external callers can synchronize on. - /// - /// An object external callers can synchronize on. - public object SyncRoot - { - get { return this; } - } - - /// - /// Adds a child element to this collection. - /// - /// The element to add. - /// Thrown if the child is not of an allowed type. - public void AddElement(ISchemaElement element) - { - foreach (object obj in this.items) - { - bool containerUsed; - - CollectionItem collectionItem = obj as CollectionItem; - if (collectionItem != null) - { - containerUsed = collectionItem.Elements.Count != 0; - if (collectionItem.ElementType.IsAssignableFrom(element.GetType())) - { - collectionItem.AddElement(element); - - if (!containerUsed) - { - this.containersUsed++; - } - - this.totalContainedItems++; - return; - } - - continue; - } - - ElementCollection collection = obj as ElementCollection; - if (collection != null) - { - containerUsed = collection.Count != 0; - - try - { - collection.AddElement(element); - - if (!containerUsed) - { - this.containersUsed++; - } - - this.totalContainedItems++; - return; - } - catch (ArgumentException) - { - // Eat the exception and keep looking. We'll throw our own if we can't find its home. - } - - continue; - } - } - - throw new ArgumentException(String.Format( - CultureInfo.InvariantCulture, - WixHarvesterStrings.EXP_ElementOfTypeIsNotValidForThisCollection, - element.GetType().Name)); - } - - /// - /// Removes a child element from this collection. - /// - /// The element to remove. - /// Thrown if the element is not of an allowed type. - public void RemoveElement(ISchemaElement element) - { - foreach (object obj in this.items) - { - CollectionItem collectionItem = obj as CollectionItem; - if (collectionItem != null) - { - if (collectionItem.ElementType.IsAssignableFrom(element.GetType())) - { - if (collectionItem.Elements.Count == 0) - { - return; - } - - collectionItem.RemoveElement(element); - - if (collectionItem.Elements.Count == 0) - { - this.containersUsed--; - } - - this.totalContainedItems--; - return; - } - - continue; - } - - ElementCollection collection = obj as ElementCollection; - if (collection != null) - { - if (collection.Count == 0) - { - continue; - } - - try - { - collection.RemoveElement(element); - - if (collection.Count == 0) - { - this.containersUsed--; - } - - this.totalContainedItems--; - return; - } - catch (ArgumentException) - { - // Eat the exception and keep looking. We'll throw our own if we can't find its home. - } - - continue; - } - } - - throw new ArgumentException(String.Format( - CultureInfo.InvariantCulture, - WixHarvesterStrings.EXP_ElementOfTypeIsNotValidForThisCollection, - element.GetType().Name)); - } - - /// - /// Copies this collection to an array. - /// - /// Array to copy to. - /// Offset into the array. - public void CopyTo(Array array, int index) - { - int item = 0; - foreach (ISchemaElement element in this) - { - array.SetValue(element, (long)(item + index)); - item++; - } - } - - /// - /// Creates an enumerator for walking the elements in this collection. - /// - /// A newly created enumerator. - public IEnumerator GetEnumerator() - { - return new ElementCollectionEnumerator(this); - } - - /// - /// Gets an enumerable collection of children of a given type. - /// - /// Type of children to get. - /// A collection of children. - /// Thrown if the type isn't a valid child type. - public IEnumerable Filter(Type childType) - { - foreach (object container in this.items) - { - CollectionItem collectionItem = container as CollectionItem; - if (collectionItem != null) - { - if (collectionItem.ElementType.IsAssignableFrom(childType)) - { - return collectionItem.Elements; - } - - continue; - } - - ElementCollection elementCollection = container as ElementCollection; - if (elementCollection != null) - { - IEnumerable nestedFilter = elementCollection.Filter(childType); - if (nestedFilter != null) - { - return nestedFilter; - } - - continue; - } - } - - throw new ArgumentException(String.Format( - CultureInfo.InvariantCulture, - WixHarvesterStrings.EXP_TypeIsNotValidForThisCollection, - childType.Name)); - } - - /// - /// Adds a type to this collection. - /// - /// CollectionItem representing the type to add. - public void AddItem(CollectionItem collectionItem) - { - this.items.Add(collectionItem); - } - - /// - /// Adds a nested collection to this collection. - /// - /// ElementCollection to add. - public void AddCollection(ElementCollection collection) - { - this.items.Add(collection); - } - - /// - /// Class used to represent a given type in the child collection of an element. Abstract, - /// has subclasses for choice and sequence (which can do cardinality checks). - /// - public abstract class CollectionItem - { - private Type elementType; - private ArrayList elements; - - /// - /// Creates a new CollectionItem for the given element type. - /// - /// Type of the element for this collection item. - protected CollectionItem(Type elementType) - { - this.elementType = elementType; - this.elements = new ArrayList(); - } - - /// - /// Gets the type of this collection's items. - /// - /// The type of this collection's items. - public Type ElementType - { - get { return this.elementType; } - } - - /// - /// Gets the elements of this collection. - /// - /// The elements of this collection. - public ArrayList Elements - { - get { return this.elements; } - } - - /// - /// Adds an element to this collection. Must be of an assignable type to the collection's - /// type. - /// - /// The element to add. - /// Thrown if the type isn't assignable to the collection's type. - public void AddElement(ISchemaElement element) - { - if (!this.elementType.IsAssignableFrom(element.GetType())) - { - throw new ArgumentException( - String.Format( - CultureInfo.InvariantCulture, - WixHarvesterStrings.EXP_ElementIsSubclassOfDifferentType, - this.elementType.Name, - element.GetType().Name), - "element"); - } - - this.elements.Add(element); - } - - /// - /// Removes an element from this collection. - /// - /// The element to remove. - /// Thrown if the element's type isn't assignable to the collection's type. - public void RemoveElement(ISchemaElement element) - { - if (!this.elementType.IsAssignableFrom(element.GetType())) - { - throw new ArgumentException( - String.Format( - CultureInfo.InvariantCulture, - WixHarvesterStrings.EXP_ElementIsSubclassOfDifferentType, - this.elementType.Name, - element.GetType().Name), - "element"); - } - - this.elements.Remove(element); - } - } - - /// - /// Class representing a choice item. Doesn't do cardinality checks. - /// - public class ChoiceItem : CollectionItem - { - /// - /// Creates a new choice item. - /// - /// Type of the created item. - public ChoiceItem(Type elementType) - : base(elementType) - { - } - } - - /// - /// Class representing a sequence item. Can do cardinality checks, if required. - /// - public class SequenceItem : CollectionItem - { - /// - /// Creates a new sequence item. - /// - /// Type of the created item. - public SequenceItem(Type elementType) - : base(elementType) - { - } - } - - /// - /// Enumerator for the ElementCollection. - /// - private class ElementCollectionEnumerator : IEnumerator - { - private ElementCollection collection; - private Stack collectionStack; - - /// - /// Creates a new ElementCollectionEnumerator. - /// - /// The collection to create an enumerator for. - public ElementCollectionEnumerator(ElementCollection collection) - { - this.collection = collection; - } - - /// - /// Gets the current object from the enumerator. - /// - public object Current - { - get - { - if (this.collectionStack != null && this.collectionStack.Count > 0) - { - CollectionSymbol symbol = (CollectionSymbol)this.collectionStack.Peek(); - object container = symbol.Collection.items[symbol.ContainerIndex]; - - CollectionItem collectionItem = container as CollectionItem; - if (collectionItem != null) - { - return collectionItem.Elements[symbol.ItemIndex]; - } - - throw new InvalidOperationException(String.Format( - CultureInfo.InvariantCulture, - WixHarvesterStrings.EXP_ElementMustBeChoiceItemOrSequenceItem, - container.GetType().Name)); - } - - return null; - } - } - - /// - /// Resets the enumerator to the beginning. - /// - public void Reset() - { - if (this.collectionStack != null) - { - this.collectionStack.Clear(); - this.collectionStack = null; - } - } - - /// - /// Moves the enumerator to the next item. - /// - /// True if there is a next item, false otherwise. - public bool MoveNext() - { - if (this.collectionStack == null) - { - if (this.collection.Count == 0) - { - return false; - } - - this.collectionStack = new Stack(); - this.collectionStack.Push(new CollectionSymbol(this.collection)); - } - - CollectionSymbol symbol = (CollectionSymbol)this.collectionStack.Peek(); - - if (this.FindNext(symbol)) - { - return true; - } - - this.collectionStack.Pop(); - if (this.collectionStack.Count == 0) - { - return false; - } - - return this.MoveNext(); - } - - /// - /// Pushes a collection onto the stack. - /// - /// The collection to push. - private void PushCollection(ElementCollection elementCollection) - { - if (elementCollection.Count <= 0) - { - throw new ArgumentException(String.Format( - CultureInfo.InvariantCulture, - WixHarvesterStrings.EXP_CollectionMustHaveAtLeastOneElement, - elementCollection.Count)); - } - - CollectionSymbol symbol = new CollectionSymbol(elementCollection); - this.collectionStack.Push(symbol); - this.FindNext(symbol); - } - - /// - /// Finds the next item from a given symbol. - /// - /// The symbol to start looking from. - /// True if a next element is found, false otherwise. - private bool FindNext(CollectionSymbol symbol) - { - object container = symbol.Collection.items[symbol.ContainerIndex]; - - CollectionItem collectionItem = container as CollectionItem; - if (collectionItem != null) - { - if (symbol.ItemIndex + 1 < collectionItem.Elements.Count) - { - symbol.ItemIndex++; - return true; - } - } - - ElementCollection elementCollection = container as ElementCollection; - if (elementCollection != null && elementCollection.Count > 0 && symbol.ItemIndex == -1) - { - symbol.ItemIndex++; - this.PushCollection(elementCollection); - return true; - } - - symbol.ItemIndex = 0; - - for (int i = symbol.ContainerIndex + 1; i < symbol.Collection.items.Count; ++i) - { - object nestedContainer = symbol.Collection.items[i]; - - CollectionItem nestedCollectionItem = nestedContainer as CollectionItem; - if (nestedCollectionItem != null) - { - if (nestedCollectionItem.Elements.Count > 0) - { - symbol.ContainerIndex = i; - return true; - } - } - - ElementCollection nestedElementCollection = nestedContainer as ElementCollection; - if (nestedElementCollection != null && nestedElementCollection.Count > 0) - { - symbol.ContainerIndex = i; - this.PushCollection(nestedElementCollection); - return true; - } - } - - return false; - } - - /// - /// Class representing a single point in the collection. Consists of an ElementCollection, - /// a container index, and an index into the container. - /// - private class CollectionSymbol - { - private ElementCollection collection; - private int containerIndex; - private int itemIndex = -1; - - /// - /// Creates a new CollectionSymbol. - /// - /// The collection for the symbol. - public CollectionSymbol(ElementCollection collection) - { - this.collection = collection; - } - - /// - /// Gets the collection for the symbol. - /// - public ElementCollection Collection - { - get { return this.collection; } - } - - /// - /// Gets and sets the index of the container in the collection. - /// - public int ContainerIndex - { - get { return this.containerIndex; } - set { this.containerIndex = value; } - } - - /// - /// Gets and sets the index of the item in the container. - /// - public int ItemIndex - { - get { return this.itemIndex; } - set { this.itemIndex = value; } - } - } - } - } -} diff --git a/src/heat/Serialize/WixHarvesterStrings.Designer.cs b/src/heat/Serialize/WixHarvesterStrings.Designer.cs deleted file mode 100644 index 6504a67b..00000000 --- a/src/heat/Serialize/WixHarvesterStrings.Designer.cs +++ /dev/null @@ -1,153 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WixToolset.Harvesters.Extensibility.Serialize { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class WixHarvesterStrings { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal WixHarvesterStrings() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WixToolset.Harvesters.Extensibility.Serialize.WixHarvesterStrings", typeof(WixHarvesterStrings).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Collection has {0} elements. Must have at least one.. - /// - internal static string EXP_CollectionMustHaveAtLeastOneElement { - get { - return ResourceManager.GetString("EXP_CollectionMustHaveAtLeastOneElement", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Element must be a subclass of {0}, but was of type {1}.. - /// - internal static string EXP_ElementIsSubclassOfDifferentType { - get { - return ResourceManager.GetString("EXP_ElementIsSubclassOfDifferentType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Element of type {0} found in enumerator. Must be ChoiceItem or SequenceItem.. - /// - internal static string EXP_ElementMustBeChoiceItemOrSequenceItem { - get { - return ResourceManager.GetString("EXP_ElementMustBeChoiceItemOrSequenceItem", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Element of type {0} is not valid for this collection.. - /// - internal static string EXP_ElementOfTypeIsNotValidForThisCollection { - get { - return ResourceManager.GetString("EXP_ElementOfTypeIsNotValidForThisCollection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ISchemaElement with name {0} does not implement ICreateChildren.. - /// - internal static string EXP_ISchemaElementDoesnotImplementICreateChildren { - get { - return ResourceManager.GetString("EXP_ISchemaElementDoesnotImplementICreateChildren", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ISchemaElement with name {0} does not implement ISetAttributes.. - /// - internal static string EXP_ISchemaElementDoesnotImplementISetAttribute { - get { - return ResourceManager.GetString("EXP_ISchemaElementDoesnotImplementISetAttribute", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A Merge table FileCompression column contains an invalid value '{0}'.. - /// - internal static string EXP_MergeTableFileCompressionColumnContainsInvalidValue { - get { - return ResourceManager.GetString("EXP_MergeTableFileCompressionColumnContainsInvalidValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Multiple root elements found in file.. - /// - internal static string EXP_MultipleRootElementsFoundInFile { - get { - return ResourceManager.GetString("EXP_MultipleRootElementsFoundInFile", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Type {0} is not valid for this collection.. - /// - internal static string EXP_TypeIsNotValidForThisCollection { - get { - return ResourceManager.GetString("EXP_TypeIsNotValidForThisCollection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to XmlElement with name {0} does not have a corresponding ISchemaElement.. - /// - internal static string EXP_XmlElementDoesnotHaveISchemaElement { - get { - return ResourceManager.GetString("EXP_XmlElementDoesnotHaveISchemaElement", resourceCulture); - } - } - } -} diff --git a/src/heat/Serialize/WixHarvesterStrings.resx b/src/heat/Serialize/WixHarvesterStrings.resx deleted file mode 100644 index 5894a190..00000000 --- a/src/heat/Serialize/WixHarvesterStrings.resx +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - A Merge table FileCompression column contains an invalid value '{0}'. - - - Multiple root elements found in file. - - - ISchemaElement with name {0} does not implement ICreateChildren. - - - ISchemaElement with name {0} does not implement ISetAttributes. - - - XmlElement with name {0} does not have a corresponding ISchemaElement. - - - Element of type {0} is not valid for this collection. - - - Type {0} is not valid for this collection. - - - Collection has {0} elements. Must have at least one. - - - Element must be a subclass of {0}, but was of type {1}. - - - Element of type {0} found in enumerator. Must be ChoiceItem or SequenceItem. - - \ No newline at end of file diff --git a/src/heat/Serialize/iis.cs b/src/heat/Serialize/iis.cs deleted file mode 100644 index 3f2943f8..00000000 --- a/src/heat/Serialize/iis.cs +++ /dev/null @@ -1,5915 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#pragma warning disable 1591 -namespace WixToolset.Harvesters.Serialize.IIs -{ - using System; - using System.CodeDom.Compiler; - using System.Collections; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Xml; - using WixToolset.Harvesters.Serialize; - - - /// - /// Values of this type will either be "yes" or "no". - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum YesNoType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - no, - - yes, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public class Enums - { - - /// - /// Parses a YesNoType from a string. - /// - public static YesNoType ParseYesNoType(string value) - { - YesNoType parsedValue; - Enums.TryParseYesNoType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoType from a string. - /// - public static bool TryParseYesNoType(string value, out YesNoType parsedValue) - { - parsedValue = YesNoType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("no" == value)) - { - parsedValue = YesNoType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoType.yes; - } - else - { - parsedValue = YesNoType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a YesNoDefaultType from a string. - /// - public static YesNoDefaultType ParseYesNoDefaultType(string value) - { - YesNoDefaultType parsedValue; - Enums.TryParseYesNoDefaultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoDefaultType from a string. - /// - public static bool TryParseYesNoDefaultType(string value, out YesNoDefaultType parsedValue) - { - parsedValue = YesNoDefaultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("default" == value)) - { - parsedValue = YesNoDefaultType.@default; - } - else - { - if (("no" == value)) - { - parsedValue = YesNoDefaultType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoDefaultType.yes; - } - else - { - parsedValue = YesNoDefaultType.IllegalValue; - return false; - } - } - } - return true; - } - } - - /// - /// Values of this type will either be "default", "yes", or "no". - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum YesNoDefaultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - @default, - - no, - - yes, - } - - /// - /// WebDirProperties used by one or more WebSites. Lists properties common to IIS web sites and vroots. Corresponding properties can be viewed through the IIS Manager snap-in. One property entry can be reused by multiple sites or vroots using the Id field as a reference, using WebVirtualDir.DirProperties, WebSite.DirProperties, or WebDir.DirProperties. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebDirProperties : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType readField; - - private bool readFieldSet; - - private YesNoType writeField; - - private bool writeFieldSet; - - private YesNoType scriptField; - - private bool scriptFieldSet; - - private YesNoType executeField; - - private bool executeFieldSet; - - private YesNoType anonymousAccessField; - - private bool anonymousAccessFieldSet; - - private string anonymousUserField; - - private bool anonymousUserFieldSet; - - private YesNoType iIsControlledPasswordField; - - private bool iIsControlledPasswordFieldSet; - - private YesNoType windowsAuthenticationField; - - private bool windowsAuthenticationFieldSet; - - private YesNoType digestAuthenticationField; - - private bool digestAuthenticationFieldSet; - - private YesNoType basicAuthenticationField; - - private bool basicAuthenticationFieldSet; - - private YesNoType passportAuthenticationField; - - private bool passportAuthenticationFieldSet; - - private YesNoType logVisitsField; - - private bool logVisitsFieldSet; - - private YesNoType indexField; - - private bool indexFieldSet; - - private string defaultDocumentsField; - - private bool defaultDocumentsFieldSet; - - private YesNoType aspDetailedErrorField; - - private bool aspDetailedErrorFieldSet; - - private string httpExpiresField; - - private bool httpExpiresFieldSet; - - private long cacheControlMaxAgeField; - - private bool cacheControlMaxAgeFieldSet; - - private string cacheControlCustomField; - - private bool cacheControlCustomFieldSet; - - private YesNoType clearCustomErrorField; - - private bool clearCustomErrorFieldSet; - - private YesNoType accessSSLField; - - private bool accessSSLFieldSet; - - private YesNoType accessSSL128Field; - - private bool accessSSL128FieldSet; - - private YesNoType accessSSLMapCertField; - - private bool accessSSLMapCertFieldSet; - - private YesNoType accessSSLNegotiateCertField; - - private bool accessSSLNegotiateCertFieldSet; - - private YesNoType accessSSLRequireCertField; - - private bool accessSSLRequireCertFieldSet; - - private string authenticationProvidersField; - - private bool authenticationProvidersFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public YesNoType Read - { - get - { - return this.readField; - } - set - { - this.readFieldSet = true; - this.readField = value; - } - } - - public YesNoType Write - { - get - { - return this.writeField; - } - set - { - this.writeFieldSet = true; - this.writeField = value; - } - } - - public YesNoType Script - { - get - { - return this.scriptField; - } - set - { - this.scriptFieldSet = true; - this.scriptField = value; - } - } - - public YesNoType Execute - { - get - { - return this.executeField; - } - set - { - this.executeFieldSet = true; - this.executeField = value; - } - } - - /// - /// Sets the Enable Anonymous Access checkbox, which maps anonymous users to a Windows user account. When setting this to 'yes' you should also provide the user account using the AnonymousUser attribute, and determine what setting to use for the IIsControlledPassword attribute. Defaults to 'no.' - /// - public YesNoType AnonymousAccess - { - get - { - return this.anonymousAccessField; - } - set - { - this.anonymousAccessFieldSet = true; - this.anonymousAccessField = value; - } - } - - /// - /// Reference to the Id attribute on the User element to be used as the anonymous user for the directory. See the User element for more information. - /// - public string AnonymousUser - { - get - { - return this.anonymousUserField; - } - set - { - this.anonymousUserFieldSet = true; - this.anonymousUserField = value; - } - } - - /// - /// Sets whether IIS should control the password used for the Windows account specified in the AnonymousUser attribute. Defaults to 'no.' - /// - public YesNoType IIsControlledPassword - { - get - { - return this.iIsControlledPasswordField; - } - set - { - this.iIsControlledPasswordFieldSet = true; - this.iIsControlledPasswordField = value; - } - } - - /// - /// Sets the Windows Authentication option, which enables integrated Windows authentication to be used on the site. Defaults to 'no.' - /// - public YesNoType WindowsAuthentication - { - get - { - return this.windowsAuthenticationField; - } - set - { - this.windowsAuthenticationFieldSet = true; - this.windowsAuthenticationField = value; - } - } - - /// - /// Sets the Digest Authentication option, which allows using digest authentication with domain user accounts. Defaults to 'no.' - /// - public YesNoType DigestAuthentication - { - get - { - return this.digestAuthenticationField; - } - set - { - this.digestAuthenticationFieldSet = true; - this.digestAuthenticationField = value; - } - } - - /// - /// Sets the Basic Authentication option, which allows clients to provide credentials in plaintext over the wire. Defaults to 'no.' - /// - public YesNoType BasicAuthentication - { - get - { - return this.basicAuthenticationField; - } - set - { - this.basicAuthenticationFieldSet = true; - this.basicAuthenticationField = value; - } - } - - /// - /// Sets the Passport Authentication option, which allows clients to provide credentials via a .Net Passport account. Defaults to 'no.' - /// - public YesNoType PassportAuthentication - { - get - { - return this.passportAuthenticationField; - } - set - { - this.passportAuthenticationFieldSet = true; - this.passportAuthenticationField = value; - } - } - - /// - /// Sets whether visits to this site should be logged. Defaults to 'no.' - /// - public YesNoType LogVisits - { - get - { - return this.logVisitsField; - } - set - { - this.logVisitsFieldSet = true; - this.logVisitsField = value; - } - } - - /// - /// Sets the Index Resource option, which specifies whether this web directory should be indexed. Defaults to 'no.' - /// - public YesNoType Index - { - get - { - return this.indexField; - } - set - { - this.indexFieldSet = true; - this.indexField = value; - } - } - - /// - /// The list of default documents to set for this web directory, in comma-delimited format. - /// - public string DefaultDocuments - { - get - { - return this.defaultDocumentsField; - } - set - { - this.defaultDocumentsFieldSet = true; - this.defaultDocumentsField = value; - } - } - - /// - /// Sets the option for whether to send detailed ASP errors back to the client on script error. Default is 'no.' - /// - public YesNoType AspDetailedError - { - get - { - return this.aspDetailedErrorField; - } - set - { - this.aspDetailedErrorFieldSet = true; - this.aspDetailedErrorField = value; - } - } - - /// - /// Value to set the HttpExpires attribute to for a Web Dir in the metabase. - /// - public string HttpExpires - { - get - { - return this.httpExpiresField; - } - set - { - this.httpExpiresFieldSet = true; - this.httpExpiresField = value; - } - } - - /// - /// Integer value specifying the cache control maximum age value. - /// - public long CacheControlMaxAge - { - get - { - return this.cacheControlMaxAgeField; - } - set - { - this.cacheControlMaxAgeFieldSet = true; - this.cacheControlMaxAgeField = value; - } - } - - /// - /// Custom HTTP 1.1 cache control directives. - /// - public string CacheControlCustom - { - get - { - return this.cacheControlCustomField; - } - set - { - this.cacheControlCustomFieldSet = true; - this.cacheControlCustomField = value; - } - } - - /// - /// Specifies whether IIs will return custom errors for this directory. - /// - public YesNoType ClearCustomError - { - get - { - return this.clearCustomErrorField; - } - set - { - this.clearCustomErrorFieldSet = true; - this.clearCustomErrorField = value; - } - } - - /// - /// A value of true indicates that file access requires SSL file permission processing, with or without a client certificate. This corresponds to AccessSSL flag for AccessSSLFlags IIS metabase property. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType AccessSSL - { - get - { - return this.accessSSLField; - } - set - { - this.accessSSLFieldSet = true; - this.accessSSLField = value; - } - } - - /// - /// A value of true indicates that file access requires SSL file permission processing with a minimum key size of 128 bits, with or without a client certificate. This corresponds to AccessSSL128 flag for AccessSSLFlags IIS metabase property. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType AccessSSL128 - { - get - { - return this.accessSSL128Field; - } - set - { - this.accessSSL128FieldSet = true; - this.accessSSL128Field = value; - } - } - - /// - /// This corresponds to AccessSSLMapCert flag for AccessSSLFlags IIS metabase property. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType AccessSSLMapCert - { - get - { - return this.accessSSLMapCertField; - } - set - { - this.accessSSLMapCertFieldSet = true; - this.accessSSLMapCertField = value; - } - } - - /// - /// This corresponds to AccessSSLNegotiateCert flag for AccessSSLFlags IIS metabase property. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType AccessSSLNegotiateCert - { - get - { - return this.accessSSLNegotiateCertField; - } - set - { - this.accessSSLNegotiateCertFieldSet = true; - this.accessSSLNegotiateCertField = value; - } - } - - /// - /// This corresponds to AccessSSLRequireCert flag for AccessSSLFlags IIS metabase property. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType AccessSSLRequireCert - { - get - { - return this.accessSSLRequireCertField; - } - set - { - this.accessSSLRequireCertFieldSet = true; - this.accessSSLRequireCertField = value; - } - } - - /// - /// Comma delimited list, in order of precedence, of Windows authentication providers that IIS will attempt to use: NTLM, Kerberos, Negotiate, and others. - /// - public string AuthenticationProviders - { - get - { - return this.authenticationProvidersField; - } - set - { - this.authenticationProvidersFieldSet = true; - this.authenticationProvidersField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebDirProperties", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.readFieldSet) - { - if ((this.readField == YesNoType.no)) - { - writer.WriteAttributeString("Read", "no"); - } - if ((this.readField == YesNoType.yes)) - { - writer.WriteAttributeString("Read", "yes"); - } - } - if (this.writeFieldSet) - { - if ((this.writeField == YesNoType.no)) - { - writer.WriteAttributeString("Write", "no"); - } - if ((this.writeField == YesNoType.yes)) - { - writer.WriteAttributeString("Write", "yes"); - } - } - if (this.scriptFieldSet) - { - if ((this.scriptField == YesNoType.no)) - { - writer.WriteAttributeString("Script", "no"); - } - if ((this.scriptField == YesNoType.yes)) - { - writer.WriteAttributeString("Script", "yes"); - } - } - if (this.executeFieldSet) - { - if ((this.executeField == YesNoType.no)) - { - writer.WriteAttributeString("Execute", "no"); - } - if ((this.executeField == YesNoType.yes)) - { - writer.WriteAttributeString("Execute", "yes"); - } - } - if (this.anonymousAccessFieldSet) - { - if ((this.anonymousAccessField == YesNoType.no)) - { - writer.WriteAttributeString("AnonymousAccess", "no"); - } - if ((this.anonymousAccessField == YesNoType.yes)) - { - writer.WriteAttributeString("AnonymousAccess", "yes"); - } - } - if (this.anonymousUserFieldSet) - { - writer.WriteAttributeString("AnonymousUser", this.anonymousUserField); - } - if (this.iIsControlledPasswordFieldSet) - { - if ((this.iIsControlledPasswordField == YesNoType.no)) - { - writer.WriteAttributeString("IIsControlledPassword", "no"); - } - if ((this.iIsControlledPasswordField == YesNoType.yes)) - { - writer.WriteAttributeString("IIsControlledPassword", "yes"); - } - } - if (this.windowsAuthenticationFieldSet) - { - if ((this.windowsAuthenticationField == YesNoType.no)) - { - writer.WriteAttributeString("WindowsAuthentication", "no"); - } - if ((this.windowsAuthenticationField == YesNoType.yes)) - { - writer.WriteAttributeString("WindowsAuthentication", "yes"); - } - } - if (this.digestAuthenticationFieldSet) - { - if ((this.digestAuthenticationField == YesNoType.no)) - { - writer.WriteAttributeString("DigestAuthentication", "no"); - } - if ((this.digestAuthenticationField == YesNoType.yes)) - { - writer.WriteAttributeString("DigestAuthentication", "yes"); - } - } - if (this.basicAuthenticationFieldSet) - { - if ((this.basicAuthenticationField == YesNoType.no)) - { - writer.WriteAttributeString("BasicAuthentication", "no"); - } - if ((this.basicAuthenticationField == YesNoType.yes)) - { - writer.WriteAttributeString("BasicAuthentication", "yes"); - } - } - if (this.passportAuthenticationFieldSet) - { - if ((this.passportAuthenticationField == YesNoType.no)) - { - writer.WriteAttributeString("PassportAuthentication", "no"); - } - if ((this.passportAuthenticationField == YesNoType.yes)) - { - writer.WriteAttributeString("PassportAuthentication", "yes"); - } - } - if (this.logVisitsFieldSet) - { - if ((this.logVisitsField == YesNoType.no)) - { - writer.WriteAttributeString("LogVisits", "no"); - } - if ((this.logVisitsField == YesNoType.yes)) - { - writer.WriteAttributeString("LogVisits", "yes"); - } - } - if (this.indexFieldSet) - { - if ((this.indexField == YesNoType.no)) - { - writer.WriteAttributeString("Index", "no"); - } - if ((this.indexField == YesNoType.yes)) - { - writer.WriteAttributeString("Index", "yes"); - } - } - if (this.defaultDocumentsFieldSet) - { - writer.WriteAttributeString("DefaultDocuments", this.defaultDocumentsField); - } - if (this.aspDetailedErrorFieldSet) - { - if ((this.aspDetailedErrorField == YesNoType.no)) - { - writer.WriteAttributeString("AspDetailedError", "no"); - } - if ((this.aspDetailedErrorField == YesNoType.yes)) - { - writer.WriteAttributeString("AspDetailedError", "yes"); - } - } - if (this.httpExpiresFieldSet) - { - writer.WriteAttributeString("HttpExpires", this.httpExpiresField); - } - if (this.cacheControlMaxAgeFieldSet) - { - writer.WriteAttributeString("CacheControlMaxAge", this.cacheControlMaxAgeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.cacheControlCustomFieldSet) - { - writer.WriteAttributeString("CacheControlCustom", this.cacheControlCustomField); - } - if (this.clearCustomErrorFieldSet) - { - if ((this.clearCustomErrorField == YesNoType.no)) - { - writer.WriteAttributeString("ClearCustomError", "no"); - } - if ((this.clearCustomErrorField == YesNoType.yes)) - { - writer.WriteAttributeString("ClearCustomError", "yes"); - } - } - if (this.accessSSLFieldSet) - { - if ((this.accessSSLField == YesNoType.no)) - { - writer.WriteAttributeString("AccessSSL", "no"); - } - if ((this.accessSSLField == YesNoType.yes)) - { - writer.WriteAttributeString("AccessSSL", "yes"); - } - } - if (this.accessSSL128FieldSet) - { - if ((this.accessSSL128Field == YesNoType.no)) - { - writer.WriteAttributeString("AccessSSL128", "no"); - } - if ((this.accessSSL128Field == YesNoType.yes)) - { - writer.WriteAttributeString("AccessSSL128", "yes"); - } - } - if (this.accessSSLMapCertFieldSet) - { - if ((this.accessSSLMapCertField == YesNoType.no)) - { - writer.WriteAttributeString("AccessSSLMapCert", "no"); - } - if ((this.accessSSLMapCertField == YesNoType.yes)) - { - writer.WriteAttributeString("AccessSSLMapCert", "yes"); - } - } - if (this.accessSSLNegotiateCertFieldSet) - { - if ((this.accessSSLNegotiateCertField == YesNoType.no)) - { - writer.WriteAttributeString("AccessSSLNegotiateCert", "no"); - } - if ((this.accessSSLNegotiateCertField == YesNoType.yes)) - { - writer.WriteAttributeString("AccessSSLNegotiateCert", "yes"); - } - } - if (this.accessSSLRequireCertFieldSet) - { - if ((this.accessSSLRequireCertField == YesNoType.no)) - { - writer.WriteAttributeString("AccessSSLRequireCert", "no"); - } - if ((this.accessSSLRequireCertField == YesNoType.yes)) - { - writer.WriteAttributeString("AccessSSLRequireCert", "yes"); - } - } - if (this.authenticationProvidersFieldSet) - { - writer.WriteAttributeString("AuthenticationProviders", this.authenticationProvidersField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Read" == name)) - { - this.readField = Enums.ParseYesNoType(value); - this.readFieldSet = true; - } - if (("Write" == name)) - { - this.writeField = Enums.ParseYesNoType(value); - this.writeFieldSet = true; - } - if (("Script" == name)) - { - this.scriptField = Enums.ParseYesNoType(value); - this.scriptFieldSet = true; - } - if (("Execute" == name)) - { - this.executeField = Enums.ParseYesNoType(value); - this.executeFieldSet = true; - } - if (("AnonymousAccess" == name)) - { - this.anonymousAccessField = Enums.ParseYesNoType(value); - this.anonymousAccessFieldSet = true; - } - if (("AnonymousUser" == name)) - { - this.anonymousUserField = value; - this.anonymousUserFieldSet = true; - } - if (("IIsControlledPassword" == name)) - { - this.iIsControlledPasswordField = Enums.ParseYesNoType(value); - this.iIsControlledPasswordFieldSet = true; - } - if (("WindowsAuthentication" == name)) - { - this.windowsAuthenticationField = Enums.ParseYesNoType(value); - this.windowsAuthenticationFieldSet = true; - } - if (("DigestAuthentication" == name)) - { - this.digestAuthenticationField = Enums.ParseYesNoType(value); - this.digestAuthenticationFieldSet = true; - } - if (("BasicAuthentication" == name)) - { - this.basicAuthenticationField = Enums.ParseYesNoType(value); - this.basicAuthenticationFieldSet = true; - } - if (("PassportAuthentication" == name)) - { - this.passportAuthenticationField = Enums.ParseYesNoType(value); - this.passportAuthenticationFieldSet = true; - } - if (("LogVisits" == name)) - { - this.logVisitsField = Enums.ParseYesNoType(value); - this.logVisitsFieldSet = true; - } - if (("Index" == name)) - { - this.indexField = Enums.ParseYesNoType(value); - this.indexFieldSet = true; - } - if (("DefaultDocuments" == name)) - { - this.defaultDocumentsField = value; - this.defaultDocumentsFieldSet = true; - } - if (("AspDetailedError" == name)) - { - this.aspDetailedErrorField = Enums.ParseYesNoType(value); - this.aspDetailedErrorFieldSet = true; - } - if (("HttpExpires" == name)) - { - this.httpExpiresField = value; - this.httpExpiresFieldSet = true; - } - if (("CacheControlMaxAge" == name)) - { - this.cacheControlMaxAgeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.cacheControlMaxAgeFieldSet = true; - } - if (("CacheControlCustom" == name)) - { - this.cacheControlCustomField = value; - this.cacheControlCustomFieldSet = true; - } - if (("ClearCustomError" == name)) - { - this.clearCustomErrorField = Enums.ParseYesNoType(value); - this.clearCustomErrorFieldSet = true; - } - if (("AccessSSL" == name)) - { - this.accessSSLField = Enums.ParseYesNoType(value); - this.accessSSLFieldSet = true; - } - if (("AccessSSL128" == name)) - { - this.accessSSL128Field = Enums.ParseYesNoType(value); - this.accessSSL128FieldSet = true; - } - if (("AccessSSLMapCert" == name)) - { - this.accessSSLMapCertField = Enums.ParseYesNoType(value); - this.accessSSLMapCertFieldSet = true; - } - if (("AccessSSLNegotiateCert" == name)) - { - this.accessSSLNegotiateCertField = Enums.ParseYesNoType(value); - this.accessSSLNegotiateCertFieldSet = true; - } - if (("AccessSSLRequireCert" == name)) - { - this.accessSSLRequireCertField = Enums.ParseYesNoType(value); - this.accessSSLRequireCertFieldSet = true; - } - if (("AuthenticationProviders" == name)) - { - this.authenticationProvidersField = value; - this.authenticationProvidersFieldSet = true; - } - } - } - - /// - /// Custom Web Errors used by WebSites and Virtual Directories. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebError : ISchemaElement, ISetAttributes - { - - private int errorCodeField; - - private bool errorCodeFieldSet; - - private int subCodeField; - - private bool subCodeFieldSet; - - private string fileField; - - private bool fileFieldSet; - - private string uRLField; - - private bool uRLFieldSet; - - private ISchemaElement parentElement; - - /// - /// HTTP 1.1 error code. - /// - public int ErrorCode - { - get - { - return this.errorCodeField; - } - set - { - this.errorCodeFieldSet = true; - this.errorCodeField = value; - } - } - - /// - /// Error sub code. Set to 0 to get the wild card "*". - /// - public int SubCode - { - get - { - return this.subCodeField; - } - set - { - this.subCodeFieldSet = true; - this.subCodeField = value; - } - } - - /// - /// File to be sent to the client for this error code and sub code. This can be formatted. For example: [#FileId]. - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// URL to be sent to the client for this error code and sub code. This can be formatted. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public string URL - { - get - { - return this.uRLField; - } - set - { - this.uRLFieldSet = true; - this.uRLField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebError", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.errorCodeFieldSet) - { - writer.WriteAttributeString("ErrorCode", this.errorCodeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.subCodeFieldSet) - { - writer.WriteAttributeString("SubCode", this.subCodeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.uRLFieldSet) - { - writer.WriteAttributeString("URL", this.uRLField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("ErrorCode" == name)) - { - this.errorCodeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.errorCodeFieldSet = true; - } - if (("SubCode" == name)) - { - this.subCodeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.subCodeFieldSet = true; - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("URL" == name)) - { - this.uRLField = value; - this.uRLFieldSet = true; - } - } - } - - /// - /// Custom HTTP Header definition for IIS resources such as WebSite and WebVirtualDir. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class HttpHeader : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary key for custom HTTP Header entry. This will default to the Name attribute. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the custom HTTP Header. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Value for the custom HTTP Header. This attribute can contain a formatted string that is processed at install time to insert the values of properties using [PropertyName] syntax. Also supported are environment variables, file installation paths, and component installation directories; see - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("HttpHeader", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// MimeMap definition for IIS resources. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class MimeMap : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string typeField; - - private bool typeFieldSet; - - private string extensionField; - - private bool extensionFieldSet; - - private ISchemaElement parentElement; - - /// - /// Id for the MimeMap. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Mime-type covered by the MimeMap. - /// - public string Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Extension covered by the MimeMap. Must begin with a dot. - /// - public string Extension - { - get - { - return this.extensionField; - } - set - { - this.extensionFieldSet = true; - this.extensionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MimeMap", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.typeFieldSet) - { - writer.WriteAttributeString("Type", this.typeField); - } - if (this.extensionFieldSet) - { - writer.WriteAttributeString("Extension", this.extensionField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = value; - this.typeFieldSet = true; - } - if (("Extension" == name)) - { - this.extensionField = value; - this.extensionFieldSet = true; - } - } - } - - /// - /// IIs Filter for a Component - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebFilter : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private string webSiteField; - - private bool webSiteFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private int flagsField; - - private bool flagsFieldSet; - - private string loadOrderField; - - private bool loadOrderFieldSet; - - private ISchemaElement parentElement; - - /// - /// The unique Id for the web filter. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The name of the filter to be used in IIS. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The path of the filter executable file. - /// This should usually be a value like '[!FileId]', where 'FileId' is the file identifier - /// of the filter executable file. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - /// - /// Specifies the parent website for this filter (if there is one). - /// If this is a global filter, then this attribute should not be specified. - /// - public string WebSite - { - get - { - return this.webSiteField; - } - set - { - this.webSiteFieldSet = true; - this.webSiteField = value; - } - } - - /// - /// Description of the filter. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Sets the MD_FILTER_FLAGS metabase key for the filter. This must be an integer. See MSDN 'FilterFlags' documentation for more details. - /// - public int Flags - { - get - { - return this.flagsField; - } - set - { - this.flagsFieldSet = true; - this.flagsField = value; - } - } - - /// - /// The legal values are "first", "last", or a number. - /// If a number is specified, it must be greater than 0. - /// - public string LoadOrder - { - get - { - return this.loadOrderField; - } - set - { - this.loadOrderFieldSet = true; - this.loadOrderField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebFilter", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - if (this.webSiteFieldSet) - { - writer.WriteAttributeString("WebSite", this.webSiteField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.flagsFieldSet) - { - writer.WriteAttributeString("Flags", this.flagsField.ToString(CultureInfo.InvariantCulture)); - } - if (this.loadOrderFieldSet) - { - writer.WriteAttributeString("LoadOrder", this.loadOrderField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - if (("WebSite" == name)) - { - this.webSiteField = value; - this.webSiteFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Flags" == name)) - { - this.flagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.flagsFieldSet = true; - } - if (("LoadOrder" == name)) - { - this.loadOrderField = value; - this.loadOrderFieldSet = true; - } - } - } - - /// - /// Extension for WebApplication - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebApplicationExtension : ISchemaElement, ISetAttributes - { - - private string executableField; - - private bool executableFieldSet; - - private string extensionField; - - private bool extensionFieldSet; - - private string verbsField; - - private bool verbsFieldSet; - - private YesNoType scriptField; - - private bool scriptFieldSet; - - private YesNoType checkPathField; - - private bool checkPathFieldSet; - - private ISchemaElement parentElement; - - /// - /// usually a Property that resolves to short file name path - /// - public string Executable - { - get - { - return this.executableField; - } - set - { - this.executableFieldSet = true; - this.executableField = value; - } - } - - /// - /// Extension being registered. Do not prefix with a '.' (e.g. you should use "html", not ".html"). To register for all extensions, use Extension="*". To register a wildcard application map (which handles all requests, even those for directories or files with no extension) omit the Extension attribute completely. - /// - public string Extension - { - get - { - return this.extensionField; - } - set - { - this.extensionFieldSet = true; - this.extensionField = value; - } - } - - public string Verbs - { - get - { - return this.verbsField; - } - set - { - this.verbsFieldSet = true; - this.verbsField = value; - } - } - - public YesNoType Script - { - get - { - return this.scriptField; - } - set - { - this.scriptFieldSet = true; - this.scriptField = value; - } - } - - public YesNoType CheckPath - { - get - { - return this.checkPathField; - } - set - { - this.checkPathFieldSet = true; - this.checkPathField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebApplicationExtension", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.executableFieldSet) - { - writer.WriteAttributeString("Executable", this.executableField); - } - if (this.extensionFieldSet) - { - writer.WriteAttributeString("Extension", this.extensionField); - } - if (this.verbsFieldSet) - { - writer.WriteAttributeString("Verbs", this.verbsField); - } - if (this.scriptFieldSet) - { - if ((this.scriptField == YesNoType.no)) - { - writer.WriteAttributeString("Script", "no"); - } - if ((this.scriptField == YesNoType.yes)) - { - writer.WriteAttributeString("Script", "yes"); - } - } - if (this.checkPathFieldSet) - { - if ((this.checkPathField == YesNoType.no)) - { - writer.WriteAttributeString("CheckPath", "no"); - } - if ((this.checkPathField == YesNoType.yes)) - { - writer.WriteAttributeString("CheckPath", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Executable" == name)) - { - this.executableField = value; - this.executableFieldSet = true; - } - if (("Extension" == name)) - { - this.extensionField = value; - this.extensionFieldSet = true; - } - if (("Verbs" == name)) - { - this.verbsField = value; - this.verbsFieldSet = true; - } - if (("Script" == name)) - { - this.scriptField = Enums.ParseYesNoType(value); - this.scriptFieldSet = true; - } - if (("CheckPath" == name)) - { - this.checkPathField = Enums.ParseYesNoType(value); - this.checkPathFieldSet = true; - } - } - } - - /// - /// IIS6 Application Pool - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebAppPool : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string userField; - - private bool userFieldSet; - - private int recycleMinutesField; - - private bool recycleMinutesFieldSet; - - private int recycleRequestsField; - - private bool recycleRequestsFieldSet; - - private int virtualMemoryField; - - private bool virtualMemoryFieldSet; - - private int privateMemoryField; - - private bool privateMemoryFieldSet; - - private int idleTimeoutField; - - private bool idleTimeoutFieldSet; - - private int queueLimitField; - - private bool queueLimitFieldSet; - - private long maxCpuUsageField; - - private bool maxCpuUsageFieldSet; - - private int refreshCpuField; - - private bool refreshCpuFieldSet; - - private CpuActionType cpuActionField; - - private bool cpuActionFieldSet; - - private int maxWorkerProcessesField; - - private bool maxWorkerProcessesFieldSet; - - private IdentityType identityField; - - private bool identityFieldSet; - - private string managedPipelineModeField; - - private bool managedPipelineModeFieldSet; - - private string managedRuntimeVersionField; - - private bool managedRuntimeVersionFieldSet; - - private ISchemaElement parentElement; - - public WebAppPool() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RecycleTime))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Id of the AppPool. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the AppPool to be shown in IIs. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// User account to run the AppPool as. To use this, you must set the Identity attribute to 'other'. - /// - public string User - { - get - { - return this.userField; - } - set - { - this.userFieldSet = true; - this.userField = value; - } - } - - /// - /// How often, in minutes, you want the AppPool to be recycled. - /// - public int RecycleMinutes - { - get - { - return this.recycleMinutesField; - } - set - { - this.recycleMinutesFieldSet = true; - this.recycleMinutesField = value; - } - } - - /// - /// How often, in requests, you want the AppPool to be recycled. - /// - public int RecycleRequests - { - get - { - return this.recycleRequestsField; - } - set - { - this.recycleRequestsFieldSet = true; - this.recycleRequestsField = value; - } - } - - /// - /// Specifies the amount of virtual memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this attribute is 4,294,967 KB. - /// - public int VirtualMemory - { - get - { - return this.virtualMemoryField; - } - set - { - this.virtualMemoryFieldSet = true; - this.virtualMemoryField = value; - } - } - - /// - /// Specifies the amount of private memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this attribute is 4,294,967 KB. - /// - public int PrivateMemory - { - get - { - return this.privateMemoryField; - } - set - { - this.privateMemoryFieldSet = true; - this.privateMemoryField = value; - } - } - - /// - /// Shutdown worker process after being idle for (time in minutes). - /// - public int IdleTimeout - { - get - { - return this.idleTimeoutField; - } - set - { - this.idleTimeoutFieldSet = true; - this.idleTimeoutField = value; - } - } - - /// - /// Limit the kernel request queue (number of requests). - /// - public int QueueLimit - { - get - { - return this.queueLimitField; - } - set - { - this.queueLimitFieldSet = true; - this.queueLimitField = value; - } - } - - /// - /// Maximum CPU usage (percent). - /// - public long MaxCpuUsage - { - get - { - return this.maxCpuUsageField; - } - set - { - this.maxCpuUsageFieldSet = true; - this.maxCpuUsageField = value; - } - } - - /// - /// Refresh CPU usage numbers (in minutes). - /// - public int RefreshCpu - { - get - { - return this.refreshCpuField; - } - set - { - this.refreshCpuFieldSet = true; - this.refreshCpuField = value; - } - } - - /// - /// Action taken when CPU exceeds maximum CPU use (as defined with MaxCpuUsage and RefreshCpu). - /// - public CpuActionType CpuAction - { - get - { - return this.cpuActionField; - } - set - { - this.cpuActionFieldSet = true; - this.cpuActionField = value; - } - } - - /// - /// Maximum number of worker processes. - /// - public int MaxWorkerProcesses - { - get - { - return this.maxWorkerProcessesField; - } - set - { - this.maxWorkerProcessesFieldSet = true; - this.maxWorkerProcessesField = value; - } - } - - /// - /// Identity you want the AppPool to run under (applicationPoolIdentity is only available on IIS7). Use the 'other' value in conjunction with the User attribute to specify non-standard user. - /// - public IdentityType Identity - { - get - { - return this.identityField; - } - set - { - this.identityFieldSet = true; - this.identityField = value; - } - } - - /// - /// Specifies the request-processing mode that is used to process requests for managed content. Only available on IIS7, ignored on IIS6. - /// See - /// - public string ManagedPipelineMode - { - get - { - return this.managedPipelineModeField; - } - set - { - this.managedPipelineModeFieldSet = true; - this.managedPipelineModeField = value; - } - } - - /// - /// Specifies the .NET Framework version to be used by the application pool. Only available on IIS7, ignored on IIS6. - /// See - /// - public string ManagedRuntimeVersion - { - get - { - return this.managedRuntimeVersionField; - } - set - { - this.managedRuntimeVersionFieldSet = true; - this.managedRuntimeVersionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("RecycleTime" == childName)) - { - childValue = new RecycleTime(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a CpuActionType from a string. - /// - public static CpuActionType ParseCpuActionType(string value) - { - CpuActionType parsedValue; - WebAppPool.TryParseCpuActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a CpuActionType from a string. - /// - public static bool TryParseCpuActionType(string value, out CpuActionType parsedValue) - { - parsedValue = CpuActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("none" == value)) - { - parsedValue = CpuActionType.none; - } - else - { - if (("shutdown" == value)) - { - parsedValue = CpuActionType.shutdown; - } - else - { - parsedValue = CpuActionType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a IdentityType from a string. - /// - public static IdentityType ParseIdentityType(string value) - { - IdentityType parsedValue; - WebAppPool.TryParseIdentityType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a IdentityType from a string. - /// - public static bool TryParseIdentityType(string value, out IdentityType parsedValue) - { - parsedValue = IdentityType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("networkService" == value)) - { - parsedValue = IdentityType.networkService; - } - else - { - if (("localService" == value)) - { - parsedValue = IdentityType.localService; - } - else - { - if (("localSystem" == value)) - { - parsedValue = IdentityType.localSystem; - } - else - { - if (("other" == value)) - { - parsedValue = IdentityType.other; - } - else - { - if (("applicationPoolIdentity" == value)) - { - parsedValue = IdentityType.applicationPoolIdentity; - } - else - { - parsedValue = IdentityType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebAppPool", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.userFieldSet) - { - writer.WriteAttributeString("User", this.userField); - } - if (this.recycleMinutesFieldSet) - { - writer.WriteAttributeString("RecycleMinutes", this.recycleMinutesField.ToString(CultureInfo.InvariantCulture)); - } - if (this.recycleRequestsFieldSet) - { - writer.WriteAttributeString("RecycleRequests", this.recycleRequestsField.ToString(CultureInfo.InvariantCulture)); - } - if (this.virtualMemoryFieldSet) - { - writer.WriteAttributeString("VirtualMemory", this.virtualMemoryField.ToString(CultureInfo.InvariantCulture)); - } - if (this.privateMemoryFieldSet) - { - writer.WriteAttributeString("PrivateMemory", this.privateMemoryField.ToString(CultureInfo.InvariantCulture)); - } - if (this.idleTimeoutFieldSet) - { - writer.WriteAttributeString("IdleTimeout", this.idleTimeoutField.ToString(CultureInfo.InvariantCulture)); - } - if (this.queueLimitFieldSet) - { - writer.WriteAttributeString("QueueLimit", this.queueLimitField.ToString(CultureInfo.InvariantCulture)); - } - if (this.maxCpuUsageFieldSet) - { - writer.WriteAttributeString("MaxCpuUsage", this.maxCpuUsageField.ToString(CultureInfo.InvariantCulture)); - } - if (this.refreshCpuFieldSet) - { - writer.WriteAttributeString("RefreshCpu", this.refreshCpuField.ToString(CultureInfo.InvariantCulture)); - } - if (this.cpuActionFieldSet) - { - if ((this.cpuActionField == CpuActionType.none)) - { - writer.WriteAttributeString("CpuAction", "none"); - } - if ((this.cpuActionField == CpuActionType.shutdown)) - { - writer.WriteAttributeString("CpuAction", "shutdown"); - } - } - if (this.maxWorkerProcessesFieldSet) - { - writer.WriteAttributeString("MaxWorkerProcesses", this.maxWorkerProcessesField.ToString(CultureInfo.InvariantCulture)); - } - if (this.identityFieldSet) - { - if ((this.identityField == IdentityType.networkService)) - { - writer.WriteAttributeString("Identity", "networkService"); - } - if ((this.identityField == IdentityType.localService)) - { - writer.WriteAttributeString("Identity", "localService"); - } - if ((this.identityField == IdentityType.localSystem)) - { - writer.WriteAttributeString("Identity", "localSystem"); - } - if ((this.identityField == IdentityType.other)) - { - writer.WriteAttributeString("Identity", "other"); - } - if ((this.identityField == IdentityType.applicationPoolIdentity)) - { - writer.WriteAttributeString("Identity", "applicationPoolIdentity"); - } - } - if (this.managedPipelineModeFieldSet) - { - writer.WriteAttributeString("ManagedPipelineMode", this.managedPipelineModeField); - } - if (this.managedRuntimeVersionFieldSet) - { - writer.WriteAttributeString("ManagedRuntimeVersion", this.managedRuntimeVersionField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("User" == name)) - { - this.userField = value; - this.userFieldSet = true; - } - if (("RecycleMinutes" == name)) - { - this.recycleMinutesField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.recycleMinutesFieldSet = true; - } - if (("RecycleRequests" == name)) - { - this.recycleRequestsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.recycleRequestsFieldSet = true; - } - if (("VirtualMemory" == name)) - { - this.virtualMemoryField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.virtualMemoryFieldSet = true; - } - if (("PrivateMemory" == name)) - { - this.privateMemoryField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.privateMemoryFieldSet = true; - } - if (("IdleTimeout" == name)) - { - this.idleTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.idleTimeoutFieldSet = true; - } - if (("QueueLimit" == name)) - { - this.queueLimitField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.queueLimitFieldSet = true; - } - if (("MaxCpuUsage" == name)) - { - this.maxCpuUsageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.maxCpuUsageFieldSet = true; - } - if (("RefreshCpu" == name)) - { - this.refreshCpuField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.refreshCpuFieldSet = true; - } - if (("CpuAction" == name)) - { - this.cpuActionField = WebAppPool.ParseCpuActionType(value); - this.cpuActionFieldSet = true; - } - if (("MaxWorkerProcesses" == name)) - { - this.maxWorkerProcessesField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.maxWorkerProcessesFieldSet = true; - } - if (("Identity" == name)) - { - this.identityField = WebAppPool.ParseIdentityType(value); - this.identityFieldSet = true; - } - if (("ManagedPipelineMode" == name)) - { - this.managedPipelineModeField = value; - this.managedPipelineModeFieldSet = true; - } - if (("ManagedRuntimeVersion" == name)) - { - this.managedRuntimeVersionField = value; - this.managedRuntimeVersionFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum CpuActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - none, - - shutdown, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum IdentityType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - networkService, - - localService, - - localSystem, - - other, - - applicationPoolIdentity, - } - } - - /// - /// IIS6 Application Pool Recycle Times on 24 hour clock. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class RecycleTime : ISchemaElement, ISetAttributes - { - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RecycleTime", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Used to install and uninstall certificates. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class Certificate : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private StoreNameType storeNameField; - - private bool storeNameFieldSet; - - private StoreLocationType storeLocationField; - - private bool storeLocationFieldSet; - - private YesNoType overwriteField; - - private bool overwriteFieldSet; - - private YesNoType requestField; - - private bool requestFieldSet; - - private string binaryKeyField; - - private bool binaryKeyFieldSet; - - private string certificatePathField; - - private bool certificatePathFieldSet; - - private string pFXPasswordField; - - private bool pFXPasswordFieldSet; - - private ISchemaElement parentElement; - - /// - /// Unique identifier for this certificate in the installation package. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the certificate that will be installed or uninstalled in the specified store. - /// This attribute may be set via a formatted Property (e.g. [MyProperty]). - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public StoreNameType StoreName - { - get - { - return this.storeNameField; - } - set - { - this.storeNameFieldSet = true; - this.storeNameField = value; - } - } - - public StoreLocationType StoreLocation - { - get - { - return this.storeLocationField; - } - set - { - this.storeLocationFieldSet = true; - this.storeLocationField = value; - } - } - - public YesNoType Overwrite - { - get - { - return this.overwriteField; - } - set - { - this.overwriteFieldSet = true; - this.overwriteField = value; - } - } - - /// - /// This attribute controls whether the CertificatePath attribute is a path to a certificate file (Request='no') or the - /// certificate authority to request the certificate from (Request='yes'). - /// - public YesNoType Request - { - get - { - return this.requestField; - } - set - { - this.requestFieldSet = true; - this.requestField = value; - } - } - - /// - /// Reference to a Binary element that will store the certificate as a stream inside the package. This attribute cannot be specified with - /// the CertificatePath attribute. - /// - public string BinaryKey - { - get - { - return this.binaryKeyField; - } - set - { - this.binaryKeyFieldSet = true; - this.binaryKeyField = value; - } - } - - /// - /// If the Request attribute is "no" then this attribute is the path to the certificate file outside of the package. - /// If the Request attribute is "yes" then this atribute is the certificate authority to request the certificate from. - /// This attribute may be set via a formatted Property (e.g. [MyProperty]). - /// - public string CertificatePath - { - get - { - return this.certificatePathField; - } - set - { - this.certificatePathFieldSet = true; - this.certificatePathField = value; - } - } - - /// - /// If the Binary stream or path to the file outside of the package is a password protected PFX file, the password for that - /// PFX must be specified here. This attribute may be set via a formatted Property (e.g. [MyProperty]). - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public string PFXPassword - { - get - { - return this.pFXPasswordField; - } - set - { - this.pFXPasswordFieldSet = true; - this.pFXPasswordField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a StoreNameType from a string. - /// - public static StoreNameType ParseStoreNameType(string value) - { - StoreNameType parsedValue; - Certificate.TryParseStoreNameType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a StoreNameType from a string. - /// - public static bool TryParseStoreNameType(string value, out StoreNameType parsedValue) - { - parsedValue = StoreNameType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("ca" == value)) - { - parsedValue = StoreNameType.ca; - } - else - { - if (("my" == value)) - { - parsedValue = StoreNameType.my; - } - else - { - if (("personal" == value)) - { - parsedValue = StoreNameType.personal; - } - else - { - if (("request" == value)) - { - parsedValue = StoreNameType.request; - } - else - { - if (("root" == value)) - { - parsedValue = StoreNameType.root; - } - else - { - if (("otherPeople" == value)) - { - parsedValue = StoreNameType.otherPeople; - } - else - { - if (("trustedPeople" == value)) - { - parsedValue = StoreNameType.trustedPeople; - } - else - { - if (("trustedPublisher" == value)) - { - parsedValue = StoreNameType.trustedPublisher; - } - else - { - parsedValue = StoreNameType.IllegalValue; - return false; - } - } - } - } - } - } - } - } - return true; - } - - /// - /// Parses a StoreLocationType from a string. - /// - public static StoreLocationType ParseStoreLocationType(string value) - { - StoreLocationType parsedValue; - Certificate.TryParseStoreLocationType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a StoreLocationType from a string. - /// - public static bool TryParseStoreLocationType(string value, out StoreLocationType parsedValue) - { - parsedValue = StoreLocationType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("currentUser" == value)) - { - parsedValue = StoreLocationType.currentUser; - } - else - { - if (("localMachine" == value)) - { - parsedValue = StoreLocationType.localMachine; - } - else - { - parsedValue = StoreLocationType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Certificate", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.storeNameFieldSet) - { - if ((this.storeNameField == StoreNameType.ca)) - { - writer.WriteAttributeString("StoreName", "ca"); - } - if ((this.storeNameField == StoreNameType.my)) - { - writer.WriteAttributeString("StoreName", "my"); - } - if ((this.storeNameField == StoreNameType.personal)) - { - writer.WriteAttributeString("StoreName", "personal"); - } - if ((this.storeNameField == StoreNameType.request)) - { - writer.WriteAttributeString("StoreName", "request"); - } - if ((this.storeNameField == StoreNameType.root)) - { - writer.WriteAttributeString("StoreName", "root"); - } - if ((this.storeNameField == StoreNameType.otherPeople)) - { - writer.WriteAttributeString("StoreName", "otherPeople"); - } - if ((this.storeNameField == StoreNameType.trustedPeople)) - { - writer.WriteAttributeString("StoreName", "trustedPeople"); - } - if ((this.storeNameField == StoreNameType.trustedPublisher)) - { - writer.WriteAttributeString("StoreName", "trustedPublisher"); - } - } - if (this.storeLocationFieldSet) - { - if ((this.storeLocationField == StoreLocationType.currentUser)) - { - writer.WriteAttributeString("StoreLocation", "currentUser"); - } - if ((this.storeLocationField == StoreLocationType.localMachine)) - { - writer.WriteAttributeString("StoreLocation", "localMachine"); - } - } - if (this.overwriteFieldSet) - { - if ((this.overwriteField == YesNoType.no)) - { - writer.WriteAttributeString("Overwrite", "no"); - } - if ((this.overwriteField == YesNoType.yes)) - { - writer.WriteAttributeString("Overwrite", "yes"); - } - } - if (this.requestFieldSet) - { - if ((this.requestField == YesNoType.no)) - { - writer.WriteAttributeString("Request", "no"); - } - if ((this.requestField == YesNoType.yes)) - { - writer.WriteAttributeString("Request", "yes"); - } - } - if (this.binaryKeyFieldSet) - { - writer.WriteAttributeString("BinaryKey", this.binaryKeyField); - } - if (this.certificatePathFieldSet) - { - writer.WriteAttributeString("CertificatePath", this.certificatePathField); - } - if (this.pFXPasswordFieldSet) - { - writer.WriteAttributeString("PFXPassword", this.pFXPasswordField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("StoreName" == name)) - { - this.storeNameField = Certificate.ParseStoreNameType(value); - this.storeNameFieldSet = true; - } - if (("StoreLocation" == name)) - { - this.storeLocationField = Certificate.ParseStoreLocationType(value); - this.storeLocationFieldSet = true; - } - if (("Overwrite" == name)) - { - this.overwriteField = Enums.ParseYesNoType(value); - this.overwriteFieldSet = true; - } - if (("Request" == name)) - { - this.requestField = Enums.ParseYesNoType(value); - this.requestFieldSet = true; - } - if (("BinaryKey" == name)) - { - this.binaryKeyField = value; - this.binaryKeyFieldSet = true; - } - if (("CertificatePath" == name)) - { - this.certificatePathField = value; - this.certificatePathFieldSet = true; - } - if (("PFXPassword" == name)) - { - this.pFXPasswordField = value; - this.pFXPasswordFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum StoreNameType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Contains the certificates of certificate authorities that the user trusts to issue certificates to others. Certificates in these stores are normally supplied with the operating system or by the user's network administrator. - /// - ca, - - /// - /// Use the "personal" value instead. - /// - my, - - /// - /// Contains personal certificates. These certificates will usually have an associated private key. This store is often - /// referred to as the "MY" certificate store. - /// - personal, - - request, - - /// - /// Contains the certificates of certificate authorities that the user trusts to issue certificates to others. Certificates in these stores are normally supplied with the operating system or by the user's network administrator. Certificates in this store are typically self-signed. - /// - root, - - /// - /// Contains the certificates of those that the user normally sends enveloped messages to or receives signed messages from. - /// See - /// - otherPeople, - - /// - /// Contains the certificates of those directly trusted people and resources. - /// See - /// - trustedPeople, - - /// - /// Contains the certificates of those publishers who are trusted. - /// See - /// - trustedPublisher, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum StoreLocationType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - currentUser, - - localMachine, - } - } - - /// - /// Associates a certificate with the parent WebSite. The Certificate element should be - /// in the same Component as the parent WebSite. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class CertificateRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the referenced Certificate. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CertificateRef", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// IIS Properties - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebProperty : ISchemaElement, ISetAttributes - { - - private IdType idField; - - private bool idFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - public IdType Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The value to be used for the WebProperty specified in the Id attribute. See - /// the remarks section for information on acceptable values for each Id. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a IdType from a string. - /// - public static IdType ParseIdType(string value) - { - IdType parsedValue; - WebProperty.TryParseIdType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a IdType from a string. - /// - public static bool TryParseIdType(string value, out IdType parsedValue) - { - parsedValue = IdType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("ETagChangeNumber" == value)) - { - parsedValue = IdType.ETagChangeNumber; - } - else - { - if (("IIs5IsolationMode" == value)) - { - parsedValue = IdType.IIs5IsolationMode; - } - else - { - if (("MaxGlobalBandwidth" == value)) - { - parsedValue = IdType.MaxGlobalBandwidth; - } - else - { - if (("LogInUTF8" == value)) - { - parsedValue = IdType.LogInUTF8; - } - else - { - parsedValue = IdType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebProperty", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - if ((this.idField == IdType.ETagChangeNumber)) - { - writer.WriteAttributeString("Id", "ETagChangeNumber"); - } - if ((this.idField == IdType.IIs5IsolationMode)) - { - writer.WriteAttributeString("Id", "IIs5IsolationMode"); - } - if ((this.idField == IdType.MaxGlobalBandwidth)) - { - writer.WriteAttributeString("Id", "MaxGlobalBandwidth"); - } - if ((this.idField == IdType.LogInUTF8)) - { - writer.WriteAttributeString("Id", "LogInUTF8"); - } - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = WebProperty.ParseIdType(value); - this.idFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum IdType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - ETagChangeNumber, - - IIs5IsolationMode, - - MaxGlobalBandwidth, - - LogInUTF8, - } - } - - /// - /// Defines properties for a web application. These properties can be used for more than one application defined in a web site or vroot, by defining this element in a common location and referring to it by setting the WebApplication attribute of the WebSite and WebVirtualDir elements. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebApplication : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private IsolationType isolationField; - - private bool isolationFieldSet; - - private YesNoDefaultType allowSessionsField; - - private bool allowSessionsFieldSet; - - private int sessionTimeoutField; - - private bool sessionTimeoutFieldSet; - - private YesNoDefaultType bufferField; - - private bool bufferFieldSet; - - private YesNoDefaultType parentPathsField; - - private bool parentPathsFieldSet; - - private DefaultScriptType defaultScriptField; - - private bool defaultScriptFieldSet; - - private int scriptTimeoutField; - - private bool scriptTimeoutFieldSet; - - private YesNoDefaultType serverDebuggingField; - - private bool serverDebuggingFieldSet; - - private YesNoDefaultType clientDebuggingField; - - private bool clientDebuggingFieldSet; - - private string webAppPoolField; - - private bool webAppPoolFieldSet; - - private ISchemaElement parentElement; - - public WebApplication() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(WebApplicationExtension))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Sets the name of this application. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Sets the application isolation level for this application for pre-IIS 6 applications. - /// - public IsolationType Isolation - { - get - { - return this.isolationField; - } - set - { - this.isolationFieldSet = true; - this.isolationField = value; - } - } - - /// - /// Sets the Enable Session State option. When enabled, you can set the session timeout using the SessionTimeout attribute. - /// - public YesNoDefaultType AllowSessions - { - get - { - return this.allowSessionsField; - } - set - { - this.allowSessionsFieldSet = true; - this.allowSessionsField = value; - } - } - - /// - /// Sets the timeout value for sessions in minutes. - /// - public int SessionTimeout - { - get - { - return this.sessionTimeoutField; - } - set - { - this.sessionTimeoutFieldSet = true; - this.sessionTimeoutField = value; - } - } - - /// - /// Sets the option that enables response buffering in the application, which allows ASP script to set response headers anywhere in the script. - /// - public YesNoDefaultType Buffer - { - get - { - return this.bufferField; - } - set - { - this.bufferFieldSet = true; - this.bufferField = value; - } - } - - /// - /// Sets the parent paths option, which allows a client to use relative paths to reach parent directories from this application. - /// - public YesNoDefaultType ParentPaths - { - get - { - return this.parentPathsField; - } - set - { - this.parentPathsFieldSet = true; - this.parentPathsField = value; - } - } - - /// - /// Sets the default script language for the site. - /// - public DefaultScriptType DefaultScript - { - get - { - return this.defaultScriptField; - } - set - { - this.defaultScriptFieldSet = true; - this.defaultScriptField = value; - } - } - - /// - /// Sets the timeout value in seconds for executing ASP scripts. - /// - public int ScriptTimeout - { - get - { - return this.scriptTimeoutField; - } - set - { - this.scriptTimeoutFieldSet = true; - this.scriptTimeoutField = value; - } - } - - /// - /// Enable ASP server-side script debugging. - /// - public YesNoDefaultType ServerDebugging - { - get - { - return this.serverDebuggingField; - } - set - { - this.serverDebuggingFieldSet = true; - this.serverDebuggingField = value; - } - } - - /// - /// Enable ASP client-side script debugging. - /// - public YesNoDefaultType ClientDebugging - { - get - { - return this.clientDebuggingField; - } - set - { - this.clientDebuggingFieldSet = true; - this.clientDebuggingField = value; - } - } - - /// - /// References the Id attribute of a WebAppPool element to use as the application pool for this application in IIS 6 applications. - /// - public string WebAppPool - { - get - { - return this.webAppPoolField; - } - set - { - this.webAppPoolFieldSet = true; - this.webAppPoolField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("WebApplicationExtension" == childName)) - { - childValue = new WebApplicationExtension(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a IsolationType from a string. - /// - public static IsolationType ParseIsolationType(string value) - { - IsolationType parsedValue; - WebApplication.TryParseIsolationType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a IsolationType from a string. - /// - public static bool TryParseIsolationType(string value, out IsolationType parsedValue) - { - parsedValue = IsolationType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("low" == value)) - { - parsedValue = IsolationType.low; - } - else - { - if (("medium" == value)) - { - parsedValue = IsolationType.medium; - } - else - { - if (("high" == value)) - { - parsedValue = IsolationType.high; - } - else - { - parsedValue = IsolationType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a DefaultScriptType from a string. - /// - public static DefaultScriptType ParseDefaultScriptType(string value) - { - DefaultScriptType parsedValue; - WebApplication.TryParseDefaultScriptType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a DefaultScriptType from a string. - /// - public static bool TryParseDefaultScriptType(string value, out DefaultScriptType parsedValue) - { - parsedValue = DefaultScriptType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("VBScript" == value)) - { - parsedValue = DefaultScriptType.VBScript; - } - else - { - if (("JScript" == value)) - { - parsedValue = DefaultScriptType.JScript; - } - else - { - parsedValue = DefaultScriptType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebApplication", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.isolationFieldSet) - { - if ((this.isolationField == IsolationType.low)) - { - writer.WriteAttributeString("Isolation", "low"); - } - if ((this.isolationField == IsolationType.medium)) - { - writer.WriteAttributeString("Isolation", "medium"); - } - if ((this.isolationField == IsolationType.high)) - { - writer.WriteAttributeString("Isolation", "high"); - } - } - if (this.allowSessionsFieldSet) - { - if ((this.allowSessionsField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("AllowSessions", "default"); - } - if ((this.allowSessionsField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("AllowSessions", "no"); - } - if ((this.allowSessionsField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("AllowSessions", "yes"); - } - } - if (this.sessionTimeoutFieldSet) - { - writer.WriteAttributeString("SessionTimeout", this.sessionTimeoutField.ToString(CultureInfo.InvariantCulture)); - } - if (this.bufferFieldSet) - { - if ((this.bufferField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Buffer", "default"); - } - if ((this.bufferField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Buffer", "no"); - } - if ((this.bufferField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Buffer", "yes"); - } - } - if (this.parentPathsFieldSet) - { - if ((this.parentPathsField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("ParentPaths", "default"); - } - if ((this.parentPathsField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("ParentPaths", "no"); - } - if ((this.parentPathsField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("ParentPaths", "yes"); - } - } - if (this.defaultScriptFieldSet) - { - if ((this.defaultScriptField == DefaultScriptType.VBScript)) - { - writer.WriteAttributeString("DefaultScript", "VBScript"); - } - if ((this.defaultScriptField == DefaultScriptType.JScript)) - { - writer.WriteAttributeString("DefaultScript", "JScript"); - } - } - if (this.scriptTimeoutFieldSet) - { - writer.WriteAttributeString("ScriptTimeout", this.scriptTimeoutField.ToString(CultureInfo.InvariantCulture)); - } - if (this.serverDebuggingFieldSet) - { - if ((this.serverDebuggingField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("ServerDebugging", "default"); - } - if ((this.serverDebuggingField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("ServerDebugging", "no"); - } - if ((this.serverDebuggingField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("ServerDebugging", "yes"); - } - } - if (this.clientDebuggingFieldSet) - { - if ((this.clientDebuggingField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("ClientDebugging", "default"); - } - if ((this.clientDebuggingField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("ClientDebugging", "no"); - } - if ((this.clientDebuggingField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("ClientDebugging", "yes"); - } - } - if (this.webAppPoolFieldSet) - { - writer.WriteAttributeString("WebAppPool", this.webAppPoolField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Isolation" == name)) - { - this.isolationField = WebApplication.ParseIsolationType(value); - this.isolationFieldSet = true; - } - if (("AllowSessions" == name)) - { - this.allowSessionsField = Enums.ParseYesNoDefaultType(value); - this.allowSessionsFieldSet = true; - } - if (("SessionTimeout" == name)) - { - this.sessionTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sessionTimeoutFieldSet = true; - } - if (("Buffer" == name)) - { - this.bufferField = Enums.ParseYesNoDefaultType(value); - this.bufferFieldSet = true; - } - if (("ParentPaths" == name)) - { - this.parentPathsField = Enums.ParseYesNoDefaultType(value); - this.parentPathsFieldSet = true; - } - if (("DefaultScript" == name)) - { - this.defaultScriptField = WebApplication.ParseDefaultScriptType(value); - this.defaultScriptFieldSet = true; - } - if (("ScriptTimeout" == name)) - { - this.scriptTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.scriptTimeoutFieldSet = true; - } - if (("ServerDebugging" == name)) - { - this.serverDebuggingField = Enums.ParseYesNoDefaultType(value); - this.serverDebuggingFieldSet = true; - } - if (("ClientDebugging" == name)) - { - this.clientDebuggingField = Enums.ParseYesNoDefaultType(value); - this.clientDebuggingFieldSet = true; - } - if (("WebAppPool" == name)) - { - this.webAppPoolField = value; - this.webAppPoolFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum IsolationType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Means the application executes within the IIS process. - /// - low, - - /// - /// Executes pooled in a separate process. - /// - medium, - - /// - /// Means execution alone in a separate process. - /// - high, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum DefaultScriptType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - VBScript, - - JScript, - } - } - - /// - /// WebAddress for WebSite - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebAddress : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string iPField; - - private bool iPFieldSet; - - private string portField; - - private bool portFieldSet; - - private string headerField; - - private bool headerFieldSet; - - private YesNoType secureField; - - private bool secureFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The IP address to locate an existing WebSite or create a new WebSite. When the WebAddress is part of a WebSite element - /// used to locate an existing web site the following rules are used: - /// - public string IP - { - get - { - return this.iPField; - } - set - { - this.iPFieldSet = true; - this.iPField = value; - } - } - - public string Port - { - get - { - return this.portField; - } - set - { - this.portFieldSet = true; - this.portField = value; - } - } - - public string Header - { - get - { - return this.headerField; - } - set - { - this.headerFieldSet = true; - this.headerField = value; - } - } - - /// - /// Determines if this address represents a secure binding. The default is 'no'. - /// - public YesNoType Secure - { - get - { - return this.secureField; - } - set - { - this.secureFieldSet = true; - this.secureField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebAddress", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.iPFieldSet) - { - writer.WriteAttributeString("IP", this.iPField); - } - if (this.portFieldSet) - { - writer.WriteAttributeString("Port", this.portField); - } - if (this.headerFieldSet) - { - writer.WriteAttributeString("Header", this.headerField); - } - if (this.secureFieldSet) - { - if ((this.secureField == YesNoType.no)) - { - writer.WriteAttributeString("Secure", "no"); - } - if ((this.secureField == YesNoType.yes)) - { - writer.WriteAttributeString("Secure", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("IP" == name)) - { - this.iPField = value; - this.iPFieldSet = true; - } - if (("Port" == name)) - { - this.portField = value; - this.portFieldSet = true; - } - if (("Header" == name)) - { - this.headerField = value; - this.headerFieldSet = true; - } - if (("Secure" == name)) - { - this.secureField = Enums.ParseYesNoType(value); - this.secureFieldSet = true; - } - } - } - - /// - /// Defines an IIS virtual directory. When this element is a child of WebSite element, the virtual directory is defined within that web site. Otherwise this virtual directory must reference a WebSite element via the WebSite attribute - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebVirtualDir : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string webSiteField; - - private bool webSiteFieldSet; - - private string aliasField; - - private bool aliasFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string dirPropertiesField; - - private bool dirPropertiesFieldSet; - - private string webApplicationField; - - private bool webApplicationFieldSet; - - private ISchemaElement parentElement; - - public WebVirtualDir() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebError))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebVirtualDir))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HttpHeader))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MimeMap))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// References the Id attribute for a WebSite in which this virtual directory belongs. Required when this element is not a child of WebSite element. - /// - public string WebSite - { - get - { - return this.webSiteField; - } - set - { - this.webSiteFieldSet = true; - this.webSiteField = value; - } - } - - /// - /// Sets the application name, which is the URL relative path used to access this virtual directory - /// - public string Alias - { - get - { - return this.aliasField; - } - set - { - this.aliasFieldSet = true; - this.aliasField = value; - } - } - - /// - /// References the Id attribute for a Directory element that points to the content for this virtual directory. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this virtual directory. - /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. - /// - public string DirProperties - { - get - { - return this.dirPropertiesField; - } - set - { - this.dirPropertiesFieldSet = true; - this.dirPropertiesField = value; - } - } - - /// - /// References the Id attribute for a WebApplication element that specifies web application settings for this virtual directory. If a WebApplication child is not specified, the virtual directory does not host web applications. - /// - public string WebApplication - { - get - { - return this.webApplicationField; - } - set - { - this.webApplicationFieldSet = true; - this.webApplicationField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("WebApplication" == childName)) - { - childValue = new WebApplication(); - } - if (("WebDirProperties" == childName)) - { - childValue = new WebDirProperties(); - } - if (("WebError" == childName)) - { - childValue = new WebError(); - } - if (("WebVirtualDir" == childName)) - { - childValue = new WebVirtualDir(); - } - if (("HttpHeader" == childName)) - { - childValue = new HttpHeader(); - } - if (("MimeMap" == childName)) - { - childValue = new MimeMap(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebVirtualDir", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.webSiteFieldSet) - { - writer.WriteAttributeString("WebSite", this.webSiteField); - } - if (this.aliasFieldSet) - { - writer.WriteAttributeString("Alias", this.aliasField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.dirPropertiesFieldSet) - { - writer.WriteAttributeString("DirProperties", this.dirPropertiesField); - } - if (this.webApplicationFieldSet) - { - writer.WriteAttributeString("WebApplication", this.webApplicationField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("WebSite" == name)) - { - this.webSiteField = value; - this.webSiteFieldSet = true; - } - if (("Alias" == name)) - { - this.aliasField = value; - this.aliasFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("DirProperties" == name)) - { - this.dirPropertiesField = value; - this.dirPropertiesFieldSet = true; - } - if (("WebApplication" == name)) - { - this.webApplicationField = value; - this.webApplicationFieldSet = true; - } - } - } - - /// - /// Defines a subdirectory within an IIS web site. When this element is a child of WebSite, the web directory is defined within that web site. Otherwise the web directory must reference a WebSite element via the WebSite attribute. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebDir : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string webSiteField; - - private bool webSiteFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private string dirPropertiesField; - - private bool dirPropertiesFieldSet; - - private ISchemaElement parentElement; - - public WebDir() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// References the Id attribute for a WebSite element in which this directory belongs. Required when this element is not a child of a WebSite element. - /// - public string WebSite - { - get - { - return this.webSiteField; - } - set - { - this.webSiteFieldSet = true; - this.webSiteField = value; - } - } - - /// - /// Specifies the name of this web directory. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - /// - /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this web directory. - /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. - /// - public string DirProperties - { - get - { - return this.dirPropertiesField; - } - set - { - this.dirPropertiesFieldSet = true; - this.dirPropertiesField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("WebApplication" == childName)) - { - childValue = new WebApplication(); - } - if (("WebDirProperties" == childName)) - { - childValue = new WebDirProperties(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebDir", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.webSiteFieldSet) - { - writer.WriteAttributeString("WebSite", this.webSiteField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - if (this.dirPropertiesFieldSet) - { - writer.WriteAttributeString("DirProperties", this.dirPropertiesField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("WebSite" == name)) - { - this.webSiteField = value; - this.webSiteFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - if (("DirProperties" == name)) - { - this.dirPropertiesField = value; - this.dirPropertiesFieldSet = true; - } - } - } - - /// - /// IIs Web Site - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebSite : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private YesNoType autoStartField; - - private bool autoStartFieldSet; - - private YesNoType configureIfExistsField; - - private bool configureIfExistsFieldSet; - - private long connectionTimeoutField; - - private bool connectionTimeoutFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string dirPropertiesField; - - private bool dirPropertiesFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private string siteIdField; - - private bool siteIdFieldSet; - - private YesNoType startOnInstallField; - - private bool startOnInstallFieldSet; - - private string webApplicationField; - - private bool webApplicationFieldSet; - - private string webLogField; - - private bool webLogFieldSet; - - private ISchemaElement parentElement; - - public WebSite() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebAddress))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MimeMap))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CertificateRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HttpHeader))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDir))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebError))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebFilter))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebVirtualDir))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the WebSite. Used within the MSI package only. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Specifies whether to automatically start the web site. - /// - public YesNoType AutoStart - { - get - { - return this.autoStartField; - } - set - { - this.autoStartFieldSet = true; - this.autoStartField = value; - } - } - - /// - /// Specifies whether to configure the web site if it already exists. Note: This will not affect uninstall behavior. If the web site exists on uninstall, it will be removed. - /// - public YesNoType ConfigureIfExists - { - get - { - return this.configureIfExistsField; - } - set - { - this.configureIfExistsFieldSet = true; - this.configureIfExistsField = value; - } - } - - /// - /// Sets the timeout value for connections in seconds. - /// - public long ConnectionTimeout - { - get - { - return this.connectionTimeoutField; - } - set - { - this.connectionTimeoutFieldSet = true; - this.connectionTimeoutField = value; - } - } - - /// - /// This is the name of the web site that will show up in the IIS management console. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Root directory of the web site. Resolved to a directory in the Directory table at install time by the server custom actions. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this website root directory. - /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. - /// - public string DirProperties - { - get - { - return this.dirPropertiesField; - } - set - { - this.dirPropertiesFieldSet = true; - this.dirPropertiesField = value; - } - } - - /// - /// Sequence that the web site is to be created in. - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// Optional attribute to directly specify the site id of the WebSite. Use this to ensure all web - /// sites in a web garden get the same site id. If a number is provided, the site id must be unique - /// on all target machines. If "*" is used, the Description attribute will be hashed to create a unique - /// value for the site id. This value must be a positive number or a "*" or a formatted value that resolves - /// to "-1" (for the same behavior as "*") or a positive number or blank. If this attribute is absent then - /// the web site will be located using the WebAddress element associated with the web site. - /// - public string SiteId - { - get - { - return this.siteIdField; - } - set - { - this.siteIdFieldSet = true; - this.siteIdField = value; - } - } - - /// - /// Specifies whether to start the web site on install. - /// - public YesNoType StartOnInstall - { - get - { - return this.startOnInstallField; - } - set - { - this.startOnInstallFieldSet = true; - this.startOnInstallField = value; - } - } - - /// - /// Reference to a WebApplication that is to be installed as part of this web site. - /// - public string WebApplication - { - get - { - return this.webApplicationField; - } - set - { - this.webApplicationFieldSet = true; - this.webApplicationField = value; - } - } - - /// - /// Reference to WebLog definition. - /// - public string WebLog - { - get - { - return this.webLogField; - } - set - { - this.webLogFieldSet = true; - this.webLogField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("WebAddress" == childName)) - { - childValue = new WebAddress(); - } - if (("WebApplication" == childName)) - { - childValue = new WebApplication(); - } - if (("WebDirProperties" == childName)) - { - childValue = new WebDirProperties(); - } - if (("MimeMap" == childName)) - { - childValue = new MimeMap(); - } - if (("CertificateRef" == childName)) - { - childValue = new CertificateRef(); - } - if (("HttpHeader" == childName)) - { - childValue = new HttpHeader(); - } - if (("WebDir" == childName)) - { - childValue = new WebDir(); - } - if (("WebError" == childName)) - { - childValue = new WebError(); - } - if (("WebFilter" == childName)) - { - childValue = new WebFilter(); - } - if (("WebVirtualDir" == childName)) - { - childValue = new WebVirtualDir(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebSite", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.autoStartFieldSet) - { - if ((this.autoStartField == YesNoType.no)) - { - writer.WriteAttributeString("AutoStart", "no"); - } - if ((this.autoStartField == YesNoType.yes)) - { - writer.WriteAttributeString("AutoStart", "yes"); - } - } - if (this.configureIfExistsFieldSet) - { - if ((this.configureIfExistsField == YesNoType.no)) - { - writer.WriteAttributeString("ConfigureIfExists", "no"); - } - if ((this.configureIfExistsField == YesNoType.yes)) - { - writer.WriteAttributeString("ConfigureIfExists", "yes"); - } - } - if (this.connectionTimeoutFieldSet) - { - writer.WriteAttributeString("ConnectionTimeout", this.connectionTimeoutField.ToString(CultureInfo.InvariantCulture)); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.dirPropertiesFieldSet) - { - writer.WriteAttributeString("DirProperties", this.dirPropertiesField); - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.siteIdFieldSet) - { - writer.WriteAttributeString("SiteId", this.siteIdField); - } - if (this.startOnInstallFieldSet) - { - if ((this.startOnInstallField == YesNoType.no)) - { - writer.WriteAttributeString("StartOnInstall", "no"); - } - if ((this.startOnInstallField == YesNoType.yes)) - { - writer.WriteAttributeString("StartOnInstall", "yes"); - } - } - if (this.webApplicationFieldSet) - { - writer.WriteAttributeString("WebApplication", this.webApplicationField); - } - if (this.webLogFieldSet) - { - writer.WriteAttributeString("WebLog", this.webLogField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("AutoStart" == name)) - { - this.autoStartField = Enums.ParseYesNoType(value); - this.autoStartFieldSet = true; - } - if (("ConfigureIfExists" == name)) - { - this.configureIfExistsField = Enums.ParseYesNoType(value); - this.configureIfExistsFieldSet = true; - } - if (("ConnectionTimeout" == name)) - { - this.connectionTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.connectionTimeoutFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("DirProperties" == name)) - { - this.dirPropertiesField = value; - this.dirPropertiesFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("SiteId" == name)) - { - this.siteIdField = value; - this.siteIdFieldSet = true; - } - if (("StartOnInstall" == name)) - { - this.startOnInstallField = Enums.ParseYesNoType(value); - this.startOnInstallFieldSet = true; - } - if (("WebApplication" == name)) - { - this.webApplicationField = value; - this.webApplicationFieldSet = true; - } - if (("WebLog" == name)) - { - this.webLogField = value; - this.webLogFieldSet = true; - } - } - } - - /// - /// WebLog definition. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebLog : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for the WebLog. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - WebLog.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("IIS" == value)) - { - parsedValue = TypeType.IIS; - } - else - { - if (("NCSA" == value)) - { - parsedValue = TypeType.NCSA; - } - else - { - if (("none" == value)) - { - parsedValue = TypeType.none; - } - else - { - if (("ODBC" == value)) - { - parsedValue = TypeType.ODBC; - } - else - { - if (("W3C" == value)) - { - parsedValue = TypeType.W3C; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebLog", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.IIS)) - { - writer.WriteAttributeString("Type", "IIS"); - } - if ((this.typeField == TypeType.NCSA)) - { - writer.WriteAttributeString("Type", "NCSA"); - } - if ((this.typeField == TypeType.none)) - { - writer.WriteAttributeString("Type", "none"); - } - if ((this.typeField == TypeType.ODBC)) - { - writer.WriteAttributeString("Type", "ODBC"); - } - if ((this.typeField == TypeType.W3C)) - { - writer.WriteAttributeString("Type", "W3C"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = WebLog.ParseTypeType(value); - this.typeFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Microsoft IIS Log File Format - /// - IIS, - - /// - /// NCSA Common Log File Format - /// - NCSA, - - /// - /// Disables logging. - /// - none, - - /// - /// ODBC Logging - /// - ODBC, - - /// - /// W3C Extended Log File Format - /// - W3C, - } - } - - /// - /// The WebServiceExtension property is used by the Web server to determine whether a Web service extension is permitted to run. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class WebServiceExtension : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string fileField; - - private bool fileFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string groupField; - - private bool groupFieldSet; - - private YesNoType allowField; - - private bool allowFieldSet; - - private YesNoType uIDeletableField; - - private bool uIDeletableFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Usually a Property that resolves to short file name path - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// Description of the extension. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// String used to identify groups of extensions. - /// - public string Group - { - get - { - return this.groupField; - } - set - { - this.groupFieldSet = true; - this.groupField = value; - } - } - - /// - /// Indicates if the extension is allowed or denied. - /// - public YesNoType Allow - { - get - { - return this.allowField; - } - set - { - this.allowFieldSet = true; - this.allowField = value; - } - } - - /// - /// Indicates if the UI is allowed to delete the extension from the list of not. Default: Not deletable. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType UIDeletable - { - get - { - return this.uIDeletableField; - } - set - { - this.uIDeletableFieldSet = true; - this.uIDeletableField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WebServiceExtension", "http://wixtoolset.org/schemas/v4/wxs/iis"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.groupFieldSet) - { - writer.WriteAttributeString("Group", this.groupField); - } - if (this.allowFieldSet) - { - if ((this.allowField == YesNoType.no)) - { - writer.WriteAttributeString("Allow", "no"); - } - if ((this.allowField == YesNoType.yes)) - { - writer.WriteAttributeString("Allow", "yes"); - } - } - if (this.uIDeletableFieldSet) - { - if ((this.uIDeletableField == YesNoType.no)) - { - writer.WriteAttributeString("UIDeletable", "no"); - } - if ((this.uIDeletableField == YesNoType.yes)) - { - writer.WriteAttributeString("UIDeletable", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Group" == name)) - { - this.groupField = value; - this.groupFieldSet = true; - } - if (("Allow" == name)) - { - this.allowField = Enums.ParseYesNoType(value); - this.allowFieldSet = true; - } - if (("UIDeletable" == name)) - { - this.uIDeletableField = Enums.ParseYesNoType(value); - this.uIDeletableFieldSet = true; - } - } - } -} diff --git a/src/heat/Serialize/util.cs b/src/heat/Serialize/util.cs deleted file mode 100644 index 84f56eb0..00000000 --- a/src/heat/Serialize/util.cs +++ /dev/null @@ -1,11462 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#pragma warning disable 1591 -namespace WixToolset.Harvesters.Serialize.Util -{ - using System; - using System.CodeDom.Compiler; - using System.Collections; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Xml; - using WixToolset.Harvesters.Serialize; - - - /// - /// Values of this type will either be "yes" or "no". - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum YesNoType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - no, - - yes, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public class Enums - { - - /// - /// Parses a YesNoType from a string. - /// - public static YesNoType ParseYesNoType(string value) - { - YesNoType parsedValue; - Enums.TryParseYesNoType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoType from a string. - /// - public static bool TryParseYesNoType(string value, out YesNoType parsedValue) - { - parsedValue = YesNoType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("no" == value)) - { - parsedValue = YesNoType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoType.yes; - } - else - { - parsedValue = YesNoType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a PerformanceCounterLanguageType from a string. - /// - public static PerformanceCounterLanguageType ParsePerformanceCounterLanguageType(string value) - { - PerformanceCounterLanguageType parsedValue; - Enums.TryParsePerformanceCounterLanguageType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a PerformanceCounterLanguageType from a string. - /// - public static bool TryParsePerformanceCounterLanguageType(string value, out PerformanceCounterLanguageType parsedValue) - { - parsedValue = PerformanceCounterLanguageType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("afrikaans" == value)) - { - parsedValue = PerformanceCounterLanguageType.afrikaans; - } - else - { - if (("albanian" == value)) - { - parsedValue = PerformanceCounterLanguageType.albanian; - } - else - { - if (("arabic" == value)) - { - parsedValue = PerformanceCounterLanguageType.arabic; - } - else - { - if (("armenian" == value)) - { - parsedValue = PerformanceCounterLanguageType.armenian; - } - else - { - if (("assamese" == value)) - { - parsedValue = PerformanceCounterLanguageType.assamese; - } - else - { - if (("azeri" == value)) - { - parsedValue = PerformanceCounterLanguageType.azeri; - } - else - { - if (("basque" == value)) - { - parsedValue = PerformanceCounterLanguageType.basque; - } - else - { - if (("belarusian" == value)) - { - parsedValue = PerformanceCounterLanguageType.belarusian; - } - else - { - if (("bengali" == value)) - { - parsedValue = PerformanceCounterLanguageType.bengali; - } - else - { - if (("bulgarian" == value)) - { - parsedValue = PerformanceCounterLanguageType.bulgarian; - } - else - { - if (("catalan" == value)) - { - parsedValue = PerformanceCounterLanguageType.catalan; - } - else - { - if (("chinese" == value)) - { - parsedValue = PerformanceCounterLanguageType.chinese; - } - else - { - if (("croatian" == value)) - { - parsedValue = PerformanceCounterLanguageType.croatian; - } - else - { - if (("czech" == value)) - { - parsedValue = PerformanceCounterLanguageType.czech; - } - else - { - if (("danish" == value)) - { - parsedValue = PerformanceCounterLanguageType.danish; - } - else - { - if (("divehi" == value)) - { - parsedValue = PerformanceCounterLanguageType.divehi; - } - else - { - if (("dutch" == value)) - { - parsedValue = PerformanceCounterLanguageType.dutch; - } - else - { - if (("english" == value)) - { - parsedValue = PerformanceCounterLanguageType.english; - } - else - { - if (("estonian" == value)) - { - parsedValue = PerformanceCounterLanguageType.estonian; - } - else - { - if (("faeroese" == value)) - { - parsedValue = PerformanceCounterLanguageType.faeroese; - } - else - { - if (("farsi" == value)) - { - parsedValue = PerformanceCounterLanguageType.farsi; - } - else - { - if (("finnish" == value)) - { - parsedValue = PerformanceCounterLanguageType.finnish; - } - else - { - if (("french" == value)) - { - parsedValue = PerformanceCounterLanguageType.french; - } - else - { - if (("galician" == value)) - { - parsedValue = PerformanceCounterLanguageType.galician; - } - else - { - if (("georgian" == value)) - { - parsedValue = PerformanceCounterLanguageType.georgian; - } - else - { - if (("german" == value)) - { - parsedValue = PerformanceCounterLanguageType.german; - } - else - { - if (("greek" == value)) - { - parsedValue = PerformanceCounterLanguageType.greek; - } - else - { - if (("gujarati" == value)) - { - parsedValue = PerformanceCounterLanguageType.gujarati; - } - else - { - if (("hebrew" == value)) - { - parsedValue = PerformanceCounterLanguageType.hebrew; - } - else - { - if (("hindi" == value)) - { - parsedValue = PerformanceCounterLanguageType.hindi; - } - else - { - if (("hungarian" == value)) - { - parsedValue = PerformanceCounterLanguageType.hungarian; - } - else - { - if (("icelandic" == value)) - { - parsedValue = PerformanceCounterLanguageType.icelandic; - } - else - { - if (("indonesian" == value)) - { - parsedValue = PerformanceCounterLanguageType.indonesian; - } - else - { - if (("italian" == value)) - { - parsedValue = PerformanceCounterLanguageType.italian; - } - else - { - if (("japanese" == value)) - { - parsedValue = PerformanceCounterLanguageType.japanese; - } - else - { - if (("kannada" == value)) - { - parsedValue = PerformanceCounterLanguageType.kannada; - } - else - { - if (("kashmiri" == value)) - { - parsedValue = PerformanceCounterLanguageType.kashmiri; - } - else - { - if (("kazak" == value)) - { - parsedValue = PerformanceCounterLanguageType.kazak; - } - else - { - if (("konkani" == value)) - { - parsedValue = PerformanceCounterLanguageType.konkani; - } - else - { - if (("korean" == value)) - { - parsedValue = PerformanceCounterLanguageType.korean; - } - else - { - if (("kyrgyz" == value)) - { - parsedValue = PerformanceCounterLanguageType.kyrgyz; - } - else - { - if (("latvian" == value)) - { - parsedValue = PerformanceCounterLanguageType.latvian; - } - else - { - if (("lithuanian" == value)) - { - parsedValue = PerformanceCounterLanguageType.lithuanian; - } - else - { - if (("macedonian" == value)) - { - parsedValue = PerformanceCounterLanguageType.macedonian; - } - else - { - if (("malay" == value)) - { - parsedValue = PerformanceCounterLanguageType.malay; - } - else - { - if (("malayalam" == value)) - { - parsedValue = PerformanceCounterLanguageType.malayalam; - } - else - { - if (("manipuri" == value)) - { - parsedValue = PerformanceCounterLanguageType.manipuri; - } - else - { - if (("marathi" == value)) - { - parsedValue = PerformanceCounterLanguageType.marathi; - } - else - { - if (("mongolian" == value)) - { - parsedValue = PerformanceCounterLanguageType.mongolian; - } - else - { - if (("nepali" == value)) - { - parsedValue = PerformanceCounterLanguageType.nepali; - } - else - { - if (("norwegian" == value)) - { - parsedValue = PerformanceCounterLanguageType.norwegian; - } - else - { - if (("oriya" == value)) - { - parsedValue = PerformanceCounterLanguageType.oriya; - } - else - { - if (("polish" == value)) - { - parsedValue = PerformanceCounterLanguageType.polish; - } - else - { - if (("portuguese" == value)) - { - parsedValue = PerformanceCounterLanguageType.portuguese; - } - else - { - if (("punjabi" == value)) - { - parsedValue = PerformanceCounterLanguageType.punjabi; - } - else - { - if (("romanian" == value)) - { - parsedValue = PerformanceCounterLanguageType.romanian; - } - else - { - if (("russian" == value)) - { - parsedValue = PerformanceCounterLanguageType.russian; - } - else - { - if (("sanskrit" == value)) - { - parsedValue = PerformanceCounterLanguageType.sanskrit; - } - else - { - if (("serbian" == value)) - { - parsedValue = PerformanceCounterLanguageType.serbian; - } - else - { - if (("sindhi" == value)) - { - parsedValue = PerformanceCounterLanguageType.sindhi; - } - else - { - if (("slovak" == value)) - { - parsedValue = PerformanceCounterLanguageType.slovak; - } - else - { - if (("slovenian" == value)) - { - parsedValue = PerformanceCounterLanguageType.slovenian; - } - else - { - if (("spanish" == value)) - { - parsedValue = PerformanceCounterLanguageType.spanish; - } - else - { - if (("swahili" == value)) - { - parsedValue = PerformanceCounterLanguageType.swahili; - } - else - { - if (("swedish" == value)) - { - parsedValue = PerformanceCounterLanguageType.swedish; - } - else - { - if (("syriac" == value)) - { - parsedValue = PerformanceCounterLanguageType.syriac; - } - else - { - if (("tamil" == value)) - { - parsedValue = PerformanceCounterLanguageType.tamil; - } - else - { - if (("tatar" == value)) - { - parsedValue = PerformanceCounterLanguageType.tatar; - } - else - { - if (("telugu" == value)) - { - parsedValue = PerformanceCounterLanguageType.telugu; - } - else - { - if (("thai" == value)) - { - parsedValue = PerformanceCounterLanguageType.thai; - } - else - { - if (("turkish" == value)) - { - parsedValue = PerformanceCounterLanguageType.turkish; - } - else - { - if (("ukrainian" == value)) - { - parsedValue = PerformanceCounterLanguageType.ukrainian; - } - else - { - if (("urdu" == value)) - { - parsedValue = PerformanceCounterLanguageType.urdu; - } - else - { - if (("uzbek" == value)) - { - parsedValue = PerformanceCounterLanguageType.uzbek; - } - else - { - if (("vietnamese" == value)) - { - parsedValue = PerformanceCounterLanguageType.vietnamese; - } - else - { - parsedValue = PerformanceCounterLanguageType.IllegalValue; - return false; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return true; - } - - /// - /// Parses a PerformanceCounterTypesType from a string. - /// - public static PerformanceCounterTypesType ParsePerformanceCounterTypesType(string value) - { - PerformanceCounterTypesType parsedValue; - Enums.TryParsePerformanceCounterTypesType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a PerformanceCounterTypesType from a string. - /// - public static bool TryParsePerformanceCounterTypesType(string value, out PerformanceCounterTypesType parsedValue) - { - parsedValue = PerformanceCounterTypesType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("averageBase" == value)) - { - parsedValue = PerformanceCounterTypesType.averageBase; - } - else - { - if (("averageCount64" == value)) - { - parsedValue = PerformanceCounterTypesType.averageCount64; - } - else - { - if (("averageTimer32" == value)) - { - parsedValue = PerformanceCounterTypesType.averageTimer32; - } - else - { - if (("counterDelta32" == value)) - { - parsedValue = PerformanceCounterTypesType.counterDelta32; - } - else - { - if (("counterTimerInverse" == value)) - { - parsedValue = PerformanceCounterTypesType.counterTimerInverse; - } - else - { - if (("sampleFraction" == value)) - { - parsedValue = PerformanceCounterTypesType.sampleFraction; - } - else - { - if (("timer100Ns" == value)) - { - parsedValue = PerformanceCounterTypesType.timer100Ns; - } - else - { - if (("counterTimer" == value)) - { - parsedValue = PerformanceCounterTypesType.counterTimer; - } - else - { - if (("rawFraction" == value)) - { - parsedValue = PerformanceCounterTypesType.rawFraction; - } - else - { - if (("timer100NsInverse" == value)) - { - parsedValue = PerformanceCounterTypesType.timer100NsInverse; - } - else - { - if (("counterMultiTimer" == value)) - { - parsedValue = PerformanceCounterTypesType.counterMultiTimer; - } - else - { - if (("counterMultiTimer100Ns" == value)) - { - parsedValue = PerformanceCounterTypesType.counterMultiTimer100Ns; - } - else - { - if (("counterMultiTimerInverse" == value)) - { - parsedValue = PerformanceCounterTypesType.counterMultiTimerInverse; - } - else - { - if (("counterMultiTimer100NsInverse" == value)) - { - parsedValue = PerformanceCounterTypesType.counterMultiTimer100NsInverse; - } - else - { - if (("elapsedTime" == value)) - { - parsedValue = PerformanceCounterTypesType.elapsedTime; - } - else - { - if (("sampleBase" == value)) - { - parsedValue = PerformanceCounterTypesType.sampleBase; - } - else - { - if (("rawBase" == value)) - { - parsedValue = PerformanceCounterTypesType.rawBase; - } - else - { - if (("counterMultiBase" == value)) - { - parsedValue = PerformanceCounterTypesType.counterMultiBase; - } - else - { - if (("rateOfCountsPerSecond64" == value)) - { - parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond64; - } - else - { - if (("rateOfCountsPerSecond32" == value)) - { - parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond32; - } - else - { - if (("countPerTimeInterval64" == value)) - { - parsedValue = PerformanceCounterTypesType.countPerTimeInterval64; - } - else - { - if (("countPerTimeInterval32" == value)) - { - parsedValue = PerformanceCounterTypesType.countPerTimeInterval32; - } - else - { - if (("sampleCounter" == value)) - { - parsedValue = PerformanceCounterTypesType.sampleCounter; - } - else - { - if (("counterDelta64" == value)) - { - parsedValue = PerformanceCounterTypesType.counterDelta64; - } - else - { - if (("numberOfItems64" == value)) - { - parsedValue = PerformanceCounterTypesType.numberOfItems64; - } - else - { - if (("numberOfItems32" == value)) - { - parsedValue = PerformanceCounterTypesType.numberOfItems32; - } - else - { - if (("numberOfItemsHEX64" == value)) - { - parsedValue = PerformanceCounterTypesType.numberOfItemsHEX64; - } - else - { - if (("numberOfItemsHEX32" == value)) - { - parsedValue = PerformanceCounterTypesType.numberOfItemsHEX32; - } - else - { - parsedValue = PerformanceCounterTypesType.IllegalValue; - return false; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return true; - } - } - - /// - /// Enumeration of valid languages for performance counters. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum PerformanceCounterLanguageType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - afrikaans, - - albanian, - - arabic, - - armenian, - - assamese, - - azeri, - - basque, - - belarusian, - - bengali, - - bulgarian, - - catalan, - - chinese, - - croatian, - - czech, - - danish, - - divehi, - - dutch, - - english, - - estonian, - - faeroese, - - farsi, - - finnish, - - french, - - galician, - - georgian, - - german, - - greek, - - gujarati, - - hebrew, - - hindi, - - hungarian, - - icelandic, - - indonesian, - - italian, - - japanese, - - kannada, - - kashmiri, - - kazak, - - konkani, - - korean, - - kyrgyz, - - latvian, - - lithuanian, - - macedonian, - - malay, - - malayalam, - - manipuri, - - marathi, - - mongolian, - - nepali, - - norwegian, - - oriya, - - polish, - - portuguese, - - punjabi, - - romanian, - - russian, - - sanskrit, - - serbian, - - sindhi, - - slovak, - - slovenian, - - spanish, - - swahili, - - swedish, - - syriac, - - tamil, - - tatar, - - telugu, - - thai, - - turkish, - - ukrainian, - - urdu, - - uzbek, - - vietnamese, - } - - /// - /// Enumeration of valid types for performance counters. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum PerformanceCounterTypesType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - averageBase, - - averageCount64, - - averageTimer32, - - counterDelta32, - - counterTimerInverse, - - sampleFraction, - - timer100Ns, - - counterTimer, - - rawFraction, - - timer100NsInverse, - - counterMultiTimer, - - counterMultiTimer100Ns, - - counterMultiTimerInverse, - - counterMultiTimer100NsInverse, - - elapsedTime, - - sampleBase, - - rawBase, - - counterMultiBase, - - rateOfCountsPerSecond64, - - rateOfCountsPerSecond32, - - countPerTimeInterval64, - - countPerTimeInterval32, - - sampleCounter, - - counterDelta64, - - numberOfItems64, - - numberOfItems32, - - numberOfItemsHEX64, - - numberOfItemsHEX32, - } - - /// - /// Closes applications or schedules a reboot if application cannot be closed. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class CloseApplication : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string targetField; - - private bool targetFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private YesNoType closeMessageField; - - private bool closeMessageFieldSet; - - private YesNoType endSessionMessageField; - - private bool endSessionMessageFieldSet; - - private YesNoType elevatedCloseMessageField; - - private bool elevatedCloseMessageFieldSet; - - private YesNoType elevatedEndSessionMessageField; - - private bool elevatedEndSessionMessageFieldSet; - - private YesNoType rebootPromptField; - - private bool rebootPromptFieldSet; - - private YesNoType promptToContinueField; - - private bool promptToContinueFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private int terminateProcessField; - - private bool terminateProcessFieldSet; - - private int timeoutField; - - private bool timeoutFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for the close application (primary key). If the Id is not specified, one will be generated. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the exectuable to be closed. This should only be the file name. - /// - public string Target - { - get - { - return this.targetField; - } - set - { - this.targetFieldSet = true; - this.targetField = value; - } - } - - /// - /// Description to show if application is running and needs to be closed. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Optionally orders the applications to be closed. - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// Optionally sends a close message to the application. Default is no. - /// - public YesNoType CloseMessage - { - get - { - return this.closeMessageField; - } - set - { - this.closeMessageFieldSet = true; - this.closeMessageField = value; - } - } - - /// - /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application. Default is "no". - /// - public YesNoType EndSessionMessage - { - get - { - return this.endSessionMessageField; - } - set - { - this.endSessionMessageFieldSet = true; - this.endSessionMessageField = value; - } - } - - /// - /// Optionally sends a close message to the application from deffered action without impersonation. Default is no. - /// - public YesNoType ElevatedCloseMessage - { - get - { - return this.elevatedCloseMessageField; - } - set - { - this.elevatedCloseMessageFieldSet = true; - this.elevatedCloseMessageField = value; - } - } - - /// - /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application from a deffered action without impersonation. Default is "no". - /// - public YesNoType ElevatedEndSessionMessage - { - get - { - return this.elevatedEndSessionMessageField; - } - set - { - this.elevatedEndSessionMessageFieldSet = true; - this.elevatedEndSessionMessageField = value; - } - } - - /// - /// Optionally prompts for reboot if application is still running. The default is "yes". The TerminateProcess attribute must be "no" or not specified if this attribute is "yes". - /// - public YesNoType RebootPrompt - { - get - { - return this.rebootPromptField; - } - set - { - this.rebootPromptFieldSet = true; - this.rebootPromptField = value; - } - } - - /// - /// When this attribute is set to "yes", the user will be prompted when the application is still running. The Description attribute must contain the message to - /// display in the prompt. The prompt occurs before executing any of the other options and gives the options to "Abort", "Retry", or "Ignore". Abort will cancel - /// the install. Retry will attempt the check again and if the application is still running, prompt again. "Ignore" will continue and execute any other options - /// set on the CloseApplication element. The default is "no". - /// - public YesNoType PromptToContinue - { - get - { - return this.promptToContinueField; - } - set - { - this.promptToContinueFieldSet = true; - this.promptToContinueField = value; - } - } - - /// - /// Property to be set if application is still running. Useful for launch conditions or to conditionalize custom UI to ask user to shut down apps. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// Attempts to terminates process and return the specified exit code if application is still running after sending any requested close and/or end session messages. - /// If this attribute is specified, the RebootPrompt attribute must be "no". The default is "no". - /// - public int TerminateProcess - { - get - { - return this.terminateProcessField; - } - set - { - this.terminateProcessFieldSet = true; - this.terminateProcessField = value; - } - } - - /// - /// Optional time in seconds to wait for the application to exit after the close and/or end session messages. If the application is still running after the timeout then - /// the RebootPrompt or TerminateProcess attributes will be considered. The default value is "5" seconds. - /// - public int Timeout - { - get - { - return this.timeoutField; - } - set - { - this.timeoutFieldSet = true; - this.timeoutField = value; - } - } - - /// - /// Condition that determines if the application should be closed. Must be blank or evaluate to true - /// for the application to be scheduled for closing. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CloseApplication", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.targetFieldSet) - { - writer.WriteAttributeString("Target", this.targetField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.closeMessageFieldSet) - { - if ((this.closeMessageField == YesNoType.no)) - { - writer.WriteAttributeString("CloseMessage", "no"); - } - if ((this.closeMessageField == YesNoType.yes)) - { - writer.WriteAttributeString("CloseMessage", "yes"); - } - } - if (this.endSessionMessageFieldSet) - { - if ((this.endSessionMessageField == YesNoType.no)) - { - writer.WriteAttributeString("EndSessionMessage", "no"); - } - if ((this.endSessionMessageField == YesNoType.yes)) - { - writer.WriteAttributeString("EndSessionMessage", "yes"); - } - } - if (this.elevatedCloseMessageFieldSet) - { - if ((this.elevatedCloseMessageField == YesNoType.no)) - { - writer.WriteAttributeString("ElevatedCloseMessage", "no"); - } - if ((this.elevatedCloseMessageField == YesNoType.yes)) - { - writer.WriteAttributeString("ElevatedCloseMessage", "yes"); - } - } - if (this.elevatedEndSessionMessageFieldSet) - { - if ((this.elevatedEndSessionMessageField == YesNoType.no)) - { - writer.WriteAttributeString("ElevatedEndSessionMessage", "no"); - } - if ((this.elevatedEndSessionMessageField == YesNoType.yes)) - { - writer.WriteAttributeString("ElevatedEndSessionMessage", "yes"); - } - } - if (this.rebootPromptFieldSet) - { - if ((this.rebootPromptField == YesNoType.no)) - { - writer.WriteAttributeString("RebootPrompt", "no"); - } - if ((this.rebootPromptField == YesNoType.yes)) - { - writer.WriteAttributeString("RebootPrompt", "yes"); - } - } - if (this.promptToContinueFieldSet) - { - if ((this.promptToContinueField == YesNoType.no)) - { - writer.WriteAttributeString("PromptToContinue", "no"); - } - if ((this.promptToContinueField == YesNoType.yes)) - { - writer.WriteAttributeString("PromptToContinue", "yes"); - } - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.terminateProcessFieldSet) - { - writer.WriteAttributeString("TerminateProcess", this.terminateProcessField.ToString(CultureInfo.InvariantCulture)); - } - if (this.timeoutFieldSet) - { - writer.WriteAttributeString("Timeout", this.timeoutField.ToString(CultureInfo.InvariantCulture)); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Target" == name)) - { - this.targetField = value; - this.targetFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("CloseMessage" == name)) - { - this.closeMessageField = Enums.ParseYesNoType(value); - this.closeMessageFieldSet = true; - } - if (("EndSessionMessage" == name)) - { - this.endSessionMessageField = Enums.ParseYesNoType(value); - this.endSessionMessageFieldSet = true; - } - if (("ElevatedCloseMessage" == name)) - { - this.elevatedCloseMessageField = Enums.ParseYesNoType(value); - this.elevatedCloseMessageFieldSet = true; - } - if (("ElevatedEndSessionMessage" == name)) - { - this.elevatedEndSessionMessageField = Enums.ParseYesNoType(value); - this.elevatedEndSessionMessageFieldSet = true; - } - if (("RebootPrompt" == name)) - { - this.rebootPromptField = Enums.ParseYesNoType(value); - this.rebootPromptFieldSet = true; - } - if (("PromptToContinue" == name)) - { - this.promptToContinueField = Enums.ParseYesNoType(value); - this.promptToContinueFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("TerminateProcess" == name)) - { - this.terminateProcessField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.terminateProcessFieldSet = true; - } - if (("Timeout" == name)) - { - this.timeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.timeoutFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Describes a component search. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class ComponentSearch : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string variableField; - - private bool variableFieldSet; - - private string conditionField; - - private bool conditionFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string guidField; - - private bool guidFieldSet; - - private string productCodeField; - - private bool productCodeFieldSet; - - private ResultType resultField; - - private bool resultFieldSet; - - private ISchemaElement parentElement; - - /// - /// Id of the search for ordering and dependency. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the variable in which to place the result of the search. - /// - public string Variable - { - get - { - return this.variableField; - } - set - { - this.variableFieldSet = true; - this.variableField = value; - } - } - - /// - /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. - /// - public string Condition - { - get - { - return this.conditionField; - } - set - { - this.conditionFieldSet = true; - this.conditionField = value; - } - } - - /// - /// Id of the search that this one should come after. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// Component to search for. - /// - public string Guid - { - get - { - return this.guidField; - } - set - { - this.guidFieldSet = true; - this.guidField = value; - } - } - - /// - /// Optional ProductCode to determine if the component is installed. - /// - public string ProductCode - { - get - { - return this.productCodeField; - } - set - { - this.productCodeFieldSet = true; - this.productCodeField = value; - } - } - - /// - /// Rather than saving the matching key path into the variable, a ComponentSearch can save an attribute of the component instead. - /// - public ResultType Result - { - get - { - return this.resultField; - } - set - { - this.resultFieldSet = true; - this.resultField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ResultType from a string. - /// - public static ResultType ParseResultType(string value) - { - ResultType parsedValue; - ComponentSearch.TryParseResultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ResultType from a string. - /// - public static bool TryParseResultType(string value, out ResultType parsedValue) - { - parsedValue = ResultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("directory" == value)) - { - parsedValue = ResultType.directory; - } - else - { - if (("state" == value)) - { - parsedValue = ResultType.state; - } - else - { - if (("keyPath" == value)) - { - parsedValue = ResultType.keyPath; - } - else - { - parsedValue = ResultType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.variableFieldSet) - { - writer.WriteAttributeString("Variable", this.variableField); - } - if (this.conditionFieldSet) - { - writer.WriteAttributeString("Condition", this.conditionField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.guidFieldSet) - { - writer.WriteAttributeString("Guid", this.guidField); - } - if (this.productCodeFieldSet) - { - writer.WriteAttributeString("ProductCode", this.productCodeField); - } - if (this.resultFieldSet) - { - if ((this.resultField == ResultType.directory)) - { - writer.WriteAttributeString("Result", "directory"); - } - if ((this.resultField == ResultType.state)) - { - writer.WriteAttributeString("Result", "state"); - } - if ((this.resultField == ResultType.keyPath)) - { - writer.WriteAttributeString("Result", "keyPath"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Variable" == name)) - { - this.variableField = value; - this.variableFieldSet = true; - } - if (("Condition" == name)) - { - this.conditionField = value; - this.conditionFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Guid" == name)) - { - this.guidField = value; - this.guidFieldSet = true; - } - if (("ProductCode" == name)) - { - this.productCodeField = value; - this.productCodeFieldSet = true; - } - if (("Result" == name)) - { - this.resultField = ComponentSearch.ParseResultType(value); - this.resultFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ResultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Saves the parent directory for the component's file key path; other types of key path are returned unmodified. - /// - directory, - - /// - /// Saves the state of the component: absent (2), locally installed (3), will run from source (4), or installed in default location (either local or from source) (5) - /// - state, - - /// - /// Saves the key path of the component if installed. This is the default. - /// - keyPath, - } - } - - /// - /// References a ComponentSearch. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class ComponentSearchRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComponentSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Describes a directory search. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class DirectorySearch : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string variableField; - - private bool variableFieldSet; - - private string conditionField; - - private bool conditionFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private ResultType resultField; - - private bool resultFieldSet; - - private ISchemaElement parentElement; - - /// - /// Id of the search for ordering and dependency. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the variable in which to place the result of the search. - /// - public string Variable - { - get - { - return this.variableField; - } - set - { - this.variableFieldSet = true; - this.variableField = value; - } - } - - /// - /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. - /// - public string Condition - { - get - { - return this.conditionField; - } - set - { - this.conditionFieldSet = true; - this.conditionField = value; - } - } - - /// - /// Id of the search that this one should come after. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// Directory path to search for. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - /// - /// Rather than saving the matching directory path into the variable, a DirectorySearch can save an - /// attribute of the matching directory instead. - /// - public ResultType Result - { - get - { - return this.resultField; - } - set - { - this.resultFieldSet = true; - this.resultField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ResultType from a string. - /// - public static ResultType ParseResultType(string value) - { - ResultType parsedValue; - DirectorySearch.TryParseResultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ResultType from a string. - /// - public static bool TryParseResultType(string value, out ResultType parsedValue) - { - parsedValue = ResultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("exists" == value)) - { - parsedValue = ResultType.exists; - } - else - { - parsedValue = ResultType.IllegalValue; - return false; - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.variableFieldSet) - { - writer.WriteAttributeString("Variable", this.variableField); - } - if (this.conditionFieldSet) - { - writer.WriteAttributeString("Condition", this.conditionField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - if (this.resultFieldSet) - { - if ((this.resultField == ResultType.exists)) - { - writer.WriteAttributeString("Result", "exists"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Variable" == name)) - { - this.variableField = value; - this.variableFieldSet = true; - } - if (("Condition" == name)) - { - this.conditionField = value; - this.conditionFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - if (("Result" == name)) - { - this.resultField = DirectorySearch.ParseResultType(value); - this.resultFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ResultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Saves true if a matching directory is found; false otherwise. - /// - exists, - } - } - - /// - /// References a DirectorySearch. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class DirectorySearchRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Creates an event source. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class EventSource : ISchemaElement, ISetAttributes - { - - private int categoryCountField; - - private bool categoryCountFieldSet; - - private string categoryMessageFileField; - - private bool categoryMessageFileFieldSet; - - private string eventMessageFileField; - - private bool eventMessageFileFieldSet; - - private YesNoType keyPathField; - - private bool keyPathFieldSet; - - private string logField; - - private bool logFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string parameterMessageFileField; - - private bool parameterMessageFileFieldSet; - - private YesNoType supportsErrorsField; - - private bool supportsErrorsFieldSet; - - private YesNoType supportsFailureAuditsField; - - private bool supportsFailureAuditsFieldSet; - - private YesNoType supportsInformationalsField; - - private bool supportsInformationalsFieldSet; - - private YesNoType supportsSuccessAuditsField; - - private bool supportsSuccessAuditsFieldSet; - - private YesNoType supportsWarningsField; - - private bool supportsWarningsFieldSet; - - private ISchemaElement parentElement; - - /// - /// The number of categories in CategoryMessageFile. CategoryMessageFile - /// must be specified too. - /// - public int CategoryCount - { - get - { - return this.categoryCountField; - } - set - { - this.categoryCountFieldSet = true; - this.categoryCountField = value; - } - } - - /// - /// Name of the category message file. CategoryCount must be specified too. - /// Note that this is a formatted field, so you can use [#fileId] syntax to - /// refer to a file being installed. It is also written as a REG_EXPAND_SZ - /// string, so you can use %environment_variable% syntax to refer to a file - /// already present on the user's machine. - /// - public string CategoryMessageFile - { - get - { - return this.categoryMessageFileField; - } - set - { - this.categoryMessageFileFieldSet = true; - this.categoryMessageFileField = value; - } - } - - /// - /// Name of the event message file. - /// Note that this is a formatted field, so you can use [#fileId] syntax to - /// refer to a file being installed. It is also written as a REG_EXPAND_SZ - /// string, so you can use %environment_variable% syntax to refer to a file - /// already present on the user's machine. - /// - public string EventMessageFile - { - get - { - return this.eventMessageFileField; - } - set - { - this.eventMessageFileFieldSet = true; - this.eventMessageFileField = value; - } - } - - /// - /// Marks the EventSource registry as the key path of the component it belongs to. - /// - public YesNoType KeyPath - { - get - { - return this.keyPathField; - } - set - { - this.keyPathFieldSet = true; - this.keyPathField = value; - } - } - - /// - /// Name of the event source's log. - /// - public string Log - { - get - { - return this.logField; - } - set - { - this.logFieldSet = true; - this.logField = value; - } - } - - /// - /// Name of the event source. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Name of the parameter message file. - /// Note that this is a formatted field, so you can use [#fileId] syntax to - /// refer to a file being installed. It is also written as a REG_EXPAND_SZ - /// string, so you can use %environment_variable% syntax to refer to a file - /// already present on the user's machine. - /// - public string ParameterMessageFile - { - get - { - return this.parameterMessageFileField; - } - set - { - this.parameterMessageFileFieldSet = true; - this.parameterMessageFileField = value; - } - } - - /// - /// Equivalent to EVENTLOG_ERROR_TYPE. - /// - public YesNoType SupportsErrors - { - get - { - return this.supportsErrorsField; - } - set - { - this.supportsErrorsFieldSet = true; - this.supportsErrorsField = value; - } - } - - /// - /// Equivalent to EVENTLOG_AUDIT_FAILURE. - /// - public YesNoType SupportsFailureAudits - { - get - { - return this.supportsFailureAuditsField; - } - set - { - this.supportsFailureAuditsFieldSet = true; - this.supportsFailureAuditsField = value; - } - } - - /// - /// Equivalent to EVENTLOG_INFORMATION_TYPE. - /// - public YesNoType SupportsInformationals - { - get - { - return this.supportsInformationalsField; - } - set - { - this.supportsInformationalsFieldSet = true; - this.supportsInformationalsField = value; - } - } - - /// - /// Equivalent to EVENTLOG_AUDIT_SUCCESS. - /// - public YesNoType SupportsSuccessAudits - { - get - { - return this.supportsSuccessAuditsField; - } - set - { - this.supportsSuccessAuditsFieldSet = true; - this.supportsSuccessAuditsField = value; - } - } - - /// - /// Equivalent to EVENTLOG_WARNING_TYPE. - /// - public YesNoType SupportsWarnings - { - get - { - return this.supportsWarningsField; - } - set - { - this.supportsWarningsFieldSet = true; - this.supportsWarningsField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("EventSource", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.categoryCountFieldSet) - { - writer.WriteAttributeString("CategoryCount", this.categoryCountField.ToString(CultureInfo.InvariantCulture)); - } - if (this.categoryMessageFileFieldSet) - { - writer.WriteAttributeString("CategoryMessageFile", this.categoryMessageFileField); - } - if (this.eventMessageFileFieldSet) - { - writer.WriteAttributeString("EventMessageFile", this.eventMessageFileField); - } - if (this.keyPathFieldSet) - { - if ((this.keyPathField == YesNoType.no)) - { - writer.WriteAttributeString("KeyPath", "no"); - } - if ((this.keyPathField == YesNoType.yes)) - { - writer.WriteAttributeString("KeyPath", "yes"); - } - } - if (this.logFieldSet) - { - writer.WriteAttributeString("Log", this.logField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.parameterMessageFileFieldSet) - { - writer.WriteAttributeString("ParameterMessageFile", this.parameterMessageFileField); - } - if (this.supportsErrorsFieldSet) - { - if ((this.supportsErrorsField == YesNoType.no)) - { - writer.WriteAttributeString("SupportsErrors", "no"); - } - if ((this.supportsErrorsField == YesNoType.yes)) - { - writer.WriteAttributeString("SupportsErrors", "yes"); - } - } - if (this.supportsFailureAuditsFieldSet) - { - if ((this.supportsFailureAuditsField == YesNoType.no)) - { - writer.WriteAttributeString("SupportsFailureAudits", "no"); - } - if ((this.supportsFailureAuditsField == YesNoType.yes)) - { - writer.WriteAttributeString("SupportsFailureAudits", "yes"); - } - } - if (this.supportsInformationalsFieldSet) - { - if ((this.supportsInformationalsField == YesNoType.no)) - { - writer.WriteAttributeString("SupportsInformationals", "no"); - } - if ((this.supportsInformationalsField == YesNoType.yes)) - { - writer.WriteAttributeString("SupportsInformationals", "yes"); - } - } - if (this.supportsSuccessAuditsFieldSet) - { - if ((this.supportsSuccessAuditsField == YesNoType.no)) - { - writer.WriteAttributeString("SupportsSuccessAudits", "no"); - } - if ((this.supportsSuccessAuditsField == YesNoType.yes)) - { - writer.WriteAttributeString("SupportsSuccessAudits", "yes"); - } - } - if (this.supportsWarningsFieldSet) - { - if ((this.supportsWarningsField == YesNoType.no)) - { - writer.WriteAttributeString("SupportsWarnings", "no"); - } - if ((this.supportsWarningsField == YesNoType.yes)) - { - writer.WriteAttributeString("SupportsWarnings", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("CategoryCount" == name)) - { - this.categoryCountField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.categoryCountFieldSet = true; - } - if (("CategoryMessageFile" == name)) - { - this.categoryMessageFileField = value; - this.categoryMessageFileFieldSet = true; - } - if (("EventMessageFile" == name)) - { - this.eventMessageFileField = value; - this.eventMessageFileFieldSet = true; - } - if (("KeyPath" == name)) - { - this.keyPathField = Enums.ParseYesNoType(value); - this.keyPathFieldSet = true; - } - if (("Log" == name)) - { - this.logField = value; - this.logFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("ParameterMessageFile" == name)) - { - this.parameterMessageFileField = value; - this.parameterMessageFileFieldSet = true; - } - if (("SupportsErrors" == name)) - { - this.supportsErrorsField = Enums.ParseYesNoType(value); - this.supportsErrorsFieldSet = true; - } - if (("SupportsFailureAudits" == name)) - { - this.supportsFailureAuditsField = Enums.ParseYesNoType(value); - this.supportsFailureAuditsFieldSet = true; - } - if (("SupportsInformationals" == name)) - { - this.supportsInformationalsField = Enums.ParseYesNoType(value); - this.supportsInformationalsFieldSet = true; - } - if (("SupportsSuccessAudits" == name)) - { - this.supportsSuccessAuditsField = Enums.ParseYesNoType(value); - this.supportsSuccessAuditsFieldSet = true; - } - if (("SupportsWarnings" == name)) - { - this.supportsWarningsField = Enums.ParseYesNoType(value); - this.supportsWarningsFieldSet = true; - } - } - } - - /// - /// Describes a file search. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class FileSearch : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string variableField; - - private bool variableFieldSet; - - private string conditionField; - - private bool conditionFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private ResultType resultField; - - private bool resultFieldSet; - - private ISchemaElement parentElement; - - /// - /// Id of the search for ordering and dependency. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the variable in which to place the result of the search. - /// - public string Variable - { - get - { - return this.variableField; - } - set - { - this.variableFieldSet = true; - this.variableField = value; - } - } - - /// - /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. - /// - public string Condition - { - get - { - return this.conditionField; - } - set - { - this.conditionFieldSet = true; - this.conditionField = value; - } - } - - /// - /// Id of the search that this one should come after. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// File path to search for. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - /// - /// Rather than saving the matching file path into the variable, a FileSearch can save an attribute of the matching file instead. - /// - public ResultType Result - { - get - { - return this.resultField; - } - set - { - this.resultFieldSet = true; - this.resultField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ResultType from a string. - /// - public static ResultType ParseResultType(string value) - { - ResultType parsedValue; - FileSearch.TryParseResultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ResultType from a string. - /// - public static bool TryParseResultType(string value, out ResultType parsedValue) - { - parsedValue = ResultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("exists" == value)) - { - parsedValue = ResultType.exists; - } - else - { - if (("version" == value)) - { - parsedValue = ResultType.version; - } - else - { - parsedValue = ResultType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.variableFieldSet) - { - writer.WriteAttributeString("Variable", this.variableField); - } - if (this.conditionFieldSet) - { - writer.WriteAttributeString("Condition", this.conditionField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - if (this.resultFieldSet) - { - if ((this.resultField == ResultType.exists)) - { - writer.WriteAttributeString("Result", "exists"); - } - if ((this.resultField == ResultType.version)) - { - writer.WriteAttributeString("Result", "version"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Variable" == name)) - { - this.variableField = value; - this.variableFieldSet = true; - } - if (("Condition" == name)) - { - this.conditionField = value; - this.conditionFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - if (("Result" == name)) - { - this.resultField = FileSearch.ParseResultType(value); - this.resultFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ResultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Saves true if a matching file is found; false otherwise. - /// - exists, - - /// - /// Saves the version information for files that have it (.exe, .dll); zero-version (0.0.0.0) otherwise. - /// - version, - } - } - - /// - /// References a FileSearch. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class FileSearchRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Creates a file share out of the component's directory. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class FileShare : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private ISchemaElement parentElement; - - public FileShare() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(FileSharePermission))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the file share (primary key). - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the file share. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Description of the file share. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("FileSharePermission" == childName)) - { - childValue = new FileSharePermission(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileShare", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - } - } - - /// - /// Sets ACLs on a FileShare. This element has no Id attribute. - /// The table and key are taken from the parent element. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class FileSharePermission : ISchemaElement, ISetAttributes - { - - private string userField; - - private bool userFieldSet; - - private YesNoType readField; - - private bool readFieldSet; - - private YesNoType deleteField; - - private bool deleteFieldSet; - - private YesNoType readPermissionField; - - private bool readPermissionFieldSet; - - private YesNoType changePermissionField; - - private bool changePermissionFieldSet; - - private YesNoType takeOwnershipField; - - private bool takeOwnershipFieldSet; - - private YesNoType readAttributesField; - - private bool readAttributesFieldSet; - - private YesNoType writeAttributesField; - - private bool writeAttributesFieldSet; - - private YesNoType readExtendedAttributesField; - - private bool readExtendedAttributesFieldSet; - - private YesNoType writeExtendedAttributesField; - - private bool writeExtendedAttributesFieldSet; - - private YesNoType synchronizeField; - - private bool synchronizeFieldSet; - - private YesNoType createFileField; - - private bool createFileFieldSet; - - private YesNoType createChildField; - - private bool createChildFieldSet; - - private YesNoType deleteChildField; - - private bool deleteChildFieldSet; - - private YesNoType traverseField; - - private bool traverseFieldSet; - - private YesNoType genericAllField; - - private bool genericAllFieldSet; - - private YesNoType genericExecuteField; - - private bool genericExecuteFieldSet; - - private YesNoType genericWriteField; - - private bool genericWriteFieldSet; - - private YesNoType genericReadField; - - private bool genericReadFieldSet; - - private ISchemaElement parentElement; - - public string User - { - get - { - return this.userField; - } - set - { - this.userFieldSet = true; - this.userField = value; - } - } - - public YesNoType Read - { - get - { - return this.readField; - } - set - { - this.readFieldSet = true; - this.readField = value; - } - } - - public YesNoType Delete - { - get - { - return this.deleteField; - } - set - { - this.deleteFieldSet = true; - this.deleteField = value; - } - } - - public YesNoType ReadPermission - { - get - { - return this.readPermissionField; - } - set - { - this.readPermissionFieldSet = true; - this.readPermissionField = value; - } - } - - public YesNoType ChangePermission - { - get - { - return this.changePermissionField; - } - set - { - this.changePermissionFieldSet = true; - this.changePermissionField = value; - } - } - - public YesNoType TakeOwnership - { - get - { - return this.takeOwnershipField; - } - set - { - this.takeOwnershipFieldSet = true; - this.takeOwnershipField = value; - } - } - - public YesNoType ReadAttributes - { - get - { - return this.readAttributesField; - } - set - { - this.readAttributesFieldSet = true; - this.readAttributesField = value; - } - } - - public YesNoType WriteAttributes - { - get - { - return this.writeAttributesField; - } - set - { - this.writeAttributesFieldSet = true; - this.writeAttributesField = value; - } - } - - public YesNoType ReadExtendedAttributes - { - get - { - return this.readExtendedAttributesField; - } - set - { - this.readExtendedAttributesFieldSet = true; - this.readExtendedAttributesField = value; - } - } - - public YesNoType WriteExtendedAttributes - { - get - { - return this.writeExtendedAttributesField; - } - set - { - this.writeExtendedAttributesFieldSet = true; - this.writeExtendedAttributesField = value; - } - } - - public YesNoType Synchronize - { - get - { - return this.synchronizeField; - } - set - { - this.synchronizeFieldSet = true; - this.synchronizeField = value; - } - } - - /// - /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. - /// - public YesNoType CreateFile - { - get - { - return this.createFileField; - } - set - { - this.createFileFieldSet = true; - this.createFileField = value; - } - } - - /// - /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. - /// - public YesNoType CreateChild - { - get - { - return this.createChildField; - } - set - { - this.createChildFieldSet = true; - this.createChildField = value; - } - } - - /// - /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. - /// - public YesNoType DeleteChild - { - get - { - return this.deleteChildField; - } - set - { - this.deleteChildFieldSet = true; - this.deleteChildField = value; - } - } - - /// - /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. - /// - public YesNoType Traverse - { - get - { - return this.traverseField; - } - set - { - this.traverseFieldSet = true; - this.traverseField = value; - } - } - - public YesNoType GenericAll - { - get - { - return this.genericAllField; - } - set - { - this.genericAllFieldSet = true; - this.genericAllField = value; - } - } - - public YesNoType GenericExecute - { - get - { - return this.genericExecuteField; - } - set - { - this.genericExecuteFieldSet = true; - this.genericExecuteField = value; - } - } - - public YesNoType GenericWrite - { - get - { - return this.genericWriteField; - } - set - { - this.genericWriteFieldSet = true; - this.genericWriteField = value; - } - } - - /// - /// specifying this will fail to grant read access - /// - public YesNoType GenericRead - { - get - { - return this.genericReadField; - } - set - { - this.genericReadFieldSet = true; - this.genericReadField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileSharePermission", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.userFieldSet) - { - writer.WriteAttributeString("User", this.userField); - } - if (this.readFieldSet) - { - if ((this.readField == YesNoType.no)) - { - writer.WriteAttributeString("Read", "no"); - } - if ((this.readField == YesNoType.yes)) - { - writer.WriteAttributeString("Read", "yes"); - } - } - if (this.deleteFieldSet) - { - if ((this.deleteField == YesNoType.no)) - { - writer.WriteAttributeString("Delete", "no"); - } - if ((this.deleteField == YesNoType.yes)) - { - writer.WriteAttributeString("Delete", "yes"); - } - } - if (this.readPermissionFieldSet) - { - if ((this.readPermissionField == YesNoType.no)) - { - writer.WriteAttributeString("ReadPermission", "no"); - } - if ((this.readPermissionField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadPermission", "yes"); - } - } - if (this.changePermissionFieldSet) - { - if ((this.changePermissionField == YesNoType.no)) - { - writer.WriteAttributeString("ChangePermission", "no"); - } - if ((this.changePermissionField == YesNoType.yes)) - { - writer.WriteAttributeString("ChangePermission", "yes"); - } - } - if (this.takeOwnershipFieldSet) - { - if ((this.takeOwnershipField == YesNoType.no)) - { - writer.WriteAttributeString("TakeOwnership", "no"); - } - if ((this.takeOwnershipField == YesNoType.yes)) - { - writer.WriteAttributeString("TakeOwnership", "yes"); - } - } - if (this.readAttributesFieldSet) - { - if ((this.readAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("ReadAttributes", "no"); - } - if ((this.readAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadAttributes", "yes"); - } - } - if (this.writeAttributesFieldSet) - { - if ((this.writeAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("WriteAttributes", "no"); - } - if ((this.writeAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("WriteAttributes", "yes"); - } - } - if (this.readExtendedAttributesFieldSet) - { - if ((this.readExtendedAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("ReadExtendedAttributes", "no"); - } - if ((this.readExtendedAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadExtendedAttributes", "yes"); - } - } - if (this.writeExtendedAttributesFieldSet) - { - if ((this.writeExtendedAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("WriteExtendedAttributes", "no"); - } - if ((this.writeExtendedAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("WriteExtendedAttributes", "yes"); - } - } - if (this.synchronizeFieldSet) - { - if ((this.synchronizeField == YesNoType.no)) - { - writer.WriteAttributeString("Synchronize", "no"); - } - if ((this.synchronizeField == YesNoType.yes)) - { - writer.WriteAttributeString("Synchronize", "yes"); - } - } - if (this.createFileFieldSet) - { - if ((this.createFileField == YesNoType.no)) - { - writer.WriteAttributeString("CreateFile", "no"); - } - if ((this.createFileField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateFile", "yes"); - } - } - if (this.createChildFieldSet) - { - if ((this.createChildField == YesNoType.no)) - { - writer.WriteAttributeString("CreateChild", "no"); - } - if ((this.createChildField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateChild", "yes"); - } - } - if (this.deleteChildFieldSet) - { - if ((this.deleteChildField == YesNoType.no)) - { - writer.WriteAttributeString("DeleteChild", "no"); - } - if ((this.deleteChildField == YesNoType.yes)) - { - writer.WriteAttributeString("DeleteChild", "yes"); - } - } - if (this.traverseFieldSet) - { - if ((this.traverseField == YesNoType.no)) - { - writer.WriteAttributeString("Traverse", "no"); - } - if ((this.traverseField == YesNoType.yes)) - { - writer.WriteAttributeString("Traverse", "yes"); - } - } - if (this.genericAllFieldSet) - { - if ((this.genericAllField == YesNoType.no)) - { - writer.WriteAttributeString("GenericAll", "no"); - } - if ((this.genericAllField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericAll", "yes"); - } - } - if (this.genericExecuteFieldSet) - { - if ((this.genericExecuteField == YesNoType.no)) - { - writer.WriteAttributeString("GenericExecute", "no"); - } - if ((this.genericExecuteField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericExecute", "yes"); - } - } - if (this.genericWriteFieldSet) - { - if ((this.genericWriteField == YesNoType.no)) - { - writer.WriteAttributeString("GenericWrite", "no"); - } - if ((this.genericWriteField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericWrite", "yes"); - } - } - if (this.genericReadFieldSet) - { - if ((this.genericReadField == YesNoType.no)) - { - writer.WriteAttributeString("GenericRead", "no"); - } - if ((this.genericReadField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericRead", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("User" == name)) - { - this.userField = value; - this.userFieldSet = true; - } - if (("Read" == name)) - { - this.readField = Enums.ParseYesNoType(value); - this.readFieldSet = true; - } - if (("Delete" == name)) - { - this.deleteField = Enums.ParseYesNoType(value); - this.deleteFieldSet = true; - } - if (("ReadPermission" == name)) - { - this.readPermissionField = Enums.ParseYesNoType(value); - this.readPermissionFieldSet = true; - } - if (("ChangePermission" == name)) - { - this.changePermissionField = Enums.ParseYesNoType(value); - this.changePermissionFieldSet = true; - } - if (("TakeOwnership" == name)) - { - this.takeOwnershipField = Enums.ParseYesNoType(value); - this.takeOwnershipFieldSet = true; - } - if (("ReadAttributes" == name)) - { - this.readAttributesField = Enums.ParseYesNoType(value); - this.readAttributesFieldSet = true; - } - if (("WriteAttributes" == name)) - { - this.writeAttributesField = Enums.ParseYesNoType(value); - this.writeAttributesFieldSet = true; - } - if (("ReadExtendedAttributes" == name)) - { - this.readExtendedAttributesField = Enums.ParseYesNoType(value); - this.readExtendedAttributesFieldSet = true; - } - if (("WriteExtendedAttributes" == name)) - { - this.writeExtendedAttributesField = Enums.ParseYesNoType(value); - this.writeExtendedAttributesFieldSet = true; - } - if (("Synchronize" == name)) - { - this.synchronizeField = Enums.ParseYesNoType(value); - this.synchronizeFieldSet = true; - } - if (("CreateFile" == name)) - { - this.createFileField = Enums.ParseYesNoType(value); - this.createFileFieldSet = true; - } - if (("CreateChild" == name)) - { - this.createChildField = Enums.ParseYesNoType(value); - this.createChildFieldSet = true; - } - if (("DeleteChild" == name)) - { - this.deleteChildField = Enums.ParseYesNoType(value); - this.deleteChildFieldSet = true; - } - if (("Traverse" == name)) - { - this.traverseField = Enums.ParseYesNoType(value); - this.traverseFieldSet = true; - } - if (("GenericAll" == name)) - { - this.genericAllField = Enums.ParseYesNoType(value); - this.genericAllFieldSet = true; - } - if (("GenericExecute" == name)) - { - this.genericExecuteField = Enums.ParseYesNoType(value); - this.genericExecuteFieldSet = true; - } - if (("GenericWrite" == name)) - { - this.genericWriteField = Enums.ParseYesNoType(value); - this.genericWriteFieldSet = true; - } - if (("GenericRead" == name)) - { - this.genericReadField = Enums.ParseYesNoType(value); - this.genericReadFieldSet = true; - } - } - } - - /// - /// Formats a file's contents at install time. The contents are formatted according to the rules of the - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class FormatFile : ISchemaElement, ISetAttributes - { - - private string binaryKeyField; - - private bool binaryKeyFieldSet; - - private ISchemaElement parentElement; - - /// - /// The id of a Binary row that contains a copy of the file. The file in the Binary table overwrites whatever - /// file is installed by the parent component. - /// - public string BinaryKey - { - get - { - return this.binaryKeyField; - } - set - { - this.binaryKeyFieldSet = true; - this.binaryKeyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FormatFile", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.binaryKeyFieldSet) - { - writer.WriteAttributeString("BinaryKey", this.binaryKeyField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("BinaryKey" == name)) - { - this.binaryKeyField = value; - this.binaryKeyFieldSet = true; - } - } - } - - /// - /// Finds user groups on the local machine or specified Active Directory domain. The local machine will be - /// searched for the group first then fallback to looking in Active Directory. This element is not capable - /// of creating new groups but can be used to add new or existing users to an existing group. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class Group : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string domainField; - - private bool domainFieldSet; - - private ISchemaElement parentElement; - - /// - /// Unique identifier in your installation package for this group. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// A - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// An optional - /// - public string Domain - { - get - { - return this.domainField; - } - set - { - this.domainFieldSet = true; - this.domainField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Group", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.domainFieldSet) - { - writer.WriteAttributeString("Domain", this.domainField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Domain" == name)) - { - this.domainField = value; - this.domainFieldSet = true; - } - } - } - - /// - /// Used to join a user to a group - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class GroupRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("GroupRef", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Creates a shortcut to a URL. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class InternetShortcut : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string targetField; - - private bool targetFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private string iconFileField; - - private bool iconFileFieldSet; - - private int iconIndexField; - - private bool iconIndexFieldSet; - - private ISchemaElement parentElement; - - /// - /// Unique identifier in your installation package for this Internet shortcut. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Identifier reference to Directory element where shortcut is to be created. This attribute's value defaults to the parent Component directory. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// The name of the shortcut file, which is visible to the user. (The .lnk - /// extension is added automatically and by default, is not shown to the user.) - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// URL that should be opened when the user selects the shortcut. Windows - /// opens the URL in the appropriate handler for the protocol specified - /// in the URL. Note that this is a formatted field, so you can use - /// [#fileId] syntax to refer to a file being installed (using the file: - /// protocol). - /// - public string Target - { - get - { - return this.targetField; - } - set - { - this.targetFieldSet = true; - this.targetField = value; - } - } - - /// - /// Which type of shortcut should be created. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Icon file that should be displayed. Note that this is a formatted field, so you can use - /// [#fileId] syntax to refer to a file being installed (using the file: - /// protocol). - /// - public string IconFile - { - get - { - return this.iconFileField; - } - set - { - this.iconFileFieldSet = true; - this.iconFileField = value; - } - } - - /// - /// Index of the icon being referenced - /// - public int IconIndex - { - get - { - return this.iconIndexField; - } - set - { - this.iconIndexFieldSet = true; - this.iconIndexField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - InternetShortcut.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("url" == value)) - { - parsedValue = TypeType.url; - } - else - { - if (("link" == value)) - { - parsedValue = TypeType.link; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InternetShortcut", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.targetFieldSet) - { - writer.WriteAttributeString("Target", this.targetField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.url)) - { - writer.WriteAttributeString("Type", "url"); - } - if ((this.typeField == TypeType.link)) - { - writer.WriteAttributeString("Type", "link"); - } - } - if (this.iconFileFieldSet) - { - writer.WriteAttributeString("IconFile", this.iconFileField); - } - if (this.iconIndexFieldSet) - { - writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Target" == name)) - { - this.targetField = value; - this.targetFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = InternetShortcut.ParseTypeType(value); - this.typeFieldSet = true; - } - if (("IconFile" == name)) - { - this.iconFileField = value; - this.iconFileFieldSet = true; - } - if (("IconIndex" == name)) - { - this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.iconIndexFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Creates .url files using IUniformResourceLocatorW. - /// - url, - - /// - /// Creates .lnk files using IShellLinkW (default). - /// - link, - } - } - - /// - /// Used to create performance categories and configure performance counters. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class PerformanceCategory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string helpField; - - private bool helpFieldSet; - - private YesNoType multiInstanceField; - - private bool multiInstanceFieldSet; - - private string libraryField; - - private bool libraryFieldSet; - - private string openField; - - private bool openFieldSet; - - private string closeField; - - private bool closeFieldSet; - - private string collectField; - - private bool collectFieldSet; - - private PerformanceCounterLanguageType defaultLanguageField; - - private bool defaultLanguageFieldSet; - - private ISchemaElement parentElement; - - public PerformanceCategory() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PerformanceCounter))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier in your installation package for this performance counter category. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name for the performance counter category. If this attribute is not provided the Id attribute is used as the name of the performance counter category. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Optional help text for the performance counter category. - /// - public string Help - { - get - { - return this.helpField; - } - set - { - this.helpFieldSet = true; - this.helpField = value; - } - } - - /// - /// Flag that specifies whether the performance counter category is multi or single instanced. Default is single instance. - /// - public YesNoType MultiInstance - { - get - { - return this.multiInstanceField; - } - set - { - this.multiInstanceFieldSet = true; - this.multiInstanceField = value; - } - } - - /// - /// DLL that contains the performance counter. The default is "netfxperf.dll" which should be used for all managed code performance counters. - /// - public string Library - { - get - { - return this.libraryField; - } - set - { - this.libraryFieldSet = true; - this.libraryField = value; - } - } - - /// - /// Function entry point in to the Library DLL called when opening the performance counter. The default is "OpenPerformanceData" which should be used for all managed code performance counters. - /// - public string Open - { - get - { - return this.openField; - } - set - { - this.openFieldSet = true; - this.openField = value; - } - } - - /// - /// Function entry point in to the Library DLL called when closing the performance counter. The default is "ClosePerformanceData" which should be used for all managed code performance counters. - /// - public string Close - { - get - { - return this.closeField; - } - set - { - this.closeFieldSet = true; - this.closeField = value; - } - } - - /// - /// Function entry point in to the Library DLL called when collecting data from the performance counter. The default is "CollectPerformanceData" which should be used for all managed code performance counters. - /// - public string Collect - { - get - { - return this.collectField; - } - set - { - this.collectFieldSet = true; - this.collectField = value; - } - } - - /// - /// Default language for the performance category and contained counters' names and help text. - /// - public PerformanceCounterLanguageType DefaultLanguage - { - get - { - return this.defaultLanguageField; - } - set - { - this.defaultLanguageFieldSet = true; - this.defaultLanguageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("PerformanceCounter" == childName)) - { - childValue = new PerformanceCounter(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PerformanceCategory", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.helpFieldSet) - { - writer.WriteAttributeString("Help", this.helpField); - } - if (this.multiInstanceFieldSet) - { - if ((this.multiInstanceField == YesNoType.no)) - { - writer.WriteAttributeString("MultiInstance", "no"); - } - if ((this.multiInstanceField == YesNoType.yes)) - { - writer.WriteAttributeString("MultiInstance", "yes"); - } - } - if (this.libraryFieldSet) - { - writer.WriteAttributeString("Library", this.libraryField); - } - if (this.openFieldSet) - { - writer.WriteAttributeString("Open", this.openField); - } - if (this.closeFieldSet) - { - writer.WriteAttributeString("Close", this.closeField); - } - if (this.collectFieldSet) - { - writer.WriteAttributeString("Collect", this.collectField); - } - if (this.defaultLanguageFieldSet) - { - if ((this.defaultLanguageField == PerformanceCounterLanguageType.afrikaans)) - { - writer.WriteAttributeString("DefaultLanguage", "afrikaans"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.albanian)) - { - writer.WriteAttributeString("DefaultLanguage", "albanian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.arabic)) - { - writer.WriteAttributeString("DefaultLanguage", "arabic"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.armenian)) - { - writer.WriteAttributeString("DefaultLanguage", "armenian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.assamese)) - { - writer.WriteAttributeString("DefaultLanguage", "assamese"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.azeri)) - { - writer.WriteAttributeString("DefaultLanguage", "azeri"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.basque)) - { - writer.WriteAttributeString("DefaultLanguage", "basque"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.belarusian)) - { - writer.WriteAttributeString("DefaultLanguage", "belarusian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.bengali)) - { - writer.WriteAttributeString("DefaultLanguage", "bengali"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.bulgarian)) - { - writer.WriteAttributeString("DefaultLanguage", "bulgarian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.catalan)) - { - writer.WriteAttributeString("DefaultLanguage", "catalan"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.chinese)) - { - writer.WriteAttributeString("DefaultLanguage", "chinese"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.croatian)) - { - writer.WriteAttributeString("DefaultLanguage", "croatian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.czech)) - { - writer.WriteAttributeString("DefaultLanguage", "czech"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.danish)) - { - writer.WriteAttributeString("DefaultLanguage", "danish"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.divehi)) - { - writer.WriteAttributeString("DefaultLanguage", "divehi"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.dutch)) - { - writer.WriteAttributeString("DefaultLanguage", "dutch"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.english)) - { - writer.WriteAttributeString("DefaultLanguage", "english"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.estonian)) - { - writer.WriteAttributeString("DefaultLanguage", "estonian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.faeroese)) - { - writer.WriteAttributeString("DefaultLanguage", "faeroese"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.farsi)) - { - writer.WriteAttributeString("DefaultLanguage", "farsi"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.finnish)) - { - writer.WriteAttributeString("DefaultLanguage", "finnish"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.french)) - { - writer.WriteAttributeString("DefaultLanguage", "french"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.galician)) - { - writer.WriteAttributeString("DefaultLanguage", "galician"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.georgian)) - { - writer.WriteAttributeString("DefaultLanguage", "georgian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.german)) - { - writer.WriteAttributeString("DefaultLanguage", "german"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.greek)) - { - writer.WriteAttributeString("DefaultLanguage", "greek"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.gujarati)) - { - writer.WriteAttributeString("DefaultLanguage", "gujarati"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.hebrew)) - { - writer.WriteAttributeString("DefaultLanguage", "hebrew"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.hindi)) - { - writer.WriteAttributeString("DefaultLanguage", "hindi"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.hungarian)) - { - writer.WriteAttributeString("DefaultLanguage", "hungarian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.icelandic)) - { - writer.WriteAttributeString("DefaultLanguage", "icelandic"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.indonesian)) - { - writer.WriteAttributeString("DefaultLanguage", "indonesian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.italian)) - { - writer.WriteAttributeString("DefaultLanguage", "italian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.japanese)) - { - writer.WriteAttributeString("DefaultLanguage", "japanese"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.kannada)) - { - writer.WriteAttributeString("DefaultLanguage", "kannada"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.kashmiri)) - { - writer.WriteAttributeString("DefaultLanguage", "kashmiri"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.kazak)) - { - writer.WriteAttributeString("DefaultLanguage", "kazak"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.konkani)) - { - writer.WriteAttributeString("DefaultLanguage", "konkani"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.korean)) - { - writer.WriteAttributeString("DefaultLanguage", "korean"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.kyrgyz)) - { - writer.WriteAttributeString("DefaultLanguage", "kyrgyz"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.latvian)) - { - writer.WriteAttributeString("DefaultLanguage", "latvian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.lithuanian)) - { - writer.WriteAttributeString("DefaultLanguage", "lithuanian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.macedonian)) - { - writer.WriteAttributeString("DefaultLanguage", "macedonian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.malay)) - { - writer.WriteAttributeString("DefaultLanguage", "malay"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.malayalam)) - { - writer.WriteAttributeString("DefaultLanguage", "malayalam"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.manipuri)) - { - writer.WriteAttributeString("DefaultLanguage", "manipuri"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.marathi)) - { - writer.WriteAttributeString("DefaultLanguage", "marathi"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.mongolian)) - { - writer.WriteAttributeString("DefaultLanguage", "mongolian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.nepali)) - { - writer.WriteAttributeString("DefaultLanguage", "nepali"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.norwegian)) - { - writer.WriteAttributeString("DefaultLanguage", "norwegian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.oriya)) - { - writer.WriteAttributeString("DefaultLanguage", "oriya"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.polish)) - { - writer.WriteAttributeString("DefaultLanguage", "polish"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.portuguese)) - { - writer.WriteAttributeString("DefaultLanguage", "portuguese"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.punjabi)) - { - writer.WriteAttributeString("DefaultLanguage", "punjabi"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.romanian)) - { - writer.WriteAttributeString("DefaultLanguage", "romanian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.russian)) - { - writer.WriteAttributeString("DefaultLanguage", "russian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.sanskrit)) - { - writer.WriteAttributeString("DefaultLanguage", "sanskrit"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.serbian)) - { - writer.WriteAttributeString("DefaultLanguage", "serbian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.sindhi)) - { - writer.WriteAttributeString("DefaultLanguage", "sindhi"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovak)) - { - writer.WriteAttributeString("DefaultLanguage", "slovak"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovenian)) - { - writer.WriteAttributeString("DefaultLanguage", "slovenian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.spanish)) - { - writer.WriteAttributeString("DefaultLanguage", "spanish"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.swahili)) - { - writer.WriteAttributeString("DefaultLanguage", "swahili"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.swedish)) - { - writer.WriteAttributeString("DefaultLanguage", "swedish"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.syriac)) - { - writer.WriteAttributeString("DefaultLanguage", "syriac"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.tamil)) - { - writer.WriteAttributeString("DefaultLanguage", "tamil"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.tatar)) - { - writer.WriteAttributeString("DefaultLanguage", "tatar"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.telugu)) - { - writer.WriteAttributeString("DefaultLanguage", "telugu"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.thai)) - { - writer.WriteAttributeString("DefaultLanguage", "thai"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.turkish)) - { - writer.WriteAttributeString("DefaultLanguage", "turkish"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.ukrainian)) - { - writer.WriteAttributeString("DefaultLanguage", "ukrainian"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.urdu)) - { - writer.WriteAttributeString("DefaultLanguage", "urdu"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.uzbek)) - { - writer.WriteAttributeString("DefaultLanguage", "uzbek"); - } - if ((this.defaultLanguageField == PerformanceCounterLanguageType.vietnamese)) - { - writer.WriteAttributeString("DefaultLanguage", "vietnamese"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Help" == name)) - { - this.helpField = value; - this.helpFieldSet = true; - } - if (("MultiInstance" == name)) - { - this.multiInstanceField = Enums.ParseYesNoType(value); - this.multiInstanceFieldSet = true; - } - if (("Library" == name)) - { - this.libraryField = value; - this.libraryFieldSet = true; - } - if (("Open" == name)) - { - this.openField = value; - this.openFieldSet = true; - } - if (("Close" == name)) - { - this.closeField = value; - this.closeFieldSet = true; - } - if (("Collect" == name)) - { - this.collectField = value; - this.collectFieldSet = true; - } - if (("DefaultLanguage" == name)) - { - this.defaultLanguageField = Enums.ParsePerformanceCounterLanguageType(value); - this.defaultLanguageFieldSet = true; - } - } - } - - /// - /// Creates a performance counter in a performance category. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class PerformanceCounter : ISchemaElement, ISetAttributes - { - - private string nameField; - - private bool nameFieldSet; - - private string helpField; - - private bool helpFieldSet; - - private PerformanceCounterTypesType typeField; - - private bool typeFieldSet; - - private PerformanceCounterLanguageType languageField; - - private bool languageFieldSet; - - private ISchemaElement parentElement; - - /// - /// Name for the performance counter. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Optional help text for the performance counter. - /// - public string Help - { - get - { - return this.helpField; - } - set - { - this.helpFieldSet = true; - this.helpField = value; - } - } - - /// - /// Type of the performance counter. - /// - public PerformanceCounterTypesType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Language for the peformance counter name and help. The default is to use the parent PerformanceCategory element's DefaultLanguage attribute. - /// - public PerformanceCounterLanguageType Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PerformanceCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.helpFieldSet) - { - writer.WriteAttributeString("Help", this.helpField); - } - if (this.typeFieldSet) - { - if ((this.typeField == PerformanceCounterTypesType.averageBase)) - { - writer.WriteAttributeString("Type", "averageBase"); - } - if ((this.typeField == PerformanceCounterTypesType.averageCount64)) - { - writer.WriteAttributeString("Type", "averageCount64"); - } - if ((this.typeField == PerformanceCounterTypesType.averageTimer32)) - { - writer.WriteAttributeString("Type", "averageTimer32"); - } - if ((this.typeField == PerformanceCounterTypesType.counterDelta32)) - { - writer.WriteAttributeString("Type", "counterDelta32"); - } - if ((this.typeField == PerformanceCounterTypesType.counterTimerInverse)) - { - writer.WriteAttributeString("Type", "counterTimerInverse"); - } - if ((this.typeField == PerformanceCounterTypesType.sampleFraction)) - { - writer.WriteAttributeString("Type", "sampleFraction"); - } - if ((this.typeField == PerformanceCounterTypesType.timer100Ns)) - { - writer.WriteAttributeString("Type", "timer100Ns"); - } - if ((this.typeField == PerformanceCounterTypesType.counterTimer)) - { - writer.WriteAttributeString("Type", "counterTimer"); - } - if ((this.typeField == PerformanceCounterTypesType.rawFraction)) - { - writer.WriteAttributeString("Type", "rawFraction"); - } - if ((this.typeField == PerformanceCounterTypesType.timer100NsInverse)) - { - writer.WriteAttributeString("Type", "timer100NsInverse"); - } - if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer)) - { - writer.WriteAttributeString("Type", "counterMultiTimer"); - } - if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100Ns)) - { - writer.WriteAttributeString("Type", "counterMultiTimer100Ns"); - } - if ((this.typeField == PerformanceCounterTypesType.counterMultiTimerInverse)) - { - writer.WriteAttributeString("Type", "counterMultiTimerInverse"); - } - if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100NsInverse)) - { - writer.WriteAttributeString("Type", "counterMultiTimer100NsInverse"); - } - if ((this.typeField == PerformanceCounterTypesType.elapsedTime)) - { - writer.WriteAttributeString("Type", "elapsedTime"); - } - if ((this.typeField == PerformanceCounterTypesType.sampleBase)) - { - writer.WriteAttributeString("Type", "sampleBase"); - } - if ((this.typeField == PerformanceCounterTypesType.rawBase)) - { - writer.WriteAttributeString("Type", "rawBase"); - } - if ((this.typeField == PerformanceCounterTypesType.counterMultiBase)) - { - writer.WriteAttributeString("Type", "counterMultiBase"); - } - if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond64)) - { - writer.WriteAttributeString("Type", "rateOfCountsPerSecond64"); - } - if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond32)) - { - writer.WriteAttributeString("Type", "rateOfCountsPerSecond32"); - } - if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval64)) - { - writer.WriteAttributeString("Type", "countPerTimeInterval64"); - } - if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval32)) - { - writer.WriteAttributeString("Type", "countPerTimeInterval32"); - } - if ((this.typeField == PerformanceCounterTypesType.sampleCounter)) - { - writer.WriteAttributeString("Type", "sampleCounter"); - } - if ((this.typeField == PerformanceCounterTypesType.counterDelta64)) - { - writer.WriteAttributeString("Type", "counterDelta64"); - } - if ((this.typeField == PerformanceCounterTypesType.numberOfItems64)) - { - writer.WriteAttributeString("Type", "numberOfItems64"); - } - if ((this.typeField == PerformanceCounterTypesType.numberOfItems32)) - { - writer.WriteAttributeString("Type", "numberOfItems32"); - } - if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX64)) - { - writer.WriteAttributeString("Type", "numberOfItemsHEX64"); - } - if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX32)) - { - writer.WriteAttributeString("Type", "numberOfItemsHEX32"); - } - } - if (this.languageFieldSet) - { - if ((this.languageField == PerformanceCounterLanguageType.afrikaans)) - { - writer.WriteAttributeString("Language", "afrikaans"); - } - if ((this.languageField == PerformanceCounterLanguageType.albanian)) - { - writer.WriteAttributeString("Language", "albanian"); - } - if ((this.languageField == PerformanceCounterLanguageType.arabic)) - { - writer.WriteAttributeString("Language", "arabic"); - } - if ((this.languageField == PerformanceCounterLanguageType.armenian)) - { - writer.WriteAttributeString("Language", "armenian"); - } - if ((this.languageField == PerformanceCounterLanguageType.assamese)) - { - writer.WriteAttributeString("Language", "assamese"); - } - if ((this.languageField == PerformanceCounterLanguageType.azeri)) - { - writer.WriteAttributeString("Language", "azeri"); - } - if ((this.languageField == PerformanceCounterLanguageType.basque)) - { - writer.WriteAttributeString("Language", "basque"); - } - if ((this.languageField == PerformanceCounterLanguageType.belarusian)) - { - writer.WriteAttributeString("Language", "belarusian"); - } - if ((this.languageField == PerformanceCounterLanguageType.bengali)) - { - writer.WriteAttributeString("Language", "bengali"); - } - if ((this.languageField == PerformanceCounterLanguageType.bulgarian)) - { - writer.WriteAttributeString("Language", "bulgarian"); - } - if ((this.languageField == PerformanceCounterLanguageType.catalan)) - { - writer.WriteAttributeString("Language", "catalan"); - } - if ((this.languageField == PerformanceCounterLanguageType.chinese)) - { - writer.WriteAttributeString("Language", "chinese"); - } - if ((this.languageField == PerformanceCounterLanguageType.croatian)) - { - writer.WriteAttributeString("Language", "croatian"); - } - if ((this.languageField == PerformanceCounterLanguageType.czech)) - { - writer.WriteAttributeString("Language", "czech"); - } - if ((this.languageField == PerformanceCounterLanguageType.danish)) - { - writer.WriteAttributeString("Language", "danish"); - } - if ((this.languageField == PerformanceCounterLanguageType.divehi)) - { - writer.WriteAttributeString("Language", "divehi"); - } - if ((this.languageField == PerformanceCounterLanguageType.dutch)) - { - writer.WriteAttributeString("Language", "dutch"); - } - if ((this.languageField == PerformanceCounterLanguageType.english)) - { - writer.WriteAttributeString("Language", "english"); - } - if ((this.languageField == PerformanceCounterLanguageType.estonian)) - { - writer.WriteAttributeString("Language", "estonian"); - } - if ((this.languageField == PerformanceCounterLanguageType.faeroese)) - { - writer.WriteAttributeString("Language", "faeroese"); - } - if ((this.languageField == PerformanceCounterLanguageType.farsi)) - { - writer.WriteAttributeString("Language", "farsi"); - } - if ((this.languageField == PerformanceCounterLanguageType.finnish)) - { - writer.WriteAttributeString("Language", "finnish"); - } - if ((this.languageField == PerformanceCounterLanguageType.french)) - { - writer.WriteAttributeString("Language", "french"); - } - if ((this.languageField == PerformanceCounterLanguageType.galician)) - { - writer.WriteAttributeString("Language", "galician"); - } - if ((this.languageField == PerformanceCounterLanguageType.georgian)) - { - writer.WriteAttributeString("Language", "georgian"); - } - if ((this.languageField == PerformanceCounterLanguageType.german)) - { - writer.WriteAttributeString("Language", "german"); - } - if ((this.languageField == PerformanceCounterLanguageType.greek)) - { - writer.WriteAttributeString("Language", "greek"); - } - if ((this.languageField == PerformanceCounterLanguageType.gujarati)) - { - writer.WriteAttributeString("Language", "gujarati"); - } - if ((this.languageField == PerformanceCounterLanguageType.hebrew)) - { - writer.WriteAttributeString("Language", "hebrew"); - } - if ((this.languageField == PerformanceCounterLanguageType.hindi)) - { - writer.WriteAttributeString("Language", "hindi"); - } - if ((this.languageField == PerformanceCounterLanguageType.hungarian)) - { - writer.WriteAttributeString("Language", "hungarian"); - } - if ((this.languageField == PerformanceCounterLanguageType.icelandic)) - { - writer.WriteAttributeString("Language", "icelandic"); - } - if ((this.languageField == PerformanceCounterLanguageType.indonesian)) - { - writer.WriteAttributeString("Language", "indonesian"); - } - if ((this.languageField == PerformanceCounterLanguageType.italian)) - { - writer.WriteAttributeString("Language", "italian"); - } - if ((this.languageField == PerformanceCounterLanguageType.japanese)) - { - writer.WriteAttributeString("Language", "japanese"); - } - if ((this.languageField == PerformanceCounterLanguageType.kannada)) - { - writer.WriteAttributeString("Language", "kannada"); - } - if ((this.languageField == PerformanceCounterLanguageType.kashmiri)) - { - writer.WriteAttributeString("Language", "kashmiri"); - } - if ((this.languageField == PerformanceCounterLanguageType.kazak)) - { - writer.WriteAttributeString("Language", "kazak"); - } - if ((this.languageField == PerformanceCounterLanguageType.konkani)) - { - writer.WriteAttributeString("Language", "konkani"); - } - if ((this.languageField == PerformanceCounterLanguageType.korean)) - { - writer.WriteAttributeString("Language", "korean"); - } - if ((this.languageField == PerformanceCounterLanguageType.kyrgyz)) - { - writer.WriteAttributeString("Language", "kyrgyz"); - } - if ((this.languageField == PerformanceCounterLanguageType.latvian)) - { - writer.WriteAttributeString("Language", "latvian"); - } - if ((this.languageField == PerformanceCounterLanguageType.lithuanian)) - { - writer.WriteAttributeString("Language", "lithuanian"); - } - if ((this.languageField == PerformanceCounterLanguageType.macedonian)) - { - writer.WriteAttributeString("Language", "macedonian"); - } - if ((this.languageField == PerformanceCounterLanguageType.malay)) - { - writer.WriteAttributeString("Language", "malay"); - } - if ((this.languageField == PerformanceCounterLanguageType.malayalam)) - { - writer.WriteAttributeString("Language", "malayalam"); - } - if ((this.languageField == PerformanceCounterLanguageType.manipuri)) - { - writer.WriteAttributeString("Language", "manipuri"); - } - if ((this.languageField == PerformanceCounterLanguageType.marathi)) - { - writer.WriteAttributeString("Language", "marathi"); - } - if ((this.languageField == PerformanceCounterLanguageType.mongolian)) - { - writer.WriteAttributeString("Language", "mongolian"); - } - if ((this.languageField == PerformanceCounterLanguageType.nepali)) - { - writer.WriteAttributeString("Language", "nepali"); - } - if ((this.languageField == PerformanceCounterLanguageType.norwegian)) - { - writer.WriteAttributeString("Language", "norwegian"); - } - if ((this.languageField == PerformanceCounterLanguageType.oriya)) - { - writer.WriteAttributeString("Language", "oriya"); - } - if ((this.languageField == PerformanceCounterLanguageType.polish)) - { - writer.WriteAttributeString("Language", "polish"); - } - if ((this.languageField == PerformanceCounterLanguageType.portuguese)) - { - writer.WriteAttributeString("Language", "portuguese"); - } - if ((this.languageField == PerformanceCounterLanguageType.punjabi)) - { - writer.WriteAttributeString("Language", "punjabi"); - } - if ((this.languageField == PerformanceCounterLanguageType.romanian)) - { - writer.WriteAttributeString("Language", "romanian"); - } - if ((this.languageField == PerformanceCounterLanguageType.russian)) - { - writer.WriteAttributeString("Language", "russian"); - } - if ((this.languageField == PerformanceCounterLanguageType.sanskrit)) - { - writer.WriteAttributeString("Language", "sanskrit"); - } - if ((this.languageField == PerformanceCounterLanguageType.serbian)) - { - writer.WriteAttributeString("Language", "serbian"); - } - if ((this.languageField == PerformanceCounterLanguageType.sindhi)) - { - writer.WriteAttributeString("Language", "sindhi"); - } - if ((this.languageField == PerformanceCounterLanguageType.slovak)) - { - writer.WriteAttributeString("Language", "slovak"); - } - if ((this.languageField == PerformanceCounterLanguageType.slovenian)) - { - writer.WriteAttributeString("Language", "slovenian"); - } - if ((this.languageField == PerformanceCounterLanguageType.spanish)) - { - writer.WriteAttributeString("Language", "spanish"); - } - if ((this.languageField == PerformanceCounterLanguageType.swahili)) - { - writer.WriteAttributeString("Language", "swahili"); - } - if ((this.languageField == PerformanceCounterLanguageType.swedish)) - { - writer.WriteAttributeString("Language", "swedish"); - } - if ((this.languageField == PerformanceCounterLanguageType.syriac)) - { - writer.WriteAttributeString("Language", "syriac"); - } - if ((this.languageField == PerformanceCounterLanguageType.tamil)) - { - writer.WriteAttributeString("Language", "tamil"); - } - if ((this.languageField == PerformanceCounterLanguageType.tatar)) - { - writer.WriteAttributeString("Language", "tatar"); - } - if ((this.languageField == PerformanceCounterLanguageType.telugu)) - { - writer.WriteAttributeString("Language", "telugu"); - } - if ((this.languageField == PerformanceCounterLanguageType.thai)) - { - writer.WriteAttributeString("Language", "thai"); - } - if ((this.languageField == PerformanceCounterLanguageType.turkish)) - { - writer.WriteAttributeString("Language", "turkish"); - } - if ((this.languageField == PerformanceCounterLanguageType.ukrainian)) - { - writer.WriteAttributeString("Language", "ukrainian"); - } - if ((this.languageField == PerformanceCounterLanguageType.urdu)) - { - writer.WriteAttributeString("Language", "urdu"); - } - if ((this.languageField == PerformanceCounterLanguageType.uzbek)) - { - writer.WriteAttributeString("Language", "uzbek"); - } - if ((this.languageField == PerformanceCounterLanguageType.vietnamese)) - { - writer.WriteAttributeString("Language", "vietnamese"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Help" == name)) - { - this.helpField = value; - this.helpFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = Enums.ParsePerformanceCounterTypesType(value); - this.typeFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = Enums.ParsePerformanceCounterLanguageType(value); - this.languageFieldSet = true; - } - } - } - - /// - /// Used to install Perfmon counters. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class PerfCounter : ISchemaElement, ISetAttributes - { - - private string nameField; - - private bool nameFieldSet; - - private ISchemaElement parentElement; - - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PerfCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - } - } - - /// - /// Used to install Perfmon Counter Manifests. - /// Note that this functionality cannot be used with major upgrades that are scheduled after the InstallExecute, - /// InstallExecuteAgain, or InstallFinalize actions. For more information on major upgrade scheduling, see - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class PerfCounterManifest : ISchemaElement, ISetAttributes - { - - private string resourceFileDirectoryField; - - private bool resourceFileDirectoryFieldSet; - - private ISchemaElement parentElement; - - /// - /// The directory that holds the resource file of the providers in the perfmon counter manifest. Often the resource file path cannot be determined until setup time. Put the directory here and during perfmon manifest registrtion the path will be updated in the registry. If not specified, Perfmon will look for the resource file in the same directory of the perfmon counter manifest file. - /// - public string ResourceFileDirectory - { - get - { - return this.resourceFileDirectoryField; - } - set - { - this.resourceFileDirectoryFieldSet = true; - this.resourceFileDirectoryField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PerfCounterManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.resourceFileDirectoryFieldSet) - { - writer.WriteAttributeString("ResourceFileDirectory", this.resourceFileDirectoryField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("ResourceFileDirectory" == name)) - { - this.resourceFileDirectoryField = value; - this.resourceFileDirectoryFieldSet = true; - } - } - } - - /// - /// Used to install Event Manifests. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class EventManifest : ISchemaElement, ISetAttributes - { - - private string messageFileField; - - private bool messageFileFieldSet; - - private string parameterFileField; - - private bool parameterFileFieldSet; - - private string resourceFileField; - - private bool resourceFileFieldSet; - - private ISchemaElement parentElement; - - /// - /// The message file (including path) of all the providers in the event manifest. Often the message file path cannot be determined until setup time. Put your MessageFile here and the messageFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. - /// - public string MessageFile - { - get - { - return this.messageFileField; - } - set - { - this.messageFileFieldSet = true; - this.messageFileField = value; - } - } - - /// - /// The parameter file (including path) of all the providers in the event manifest. Often the parameter file path cannot be determined until setup time. Put your ParameterFile here and the parameterFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. - /// - public string ParameterFile - { - get - { - return this.parameterFileField; - } - set - { - this.parameterFileFieldSet = true; - this.parameterFileField = value; - } - } - - /// - /// The resource file (including path) of all the providers in the event manifest. Often the resource file path cannot be determined until setup time. Put your ResourceFile here and the resourceFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. - /// - public string ResourceFile - { - get - { - return this.resourceFileField; - } - set - { - this.resourceFileFieldSet = true; - this.resourceFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("EventManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.messageFileFieldSet) - { - writer.WriteAttributeString("MessageFile", this.messageFileField); - } - if (this.parameterFileFieldSet) - { - writer.WriteAttributeString("ParameterFile", this.parameterFileField); - } - if (this.resourceFileFieldSet) - { - writer.WriteAttributeString("ResourceFile", this.resourceFileField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("MessageFile" == name)) - { - this.messageFileField = value; - this.messageFileFieldSet = true; - } - if (("ParameterFile" == name)) - { - this.parameterFileField = value; - this.parameterFileFieldSet = true; - } - if (("ResourceFile" == name)) - { - this.resourceFileField = value; - this.resourceFileFieldSet = true; - } - } - } - - /// - /// Sets ACLs on File, Registry, CreateFolder, or ServiceInstall. When under a Registry element, this cannot be used - /// if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. - /// The table and key are taken from the parent element. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class PermissionEx : ISchemaElement, ISetAttributes - { - - private string domainField; - - private bool domainFieldSet; - - private string userField; - - private bool userFieldSet; - - private YesNoType readField; - - private bool readFieldSet; - - private YesNoType deleteField; - - private bool deleteFieldSet; - - private YesNoType readPermissionField; - - private bool readPermissionFieldSet; - - private YesNoType changePermissionField; - - private bool changePermissionFieldSet; - - private YesNoType takeOwnershipField; - - private bool takeOwnershipFieldSet; - - private YesNoType readAttributesField; - - private bool readAttributesFieldSet; - - private YesNoType writeAttributesField; - - private bool writeAttributesFieldSet; - - private YesNoType readExtendedAttributesField; - - private bool readExtendedAttributesFieldSet; - - private YesNoType writeExtendedAttributesField; - - private bool writeExtendedAttributesFieldSet; - - private YesNoType synchronizeField; - - private bool synchronizeFieldSet; - - private YesNoType createFileField; - - private bool createFileFieldSet; - - private YesNoType createChildField; - - private bool createChildFieldSet; - - private YesNoType deleteChildField; - - private bool deleteChildFieldSet; - - private YesNoType traverseField; - - private bool traverseFieldSet; - - private YesNoType appendField; - - private bool appendFieldSet; - - private YesNoType executeField; - - private bool executeFieldSet; - - private YesNoType writeField; - - private bool writeFieldSet; - - private YesNoType createSubkeysField; - - private bool createSubkeysFieldSet; - - private YesNoType enumerateSubkeysField; - - private bool enumerateSubkeysFieldSet; - - private YesNoType notifyField; - - private bool notifyFieldSet; - - private YesNoType createLinkField; - - private bool createLinkFieldSet; - - private YesNoType genericAllField; - - private bool genericAllFieldSet; - - private YesNoType genericExecuteField; - - private bool genericExecuteFieldSet; - - private YesNoType genericWriteField; - - private bool genericWriteFieldSet; - - private YesNoType genericReadField; - - private bool genericReadFieldSet; - - private YesNoType serviceQueryConfigField; - - private bool serviceQueryConfigFieldSet; - - private YesNoType serviceChangeConfigField; - - private bool serviceChangeConfigFieldSet; - - private YesNoType serviceQueryStatusField; - - private bool serviceQueryStatusFieldSet; - - private YesNoType serviceEnumerateDependentsField; - - private bool serviceEnumerateDependentsFieldSet; - - private YesNoType serviceStartField; - - private bool serviceStartFieldSet; - - private YesNoType serviceStopField; - - private bool serviceStopFieldSet; - - private YesNoType servicePauseContinueField; - - private bool servicePauseContinueFieldSet; - - private YesNoType serviceInterrogateField; - - private bool serviceInterrogateFieldSet; - - private YesNoType serviceUserDefinedControlField; - - private bool serviceUserDefinedControlFieldSet; - - private ISchemaElement parentElement; - - public string Domain - { - get - { - return this.domainField; - } - set - { - this.domainFieldSet = true; - this.domainField = value; - } - } - - public string User - { - get - { - return this.userField; - } - set - { - this.userFieldSet = true; - this.userField = value; - } - } - - public YesNoType Read - { - get - { - return this.readField; - } - set - { - this.readFieldSet = true; - this.readField = value; - } - } - - public YesNoType Delete - { - get - { - return this.deleteField; - } - set - { - this.deleteFieldSet = true; - this.deleteField = value; - } - } - - public YesNoType ReadPermission - { - get - { - return this.readPermissionField; - } - set - { - this.readPermissionFieldSet = true; - this.readPermissionField = value; - } - } - - public YesNoType ChangePermission - { - get - { - return this.changePermissionField; - } - set - { - this.changePermissionFieldSet = true; - this.changePermissionField = value; - } - } - - public YesNoType TakeOwnership - { - get - { - return this.takeOwnershipField; - } - set - { - this.takeOwnershipFieldSet = true; - this.takeOwnershipField = value; - } - } - - public YesNoType ReadAttributes - { - get - { - return this.readAttributesField; - } - set - { - this.readAttributesFieldSet = true; - this.readAttributesField = value; - } - } - - public YesNoType WriteAttributes - { - get - { - return this.writeAttributesField; - } - set - { - this.writeAttributesFieldSet = true; - this.writeAttributesField = value; - } - } - - public YesNoType ReadExtendedAttributes - { - get - { - return this.readExtendedAttributesField; - } - set - { - this.readExtendedAttributesFieldSet = true; - this.readExtendedAttributesField = value; - } - } - - public YesNoType WriteExtendedAttributes - { - get - { - return this.writeExtendedAttributesField; - } - set - { - this.writeExtendedAttributesFieldSet = true; - this.writeExtendedAttributesField = value; - } - } - - public YesNoType Synchronize - { - get - { - return this.synchronizeField; - } - set - { - this.synchronizeFieldSet = true; - this.synchronizeField = value; - } - } - - /// - /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. - /// - public YesNoType CreateFile - { - get - { - return this.createFileField; - } - set - { - this.createFileFieldSet = true; - this.createFileField = value; - } - } - - /// - /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. - /// - public YesNoType CreateChild - { - get - { - return this.createChildField; - } - set - { - this.createChildFieldSet = true; - this.createChildField = value; - } - } - - /// - /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. - /// - public YesNoType DeleteChild - { - get - { - return this.deleteChildField; - } - set - { - this.deleteChildFieldSet = true; - this.deleteChildField = value; - } - } - - /// - /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. - /// - public YesNoType Traverse - { - get - { - return this.traverseField; - } - set - { - this.traverseFieldSet = true; - this.traverseField = value; - } - } - - public YesNoType Append - { - get - { - return this.appendField; - } - set - { - this.appendFieldSet = true; - this.appendField = value; - } - } - - public YesNoType Execute - { - get - { - return this.executeField; - } - set - { - this.executeFieldSet = true; - this.executeField = value; - } - } - - public YesNoType Write - { - get - { - return this.writeField; - } - set - { - this.writeFieldSet = true; - this.writeField = value; - } - } - - public YesNoType CreateSubkeys - { - get - { - return this.createSubkeysField; - } - set - { - this.createSubkeysFieldSet = true; - this.createSubkeysField = value; - } - } - - public YesNoType EnumerateSubkeys - { - get - { - return this.enumerateSubkeysField; - } - set - { - this.enumerateSubkeysFieldSet = true; - this.enumerateSubkeysField = value; - } - } - - public YesNoType Notify - { - get - { - return this.notifyField; - } - set - { - this.notifyFieldSet = true; - this.notifyField = value; - } - } - - public YesNoType CreateLink - { - get - { - return this.createLinkField; - } - set - { - this.createLinkFieldSet = true; - this.createLinkField = value; - } - } - - public YesNoType GenericAll - { - get - { - return this.genericAllField; - } - set - { - this.genericAllFieldSet = true; - this.genericAllField = value; - } - } - - public YesNoType GenericExecute - { - get - { - return this.genericExecuteField; - } - set - { - this.genericExecuteFieldSet = true; - this.genericExecuteField = value; - } - } - - public YesNoType GenericWrite - { - get - { - return this.genericWriteField; - } - set - { - this.genericWriteFieldSet = true; - this.genericWriteField = value; - } - } - - /// - /// specifying this will fail to grant read access - /// - public YesNoType GenericRead - { - get - { - return this.genericReadField; - } - set - { - this.genericReadFieldSet = true; - this.genericReadField = value; - } - } - - /// - /// Required to call the QueryServiceConfig and QueryServiceConfig2 functions to query the service configuration. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceQueryConfig - { - get - { - return this.serviceQueryConfigField; - } - set - { - this.serviceQueryConfigFieldSet = true; - this.serviceQueryConfigField = value; - } - } - - /// - /// Required to call the ChangeServiceConfig or ChangeServiceConfig2 function to change the service configuration. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceChangeConfig - { - get - { - return this.serviceChangeConfigField; - } - set - { - this.serviceChangeConfigFieldSet = true; - this.serviceChangeConfigField = value; - } - } - - /// - /// Required to call the QueryServiceStatus function to ask the service control manager about the status of the service. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceQueryStatus - { - get - { - return this.serviceQueryStatusField; - } - set - { - this.serviceQueryStatusFieldSet = true; - this.serviceQueryStatusField = value; - } - } - - /// - /// Required to call the EnumDependentServices function to enumerate all the services dependent on the service. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceEnumerateDependents - { - get - { - return this.serviceEnumerateDependentsField; - } - set - { - this.serviceEnumerateDependentsFieldSet = true; - this.serviceEnumerateDependentsField = value; - } - } - - /// - /// Required to call the StartService function to start the service. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceStart - { - get - { - return this.serviceStartField; - } - set - { - this.serviceStartFieldSet = true; - this.serviceStartField = value; - } - } - - /// - /// Required to call the ControlService function to stop the service. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceStop - { - get - { - return this.serviceStopField; - } - set - { - this.serviceStopFieldSet = true; - this.serviceStopField = value; - } - } - - /// - /// Required to call the ControlService function to pause or continue the service. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServicePauseContinue - { - get - { - return this.servicePauseContinueField; - } - set - { - this.servicePauseContinueFieldSet = true; - this.servicePauseContinueField = value; - } - } - - /// - /// Required to call the ControlService function to ask the service to report its status immediately. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceInterrogate - { - get - { - return this.serviceInterrogateField; - } - set - { - this.serviceInterrogateFieldSet = true; - this.serviceInterrogateField = value; - } - } - - /// - /// Required to call the ControlService function to specify a user-defined control code. Only valid under a 'ServiceInstall' parent. - /// - public YesNoType ServiceUserDefinedControl - { - get - { - return this.serviceUserDefinedControlField; - } - set - { - this.serviceUserDefinedControlFieldSet = true; - this.serviceUserDefinedControlField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PermissionEx", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.domainFieldSet) - { - writer.WriteAttributeString("Domain", this.domainField); - } - if (this.userFieldSet) - { - writer.WriteAttributeString("User", this.userField); - } - if (this.readFieldSet) - { - if ((this.readField == YesNoType.no)) - { - writer.WriteAttributeString("Read", "no"); - } - if ((this.readField == YesNoType.yes)) - { - writer.WriteAttributeString("Read", "yes"); - } - } - if (this.deleteFieldSet) - { - if ((this.deleteField == YesNoType.no)) - { - writer.WriteAttributeString("Delete", "no"); - } - if ((this.deleteField == YesNoType.yes)) - { - writer.WriteAttributeString("Delete", "yes"); - } - } - if (this.readPermissionFieldSet) - { - if ((this.readPermissionField == YesNoType.no)) - { - writer.WriteAttributeString("ReadPermission", "no"); - } - if ((this.readPermissionField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadPermission", "yes"); - } - } - if (this.changePermissionFieldSet) - { - if ((this.changePermissionField == YesNoType.no)) - { - writer.WriteAttributeString("ChangePermission", "no"); - } - if ((this.changePermissionField == YesNoType.yes)) - { - writer.WriteAttributeString("ChangePermission", "yes"); - } - } - if (this.takeOwnershipFieldSet) - { - if ((this.takeOwnershipField == YesNoType.no)) - { - writer.WriteAttributeString("TakeOwnership", "no"); - } - if ((this.takeOwnershipField == YesNoType.yes)) - { - writer.WriteAttributeString("TakeOwnership", "yes"); - } - } - if (this.readAttributesFieldSet) - { - if ((this.readAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("ReadAttributes", "no"); - } - if ((this.readAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadAttributes", "yes"); - } - } - if (this.writeAttributesFieldSet) - { - if ((this.writeAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("WriteAttributes", "no"); - } - if ((this.writeAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("WriteAttributes", "yes"); - } - } - if (this.readExtendedAttributesFieldSet) - { - if ((this.readExtendedAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("ReadExtendedAttributes", "no"); - } - if ((this.readExtendedAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadExtendedAttributes", "yes"); - } - } - if (this.writeExtendedAttributesFieldSet) - { - if ((this.writeExtendedAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("WriteExtendedAttributes", "no"); - } - if ((this.writeExtendedAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("WriteExtendedAttributes", "yes"); - } - } - if (this.synchronizeFieldSet) - { - if ((this.synchronizeField == YesNoType.no)) - { - writer.WriteAttributeString("Synchronize", "no"); - } - if ((this.synchronizeField == YesNoType.yes)) - { - writer.WriteAttributeString("Synchronize", "yes"); - } - } - if (this.createFileFieldSet) - { - if ((this.createFileField == YesNoType.no)) - { - writer.WriteAttributeString("CreateFile", "no"); - } - if ((this.createFileField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateFile", "yes"); - } - } - if (this.createChildFieldSet) - { - if ((this.createChildField == YesNoType.no)) - { - writer.WriteAttributeString("CreateChild", "no"); - } - if ((this.createChildField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateChild", "yes"); - } - } - if (this.deleteChildFieldSet) - { - if ((this.deleteChildField == YesNoType.no)) - { - writer.WriteAttributeString("DeleteChild", "no"); - } - if ((this.deleteChildField == YesNoType.yes)) - { - writer.WriteAttributeString("DeleteChild", "yes"); - } - } - if (this.traverseFieldSet) - { - if ((this.traverseField == YesNoType.no)) - { - writer.WriteAttributeString("Traverse", "no"); - } - if ((this.traverseField == YesNoType.yes)) - { - writer.WriteAttributeString("Traverse", "yes"); - } - } - if (this.appendFieldSet) - { - if ((this.appendField == YesNoType.no)) - { - writer.WriteAttributeString("Append", "no"); - } - if ((this.appendField == YesNoType.yes)) - { - writer.WriteAttributeString("Append", "yes"); - } - } - if (this.executeFieldSet) - { - if ((this.executeField == YesNoType.no)) - { - writer.WriteAttributeString("Execute", "no"); - } - if ((this.executeField == YesNoType.yes)) - { - writer.WriteAttributeString("Execute", "yes"); - } - } - if (this.writeFieldSet) - { - if ((this.writeField == YesNoType.no)) - { - writer.WriteAttributeString("Write", "no"); - } - if ((this.writeField == YesNoType.yes)) - { - writer.WriteAttributeString("Write", "yes"); - } - } - if (this.createSubkeysFieldSet) - { - if ((this.createSubkeysField == YesNoType.no)) - { - writer.WriteAttributeString("CreateSubkeys", "no"); - } - if ((this.createSubkeysField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateSubkeys", "yes"); - } - } - if (this.enumerateSubkeysFieldSet) - { - if ((this.enumerateSubkeysField == YesNoType.no)) - { - writer.WriteAttributeString("EnumerateSubkeys", "no"); - } - if ((this.enumerateSubkeysField == YesNoType.yes)) - { - writer.WriteAttributeString("EnumerateSubkeys", "yes"); - } - } - if (this.notifyFieldSet) - { - if ((this.notifyField == YesNoType.no)) - { - writer.WriteAttributeString("Notify", "no"); - } - if ((this.notifyField == YesNoType.yes)) - { - writer.WriteAttributeString("Notify", "yes"); - } - } - if (this.createLinkFieldSet) - { - if ((this.createLinkField == YesNoType.no)) - { - writer.WriteAttributeString("CreateLink", "no"); - } - if ((this.createLinkField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateLink", "yes"); - } - } - if (this.genericAllFieldSet) - { - if ((this.genericAllField == YesNoType.no)) - { - writer.WriteAttributeString("GenericAll", "no"); - } - if ((this.genericAllField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericAll", "yes"); - } - } - if (this.genericExecuteFieldSet) - { - if ((this.genericExecuteField == YesNoType.no)) - { - writer.WriteAttributeString("GenericExecute", "no"); - } - if ((this.genericExecuteField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericExecute", "yes"); - } - } - if (this.genericWriteFieldSet) - { - if ((this.genericWriteField == YesNoType.no)) - { - writer.WriteAttributeString("GenericWrite", "no"); - } - if ((this.genericWriteField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericWrite", "yes"); - } - } - if (this.genericReadFieldSet) - { - if ((this.genericReadField == YesNoType.no)) - { - writer.WriteAttributeString("GenericRead", "no"); - } - if ((this.genericReadField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericRead", "yes"); - } - } - if (this.serviceQueryConfigFieldSet) - { - if ((this.serviceQueryConfigField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceQueryConfig", "no"); - } - if ((this.serviceQueryConfigField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceQueryConfig", "yes"); - } - } - if (this.serviceChangeConfigFieldSet) - { - if ((this.serviceChangeConfigField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceChangeConfig", "no"); - } - if ((this.serviceChangeConfigField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceChangeConfig", "yes"); - } - } - if (this.serviceQueryStatusFieldSet) - { - if ((this.serviceQueryStatusField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceQueryStatus", "no"); - } - if ((this.serviceQueryStatusField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceQueryStatus", "yes"); - } - } - if (this.serviceEnumerateDependentsFieldSet) - { - if ((this.serviceEnumerateDependentsField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceEnumerateDependents", "no"); - } - if ((this.serviceEnumerateDependentsField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceEnumerateDependents", "yes"); - } - } - if (this.serviceStartFieldSet) - { - if ((this.serviceStartField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceStart", "no"); - } - if ((this.serviceStartField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceStart", "yes"); - } - } - if (this.serviceStopFieldSet) - { - if ((this.serviceStopField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceStop", "no"); - } - if ((this.serviceStopField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceStop", "yes"); - } - } - if (this.servicePauseContinueFieldSet) - { - if ((this.servicePauseContinueField == YesNoType.no)) - { - writer.WriteAttributeString("ServicePauseContinue", "no"); - } - if ((this.servicePauseContinueField == YesNoType.yes)) - { - writer.WriteAttributeString("ServicePauseContinue", "yes"); - } - } - if (this.serviceInterrogateFieldSet) - { - if ((this.serviceInterrogateField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceInterrogate", "no"); - } - if ((this.serviceInterrogateField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceInterrogate", "yes"); - } - } - if (this.serviceUserDefinedControlFieldSet) - { - if ((this.serviceUserDefinedControlField == YesNoType.no)) - { - writer.WriteAttributeString("ServiceUserDefinedControl", "no"); - } - if ((this.serviceUserDefinedControlField == YesNoType.yes)) - { - writer.WriteAttributeString("ServiceUserDefinedControl", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Domain" == name)) - { - this.domainField = value; - this.domainFieldSet = true; - } - if (("User" == name)) - { - this.userField = value; - this.userFieldSet = true; - } - if (("Read" == name)) - { - this.readField = Enums.ParseYesNoType(value); - this.readFieldSet = true; - } - if (("Delete" == name)) - { - this.deleteField = Enums.ParseYesNoType(value); - this.deleteFieldSet = true; - } - if (("ReadPermission" == name)) - { - this.readPermissionField = Enums.ParseYesNoType(value); - this.readPermissionFieldSet = true; - } - if (("ChangePermission" == name)) - { - this.changePermissionField = Enums.ParseYesNoType(value); - this.changePermissionFieldSet = true; - } - if (("TakeOwnership" == name)) - { - this.takeOwnershipField = Enums.ParseYesNoType(value); - this.takeOwnershipFieldSet = true; - } - if (("ReadAttributes" == name)) - { - this.readAttributesField = Enums.ParseYesNoType(value); - this.readAttributesFieldSet = true; - } - if (("WriteAttributes" == name)) - { - this.writeAttributesField = Enums.ParseYesNoType(value); - this.writeAttributesFieldSet = true; - } - if (("ReadExtendedAttributes" == name)) - { - this.readExtendedAttributesField = Enums.ParseYesNoType(value); - this.readExtendedAttributesFieldSet = true; - } - if (("WriteExtendedAttributes" == name)) - { - this.writeExtendedAttributesField = Enums.ParseYesNoType(value); - this.writeExtendedAttributesFieldSet = true; - } - if (("Synchronize" == name)) - { - this.synchronizeField = Enums.ParseYesNoType(value); - this.synchronizeFieldSet = true; - } - if (("CreateFile" == name)) - { - this.createFileField = Enums.ParseYesNoType(value); - this.createFileFieldSet = true; - } - if (("CreateChild" == name)) - { - this.createChildField = Enums.ParseYesNoType(value); - this.createChildFieldSet = true; - } - if (("DeleteChild" == name)) - { - this.deleteChildField = Enums.ParseYesNoType(value); - this.deleteChildFieldSet = true; - } - if (("Traverse" == name)) - { - this.traverseField = Enums.ParseYesNoType(value); - this.traverseFieldSet = true; - } - if (("Append" == name)) - { - this.appendField = Enums.ParseYesNoType(value); - this.appendFieldSet = true; - } - if (("Execute" == name)) - { - this.executeField = Enums.ParseYesNoType(value); - this.executeFieldSet = true; - } - if (("Write" == name)) - { - this.writeField = Enums.ParseYesNoType(value); - this.writeFieldSet = true; - } - if (("CreateSubkeys" == name)) - { - this.createSubkeysField = Enums.ParseYesNoType(value); - this.createSubkeysFieldSet = true; - } - if (("EnumerateSubkeys" == name)) - { - this.enumerateSubkeysField = Enums.ParseYesNoType(value); - this.enumerateSubkeysFieldSet = true; - } - if (("Notify" == name)) - { - this.notifyField = Enums.ParseYesNoType(value); - this.notifyFieldSet = true; - } - if (("CreateLink" == name)) - { - this.createLinkField = Enums.ParseYesNoType(value); - this.createLinkFieldSet = true; - } - if (("GenericAll" == name)) - { - this.genericAllField = Enums.ParseYesNoType(value); - this.genericAllFieldSet = true; - } - if (("GenericExecute" == name)) - { - this.genericExecuteField = Enums.ParseYesNoType(value); - this.genericExecuteFieldSet = true; - } - if (("GenericWrite" == name)) - { - this.genericWriteField = Enums.ParseYesNoType(value); - this.genericWriteFieldSet = true; - } - if (("GenericRead" == name)) - { - this.genericReadField = Enums.ParseYesNoType(value); - this.genericReadFieldSet = true; - } - if (("ServiceQueryConfig" == name)) - { - this.serviceQueryConfigField = Enums.ParseYesNoType(value); - this.serviceQueryConfigFieldSet = true; - } - if (("ServiceChangeConfig" == name)) - { - this.serviceChangeConfigField = Enums.ParseYesNoType(value); - this.serviceChangeConfigFieldSet = true; - } - if (("ServiceQueryStatus" == name)) - { - this.serviceQueryStatusField = Enums.ParseYesNoType(value); - this.serviceQueryStatusFieldSet = true; - } - if (("ServiceEnumerateDependents" == name)) - { - this.serviceEnumerateDependentsField = Enums.ParseYesNoType(value); - this.serviceEnumerateDependentsFieldSet = true; - } - if (("ServiceStart" == name)) - { - this.serviceStartField = Enums.ParseYesNoType(value); - this.serviceStartFieldSet = true; - } - if (("ServiceStop" == name)) - { - this.serviceStopField = Enums.ParseYesNoType(value); - this.serviceStopFieldSet = true; - } - if (("ServicePauseContinue" == name)) - { - this.servicePauseContinueField = Enums.ParseYesNoType(value); - this.servicePauseContinueFieldSet = true; - } - if (("ServiceInterrogate" == name)) - { - this.serviceInterrogateField = Enums.ParseYesNoType(value); - this.serviceInterrogateFieldSet = true; - } - if (("ServiceUserDefinedControl" == name)) - { - this.serviceUserDefinedControlField = Enums.ParseYesNoType(value); - this.serviceUserDefinedControlFieldSet = true; - } - } - } - - /// - /// Describes a product search. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class ProductSearch : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string variableField; - - private bool variableFieldSet; - - private string conditionField; - - private bool conditionFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string guidField; - - private bool guidFieldSet; - - private string productCodeField; - - private bool productCodeFieldSet; - - private string upgradeCodeField; - - private bool upgradeCodeFieldSet; - - private ResultType resultField; - - private bool resultFieldSet; - - private ISchemaElement parentElement; - - /// - /// Id of the search for ordering and dependency. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the variable in which to place the result of the search. - /// - public string Variable - { - get - { - return this.variableField; - } - set - { - this.variableFieldSet = true; - this.variableField = value; - } - } - - /// - /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. - /// - public string Condition - { - get - { - return this.conditionField; - } - set - { - this.conditionFieldSet = true; - this.conditionField = value; - } - } - - /// - /// Id of the search that this one should come after. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// The Guid attribute has been deprecated; use the ProductCode or UpgradeCode attribute instead. If this attribute is used, it is assumed to be a ProductCode. - /// - public string Guid - { - get - { - return this.guidField; - } - set - { - this.guidFieldSet = true; - this.guidField = value; - } - } - - /// - /// The ProductCode to use for the search. This attribute must be omitted if UpgradeCode is specified. - /// - public string ProductCode - { - get - { - return this.productCodeField; - } - set - { - this.productCodeFieldSet = true; - this.productCodeField = value; - } - } - - /// - /// The UpgradeCode to use for the search. This attribute must be omitted if ProductCode is specified. Note that if multiple products are found, the highest versioned product will be used for the result. - /// - public string UpgradeCode - { - get - { - return this.upgradeCodeField; - } - set - { - this.upgradeCodeFieldSet = true; - this.upgradeCodeField = value; - } - } - - /// - /// Rather than saving the product version into the variable, a ProductSearch can save another attribute of the matching product instead. - /// - public ResultType Result - { - get - { - return this.resultField; - } - set - { - this.resultFieldSet = true; - this.resultField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ResultType from a string. - /// - public static ResultType ParseResultType(string value) - { - ResultType parsedValue; - ProductSearch.TryParseResultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ResultType from a string. - /// - public static bool TryParseResultType(string value, out ResultType parsedValue) - { - parsedValue = ResultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("version" == value)) - { - parsedValue = ResultType.version; - } - else - { - if (("language" == value)) - { - parsedValue = ResultType.language; - } - else - { - if (("state" == value)) - { - parsedValue = ResultType.state; - } - else - { - if (("assignment" == value)) - { - parsedValue = ResultType.assignment; - } - else - { - parsedValue = ResultType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProductSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.variableFieldSet) - { - writer.WriteAttributeString("Variable", this.variableField); - } - if (this.conditionFieldSet) - { - writer.WriteAttributeString("Condition", this.conditionField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.guidFieldSet) - { - writer.WriteAttributeString("Guid", this.guidField); - } - if (this.productCodeFieldSet) - { - writer.WriteAttributeString("ProductCode", this.productCodeField); - } - if (this.upgradeCodeFieldSet) - { - writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); - } - if (this.resultFieldSet) - { - if ((this.resultField == ResultType.version)) - { - writer.WriteAttributeString("Result", "version"); - } - if ((this.resultField == ResultType.language)) - { - writer.WriteAttributeString("Result", "language"); - } - if ((this.resultField == ResultType.state)) - { - writer.WriteAttributeString("Result", "state"); - } - if ((this.resultField == ResultType.assignment)) - { - writer.WriteAttributeString("Result", "assignment"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Variable" == name)) - { - this.variableField = value; - this.variableFieldSet = true; - } - if (("Condition" == name)) - { - this.conditionField = value; - this.conditionFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Guid" == name)) - { - this.guidField = value; - this.guidFieldSet = true; - } - if (("ProductCode" == name)) - { - this.productCodeField = value; - this.productCodeFieldSet = true; - } - if (("UpgradeCode" == name)) - { - this.upgradeCodeField = value; - this.upgradeCodeFieldSet = true; - } - if (("Result" == name)) - { - this.resultField = ProductSearch.ParseResultType(value); - this.resultFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ResultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Saves the version of a matching product if found; 0.0.0.0 otherwise. This is the default. - /// - version, - - /// - /// Saves the language of a matching product if found; empty otherwise. - /// - language, - - /// - /// Saves the state of the product: advertised (1), absent (2), or locally installed (5). - /// - state, - - /// - /// Saves the assignment type of the product: per-user (0), or per-machine (1). - /// - assignment, - } - } - - /// - /// References a ProductSearch. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class ProductSearchRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProductSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Remove a folder and all contained files and folders if the parent component is selected for installation or removal. - /// The folder must be specified in the Property attribute as the name of a property that will have a value that resolves - /// to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. - /// For more details, see the Remarks. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class RemoveFolderEx : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private OnType onField; - - private bool onFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary key used to identify this particular entry. If this is not specified, a stable identifier - /// will be generated at compile time based on the other attributes. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The id of a property that resolves to the full path of the source directory. The property does not have - /// to exist in the installer database at creation time; it could be created at installation time by a custom - /// action, on the command line, etc. The property value can contain environment variables surrounded by - /// percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before - /// being evaluated for a full path. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// This value determines when the folder may be removed. - /// - public OnType On - { - get - { - return this.onField; - } - set - { - this.onFieldSet = true; - this.onField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a OnType from a string. - /// - public static OnType ParseOnType(string value) - { - OnType parsedValue; - RemoveFolderEx.TryParseOnType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a OnType from a string. - /// - public static bool TryParseOnType(string value, out OnType parsedValue) - { - parsedValue = OnType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("install" == value)) - { - parsedValue = OnType.install; - } - else - { - if (("uninstall" == value)) - { - parsedValue = OnType.uninstall; - } - else - { - if (("both" == value)) - { - parsedValue = OnType.both; - } - else - { - parsedValue = OnType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveFolderEx", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.onFieldSet) - { - if ((this.onField == OnType.install)) - { - writer.WriteAttributeString("On", "install"); - } - if ((this.onField == OnType.uninstall)) - { - writer.WriteAttributeString("On", "uninstall"); - } - if ((this.onField == OnType.both)) - { - writer.WriteAttributeString("On", "both"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("On" == name)) - { - this.onField = RemoveFolderEx.ParseOnType(value); - this.onFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum OnType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Removes the folder only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource). - /// - install, - - /// - /// Default: Removes the folder only when the parent component is being removed (msiInstallStateAbsent). - /// - uninstall, - - /// - /// Removes the folder when the parent component is being installed or removed. - /// - both, - } - } - - /// - /// Registers a resource with the Restart Manager. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class RestartResource : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private string processNameField; - - private bool processNameFieldSet; - - private string serviceNameField; - - private bool serviceNameFieldSet; - - private ISchemaElement parentElement; - - /// - /// The unique identifier for this resource. A unique identifier will - /// be generated automatically if not specified. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The full path to the process module to register with the Restart Manager. - /// This can be a formatted value that resolves to a full path. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - /// - /// The name of a process to register with the Restart Manager. - /// This can be a formatted value that resolves to a process name. - /// - public string ProcessName - { - get - { - return this.processNameField; - } - set - { - this.processNameFieldSet = true; - this.processNameField = value; - } - } - - /// - /// The name of a Windows service to register with the Restart Manager. - /// This can be a formatted value that resolves to a service name. - /// - public string ServiceName - { - get - { - return this.serviceNameField; - } - set - { - this.serviceNameFieldSet = true; - this.serviceNameField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RestartResource", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - if (this.processNameFieldSet) - { - writer.WriteAttributeString("ProcessName", this.processNameField); - } - if (this.serviceNameFieldSet) - { - writer.WriteAttributeString("ServiceName", this.serviceNameField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - if (("ProcessName" == name)) - { - this.processNameField = value; - this.processNameFieldSet = true; - } - if (("ServiceName" == name)) - { - this.serviceNameField = value; - this.serviceNameFieldSet = true; - } - } - } - - /// - /// Describes a registry search. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class RegistrySearch : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string variableField; - - private bool variableFieldSet; - - private string conditionField; - - private bool conditionFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private RootType rootField; - - private bool rootFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private FormatType formatField; - - private bool formatFieldSet; - - private YesNoType expandEnvironmentVariablesField; - - private bool expandEnvironmentVariablesFieldSet; - - private ResultType resultField; - - private bool resultFieldSet; - - private YesNoType win64Field; - - private bool win64FieldSet; - - private ISchemaElement parentElement; - - /// - /// Id of the search for ordering and dependency. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the variable in which to place the result of the search. - /// - public string Variable - { - get - { - return this.variableField; - } - set - { - this.variableFieldSet = true; - this.variableField = value; - } - } - - /// - /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. - /// - public string Condition - { - get - { - return this.conditionField; - } - set - { - this.conditionFieldSet = true; - this.conditionField = value; - } - } - - /// - /// Id of the search that this one should come after. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// Registry root hive to search under. - /// - public RootType Root - { - get - { - return this.rootField; - } - set - { - this.rootFieldSet = true; - this.rootField = value; - } - } - - /// - /// Key to search for. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// Optional value to search for under the given Key. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// What format to return the value in. - /// - public FormatType Format - { - get - { - return this.formatField; - } - set - { - this.formatFieldSet = true; - this.formatField = value; - } - } - - /// - /// Whether to expand any environment variables in REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ values. - /// - public YesNoType ExpandEnvironmentVariables - { - get - { - return this.expandEnvironmentVariablesField; - } - set - { - this.expandEnvironmentVariablesFieldSet = true; - this.expandEnvironmentVariablesField = value; - } - } - - /// - /// Rather than saving the matching registry value into the variable, a RegistrySearch can save an attribute of the matching entry instead. - /// - public ResultType Result - { - get - { - return this.resultField; - } - set - { - this.resultFieldSet = true; - this.resultField = value; - } - } - - /// - /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. The default value is 'no'. - /// - public YesNoType Win64 - { - get - { - return this.win64Field; - } - set - { - this.win64FieldSet = true; - this.win64Field = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a RootType from a string. - /// - public static RootType ParseRootType(string value) - { - RootType parsedValue; - RegistrySearch.TryParseRootType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a RootType from a string. - /// - public static bool TryParseRootType(string value, out RootType parsedValue) - { - parsedValue = RootType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("HKLM" == value)) - { - parsedValue = RootType.HKLM; - } - else - { - if (("HKCU" == value)) - { - parsedValue = RootType.HKCU; - } - else - { - if (("HKCR" == value)) - { - parsedValue = RootType.HKCR; - } - else - { - if (("HKU" == value)) - { - parsedValue = RootType.HKU; - } - else - { - parsedValue = RootType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a FormatType from a string. - /// - public static FormatType ParseFormatType(string value) - { - FormatType parsedValue; - RegistrySearch.TryParseFormatType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a FormatType from a string. - /// - public static bool TryParseFormatType(string value, out FormatType parsedValue) - { - parsedValue = FormatType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("raw" == value)) - { - parsedValue = FormatType.raw; - } - else - { - if (("compatible" == value)) - { - parsedValue = FormatType.compatible; - } - else - { - parsedValue = FormatType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a ResultType from a string. - /// - public static ResultType ParseResultType(string value) - { - ResultType parsedValue; - RegistrySearch.TryParseResultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ResultType from a string. - /// - public static bool TryParseResultType(string value, out ResultType parsedValue) - { - parsedValue = ResultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("exists" == value)) - { - parsedValue = ResultType.exists; - } - else - { - if (("value" == value)) - { - parsedValue = ResultType.value; - } - else - { - parsedValue = ResultType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegistrySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.variableFieldSet) - { - writer.WriteAttributeString("Variable", this.variableField); - } - if (this.conditionFieldSet) - { - writer.WriteAttributeString("Condition", this.conditionField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.rootFieldSet) - { - if ((this.rootField == RootType.HKLM)) - { - writer.WriteAttributeString("Root", "HKLM"); - } - if ((this.rootField == RootType.HKCU)) - { - writer.WriteAttributeString("Root", "HKCU"); - } - if ((this.rootField == RootType.HKCR)) - { - writer.WriteAttributeString("Root", "HKCR"); - } - if ((this.rootField == RootType.HKU)) - { - writer.WriteAttributeString("Root", "HKU"); - } - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.formatFieldSet) - { - if ((this.formatField == FormatType.raw)) - { - writer.WriteAttributeString("Format", "raw"); - } - if ((this.formatField == FormatType.compatible)) - { - writer.WriteAttributeString("Format", "compatible"); - } - } - if (this.expandEnvironmentVariablesFieldSet) - { - if ((this.expandEnvironmentVariablesField == YesNoType.no)) - { - writer.WriteAttributeString("ExpandEnvironmentVariables", "no"); - } - if ((this.expandEnvironmentVariablesField == YesNoType.yes)) - { - writer.WriteAttributeString("ExpandEnvironmentVariables", "yes"); - } - } - if (this.resultFieldSet) - { - if ((this.resultField == ResultType.exists)) - { - writer.WriteAttributeString("Result", "exists"); - } - if ((this.resultField == ResultType.value)) - { - writer.WriteAttributeString("Result", "value"); - } - } - if (this.win64FieldSet) - { - if ((this.win64Field == YesNoType.no)) - { - writer.WriteAttributeString("Win64", "no"); - } - if ((this.win64Field == YesNoType.yes)) - { - writer.WriteAttributeString("Win64", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Variable" == name)) - { - this.variableField = value; - this.variableFieldSet = true; - } - if (("Condition" == name)) - { - this.conditionField = value; - this.conditionFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Root" == name)) - { - this.rootField = RegistrySearch.ParseRootType(value); - this.rootFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Format" == name)) - { - this.formatField = RegistrySearch.ParseFormatType(value); - this.formatFieldSet = true; - } - if (("ExpandEnvironmentVariables" == name)) - { - this.expandEnvironmentVariablesField = Enums.ParseYesNoType(value); - this.expandEnvironmentVariablesFieldSet = true; - } - if (("Result" == name)) - { - this.resultField = RegistrySearch.ParseResultType(value); - this.resultFieldSet = true; - } - if (("Win64" == name)) - { - this.win64Field = Enums.ParseYesNoType(value); - this.win64FieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum RootType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// HKEY_LOCAL_MACHINE - /// - HKLM, - - /// - /// HKEY_CURRENT_USER - /// - HKCU, - - /// - /// HKEY_CLASSES_ROOT - /// - HKCR, - - /// - /// HKEY_USERS - /// - HKU, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum FormatType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Returns the unformatted value directly from the registry. For example, a REG_DWORD value of '1' is returned as '1', not '#1'. - /// - raw, - - /// - /// Returns the value formatted as Windows Installer would. For example, a REG_DWORD value of '1' is returned as '#1', not '1'. - /// - compatible, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ResultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Saves true if a matching registry entry is found; false otherwise. - /// - exists, - - /// - /// Saves the value of the registry key in the variable. This is the default. - /// - value, - } - } - - /// - /// References a RegistrySearch. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class RegistrySearchRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegistrySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Service configuration information for failure actions. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class ServiceConfig : ISchemaElement, ISetAttributes - { - - private string serviceNameField; - - private bool serviceNameFieldSet; - - private FirstFailureActionTypeType firstFailureActionTypeField; - - private bool firstFailureActionTypeFieldSet; - - private SecondFailureActionTypeType secondFailureActionTypeField; - - private bool secondFailureActionTypeFieldSet; - - private ThirdFailureActionTypeType thirdFailureActionTypeField; - - private bool thirdFailureActionTypeFieldSet; - - private int resetPeriodInDaysField; - - private bool resetPeriodInDaysFieldSet; - - private int restartServiceDelayInSecondsField; - - private bool restartServiceDelayInSecondsFieldSet; - - private string programCommandLineField; - - private bool programCommandLineFieldSet; - - private string rebootMessageField; - - private bool rebootMessageFieldSet; - - private ISchemaElement parentElement; - - /// - /// Required if not under a ServiceInstall element. - /// - public string ServiceName - { - get - { - return this.serviceNameField; - } - set - { - this.serviceNameFieldSet = true; - this.serviceNameField = value; - } - } - - /// - /// Action to take on the first failure of the service. - /// - public FirstFailureActionTypeType FirstFailureActionType - { - get - { - return this.firstFailureActionTypeField; - } - set - { - this.firstFailureActionTypeFieldSet = true; - this.firstFailureActionTypeField = value; - } - } - - /// - /// Action to take on the second failure of the service. - /// - public SecondFailureActionTypeType SecondFailureActionType - { - get - { - return this.secondFailureActionTypeField; - } - set - { - this.secondFailureActionTypeFieldSet = true; - this.secondFailureActionTypeField = value; - } - } - - /// - /// Action to take on the third failure of the service. - /// - public ThirdFailureActionTypeType ThirdFailureActionType - { - get - { - return this.thirdFailureActionTypeField; - } - set - { - this.thirdFailureActionTypeFieldSet = true; - this.thirdFailureActionTypeField = value; - } - } - - /// - /// Number of days after which to reset the failure count to zero if there are no failures. - /// - public int ResetPeriodInDays - { - get - { - return this.resetPeriodInDaysField; - } - set - { - this.resetPeriodInDaysFieldSet = true; - this.resetPeriodInDaysField = value; - } - } - - /// - /// If any of the three *ActionType attributes is "restart", this specifies the number of seconds to wait before doing so. - /// - public int RestartServiceDelayInSeconds - { - get - { - return this.restartServiceDelayInSecondsField; - } - set - { - this.restartServiceDelayInSecondsFieldSet = true; - this.restartServiceDelayInSecondsField = value; - } - } - - /// - /// If any of the three *ActionType attributes is "runCommand", this specifies the command to run when doing so. This value is formatted. - /// - public string ProgramCommandLine - { - get - { - return this.programCommandLineField; - } - set - { - this.programCommandLineFieldSet = true; - this.programCommandLineField = value; - } - } - - /// - /// If any of the three *ActionType attributes is "reboot", this specifies the message to broadcast to server users before doing so. - /// - public string RebootMessage - { - get - { - return this.rebootMessageField; - } - set - { - this.rebootMessageFieldSet = true; - this.rebootMessageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a FirstFailureActionTypeType from a string. - /// - public static FirstFailureActionTypeType ParseFirstFailureActionTypeType(string value) - { - FirstFailureActionTypeType parsedValue; - ServiceConfig.TryParseFirstFailureActionTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a FirstFailureActionTypeType from a string. - /// - public static bool TryParseFirstFailureActionTypeType(string value, out FirstFailureActionTypeType parsedValue) - { - parsedValue = FirstFailureActionTypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("none" == value)) - { - parsedValue = FirstFailureActionTypeType.none; - } - else - { - if (("reboot" == value)) - { - parsedValue = FirstFailureActionTypeType.reboot; - } - else - { - if (("restart" == value)) - { - parsedValue = FirstFailureActionTypeType.restart; - } - else - { - if (("runCommand" == value)) - { - parsedValue = FirstFailureActionTypeType.runCommand; - } - else - { - parsedValue = FirstFailureActionTypeType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a SecondFailureActionTypeType from a string. - /// - public static SecondFailureActionTypeType ParseSecondFailureActionTypeType(string value) - { - SecondFailureActionTypeType parsedValue; - ServiceConfig.TryParseSecondFailureActionTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a SecondFailureActionTypeType from a string. - /// - public static bool TryParseSecondFailureActionTypeType(string value, out SecondFailureActionTypeType parsedValue) - { - parsedValue = SecondFailureActionTypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("none" == value)) - { - parsedValue = SecondFailureActionTypeType.none; - } - else - { - if (("reboot" == value)) - { - parsedValue = SecondFailureActionTypeType.reboot; - } - else - { - if (("restart" == value)) - { - parsedValue = SecondFailureActionTypeType.restart; - } - else - { - if (("runCommand" == value)) - { - parsedValue = SecondFailureActionTypeType.runCommand; - } - else - { - parsedValue = SecondFailureActionTypeType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a ThirdFailureActionTypeType from a string. - /// - public static ThirdFailureActionTypeType ParseThirdFailureActionTypeType(string value) - { - ThirdFailureActionTypeType parsedValue; - ServiceConfig.TryParseThirdFailureActionTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ThirdFailureActionTypeType from a string. - /// - public static bool TryParseThirdFailureActionTypeType(string value, out ThirdFailureActionTypeType parsedValue) - { - parsedValue = ThirdFailureActionTypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("none" == value)) - { - parsedValue = ThirdFailureActionTypeType.none; - } - else - { - if (("reboot" == value)) - { - parsedValue = ThirdFailureActionTypeType.reboot; - } - else - { - if (("restart" == value)) - { - parsedValue = ThirdFailureActionTypeType.restart; - } - else - { - if (("runCommand" == value)) - { - parsedValue = ThirdFailureActionTypeType.runCommand; - } - else - { - parsedValue = ThirdFailureActionTypeType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ServiceConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.serviceNameFieldSet) - { - writer.WriteAttributeString("ServiceName", this.serviceNameField); - } - if (this.firstFailureActionTypeFieldSet) - { - if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.none)) - { - writer.WriteAttributeString("FirstFailureActionType", "none"); - } - if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.reboot)) - { - writer.WriteAttributeString("FirstFailureActionType", "reboot"); - } - if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.restart)) - { - writer.WriteAttributeString("FirstFailureActionType", "restart"); - } - if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.runCommand)) - { - writer.WriteAttributeString("FirstFailureActionType", "runCommand"); - } - } - if (this.secondFailureActionTypeFieldSet) - { - if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.none)) - { - writer.WriteAttributeString("SecondFailureActionType", "none"); - } - if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.reboot)) - { - writer.WriteAttributeString("SecondFailureActionType", "reboot"); - } - if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.restart)) - { - writer.WriteAttributeString("SecondFailureActionType", "restart"); - } - if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.runCommand)) - { - writer.WriteAttributeString("SecondFailureActionType", "runCommand"); - } - } - if (this.thirdFailureActionTypeFieldSet) - { - if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.none)) - { - writer.WriteAttributeString("ThirdFailureActionType", "none"); - } - if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.reboot)) - { - writer.WriteAttributeString("ThirdFailureActionType", "reboot"); - } - if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.restart)) - { - writer.WriteAttributeString("ThirdFailureActionType", "restart"); - } - if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.runCommand)) - { - writer.WriteAttributeString("ThirdFailureActionType", "runCommand"); - } - } - if (this.resetPeriodInDaysFieldSet) - { - writer.WriteAttributeString("ResetPeriodInDays", this.resetPeriodInDaysField.ToString(CultureInfo.InvariantCulture)); - } - if (this.restartServiceDelayInSecondsFieldSet) - { - writer.WriteAttributeString("RestartServiceDelayInSeconds", this.restartServiceDelayInSecondsField.ToString(CultureInfo.InvariantCulture)); - } - if (this.programCommandLineFieldSet) - { - writer.WriteAttributeString("ProgramCommandLine", this.programCommandLineField); - } - if (this.rebootMessageFieldSet) - { - writer.WriteAttributeString("RebootMessage", this.rebootMessageField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("ServiceName" == name)) - { - this.serviceNameField = value; - this.serviceNameFieldSet = true; - } - if (("FirstFailureActionType" == name)) - { - this.firstFailureActionTypeField = ServiceConfig.ParseFirstFailureActionTypeType(value); - this.firstFailureActionTypeFieldSet = true; - } - if (("SecondFailureActionType" == name)) - { - this.secondFailureActionTypeField = ServiceConfig.ParseSecondFailureActionTypeType(value); - this.secondFailureActionTypeFieldSet = true; - } - if (("ThirdFailureActionType" == name)) - { - this.thirdFailureActionTypeField = ServiceConfig.ParseThirdFailureActionTypeType(value); - this.thirdFailureActionTypeFieldSet = true; - } - if (("ResetPeriodInDays" == name)) - { - this.resetPeriodInDaysField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.resetPeriodInDaysFieldSet = true; - } - if (("RestartServiceDelayInSeconds" == name)) - { - this.restartServiceDelayInSecondsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.restartServiceDelayInSecondsFieldSet = true; - } - if (("ProgramCommandLine" == name)) - { - this.programCommandLineField = value; - this.programCommandLineFieldSet = true; - } - if (("RebootMessage" == name)) - { - this.rebootMessageField = value; - this.rebootMessageFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum FirstFailureActionTypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - none, - - reboot, - - restart, - - runCommand, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum SecondFailureActionTypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - none, - - reboot, - - restart, - - runCommand, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ThirdFailureActionTypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - none, - - reboot, - - restart, - - runCommand, - } - } - - /// - /// Updates the last modified date/time of a file. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class TouchFile : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private YesNoType onInstallField; - - private bool onInstallFieldSet; - - private YesNoType onReinstallField; - - private bool onReinstallFieldSet; - - private YesNoType onUninstallField; - - private bool onUninstallFieldSet; - - private YesNoType nonvitalField; - - private bool nonvitalFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for the touch file operation. If the identifier is not specified it will be generated. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Path of the file to update. This value is formatted. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - /// - /// Specifies whether or not the modified time of the file should be updated on install. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. - /// - public YesNoType OnInstall - { - get - { - return this.onInstallField; - } - set - { - this.onInstallFieldSet = true; - this.onInstallField = value; - } - } - - /// - /// Specifies whether or not the modified time of the file should be updated on reinstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. - /// - public YesNoType OnReinstall - { - get - { - return this.onReinstallField; - } - set - { - this.onReinstallFieldSet = true; - this.onReinstallField = value; - } - } - - /// - /// Specifies whether or not the modified time of the file should be updated on uninstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'no'. - /// - public YesNoType OnUninstall - { - get - { - return this.onUninstallField; - } - set - { - this.onUninstallFieldSet = true; - this.onUninstallField = value; - } - } - - /// - /// Indicates the installation will succeed even if the modified time of the file cannot be updated. The default is 'no'. - /// - public YesNoType Nonvital - { - get - { - return this.nonvitalField; - } - set - { - this.nonvitalFieldSet = true; - this.nonvitalField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("TouchFile", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - if (this.onInstallFieldSet) - { - if ((this.onInstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnInstall", "no"); - } - if ((this.onInstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnInstall", "yes"); - } - } - if (this.onReinstallFieldSet) - { - if ((this.onReinstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnReinstall", "no"); - } - if ((this.onReinstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnReinstall", "yes"); - } - } - if (this.onUninstallFieldSet) - { - if ((this.onUninstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnUninstall", "no"); - } - if ((this.onUninstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnUninstall", "yes"); - } - } - if (this.nonvitalFieldSet) - { - if ((this.nonvitalField == YesNoType.no)) - { - writer.WriteAttributeString("Nonvital", "no"); - } - if ((this.nonvitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Nonvital", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - if (("OnInstall" == name)) - { - this.onInstallField = Enums.ParseYesNoType(value); - this.onInstallFieldSet = true; - } - if (("OnReinstall" == name)) - { - this.onReinstallField = Enums.ParseYesNoType(value); - this.onReinstallFieldSet = true; - } - if (("OnUninstall" == name)) - { - this.onUninstallField = Enums.ParseYesNoType(value); - this.onUninstallFieldSet = true; - } - if (("Nonvital" == name)) - { - this.nonvitalField = Enums.ParseYesNoType(value); - this.nonvitalFieldSet = true; - } - } - } - - /// - /// User for all kinds of things. When it is not nested under a component it is included in the MSI so it can be referenced by other elements such as the User attribute in the AppPool element. When it is nested under a Component element, the User will be created on install and can also be used for reference. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class User : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string domainField; - - private bool domainFieldSet; - - private string passwordField; - - private bool passwordFieldSet; - - private YesNoType passwordNeverExpiresField; - - private bool passwordNeverExpiresFieldSet; - - private YesNoType canNotChangePasswordField; - - private bool canNotChangePasswordFieldSet; - - private YesNoType removeOnUninstallField; - - private bool removeOnUninstallFieldSet; - - private YesNoType failIfExistsField; - - private bool failIfExistsFieldSet; - - private YesNoType logonAsServiceField; - - private bool logonAsServiceFieldSet; - - private YesNoType logonAsBatchJobField; - - private bool logonAsBatchJobFieldSet; - - private YesNoType updateIfExistsField; - - private bool updateIfExistsFieldSet; - - private YesNoType passwordExpiredField; - - private bool passwordExpiredFieldSet; - - private YesNoType disabledField; - - private bool disabledFieldSet; - - private YesNoType createUserField; - - private bool createUserFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private ISchemaElement parentElement; - - public User() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(GroupRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// A - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// A - /// - public string Domain - { - get - { - return this.domainField; - } - set - { - this.domainFieldSet = true; - this.domainField = value; - } - } - - /// - /// Usually a Property that is passed in on the command-line to keep it more secure. - /// - public string Password - { - get - { - return this.passwordField; - } - set - { - this.passwordFieldSet = true; - this.passwordField = value; - } - } - - /// - /// The account's password never expires. Equivalent to UF_DONT_EXPIRE_PASSWD. - /// - public YesNoType PasswordNeverExpires - { - get - { - return this.passwordNeverExpiresField; - } - set - { - this.passwordNeverExpiresFieldSet = true; - this.passwordNeverExpiresField = value; - } - } - - /// - /// The user cannot change the account's password. Equivalent to UF_PASSWD_CANT_CHANGE. - /// - public YesNoType CanNotChangePassword - { - get - { - return this.canNotChangePasswordField; - } - set - { - this.canNotChangePasswordFieldSet = true; - this.canNotChangePasswordField = value; - } - } - - /// - /// Indicates whether the user account should be removed or left behind on uninstall. - /// - public YesNoType RemoveOnUninstall - { - get - { - return this.removeOnUninstallField; - } - set - { - this.removeOnUninstallFieldSet = true; - this.removeOnUninstallField = value; - } - } - - /// - /// Indicates if the install should fail if the user already exists. - /// - public YesNoType FailIfExists - { - get - { - return this.failIfExistsField; - } - set - { - this.failIfExistsFieldSet = true; - this.failIfExistsField = value; - } - } - - /// - /// Indicates whether or not the user can logon as a serivce. User creation can be skipped if all that is desired is to set this access right on the user. - /// - public YesNoType LogonAsService - { - get - { - return this.logonAsServiceField; - } - set - { - this.logonAsServiceFieldSet = true; - this.logonAsServiceField = value; - } - } - - /// - /// Indicates whether or not the user can logon as a batch job. User creation can be skipped if all that is desired is to set this access right on the user. - /// - public YesNoType LogonAsBatchJob - { - get - { - return this.logonAsBatchJobField; - } - set - { - this.logonAsBatchJobFieldSet = true; - this.logonAsBatchJobField = value; - } - } - - /// - /// Indicates if the user account properties should be updated if the user already exists. - /// - public YesNoType UpdateIfExists - { - get - { - return this.updateIfExistsField; - } - set - { - this.updateIfExistsFieldSet = true; - this.updateIfExistsField = value; - } - } - - /// - /// Indicates whether the user must change their password on their first login. - /// - public YesNoType PasswordExpired - { - get - { - return this.passwordExpiredField; - } - set - { - this.passwordExpiredFieldSet = true; - this.passwordExpiredField = value; - } - } - - /// - /// The account is disabled. Equivalent to UF_ACCOUNTDISABLE. - /// - public YesNoType Disabled - { - get - { - return this.disabledField; - } - set - { - this.disabledFieldSet = true; - this.disabledField = value; - } - } - - /// - /// Indicates whether or not to create the user. User creation can be skipped if all that is desired is to join a user to groups. - /// - public YesNoType CreateUser - { - get - { - return this.createUserField; - } - set - { - this.createUserFieldSet = true; - this.createUserField = value; - } - } - - /// - /// Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes". - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("GroupRef" == childName)) - { - childValue = new GroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("User", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.domainFieldSet) - { - writer.WriteAttributeString("Domain", this.domainField); - } - if (this.passwordFieldSet) - { - writer.WriteAttributeString("Password", this.passwordField); - } - if (this.passwordNeverExpiresFieldSet) - { - if ((this.passwordNeverExpiresField == YesNoType.no)) - { - writer.WriteAttributeString("PasswordNeverExpires", "no"); - } - if ((this.passwordNeverExpiresField == YesNoType.yes)) - { - writer.WriteAttributeString("PasswordNeverExpires", "yes"); - } - } - if (this.canNotChangePasswordFieldSet) - { - if ((this.canNotChangePasswordField == YesNoType.no)) - { - writer.WriteAttributeString("CanNotChangePassword", "no"); - } - if ((this.canNotChangePasswordField == YesNoType.yes)) - { - writer.WriteAttributeString("CanNotChangePassword", "yes"); - } - } - if (this.removeOnUninstallFieldSet) - { - if ((this.removeOnUninstallField == YesNoType.no)) - { - writer.WriteAttributeString("RemoveOnUninstall", "no"); - } - if ((this.removeOnUninstallField == YesNoType.yes)) - { - writer.WriteAttributeString("RemoveOnUninstall", "yes"); - } - } - if (this.failIfExistsFieldSet) - { - if ((this.failIfExistsField == YesNoType.no)) - { - writer.WriteAttributeString("FailIfExists", "no"); - } - if ((this.failIfExistsField == YesNoType.yes)) - { - writer.WriteAttributeString("FailIfExists", "yes"); - } - } - if (this.logonAsServiceFieldSet) - { - if ((this.logonAsServiceField == YesNoType.no)) - { - writer.WriteAttributeString("LogonAsService", "no"); - } - if ((this.logonAsServiceField == YesNoType.yes)) - { - writer.WriteAttributeString("LogonAsService", "yes"); - } - } - if (this.logonAsBatchJobFieldSet) - { - if ((this.logonAsBatchJobField == YesNoType.no)) - { - writer.WriteAttributeString("LogonAsBatchJob", "no"); - } - if ((this.logonAsBatchJobField == YesNoType.yes)) - { - writer.WriteAttributeString("LogonAsBatchJob", "yes"); - } - } - if (this.updateIfExistsFieldSet) - { - if ((this.updateIfExistsField == YesNoType.no)) - { - writer.WriteAttributeString("UpdateIfExists", "no"); - } - if ((this.updateIfExistsField == YesNoType.yes)) - { - writer.WriteAttributeString("UpdateIfExists", "yes"); - } - } - if (this.passwordExpiredFieldSet) - { - if ((this.passwordExpiredField == YesNoType.no)) - { - writer.WriteAttributeString("PasswordExpired", "no"); - } - if ((this.passwordExpiredField == YesNoType.yes)) - { - writer.WriteAttributeString("PasswordExpired", "yes"); - } - } - if (this.disabledFieldSet) - { - if ((this.disabledField == YesNoType.no)) - { - writer.WriteAttributeString("Disabled", "no"); - } - if ((this.disabledField == YesNoType.yes)) - { - writer.WriteAttributeString("Disabled", "yes"); - } - } - if (this.createUserFieldSet) - { - if ((this.createUserField == YesNoType.no)) - { - writer.WriteAttributeString("CreateUser", "no"); - } - if ((this.createUserField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateUser", "yes"); - } - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Domain" == name)) - { - this.domainField = value; - this.domainFieldSet = true; - } - if (("Password" == name)) - { - this.passwordField = value; - this.passwordFieldSet = true; - } - if (("PasswordNeverExpires" == name)) - { - this.passwordNeverExpiresField = Enums.ParseYesNoType(value); - this.passwordNeverExpiresFieldSet = true; - } - if (("CanNotChangePassword" == name)) - { - this.canNotChangePasswordField = Enums.ParseYesNoType(value); - this.canNotChangePasswordFieldSet = true; - } - if (("RemoveOnUninstall" == name)) - { - this.removeOnUninstallField = Enums.ParseYesNoType(value); - this.removeOnUninstallFieldSet = true; - } - if (("FailIfExists" == name)) - { - this.failIfExistsField = Enums.ParseYesNoType(value); - this.failIfExistsFieldSet = true; - } - if (("LogonAsService" == name)) - { - this.logonAsServiceField = Enums.ParseYesNoType(value); - this.logonAsServiceFieldSet = true; - } - if (("LogonAsBatchJob" == name)) - { - this.logonAsBatchJobField = Enums.ParseYesNoType(value); - this.logonAsBatchJobFieldSet = true; - } - if (("UpdateIfExists" == name)) - { - this.updateIfExistsField = Enums.ParseYesNoType(value); - this.updateIfExistsFieldSet = true; - } - if (("PasswordExpired" == name)) - { - this.passwordExpiredField = Enums.ParseYesNoType(value); - this.passwordExpiredFieldSet = true; - } - if (("Disabled" == name)) - { - this.disabledField = Enums.ParseYesNoType(value); - this.disabledFieldSet = true; - } - if (("CreateUser" == name)) - { - this.createUserField = Enums.ParseYesNoType(value); - this.createUserFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - } - } - - /// - /// Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class XmlFile : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string elementPathField; - - private bool elementPathFieldSet; - - private string fileField; - - private bool fileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private YesNoType preserveModifiedDateField; - - private bool preserveModifiedDateFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private SelectionLanguageType selectionLanguageField; - - private bool selectionLanguageFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for xml file modification. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. - /// - public string ElementPath - { - get - { - return this.elementPathField; - } - set - { - this.elementPathFieldSet = true; - this.elementPathField = value; - } - } - - /// - /// Path of the .xml file to configure. - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The value to be written. See the - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// The type of modification to be made to the XML file when the component is installed. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// Specifies whether or not the modification should be removed on uninstall. This has no effect on uninstall if the action was deleteValue. - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. - /// - public YesNoType PreserveModifiedDate - { - get - { - return this.preserveModifiedDateField; - } - set - { - this.preserveModifiedDateFieldSet = true; - this.preserveModifiedDateField = value; - } - } - - /// - /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. - /// - public SelectionLanguageType SelectionLanguage - { - get - { - return this.selectionLanguageField; - } - set - { - this.selectionLanguageFieldSet = true; - this.selectionLanguageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - XmlFile.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("createElement" == value)) - { - parsedValue = ActionType.createElement; - } - else - { - if (("deleteValue" == value)) - { - parsedValue = ActionType.deleteValue; - } - else - { - if (("setValue" == value)) - { - parsedValue = ActionType.setValue; - } - else - { - if (("bulkSetValue" == value)) - { - parsedValue = ActionType.bulkSetValue; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a SelectionLanguageType from a string. - /// - public static SelectionLanguageType ParseSelectionLanguageType(string value) - { - SelectionLanguageType parsedValue; - XmlFile.TryParseSelectionLanguageType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a SelectionLanguageType from a string. - /// - public static bool TryParseSelectionLanguageType(string value, out SelectionLanguageType parsedValue) - { - parsedValue = SelectionLanguageType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("XPath" == value)) - { - parsedValue = SelectionLanguageType.XPath; - } - else - { - if (("XSLPattern" == value)) - { - parsedValue = SelectionLanguageType.XSLPattern; - } - else - { - parsedValue = SelectionLanguageType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("XmlFile", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.elementPathFieldSet) - { - writer.WriteAttributeString("ElementPath", this.elementPathField); - } - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.createElement)) - { - writer.WriteAttributeString("Action", "createElement"); - } - if ((this.actionField == ActionType.deleteValue)) - { - writer.WriteAttributeString("Action", "deleteValue"); - } - if ((this.actionField == ActionType.setValue)) - { - writer.WriteAttributeString("Action", "setValue"); - } - if ((this.actionField == ActionType.bulkSetValue)) - { - writer.WriteAttributeString("Action", "bulkSetValue"); - } - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.preserveModifiedDateFieldSet) - { - if ((this.preserveModifiedDateField == YesNoType.no)) - { - writer.WriteAttributeString("PreserveModifiedDate", "no"); - } - if ((this.preserveModifiedDateField == YesNoType.yes)) - { - writer.WriteAttributeString("PreserveModifiedDate", "yes"); - } - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.selectionLanguageFieldSet) - { - if ((this.selectionLanguageField == SelectionLanguageType.XPath)) - { - writer.WriteAttributeString("SelectionLanguage", "XPath"); - } - if ((this.selectionLanguageField == SelectionLanguageType.XSLPattern)) - { - writer.WriteAttributeString("SelectionLanguage", "XSLPattern"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("ElementPath" == name)) - { - this.elementPathField = value; - this.elementPathFieldSet = true; - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = XmlFile.ParseActionType(value); - this.actionFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("PreserveModifiedDate" == name)) - { - this.preserveModifiedDateField = Enums.ParseYesNoType(value); - this.preserveModifiedDateFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("SelectionLanguage" == name)) - { - this.selectionLanguageField = XmlFile.ParseSelectionLanguageType(value); - this.selectionLanguageFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Creates a new element under the element specified in ElementPath. The Name attribute is required in this case and specifies the name of the new element. The Value attribute is not necessary when createElement is specified as the action. If the Value attribute is set, it will cause the new element's text value to be set. - /// - createElement, - - /// - /// Deletes a value from the element specified in the ElementPath. If Name is specified, the attribute with that name is deleted. If Name is not specified, the text value of the element specified in the ElementPath is deleted. The Value attribute is ignored if deleteValue is the action specified. - /// - deleteValue, - - /// - /// Sets a value in the element specified in the ElementPath. If Name is specified, and attribute with that name is set to the value specified in Value. If Name is not specified, the text value of the element is set. Value is a required attribute if setValue is the action specified. - /// - setValue, - - /// - /// Sets all the values in the elements that match the ElementPath. If Name is specified, attributes with that name are set to the same value specified in Value. If Name is not specified, the text values of the elements are set. Value is a required attribute if setBulkValue is the action specified. - /// - bulkSetValue, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum SelectionLanguageType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - XPath, - - XSLPattern, - } - } - - /// - /// Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class XmlConfig : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private string elementIdField; - - private bool elementIdFieldSet; - - private string elementPathField; - - private bool elementPathFieldSet; - - private string fileField; - - private bool fileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private NodeType nodeField; - - private bool nodeFieldSet; - - private OnType onField; - - private bool onFieldSet; - - private YesNoType preserveModifiedDateField; - - private bool preserveModifiedDateFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private string verifyPathField; - - private bool verifyPathFieldSet; - - private ISchemaElement parentElement; - - public XmlConfig() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(XmlConfig))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for xml file modification. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// The Id of another XmlConfig to add attributes to. In this case, the 'ElementPath', 'Action', 'Node', and 'On' attributes must be omitted. - /// - public string ElementId - { - get - { - return this.elementIdField; - } - set - { - this.elementIdFieldSet = true; - this.elementIdField = value; - } - } - - /// - /// The XPath of the parent element being modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. - /// - public string ElementPath - { - get - { - return this.elementPathField; - } - set - { - this.elementPathFieldSet = true; - this.elementPathField = value; - } - } - - /// - /// Path of the .xml file to configure. - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public NodeType Node - { - get - { - return this.nodeField; - } - set - { - this.nodeFieldSet = true; - this.nodeField = value; - } - } - - public OnType On - { - get - { - return this.onField; - } - set - { - this.onFieldSet = true; - this.onField = value; - } - } - - /// - /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. - /// - public YesNoType PreserveModifiedDate - { - get - { - return this.preserveModifiedDateField; - } - set - { - this.preserveModifiedDateFieldSet = true; - this.preserveModifiedDateField = value; - } - } - - /// - /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// The value to be written. See the - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// The XPath to the element being modified. This is required for 'delete' actions. For 'create' actions, VerifyPath is used to decide if the element already exists. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. - /// - public string VerifyPath - { - get - { - return this.verifyPathField; - } - set - { - this.verifyPathFieldSet = true; - this.verifyPathField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("XmlConfig" == childName)) - { - childValue = new XmlConfig(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - XmlConfig.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("create" == value)) - { - parsedValue = ActionType.create; - } - else - { - if (("delete" == value)) - { - parsedValue = ActionType.delete; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a NodeType from a string. - /// - public static NodeType ParseNodeType(string value) - { - NodeType parsedValue; - XmlConfig.TryParseNodeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a NodeType from a string. - /// - public static bool TryParseNodeType(string value, out NodeType parsedValue) - { - parsedValue = NodeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("element" == value)) - { - parsedValue = NodeType.element; - } - else - { - if (("value" == value)) - { - parsedValue = NodeType.value; - } - else - { - if (("document" == value)) - { - parsedValue = NodeType.document; - } - else - { - parsedValue = NodeType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a OnType from a string. - /// - public static OnType ParseOnType(string value) - { - OnType parsedValue; - XmlConfig.TryParseOnType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a OnType from a string. - /// - public static bool TryParseOnType(string value, out OnType parsedValue) - { - parsedValue = OnType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("install" == value)) - { - parsedValue = OnType.install; - } - else - { - if (("uninstall" == value)) - { - parsedValue = OnType.uninstall; - } - else - { - parsedValue = OnType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("XmlConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.create)) - { - writer.WriteAttributeString("Action", "create"); - } - if ((this.actionField == ActionType.delete)) - { - writer.WriteAttributeString("Action", "delete"); - } - } - if (this.elementIdFieldSet) - { - writer.WriteAttributeString("ElementId", this.elementIdField); - } - if (this.elementPathFieldSet) - { - writer.WriteAttributeString("ElementPath", this.elementPathField); - } - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.nodeFieldSet) - { - if ((this.nodeField == NodeType.element)) - { - writer.WriteAttributeString("Node", "element"); - } - if ((this.nodeField == NodeType.value)) - { - writer.WriteAttributeString("Node", "value"); - } - if ((this.nodeField == NodeType.document)) - { - writer.WriteAttributeString("Node", "document"); - } - } - if (this.onFieldSet) - { - if ((this.onField == OnType.install)) - { - writer.WriteAttributeString("On", "install"); - } - if ((this.onField == OnType.uninstall)) - { - writer.WriteAttributeString("On", "uninstall"); - } - } - if (this.preserveModifiedDateFieldSet) - { - if ((this.preserveModifiedDateField == YesNoType.no)) - { - writer.WriteAttributeString("PreserveModifiedDate", "no"); - } - if ((this.preserveModifiedDateField == YesNoType.yes)) - { - writer.WriteAttributeString("PreserveModifiedDate", "yes"); - } - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.verifyPathFieldSet) - { - writer.WriteAttributeString("VerifyPath", this.verifyPathField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = XmlConfig.ParseActionType(value); - this.actionFieldSet = true; - } - if (("ElementId" == name)) - { - this.elementIdField = value; - this.elementIdFieldSet = true; - } - if (("ElementPath" == name)) - { - this.elementPathField = value; - this.elementPathFieldSet = true; - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Node" == name)) - { - this.nodeField = XmlConfig.ParseNodeType(value); - this.nodeFieldSet = true; - } - if (("On" == name)) - { - this.onField = XmlConfig.ParseOnType(value); - this.onFieldSet = true; - } - if (("PreserveModifiedDate" == name)) - { - this.preserveModifiedDateField = Enums.ParseYesNoType(value); - this.preserveModifiedDateFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("VerifyPath" == name)) - { - this.verifyPathField = value; - this.verifyPathFieldSet = true; - } - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - create, - - delete, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum NodeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - element, - - value, - - document, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum OnType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - install, - - uninstall, - } - } -} diff --git a/src/heat/Serialize/vs.cs b/src/heat/Serialize/vs.cs deleted file mode 100644 index 8f926efc..00000000 --- a/src/heat/Serialize/vs.cs +++ /dev/null @@ -1,1574 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#pragma warning disable 1591 -namespace WixToolset.Harvesters.Serialize.VS -{ - using System; - using System.CodeDom.Compiler; - using System.Collections; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Xml; - using WixToolset.Harvesters.Serialize; - - - /// - /// Values of this type will either be "yes" or "no". - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public enum YesNoType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - no, - - yes, - } - - [GeneratedCode("XsdGen", "4.0.0.0")] - public class Enums - { - - /// - /// Parses a YesNoType from a string. - /// - public static YesNoType ParseYesNoType(string value) - { - YesNoType parsedValue; - Enums.TryParseYesNoType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoType from a string. - /// - public static bool TryParseYesNoType(string value, out YesNoType parsedValue) - { - parsedValue = YesNoType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("no" == value)) - { - parsedValue = YesNoType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoType.yes; - } - else - { - parsedValue = YesNoType.IllegalValue; - return false; - } - } - return true; - } - } - - /// - /// Help Namespace for a help collection. The parent file is the key for the HxC (Collection) file. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class HelpCollection : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private YesNoType suppressCustomActionsField; - - private bool suppressCustomActionsFieldSet; - - private ISchemaElement parentElement; - - public HelpCollection() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFileRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFilterRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PlugCollectionInto))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Primary Key for HelpNamespace. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Friendly name for Namespace. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Internal Microsoft Help ID for this Namespace. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. - /// - public YesNoType SuppressCustomActions - { - get - { - return this.suppressCustomActionsField; - } - set - { - this.suppressCustomActionsFieldSet = true; - this.suppressCustomActionsField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("HelpFileRef" == childName)) - { - childValue = new HelpFileRef(); - } - if (("HelpFilterRef" == childName)) - { - childValue = new HelpFilterRef(); - } - if (("PlugCollectionInto" == childName)) - { - childValue = new PlugCollectionInto(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("HelpCollection", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.suppressCustomActionsFieldSet) - { - if ((this.suppressCustomActionsField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressCustomActions", "no"); - } - if ((this.suppressCustomActionsField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressCustomActions", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("SuppressCustomActions" == name)) - { - this.suppressCustomActionsField = Enums.ParseYesNoType(value); - this.suppressCustomActionsFieldSet = true; - } - } - } - - /// - /// Filter for Help Namespace. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class HelpFilter : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string filterDefinitionField; - - private bool filterDefinitionFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private YesNoType suppressCustomActionsField; - - private bool suppressCustomActionsFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary Key for HelpFilter. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Query String for Help Filter. - /// - public string FilterDefinition - { - get - { - return this.filterDefinitionField; - } - set - { - this.filterDefinitionFieldSet = true; - this.filterDefinitionField = value; - } - } - - /// - /// Friendly name for Filter. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. - /// - public YesNoType SuppressCustomActions - { - get - { - return this.suppressCustomActionsField; - } - set - { - this.suppressCustomActionsFieldSet = true; - this.suppressCustomActionsField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("HelpFilter", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.filterDefinitionFieldSet) - { - writer.WriteAttributeString("FilterDefinition", this.filterDefinitionField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.suppressCustomActionsFieldSet) - { - if ((this.suppressCustomActionsField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressCustomActions", "no"); - } - if ((this.suppressCustomActionsField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressCustomActions", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("FilterDefinition" == name)) - { - this.filterDefinitionField = value; - this.filterDefinitionFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("SuppressCustomActions" == name)) - { - this.suppressCustomActionsField = Enums.ParseYesNoType(value); - this.suppressCustomActionsFieldSet = true; - } - } - } - - /// - /// File for Help Namespace. The parent file is the key for HxS (Title) file. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class HelpFile : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string attributeIndexField; - - private bool attributeIndexFieldSet; - - private string indexField; - - private bool indexFieldSet; - - private int languageField; - - private bool languageFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string sampleLocationField; - - private bool sampleLocationFieldSet; - - private string searchField; - - private bool searchFieldSet; - - private YesNoType suppressCustomActionsField; - - private bool suppressCustomActionsFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary Key for HelpFile Table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Key for HxR (Attributes) file. - /// - public string AttributeIndex - { - get - { - return this.attributeIndexField; - } - set - { - this.attributeIndexFieldSet = true; - this.attributeIndexField = value; - } - } - - /// - /// Key for HxI (Index) file. - /// - public string Index - { - get - { - return this.indexField; - } - set - { - this.indexFieldSet = true; - this.indexField = value; - } - } - - /// - /// Language ID for content file. - /// - public int Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - /// - /// Internal Microsoft Help ID for this HelpFile. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Key for a file that is in the "root" of the samples directory for this HelpFile. - /// - public string SampleLocation - { - get - { - return this.sampleLocationField; - } - set - { - this.sampleLocationFieldSet = true; - this.sampleLocationField = value; - } - } - - /// - /// Key for HxQ (Query) file. - /// - public string Search - { - get - { - return this.searchField; - } - set - { - this.searchFieldSet = true; - this.searchField = value; - } - } - - /// - /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. - /// - public YesNoType SuppressCustomActions - { - get - { - return this.suppressCustomActionsField; - } - set - { - this.suppressCustomActionsFieldSet = true; - this.suppressCustomActionsField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("HelpFile", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.attributeIndexFieldSet) - { - writer.WriteAttributeString("AttributeIndex", this.attributeIndexField); - } - if (this.indexFieldSet) - { - writer.WriteAttributeString("Index", this.indexField); - } - if (this.languageFieldSet) - { - writer.WriteAttributeString("Language", this.languageField.ToString(CultureInfo.InvariantCulture)); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.sampleLocationFieldSet) - { - writer.WriteAttributeString("SampleLocation", this.sampleLocationField); - } - if (this.searchFieldSet) - { - writer.WriteAttributeString("Search", this.searchField); - } - if (this.suppressCustomActionsFieldSet) - { - if ((this.suppressCustomActionsField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressCustomActions", "no"); - } - if ((this.suppressCustomActionsField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressCustomActions", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("AttributeIndex" == name)) - { - this.attributeIndexField = value; - this.attributeIndexFieldSet = true; - } - if (("Index" == name)) - { - this.indexField = value; - this.indexFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.languageFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("SampleLocation" == name)) - { - this.sampleLocationField = value; - this.sampleLocationFieldSet = true; - } - if (("Search" == name)) - { - this.searchField = value; - this.searchFieldSet = true; - } - if (("SuppressCustomActions" == name)) - { - this.suppressCustomActionsField = Enums.ParseYesNoType(value); - this.suppressCustomActionsFieldSet = true; - } - } - } - - /// - /// Plugin for Help Namespace. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class PlugCollectionInto : ISchemaElement, ISetAttributes - { - - private string attributesField; - - private bool attributesFieldSet; - - private string tableOfContentsField; - - private bool tableOfContentsFieldSet; - - private string targetCollectionField; - - private bool targetCollectionFieldSet; - - private string targetTableOfContentsField; - - private bool targetTableOfContentsFieldSet; - - private string targetFeatureField; - - private bool targetFeatureFieldSet; - - private YesNoType suppressExternalNamespacesField; - - private bool suppressExternalNamespacesFieldSet; - - private ISchemaElement parentElement; - - /// - /// Key for HxA (Attributes) file of child namespace. - /// - public string Attributes - { - get - { - return this.attributesField; - } - set - { - this.attributesFieldSet = true; - this.attributesField = value; - } - } - - /// - /// Key for HxT file of child namespace. - /// - public string TableOfContents - { - get - { - return this.tableOfContentsField; - } - set - { - this.tableOfContentsFieldSet = true; - this.tableOfContentsField = value; - } - } - - /// - /// Foriegn Key into HelpNamespace table for the parent namespace into which the child will be inserted. - /// The following special keys can be used to plug into external namespaces defined outside of the installer. - /// MS_VSIPCC_v80 : Visual Studio 2005 - /// MS.VSIPCC.v90 : Visual Studio 2008 - /// - public string TargetCollection - { - get - { - return this.targetCollectionField; - } - set - { - this.targetCollectionFieldSet = true; - this.targetCollectionField = value; - } - } - - /// - /// Key for HxT file of parent namespace that now includes the new child namespace. - /// - public string TargetTableOfContents - { - get - { - return this.targetTableOfContentsField; - } - set - { - this.targetTableOfContentsFieldSet = true; - this.targetTableOfContentsField = value; - } - } - - /// - /// Key for the feature parent of this help collection. Required only when plugging into external namespaces. - /// - public string TargetFeature - { - get - { - return this.targetFeatureField; - } - set - { - this.targetFeatureFieldSet = true; - this.targetFeatureField = value; - } - } - - /// - /// Suppress linking Visual Studio Help namespaces. Help redistributable merge modules will be required. Use this when building a merge module. - /// - public YesNoType SuppressExternalNamespaces - { - get - { - return this.suppressExternalNamespacesField; - } - set - { - this.suppressExternalNamespacesFieldSet = true; - this.suppressExternalNamespacesField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PlugCollectionInto", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.attributesFieldSet) - { - writer.WriteAttributeString("Attributes", this.attributesField); - } - if (this.tableOfContentsFieldSet) - { - writer.WriteAttributeString("TableOfContents", this.tableOfContentsField); - } - if (this.targetCollectionFieldSet) - { - writer.WriteAttributeString("TargetCollection", this.targetCollectionField); - } - if (this.targetTableOfContentsFieldSet) - { - writer.WriteAttributeString("TargetTableOfContents", this.targetTableOfContentsField); - } - if (this.targetFeatureFieldSet) - { - writer.WriteAttributeString("TargetFeature", this.targetFeatureField); - } - if (this.suppressExternalNamespacesFieldSet) - { - if ((this.suppressExternalNamespacesField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressExternalNamespaces", "no"); - } - if ((this.suppressExternalNamespacesField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressExternalNamespaces", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Attributes" == name)) - { - this.attributesField = value; - this.attributesFieldSet = true; - } - if (("TableOfContents" == name)) - { - this.tableOfContentsField = value; - this.tableOfContentsFieldSet = true; - } - if (("TargetCollection" == name)) - { - this.targetCollectionField = value; - this.targetCollectionFieldSet = true; - } - if (("TargetTableOfContents" == name)) - { - this.targetTableOfContentsField = value; - this.targetTableOfContentsFieldSet = true; - } - if (("TargetFeature" == name)) - { - this.targetFeatureField = value; - this.targetFeatureFieldSet = true; - } - if (("SuppressExternalNamespaces" == name)) - { - this.suppressExternalNamespacesField = Enums.ParseYesNoType(value); - this.suppressExternalNamespacesFieldSet = true; - } - } - } - - /// - /// Create a reference to a HelpFile element in another Fragment. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class HelpFileRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary Key for HelpFile Table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("HelpFileRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Create a reference to a HelpFile element in another Fragment. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class HelpFilterRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary Key for HelpFilter. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("HelpFilterRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Create a reference to a HelpCollection element in another Fragment. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class HelpCollectionRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public HelpCollectionRef() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFileRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Primary Key for HelpNamespace Table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("HelpFileRef" == childName)) - { - childValue = new HelpFileRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("HelpCollectionRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// This element provides the metdata required to install/uninstall a file as - /// a VSIX Package. The VSIX package file will be installed as part of the MSI - /// then passed to the VSIX installer to install the VSIX package. To avoid the - /// duplication, simply use the MSI to install the VSIX package itself. - /// - [GeneratedCode("XsdGen", "4.0.0.0")] - public class VsixPackage : ISchemaElement, ISetAttributes - { - - private string fileField; - - private bool fileFieldSet; - - private string packageIdField; - - private bool packageIdFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private string targetField; - - private bool targetFieldSet; - - private string targetVersionField; - - private bool targetVersionFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private string vsixInstallerPathPropertyField; - - private bool vsixInstallerPathPropertyFieldSet; - - private ISchemaElement parentElement; - - /// - /// Reference to file identifer. This attribute is required when the element is not a - /// child of a File element and is invalid when the element is a child of the File element. - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// Identity of the VSIX package per its internal manifest. If this value is not correct - /// the VSIX package will not correctly uninstall. - /// - public string PackageId - { - get - { - return this.packageIdField; - } - set - { - this.packageIdFieldSet = true; - this.packageIdField = value; - } - } - - /// - /// Indicates whether the VSIX package is uninstalled when the parent Component is uninstalled. - /// The default is 'no'. - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// Specifies the SKU of Visual Studio in which to register the extension. If no target - /// is specified the extension is registered with all installed SKUs. If the Target - /// attribute is specified the TargetVersion attribute must also be specified. The - /// following is a list of known Visual Studio targets: integratedShell, professional, - /// premium, ultimate, vbExpress, vcExpress, vcsExpress, vwdExpress - /// - public string Target - { - get - { - return this.targetField; - } - set - { - this.targetFieldSet = true; - this.targetField = value; - } - } - - /// - /// Specifies the version of Visual Studio in which to register the extension. This attribute - /// is required if the Target attribute is specified. - /// - public string TargetVersion - { - get - { - return this.targetVersionField; - } - set - { - this.targetVersionFieldSet = true; - this.targetVersionField = value; - } - } - - /// - /// Indicates whether failure to install the VSIX package causes the installation to rollback. - /// The default is 'yes'. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// Optional reference to a Property element that contains the path to the VsixInstaller.exe. - /// By default, the latest VsixInstaller.exe on the machine will be used to install the VSIX - /// package. It is highly recommended that this attribute is *not* used. - /// - public string VsixInstallerPathProperty - { - get - { - return this.vsixInstallerPathPropertyField; - } - set - { - this.vsixInstallerPathPropertyFieldSet = true; - this.vsixInstallerPathPropertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("VsixPackage", "http://wixtoolset.org/schemas/v4/wxs/vs"); - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.packageIdFieldSet) - { - writer.WriteAttributeString("PackageId", this.packageIdField); - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.targetFieldSet) - { - writer.WriteAttributeString("Target", this.targetField); - } - if (this.targetVersionFieldSet) - { - writer.WriteAttributeString("TargetVersion", this.targetVersionField); - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.vsixInstallerPathPropertyFieldSet) - { - writer.WriteAttributeString("VsixInstallerPathProperty", this.vsixInstallerPathPropertyField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("PackageId" == name)) - { - this.packageIdField = value; - this.packageIdFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("Target" == name)) - { - this.targetField = value; - this.targetFieldSet = true; - } - if (("TargetVersion" == name)) - { - this.targetVersionField = value; - this.targetVersionFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("VsixInstallerPathProperty" == name)) - { - this.vsixInstallerPathPropertyField = value; - this.vsixInstallerPathPropertyFieldSet = true; - } - } - } -} diff --git a/src/heat/Serialize/wix.cs b/src/heat/Serialize/wix.cs deleted file mode 100644 index e5a81cd0..00000000 --- a/src/heat/Serialize/wix.cs +++ /dev/null @@ -1,57740 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#pragma warning disable 1591 // TODO: add documentation -namespace WixToolset.Harvesters.Serialize -{ - using System; - using System.CodeDom.Compiler; - using System.Collections; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Xml; - - /// - /// Values of this type will either be "attached" or "detached". - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum BurnContainerType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - attached, - - detached, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Enums - { - - /// - /// Parses a BurnContainerType from a string. - /// - public static BurnContainerType ParseBurnContainerType(string value) - { - BurnContainerType parsedValue; - Enums.TryParseBurnContainerType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a BurnContainerType from a string. - /// - public static bool TryParseBurnContainerType(string value, out BurnContainerType parsedValue) - { - parsedValue = BurnContainerType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("attached" == value)) - { - parsedValue = BurnContainerType.attached; - } - else - { - if (("detached" == value)) - { - parsedValue = BurnContainerType.detached; - } - else - { - parsedValue = BurnContainerType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a BurnExeProtocolType from a string. - /// - public static BurnExeProtocolType ParseBurnExeProtocolType(string value) - { - BurnExeProtocolType parsedValue; - Enums.TryParseBurnExeProtocolType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a BurnExeProtocolType from a string. - /// - public static bool TryParseBurnExeProtocolType(string value, out BurnExeProtocolType parsedValue) - { - parsedValue = BurnExeProtocolType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("none" == value)) - { - parsedValue = BurnExeProtocolType.none; - } - else - { - if (("burn" == value)) - { - parsedValue = BurnExeProtocolType.burn; - } - else - { - if (("netfx4" == value)) - { - parsedValue = BurnExeProtocolType.netfx4; - } - else - { - parsedValue = BurnExeProtocolType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a YesNoType from a string. - /// - public static YesNoType ParseYesNoType(string value) - { - YesNoType parsedValue; - Enums.TryParseYesNoType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoType from a string. - /// - public static bool TryParseYesNoType(string value, out YesNoType parsedValue) - { - parsedValue = YesNoType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("no" == value)) - { - parsedValue = YesNoType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoType.yes; - } - else - { - parsedValue = YesNoType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a YesNoButtonType from a string. - /// - public static YesNoButtonType ParseYesNoButtonType(string value) - { - YesNoButtonType parsedValue; - Enums.TryParseYesNoButtonType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoButtonType from a string. - /// - public static bool TryParseYesNoButtonType(string value, out YesNoButtonType parsedValue) - { - parsedValue = YesNoButtonType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("no" == value)) - { - parsedValue = YesNoButtonType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoButtonType.yes; - } - else - { - if (("button" == value)) - { - parsedValue = YesNoButtonType.button; - } - else - { - parsedValue = YesNoButtonType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a YesNoDefaultType from a string. - /// - public static YesNoDefaultType ParseYesNoDefaultType(string value) - { - YesNoDefaultType parsedValue; - Enums.TryParseYesNoDefaultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoDefaultType from a string. - /// - public static bool TryParseYesNoDefaultType(string value, out YesNoDefaultType parsedValue) - { - parsedValue = YesNoDefaultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("default" == value)) - { - parsedValue = YesNoDefaultType.@default; - } - else - { - if (("no" == value)) - { - parsedValue = YesNoDefaultType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoDefaultType.yes; - } - else - { - parsedValue = YesNoDefaultType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a YesNoAlwaysType from a string. - /// - public static YesNoAlwaysType ParseYesNoAlwaysType(string value) - { - YesNoAlwaysType parsedValue; - Enums.TryParseYesNoAlwaysType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a YesNoAlwaysType from a string. - /// - public static bool TryParseYesNoAlwaysType(string value, out YesNoAlwaysType parsedValue) - { - parsedValue = YesNoAlwaysType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("always" == value)) - { - parsedValue = YesNoAlwaysType.always; - } - else - { - if (("no" == value)) - { - parsedValue = YesNoAlwaysType.no; - } - else - { - if (("yes" == value)) - { - parsedValue = YesNoAlwaysType.yes; - } - else - { - parsedValue = YesNoAlwaysType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a RegistryRootType from a string. - /// - public static RegistryRootType ParseRegistryRootType(string value) - { - RegistryRootType parsedValue; - Enums.TryParseRegistryRootType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a RegistryRootType from a string. - /// - public static bool TryParseRegistryRootType(string value, out RegistryRootType parsedValue) - { - parsedValue = RegistryRootType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("HKMU" == value)) - { - parsedValue = RegistryRootType.HKMU; - } - else - { - if (("HKCR" == value)) - { - parsedValue = RegistryRootType.HKCR; - } - else - { - if (("HKCU" == value)) - { - parsedValue = RegistryRootType.HKCU; - } - else - { - if (("HKLM" == value)) - { - parsedValue = RegistryRootType.HKLM; - } - else - { - if (("HKU" == value)) - { - parsedValue = RegistryRootType.HKU; - } - else - { - parsedValue = RegistryRootType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Parses a ExitType from a string. - /// - public static ExitType ParseExitType(string value) - { - ExitType parsedValue; - Enums.TryParseExitType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ExitType from a string. - /// - public static bool TryParseExitType(string value, out ExitType parsedValue) - { - parsedValue = ExitType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("success" == value)) - { - parsedValue = ExitType.success; - } - else - { - if (("cancel" == value)) - { - parsedValue = ExitType.cancel; - } - else - { - if (("error" == value)) - { - parsedValue = ExitType.error; - } - else - { - if (("suspend" == value)) - { - parsedValue = ExitType.suspend; - } - else - { - parsedValue = ExitType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a InstallUninstallType from a string. - /// - public static InstallUninstallType ParseInstallUninstallType(string value) - { - InstallUninstallType parsedValue; - Enums.TryParseInstallUninstallType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a InstallUninstallType from a string. - /// - public static bool TryParseInstallUninstallType(string value, out InstallUninstallType parsedValue) - { - parsedValue = InstallUninstallType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("install" == value)) - { - parsedValue = InstallUninstallType.install; - } - else - { - if (("uninstall" == value)) - { - parsedValue = InstallUninstallType.uninstall; - } - else - { - if (("both" == value)) - { - parsedValue = InstallUninstallType.both; - } - else - { - parsedValue = InstallUninstallType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a SequenceType from a string. - /// - public static SequenceType ParseSequenceType(string value) - { - SequenceType parsedValue; - Enums.TryParseSequenceType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a SequenceType from a string. - /// - public static bool TryParseSequenceType(string value, out SequenceType parsedValue) - { - parsedValue = SequenceType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("both" == value)) - { - parsedValue = SequenceType.both; - } - else - { - if (("first" == value)) - { - parsedValue = SequenceType.first; - } - else - { - if (("execute" == value)) - { - parsedValue = SequenceType.execute; - } - else - { - if (("ui" == value)) - { - parsedValue = SequenceType.ui; - } - else - { - parsedValue = SequenceType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a CompressionLevelType from a string. - /// - public static CompressionLevelType ParseCompressionLevelType(string value) - { - CompressionLevelType parsedValue; - Enums.TryParseCompressionLevelType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a CompressionLevelType from a string. - /// - public static bool TryParseCompressionLevelType(string value, out CompressionLevelType parsedValue) - { - parsedValue = CompressionLevelType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("high" == value)) - { - parsedValue = CompressionLevelType.high; - } - else - { - if (("low" == value)) - { - parsedValue = CompressionLevelType.low; - } - else - { - if (("medium" == value)) - { - parsedValue = CompressionLevelType.medium; - } - else - { - if (("mszip" == value)) - { - parsedValue = CompressionLevelType.mszip; - } - else - { - if (("none" == value)) - { - parsedValue = CompressionLevelType.none; - } - else - { - parsedValue = CompressionLevelType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - } - - /// - /// The list of communcation protocols with executable packages Burn supports. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum BurnExeProtocolType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The executable package does not support a communication protocol. - /// - none, - - /// - /// The executable package is another Burn bundle and supports the Burn communication protocol. - /// - burn, - - /// - /// The executable package implements the .NET Framework v4.0 communication protocol. - /// - netfx4, - } - - /// - /// Values of this type will either be "yes" or "no". - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum YesNoType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - no, - - yes, - } - - /// - /// Values of this type will either be "button", "yes" or "no". - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum YesNoButtonType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - no, - - yes, - - button, - } - - /// - /// Values of this type will either be "default", "yes", or "no". - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum YesNoDefaultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - @default, - - no, - - yes, - } - - /// - /// Values of this type will either be "always", "yes", or "no". - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum YesNoAlwaysType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - always, - - no, - - yes, - } - - /// - /// Values of this type represent possible registry roots. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum RegistryRootType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// A per-user installation will make the operation occur under HKEY_CURRENT_USER. - /// A per-machine installation will make the operation occur under HKEY_LOCAL_MACHINE. - /// - HKMU, - - /// - /// Operation occurs under HKEY_CLASSES_ROOT. When using Windows 2000 or later, the installer writes or removes the value - /// from the HKCU\Software\Classes hive during per-user installations. When using Windows 2000 or later operating systems, - /// the installer writes or removes the value from the HKLM\Software\Classes hive during per-machine installations. - /// - HKCR, - - /// - /// Operation occurs under HKEY_CURRENT_USER. It is recommended to set the KeyPath='yes' attribute when setting this value for writing values - /// in order to ensure that the installer writes the necessary registry entries when there are multiple users on the same computer. - /// - HKCU, - - /// - /// Operation occurs under HKEY_LOCAL_MACHINE. - /// - HKLM, - - /// - /// Operation occurs under HKEY_USERS. - /// - HKU, - } - - /// - /// Value indicates that this action is executed if the installer returns the associated exit type. Each exit type can be used with no more than one action. - /// Multiple actions can have exit types assigned, but every action and exit type must be different. Exit types are typically used with dialog boxes. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ExitType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - success, - - cancel, - - error, - - suspend, - } - - /// - /// Specifies whether an action occur on install, uninstall or both. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum InstallUninstallType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The action should happen during install (msiInstallStateLocal or msiInstallStateSource). - /// - install, - - /// - /// The action should happen during uninstall (msiInstallStateAbsent). - /// - uninstall, - - /// - /// The action should happen during both install and uninstall. - /// - both, - } - - /// - /// Controls which sequences the item assignment is sequenced in. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum SequenceType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Schedules the assignment in the InstallUISequence and the InstallExecuteSequence. - /// - both, - - /// - /// Schedules the assignment to run in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped. - /// - first, - - /// - /// Schedules the assignment only in the the InstallExecuteSequence. - /// - execute, - - /// - /// Schedules the assignment only in the the InstallUISequence. - /// - ui, - } - - /// - /// Indicates the compression level for a cabinet. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum CompressionLevelType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - high, - - low, - - medium, - - mszip, - - none, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public abstract class ActionModuleSequenceType : ISchemaElement, ISetAttributes - { - - private string afterField; - - private bool afterFieldSet; - - private string beforeField; - - private bool beforeFieldSet; - - private YesNoType overridableField; - - private bool overridableFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private YesNoType suppressField; - - private bool suppressFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of an action that this action should come after. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// The name of an action that this action should come before. - /// - public string Before - { - get - { - return this.beforeField; - } - set - { - this.beforeFieldSet = true; - this.beforeField = value; - } - } - - /// - /// If "yes", the sequencing of this action may be overridden by sequencing elsewhere. - /// - public YesNoType Overridable - { - get - { - return this.overridableField; - } - set - { - this.overridableFieldSet = true; - this.overridableField = value; - } - } - - /// - /// A value used to indicate the position of this action in a sequence. - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// If yes, this action will not occur. - /// - public YesNoType Suppress - { - get - { - return this.suppressField; - } - set - { - this.suppressFieldSet = true; - this.suppressField = value; - } - } - - /// - /// Text node specifies the condition of the action. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.beforeFieldSet) - { - writer.WriteAttributeString("Before", this.beforeField); - } - if (this.overridableFieldSet) - { - if ((this.overridableField == YesNoType.no)) - { - writer.WriteAttributeString("Overridable", "no"); - } - if ((this.overridableField == YesNoType.yes)) - { - writer.WriteAttributeString("Overridable", "yes"); - } - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.suppressFieldSet) - { - if ((this.suppressField == YesNoType.no)) - { - writer.WriteAttributeString("Suppress", "no"); - } - if ((this.suppressField == YesNoType.yes)) - { - writer.WriteAttributeString("Suppress", "yes"); - } - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Before" == name)) - { - this.beforeField = value; - this.beforeFieldSet = true; - } - if (("Overridable" == name)) - { - this.overridableField = Enums.ParseYesNoType(value); - this.overridableFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("Suppress" == name)) - { - this.suppressField = Enums.ParseYesNoType(value); - this.suppressFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public abstract class ActionSequenceType : ISchemaElement, ISetAttributes - { - - private int sequenceField; - - private bool sequenceFieldSet; - - private YesNoType suppressField; - - private bool suppressFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// A value used to indicate the position of this action in a sequence. - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// If yes, this action will not occur. - /// - public YesNoType Suppress - { - get - { - return this.suppressField; - } - set - { - this.suppressFieldSet = true; - this.suppressField = value; - } - } - - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.suppressFieldSet) - { - if ((this.suppressField == YesNoType.no)) - { - writer.WriteAttributeString("Suppress", "no"); - } - if ((this.suppressField == YesNoType.yes)) - { - writer.WriteAttributeString("Suppress", "yes"); - } - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("Suppress" == name)) - { - this.suppressField = Enums.ParseYesNoType(value); - this.suppressFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// This is the top-level container element for every wxs file. Among the possible children, - /// the Bundle, Package, Module, Patch, and PatchCreation elements are analogous to the main function in a C program. - /// There can only be one of these present when linking occurs. Package compiles into an msi file, - /// Module compiles into an msm file, PatchCreation compiles into a pcp file. The Fragment element - /// is an atomic unit which ultimately links into either a Package, Module, or PatchCreation. The - /// Fragment can either be completely included or excluded during linking. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Wix : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string requiredVersionField; - - private bool requiredVersionFieldSet; - - private ISchemaElement parentElement; - - public Wix() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); - ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Bundle))); - childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Package))); - childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Module))); - childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Patch))); - childCollection1.AddCollection(childCollection2); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(Fragment))); - childCollection0.AddCollection(childCollection1); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCreation))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Required version of the WiX toolset to compile this input file. - /// - public string RequiredVersion - { - get - { - return this.requiredVersionField; - } - set - { - this.requiredVersionFieldSet = true; - this.requiredVersionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Bundle" == childName)) - { - childValue = new Bundle(); - } - if (("Package" == childName)) - { - childValue = new Package(); - } - if (("Module" == childName)) - { - childValue = new Module(); - } - if (("Patch" == childName)) - { - childValue = new Patch(); - } - if (("Fragment" == childName)) - { - childValue = new Fragment(); - } - if (("PatchCreation" == childName)) - { - childValue = new PatchCreation(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Wix", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.requiredVersionFieldSet) - { - writer.WriteAttributeString("RequiredVersion", this.requiredVersionField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("RequiredVersion" == name)) - { - this.requiredVersionField = value; - this.requiredVersionFieldSet = true; - } - } - } - - /// - /// This is the top-level container element for every wxi file. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Include : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public Include() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Include", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - /// - /// The root element for creating bundled packages. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Bundle : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string aboutUrlField; - - private bool aboutUrlFieldSet; - - private string copyrightField; - - private bool copyrightFieldSet; - - private YesNoDefaultType compressedField; - - private bool compressedFieldSet; - - private YesNoButtonType disableModifyField; - - private bool disableModifyFieldSet; - - private YesNoType disableRemoveField; - - private bool disableRemoveFieldSet; - - private YesNoType disableRepairField; - - private bool disableRepairFieldSet; - - private string helpTelephoneField; - - private bool helpTelephoneFieldSet; - - private string helpUrlField; - - private bool helpUrlFieldSet; - - private string iconSourceFileField; - - private bool iconSourceFileFieldSet; - - private string manufacturerField; - - private bool manufacturerFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string parentNameField; - - private bool parentNameFieldSet; - - private string splashScreenSourceFileField; - - private bool splashScreenSourceFileFieldSet; - - private string tagField; - - private bool tagFieldSet; - - private string updateUrlField; - - private bool updateUrlFieldSet; - - private string upgradeCodeField; - - private bool upgradeCodeFieldSet; - - private string versionField; - - private bool versionFieldSet; - - private string conditionField; - - private bool conditionFieldSet; - - private ISchemaElement parentElement; - - public Bundle() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ApprovedExeForElevation))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Log))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Catalog))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplication))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplicationRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(OptionalUpdateRegistration))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Chain))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Container))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ContainerRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RelatedBundle))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Update))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Variable))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// A URL for more information about the bundle to display in Programs and Features (also - /// known as Add/Remove Programs). - /// - public string AboutUrl - { - get - { - return this.aboutUrlField; - } - set - { - this.aboutUrlFieldSet = true; - this.aboutUrlField = value; - } - } - - /// - /// The legal copyright found in the version resources of final bundle executable. If - /// this attribute is not provided the copyright will be set to "Copyright (c) [Bundle/@Manufacturer]. All rights reserved.". - /// - public string Copyright - { - get - { - return this.copyrightField; - } - set - { - this.copyrightFieldSet = true; - this.copyrightField = value; - } - } - - /// - /// Whether Packages and Payloads not assigned to a container should be added to the default attached container or if they should be external. The default is yes. - /// - public YesNoDefaultType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// Determines whether the bundle can be modified via the Programs and Features (also known as - /// Add/Remove Programs). If the value is "button" then Programs and Features will show a single - /// "Uninstall/Change" button. If the value is "yes" then Programs and Features will only show - /// the "Uninstall" button". If the value is "no", the default, then a "Change" button is shown. - /// See the DisableRemove attribute for information how to not display the bundle in Programs - /// and Features. - /// - public YesNoButtonType DisableModify - { - get - { - return this.disableModifyField; - } - set - { - this.disableModifyFieldSet = true; - this.disableModifyField = value; - } - } - - /// - /// Determines whether the bundle can be removed via the Programs and Features (also - /// known as Add/Remove Programs). If the value is "yes" then the "Uninstall" button will - /// not be displayed. The default is "no" which ensures there is an "Uninstall" button to - /// remove the bundle. If the "DisableModify" attribute is also "yes" or "button" then the - /// bundle will not be displayed in Progams and Features and another mechanism (such as - /// registering as a related bundle addon) must be used to ensure the bundle can be removed. - /// - public YesNoType DisableRemove - { - get - { - return this.disableRemoveField; - } - set - { - this.disableRemoveFieldSet = true; - this.disableRemoveField = value; - } - } - - public YesNoType DisableRepair - { - get - { - return this.disableRepairField; - } - set - { - this.disableRepairFieldSet = true; - this.disableRepairField = value; - } - } - - /// - /// A telephone number for help to display in Programs and Features (also known as - /// Add/Remove Programs). - /// - public string HelpTelephone - { - get - { - return this.helpTelephoneField; - } - set - { - this.helpTelephoneFieldSet = true; - this.helpTelephoneField = value; - } - } - - /// - /// A URL to the help for the bundle to display in Programs and Features (also known as - /// Add/Remove Programs). - /// - public string HelpUrl - { - get - { - return this.helpUrlField; - } - set - { - this.helpUrlFieldSet = true; - this.helpUrlField = value; - } - } - - /// - /// Path to an icon that will replace the default icon in the final Bundle executable. - /// This icon will also be displayed in Programs and Features (also known as Add/Remove - /// Programs). - /// - public string IconSourceFile - { - get - { - return this.iconSourceFileField; - } - set - { - this.iconSourceFileFieldSet = true; - this.iconSourceFileField = value; - } - } - - /// - /// The publisher of the bundle to display in Programs and Features (also known as - /// Add/Remove Programs). - /// - public string Manufacturer - { - get - { - return this.manufacturerField; - } - set - { - this.manufacturerFieldSet = true; - this.manufacturerField = value; - } - } - - /// - /// The name of the bundle to display in Programs and Features (also known as Add/Remove - /// Programs). This name can be accessed and overwritten by a BootstrapperApplication - /// using the WixBundleName bundle variable. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The name of the parent bundle to display in Installed Updates (also known as Add/Remove - /// Programs). This name is used to nest or group bundles that will appear as updates. - /// If the parent name does not actually exist, a virtual parent is created automatically. - /// - public string ParentName - { - get - { - return this.parentNameField; - } - set - { - this.parentNameFieldSet = true; - this.parentNameField = value; - } - } - - /// - /// Path to a bitmap that will be shown as the bootstrapper application is being loaded. If this attribute is not specified, no splash screen will be displayed. - /// - public string SplashScreenSourceFile - { - get - { - return this.splashScreenSourceFileField; - } - set - { - this.splashScreenSourceFileFieldSet = true; - this.splashScreenSourceFileField = value; - } - } - - /// - /// Set this string to uniquely identify this bundle to its own BA, and to related bundles. The value of this string only matters to the BA, and its value has no direct effect on engine functionality. - /// - public string Tag - { - get - { - return this.tagField; - } - set - { - this.tagFieldSet = true; - this.tagField = value; - } - } - - /// - /// A URL for updates of the bundle to display in Programs and Features (also - /// known as Add/Remove Programs). - /// - public string UpdateUrl - { - get - { - return this.updateUrlField; - } - set - { - this.updateUrlFieldSet = true; - this.updateUrlField = value; - } - } - - /// - /// Unique identifier for a family of bundles. If two bundles have the same UpgradeCode the - /// bundle with the highest version will be installed. - /// - public string UpgradeCode - { - get - { - return this.upgradeCodeField; - } - set - { - this.upgradeCodeFieldSet = true; - this.upgradeCodeField = value; - } - } - - /// - /// The version of the bundle. Newer versions upgrade earlier versions of the bundles - /// with matching UpgradeCodes. If the bundle is registered in Programs and Features - /// then this attribute will be displayed in the Programs and Features user interface. - /// - public string Version - { - get - { - return this.versionField; - } - set - { - this.versionFieldSet = true; - this.versionField = value; - } - } - - /// - /// The condition of the bundle. If the condition is not met, the bundle will - /// refuse to run. Conditions are checked before the bootstrapper application is loaded - /// (before detect), and thus can only reference built-in variables such as - /// variables which indicate the version of the OS. - /// - public string Condition - { - get - { - return this.conditionField; - } - set - { - this.conditionFieldSet = true; - this.conditionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ApprovedExeForElevation" == childName)) - { - childValue = new ApprovedExeForElevation(); - } - if (("Log" == childName)) - { - childValue = new Log(); - } - if (("Catalog" == childName)) - { - childValue = new Catalog(); - } - if (("BootstrapperApplication" == childName)) - { - childValue = new BootstrapperApplication(); - } - if (("BootstrapperApplicationRef" == childName)) - { - childValue = new BootstrapperApplicationRef(); - } - if (("OptionalUpdateRegistration" == childName)) - { - childValue = new OptionalUpdateRegistration(); - } - if (("Chain" == childName)) - { - childValue = new Chain(); - } - if (("Container" == childName)) - { - childValue = new Container(); - } - if (("ContainerRef" == childName)) - { - childValue = new ContainerRef(); - } - if (("PayloadGroup" == childName)) - { - childValue = new PayloadGroup(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if (("RelatedBundle" == childName)) - { - childValue = new RelatedBundle(); - } - if (("Update" == childName)) - { - childValue = new Update(); - } - if (("Variable" == childName)) - { - childValue = new Variable(); - } - if (("WixVariable" == childName)) - { - childValue = new WixVariable(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Bundle", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.aboutUrlFieldSet) - { - writer.WriteAttributeString("AboutUrl", this.aboutUrlField); - } - if (this.copyrightFieldSet) - { - writer.WriteAttributeString("Copyright", this.copyrightField); - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Compressed", "default"); - } - if ((this.compressedField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.disableModifyFieldSet) - { - if ((this.disableModifyField == YesNoButtonType.no)) - { - writer.WriteAttributeString("DisableModify", "no"); - } - if ((this.disableModifyField == YesNoButtonType.yes)) - { - writer.WriteAttributeString("DisableModify", "yes"); - } - if ((this.disableModifyField == YesNoButtonType.button)) - { - writer.WriteAttributeString("DisableModify", "button"); - } - } - if (this.disableRemoveFieldSet) - { - if ((this.disableRemoveField == YesNoType.no)) - { - writer.WriteAttributeString("DisableRemove", "no"); - } - if ((this.disableRemoveField == YesNoType.yes)) - { - writer.WriteAttributeString("DisableRemove", "yes"); - } - } - if (this.disableRepairFieldSet) - { - if ((this.disableRepairField == YesNoType.no)) - { - writer.WriteAttributeString("DisableRepair", "no"); - } - if ((this.disableRepairField == YesNoType.yes)) - { - writer.WriteAttributeString("DisableRepair", "yes"); - } - } - if (this.helpTelephoneFieldSet) - { - writer.WriteAttributeString("HelpTelephone", this.helpTelephoneField); - } - if (this.helpUrlFieldSet) - { - writer.WriteAttributeString("HelpUrl", this.helpUrlField); - } - if (this.iconSourceFileFieldSet) - { - writer.WriteAttributeString("IconSourceFile", this.iconSourceFileField); - } - if (this.manufacturerFieldSet) - { - writer.WriteAttributeString("Manufacturer", this.manufacturerField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.parentNameFieldSet) - { - writer.WriteAttributeString("ParentName", this.parentNameField); - } - if (this.splashScreenSourceFileFieldSet) - { - writer.WriteAttributeString("SplashScreenSourceFile", this.splashScreenSourceFileField); - } - if (this.tagFieldSet) - { - writer.WriteAttributeString("Tag", this.tagField); - } - if (this.updateUrlFieldSet) - { - writer.WriteAttributeString("UpdateUrl", this.updateUrlField); - } - if (this.upgradeCodeFieldSet) - { - writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); - } - if (this.versionFieldSet) - { - writer.WriteAttributeString("Version", this.versionField); - } - if (this.conditionFieldSet) - { - writer.WriteAttributeString("Condition", this.conditionField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("AboutUrl" == name)) - { - this.aboutUrlField = value; - this.aboutUrlFieldSet = true; - } - if (("Copyright" == name)) - { - this.copyrightField = value; - this.copyrightFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoDefaultType(value); - this.compressedFieldSet = true; - } - if (("DisableModify" == name)) - { - this.disableModifyField = Enums.ParseYesNoButtonType(value); - this.disableModifyFieldSet = true; - } - if (("DisableRemove" == name)) - { - this.disableRemoveField = Enums.ParseYesNoType(value); - this.disableRemoveFieldSet = true; - } - if (("DisableRepair" == name)) - { - this.disableRepairField = Enums.ParseYesNoType(value); - this.disableRepairFieldSet = true; - } - if (("HelpTelephone" == name)) - { - this.helpTelephoneField = value; - this.helpTelephoneFieldSet = true; - } - if (("HelpUrl" == name)) - { - this.helpUrlField = value; - this.helpUrlFieldSet = true; - } - if (("IconSourceFile" == name)) - { - this.iconSourceFileField = value; - this.iconSourceFileFieldSet = true; - } - if (("Manufacturer" == name)) - { - this.manufacturerField = value; - this.manufacturerFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("ParentName" == name)) - { - this.parentNameField = value; - this.parentNameFieldSet = true; - } - if (("SplashScreenSourceFile" == name)) - { - this.splashScreenSourceFileField = value; - this.splashScreenSourceFileFieldSet = true; - } - if (("Tag" == name)) - { - this.tagField = value; - this.tagFieldSet = true; - } - if (("UpdateUrl" == name)) - { - this.updateUrlField = value; - this.updateUrlFieldSet = true; - } - if (("UpgradeCode" == name)) - { - this.upgradeCodeField = value; - this.upgradeCodeFieldSet = true; - } - if (("Version" == name)) - { - this.versionField = value; - this.versionFieldSet = true; - } - if (("Condition" == name)) - { - this.conditionField = value; - this.conditionFieldSet = true; - } - } - } - - /// - /// Provides information about an .exe so that the BA can request the engine to run it elevated from any secure location. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ApprovedExeForElevation : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private YesNoType win64Field; - - private bool win64FieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the ApprovedExeForElevation element. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The key path. - /// For security purposes, the root key will be HKLM and Variables are not supported. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// The value name. - /// For security purposes, Variables are not supported. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// Instructs the search to look in the 64-bit registry when the value is 'yes'. - /// When the value is 'no', the search looks in the 32-bit registry. - /// The default value is 'no'. - /// - public YesNoType Win64 - { - get - { - return this.win64Field; - } - set - { - this.win64FieldSet = true; - this.win64Field = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ApprovedExeForElevation", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.win64FieldSet) - { - if ((this.win64Field == YesNoType.no)) - { - writer.WriteAttributeString("Win64", "no"); - } - if ((this.win64Field == YesNoType.yes)) - { - writer.WriteAttributeString("Win64", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Win64" == name)) - { - this.win64Field = Enums.ParseYesNoType(value); - this.win64FieldSet = true; - } - } - } - - /// - /// Overrides the default log settings for a bundle. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Log : ISchemaElement, ISetAttributes - { - - private YesNoType disableField; - - private bool disableFieldSet; - - private string pathVariableField; - - private bool pathVariableFieldSet; - - private string prefixField; - - private bool prefixFieldSet; - - private string extensionField; - - private bool extensionFieldSet; - - private ISchemaElement parentElement; - - /// - /// Disables the default logging in the Bundle. The end user can still generate a - /// log file by specifying the "-l" command-line argument when installing the - /// Bundle. - /// - public YesNoType Disable - { - get - { - return this.disableField; - } - set - { - this.disableFieldSet = true; - this.disableField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file. An empty value - /// will cause the variable to not be set. The default is "WixBundleLog". - /// - public string PathVariable - { - get - { - return this.pathVariableField; - } - set - { - this.pathVariableFieldSet = true; - this.pathVariableField = value; - } - } - - /// - /// File name and optionally a relative path to use as the prefix for the log file. The - /// default is to use the Bundle/@Name or, if Bundle/@Name is not specified, the value - /// "Setup". - /// - public string Prefix - { - get - { - return this.prefixField; - } - set - { - this.prefixFieldSet = true; - this.prefixField = value; - } - } - - /// - /// The extension to use for the log. The default is ".log". - /// - public string Extension - { - get - { - return this.extensionField; - } - set - { - this.extensionFieldSet = true; - this.extensionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Log", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.disableFieldSet) - { - if ((this.disableField == YesNoType.no)) - { - writer.WriteAttributeString("Disable", "no"); - } - if ((this.disableField == YesNoType.yes)) - { - writer.WriteAttributeString("Disable", "yes"); - } - } - if (this.pathVariableFieldSet) - { - writer.WriteAttributeString("PathVariable", this.pathVariableField); - } - if (this.prefixFieldSet) - { - writer.WriteAttributeString("Prefix", this.prefixField); - } - if (this.extensionFieldSet) - { - writer.WriteAttributeString("Extension", this.extensionField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Disable" == name)) - { - this.disableField = Enums.ParseYesNoType(value); - this.disableFieldSet = true; - } - if (("PathVariable" == name)) - { - this.pathVariableField = value; - this.pathVariableFieldSet = true; - } - if (("Prefix" == name)) - { - this.prefixField = value; - this.prefixFieldSet = true; - } - if (("Extension" == name)) - { - this.extensionField = value; - this.extensionFieldSet = true; - } - } - } - - /// - /// Specify one or more catalog files that will be used to verify the contents of the bundle. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Catalog : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the catalog element. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The catalog file - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Catalog", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - } - } - - /// - /// Contains all the relevant information about the setup UI. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class BootstrapperApplication : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private ISchemaElement parentElement; - - public BootstrapperApplication() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The identifier of the BootstrapperApplication element. Only required if you want to reference this element using a BootstrapperApplicationRef element. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The DLL with the bootstrapper application entry function. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// The relative destination path and file name for the bootstrapper application DLL. The default is the source file name. Use this attribute to rename the bootstrapper application DLL or extract it into a subfolder. The use of '..' directories is not allowed. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("BootstrapperApplication", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - } - } - - /// - /// Used to reference a BootstrapperApplication element and optionally add additional payloads to the bootstrapper application. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class BootstrapperApplicationRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public BootstrapperApplicationRef() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The identifier of the BootstrapperApplication element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("BootstrapperApplicationRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// This element has been deprecated. Use the BootstrapperApplication element instead. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UX : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string splashScreenSourceFileField; - - private bool splashScreenSourceFileFieldSet; - - private ISchemaElement parentElement; - - public UX() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// See the BootstrapperApplication instead. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// See the BootstrapperApplication instead. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// See the BootstrapperApplication instead. - /// - public string SplashScreenSourceFile - { - get - { - return this.splashScreenSourceFileField; - } - set - { - this.splashScreenSourceFileFieldSet = true; - this.splashScreenSourceFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UX", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.splashScreenSourceFileFieldSet) - { - writer.WriteAttributeString("SplashScreenSourceFile", this.splashScreenSourceFileField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("SplashScreenSourceFile" == name)) - { - this.splashScreenSourceFileField = value; - this.splashScreenSourceFileFieldSet = true; - } - } - } - - /// - /// Writes additional information to the Windows registry that can be used to detect the bundle. - /// This registration is intended primarily for update to an existing product. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class OptionalUpdateRegistration : ISchemaElement, ISetAttributes - { - - private string manufacturerField; - - private bool manufacturerFieldSet; - - private string departmentField; - - private bool departmentFieldSet; - - private string productFamilyField; - - private bool productFamilyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string classificationField; - - private bool classificationFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of the manufacturer. The default is the Bundle/@Manufacturer attribute, - /// but may also be a short form, ex: Acme instead of Acme Corporation. - /// An error is generated at build time if neither attribute is specified. - /// - public string Manufacturer - { - get - { - return this.manufacturerField; - } - set - { - this.manufacturerFieldSet = true; - this.manufacturerField = value; - } - } - - /// - /// The name of the department or division publishing the update bundle. - /// The PublishingGroup registry value is not written if this attribute is not specified. - /// - public string Department - { - get - { - return this.departmentField; - } - set - { - this.departmentFieldSet = true; - this.departmentField = value; - } - } - - /// - /// The name of the family of products being updated. The default is the Bundle/@ParentName attribute. - /// The corresponding registry key is not created if neither attribute is specified. - /// - public string ProductFamily - { - get - { - return this.productFamilyField; - } - set - { - this.productFamilyFieldSet = true; - this.productFamilyField = value; - } - } - - /// - /// The name of the bundle. The default is the Bundle/@Name attribute, - /// but may also be a short form, ex: KB12345 instead of Update to Product (KB12345). - /// An error is generated at build time if neither attribute is specified. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The release type of the update bundle, such as Update, Security Update, Service Pack, etc. - /// The default value is Update. - /// - public string Classification - { - get - { - return this.classificationField; - } - set - { - this.classificationFieldSet = true; - this.classificationField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("OptionalUpdateRegistration", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.manufacturerFieldSet) - { - writer.WriteAttributeString("Manufacturer", this.manufacturerField); - } - if (this.departmentFieldSet) - { - writer.WriteAttributeString("Department", this.departmentField); - } - if (this.productFamilyFieldSet) - { - writer.WriteAttributeString("ProductFamily", this.productFamilyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.classificationFieldSet) - { - writer.WriteAttributeString("Classification", this.classificationField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Manufacturer" == name)) - { - this.manufacturerField = value; - this.manufacturerFieldSet = true; - } - if (("Department" == name)) - { - this.departmentField = value; - this.departmentFieldSet = true; - } - if (("ProductFamily" == name)) - { - this.productFamilyField = value; - this.productFamilyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Classification" == name)) - { - this.classificationField = value; - this.classificationFieldSet = true; - } - } - } - - /// - /// Contains the chain of packages to install. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Chain : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private YesNoType disableRollbackField; - - private bool disableRollbackFieldSet; - - private YesNoType disableSystemRestoreField; - - private bool disableSystemRestoreFieldSet; - - private YesNoType parallelCacheField; - - private bool parallelCacheFieldSet; - - private ISchemaElement parentElement; - - public Chain() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MspPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RollbackBoundary))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Specifies whether the bundle will attempt to rollback packages - /// executed in the chain. If "yes" is specified then when a vital - /// package fails to install only that package will rollback and the - /// chain will stop with the error. The default is "no" which - /// indicates all packages executed during the chain will be - /// rolledback to their previous state when a vital package fails. - /// - public YesNoType DisableRollback - { - get - { - return this.disableRollbackField; - } - set - { - this.disableRollbackFieldSet = true; - this.disableRollbackField = value; - } - } - - /// - /// Specifies whether the bundle will attempt to create a system - /// restore point when executing the chain. If "yes" is specified then - /// a system restore point will not be created. The default is "no" which - /// indicates a system restore point will be created when the bundle is - /// installed, uninstalled, repaired, modified, etc. If the system restore - /// point cannot be created, the bundle will log the issue and continue. - /// - public YesNoType DisableSystemRestore - { - get - { - return this.disableSystemRestoreField; - } - set - { - this.disableSystemRestoreFieldSet = true; - this.disableSystemRestoreField = value; - } - } - - /// - /// Specifies whether the bundle will start installing packages - /// while other packages are still being cached. If "yes", - /// packages will start executing when a rollback boundary is - /// encountered. The default is "no" which dictates all packages - /// must be cached before any packages will start to be installed. - /// - public YesNoType ParallelCache - { - get - { - return this.parallelCacheField; - } - set - { - this.parallelCacheFieldSet = true; - this.parallelCacheField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("MsiPackage" == childName)) - { - childValue = new MsiPackage(); - } - if (("MspPackage" == childName)) - { - childValue = new MspPackage(); - } - if (("MsuPackage" == childName)) - { - childValue = new MsuPackage(); - } - if (("ExePackage" == childName)) - { - childValue = new ExePackage(); - } - if (("RollbackBoundary" == childName)) - { - childValue = new RollbackBoundary(); - } - if (("PackageGroupRef" == childName)) - { - childValue = new PackageGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Chain", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.disableRollbackFieldSet) - { - if ((this.disableRollbackField == YesNoType.no)) - { - writer.WriteAttributeString("DisableRollback", "no"); - } - if ((this.disableRollbackField == YesNoType.yes)) - { - writer.WriteAttributeString("DisableRollback", "yes"); - } - } - if (this.disableSystemRestoreFieldSet) - { - if ((this.disableSystemRestoreField == YesNoType.no)) - { - writer.WriteAttributeString("DisableSystemRestore", "no"); - } - if ((this.disableSystemRestoreField == YesNoType.yes)) - { - writer.WriteAttributeString("DisableSystemRestore", "yes"); - } - } - if (this.parallelCacheFieldSet) - { - if ((this.parallelCacheField == YesNoType.no)) - { - writer.WriteAttributeString("ParallelCache", "no"); - } - if ((this.parallelCacheField == YesNoType.yes)) - { - writer.WriteAttributeString("ParallelCache", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("DisableRollback" == name)) - { - this.disableRollbackField = Enums.ParseYesNoType(value); - this.disableRollbackFieldSet = true; - } - if (("DisableSystemRestore" == name)) - { - this.disableSystemRestoreField = Enums.ParseYesNoType(value); - this.disableSystemRestoreFieldSet = true; - } - if (("ParallelCache" == name)) - { - this.parallelCacheField = Enums.ParseYesNoType(value); - this.parallelCacheFieldSet = true; - } - } - } - - /// - /// Describes a single msi package to install. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MsiPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string downloadUrlField; - - private bool downloadUrlFieldSet; - - private string idField; - - private bool idFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string installSizeField; - - private bool installSizeFieldSet; - - private string installConditionField; - - private bool installConditionFieldSet; - - private YesNoAlwaysType cacheField; - - private bool cacheFieldSet; - - private string cacheIdField; - - private bool cacheIdFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string logPathVariableField; - - private bool logPathVariableFieldSet; - - private string rollbackLogPathVariableField; - - private bool rollbackLogPathVariableFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private YesNoDefaultType compressedField; - - private bool compressedFieldSet; - - private YesNoType enableSignatureVerificationField; - - private bool enableSignatureVerificationFieldSet; - - private YesNoType enableFeatureSelectionField; - - private bool enableFeatureSelectionFieldSet; - - private YesNoType forcePerMachineField; - - private bool forcePerMachineFieldSet; - - private YesNoType suppressLooseFilePayloadGenerationField; - - private bool suppressLooseFilePayloadGenerationFieldSet; - - private YesNoType visibleField; - - private bool visibleFieldSet; - - private ISchemaElement parentElement; - - public MsiPackage() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiProperty))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SlipstreamMsp))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. - /// At a minimum, the SourceFile or Name attribute must be specified. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// The destination path and file name for this chain payload. Use this attribute to rename the - /// chain entry point or extract it into a subfolder. The default value is the file name from the - /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. - /// The use of '..' directories is not allowed. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public string DownloadUrl - { - get - { - return this.downloadUrlField; - } - set - { - this.downloadUrlFieldSet = true; - this.downloadUrlField = value; - } - } - - /// - /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute - /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The identifier of another package that this one should be installed after. By default the After - /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this - /// attribute is specified ensure that a cycle is not created explicitly or implicitly. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// The size this package will take on disk in bytes after it is installed. By default, the binder will - /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) - /// and use the total for the install size of the package. - /// - public string InstallSize - { - get - { - return this.installSizeField; - } - set - { - this.installSizeFieldSet = true; - this.installSizeField = value; - } - } - - /// - /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. - /// - public string InstallCondition - { - get - { - return this.installConditionField; - } - set - { - this.installConditionFieldSet = true; - this.installConditionField = value; - } - } - - /// - /// Whether to cache the package. The default is "yes". - /// - public YesNoAlwaysType Cache - { - get - { - return this.cacheField; - } - set - { - this.cacheFieldSet = true; - this.cacheField = value; - } - } - - /// - /// The identifier to use when caching the package. - /// - public string CacheId - { - get - { - return this.cacheIdField; - } - set - { - this.cacheIdFieldSet = true; - this.cacheIdField = value; - } - } - - /// - /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use - /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the - /// bootstrapper application data manifest. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use - /// the Description patch metadata property. Other package types must use this attribute to define a description in the - /// bootstrapper application data manifest. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not - /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. - /// - public string LogPathVariable - { - get - { - return this.logPathVariableField; - } - set - { - this.logPathVariableFieldSet = true; - this.logPathVariableField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause - /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which - /// default to no logging. - /// - public string RollbackLogPathVariable - { - get - { - return this.rollbackLogPathVariableField; - } - set - { - this.rollbackLogPathVariableFieldSet = true; - this.rollbackLogPathVariableField = value; - } - } - - /// - /// Specifies whether the package can be uninstalled. The default is "no". - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// Specifies whether the package must succeed for the chain to continue. The default "yes" - /// indicates that if the package fails then the chain will fail and rollback or stop. If - /// "no" is specified then the chain will continue even if the package reports failure. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// Whether the package payload should be embedded in a container or left as an external payload. - /// - public YesNoDefaultType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" - /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the - /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. - /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". - /// - public YesNoType EnableSignatureVerification - { - get - { - return this.enableSignatureVerificationField; - } - set - { - this.enableSignatureVerificationFieldSet = true; - this.enableSignatureVerificationField = value; - } - } - - /// - /// Specifies whether the bundle will allow individual control over the installation state of Features inside - /// the msi package. Managing feature selection requires special care to ensure the install, modify, update and - /// uninstall behavior of the package is always correct. The default is "no". - /// - public YesNoType EnableFeatureSelection - { - get - { - return this.enableFeatureSelectionField; - } - set - { - this.enableFeatureSelectionFieldSet = true; - this.enableFeatureSelectionField = value; - } - } - - /// - /// Override the automatic per-machine detection of MSI packages and force the package to be per-machine. - /// The default is "no", which allows the tools to detect the expected value. - /// - public YesNoType ForcePerMachine - { - get - { - return this.forcePerMachineField; - } - set - { - this.forcePerMachineFieldSet = true; - this.forcePerMachineField = value; - } - } - - /// - /// This attribute has been deprecated. When the value is "yes", the Binder will not read the MSI package - /// to detect uncompressed files that would otherwise be automatically included in the Bundle as Payloads. - /// The resulting Bundle may not be able to install the MSI package correctly. The default is "no". - /// - public YesNoType SuppressLooseFilePayloadGeneration - { - get - { - return this.suppressLooseFilePayloadGenerationField; - } - set - { - this.suppressLooseFilePayloadGenerationFieldSet = true; - this.suppressLooseFilePayloadGenerationField = value; - } - } - - /// - /// Specifies whether the MSI will be displayed in Programs and Features (also known as Add/Remove Programs). If "yes" is - /// specified the MSI package information will be displayed in Programs and Features. The default "no" indicates the MSI - /// will not be displayed. - /// - public YesNoType Visible - { - get - { - return this.visibleField; - } - set - { - this.visibleFieldSet = true; - this.visibleField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("MsiProperty" == childName)) - { - childValue = new MsiProperty(); - } - if (("SlipstreamMsp" == childName)) - { - childValue = new SlipstreamMsp(); - } - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MsiPackage", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.downloadUrlFieldSet) - { - writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.installSizeFieldSet) - { - writer.WriteAttributeString("InstallSize", this.installSizeField); - } - if (this.installConditionFieldSet) - { - writer.WriteAttributeString("InstallCondition", this.installConditionField); - } - if (this.cacheFieldSet) - { - if ((this.cacheField == YesNoAlwaysType.always)) - { - writer.WriteAttributeString("Cache", "always"); - } - if ((this.cacheField == YesNoAlwaysType.no)) - { - writer.WriteAttributeString("Cache", "no"); - } - if ((this.cacheField == YesNoAlwaysType.yes)) - { - writer.WriteAttributeString("Cache", "yes"); - } - } - if (this.cacheIdFieldSet) - { - writer.WriteAttributeString("CacheId", this.cacheIdField); - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.logPathVariableFieldSet) - { - writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); - } - if (this.rollbackLogPathVariableFieldSet) - { - writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Compressed", "default"); - } - if ((this.compressedField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.enableSignatureVerificationFieldSet) - { - if ((this.enableSignatureVerificationField == YesNoType.no)) - { - writer.WriteAttributeString("EnableSignatureVerification", "no"); - } - if ((this.enableSignatureVerificationField == YesNoType.yes)) - { - writer.WriteAttributeString("EnableSignatureVerification", "yes"); - } - } - if (this.enableFeatureSelectionFieldSet) - { - if ((this.enableFeatureSelectionField == YesNoType.no)) - { - writer.WriteAttributeString("EnableFeatureSelection", "no"); - } - if ((this.enableFeatureSelectionField == YesNoType.yes)) - { - writer.WriteAttributeString("EnableFeatureSelection", "yes"); - } - } - if (this.forcePerMachineFieldSet) - { - if ((this.forcePerMachineField == YesNoType.no)) - { - writer.WriteAttributeString("ForcePerMachine", "no"); - } - if ((this.forcePerMachineField == YesNoType.yes)) - { - writer.WriteAttributeString("ForcePerMachine", "yes"); - } - } - if (this.suppressLooseFilePayloadGenerationFieldSet) - { - if ((this.suppressLooseFilePayloadGenerationField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressLooseFilePayloadGeneration", "no"); - } - if ((this.suppressLooseFilePayloadGenerationField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressLooseFilePayloadGeneration", "yes"); - } - } - if (this.visibleFieldSet) - { - if ((this.visibleField == YesNoType.no)) - { - writer.WriteAttributeString("Visible", "no"); - } - if ((this.visibleField == YesNoType.yes)) - { - writer.WriteAttributeString("Visible", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("DownloadUrl" == name)) - { - this.downloadUrlField = value; - this.downloadUrlFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("InstallSize" == name)) - { - this.installSizeField = value; - this.installSizeFieldSet = true; - } - if (("InstallCondition" == name)) - { - this.installConditionField = value; - this.installConditionFieldSet = true; - } - if (("Cache" == name)) - { - this.cacheField = Enums.ParseYesNoAlwaysType(value); - this.cacheFieldSet = true; - } - if (("CacheId" == name)) - { - this.cacheIdField = value; - this.cacheIdFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("LogPathVariable" == name)) - { - this.logPathVariableField = value; - this.logPathVariableFieldSet = true; - } - if (("RollbackLogPathVariable" == name)) - { - this.rollbackLogPathVariableField = value; - this.rollbackLogPathVariableFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoDefaultType(value); - this.compressedFieldSet = true; - } - if (("EnableSignatureVerification" == name)) - { - this.enableSignatureVerificationField = Enums.ParseYesNoType(value); - this.enableSignatureVerificationFieldSet = true; - } - if (("EnableFeatureSelection" == name)) - { - this.enableFeatureSelectionField = Enums.ParseYesNoType(value); - this.enableFeatureSelectionFieldSet = true; - } - if (("ForcePerMachine" == name)) - { - this.forcePerMachineField = Enums.ParseYesNoType(value); - this.forcePerMachineFieldSet = true; - } - if (("SuppressLooseFilePayloadGeneration" == name)) - { - this.suppressLooseFilePayloadGenerationField = Enums.ParseYesNoType(value); - this.suppressLooseFilePayloadGenerationFieldSet = true; - } - if (("Visible" == name)) - { - this.visibleField = Enums.ParseYesNoType(value); - this.visibleFieldSet = true; - } - } - } - - /// - /// Describes a single msp package to install. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MspPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string downloadUrlField; - - private bool downloadUrlFieldSet; - - private string idField; - - private bool idFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string installSizeField; - - private bool installSizeFieldSet; - - private string installConditionField; - - private bool installConditionFieldSet; - - private YesNoAlwaysType cacheField; - - private bool cacheFieldSet; - - private string cacheIdField; - - private bool cacheIdFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string logPathVariableField; - - private bool logPathVariableFieldSet; - - private string rollbackLogPathVariableField; - - private bool rollbackLogPathVariableFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private YesNoDefaultType compressedField; - - private bool compressedFieldSet; - - private YesNoType enableSignatureVerificationField; - - private bool enableSignatureVerificationFieldSet; - - private YesNoDefaultType perMachineField; - - private bool perMachineFieldSet; - - private YesNoType slipstreamField; - - private bool slipstreamFieldSet; - - private ISchemaElement parentElement; - - public MspPackage() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiProperty))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. - /// At a minimum, the SourceFile or Name attribute must be specified. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// The destination path and file name for this chain payload. Use this attribute to rename the - /// chain entry point or extract it into a subfolder. The default value is the file name from the - /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. - /// The use of '..' directories is not allowed. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public string DownloadUrl - { - get - { - return this.downloadUrlField; - } - set - { - this.downloadUrlFieldSet = true; - this.downloadUrlField = value; - } - } - - /// - /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute - /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The identifier of another package that this one should be installed after. By default the After - /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this - /// attribute is specified ensure that a cycle is not created explicitly or implicitly. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// The size this package will take on disk in bytes after it is installed. By default, the binder will - /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) - /// and use the total for the install size of the package. - /// - public string InstallSize - { - get - { - return this.installSizeField; - } - set - { - this.installSizeFieldSet = true; - this.installSizeField = value; - } - } - - /// - /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. - /// - public string InstallCondition - { - get - { - return this.installConditionField; - } - set - { - this.installConditionFieldSet = true; - this.installConditionField = value; - } - } - - /// - /// Whether to cache the package. The default is "yes". - /// - public YesNoAlwaysType Cache - { - get - { - return this.cacheField; - } - set - { - this.cacheFieldSet = true; - this.cacheField = value; - } - } - - /// - /// The identifier to use when caching the package. - /// - public string CacheId - { - get - { - return this.cacheIdField; - } - set - { - this.cacheIdFieldSet = true; - this.cacheIdField = value; - } - } - - /// - /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use - /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the - /// bootstrapper application data manifest. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use - /// the Description patch metadata property. Other package types must use this attribute to define a description in the - /// bootstrapper application data manifest. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not - /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. - /// - public string LogPathVariable - { - get - { - return this.logPathVariableField; - } - set - { - this.logPathVariableFieldSet = true; - this.logPathVariableField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause - /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which - /// default to no logging. - /// - public string RollbackLogPathVariable - { - get - { - return this.rollbackLogPathVariableField; - } - set - { - this.rollbackLogPathVariableFieldSet = true; - this.rollbackLogPathVariableField = value; - } - } - - /// - /// Specifies whether the package can be uninstalled. The default is "no". - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// Specifies whether the package must succeed for the chain to continue. The default "yes" - /// indicates that if the package fails then the chain will fail and rollback or stop. If - /// "no" is specified then the chain will continue even if the package reports failure. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// Whether the package payload should be embedded in a container or left as an external payload. - /// - public YesNoDefaultType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" - /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the - /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. - /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". - /// - public YesNoType EnableSignatureVerification - { - get - { - return this.enableSignatureVerificationField; - } - set - { - this.enableSignatureVerificationFieldSet = true; - this.enableSignatureVerificationField = value; - } - } - - /// - /// Indicates the package must be executed elevated. The default is "no". - /// - public YesNoDefaultType PerMachine - { - get - { - return this.perMachineField; - } - set - { - this.perMachineFieldSet = true; - this.perMachineField = value; - } - } - - /// - /// Specifies whether to automatically slipstream the patch for any target msi packages in the chain. The default is "no". - /// Even when the value is "no", you can still author the SlipstreamMsp element under MsiPackage elements as desired. - /// - public YesNoType Slipstream - { - get - { - return this.slipstreamField; - } - set - { - this.slipstreamFieldSet = true; - this.slipstreamField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("MsiProperty" == childName)) - { - childValue = new MsiProperty(); - } - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MspPackage", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.downloadUrlFieldSet) - { - writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.installSizeFieldSet) - { - writer.WriteAttributeString("InstallSize", this.installSizeField); - } - if (this.installConditionFieldSet) - { - writer.WriteAttributeString("InstallCondition", this.installConditionField); - } - if (this.cacheFieldSet) - { - if ((this.cacheField == YesNoAlwaysType.always)) - { - writer.WriteAttributeString("Cache", "always"); - } - if ((this.cacheField == YesNoAlwaysType.no)) - { - writer.WriteAttributeString("Cache", "no"); - } - if ((this.cacheField == YesNoAlwaysType.yes)) - { - writer.WriteAttributeString("Cache", "yes"); - } - } - if (this.cacheIdFieldSet) - { - writer.WriteAttributeString("CacheId", this.cacheIdField); - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.logPathVariableFieldSet) - { - writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); - } - if (this.rollbackLogPathVariableFieldSet) - { - writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Compressed", "default"); - } - if ((this.compressedField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.enableSignatureVerificationFieldSet) - { - if ((this.enableSignatureVerificationField == YesNoType.no)) - { - writer.WriteAttributeString("EnableSignatureVerification", "no"); - } - if ((this.enableSignatureVerificationField == YesNoType.yes)) - { - writer.WriteAttributeString("EnableSignatureVerification", "yes"); - } - } - if (this.perMachineFieldSet) - { - if ((this.perMachineField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("PerMachine", "default"); - } - if ((this.perMachineField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("PerMachine", "no"); - } - if ((this.perMachineField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("PerMachine", "yes"); - } - } - if (this.slipstreamFieldSet) - { - if ((this.slipstreamField == YesNoType.no)) - { - writer.WriteAttributeString("Slipstream", "no"); - } - if ((this.slipstreamField == YesNoType.yes)) - { - writer.WriteAttributeString("Slipstream", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("DownloadUrl" == name)) - { - this.downloadUrlField = value; - this.downloadUrlFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("InstallSize" == name)) - { - this.installSizeField = value; - this.installSizeFieldSet = true; - } - if (("InstallCondition" == name)) - { - this.installConditionField = value; - this.installConditionFieldSet = true; - } - if (("Cache" == name)) - { - this.cacheField = Enums.ParseYesNoAlwaysType(value); - this.cacheFieldSet = true; - } - if (("CacheId" == name)) - { - this.cacheIdField = value; - this.cacheIdFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("LogPathVariable" == name)) - { - this.logPathVariableField = value; - this.logPathVariableFieldSet = true; - } - if (("RollbackLogPathVariable" == name)) - { - this.rollbackLogPathVariableField = value; - this.rollbackLogPathVariableFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoDefaultType(value); - this.compressedFieldSet = true; - } - if (("EnableSignatureVerification" == name)) - { - this.enableSignatureVerificationField = Enums.ParseYesNoType(value); - this.enableSignatureVerificationFieldSet = true; - } - if (("PerMachine" == name)) - { - this.perMachineField = Enums.ParseYesNoDefaultType(value); - this.perMachineFieldSet = true; - } - if (("Slipstream" == name)) - { - this.slipstreamField = Enums.ParseYesNoType(value); - this.slipstreamFieldSet = true; - } - } - } - - /// - /// Describes a single msu package to install. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MsuPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string downloadUrlField; - - private bool downloadUrlFieldSet; - - private string idField; - - private bool idFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string installSizeField; - - private bool installSizeFieldSet; - - private string installConditionField; - - private bool installConditionFieldSet; - - private YesNoAlwaysType cacheField; - - private bool cacheFieldSet; - - private string cacheIdField; - - private bool cacheIdFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string logPathVariableField; - - private bool logPathVariableFieldSet; - - private string rollbackLogPathVariableField; - - private bool rollbackLogPathVariableFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private YesNoDefaultType compressedField; - - private bool compressedFieldSet; - - private YesNoType enableSignatureVerificationField; - - private bool enableSignatureVerificationFieldSet; - - private string detectConditionField; - - private bool detectConditionFieldSet; - - private string kBField; - - private bool kBFieldSet; - - private ISchemaElement parentElement; - - public MsuPackage() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackagePayload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. - /// At a minimum, the SourceFile or Name attribute must be specified. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// The destination path and file name for this chain payload. Use this attribute to rename the - /// chain entry point or extract it into a subfolder. The default value is the file name from the - /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. - /// The use of '..' directories is not allowed. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public string DownloadUrl - { - get - { - return this.downloadUrlField; - } - set - { - this.downloadUrlFieldSet = true; - this.downloadUrlField = value; - } - } - - /// - /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute - /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The identifier of another package that this one should be installed after. By default the After - /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this - /// attribute is specified ensure that a cycle is not created explicitly or implicitly. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// The size this package will take on disk in bytes after it is installed. By default, the binder will - /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) - /// and use the total for the install size of the package. - /// - public string InstallSize - { - get - { - return this.installSizeField; - } - set - { - this.installSizeFieldSet = true; - this.installSizeField = value; - } - } - - /// - /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. - /// - public string InstallCondition - { - get - { - return this.installConditionField; - } - set - { - this.installConditionFieldSet = true; - this.installConditionField = value; - } - } - - /// - /// Whether to cache the package. The default is "yes". - /// - public YesNoAlwaysType Cache - { - get - { - return this.cacheField; - } - set - { - this.cacheFieldSet = true; - this.cacheField = value; - } - } - - /// - /// The identifier to use when caching the package. - /// - public string CacheId - { - get - { - return this.cacheIdField; - } - set - { - this.cacheIdFieldSet = true; - this.cacheIdField = value; - } - } - - /// - /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use - /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the - /// bootstrapper application data manifest. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use - /// the Description patch metadata property. Other package types must use this attribute to define a description in the - /// bootstrapper application data manifest. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not - /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. - /// - public string LogPathVariable - { - get - { - return this.logPathVariableField; - } - set - { - this.logPathVariableFieldSet = true; - this.logPathVariableField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause - /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which - /// default to no logging. - /// - public string RollbackLogPathVariable - { - get - { - return this.rollbackLogPathVariableField; - } - set - { - this.rollbackLogPathVariableFieldSet = true; - this.rollbackLogPathVariableField = value; - } - } - - /// - /// Specifies whether the package can be uninstalled. The default is "no". - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// Specifies whether the package must succeed for the chain to continue. The default "yes" - /// indicates that if the package fails then the chain will fail and rollback or stop. If - /// "no" is specified then the chain will continue even if the package reports failure. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// Whether the package payload should be embedded in a container or left as an external payload. - /// - public YesNoDefaultType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" - /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the - /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. - /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". - /// - public YesNoType EnableSignatureVerification - { - get - { - return this.enableSignatureVerificationField; - } - set - { - this.enableSignatureVerificationFieldSet = true; - this.enableSignatureVerificationField = value; - } - } - - /// - /// A condition that determines if the package is present on the target system. This condition can use built-in - /// variables and variables returned by searches. This condition is necessary because Windows doesn't provide a - /// method to detect the presence of an MsuPackage. Burn uses this condition to determine how to treat this - /// package during a bundle action; for example, if this condition is false or omitted and the bundle is being - /// installed, Burn will install this package. - /// - public string DetectCondition - { - get - { - return this.detectConditionField; - } - set - { - this.detectConditionFieldSet = true; - this.detectConditionField = value; - } - } - - /// - /// The knowledge base identifier for the MSU. The KB attribute must be specified to enable the MSU package to - /// be uninstalled. Even then MSU uninstallation is only supported on Windows 7 and later. When the KB attribute - /// is specified, the Permanent attribute will the control whether the package is uninstalled. - /// - public string KB - { - get - { - return this.kBField; - } - set - { - this.kBFieldSet = true; - this.kBField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if (("MsuPackagePayload" == childName)) - { - childValue = new MsuPackagePayload(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MsuPackage", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.downloadUrlFieldSet) - { - writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.installSizeFieldSet) - { - writer.WriteAttributeString("InstallSize", this.installSizeField); - } - if (this.installConditionFieldSet) - { - writer.WriteAttributeString("InstallCondition", this.installConditionField); - } - if (this.cacheFieldSet) - { - if ((this.cacheField == YesNoAlwaysType.always)) - { - writer.WriteAttributeString("Cache", "always"); - } - if ((this.cacheField == YesNoAlwaysType.no)) - { - writer.WriteAttributeString("Cache", "no"); - } - if ((this.cacheField == YesNoAlwaysType.yes)) - { - writer.WriteAttributeString("Cache", "yes"); - } - } - if (this.cacheIdFieldSet) - { - writer.WriteAttributeString("CacheId", this.cacheIdField); - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.logPathVariableFieldSet) - { - writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); - } - if (this.rollbackLogPathVariableFieldSet) - { - writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Compressed", "default"); - } - if ((this.compressedField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.enableSignatureVerificationFieldSet) - { - if ((this.enableSignatureVerificationField == YesNoType.no)) - { - writer.WriteAttributeString("EnableSignatureVerification", "no"); - } - if ((this.enableSignatureVerificationField == YesNoType.yes)) - { - writer.WriteAttributeString("EnableSignatureVerification", "yes"); - } - } - if (this.detectConditionFieldSet) - { - writer.WriteAttributeString("DetectCondition", this.detectConditionField); - } - if (this.kBFieldSet) - { - writer.WriteAttributeString("KB", this.kBField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("DownloadUrl" == name)) - { - this.downloadUrlField = value; - this.downloadUrlFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("InstallSize" == name)) - { - this.installSizeField = value; - this.installSizeFieldSet = true; - } - if (("InstallCondition" == name)) - { - this.installConditionField = value; - this.installConditionFieldSet = true; - } - if (("Cache" == name)) - { - this.cacheField = Enums.ParseYesNoAlwaysType(value); - this.cacheFieldSet = true; - } - if (("CacheId" == name)) - { - this.cacheIdField = value; - this.cacheIdFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("LogPathVariable" == name)) - { - this.logPathVariableField = value; - this.logPathVariableFieldSet = true; - } - if (("RollbackLogPathVariable" == name)) - { - this.rollbackLogPathVariableField = value; - this.rollbackLogPathVariableFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoDefaultType(value); - this.compressedFieldSet = true; - } - if (("EnableSignatureVerification" == name)) - { - this.enableSignatureVerificationField = Enums.ParseYesNoType(value); - this.enableSignatureVerificationFieldSet = true; - } - if (("DetectCondition" == name)) - { - this.detectConditionField = value; - this.detectConditionFieldSet = true; - } - if (("KB" == name)) - { - this.kBField = value; - this.kBFieldSet = true; - } - } - } - - /// - /// Describes a single exe package to install. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ExePackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string downloadUrlField; - - private bool downloadUrlFieldSet; - - private string idField; - - private bool idFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string installSizeField; - - private bool installSizeFieldSet; - - private string installConditionField; - - private bool installConditionFieldSet; - - private YesNoAlwaysType cacheField; - - private bool cacheFieldSet; - - private string cacheIdField; - - private bool cacheIdFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string logPathVariableField; - - private bool logPathVariableFieldSet; - - private string rollbackLogPathVariableField; - - private bool rollbackLogPathVariableFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private YesNoDefaultType compressedField; - - private bool compressedFieldSet; - - private YesNoType enableSignatureVerificationField; - - private bool enableSignatureVerificationFieldSet; - - private string detectConditionField; - - private bool detectConditionFieldSet; - - private string installCommandField; - - private bool installCommandFieldSet; - - private string repairCommandField; - - private bool repairCommandFieldSet; - - private string uninstallCommandField; - - private bool uninstallCommandFieldSet; - - private YesNoDefaultType perMachineField; - - private bool perMachineFieldSet; - - private BurnExeProtocolType protocolField; - - private bool protocolFieldSet; - - private ISchemaElement parentElement; - - public ExePackage() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackagePayload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExitCode))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CommandLine))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. - /// At a minimum, the SourceFile or Name attribute must be specified. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// The destination path and file name for this chain payload. Use this attribute to rename the - /// chain entry point or extract it into a subfolder. The default value is the file name from the - /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. - /// The use of '..' directories is not allowed. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public string DownloadUrl - { - get - { - return this.downloadUrlField; - } - set - { - this.downloadUrlFieldSet = true; - this.downloadUrlField = value; - } - } - - /// - /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute - /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The identifier of another package that this one should be installed after. By default the After - /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this - /// attribute is specified ensure that a cycle is not created explicitly or implicitly. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// The size this package will take on disk in bytes after it is installed. By default, the binder will - /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) - /// and use the total for the install size of the package. - /// - public string InstallSize - { - get - { - return this.installSizeField; - } - set - { - this.installSizeFieldSet = true; - this.installSizeField = value; - } - } - - /// - /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. - /// - public string InstallCondition - { - get - { - return this.installConditionField; - } - set - { - this.installConditionFieldSet = true; - this.installConditionField = value; - } - } - - /// - /// Whether to cache the package. The default is "yes". - /// - public YesNoAlwaysType Cache - { - get - { - return this.cacheField; - } - set - { - this.cacheFieldSet = true; - this.cacheField = value; - } - } - - /// - /// The identifier to use when caching the package. - /// - public string CacheId - { - get - { - return this.cacheIdField; - } - set - { - this.cacheIdFieldSet = true; - this.cacheIdField = value; - } - } - - /// - /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use - /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the - /// bootstrapper application data manifest. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages - /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use - /// the Description patch metadata property. Other package types must use this attribute to define a description in the - /// bootstrapper application data manifest. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not - /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. - /// - public string LogPathVariable - { - get - { - return this.logPathVariableField; - } - set - { - this.logPathVariableFieldSet = true; - this.logPathVariableField = value; - } - } - - /// - /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause - /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which - /// default to no logging. - /// - public string RollbackLogPathVariable - { - get - { - return this.rollbackLogPathVariableField; - } - set - { - this.rollbackLogPathVariableFieldSet = true; - this.rollbackLogPathVariableField = value; - } - } - - /// - /// Specifies whether the package can be uninstalled. The default is "no". - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// Specifies whether the package must succeed for the chain to continue. The default "yes" - /// indicates that if the package fails then the chain will fail and rollback or stop. If - /// "no" is specified then the chain will continue even if the package reports failure. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// Whether the package payload should be embedded in a container or left as an external payload. - /// - public YesNoDefaultType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" - /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the - /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. - /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". - /// - public YesNoType EnableSignatureVerification - { - get - { - return this.enableSignatureVerificationField; - } - set - { - this.enableSignatureVerificationFieldSet = true; - this.enableSignatureVerificationField = value; - } - } - - /// - /// A condition that determines if the package is present on the target system. This condition can use built-in - /// variables and variables returned by searches. This condition is necessary because Windows doesn't provide a - /// method to detect the presence of an ExePackage. Burn uses this condition to determine how to treat this - /// package during a bundle action; for example, if this condition is false or omitted and the bundle is being - /// installed, Burn will install this package. - /// - public string DetectCondition - { - get - { - return this.detectConditionField; - } - set - { - this.detectConditionFieldSet = true; - this.detectConditionField = value; - } - } - - /// - /// The command-line arguments provided to the ExePackage during install. If this attribute is absent the executable will be launched with no command-line arguments. - /// - public string InstallCommand - { - get - { - return this.installCommandField; - } - set - { - this.installCommandFieldSet = true; - this.installCommandField = value; - } - } - - /// - /// The command-line arguments to specify to indicate a repair. If the executable package can be repaired but - /// does not require any special command-line arguments to do so then set the attribute's value to blank. To - /// indicate that the package does not support repair, omit this attribute. - /// - public string RepairCommand - { - get - { - return this.repairCommandField; - } - set - { - this.repairCommandFieldSet = true; - this.repairCommandField = value; - } - } - - /// - /// The command-line arguments provided to the ExePackage during uninstall. If this attribute is absent the executable will be launched with no command-line arguments. To prevent an ExePackage from being uninstalled set the Permanent attribute to "yes". - /// - public string UninstallCommand - { - get - { - return this.uninstallCommandField; - } - set - { - this.uninstallCommandFieldSet = true; - this.uninstallCommandField = value; - } - } - - /// - /// Indicates the package must be executed elevated. The default is "no". - /// - public YesNoDefaultType PerMachine - { - get - { - return this.perMachineField; - } - set - { - this.perMachineFieldSet = true; - this.perMachineField = value; - } - } - - /// - /// Indicates the communication protocol the package supports for extended progress and error reporting. The default is "none". - /// - public BurnExeProtocolType Protocol - { - get - { - return this.protocolField; - } - set - { - this.protocolFieldSet = true; - this.protocolField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if (("ExePackagePayload" == childName)) - { - childValue = new ExePackagePayload(); - } - if (("ExitCode" == childName)) - { - childValue = new ExitCode(); - } - if (("CommandLine" == childName)) - { - childValue = new CommandLine(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ExePackage", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.downloadUrlFieldSet) - { - writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.installSizeFieldSet) - { - writer.WriteAttributeString("InstallSize", this.installSizeField); - } - if (this.installConditionFieldSet) - { - writer.WriteAttributeString("InstallCondition", this.installConditionField); - } - if (this.cacheFieldSet) - { - if ((this.cacheField == YesNoAlwaysType.always)) - { - writer.WriteAttributeString("Cache", "always"); - } - if ((this.cacheField == YesNoAlwaysType.no)) - { - writer.WriteAttributeString("Cache", "no"); - } - if ((this.cacheField == YesNoAlwaysType.yes)) - { - writer.WriteAttributeString("Cache", "yes"); - } - } - if (this.cacheIdFieldSet) - { - writer.WriteAttributeString("CacheId", this.cacheIdField); - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.logPathVariableFieldSet) - { - writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); - } - if (this.rollbackLogPathVariableFieldSet) - { - writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Compressed", "default"); - } - if ((this.compressedField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.enableSignatureVerificationFieldSet) - { - if ((this.enableSignatureVerificationField == YesNoType.no)) - { - writer.WriteAttributeString("EnableSignatureVerification", "no"); - } - if ((this.enableSignatureVerificationField == YesNoType.yes)) - { - writer.WriteAttributeString("EnableSignatureVerification", "yes"); - } - } - if (this.detectConditionFieldSet) - { - writer.WriteAttributeString("DetectCondition", this.detectConditionField); - } - if (this.installCommandFieldSet) - { - writer.WriteAttributeString("InstallCommand", this.installCommandField); - } - if (this.repairCommandFieldSet) - { - writer.WriteAttributeString("RepairCommand", this.repairCommandField); - } - if (this.uninstallCommandFieldSet) - { - writer.WriteAttributeString("UninstallCommand", this.uninstallCommandField); - } - if (this.perMachineFieldSet) - { - if ((this.perMachineField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("PerMachine", "default"); - } - if ((this.perMachineField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("PerMachine", "no"); - } - if ((this.perMachineField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("PerMachine", "yes"); - } - } - if (this.protocolFieldSet) - { - if ((this.protocolField == BurnExeProtocolType.none)) - { - writer.WriteAttributeString("Protocol", "none"); - } - if ((this.protocolField == BurnExeProtocolType.burn)) - { - writer.WriteAttributeString("Protocol", "burn"); - } - if ((this.protocolField == BurnExeProtocolType.netfx4)) - { - writer.WriteAttributeString("Protocol", "netfx4"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("DownloadUrl" == name)) - { - this.downloadUrlField = value; - this.downloadUrlFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("InstallSize" == name)) - { - this.installSizeField = value; - this.installSizeFieldSet = true; - } - if (("InstallCondition" == name)) - { - this.installConditionField = value; - this.installConditionFieldSet = true; - } - if (("Cache" == name)) - { - this.cacheField = Enums.ParseYesNoAlwaysType(value); - this.cacheFieldSet = true; - } - if (("CacheId" == name)) - { - this.cacheIdField = value; - this.cacheIdFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("LogPathVariable" == name)) - { - this.logPathVariableField = value; - this.logPathVariableFieldSet = true; - } - if (("RollbackLogPathVariable" == name)) - { - this.rollbackLogPathVariableField = value; - this.rollbackLogPathVariableFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoDefaultType(value); - this.compressedFieldSet = true; - } - if (("EnableSignatureVerification" == name)) - { - this.enableSignatureVerificationField = Enums.ParseYesNoType(value); - this.enableSignatureVerificationFieldSet = true; - } - if (("DetectCondition" == name)) - { - this.detectConditionField = value; - this.detectConditionFieldSet = true; - } - if (("InstallCommand" == name)) - { - this.installCommandField = value; - this.installCommandFieldSet = true; - } - if (("RepairCommand" == name)) - { - this.repairCommandField = value; - this.repairCommandFieldSet = true; - } - if (("UninstallCommand" == name)) - { - this.uninstallCommandField = value; - this.uninstallCommandFieldSet = true; - } - if (("PerMachine" == name)) - { - this.perMachineField = Enums.ParseYesNoDefaultType(value); - this.perMachineFieldSet = true; - } - if (("Protocol" == name)) - { - this.protocolField = Enums.ParseBurnExeProtocolType(value); - this.protocolFieldSet = true; - } - } - } - - /// - /// Describes a rollback boundary in the chain. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RollbackBoundary : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private YesNoType transactionField; - - private bool transactionFieldSet; - - private ISchemaElement parentElement; - - public RollbackBoundary() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for this rollback boundary, for ordering and cross-referencing. If this attribute is - /// not provided a stable identifier will be generated. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Specifies whether the rollback boundary aborts the chain. The default "yes" indicates that if - /// the rollback boundary is encountered then the chain will fail and rollback or stop. If "no" - /// is specified then the chain should continue successfuly at the next rollback boundary. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// Specifies whether the rollback boundary is wrapped in an MSI transaction. The default is "no" - /// - public YesNoType Transaction - { - get - { - return this.transactionField; - } - set - { - this.transactionFieldSet = true; - this.transactionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RollbackBoundary", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.transactionFieldSet) - { - if ((this.transactionField == YesNoType.no)) - { - writer.WriteAttributeString("Transaction", "no"); - } - if ((this.transactionField == YesNoType.yes)) - { - writer.WriteAttributeString("Transaction", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("Transaction" == name)) - { - this.transactionField = Enums.ParseYesNoType(value); - this.transactionFieldSet = true; - } - } - } - - /// - /// Describes a package group to a bootstrapper. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PackageGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public PackageGroup() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MspPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RollbackBoundary))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for package group. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("MsiPackage" == childName)) - { - childValue = new MsiPackage(); - } - if (("MspPackage" == childName)) - { - childValue = new MspPackage(); - } - if (("MsuPackage" == childName)) - { - childValue = new MsuPackage(); - } - if (("ExePackage" == childName)) - { - childValue = new ExePackage(); - } - if (("RollbackBoundary" == childName)) - { - childValue = new RollbackBoundary(); - } - if (("PackageGroupRef" == childName)) - { - childValue = new PackageGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PackageGroup", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Create a reference to PackageGroup element that exists inside a Bundle or Fragment element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PackageGroupRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the PackageGroup element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The identifier of a package that this group should be installed after. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PackageGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - } - } - - /// - /// Allows an MSI property to be set based on the value of a burn engine expression. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MsiProperty : ISchemaElement, ISetAttributes - { - - private string nameField; - - private bool nameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of the MSI property to set. Burn controls the follow MSI properties so they cannot be set with MsiProperty: ACTION, ALLUSERS, REBOOT, REINSTALL, REINSTALLMODE - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The value to set the property to. This string is evaluated by the burn engine and can be as simple as a burn engine variable reference or as complex as a full expression. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MsiProperty", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Specifies a patch included in the same bundle that is installed when the parent MSI package is installed. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SlipstreamMsp : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier for a MspPackage in the bundle. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SlipstreamMsp", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Describes a burn engine variable to define. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Variable : ISchemaElement, ISetAttributes - { - - private YesNoType hiddenField; - - private bool hiddenFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private YesNoType persistedField; - - private bool persistedFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private ISchemaElement parentElement; - - /// - /// Whether the value of the variable should be hidden. - /// - public YesNoType Hidden - { - get - { - return this.hiddenField; - } - set - { - this.hiddenFieldSet = true; - this.hiddenField = value; - } - } - - /// - /// The name for the variable. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Whether the variable should be persisted. - /// - public YesNoType Persisted - { - get - { - return this.persistedField; - } - set - { - this.persistedFieldSet = true; - this.persistedField = value; - } - } - - /// - /// Starting value for the variable. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// Type of the variable, inferred from the value if not specified. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - Variable.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("string" == value)) - { - parsedValue = TypeType.@string; - } - else - { - if (("numeric" == value)) - { - parsedValue = TypeType.numeric; - } - else - { - if (("version" == value)) - { - parsedValue = TypeType.version; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Variable", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.hiddenFieldSet) - { - if ((this.hiddenField == YesNoType.no)) - { - writer.WriteAttributeString("Hidden", "no"); - } - if ((this.hiddenField == YesNoType.yes)) - { - writer.WriteAttributeString("Hidden", "yes"); - } - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.persistedFieldSet) - { - if ((this.persistedField == YesNoType.no)) - { - writer.WriteAttributeString("Persisted", "no"); - } - if ((this.persistedField == YesNoType.yes)) - { - writer.WriteAttributeString("Persisted", "yes"); - } - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.@string)) - { - writer.WriteAttributeString("Type", "string"); - } - if ((this.typeField == TypeType.numeric)) - { - writer.WriteAttributeString("Type", "numeric"); - } - if ((this.typeField == TypeType.version)) - { - writer.WriteAttributeString("Type", "version"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Hidden" == name)) - { - this.hiddenField = Enums.ParseYesNoType(value); - this.hiddenFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Persisted" == name)) - { - this.persistedField = Enums.ParseYesNoType(value); - this.persistedFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = Variable.ParseTypeType(value); - this.typeFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - @string, - - numeric, - - version, - } - } - - /// - /// Representation of a file that contains one or more files. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Container : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string downloadUrlField; - - private bool downloadUrlFieldSet; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private BurnContainerType typeField; - - private bool typeFieldSet; - - private ISchemaElement parentElement; - - public Container() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string DownloadUrl - { - get - { - return this.downloadUrlField; - } - set - { - this.downloadUrlFieldSet = true; - this.downloadUrlField = value; - } - } - - /// - /// The unique identifier for the container. If this attribute is not specified the Name attribute will be used. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The file name for this container. A relative path may be provided to place the container in a sub-folder of the bundle. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Indicates whether the container is "attached" to the bundle executable or placed external to the bundle extecutable as "detached". If - /// this attribute is not specified, the default is to create a detached container. - /// - public BurnContainerType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("PackageGroupRef" == childName)) - { - childValue = new PackageGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Container", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.downloadUrlFieldSet) - { - writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.typeFieldSet) - { - if ((this.typeField == BurnContainerType.attached)) - { - writer.WriteAttributeString("Type", "attached"); - } - if ((this.typeField == BurnContainerType.detached)) - { - writer.WriteAttributeString("Type", "detached"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("DownloadUrl" == name)) - { - this.downloadUrlField = value; - this.downloadUrlFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = Enums.ParseBurnContainerType(value); - this.typeFieldSet = true; - } - } - } - - /// - /// Create a reference to an existing Container element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ContainerRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of Container element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ContainerRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Describes map of exit code returned from executable package to a bootstrapper behavior. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ExitCode : ISchemaElement, ISetAttributes - { - - private int valueField; - - private bool valueFieldSet; - - private BehaviorType behaviorField; - - private bool behaviorFieldSet; - - private ISchemaElement parentElement; - - /// - /// Exit code returned from executable package. If no value is provided it means all values not explicitly set default to this behavior. - /// - public int Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// Choose one of the supported behaviors error codes: success, error, scheduleReboot, forceReboot. - /// - public BehaviorType Behavior - { - get - { - return this.behaviorField; - } - set - { - this.behaviorFieldSet = true; - this.behaviorField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a BehaviorType from a string. - /// - public static BehaviorType ParseBehaviorType(string value) - { - BehaviorType parsedValue; - ExitCode.TryParseBehaviorType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a BehaviorType from a string. - /// - public static bool TryParseBehaviorType(string value, out BehaviorType parsedValue) - { - parsedValue = BehaviorType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("success" == value)) - { - parsedValue = BehaviorType.success; - } - else - { - if (("error" == value)) - { - parsedValue = BehaviorType.error; - } - else - { - if (("scheduleReboot" == value)) - { - parsedValue = BehaviorType.scheduleReboot; - } - else - { - if (("forceReboot" == value)) - { - parsedValue = BehaviorType.forceReboot; - } - else - { - parsedValue = BehaviorType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ExitCode", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField.ToString(CultureInfo.InvariantCulture)); - } - if (this.behaviorFieldSet) - { - if ((this.behaviorField == BehaviorType.success)) - { - writer.WriteAttributeString("Behavior", "success"); - } - if ((this.behaviorField == BehaviorType.error)) - { - writer.WriteAttributeString("Behavior", "error"); - } - if ((this.behaviorField == BehaviorType.scheduleReboot)) - { - writer.WriteAttributeString("Behavior", "scheduleReboot"); - } - if ((this.behaviorField == BehaviorType.forceReboot)) - { - writer.WriteAttributeString("Behavior", "forceReboot"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Value" == name)) - { - this.valueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.valueFieldSet = true; - } - if (("Behavior" == name)) - { - this.behaviorField = ExitCode.ParseBehaviorType(value); - this.behaviorFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum BehaviorType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - success, - - error, - - scheduleReboot, - - forceReboot, - } - } - - /// - /// Describes additional, conditional command-line arguments for an ExePackage. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CommandLine : ISchemaElement, ISetAttributes - { - - private string installArgumentField; - - private bool installArgumentFieldSet; - - private string uninstallArgumentField; - - private bool uninstallArgumentFieldSet; - - private string repairArgumentField; - - private bool repairArgumentFieldSet; - - private string conditionField; - - private bool conditionFieldSet; - - private ISchemaElement parentElement; - - /// - /// Additional command-line arguments to apply during package installation if Condition is true. - /// - public string InstallArgument - { - get - { - return this.installArgumentField; - } - set - { - this.installArgumentFieldSet = true; - this.installArgumentField = value; - } - } - - /// - /// Additional command-line arguments to apply during package uninstallation if Condition is true. - /// - public string UninstallArgument - { - get - { - return this.uninstallArgumentField; - } - set - { - this.uninstallArgumentFieldSet = true; - this.uninstallArgumentField = value; - } - } - - /// - /// Additional command-line arguments to apply during package repair if Condition is true. - /// - public string RepairArgument - { - get - { - return this.repairArgumentField; - } - set - { - this.repairArgumentFieldSet = true; - this.repairArgumentField = value; - } - } - - /// - /// The condition that controls whether the command-line arguments specified in the - /// InstallArgument, UninstallArgument, or RepairArgument attributes are appended to the - /// command line passed to the ExePackage. Which attribute is used depends on the - /// action being applied to the ExePackage. For example, when the ExePackage is - /// being installed, the InstallArgument attribute value is appended to the command - /// line when the ExePackage is executed. - /// - public string Condition - { - get - { - return this.conditionField; - } - set - { - this.conditionFieldSet = true; - this.conditionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CommandLine", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.installArgumentFieldSet) - { - writer.WriteAttributeString("InstallArgument", this.installArgumentField); - } - if (this.uninstallArgumentFieldSet) - { - writer.WriteAttributeString("UninstallArgument", this.uninstallArgumentField); - } - if (this.repairArgumentFieldSet) - { - writer.WriteAttributeString("RepairArgument", this.repairArgumentField); - } - if (this.conditionFieldSet) - { - writer.WriteAttributeString("Condition", this.conditionField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("InstallArgument" == name)) - { - this.installArgumentField = value; - this.installArgumentFieldSet = true; - } - if (("UninstallArgument" == name)) - { - this.uninstallArgumentField = value; - this.uninstallArgumentFieldSet = true; - } - if (("RepairArgument" == name)) - { - this.repairArgumentField = value; - this.repairArgumentFieldSet = true; - } - if (("Condition" == name)) - { - this.conditionField = value; - this.conditionFieldSet = true; - } - } - } - - /// - /// Describes a payload to a bootstrapper. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Payload : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoDefaultType compressedField; - - private bool compressedFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string downloadUrlField; - - private bool downloadUrlFieldSet; - - private YesNoType enableSignatureVerificationField; - - private bool enableSignatureVerificationFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of Payload element. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Whether the payload should be embedded in a container or left as an external payload. - /// - public YesNoDefaultType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// Location of the source file. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// The destination path and file name for this payload. The default is the source file name. The use of '..' directories is not allowed. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - public string DownloadUrl - { - get - { - return this.downloadUrlField; - } - set - { - this.downloadUrlFieldSet = true; - this.downloadUrlField = value; - } - } - - /// - /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" - /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the - /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. - /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". - /// - public YesNoType EnableSignatureVerification - { - get - { - return this.enableSignatureVerificationField; - } - set - { - this.enableSignatureVerificationFieldSet = true; - this.enableSignatureVerificationField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Payload", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Compressed", "default"); - } - if ((this.compressedField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.downloadUrlFieldSet) - { - writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); - } - if (this.enableSignatureVerificationFieldSet) - { - if ((this.enableSignatureVerificationField == YesNoType.no)) - { - writer.WriteAttributeString("EnableSignatureVerification", "no"); - } - if ((this.enableSignatureVerificationField == YesNoType.yes)) - { - writer.WriteAttributeString("EnableSignatureVerification", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoDefaultType(value); - this.compressedFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("DownloadUrl" == name)) - { - this.downloadUrlField = value; - this.downloadUrlFieldSet = true; - } - if (("EnableSignatureVerification" == name)) - { - this.enableSignatureVerificationField = Enums.ParseYesNoType(value); - this.enableSignatureVerificationFieldSet = true; - } - } - } - - /// - /// Describes a payload group to a bootstrapper. PayloadGroups referenced from within a Bundle are tied to the Bundle. - /// PayloadGroups referenced from a Fragment are tied to the context of whatever references them such as an ExePackage or MsiPackage. - /// It is possible to share a PayloadGroup between multiple Packages and/or a Bundle by creating multiple references to it. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PayloadGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public PayloadGroup() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for payload group. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Payload" == childName)) - { - childValue = new Payload(); - } - if (("PayloadGroupRef" == childName)) - { - childValue = new PayloadGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PayloadGroup", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Create a reference to PayloadGroup element that exists inside a Bundle or Fragment element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PayloadGroupRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the PayloadGroup element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PayloadGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - public class ExePackagePayload : RemotePayload - { - public ExePackagePayload() : base("ExePackagePayload") { } - } - - public class MsuPackagePayload : RemotePayload - { - public MsuPackagePayload() : base("MsuPackagePayload") { } - } - - /// - /// Describes information about a remote file payload that is not available at the time of building the bundle. - /// The parent must specify DownloadUrl and must not specify SourceFile when using this element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public abstract class RemotePayload : ISchemaElement, ISetAttributes - { - private string elementName; - - public RemotePayload(string elementName) - { - this.elementName = elementName; - } - - private string descriptionField; - - private bool descriptionFieldSet; - - private string hashField; - - private bool hashFieldSet; - - private string productNameField; - - private bool productNameFieldSet; - - private long sizeField; - - private bool sizeFieldSet; - - private string versionField; - - private bool versionFieldSet; - - private ISchemaElement parentElement; - - /// - /// Description of the file from version resources. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// SHA-1 hash of the RemotePayload. Include this attribute if the remote file is unsigned or SuppressSignatureVerification is set to Yes. - /// - public string Hash - { - get - { - return this.hashField; - } - set - { - this.hashFieldSet = true; - this.hashField = value; - } - } - - /// - /// Product name of the file from version resouces. - /// - public string ProductName - { - get - { - return this.productNameField; - } - set - { - this.productNameFieldSet = true; - this.productNameField = value; - } - } - - /// - /// Size of the remote file in bytes. - /// - public long Size - { - get - { - return this.sizeField; - } - set - { - this.sizeFieldSet = true; - this.sizeField = value; - } - } - - /// - /// Version of the remote file - /// - public string Version - { - get - { - return this.versionField; - } - set - { - this.versionFieldSet = true; - this.versionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement(this.elementName, "http://wixtoolset.org/schemas/v4/wxs"); - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.hashFieldSet) - { - writer.WriteAttributeString("Hash", this.hashField); - } - if (this.productNameFieldSet) - { - writer.WriteAttributeString("ProductName", this.productNameField); - } - if (this.sizeFieldSet) - { - writer.WriteAttributeString("Size", this.sizeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.versionFieldSet) - { - writer.WriteAttributeString("Version", this.versionField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Hash" == name)) - { - this.hashField = value; - this.hashFieldSet = true; - } - if (("ProductName" == name)) - { - this.productNameField = value; - this.productNameFieldSet = true; - } - if (("Size" == name)) - { - this.sizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sizeFieldSet = true; - } - if (("Version" == name)) - { - this.versionField = value; - this.versionFieldSet = true; - } - } - } - - /// - /// Create a RelatedBundle element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RelatedBundle : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the RelatedBundle group. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The action to take on bundles related to this one. Detect is the default. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - RelatedBundle.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("Detect" == value)) - { - parsedValue = ActionType.Detect; - } - else - { - if (("Upgrade" == value)) - { - parsedValue = ActionType.Upgrade; - } - else - { - if (("Addon" == value)) - { - parsedValue = ActionType.Addon; - } - else - { - if (("Patch" == value)) - { - parsedValue = ActionType.Patch; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RelatedBundle", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.Detect)) - { - writer.WriteAttributeString("Action", "Detect"); - } - if ((this.actionField == ActionType.Upgrade)) - { - writer.WriteAttributeString("Action", "Upgrade"); - } - if ((this.actionField == ActionType.Addon)) - { - writer.WriteAttributeString("Action", "Addon"); - } - if ((this.actionField == ActionType.Patch)) - { - writer.WriteAttributeString("Action", "Patch"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = RelatedBundle.ParseActionType(value); - this.actionFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - Detect, - - Upgrade, - - Addon, - - Patch, - } - } - - /// - /// Defines the update for a Bundle. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Update : ISchemaElement, ISetAttributes - { - - private string locationField; - - private bool locationFieldSet; - - private ISchemaElement parentElement; - - /// - /// The absolute path or URL to check for an update bundle. Currently the engine provides this value - /// in the IBootstrapperApplication::OnDetectUpdateBegin() and otherwise ignores the value. In the - /// future the engine will be able to acquire an update bundle from the location and determine if it - /// is newer than the current executing bundle. - /// - public string Location - { - get - { - return this.locationField; - } - set - { - this.locationFieldSet = true; - this.locationField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Update", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.locationFieldSet) - { - writer.WriteAttributeString("Location", this.locationField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Location" == name)) - { - this.locationField = value; - this.locationFieldSet = true; - } - } - } - - /// - /// The Package element is analogous to the main function in a C program. When linking, only one Package section - /// can be given to the linker to produce a successful result. Using this element creates an msi file. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Package : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string codepageField; - - private bool codepageFieldSet; - - private string languageField; - - private bool languageFieldSet; - - private string manufacturerField; - - private bool manufacturerFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string upgradeCodeField; - - private bool upgradeCodeFieldSet; - - private string versionField; - - private bool versionFieldSet; - - private ISchemaElement parentElement; - - public Package() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SummaryInformation))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComplianceCheck))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroup))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(InstanceTransforms))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(MajorUpgrade))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(MediaTemplate))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PackageCertificates))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCertificates))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Upgrade))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); - ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); - childCollection1.AddCollection(childCollection2); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The product code GUID for the product. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The code page integer value or web name for the resulting MSI. See remarks for more information. - /// - public string Codepage - { - get - { - return this.codepageField; - } - set - { - this.codepageFieldSet = true; - this.codepageField = value; - } - } - - /// - /// The decimal language ID (LCID) for the product. - /// - public string Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - /// - /// The manufacturer of the product. - /// - public string Manufacturer - { - get - { - return this.manufacturerField; - } - set - { - this.manufacturerFieldSet = true; - this.manufacturerField = value; - } - } - - /// - /// The descriptive name of the product. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The upgrade code GUID for the product. - /// - public string UpgradeCode - { - get - { - return this.upgradeCodeField; - } - set - { - this.upgradeCodeFieldSet = true; - this.upgradeCodeField = value; - } - } - - /// - /// The product's version string. - /// - public string Version - { - get - { - return this.versionField; - } - set - { - this.versionFieldSet = true; - this.versionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("SummaryInformation" == childName)) - { - childValue = new SummaryInformation(); - } - if (("AppId" == childName)) - { - childValue = new AppId(); - } - if (("Binary" == childName)) - { - childValue = new Binary(); - } - if (("ComplianceCheck" == childName)) - { - childValue = new ComplianceCheck(); - } - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("ComponentGroup" == childName)) - { - childValue = new ComponentGroup(); - } - if (("Condition" == childName)) - { - childValue = new Condition(); - } - if (("CustomAction" == childName)) - { - childValue = new CustomAction(); - } - if (("CustomActionRef" == childName)) - { - childValue = new CustomActionRef(); - } - if (("CustomTable" == childName)) - { - childValue = new CustomTable(); - } - if (("Directory" == childName)) - { - childValue = new Directory(); - } - if (("DirectoryRef" == childName)) - { - childValue = new DirectoryRef(); - } - if (("EmbeddedChainer" == childName)) - { - childValue = new EmbeddedChainer(); - } - if (("EmbeddedChainerRef" == childName)) - { - childValue = new EmbeddedChainerRef(); - } - if (("EnsureTable" == childName)) - { - childValue = new EnsureTable(); - } - if (("Feature" == childName)) - { - childValue = new Feature(); - } - if (("FeatureRef" == childName)) - { - childValue = new FeatureRef(); - } - if (("FeatureGroupRef" == childName)) - { - childValue = new FeatureGroupRef(); - } - if (("Icon" == childName)) - { - childValue = new Icon(); - } - if (("InstanceTransforms" == childName)) - { - childValue = new InstanceTransforms(); - } - if (("MajorUpgrade" == childName)) - { - childValue = new MajorUpgrade(); - } - if (("Media" == childName)) - { - childValue = new Media(); - } - if (("MediaTemplate" == childName)) - { - childValue = new MediaTemplate(); - } - if (("PackageCertificates" == childName)) - { - childValue = new PackageCertificates(); - } - if (("PatchCertificates" == childName)) - { - childValue = new PatchCertificates(); - } - if (("Property" == childName)) - { - childValue = new Property(); - } - if (("PropertyRef" == childName)) - { - childValue = new PropertyRef(); - } - if (("SetDirectory" == childName)) - { - childValue = new SetDirectory(); - } - if (("SetProperty" == childName)) - { - childValue = new SetProperty(); - } - if (("SFPCatalog" == childName)) - { - childValue = new SFPCatalog(); - } - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if (("UI" == childName)) - { - childValue = new UI(); - } - if (("UIRef" == childName)) - { - childValue = new UIRef(); - } - if (("Upgrade" == childName)) - { - childValue = new Upgrade(); - } - if (("WixVariable" == childName)) - { - childValue = new WixVariable(); - } - if (("InstallExecuteSequence" == childName)) - { - childValue = new InstallExecuteSequence(); - } - if (("InstallUISequence" == childName)) - { - childValue = new InstallUISequence(); - } - if (("AdminExecuteSequence" == childName)) - { - childValue = new AdminExecuteSequence(); - } - if (("AdminUISequence" == childName)) - { - childValue = new AdminUISequence(); - } - if (("AdvertiseExecuteSequence" == childName)) - { - childValue = new AdvertiseExecuteSequence(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Package", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.codepageFieldSet) - { - writer.WriteAttributeString("Codepage", this.codepageField); - } - if (this.languageFieldSet) - { - writer.WriteAttributeString("Language", this.languageField); - } - if (this.manufacturerFieldSet) - { - writer.WriteAttributeString("Manufacturer", this.manufacturerField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.upgradeCodeFieldSet) - { - writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); - } - if (this.versionFieldSet) - { - writer.WriteAttributeString("Version", this.versionField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Codepage" == name)) - { - this.codepageField = value; - this.codepageFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = value; - this.languageFieldSet = true; - } - if (("Manufacturer" == name)) - { - this.manufacturerField = value; - this.manufacturerFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("UpgradeCode" == name)) - { - this.upgradeCodeField = value; - this.upgradeCodeFieldSet = true; - } - if (("Version" == name)) - { - this.versionField = value; - this.versionFieldSet = true; - } - } - } - - /// - /// The Module element is analogous to the main function in a C program. When linking, only - /// one Module section can be given to the linker to produce a successful result. Using this - /// element creates an msm file. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Module : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string codepageField; - - private bool codepageFieldSet; - - private string guidField; - - private bool guidFieldSet; - - private string languageField; - - private bool languageFieldSet; - - private string versionField; - - private bool versionFieldSet; - - private ISchemaElement parentElement; - - public Module() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SummaryInformation))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Configuration))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Dependency))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Exclusion))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreModularization))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreTable))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Substitution))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); - ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); - childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); - childCollection1.AddCollection(childCollection2); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The name of the merge module (not the file name). - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The code page integer value or web name for the resulting MSM. See remarks for more information. - /// - public string Codepage - { - get - { - return this.codepageField; - } - set - { - this.codepageFieldSet = true; - this.codepageField = value; - } - } - - /// - /// The modularizaion Guid. - /// - public string Guid - { - get - { - return this.guidField; - } - set - { - this.guidFieldSet = true; - this.guidField = value; - } - } - - /// - /// The decimal language ID (LCID) of the merge module. - /// - public string Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - /// - /// The major and minor versions of the merge module. - /// - public string Version - { - get - { - return this.versionField; - } - set - { - this.versionFieldSet = true; - this.versionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("SummaryInformation" == childName)) - { - childValue = new SummaryInformation(); - } - if (("AppId" == childName)) - { - childValue = new AppId(); - } - if (("Binary" == childName)) - { - childValue = new Binary(); - } - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("ComponentGroupRef" == childName)) - { - childValue = new ComponentGroupRef(); - } - if (("ComponentRef" == childName)) - { - childValue = new ComponentRef(); - } - if (("Configuration" == childName)) - { - childValue = new Configuration(); - } - if (("CustomAction" == childName)) - { - childValue = new CustomAction(); - } - if (("CustomActionRef" == childName)) - { - childValue = new CustomActionRef(); - } - if (("CustomTable" == childName)) - { - childValue = new CustomTable(); - } - if (("Dependency" == childName)) - { - childValue = new Dependency(); - } - if (("Directory" == childName)) - { - childValue = new Directory(); - } - if (("DirectoryRef" == childName)) - { - childValue = new DirectoryRef(); - } - if (("EmbeddedChainer" == childName)) - { - childValue = new EmbeddedChainer(); - } - if (("EmbeddedChainerRef" == childName)) - { - childValue = new EmbeddedChainerRef(); - } - if (("EnsureTable" == childName)) - { - childValue = new EnsureTable(); - } - if (("Exclusion" == childName)) - { - childValue = new Exclusion(); - } - if (("Icon" == childName)) - { - childValue = new Icon(); - } - if (("IgnoreModularization" == childName)) - { - childValue = new IgnoreModularization(); - } - if (("IgnoreTable" == childName)) - { - childValue = new IgnoreTable(); - } - if (("Property" == childName)) - { - childValue = new Property(); - } - if (("PropertyRef" == childName)) - { - childValue = new PropertyRef(); - } - if (("SetDirectory" == childName)) - { - childValue = new SetDirectory(); - } - if (("SetProperty" == childName)) - { - childValue = new SetProperty(); - } - if (("SFPCatalog" == childName)) - { - childValue = new SFPCatalog(); - } - if (("Substitution" == childName)) - { - childValue = new Substitution(); - } - if (("UI" == childName)) - { - childValue = new UI(); - } - if (("UIRef" == childName)) - { - childValue = new UIRef(); - } - if (("WixVariable" == childName)) - { - childValue = new WixVariable(); - } - if (("InstallExecuteSequence" == childName)) - { - childValue = new InstallExecuteSequence(); - } - if (("InstallUISequence" == childName)) - { - childValue = new InstallUISequence(); - } - if (("AdminExecuteSequence" == childName)) - { - childValue = new AdminExecuteSequence(); - } - if (("AdminUISequence" == childName)) - { - childValue = new AdminUISequence(); - } - if (("AdvertiseExecuteSequence" == childName)) - { - childValue = new AdvertiseExecuteSequence(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Module", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.codepageFieldSet) - { - writer.WriteAttributeString("Codepage", this.codepageField); - } - if (this.guidFieldSet) - { - writer.WriteAttributeString("Guid", this.guidField); - } - if (this.languageFieldSet) - { - writer.WriteAttributeString("Language", this.languageField); - } - if (this.versionFieldSet) - { - writer.WriteAttributeString("Version", this.versionField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Codepage" == name)) - { - this.codepageField = value; - this.codepageFieldSet = true; - } - if (("Guid" == name)) - { - this.guidField = value; - this.guidFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = value; - this.languageFieldSet = true; - } - if (("Version" == name)) - { - this.versionField = value; - this.versionFieldSet = true; - } - } - } - - /// - /// Declares a dependency on another merge module. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Dependency : ISchemaElement, ISetAttributes - { - - private string requiredIdField; - - private bool requiredIdFieldSet; - - private int requiredLanguageField; - - private bool requiredLanguageFieldSet; - - private string requiredVersionField; - - private bool requiredVersionFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier of the merge module required by the merge module. - /// - public string RequiredId - { - get - { - return this.requiredIdField; - } - set - { - this.requiredIdFieldSet = true; - this.requiredIdField = value; - } - } - - /// - /// Numeric language ID of the merge module in RequiredID. - /// - public int RequiredLanguage - { - get - { - return this.requiredLanguageField; - } - set - { - this.requiredLanguageFieldSet = true; - this.requiredLanguageField = value; - } - } - - /// - /// Version of the merge module in RequiredID. - /// - public string RequiredVersion - { - get - { - return this.requiredVersionField; - } - set - { - this.requiredVersionFieldSet = true; - this.requiredVersionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Dependency", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.requiredIdFieldSet) - { - writer.WriteAttributeString("RequiredId", this.requiredIdField); - } - if (this.requiredLanguageFieldSet) - { - writer.WriteAttributeString("RequiredLanguage", this.requiredLanguageField.ToString(CultureInfo.InvariantCulture)); - } - if (this.requiredVersionFieldSet) - { - writer.WriteAttributeString("RequiredVersion", this.requiredVersionField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("RequiredId" == name)) - { - this.requiredIdField = value; - this.requiredIdFieldSet = true; - } - if (("RequiredLanguage" == name)) - { - this.requiredLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.requiredLanguageFieldSet = true; - } - if (("RequiredVersion" == name)) - { - this.requiredVersionField = value; - this.requiredVersionFieldSet = true; - } - } - } - - /// - /// Declares a merge module with which this merge module is incompatible. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Exclusion : ISchemaElement, ISetAttributes - { - - private string excludedIdField; - - private bool excludedIdFieldSet; - - private int excludeExceptLanguageField; - - private bool excludeExceptLanguageFieldSet; - - private int excludeLanguageField; - - private bool excludeLanguageFieldSet; - - private string excludedMinVersionField; - - private bool excludedMinVersionFieldSet; - - private string excludedMaxVersionField; - - private bool excludedMaxVersionFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier of the merge module that is incompatible. - /// - public string ExcludedId - { - get - { - return this.excludedIdField; - } - set - { - this.excludedIdFieldSet = true; - this.excludedIdField = value; - } - } - - /// - /// Numeric language ID of the merge module in ExcludedID. All except this language will be excluded. Only one of ExcludeExceptLanguage and ExcludeLanguage may be specified. - /// - public int ExcludeExceptLanguage - { - get - { - return this.excludeExceptLanguageField; - } - set - { - this.excludeExceptLanguageFieldSet = true; - this.excludeExceptLanguageField = value; - } - } - - /// - /// Numeric language ID of the merge module in ExcludedID. The specified language will be excluded. Only one of ExcludeExceptLanguage and ExcludeLanguage may be specified. - /// - public int ExcludeLanguage - { - get - { - return this.excludeLanguageField; - } - set - { - this.excludeLanguageFieldSet = true; - this.excludeLanguageField = value; - } - } - - /// - /// Minimum version excluded from a range. If not set, all versions before max are excluded. If neither max nor min, no exclusion based on version. - /// - public string ExcludedMinVersion - { - get - { - return this.excludedMinVersionField; - } - set - { - this.excludedMinVersionFieldSet = true; - this.excludedMinVersionField = value; - } - } - - /// - /// Maximum version excluded from a range. If not set, all versions after min are excluded. If neither max nor min, no exclusion based on version. - /// - public string ExcludedMaxVersion - { - get - { - return this.excludedMaxVersionField; - } - set - { - this.excludedMaxVersionFieldSet = true; - this.excludedMaxVersionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Exclusion", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.excludedIdFieldSet) - { - writer.WriteAttributeString("ExcludedId", this.excludedIdField); - } - if (this.excludeExceptLanguageFieldSet) - { - writer.WriteAttributeString("ExcludeExceptLanguage", this.excludeExceptLanguageField.ToString(CultureInfo.InvariantCulture)); - } - if (this.excludeLanguageFieldSet) - { - writer.WriteAttributeString("ExcludeLanguage", this.excludeLanguageField.ToString(CultureInfo.InvariantCulture)); - } - if (this.excludedMinVersionFieldSet) - { - writer.WriteAttributeString("ExcludedMinVersion", this.excludedMinVersionField); - } - if (this.excludedMaxVersionFieldSet) - { - writer.WriteAttributeString("ExcludedMaxVersion", this.excludedMaxVersionField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("ExcludedId" == name)) - { - this.excludedIdField = value; - this.excludedIdFieldSet = true; - } - if (("ExcludeExceptLanguage" == name)) - { - this.excludeExceptLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.excludeExceptLanguageFieldSet = true; - } - if (("ExcludeLanguage" == name)) - { - this.excludeLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.excludeLanguageFieldSet = true; - } - if (("ExcludedMinVersion" == name)) - { - this.excludedMinVersionField = value; - this.excludedMinVersionFieldSet = true; - } - if (("ExcludedMaxVersion" == name)) - { - this.excludedMaxVersionField = value; - this.excludedMaxVersionFieldSet = true; - } - } - } - - /// - /// Defines the configurable attributes of merge module. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Configuration : ISchemaElement, ISetAttributes - { - - private string nameField; - - private bool nameFieldSet; - - private FormatType formatField; - - private bool formatFieldSet; - - private string typeField; - - private bool typeFieldSet; - - private string contextDataField; - - private bool contextDataFieldSet; - - private string defaultValueField; - - private bool defaultValueFieldSet; - - private YesNoType keyNoOrphanField; - - private bool keyNoOrphanFieldSet; - - private YesNoType nonNullableField; - - private bool nonNullableFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string helpLocationField; - - private bool helpLocationFieldSet; - - private string helpKeywordField; - - private bool helpKeywordFieldSet; - - private ISchemaElement parentElement; - - /// - /// Defines the name of the configurable item. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Specifies the format of the data being changed. - /// - public FormatType Format - { - get - { - return this.formatField; - } - set - { - this.formatFieldSet = true; - this.formatField = value; - } - } - - /// - /// Specifies the type of the data being changed. - /// - public string Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Specifies a semantic context for the requested data. - /// - public string ContextData - { - get - { - return this.contextDataField; - } - set - { - this.contextDataFieldSet = true; - this.contextDataField = value; - } - } - - /// - /// Specifies a default value for the item in this record if the merge tool declines to provide a value. - /// - public string DefaultValue - { - get - { - return this.defaultValueField; - } - set - { - this.defaultValueFieldSet = true; - this.defaultValueField = value; - } - } - - /// - /// Does not merge rule according to rules in MSI SDK. - /// - public YesNoType KeyNoOrphan - { - get - { - return this.keyNoOrphanField; - } - set - { - this.keyNoOrphanFieldSet = true; - this.keyNoOrphanField = value; - } - } - - /// - /// If yes, null is not a valid entry. - /// - public YesNoType NonNullable - { - get - { - return this.nonNullableField; - } - set - { - this.nonNullableFieldSet = true; - this.nonNullableField = value; - } - } - - /// - /// Display name for authoring. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// Description for authoring. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Location of chm file for authoring. - /// - public string HelpLocation - { - get - { - return this.helpLocationField; - } - set - { - this.helpLocationFieldSet = true; - this.helpLocationField = value; - } - } - - /// - /// Keyword into chm file for authoring. - /// - public string HelpKeyword - { - get - { - return this.helpKeywordField; - } - set - { - this.helpKeywordFieldSet = true; - this.helpKeywordField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a FormatType from a string. - /// - public static FormatType ParseFormatType(string value) - { - FormatType parsedValue; - Configuration.TryParseFormatType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a FormatType from a string. - /// - public static bool TryParseFormatType(string value, out FormatType parsedValue) - { - parsedValue = FormatType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("Text" == value)) - { - parsedValue = FormatType.Text; - } - else - { - if (("Key" == value)) - { - parsedValue = FormatType.Key; - } - else - { - if (("Integer" == value)) - { - parsedValue = FormatType.Integer; - } - else - { - if (("Bitfield" == value)) - { - parsedValue = FormatType.Bitfield; - } - else - { - parsedValue = FormatType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Configuration", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.formatFieldSet) - { - if ((this.formatField == FormatType.Text)) - { - writer.WriteAttributeString("Format", "Text"); - } - if ((this.formatField == FormatType.Key)) - { - writer.WriteAttributeString("Format", "Key"); - } - if ((this.formatField == FormatType.Integer)) - { - writer.WriteAttributeString("Format", "Integer"); - } - if ((this.formatField == FormatType.Bitfield)) - { - writer.WriteAttributeString("Format", "Bitfield"); - } - } - if (this.typeFieldSet) - { - writer.WriteAttributeString("Type", this.typeField); - } - if (this.contextDataFieldSet) - { - writer.WriteAttributeString("ContextData", this.contextDataField); - } - if (this.defaultValueFieldSet) - { - writer.WriteAttributeString("DefaultValue", this.defaultValueField); - } - if (this.keyNoOrphanFieldSet) - { - if ((this.keyNoOrphanField == YesNoType.no)) - { - writer.WriteAttributeString("KeyNoOrphan", "no"); - } - if ((this.keyNoOrphanField == YesNoType.yes)) - { - writer.WriteAttributeString("KeyNoOrphan", "yes"); - } - } - if (this.nonNullableFieldSet) - { - if ((this.nonNullableField == YesNoType.no)) - { - writer.WriteAttributeString("NonNullable", "no"); - } - if ((this.nonNullableField == YesNoType.yes)) - { - writer.WriteAttributeString("NonNullable", "yes"); - } - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.helpLocationFieldSet) - { - writer.WriteAttributeString("HelpLocation", this.helpLocationField); - } - if (this.helpKeywordFieldSet) - { - writer.WriteAttributeString("HelpKeyword", this.helpKeywordField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Format" == name)) - { - this.formatField = Configuration.ParseFormatType(value); - this.formatFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = value; - this.typeFieldSet = true; - } - if (("ContextData" == name)) - { - this.contextDataField = value; - this.contextDataFieldSet = true; - } - if (("DefaultValue" == name)) - { - this.defaultValueField = value; - this.defaultValueFieldSet = true; - } - if (("KeyNoOrphan" == name)) - { - this.keyNoOrphanField = Enums.ParseYesNoType(value); - this.keyNoOrphanFieldSet = true; - } - if (("NonNullable" == name)) - { - this.nonNullableField = Enums.ParseYesNoType(value); - this.nonNullableFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("HelpLocation" == name)) - { - this.helpLocationField = value; - this.helpLocationFieldSet = true; - } - if (("HelpKeyword" == name)) - { - this.helpKeywordField = value; - this.helpKeywordFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum FormatType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - Text, - - Key, - - Integer, - - Bitfield, - } - } - - /// - /// Specifies the configurable fields of a module database and provides a template for the configuration of each field. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Substitution : ISchemaElement, ISetAttributes - { - - private string tableField; - - private bool tableFieldSet; - - private string rowField; - - private bool rowFieldSet; - - private string columnField; - - private bool columnFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Specifies the name of the table being modified in the module database. - /// - public string Table - { - get - { - return this.tableField; - } - set - { - this.tableFieldSet = true; - this.tableField = value; - } - } - - /// - /// Specifies the primary keys of the target row in the table named in the Table column. If multiple keys, separated by semicolons. - /// - public string Row - { - get - { - return this.rowField; - } - set - { - this.rowFieldSet = true; - this.rowField = value; - } - } - - /// - /// Specifies the target column in the row named in the Row column. - /// - public string Column - { - get - { - return this.columnField; - } - set - { - this.columnFieldSet = true; - this.columnField = value; - } - } - - /// - /// Provides a formatting template for the data being substituted into the target field specified by Table, Row, and Column. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Substitution", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.tableFieldSet) - { - writer.WriteAttributeString("Table", this.tableField); - } - if (this.rowFieldSet) - { - writer.WriteAttributeString("Row", this.rowField); - } - if (this.columnFieldSet) - { - writer.WriteAttributeString("Column", this.columnField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Table" == name)) - { - this.tableField = value; - this.tableFieldSet = true; - } - if (("Row" == name)) - { - this.rowField = value; - this.rowFieldSet = true; - } - if (("Column" == name)) - { - this.columnField = value; - this.columnFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Specifies a table from the merge module that is not merged into an .msi file. - /// If the table already exists in an .msi file, it is not modified by the merge. - /// The specified table can therefore contain data that is unneeded after the merge. - /// To minimize the size of the .msm file, it is recommended that developers remove - /// unused tables from modules intended for redistribution rather than creating - /// IgnoreTable elements for those tables. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IgnoreTable : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of the table in the merge module that is not to be merged into the .msi file. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IgnoreTable", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// The Fragment element is the building block of creating an installer database in WiX. Once defined, - /// the Fragment becomes an immutable, atomic unit which can either be completely included or excluded - /// from a product. The contents of a Fragment element can be linked into a product by utilizing one - /// of the many *Ref elements. When linking in a Fragment, it will be necessary to link in all of its - /// individual units. For instance, if a given Fragment contains two Component elements, you must link - /// both under features using ComponentRef for each linked Component. Otherwise, you will get a linker - /// warning and have a floating Component that does not appear under any Feature. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Fragment : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public Fragment() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplication))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplicationRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComplianceCheck))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Container))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreModularization))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MediaTemplate))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageCertificates))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCertificates))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RelatedBundle))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Upgrade))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Variable))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); - childCollection0.AddCollection(childCollection1); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Optional identifier for a Fragment. Should only be set by advanced users to tag sections. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("AppId" == childName)) - { - childValue = new AppId(); - } - if (("Binary" == childName)) - { - childValue = new Binary(); - } - if (("BootstrapperApplication" == childName)) - { - childValue = new BootstrapperApplication(); - } - if (("BootstrapperApplicationRef" == childName)) - { - childValue = new BootstrapperApplicationRef(); - } - if (("ComplianceCheck" == childName)) - { - childValue = new ComplianceCheck(); - } - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("ComponentGroup" == childName)) - { - childValue = new ComponentGroup(); - } - if (("Condition" == childName)) - { - childValue = new Condition(); - } - if (("Container" == childName)) - { - childValue = new Container(); - } - if (("CustomAction" == childName)) - { - childValue = new CustomAction(); - } - if (("CustomActionRef" == childName)) - { - childValue = new CustomActionRef(); - } - if (("CustomTable" == childName)) - { - childValue = new CustomTable(); - } - if (("Directory" == childName)) - { - childValue = new Directory(); - } - if (("DirectoryRef" == childName)) - { - childValue = new DirectoryRef(); - } - if (("EmbeddedChainer" == childName)) - { - childValue = new EmbeddedChainer(); - } - if (("EmbeddedChainerRef" == childName)) - { - childValue = new EmbeddedChainerRef(); - } - if (("EnsureTable" == childName)) - { - childValue = new EnsureTable(); - } - if (("Feature" == childName)) - { - childValue = new Feature(); - } - if (("FeatureGroup" == childName)) - { - childValue = new FeatureGroup(); - } - if (("FeatureRef" == childName)) - { - childValue = new FeatureRef(); - } - if (("Icon" == childName)) - { - childValue = new Icon(); - } - if (("IgnoreModularization" == childName)) - { - childValue = new IgnoreModularization(); - } - if (("Media" == childName)) - { - childValue = new Media(); - } - if (("MediaTemplate" == childName)) - { - childValue = new MediaTemplate(); - } - if (("PackageGroup" == childName)) - { - childValue = new PackageGroup(); - } - if (("PackageCertificates" == childName)) - { - childValue = new PackageCertificates(); - } - if (("PatchCertificates" == childName)) - { - childValue = new PatchCertificates(); - } - if (("PatchFamily" == childName)) - { - childValue = new PatchFamily(); - } - if (("PatchFamilyGroup" == childName)) - { - childValue = new PatchFamilyGroup(); - } - if (("PayloadGroup" == childName)) - { - childValue = new PayloadGroup(); - } - if (("Property" == childName)) - { - childValue = new Property(); - } - if (("PropertyRef" == childName)) - { - childValue = new PropertyRef(); - } - if (("RelatedBundle" == childName)) - { - childValue = new RelatedBundle(); - } - if (("SetDirectory" == childName)) - { - childValue = new SetDirectory(); - } - if (("SetProperty" == childName)) - { - childValue = new SetProperty(); - } - if (("SFPCatalog" == childName)) - { - childValue = new SFPCatalog(); - } - if (("UI" == childName)) - { - childValue = new UI(); - } - if (("UIRef" == childName)) - { - childValue = new UIRef(); - } - if (("Upgrade" == childName)) - { - childValue = new Upgrade(); - } - if (("Variable" == childName)) - { - childValue = new Variable(); - } - if (("WixVariable" == childName)) - { - childValue = new WixVariable(); - } - if (("InstallExecuteSequence" == childName)) - { - childValue = new InstallExecuteSequence(); - } - if (("InstallUISequence" == childName)) - { - childValue = new InstallUISequence(); - } - if (("AdminExecuteSequence" == childName)) - { - childValue = new AdminExecuteSequence(); - } - if (("AdminUISequence" == childName)) - { - childValue = new AdminUISequence(); - } - if (("AdvertiseExecuteSequence" == childName)) - { - childValue = new AdvertiseExecuteSequence(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Fragment", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// The Patch element is analogous to the main function in a C program. When linking, only one Patch section - /// can be given to the linker to produce a successful result. Using this element creates an MSP file. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Patch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string codepageField; - - private bool codepageFieldSet; - - private YesNoType allowRemovalField; - - private bool allowRemovalFieldSet; - - private string classificationField; - - private bool classificationFieldSet; - - private string clientPatchIdField; - - private bool clientPatchIdFieldSet; - - private YesNoType apiPatchingSymbolNoImagehlpFlagField; - - private bool apiPatchingSymbolNoImagehlpFlagFieldSet; - - private YesNoType apiPatchingSymbolNoFailuresFlagField; - - private bool apiPatchingSymbolNoFailuresFlagFieldSet; - - private YesNoType apiPatchingSymbolUndecoratedTooFlagField; - - private bool apiPatchingSymbolUndecoratedTooFlagFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private string commentsField; - - private bool commentsFieldSet; - - private string manufacturerField; - - private bool manufacturerFieldSet; - - private YesNoType minorUpdateTargetRTMField; - - private bool minorUpdateTargetRTMFieldSet; - - private string moreInfoURLField; - - private bool moreInfoURLFieldSet; - - private YesNoType optimizedInstallModeField; - - private bool optimizedInstallModeFieldSet; - - private string targetProductNameField; - - private bool targetProductNameFieldSet; - - private YesNoType optimizePatchSizeForLargeFilesField; - - private bool optimizePatchSizeForLargeFilesFieldSet; - - private ISchemaElement parentElement; - - public Patch() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchInformation))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(OptimizeCustomActions))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroup))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroupRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchProperty))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCodes))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Patch code for this patch. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The code page integer value or web name for the resulting MSP. See remarks for more information. - /// - public string Codepage - { - get - { - return this.codepageField; - } - set - { - this.codepageFieldSet = true; - this.codepageField = value; - } - } - - /// - /// Whether this is an uninstallable patch. - /// - public YesNoType AllowRemoval - { - get - { - return this.allowRemovalField; - } - set - { - this.allowRemovalFieldSet = true; - this.allowRemovalField = value; - } - } - - /// - /// Category of updates. Recommended values are Critical Update, Hotfix, Security Rollup, Security Update, Service Pack, Update, Update Rollup. - /// - public string Classification - { - get - { - return this.classificationField; - } - set - { - this.classificationFieldSet = true; - this.classificationField = value; - } - } - - /// - /// An easily referenced identity unique to a patch that can be used in product authoring. See remarks for more information. - /// - public string ClientPatchId - { - get - { - return this.clientPatchIdField; - } - set - { - this.clientPatchIdFieldSet = true; - this.clientPatchIdField = value; - } - } - - /// - /// Flag used when creating a binary file patch. Default is "no". Don't use imagehlp.dll. - /// - public YesNoType ApiPatchingSymbolNoImagehlpFlag - { - get - { - return this.apiPatchingSymbolNoImagehlpFlagField; - } - set - { - this.apiPatchingSymbolNoImagehlpFlagFieldSet = true; - this.apiPatchingSymbolNoImagehlpFlagField = value; - } - } - - /// - /// Flag used when creating a binary file patch. Default is "no". Don't fail patch due to imagehlp failures. - /// - public YesNoType ApiPatchingSymbolNoFailuresFlag - { - get - { - return this.apiPatchingSymbolNoFailuresFlagField; - } - set - { - this.apiPatchingSymbolNoFailuresFlagFieldSet = true; - this.apiPatchingSymbolNoFailuresFlagField = value; - } - } - - /// - /// Flag used when creating a binary file patch. Default is "no". After matching decorated symbols, try to match remaining by undecorated names. - /// - public YesNoType ApiPatchingSymbolUndecoratedTooFlag - { - get - { - return this.apiPatchingSymbolUndecoratedTooFlagField; - } - set - { - this.apiPatchingSymbolUndecoratedTooFlagFieldSet = true; - this.apiPatchingSymbolUndecoratedTooFlagField = value; - } - } - - /// - /// Description of the patch. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// A title for the patch that is suitable for public display. In Add/Remove Programs from XP SP2 on. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// Optional comments for browsing. - /// - public string Comments - { - get - { - return this.commentsField; - } - set - { - this.commentsFieldSet = true; - this.commentsField = value; - } - } - - /// - /// Vendor releasing the package - /// - public string Manufacturer - { - get - { - return this.manufacturerField; - } - set - { - this.manufacturerFieldSet = true; - this.manufacturerField = value; - } - } - - /// - /// Indicates that the patch targets the RTM version of the product or the most recent major - /// upgrade patch. Author this optional property in minor update patches that contain sequencing - /// information to indicate that the patch removes all patches up to the RTM version of the - /// product, or up to the most recent major upgrade patch. This property is available beginning - /// with Windows Installer 3.1. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType MinorUpdateTargetRTM - { - get - { - return this.minorUpdateTargetRTMField; - } - set - { - this.minorUpdateTargetRTMFieldSet = true; - this.minorUpdateTargetRTMField = value; - } - } - - /// - /// A URL that provides information specific to this patch. In Add/Remove Programs from XP SP2 on. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public string MoreInfoURL - { - get - { - return this.moreInfoURLField; - } - set - { - this.moreInfoURLFieldSet = true; - this.moreInfoURLField = value; - } - } - - /// - /// If this attribute is set to 'yes' in all the patches to be applied in a transaction, the - /// application of the patch is optimized if possible. Available beginning with Windows Installer 3.1. - /// - public YesNoType OptimizedInstallMode - { - get - { - return this.optimizedInstallModeField; - } - set - { - this.optimizedInstallModeFieldSet = true; - this.optimizedInstallModeField = value; - } - } - - /// - /// Name of the application or target product suite. - /// - public string TargetProductName - { - get - { - return this.targetProductNameField; - } - set - { - this.targetProductNameFieldSet = true; - this.targetProductNameField = value; - } - } - - /// - /// When this attribute is set, patches for files greater than approximately 4 MB in size may be made smaller. - /// - public YesNoType OptimizePatchSizeForLargeFiles - { - get - { - return this.optimizePatchSizeForLargeFilesField; - } - set - { - this.optimizePatchSizeForLargeFilesFieldSet = true; - this.optimizePatchSizeForLargeFilesField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("PatchInformation" == childName)) - { - childValue = new PatchInformation(); - } - if (("Media" == childName)) - { - childValue = new Media(); - } - if (("OptimizeCustomActions" == childName)) - { - childValue = new OptimizeCustomActions(); - } - if (("PatchFamily" == childName)) - { - childValue = new PatchFamily(); - } - if (("PatchFamilyRef" == childName)) - { - childValue = new PatchFamilyRef(); - } - if (("PatchFamilyGroup" == childName)) - { - childValue = new PatchFamilyGroup(); - } - if (("PatchFamilyGroupRef" == childName)) - { - childValue = new PatchFamilyGroupRef(); - } - if (("PatchProperty" == childName)) - { - childValue = new PatchProperty(); - } - if (("TargetProductCodes" == childName)) - { - childValue = new TargetProductCodes(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Patch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.codepageFieldSet) - { - writer.WriteAttributeString("Codepage", this.codepageField); - } - if (this.allowRemovalFieldSet) - { - if ((this.allowRemovalField == YesNoType.no)) - { - writer.WriteAttributeString("AllowRemoval", "no"); - } - if ((this.allowRemovalField == YesNoType.yes)) - { - writer.WriteAttributeString("AllowRemoval", "yes"); - } - } - if (this.classificationFieldSet) - { - writer.WriteAttributeString("Classification", this.classificationField); - } - if (this.clientPatchIdFieldSet) - { - writer.WriteAttributeString("ClientPatchId", this.clientPatchIdField); - } - if (this.apiPatchingSymbolNoImagehlpFlagFieldSet) - { - if ((this.apiPatchingSymbolNoImagehlpFlagField == YesNoType.no)) - { - writer.WriteAttributeString("ApiPatchingSymbolNoImagehlpFlag", "no"); - } - if ((this.apiPatchingSymbolNoImagehlpFlagField == YesNoType.yes)) - { - writer.WriteAttributeString("ApiPatchingSymbolNoImagehlpFlag", "yes"); - } - } - if (this.apiPatchingSymbolNoFailuresFlagFieldSet) - { - if ((this.apiPatchingSymbolNoFailuresFlagField == YesNoType.no)) - { - writer.WriteAttributeString("ApiPatchingSymbolNoFailuresFlag", "no"); - } - if ((this.apiPatchingSymbolNoFailuresFlagField == YesNoType.yes)) - { - writer.WriteAttributeString("ApiPatchingSymbolNoFailuresFlag", "yes"); - } - } - if (this.apiPatchingSymbolUndecoratedTooFlagFieldSet) - { - if ((this.apiPatchingSymbolUndecoratedTooFlagField == YesNoType.no)) - { - writer.WriteAttributeString("ApiPatchingSymbolUndecoratedTooFlag", "no"); - } - if ((this.apiPatchingSymbolUndecoratedTooFlagField == YesNoType.yes)) - { - writer.WriteAttributeString("ApiPatchingSymbolUndecoratedTooFlag", "yes"); - } - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.commentsFieldSet) - { - writer.WriteAttributeString("Comments", this.commentsField); - } - if (this.manufacturerFieldSet) - { - writer.WriteAttributeString("Manufacturer", this.manufacturerField); - } - if (this.minorUpdateTargetRTMFieldSet) - { - if ((this.minorUpdateTargetRTMField == YesNoType.no)) - { - writer.WriteAttributeString("MinorUpdateTargetRTM", "no"); - } - if ((this.minorUpdateTargetRTMField == YesNoType.yes)) - { - writer.WriteAttributeString("MinorUpdateTargetRTM", "yes"); - } - } - if (this.moreInfoURLFieldSet) - { - writer.WriteAttributeString("MoreInfoURL", this.moreInfoURLField); - } - if (this.optimizedInstallModeFieldSet) - { - if ((this.optimizedInstallModeField == YesNoType.no)) - { - writer.WriteAttributeString("OptimizedInstallMode", "no"); - } - if ((this.optimizedInstallModeField == YesNoType.yes)) - { - writer.WriteAttributeString("OptimizedInstallMode", "yes"); - } - } - if (this.targetProductNameFieldSet) - { - writer.WriteAttributeString("TargetProductName", this.targetProductNameField); - } - if (this.optimizePatchSizeForLargeFilesFieldSet) - { - if ((this.optimizePatchSizeForLargeFilesField == YesNoType.no)) - { - writer.WriteAttributeString("OptimizePatchSizeForLargeFiles", "no"); - } - if ((this.optimizePatchSizeForLargeFilesField == YesNoType.yes)) - { - writer.WriteAttributeString("OptimizePatchSizeForLargeFiles", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Codepage" == name)) - { - this.codepageField = value; - this.codepageFieldSet = true; - } - if (("AllowRemoval" == name)) - { - this.allowRemovalField = Enums.ParseYesNoType(value); - this.allowRemovalFieldSet = true; - } - if (("Classification" == name)) - { - this.classificationField = value; - this.classificationFieldSet = true; - } - if (("ClientPatchId" == name)) - { - this.clientPatchIdField = value; - this.clientPatchIdFieldSet = true; - } - if (("ApiPatchingSymbolNoImagehlpFlag" == name)) - { - this.apiPatchingSymbolNoImagehlpFlagField = Enums.ParseYesNoType(value); - this.apiPatchingSymbolNoImagehlpFlagFieldSet = true; - } - if (("ApiPatchingSymbolNoFailuresFlag" == name)) - { - this.apiPatchingSymbolNoFailuresFlagField = Enums.ParseYesNoType(value); - this.apiPatchingSymbolNoFailuresFlagFieldSet = true; - } - if (("ApiPatchingSymbolUndecoratedTooFlag" == name)) - { - this.apiPatchingSymbolUndecoratedTooFlagField = Enums.ParseYesNoType(value); - this.apiPatchingSymbolUndecoratedTooFlagFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("Comments" == name)) - { - this.commentsField = value; - this.commentsFieldSet = true; - } - if (("Manufacturer" == name)) - { - this.manufacturerField = value; - this.manufacturerFieldSet = true; - } - if (("MinorUpdateTargetRTM" == name)) - { - this.minorUpdateTargetRTMField = Enums.ParseYesNoType(value); - this.minorUpdateTargetRTMFieldSet = true; - } - if (("MoreInfoURL" == name)) - { - this.moreInfoURLField = value; - this.moreInfoURLFieldSet = true; - } - if (("OptimizedInstallMode" == name)) - { - this.optimizedInstallModeField = Enums.ParseYesNoType(value); - this.optimizedInstallModeFieldSet = true; - } - if (("TargetProductName" == name)) - { - this.targetProductNameField = value; - this.targetProductNameFieldSet = true; - } - if (("OptimizePatchSizeForLargeFiles" == name)) - { - this.optimizePatchSizeForLargeFilesField = Enums.ParseYesNoType(value); - this.optimizePatchSizeForLargeFilesFieldSet = true; - } - } - } - - /// - /// Sets information in the patch transform that determines if the transform applies to an installed product and what errors should be ignored when applying the patch transform. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Validate : ISchemaElement, ISetAttributes - { - - private YesNoType productIdField; - - private bool productIdFieldSet; - - private YesNoType productLanguageField; - - private bool productLanguageFieldSet; - - private ProductVersionType productVersionField; - - private bool productVersionFieldSet; - - private ProductVersionOperatorType productVersionOperatorField; - - private bool productVersionOperatorFieldSet; - - private YesNoType upgradeCodeField; - - private bool upgradeCodeFieldSet; - - private YesNoType ignoreAddExistingRowField; - - private bool ignoreAddExistingRowFieldSet; - - private YesNoType ignoreAddExistingTableField; - - private bool ignoreAddExistingTableFieldSet; - - private YesNoType ignoreDeleteMissingRowField; - - private bool ignoreDeleteMissingRowFieldSet; - - private YesNoType ignoreDeleteMissingTableField; - - private bool ignoreDeleteMissingTableFieldSet; - - private YesNoType ignoreUpdateMissingRowField; - - private bool ignoreUpdateMissingRowFieldSet; - - private YesNoType ignoreChangingCodePageField; - - private bool ignoreChangingCodePageFieldSet; - - private ISchemaElement parentElement; - - /// - /// Requires that the installed ProductCode match the target ProductCode used to create the transform. The default is 'yes'. - /// - public YesNoType ProductId - { - get - { - return this.productIdField; - } - set - { - this.productIdFieldSet = true; - this.productIdField = value; - } - } - - /// - /// Requires that the installed ProductLanguage match the target ProductLanguage used to create the transform. The default is 'no'. - /// - public YesNoType ProductLanguage - { - get - { - return this.productLanguageField; - } - set - { - this.productLanguageFieldSet = true; - this.productLanguageField = value; - } - } - - /// - /// Determines how many fields of the installed ProductVersion to compare. See remarks for more information. The default is 'Update'. - /// - public ProductVersionType ProductVersion - { - get - { - return this.productVersionField; - } - set - { - this.productVersionFieldSet = true; - this.productVersionField = value; - } - } - - /// - /// Determines how the installed ProductVersion is compared to the target ProductVersion used to create the transform. See remarks for more information. The default is 'Equal'. - /// - public ProductVersionOperatorType ProductVersionOperator - { - get - { - return this.productVersionOperatorField; - } - set - { - this.productVersionOperatorFieldSet = true; - this.productVersionOperatorField = value; - } - } - - /// - /// Requires that the installed UpgradeCode match the target UpgradeCode used to create the transform. The default is 'yes'. - /// - public YesNoType UpgradeCode - { - get - { - return this.upgradeCodeField; - } - set - { - this.upgradeCodeFieldSet = true; - this.upgradeCodeField = value; - } - } - - /// - /// Ignore errors when adding existing rows. The default is 'yes'. - /// - public YesNoType IgnoreAddExistingRow - { - get - { - return this.ignoreAddExistingRowField; - } - set - { - this.ignoreAddExistingRowFieldSet = true; - this.ignoreAddExistingRowField = value; - } - } - - /// - /// Ignore errors when adding existing tables. The default is 'yes'. - /// - public YesNoType IgnoreAddExistingTable - { - get - { - return this.ignoreAddExistingTableField; - } - set - { - this.ignoreAddExistingTableFieldSet = true; - this.ignoreAddExistingTableField = value; - } - } - - /// - /// Ignore errors when deleting missing rows. The default is 'yes'. - /// - public YesNoType IgnoreDeleteMissingRow - { - get - { - return this.ignoreDeleteMissingRowField; - } - set - { - this.ignoreDeleteMissingRowFieldSet = true; - this.ignoreDeleteMissingRowField = value; - } - } - - /// - /// Ignore errors when deleting missing tables. The default is 'yes'. - /// - public YesNoType IgnoreDeleteMissingTable - { - get - { - return this.ignoreDeleteMissingTableField; - } - set - { - this.ignoreDeleteMissingTableFieldSet = true; - this.ignoreDeleteMissingTableField = value; - } - } - - /// - /// Ignore errors when updating missing rows. The default is 'yes'. - /// - public YesNoType IgnoreUpdateMissingRow - { - get - { - return this.ignoreUpdateMissingRowField; - } - set - { - this.ignoreUpdateMissingRowFieldSet = true; - this.ignoreUpdateMissingRowField = value; - } - } - - /// - /// Ignore errors when changing the database code page. The default is 'no'. - /// - public YesNoType IgnoreChangingCodePage - { - get - { - return this.ignoreChangingCodePageField; - } - set - { - this.ignoreChangingCodePageFieldSet = true; - this.ignoreChangingCodePageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ProductVersionType from a string. - /// - public static ProductVersionType ParseProductVersionType(string value) - { - ProductVersionType parsedValue; - Validate.TryParseProductVersionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ProductVersionType from a string. - /// - public static bool TryParseProductVersionType(string value, out ProductVersionType parsedValue) - { - parsedValue = ProductVersionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("Major" == value)) - { - parsedValue = ProductVersionType.Major; - } - else - { - if (("Minor" == value)) - { - parsedValue = ProductVersionType.Minor; - } - else - { - if (("Update" == value)) - { - parsedValue = ProductVersionType.Update; - } - else - { - parsedValue = ProductVersionType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a ProductVersionOperatorType from a string. - /// - public static ProductVersionOperatorType ParseProductVersionOperatorType(string value) - { - ProductVersionOperatorType parsedValue; - Validate.TryParseProductVersionOperatorType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ProductVersionOperatorType from a string. - /// - public static bool TryParseProductVersionOperatorType(string value, out ProductVersionOperatorType parsedValue) - { - parsedValue = ProductVersionOperatorType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("Lesser" == value)) - { - parsedValue = ProductVersionOperatorType.Lesser; - } - else - { - if (("LesserOrEqual" == value)) - { - parsedValue = ProductVersionOperatorType.LesserOrEqual; - } - else - { - if (("Equal" == value)) - { - parsedValue = ProductVersionOperatorType.Equal; - } - else - { - if (("GreaterOrEqual" == value)) - { - parsedValue = ProductVersionOperatorType.GreaterOrEqual; - } - else - { - if (("Greater" == value)) - { - parsedValue = ProductVersionOperatorType.Greater; - } - else - { - parsedValue = ProductVersionOperatorType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Validate", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.productIdFieldSet) - { - if ((this.productIdField == YesNoType.no)) - { - writer.WriteAttributeString("ProductId", "no"); - } - if ((this.productIdField == YesNoType.yes)) - { - writer.WriteAttributeString("ProductId", "yes"); - } - } - if (this.productLanguageFieldSet) - { - if ((this.productLanguageField == YesNoType.no)) - { - writer.WriteAttributeString("ProductLanguage", "no"); - } - if ((this.productLanguageField == YesNoType.yes)) - { - writer.WriteAttributeString("ProductLanguage", "yes"); - } - } - if (this.productVersionFieldSet) - { - if ((this.productVersionField == ProductVersionType.Major)) - { - writer.WriteAttributeString("ProductVersion", "Major"); - } - if ((this.productVersionField == ProductVersionType.Minor)) - { - writer.WriteAttributeString("ProductVersion", "Minor"); - } - if ((this.productVersionField == ProductVersionType.Update)) - { - writer.WriteAttributeString("ProductVersion", "Update"); - } - } - if (this.productVersionOperatorFieldSet) - { - if ((this.productVersionOperatorField == ProductVersionOperatorType.Lesser)) - { - writer.WriteAttributeString("ProductVersionOperator", "Lesser"); - } - if ((this.productVersionOperatorField == ProductVersionOperatorType.LesserOrEqual)) - { - writer.WriteAttributeString("ProductVersionOperator", "LesserOrEqual"); - } - if ((this.productVersionOperatorField == ProductVersionOperatorType.Equal)) - { - writer.WriteAttributeString("ProductVersionOperator", "Equal"); - } - if ((this.productVersionOperatorField == ProductVersionOperatorType.GreaterOrEqual)) - { - writer.WriteAttributeString("ProductVersionOperator", "GreaterOrEqual"); - } - if ((this.productVersionOperatorField == ProductVersionOperatorType.Greater)) - { - writer.WriteAttributeString("ProductVersionOperator", "Greater"); - } - } - if (this.upgradeCodeFieldSet) - { - if ((this.upgradeCodeField == YesNoType.no)) - { - writer.WriteAttributeString("UpgradeCode", "no"); - } - if ((this.upgradeCodeField == YesNoType.yes)) - { - writer.WriteAttributeString("UpgradeCode", "yes"); - } - } - if (this.ignoreAddExistingRowFieldSet) - { - if ((this.ignoreAddExistingRowField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreAddExistingRow", "no"); - } - if ((this.ignoreAddExistingRowField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreAddExistingRow", "yes"); - } - } - if (this.ignoreAddExistingTableFieldSet) - { - if ((this.ignoreAddExistingTableField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreAddExistingTable", "no"); - } - if ((this.ignoreAddExistingTableField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreAddExistingTable", "yes"); - } - } - if (this.ignoreDeleteMissingRowFieldSet) - { - if ((this.ignoreDeleteMissingRowField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreDeleteMissingRow", "no"); - } - if ((this.ignoreDeleteMissingRowField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreDeleteMissingRow", "yes"); - } - } - if (this.ignoreDeleteMissingTableFieldSet) - { - if ((this.ignoreDeleteMissingTableField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreDeleteMissingTable", "no"); - } - if ((this.ignoreDeleteMissingTableField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreDeleteMissingTable", "yes"); - } - } - if (this.ignoreUpdateMissingRowFieldSet) - { - if ((this.ignoreUpdateMissingRowField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreUpdateMissingRow", "no"); - } - if ((this.ignoreUpdateMissingRowField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreUpdateMissingRow", "yes"); - } - } - if (this.ignoreChangingCodePageFieldSet) - { - if ((this.ignoreChangingCodePageField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreChangingCodePage", "no"); - } - if ((this.ignoreChangingCodePageField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreChangingCodePage", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("ProductId" == name)) - { - this.productIdField = Enums.ParseYesNoType(value); - this.productIdFieldSet = true; - } - if (("ProductLanguage" == name)) - { - this.productLanguageField = Enums.ParseYesNoType(value); - this.productLanguageFieldSet = true; - } - if (("ProductVersion" == name)) - { - this.productVersionField = Validate.ParseProductVersionType(value); - this.productVersionFieldSet = true; - } - if (("ProductVersionOperator" == name)) - { - this.productVersionOperatorField = Validate.ParseProductVersionOperatorType(value); - this.productVersionOperatorFieldSet = true; - } - if (("UpgradeCode" == name)) - { - this.upgradeCodeField = Enums.ParseYesNoType(value); - this.upgradeCodeFieldSet = true; - } - if (("IgnoreAddExistingRow" == name)) - { - this.ignoreAddExistingRowField = Enums.ParseYesNoType(value); - this.ignoreAddExistingRowFieldSet = true; - } - if (("IgnoreAddExistingTable" == name)) - { - this.ignoreAddExistingTableField = Enums.ParseYesNoType(value); - this.ignoreAddExistingTableFieldSet = true; - } - if (("IgnoreDeleteMissingRow" == name)) - { - this.ignoreDeleteMissingRowField = Enums.ParseYesNoType(value); - this.ignoreDeleteMissingRowFieldSet = true; - } - if (("IgnoreDeleteMissingTable" == name)) - { - this.ignoreDeleteMissingTableField = Enums.ParseYesNoType(value); - this.ignoreDeleteMissingTableFieldSet = true; - } - if (("IgnoreUpdateMissingRow" == name)) - { - this.ignoreUpdateMissingRowField = Enums.ParseYesNoType(value); - this.ignoreUpdateMissingRowFieldSet = true; - } - if (("IgnoreChangingCodePage" == name)) - { - this.ignoreChangingCodePageField = Enums.ParseYesNoType(value); - this.ignoreChangingCodePageFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ProductVersionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Checks the major version. - /// - Major, - - /// - /// Checks the major and minor versions. - /// - Minor, - - /// - /// Checks the major, minor, and update versions. - /// - Update, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ProductVersionOperatorType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Installed ProductVersion < target ProductVersion. - /// - Lesser, - - /// - /// Installed ProductVersion <= target ProductVersion. - /// - LesserOrEqual, - - /// - /// Installed ProductVersion = target ProductVersion. - /// - Equal, - - /// - /// Installed ProductVersion >= target ProductVersion. - /// - GreaterOrEqual, - - /// - /// Installed ProductVersion > target ProductVersion. - /// - Greater, - } - } - - /// - /// Indicates whether custom actions can be skipped when applying the patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class OptimizeCustomActions : ISchemaElement, ISetAttributes - { - - private YesNoType skipAssignmentField; - - private bool skipAssignmentFieldSet; - - private YesNoType skipImmediateField; - - private bool skipImmediateFieldSet; - - private YesNoType skipDeferredField; - - private bool skipDeferredFieldSet; - - private ISchemaElement parentElement; - - /// - /// Skip property (type 51) and directory (type 35) assignment custom actions. - /// - public YesNoType SkipAssignment - { - get - { - return this.skipAssignmentField; - } - set - { - this.skipAssignmentFieldSet = true; - this.skipAssignmentField = value; - } - } - - /// - /// Skip immediate custom actions that are not property or directory assignment custom actions. - /// - public YesNoType SkipImmediate - { - get - { - return this.skipImmediateField; - } - set - { - this.skipImmediateFieldSet = true; - this.skipImmediateField = value; - } - } - - /// - /// Skip custom actions that run within the script. - /// - public YesNoType SkipDeferred - { - get - { - return this.skipDeferredField; - } - set - { - this.skipDeferredFieldSet = true; - this.skipDeferredField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("OptimizeCustomActions", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.skipAssignmentFieldSet) - { - if ((this.skipAssignmentField == YesNoType.no)) - { - writer.WriteAttributeString("SkipAssignment", "no"); - } - if ((this.skipAssignmentField == YesNoType.yes)) - { - writer.WriteAttributeString("SkipAssignment", "yes"); - } - } - if (this.skipImmediateFieldSet) - { - if ((this.skipImmediateField == YesNoType.no)) - { - writer.WriteAttributeString("SkipImmediate", "no"); - } - if ((this.skipImmediateField == YesNoType.yes)) - { - writer.WriteAttributeString("SkipImmediate", "yes"); - } - } - if (this.skipDeferredFieldSet) - { - if ((this.skipDeferredField == YesNoType.no)) - { - writer.WriteAttributeString("SkipDeferred", "no"); - } - if ((this.skipDeferredField == YesNoType.yes)) - { - writer.WriteAttributeString("SkipDeferred", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SkipAssignment" == name)) - { - this.skipAssignmentField = Enums.ParseYesNoType(value); - this.skipAssignmentFieldSet = true; - } - if (("SkipImmediate" == name)) - { - this.skipImmediateField = Enums.ParseYesNoType(value); - this.skipImmediateFieldSet = true; - } - if (("SkipDeferred" == name)) - { - this.skipDeferredField = Enums.ParseYesNoType(value); - this.skipDeferredFieldSet = true; - } - } - } - - /// - /// Identifies a set of product versions. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchBaseline : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public PatchBaseline() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Validate))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for a set of product versions. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Validate" == childName)) - { - childValue = new Validate(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchBaseline", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Collection of items that should be kept from the differences between two products. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchFamily : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string productCodeField; - - private bool productCodeFieldSet; - - private string versionField; - - private bool versionFieldSet; - - private YesNoType supersedeField; - - private bool supersedeFieldSet; - - private ISchemaElement parentElement; - - public PatchFamily() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(All))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(BinaryRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificateRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IconRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier which indicates a sequence family to which this patch belongs. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Specifies the ProductCode of the product that this family applies to. - /// - public string ProductCode - { - get - { - return this.productCodeField; - } - set - { - this.productCodeFieldSet = true; - this.productCodeField = value; - } - } - - /// - /// Used to populate the sequence column of the MsiPatchSequence table in the final MSP file. Specified in x.x.x.x format. See documentation for Sequence column of MsiPatchSequence table in MSI SDK. - /// - public string Version - { - get - { - return this.versionField; - } - set - { - this.versionFieldSet = true; - this.versionField = value; - } - } - - /// - /// Set this value to 'yes' to indicate that this patch will supersede all previous patches in this patch family. - /// The default value is 'no'. - /// - public YesNoType Supersede - { - get - { - return this.supersedeField; - } - set - { - this.supersedeFieldSet = true; - this.supersedeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("All" == childName)) - { - childValue = new All(); - } - if (("BinaryRef" == childName)) - { - childValue = new BinaryRef(); - } - if (("ComponentRef" == childName)) - { - childValue = new ComponentRef(); - } - if (("CustomActionRef" == childName)) - { - childValue = new CustomActionRef(); - } - if (("DigitalCertificateRef" == childName)) - { - childValue = new DigitalCertificateRef(); - } - if (("DirectoryRef" == childName)) - { - childValue = new DirectoryRef(); - } - if (("FeatureRef" == childName)) - { - childValue = new FeatureRef(); - } - if (("IconRef" == childName)) - { - childValue = new IconRef(); - } - if (("PropertyRef" == childName)) - { - childValue = new PropertyRef(); - } - if (("UIRef" == childName)) - { - childValue = new UIRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchFamily", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.productCodeFieldSet) - { - writer.WriteAttributeString("ProductCode", this.productCodeField); - } - if (this.versionFieldSet) - { - writer.WriteAttributeString("Version", this.versionField); - } - if (this.supersedeFieldSet) - { - if ((this.supersedeField == YesNoType.no)) - { - writer.WriteAttributeString("Supersede", "no"); - } - if ((this.supersedeField == YesNoType.yes)) - { - writer.WriteAttributeString("Supersede", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("ProductCode" == name)) - { - this.productCodeField = value; - this.productCodeFieldSet = true; - } - if (("Version" == name)) - { - this.versionField = value; - this.versionFieldSet = true; - } - if (("Supersede" == name)) - { - this.supersedeField = Enums.ParseYesNoType(value); - this.supersedeFieldSet = true; - } - } - } - - /// - /// Groups together multiple patch families to be used in other locations. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchFamilyGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public PatchFamilyGroup() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the PatchFamilyGroup. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("PatchFamily" == childName)) - { - childValue = new PatchFamily(); - } - if (("PatchFamilyRef" == childName)) - { - childValue = new PatchFamilyRef(); - } - if (("PatchFamilyGroupRef" == childName)) - { - childValue = new PatchFamilyGroupRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchFamilyGroup", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Create a reference to a PatchFamilyGroup in another Fragment. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchFamilyGroupRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the PatchFamilyGroup to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchFamilyGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// The PatchCreation element is analogous to the main function in a C program. When linking, only one PatchCreation section - /// can be given to the linker to produce a successful result. Using this element creates a pcp file. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchCreation : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private YesNoType allowMajorVersionMismatchesField; - - private bool allowMajorVersionMismatchesFieldSet; - - private YesNoType allowProductCodeMismatchesField; - - private bool allowProductCodeMismatchesFieldSet; - - private YesNoType cleanWorkingFolderField; - - private bool cleanWorkingFolderFieldSet; - - private string codepageField; - - private bool codepageFieldSet; - - private string outputPathField; - - private bool outputPathFieldSet; - - private string sourceListField; - - private bool sourceListFieldSet; - - private int symbolFlagsField; - - private bool symbolFlagsFieldSet; - - private YesNoType wholeFilesOnlyField; - - private bool wholeFilesOnlyFieldSet; - - private ISchemaElement parentElement; - - public PatchCreation() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PatchInformation))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PatchMetadata))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Family))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchProperty))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchSequence))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ReplacePatch))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCode))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// PatchCreation identifier; this is the primary key for identifying patches. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Use this to set whether the major versions between the upgrade and target images match. See - /// - public YesNoType AllowMajorVersionMismatches - { - get - { - return this.allowMajorVersionMismatchesField; - } - set - { - this.allowMajorVersionMismatchesFieldSet = true; - this.allowMajorVersionMismatchesField = value; - } - } - - /// - /// Use this to set whether the product code between the upgrade and target images match. See - /// - public YesNoType AllowProductCodeMismatches - { - get - { - return this.allowProductCodeMismatchesField; - } - set - { - this.allowProductCodeMismatchesFieldSet = true; - this.allowProductCodeMismatchesField = value; - } - } - - /// - /// Use this to set whether Patchwiz should clean the temp folder when finished. See - /// - public YesNoType CleanWorkingFolder - { - get - { - return this.cleanWorkingFolderField; - } - set - { - this.cleanWorkingFolderFieldSet = true; - this.cleanWorkingFolderField = value; - } - } - - /// - /// The code page integer value or web name for the resulting PCP. See remarks for more information. - /// - public string Codepage - { - get - { - return this.codepageField; - } - set - { - this.codepageFieldSet = true; - this.codepageField = value; - } - } - - /// - /// The full path, including file name, of the patch package file that is to be generated. See - /// - public string OutputPath - { - get - { - return this.outputPathField; - } - set - { - this.outputPathFieldSet = true; - this.outputPathField = value; - } - } - - /// - /// Used to locate the .msp file for the patch if the cached copy is unavailable. See - /// - public string SourceList - { - get - { - return this.sourceListField; - } - set - { - this.sourceListFieldSet = true; - this.sourceListField = value; - } - } - - /// - /// An 8-digit hex integer representing the combination of patch symbol usage flags to use when creating a binary file patch. See - /// - public int SymbolFlags - { - get - { - return this.symbolFlagsField; - } - set - { - this.symbolFlagsFieldSet = true; - this.symbolFlagsField = value; - } - } - - /// - /// Use this to set whether changing files should be included in their entirety. See - /// - public YesNoType WholeFilesOnly - { - get - { - return this.wholeFilesOnlyField; - } - set - { - this.wholeFilesOnlyFieldSet = true; - this.wholeFilesOnlyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("PatchInformation" == childName)) - { - childValue = new PatchInformation(); - } - if (("PatchMetadata" == childName)) - { - childValue = new PatchMetadata(); - } - if (("Family" == childName)) - { - childValue = new Family(); - } - if (("PatchProperty" == childName)) - { - childValue = new PatchProperty(); - } - if (("PatchSequence" == childName)) - { - childValue = new PatchSequence(); - } - if (("ReplacePatch" == childName)) - { - childValue = new ReplacePatch(); - } - if (("TargetProductCode" == childName)) - { - childValue = new TargetProductCode(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchCreation", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.allowMajorVersionMismatchesFieldSet) - { - if ((this.allowMajorVersionMismatchesField == YesNoType.no)) - { - writer.WriteAttributeString("AllowMajorVersionMismatches", "no"); - } - if ((this.allowMajorVersionMismatchesField == YesNoType.yes)) - { - writer.WriteAttributeString("AllowMajorVersionMismatches", "yes"); - } - } - if (this.allowProductCodeMismatchesFieldSet) - { - if ((this.allowProductCodeMismatchesField == YesNoType.no)) - { - writer.WriteAttributeString("AllowProductCodeMismatches", "no"); - } - if ((this.allowProductCodeMismatchesField == YesNoType.yes)) - { - writer.WriteAttributeString("AllowProductCodeMismatches", "yes"); - } - } - if (this.cleanWorkingFolderFieldSet) - { - if ((this.cleanWorkingFolderField == YesNoType.no)) - { - writer.WriteAttributeString("CleanWorkingFolder", "no"); - } - if ((this.cleanWorkingFolderField == YesNoType.yes)) - { - writer.WriteAttributeString("CleanWorkingFolder", "yes"); - } - } - if (this.codepageFieldSet) - { - writer.WriteAttributeString("Codepage", this.codepageField); - } - if (this.outputPathFieldSet) - { - writer.WriteAttributeString("OutputPath", this.outputPathField); - } - if (this.sourceListFieldSet) - { - writer.WriteAttributeString("SourceList", this.sourceListField); - } - if (this.symbolFlagsFieldSet) - { - writer.WriteAttributeString("SymbolFlags", this.symbolFlagsField.ToString(CultureInfo.InvariantCulture)); - } - if (this.wholeFilesOnlyFieldSet) - { - if ((this.wholeFilesOnlyField == YesNoType.no)) - { - writer.WriteAttributeString("WholeFilesOnly", "no"); - } - if ((this.wholeFilesOnlyField == YesNoType.yes)) - { - writer.WriteAttributeString("WholeFilesOnly", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("AllowMajorVersionMismatches" == name)) - { - this.allowMajorVersionMismatchesField = Enums.ParseYesNoType(value); - this.allowMajorVersionMismatchesFieldSet = true; - } - if (("AllowProductCodeMismatches" == name)) - { - this.allowProductCodeMismatchesField = Enums.ParseYesNoType(value); - this.allowProductCodeMismatchesFieldSet = true; - } - if (("CleanWorkingFolder" == name)) - { - this.cleanWorkingFolderField = Enums.ParseYesNoType(value); - this.cleanWorkingFolderFieldSet = true; - } - if (("Codepage" == name)) - { - this.codepageField = value; - this.codepageFieldSet = true; - } - if (("OutputPath" == name)) - { - this.outputPathField = value; - this.outputPathFieldSet = true; - } - if (("SourceList" == name)) - { - this.sourceListField = value; - this.sourceListFieldSet = true; - } - if (("SymbolFlags" == name)) - { - this.symbolFlagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.symbolFlagsFieldSet = true; - } - if (("WholeFilesOnly" == name)) - { - this.wholeFilesOnlyField = Enums.ParseYesNoType(value); - this.wholeFilesOnlyFieldSet = true; - } - } - } - - /// - /// Properties about the patch to be placed in the Summary Information Stream. These are visible from COM through the IStream interface, and these properties can be seen on the package in Explorer. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchInformation : ISchemaElement, ISetAttributes - { - - private string descriptionField; - - private bool descriptionFieldSet; - - private string platformsField; - - private bool platformsFieldSet; - - private string languagesField; - - private bool languagesFieldSet; - - private string manufacturerField; - - private bool manufacturerFieldSet; - - private string keywordsField; - - private bool keywordsFieldSet; - - private string commentsField; - - private bool commentsFieldSet; - - private YesNoDefaultType readOnlyField; - - private bool readOnlyFieldSet; - - private string summaryCodepageField; - - private bool summaryCodepageFieldSet; - - private YesNoType shortNamesField; - - private bool shortNamesFieldSet; - - private YesNoType compressedField; - - private bool compressedFieldSet; - - private YesNoType adminImageField; - - private bool adminImageFieldSet; - - private ISchemaElement parentElement; - - /// - /// A short description of the patch that includes the name of the product. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - public string Platforms - { - get - { - return this.platformsField; - } - set - { - this.platformsFieldSet = true; - this.platformsField = value; - } - } - - public string Languages - { - get - { - return this.languagesField; - } - set - { - this.languagesFieldSet = true; - this.languagesField = value; - } - } - - /// - /// The name of the manufacturer of the patch package. - /// - public string Manufacturer - { - get - { - return this.manufacturerField; - } - set - { - this.manufacturerFieldSet = true; - this.manufacturerField = value; - } - } - - /// - /// A semicolon-delimited list of network or URL locations for alternate sources of the patch. The default is "Installer,Patching,PCP,Database". - /// - public string Keywords - { - get - { - return this.keywordsField; - } - set - { - this.keywordsFieldSet = true; - this.keywordsField = value; - } - } - - /// - /// General purpose of the patch package. For example, "This patch contains the logic and data required to install - /// - public string Comments - { - get - { - return this.commentsField; - } - set - { - this.commentsFieldSet = true; - this.commentsField = value; - } - } - - /// - /// The value of this attribute conveys whether the package should be opened as read-only. - /// A database editing tool should not modify a read-only enforced database and should - /// issue a warning at attempts to modify a read-only recommended database. - /// - public YesNoDefaultType ReadOnly - { - get - { - return this.readOnlyField; - } - set - { - this.readOnlyFieldSet = true; - this.readOnlyField = value; - } - } - - /// - /// The code page integer value or web name for summary info strings only. The default is 1252. See remarks for more information. - /// - public string SummaryCodepage - { - get - { - return this.summaryCodepageField; - } - set - { - this.summaryCodepageFieldSet = true; - this.summaryCodepageField = value; - } - } - - public YesNoType ShortNames - { - get - { - return this.shortNamesField; - } - set - { - this.shortNamesFieldSet = true; - this.shortNamesField = value; - } - } - - public YesNoType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - public YesNoType AdminImage - { - get - { - return this.adminImageField; - } - set - { - this.adminImageFieldSet = true; - this.adminImageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchInformation", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.platformsFieldSet) - { - writer.WriteAttributeString("Platforms", this.platformsField); - } - if (this.languagesFieldSet) - { - writer.WriteAttributeString("Languages", this.languagesField); - } - if (this.manufacturerFieldSet) - { - writer.WriteAttributeString("Manufacturer", this.manufacturerField); - } - if (this.keywordsFieldSet) - { - writer.WriteAttributeString("Keywords", this.keywordsField); - } - if (this.commentsFieldSet) - { - writer.WriteAttributeString("Comments", this.commentsField); - } - if (this.readOnlyFieldSet) - { - if ((this.readOnlyField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("ReadOnly", "default"); - } - if ((this.readOnlyField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("ReadOnly", "no"); - } - if ((this.readOnlyField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("ReadOnly", "yes"); - } - } - if (this.summaryCodepageFieldSet) - { - writer.WriteAttributeString("SummaryCodepage", this.summaryCodepageField); - } - if (this.shortNamesFieldSet) - { - if ((this.shortNamesField == YesNoType.no)) - { - writer.WriteAttributeString("ShortNames", "no"); - } - if ((this.shortNamesField == YesNoType.yes)) - { - writer.WriteAttributeString("ShortNames", "yes"); - } - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.adminImageFieldSet) - { - if ((this.adminImageField == YesNoType.no)) - { - writer.WriteAttributeString("AdminImage", "no"); - } - if ((this.adminImageField == YesNoType.yes)) - { - writer.WriteAttributeString("AdminImage", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Platforms" == name)) - { - this.platformsField = value; - this.platformsFieldSet = true; - } - if (("Languages" == name)) - { - this.languagesField = value; - this.languagesFieldSet = true; - } - if (("Manufacturer" == name)) - { - this.manufacturerField = value; - this.manufacturerFieldSet = true; - } - if (("Keywords" == name)) - { - this.keywordsField = value; - this.keywordsFieldSet = true; - } - if (("Comments" == name)) - { - this.commentsField = value; - this.commentsFieldSet = true; - } - if (("ReadOnly" == name)) - { - this.readOnlyField = Enums.ParseYesNoDefaultType(value); - this.readOnlyFieldSet = true; - } - if (("SummaryCodepage" == name)) - { - this.summaryCodepageField = value; - this.summaryCodepageFieldSet = true; - } - if (("ShortNames" == name)) - { - this.shortNamesField = Enums.ParseYesNoType(value); - this.shortNamesFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoType(value); - this.compressedFieldSet = true; - } - if (("AdminImage" == name)) - { - this.adminImageField = Enums.ParseYesNoType(value); - this.adminImageFieldSet = true; - } - } - } - - /// - /// Properties about the patch to be placed in the PatchMetadata table. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchMetadata : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private YesNoType allowRemovalField; - - private bool allowRemovalFieldSet; - - private string classificationField; - - private bool classificationFieldSet; - - private string creationTimeUTCField; - - private bool creationTimeUTCFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private string manufacturerNameField; - - private bool manufacturerNameFieldSet; - - private string minorUpdateTargetRTMField; - - private bool minorUpdateTargetRTMFieldSet; - - private string moreInfoURLField; - - private bool moreInfoURLFieldSet; - - private YesNoType optimizedInstallModeField; - - private bool optimizedInstallModeFieldSet; - - private string targetProductNameField; - - private bool targetProductNameFieldSet; - - private ISchemaElement parentElement; - - public PatchMetadata() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomProperty))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(OptimizeCustomActions))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Whether this is an uninstallable patch. - /// - public YesNoType AllowRemoval - { - get - { - return this.allowRemovalField; - } - set - { - this.allowRemovalFieldSet = true; - this.allowRemovalField = value; - } - } - - /// - /// Category of updates. Recommended values are Critical Update, Hotfix, Security Rollup, Security Update, Service Pack, Update, Update Rollup. - /// - public string Classification - { - get - { - return this.classificationField; - } - set - { - this.classificationFieldSet = true; - this.classificationField = value; - } - } - - /// - /// Creation time of the .msp file in the form mm-dd-yy HH:MM (month-day-year hour:minute). - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public string CreationTimeUTC - { - get - { - return this.creationTimeUTCField; - } - set - { - this.creationTimeUTCFieldSet = true; - this.creationTimeUTCField = value; - } - } - - /// - /// Description of the patch. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// A title for the patch that is suitable for public display. In Add/Remove Programs from XP SP2 on. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// Name of the manufacturer. - /// - public string ManufacturerName - { - get - { - return this.manufacturerNameField; - } - set - { - this.manufacturerNameFieldSet = true; - this.manufacturerNameField = value; - } - } - - /// - /// Indicates that the patch targets the RTM version of the product or the most recent major - /// upgrade patch. Author this optional property in minor update patches that contain sequencing - /// information to indicate that the patch removes all patches up to the RTM version of the - /// product, or up to the most recent major upgrade patch. This property is available beginning - /// with Windows Installer 3.1. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public string MinorUpdateTargetRTM - { - get - { - return this.minorUpdateTargetRTMField; - } - set - { - this.minorUpdateTargetRTMFieldSet = true; - this.minorUpdateTargetRTMField = value; - } - } - - /// - /// A URL that provides information specific to this patch. In Add/Remove Programs from XP SP2 on. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public string MoreInfoURL - { - get - { - return this.moreInfoURLField; - } - set - { - this.moreInfoURLFieldSet = true; - this.moreInfoURLField = value; - } - } - - /// - /// If this attribute is set to 'yes' in all the patches to be applied in a transaction, the - /// application of the patch is optimized if possible. Available beginning with Windows Installer 3.1. - /// - public YesNoType OptimizedInstallMode - { - get - { - return this.optimizedInstallModeField; - } - set - { - this.optimizedInstallModeFieldSet = true; - this.optimizedInstallModeField = value; - } - } - - /// - /// Name of the application or target product suite. - /// - public string TargetProductName - { - get - { - return this.targetProductNameField; - } - set - { - this.targetProductNameFieldSet = true; - this.targetProductNameField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("CustomProperty" == childName)) - { - childValue = new CustomProperty(); - } - if (("OptimizeCustomActions" == childName)) - { - childValue = new OptimizeCustomActions(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchMetadata", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.allowRemovalFieldSet) - { - if ((this.allowRemovalField == YesNoType.no)) - { - writer.WriteAttributeString("AllowRemoval", "no"); - } - if ((this.allowRemovalField == YesNoType.yes)) - { - writer.WriteAttributeString("AllowRemoval", "yes"); - } - } - if (this.classificationFieldSet) - { - writer.WriteAttributeString("Classification", this.classificationField); - } - if (this.creationTimeUTCFieldSet) - { - writer.WriteAttributeString("CreationTimeUTC", this.creationTimeUTCField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.manufacturerNameFieldSet) - { - writer.WriteAttributeString("ManufacturerName", this.manufacturerNameField); - } - if (this.minorUpdateTargetRTMFieldSet) - { - writer.WriteAttributeString("MinorUpdateTargetRTM", this.minorUpdateTargetRTMField); - } - if (this.moreInfoURLFieldSet) - { - writer.WriteAttributeString("MoreInfoURL", this.moreInfoURLField); - } - if (this.optimizedInstallModeFieldSet) - { - if ((this.optimizedInstallModeField == YesNoType.no)) - { - writer.WriteAttributeString("OptimizedInstallMode", "no"); - } - if ((this.optimizedInstallModeField == YesNoType.yes)) - { - writer.WriteAttributeString("OptimizedInstallMode", "yes"); - } - } - if (this.targetProductNameFieldSet) - { - writer.WriteAttributeString("TargetProductName", this.targetProductNameField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("AllowRemoval" == name)) - { - this.allowRemovalField = Enums.ParseYesNoType(value); - this.allowRemovalFieldSet = true; - } - if (("Classification" == name)) - { - this.classificationField = value; - this.classificationFieldSet = true; - } - if (("CreationTimeUTC" == name)) - { - this.creationTimeUTCField = value; - this.creationTimeUTCFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("ManufacturerName" == name)) - { - this.manufacturerNameField = value; - this.manufacturerNameFieldSet = true; - } - if (("MinorUpdateTargetRTM" == name)) - { - this.minorUpdateTargetRTMField = value; - this.minorUpdateTargetRTMFieldSet = true; - } - if (("MoreInfoURL" == name)) - { - this.moreInfoURLField = value; - this.moreInfoURLFieldSet = true; - } - if (("OptimizedInstallMode" == name)) - { - this.optimizedInstallModeField = Enums.ParseYesNoType(value); - this.optimizedInstallModeFieldSet = true; - } - if (("TargetProductName" == name)) - { - this.targetProductNameField = value; - this.targetProductNameFieldSet = true; - } - } - } - - /// - /// A custom property for the PatchMetadata table. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CustomProperty : ISchemaElement, ISetAttributes - { - - private string companyField; - - private bool companyFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of the company. - /// - public string Company - { - get - { - return this.companyField; - } - set - { - this.companyFieldSet = true; - this.companyField = value; - } - } - - /// - /// The name of the metadata property. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// Value of the metadata property. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CustomProperty", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.companyFieldSet) - { - writer.WriteAttributeString("Company", this.companyField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Company" == name)) - { - this.companyField = value; - this.companyFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// A patch that is deprecated by this patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ReplacePatch : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// Patch GUID to be unregistered if it exists on the machine targeted by this patch. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ReplacePatch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// The product codes for products that can accept the patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class TargetProductCodes : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private YesNoType replaceField; - - private bool replaceFieldSet; - - private ISchemaElement parentElement; - - public TargetProductCodes() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCode))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Whether to replace the product codes that can accept the patch from the target packages with the child elements. - /// - public YesNoType Replace - { - get - { - return this.replaceField; - } - set - { - this.replaceFieldSet = true; - this.replaceField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("TargetProductCode" == childName)) - { - childValue = new TargetProductCode(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("TargetProductCodes", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.replaceFieldSet) - { - if ((this.replaceField == YesNoType.no)) - { - writer.WriteAttributeString("Replace", "no"); - } - if ((this.replaceField == YesNoType.yes)) - { - writer.WriteAttributeString("Replace", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Replace" == name)) - { - this.replaceField = Enums.ParseYesNoType(value); - this.replaceFieldSet = true; - } - } - } - - /// - /// A product code for a product that can accept the patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class TargetProductCode : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The product code for a product that can accept the patch. This can be '*'. See remarks for more information. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("TargetProductCode", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// A property for this patch database. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchProperty : ISchemaElement, ISetAttributes - { - - private string companyField; - - private bool companyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Name of the company for a custom metadata property. - /// - public string Company - { - get - { - return this.companyField; - } - set - { - this.companyFieldSet = true; - this.companyField = value; - } - } - - /// - /// Name of the patch property. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Value of the patch property. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchProperty", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.companyFieldSet) - { - writer.WriteAttributeString("Company", this.companyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Company" == name)) - { - this.companyField = value; - this.companyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Sequence information for this patch database. Sequence information is generated automatically in most cases, and rarely needs to be set explicitly. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchSequence : ISchemaElement, ISetAttributes - { - - private string patchFamilyField; - - private bool patchFamilyFieldSet; - - private string productCodeField; - - private bool productCodeFieldSet; - - private string sequenceField; - - private bool sequenceFieldSet; - - private YesNoType supersedeField; - - private bool supersedeFieldSet; - - private string targetField; - - private bool targetFieldSet; - - private string targetImageField; - - private bool targetImageFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier which indicates a sequence family to which this patch belongs. - /// - public string PatchFamily - { - get - { - return this.patchFamilyField; - } - set - { - this.patchFamilyFieldSet = true; - this.patchFamilyField = value; - } - } - - /// - /// Specifies the ProductCode of the product that this family applies to. - /// This attribute cannot the specified if the TargetImage attribute is specified. - /// - public string ProductCode - { - get - { - return this.productCodeField; - } - set - { - this.productCodeFieldSet = true; - this.productCodeField = value; - } - } - - /// - /// Used to populate the sequence column of the MsiPatchSequence table in the final MSP file. Specified in x.x.x.x format. See documentation for Sequence column of MsiPatchSequence table in MSI SDK. - /// - public string Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// Set this value to 'yes' to indicate that this patch will supersede all previous patches in this patch family. - /// The default value is 'no'. - /// - public YesNoType Supersede - { - get - { - return this.supersedeField; - } - set - { - this.supersedeFieldSet = true; - this.supersedeField = value; - } - } - - public string Target - { - get - { - return this.targetField; - } - set - { - this.targetFieldSet = true; - this.targetField = value; - } - } - - /// - /// Specifies the TargetImage that this family applies to. - /// This attribute cannot the specified if the ProductCode attribute is specified. - /// - public string TargetImage - { - get - { - return this.targetImageField; - } - set - { - this.targetImageFieldSet = true; - this.targetImageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchSequence", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.patchFamilyFieldSet) - { - writer.WriteAttributeString("PatchFamily", this.patchFamilyField); - } - if (this.productCodeFieldSet) - { - writer.WriteAttributeString("ProductCode", this.productCodeField); - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField); - } - if (this.supersedeFieldSet) - { - if ((this.supersedeField == YesNoType.no)) - { - writer.WriteAttributeString("Supersede", "no"); - } - if ((this.supersedeField == YesNoType.yes)) - { - writer.WriteAttributeString("Supersede", "yes"); - } - } - if (this.targetFieldSet) - { - writer.WriteAttributeString("Target", this.targetField); - } - if (this.targetImageFieldSet) - { - writer.WriteAttributeString("TargetImage", this.targetImageField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("PatchFamily" == name)) - { - this.patchFamilyField = value; - this.patchFamilyFieldSet = true; - } - if (("ProductCode" == name)) - { - this.productCodeField = value; - this.productCodeFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = value; - this.sequenceFieldSet = true; - } - if (("Supersede" == name)) - { - this.supersedeField = Enums.ParseYesNoType(value); - this.supersedeFieldSet = true; - } - if (("Target" == name)) - { - this.targetField = value; - this.targetFieldSet = true; - } - if (("TargetImage" == name)) - { - this.targetImageField = value; - this.targetImageFieldSet = true; - } - } - } - - /// - /// Group of one or more upgraded images of a product. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Family : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string diskIdField; - - private bool diskIdFieldSet; - - private string diskPromptField; - - private bool diskPromptFieldSet; - - private string mediaSrcPropField; - - private bool mediaSrcPropFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private int sequenceStartField; - - private bool sequenceStartFieldSet; - - private string volumeLabelField; - - private bool volumeLabelFieldSet; - - private ISchemaElement parentElement; - - public Family() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(UpgradeImage))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ExternalFile))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectFile))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Entered into the DiskId field of the new Media table record. - /// - public string DiskId - { - get - { - return this.diskIdField; - } - set - { - this.diskIdFieldSet = true; - this.diskIdField = value; - } - } - - /// - /// Value to display in the "[1]" of the DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. - /// - public string DiskPrompt - { - get - { - return this.diskPromptField; - } - set - { - this.diskPromptFieldSet = true; - this.diskPromptField = value; - } - } - - /// - /// Entered into the Source field of the new Media table entry of the upgraded image. - /// - public string MediaSrcProp - { - get - { - return this.mediaSrcPropField; - } - set - { - this.mediaSrcPropFieldSet = true; - this.mediaSrcPropField = value; - } - } - - /// - /// Identifier for the family. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Sequence number for the starting file. - /// - public int SequenceStart - { - get - { - return this.sequenceStartField; - } - set - { - this.sequenceStartFieldSet = true; - this.sequenceStartField = value; - } - } - - /// - /// Entered into the VolumeLabel field of the new Media table record. - /// - public string VolumeLabel - { - get - { - return this.volumeLabelField; - } - set - { - this.volumeLabelFieldSet = true; - this.volumeLabelField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("UpgradeImage" == childName)) - { - childValue = new UpgradeImage(); - } - if (("ExternalFile" == childName)) - { - childValue = new ExternalFile(); - } - if (("ProtectFile" == childName)) - { - childValue = new ProtectFile(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Family", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.diskIdFieldSet) - { - writer.WriteAttributeString("DiskId", this.diskIdField); - } - if (this.diskPromptFieldSet) - { - writer.WriteAttributeString("DiskPrompt", this.diskPromptField); - } - if (this.mediaSrcPropFieldSet) - { - writer.WriteAttributeString("MediaSrcProp", this.mediaSrcPropField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.sequenceStartFieldSet) - { - writer.WriteAttributeString("SequenceStart", this.sequenceStartField.ToString(CultureInfo.InvariantCulture)); - } - if (this.volumeLabelFieldSet) - { - writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("DiskId" == name)) - { - this.diskIdField = value; - this.diskIdFieldSet = true; - } - if (("DiskPrompt" == name)) - { - this.diskPromptField = value; - this.diskPromptFieldSet = true; - } - if (("MediaSrcProp" == name)) - { - this.mediaSrcPropField = value; - this.mediaSrcPropFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("SequenceStart" == name)) - { - this.sequenceStartField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceStartFieldSet = true; - } - if (("VolumeLabel" == name)) - { - this.volumeLabelField = value; - this.volumeLabelFieldSet = true; - } - } - } - - /// - /// Contains information about the upgraded images of the product. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UpgradeImage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private string sourcePatchField; - - private bool sourcePatchFieldSet; - - private string srcPatchField; - - private bool srcPatchFieldSet; - - private ISchemaElement parentElement; - - public UpgradeImage() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(TargetImage))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UpgradeFile))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier to connect target images with upgraded image. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Full path to location of msi file for upgraded image. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - /// - /// Modified copy of the upgraded installation database that contains additional authoring specific to patching. - /// - public string SourcePatch - { - get - { - return this.sourcePatchField; - } - set - { - this.sourcePatchFieldSet = true; - this.sourcePatchField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string srcPatch - { - get - { - return this.srcPatchField; - } - set - { - this.srcPatchFieldSet = true; - this.srcPatchField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("TargetImage" == childName)) - { - childValue = new TargetImage(); - } - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if (("UpgradeFile" == childName)) - { - childValue = new UpgradeFile(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UpgradeImage", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - if (this.sourcePatchFieldSet) - { - writer.WriteAttributeString("SourcePatch", this.sourcePatchField); - } - if (this.srcPatchFieldSet) - { - writer.WriteAttributeString("srcPatch", this.srcPatchField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - if (("SourcePatch" == name)) - { - this.sourcePatchField = value; - this.sourcePatchFieldSet = true; - } - if (("srcPatch" == name)) - { - this.srcPatchField = value; - this.srcPatchFieldSet = true; - } - } - } - - /// - /// Contains information about the target images of the product. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class TargetImage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private int orderField; - - private bool orderFieldSet; - - private string validationField; - - private bool validationFieldSet; - - private YesNoType ignoreMissingFilesField; - - private bool ignoreMissingFilesFieldSet; - - private ISchemaElement parentElement; - - public TargetImage() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TargetFile))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the target image. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Full path to the location of the msi file for the target image. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - /// - /// Relative order of the target image. - /// - public int Order - { - get - { - return this.orderField; - } - set - { - this.orderFieldSet = true; - this.orderField = value; - } - } - - /// - /// Product checking to avoid applying irrelevant transforms. - /// - public string Validation - { - get - { - return this.validationField; - } - set - { - this.validationFieldSet = true; - this.validationField = value; - } - } - - /// - /// Files missing from the target image are ignored by the installer. - /// - public YesNoType IgnoreMissingFiles - { - get - { - return this.ignoreMissingFilesField; - } - set - { - this.ignoreMissingFilesFieldSet = true; - this.ignoreMissingFilesField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if (("TargetFile" == childName)) - { - childValue = new TargetFile(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("TargetImage", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - if (this.orderFieldSet) - { - writer.WriteAttributeString("Order", this.orderField.ToString(CultureInfo.InvariantCulture)); - } - if (this.validationFieldSet) - { - writer.WriteAttributeString("Validation", this.validationField); - } - if (this.ignoreMissingFilesFieldSet) - { - if ((this.ignoreMissingFilesField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreMissingFiles", "no"); - } - if ((this.ignoreMissingFilesField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreMissingFiles", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - if (("Order" == name)) - { - this.orderField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.orderFieldSet = true; - } - if (("Validation" == name)) - { - this.validationField = value; - this.validationFieldSet = true; - } - if (("IgnoreMissingFiles" == name)) - { - this.ignoreMissingFilesField = Enums.ParseYesNoType(value); - this.ignoreMissingFilesFieldSet = true; - } - } - } - - /// - /// Information about specific files in a target image. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class TargetFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public TargetFile() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SymbolPath))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreRange))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectRange))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Foreign key into the File table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if (("IgnoreRange" == childName)) - { - childValue = new IgnoreRange(); - } - if (("ProtectRange" == childName)) - { - childValue = new ProtectRange(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("TargetFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Specifies part of a file that is to be ignored during patching. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IgnoreRange : ISchemaElement, ISetAttributes - { - - private int offsetField; - - private bool offsetFieldSet; - - private int lengthField; - - private bool lengthFieldSet; - - private ISchemaElement parentElement; - - /// - /// Offset of the start of the range. - /// - public int Offset - { - get - { - return this.offsetField; - } - set - { - this.offsetFieldSet = true; - this.offsetField = value; - } - } - - /// - /// Length of the range. - /// - public int Length - { - get - { - return this.lengthField; - } - set - { - this.lengthFieldSet = true; - this.lengthField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IgnoreRange", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.offsetFieldSet) - { - writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); - } - if (this.lengthFieldSet) - { - writer.WriteAttributeString("Length", this.lengthField.ToString(CultureInfo.InvariantCulture)); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Offset" == name)) - { - this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.offsetFieldSet = true; - } - if (("Length" == name)) - { - this.lengthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.lengthFieldSet = true; - } - } - } - - /// - /// Specifies part of a file that cannot be overwritten during patching. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ProtectRange : ISchemaElement, ISetAttributes - { - - private int offsetField; - - private bool offsetFieldSet; - - private int lengthField; - - private bool lengthFieldSet; - - private ISchemaElement parentElement; - - /// - /// Offset of the start of the range. - /// - public int Offset - { - get - { - return this.offsetField; - } - set - { - this.offsetFieldSet = true; - this.offsetField = value; - } - } - - /// - /// Length of the range. - /// - public int Length - { - get - { - return this.lengthField; - } - set - { - this.lengthFieldSet = true; - this.lengthField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProtectRange", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.offsetFieldSet) - { - writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); - } - if (this.lengthFieldSet) - { - writer.WriteAttributeString("Length", this.lengthField.ToString(CultureInfo.InvariantCulture)); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Offset" == name)) - { - this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.offsetFieldSet = true; - } - if (("Length" == name)) - { - this.lengthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.lengthFieldSet = true; - } - } - } - - /// - /// Specifies a file to be protected. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ProtectFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string fileField; - - private bool fileFieldSet; - - private ISchemaElement parentElement; - - public ProtectFile() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectRange))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Foreign key into the File table. - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ProtectRange" == childName)) - { - childValue = new ProtectRange(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProtectFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - } - } - - /// - /// Contains information about specific files that are not part of a regular target image. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ExternalFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string fileField; - - private bool fileFieldSet; - - private string sourceField; - - private bool sourceFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private int orderField; - - private bool orderFieldSet; - - private ISchemaElement parentElement; - - public ExternalFile() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ProtectRange))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SymbolPath))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreRange))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Foreign key into the File table. - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// Full path of the external file. - /// - public string Source - { - get - { - return this.sourceField; - } - set - { - this.sourceFieldSet = true; - this.sourceField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - /// - /// Specifies the order of the external files to use when creating the patch. - /// - public int Order - { - get - { - return this.orderField; - } - set - { - this.orderFieldSet = true; - this.orderField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ProtectRange" == childName)) - { - childValue = new ProtectRange(); - } - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if (("IgnoreRange" == childName)) - { - childValue = new IgnoreRange(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ExternalFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.sourceFieldSet) - { - writer.WriteAttributeString("Source", this.sourceField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - if (this.orderFieldSet) - { - writer.WriteAttributeString("Order", this.orderField.ToString(CultureInfo.InvariantCulture)); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("Source" == name)) - { - this.sourceField = value; - this.sourceFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - if (("Order" == name)) - { - this.orderField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.orderFieldSet = true; - } - } - } - - /// - /// Specifies files to either ignore or to specify optional data about a file. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UpgradeFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string fileField; - - private bool fileFieldSet; - - private YesNoType ignoreField; - - private bool ignoreFieldSet; - - private YesNoType allowIgnoreOnErrorField; - - private bool allowIgnoreOnErrorFieldSet; - - private YesNoType wholeFileField; - - private bool wholeFileFieldSet; - - private ISchemaElement parentElement; - - public UpgradeFile() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Foreign key into the File table. - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// If yes, the file is ignored during patching, and the next two attributes are ignored. - /// - public YesNoType Ignore - { - get - { - return this.ignoreField; - } - set - { - this.ignoreFieldSet = true; - this.ignoreField = value; - } - } - - /// - /// Specifies whether patching this file is vital. - /// - public YesNoType AllowIgnoreOnError - { - get - { - return this.allowIgnoreOnErrorField; - } - set - { - this.allowIgnoreOnErrorFieldSet = true; - this.allowIgnoreOnErrorField = value; - } - } - - /// - /// Whether the whole file should be installed, rather than creating a binary patch. - /// - public YesNoType WholeFile - { - get - { - return this.wholeFileField; - } - set - { - this.wholeFileFieldSet = true; - this.wholeFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UpgradeFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.ignoreFieldSet) - { - if ((this.ignoreField == YesNoType.no)) - { - writer.WriteAttributeString("Ignore", "no"); - } - if ((this.ignoreField == YesNoType.yes)) - { - writer.WriteAttributeString("Ignore", "yes"); - } - } - if (this.allowIgnoreOnErrorFieldSet) - { - if ((this.allowIgnoreOnErrorField == YesNoType.no)) - { - writer.WriteAttributeString("AllowIgnoreOnError", "no"); - } - if ((this.allowIgnoreOnErrorField == YesNoType.yes)) - { - writer.WriteAttributeString("AllowIgnoreOnError", "yes"); - } - } - if (this.wholeFileFieldSet) - { - if ((this.wholeFileField == YesNoType.no)) - { - writer.WriteAttributeString("WholeFile", "no"); - } - if ((this.wholeFileField == YesNoType.yes)) - { - writer.WriteAttributeString("WholeFile", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("Ignore" == name)) - { - this.ignoreField = Enums.ParseYesNoType(value); - this.ignoreFieldSet = true; - } - if (("AllowIgnoreOnError" == name)) - { - this.allowIgnoreOnErrorField = Enums.ParseYesNoType(value); - this.allowIgnoreOnErrorFieldSet = true; - } - if (("WholeFile" == name)) - { - this.wholeFileField = Enums.ParseYesNoType(value); - this.wholeFileFieldSet = true; - } - } - } - - /// - /// A path to symbols. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SymbolPath : ISchemaElement, ISetAttributes - { - - private string pathField; - - private bool pathFieldSet; - - private ISchemaElement parentElement; - - /// - /// The path. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SymbolPath", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - } - } - - /// - /// Properties about the package to be placed in the Summary Information Stream. These are - /// visible from COM through the IStream interface, and these properties can be seen on the package in Explorer. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SummaryInformation : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType adminImageField; - - private bool adminImageFieldSet; - - private string commentsField; - - private bool commentsFieldSet; - - private YesNoType compressedField; - - private bool compressedFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private InstallPrivilegesType installPrivilegesField; - - private bool installPrivilegesFieldSet; - - private InstallScopeType installScopeField; - - private bool installScopeFieldSet; - - private int installerVersionField; - - private bool installerVersionFieldSet; - - private string keywordsField; - - private bool keywordsFieldSet; - - private string languagesField; - - private bool languagesFieldSet; - - private string manufacturerField; - - private bool manufacturerFieldSet; - - private string platformsField; - - private bool platformsFieldSet; - - private PlatformType platformField; - - private bool platformFieldSet; - - private YesNoDefaultType readOnlyField; - - private bool readOnlyFieldSet; - - private YesNoType shortNamesField; - - private bool shortNamesFieldSet; - - private string summaryCodepageField; - - private bool summaryCodepageFieldSet; - - private ISchemaElement parentElement; - - /// - /// The package code GUID for a product or merge module. - /// When compiling a product, this attribute should not be set in order to allow the package - /// code to be generated for each build. - /// When compiling a merge module, this attribute must be set to the modularization guid. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set to 'yes' if the source is an admin image. - /// - public YesNoType AdminImage - { - get - { - return this.adminImageField; - } - set - { - this.adminImageFieldSet = true; - this.adminImageField = value; - } - } - - /// - /// Optional comments for browsing. - /// - public string Comments - { - get - { - return this.commentsField; - } - set - { - this.commentsFieldSet = true; - this.commentsField = value; - } - } - - /// - /// Set to 'yes' to have compressed files in the source. - /// This attribute cannot be set for merge modules. - /// - public YesNoType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// The product full name or description. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Use this attribute to specify the priviliges required to install the package on Windows Vista and above. - /// - public InstallPrivilegesType InstallPrivileges - { - get - { - return this.installPrivilegesField; - } - set - { - this.installPrivilegesFieldSet = true; - this.installPrivilegesField = value; - } - } - - /// - /// Use this attribute to specify the installation scope of this package: per-machine or per-user. - /// - public InstallScopeType InstallScope - { - get - { - return this.installScopeField; - } - set - { - this.installScopeFieldSet = true; - this.installScopeField = value; - } - } - - /// - /// The minimum version of the Windows Installer required to install this package. Take the major version of the required Windows Installer - /// and multiply by a 100 then add the minor version of the Windows Installer. For example, "200" would represent Windows Installer 2.0 and - /// "405" would represent Windows Installer 4.5. For 64-bit Windows Installer packages, this property is set to 200 by default as - /// Windows Installer 2.0 was the first version to support 64-bit packages. - /// - public int InstallerVersion - { - get - { - return this.installerVersionField; - } - set - { - this.installerVersionFieldSet = true; - this.installerVersionField = value; - } - } - - /// - /// Optional keywords for browsing. - /// - public string Keywords - { - get - { - return this.keywordsField; - } - set - { - this.keywordsFieldSet = true; - this.keywordsField = value; - } - } - - /// - /// The list of language IDs (LCIDs) supported in the package. - /// - public string Languages - { - get - { - return this.languagesField; - } - set - { - this.languagesFieldSet = true; - this.languagesField = value; - } - } - - /// - /// The vendor releasing the package. - /// - public string Manufacturer - { - get - { - return this.manufacturerField; - } - set - { - this.manufacturerFieldSet = true; - this.manufacturerField = value; - } - } - - /// - /// The list of platforms supported by the package. This attribute has been deprecated. - /// Specify the -arch switch at the candle.exe command line or the InstallerPlatform - /// property in a .wixproj MSBuild project. - /// - public string Platforms - { - get - { - return this.platformsField; - } - set - { - this.platformsFieldSet = true; - this.platformsField = value; - } - } - - /// - /// The platform supported by the package. Use of this attribute is discouraged; instead, - /// specify the -arch switch at the candle.exe command line or the InstallerPlatform - /// property in a .wixproj MSBuild project. - /// - public PlatformType Platform - { - get - { - return this.platformField; - } - set - { - this.platformFieldSet = true; - this.platformField = value; - } - } - - /// - /// The value of this attribute conveys whether the package should be opened as read-only. - /// A database editing tool should not modify a read-only enforced database and should - /// issue a warning at attempts to modify a read-only recommended database. - /// - public YesNoDefaultType ReadOnly - { - get - { - return this.readOnlyField; - } - set - { - this.readOnlyFieldSet = true; - this.readOnlyField = value; - } - } - - /// - /// Set to 'yes' to have short filenames in the source. - /// - public YesNoType ShortNames - { - get - { - return this.shortNamesField; - } - set - { - this.shortNamesFieldSet = true; - this.shortNamesField = value; - } - } - - /// - /// The code page integer value or web name for summary info strings only. See remarks for more information. - /// - public string SummaryCodepage - { - get - { - return this.summaryCodepageField; - } - set - { - this.summaryCodepageFieldSet = true; - this.summaryCodepageField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a InstallPrivilegesType from a string. - /// - public static InstallPrivilegesType ParseInstallPrivilegesType(string value) - { - InstallPrivilegesType parsedValue; - SummaryInformation.TryParseInstallPrivilegesType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a InstallPrivilegesType from a string. - /// - public static bool TryParseInstallPrivilegesType(string value, out InstallPrivilegesType parsedValue) - { - parsedValue = InstallPrivilegesType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("limited" == value)) - { - parsedValue = InstallPrivilegesType.limited; - } - else - { - if (("elevated" == value)) - { - parsedValue = InstallPrivilegesType.elevated; - } - else - { - parsedValue = InstallPrivilegesType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a InstallScopeType from a string. - /// - public static InstallScopeType ParseInstallScopeType(string value) - { - InstallScopeType parsedValue; - SummaryInformation.TryParseInstallScopeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a InstallScopeType from a string. - /// - public static bool TryParseInstallScopeType(string value, out InstallScopeType parsedValue) - { - parsedValue = InstallScopeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("perMachine" == value)) - { - parsedValue = InstallScopeType.perMachine; - } - else - { - if (("perUser" == value)) - { - parsedValue = InstallScopeType.perUser; - } - else - { - parsedValue = InstallScopeType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a PlatformType from a string. - /// - public static PlatformType ParsePlatformType(string value) - { - PlatformType parsedValue; - SummaryInformation.TryParsePlatformType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a PlatformType from a string. - /// - public static bool TryParsePlatformType(string value, out PlatformType parsedValue) - { - parsedValue = PlatformType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("x86" == value)) - { - parsedValue = PlatformType.x86; - } - else - { - if (("ia64" == value)) - { - parsedValue = PlatformType.ia64; - } - else - { - if (("x64" == value)) - { - parsedValue = PlatformType.x64; - } - else - { - if (("arm" == value)) - { - parsedValue = PlatformType.arm; - } - else - { - if (("intel" == value)) - { - parsedValue = PlatformType.intel; - } - else - { - if (("intel64" == value)) - { - parsedValue = PlatformType.intel64; - } - else - { - parsedValue = PlatformType.IllegalValue; - return false; - } - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SummaryInformation", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.adminImageFieldSet) - { - if ((this.adminImageField == YesNoType.no)) - { - writer.WriteAttributeString("AdminImage", "no"); - } - if ((this.adminImageField == YesNoType.yes)) - { - writer.WriteAttributeString("AdminImage", "yes"); - } - } - if (this.commentsFieldSet) - { - writer.WriteAttributeString("Comments", this.commentsField); - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.installPrivilegesFieldSet) - { - if ((this.installPrivilegesField == InstallPrivilegesType.limited)) - { - writer.WriteAttributeString("InstallPrivileges", "limited"); - } - if ((this.installPrivilegesField == InstallPrivilegesType.elevated)) - { - writer.WriteAttributeString("InstallPrivileges", "elevated"); - } - } - if (this.installScopeFieldSet) - { - if ((this.installScopeField == InstallScopeType.perMachine)) - { - writer.WriteAttributeString("InstallScope", "perMachine"); - } - if ((this.installScopeField == InstallScopeType.perUser)) - { - writer.WriteAttributeString("InstallScope", "perUser"); - } - } - if (this.installerVersionFieldSet) - { - writer.WriteAttributeString("InstallerVersion", this.installerVersionField.ToString(CultureInfo.InvariantCulture)); - } - if (this.keywordsFieldSet) - { - writer.WriteAttributeString("Keywords", this.keywordsField); - } - if (this.languagesFieldSet) - { - writer.WriteAttributeString("Languages", this.languagesField); - } - if (this.manufacturerFieldSet) - { - writer.WriteAttributeString("Manufacturer", this.manufacturerField); - } - if (this.platformsFieldSet) - { - writer.WriteAttributeString("Platforms", this.platformsField); - } - if (this.platformFieldSet) - { - if ((this.platformField == PlatformType.x86)) - { - writer.WriteAttributeString("Platform", "x86"); - } - if ((this.platformField == PlatformType.ia64)) - { - writer.WriteAttributeString("Platform", "ia64"); - } - if ((this.platformField == PlatformType.x64)) - { - writer.WriteAttributeString("Platform", "x64"); - } - if ((this.platformField == PlatformType.arm)) - { - writer.WriteAttributeString("Platform", "arm"); - } - if ((this.platformField == PlatformType.intel)) - { - writer.WriteAttributeString("Platform", "intel"); - } - if ((this.platformField == PlatformType.intel64)) - { - writer.WriteAttributeString("Platform", "intel64"); - } - } - if (this.readOnlyFieldSet) - { - if ((this.readOnlyField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("ReadOnly", "default"); - } - if ((this.readOnlyField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("ReadOnly", "no"); - } - if ((this.readOnlyField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("ReadOnly", "yes"); - } - } - if (this.shortNamesFieldSet) - { - if ((this.shortNamesField == YesNoType.no)) - { - writer.WriteAttributeString("ShortNames", "no"); - } - if ((this.shortNamesField == YesNoType.yes)) - { - writer.WriteAttributeString("ShortNames", "yes"); - } - } - if (this.summaryCodepageFieldSet) - { - writer.WriteAttributeString("SummaryCodepage", this.summaryCodepageField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("AdminImage" == name)) - { - this.adminImageField = Enums.ParseYesNoType(value); - this.adminImageFieldSet = true; - } - if (("Comments" == name)) - { - this.commentsField = value; - this.commentsFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoType(value); - this.compressedFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("InstallPrivileges" == name)) - { - this.installPrivilegesField = SummaryInformation.ParseInstallPrivilegesType(value); - this.installPrivilegesFieldSet = true; - } - if (("InstallScope" == name)) - { - this.installScopeField = SummaryInformation.ParseInstallScopeType(value); - this.installScopeFieldSet = true; - } - if (("InstallerVersion" == name)) - { - this.installerVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.installerVersionFieldSet = true; - } - if (("Keywords" == name)) - { - this.keywordsField = value; - this.keywordsFieldSet = true; - } - if (("Languages" == name)) - { - this.languagesField = value; - this.languagesFieldSet = true; - } - if (("Manufacturer" == name)) - { - this.manufacturerField = value; - this.manufacturerFieldSet = true; - } - if (("Platforms" == name)) - { - this.platformsField = value; - this.platformsFieldSet = true; - } - if (("Platform" == name)) - { - this.platformField = SummaryInformation.ParsePlatformType(value); - this.platformFieldSet = true; - } - if (("ReadOnly" == name)) - { - this.readOnlyField = Enums.ParseYesNoDefaultType(value); - this.readOnlyFieldSet = true; - } - if (("ShortNames" == name)) - { - this.shortNamesField = Enums.ParseYesNoType(value); - this.shortNamesFieldSet = true; - } - if (("SummaryCodepage" == name)) - { - this.summaryCodepageField = value; - this.summaryCodepageFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum InstallPrivilegesType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Set this value to declare that the package does not require elevated privileges to install. - /// - limited, - - /// - /// Set this value to declare that the package requires elevated privileges to install. - /// This is the default value. - /// - elevated, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum InstallScopeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Set this value to declare that the package is a per-machine installation and requires elevated privileges to install. - /// Sets the ALLUSERS property to 1. - /// - perMachine, - - /// - /// Set this value to declare that the package is a per-user installation and does not require elevated privileges to install. - /// Sets the package's InstallPrivileges attribute to "limited." - /// - perUser, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum PlatformType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Set this value to declare that the package is an x86 package. - /// - x86, - - /// - /// Set this value to declare that the package is an ia64 package. - /// This value requires that the InstallerVersion property be set to 200 or greater. - /// - ia64, - - /// - /// Set this value to declare that the package is an x64 package. - /// This value requires that the InstallerVersion property be set to 200 or greater. - /// - x64, - - /// - /// Set this value to declare that the package is an arm package. - /// This value requires that the InstallerVersion property be set to 500 or greater. - /// - arm, - - /// - /// This value has been deprecated. Use "x86" instead. - /// - intel, - - /// - /// This value has been deprecated. Use "ia64" instead. - /// - intel64, - } - } - - /// - /// The MsiAssemblyName table specifies the schema for the elements of a strong assembly cache name for a .NET Framework or Win32 assembly. - /// Consider using the Assembly attribute on File element to have the toolset populate these entries automatically. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AssemblyName : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Name of the attribute associated with the value specified in the Value column. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Value associated with the name specified in the Name column. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AssemblyName", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Identifies the possible signer certificates used to digitally sign patches. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchCertificates : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public PatchCertificates() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DigitalCertificate" == childName)) - { - childValue = new DigitalCertificate(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchCertificates", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - /// - /// Digital signatures that identify installation packages in a multi-product transaction. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PackageCertificates : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public PackageCertificates() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DigitalCertificate" == childName)) - { - childValue = new DigitalCertificate(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PackageCertificates", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - /// - /// Adds a digital certificate. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DigitalCertificate : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for a certificate file. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The path to the certificate file. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DigitalCertificate", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - } - } - - /// - /// Reference to a DigitalCertificate element. This will force the entire referenced Fragment's contents - /// to be included in the installer database. This is only used for references when patching. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DigitalCertificateRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DigitalCertificateRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Adds a digital signature. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DigitalSignature : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private ISchemaElement parentElement; - - public DigitalSignature() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The path to signature's optional hash file. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DigitalCertificate" == childName)) - { - childValue = new DigitalCertificate(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DigitalSignature", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - } - } - - /// - /// Adds a system file protection update catalog file - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SFPCatalog : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string nameField; - - private bool nameFieldSet; - - private string dependencyField; - - private bool dependencyFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private ISchemaElement parentElement; - - public SFPCatalog() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPFile))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Filename for catalog file when installed. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Used to define dependency outside of the package. - /// - public string Dependency - { - get - { - return this.dependencyField; - } - set - { - this.dependencyFieldSet = true; - this.dependencyField = value; - } - } - - /// - /// Path to catalog file in binary. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("SFPCatalog" == childName)) - { - childValue = new SFPCatalog(); - } - if (("SFPFile" == childName)) - { - childValue = new SFPFile(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SFPCatalog", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.dependencyFieldSet) - { - writer.WriteAttributeString("Dependency", this.dependencyField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Dependency" == name)) - { - this.dependencyField = value; - this.dependencyFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - } - } - - /// - /// Provides a many-to-many mapping from the SFPCatalog table to the File table - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SFPFile : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary Key to File Table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SFPFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Adds or removes .ini file entries. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IniFile : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string sectionField; - - private bool sectionFieldSet; - - private string shortNameField; - - private bool shortNameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for ini file. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The type of modification to be made. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// Name of a property, the value of which is the full path of the folder containing the .ini file. Can be name of a directory in the Directory table, a property set by the AppSearch table, or any other property representing a full path. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// The localizable .ini file key within the section. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// In prior versions of the WiX toolset, this attribute specified the short name. - /// This attribute's value may now be either a short or long name. - /// If a short name is specified, the ShortName attribute may not be specified. - /// Also, if this value is a long name, the ShortName attribute may be omitted to - /// allow WiX to attempt to generate a unique short name. - /// However, if this name collides with another file or you wish to manually specify - /// the short name, then the ShortName attribute may be specified. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The localizable .ini file section. - /// - public string Section - { - get - { - return this.sectionField; - } - set - { - this.sectionFieldSet = true; - this.sectionField = value; - } - } - - /// - /// The short name of the in 8.3 format. - /// This attribute should only be set if there is a conflict between generated short names - /// or the user wants to manually specify the short name. - /// - public string ShortName - { - get - { - return this.shortNameField; - } - set - { - this.shortNameFieldSet = true; - this.shortNameField = value; - } - } - - /// - /// The localizable value to be written or deleted. This attribute must be set if - /// the Action attribute's value is "addLine", "addTag", or "createLine". - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - IniFile.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("addLine" == value)) - { - parsedValue = ActionType.addLine; - } - else - { - if (("addTag" == value)) - { - parsedValue = ActionType.addTag; - } - else - { - if (("createLine" == value)) - { - parsedValue = ActionType.createLine; - } - else - { - if (("removeLine" == value)) - { - parsedValue = ActionType.removeLine; - } - else - { - if (("removeTag" == value)) - { - parsedValue = ActionType.removeTag; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IniFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.addLine)) - { - writer.WriteAttributeString("Action", "addLine"); - } - if ((this.actionField == ActionType.addTag)) - { - writer.WriteAttributeString("Action", "addTag"); - } - if ((this.actionField == ActionType.createLine)) - { - writer.WriteAttributeString("Action", "createLine"); - } - if ((this.actionField == ActionType.removeLine)) - { - writer.WriteAttributeString("Action", "removeLine"); - } - if ((this.actionField == ActionType.removeTag)) - { - writer.WriteAttributeString("Action", "removeTag"); - } - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.sectionFieldSet) - { - writer.WriteAttributeString("Section", this.sectionField); - } - if (this.shortNameFieldSet) - { - writer.WriteAttributeString("ShortName", this.shortNameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = IniFile.ParseActionType(value); - this.actionFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Section" == name)) - { - this.sectionField = value; - this.sectionFieldSet = true; - } - if (("ShortName" == name)) - { - this.shortNameField = value; - this.shortNameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Creates or updates an .ini entry. - /// - addLine, - - /// - /// Creates a new entry or appends a new comma-separated value to an existing entry. - /// - addTag, - - /// - /// Creates an .ini entry only if the entry does no already exist. - /// - createLine, - - /// - /// Removes an .ini entry. - /// - removeLine, - - /// - /// Removes a tag from an .ini entry. - /// - removeTag, - } - } - - /// - /// ODBCDataSource for a Component - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ODBCDataSource : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string driverNameField; - - private bool driverNameFieldSet; - - private RegistrationType registrationField; - - private bool registrationFieldSet; - - private YesNoType keyPathField; - - private bool keyPathFieldSet; - - private ISchemaElement parentElement; - - public ODBCDataSource() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier of the data source. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name for the data source. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Required if not found as child of ODBCDriver element - /// - public string DriverName - { - get - { - return this.driverNameField; - } - set - { - this.driverNameFieldSet = true; - this.driverNameField = value; - } - } - - /// - /// Scope for which the data source should be registered. - /// - public RegistrationType Registration - { - get - { - return this.registrationField; - } - set - { - this.registrationFieldSet = true; - this.registrationField = value; - } - } - - /// - /// Set 'yes' to force this file to be key path for parent Component - /// - public YesNoType KeyPath - { - get - { - return this.keyPathField; - } - set - { - this.keyPathFieldSet = true; - this.keyPathField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Property" == childName)) - { - childValue = new Property(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a RegistrationType from a string. - /// - public static RegistrationType ParseRegistrationType(string value) - { - RegistrationType parsedValue; - ODBCDataSource.TryParseRegistrationType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a RegistrationType from a string. - /// - public static bool TryParseRegistrationType(string value, out RegistrationType parsedValue) - { - parsedValue = RegistrationType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("machine" == value)) - { - parsedValue = RegistrationType.machine; - } - else - { - if (("user" == value)) - { - parsedValue = RegistrationType.user; - } - else - { - parsedValue = RegistrationType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ODBCDataSource", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.driverNameFieldSet) - { - writer.WriteAttributeString("DriverName", this.driverNameField); - } - if (this.registrationFieldSet) - { - if ((this.registrationField == RegistrationType.machine)) - { - writer.WriteAttributeString("Registration", "machine"); - } - if ((this.registrationField == RegistrationType.user)) - { - writer.WriteAttributeString("Registration", "user"); - } - } - if (this.keyPathFieldSet) - { - if ((this.keyPathField == YesNoType.no)) - { - writer.WriteAttributeString("KeyPath", "no"); - } - if ((this.keyPathField == YesNoType.yes)) - { - writer.WriteAttributeString("KeyPath", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("DriverName" == name)) - { - this.driverNameField = value; - this.driverNameFieldSet = true; - } - if (("Registration" == name)) - { - this.registrationField = ODBCDataSource.ParseRegistrationType(value); - this.registrationFieldSet = true; - } - if (("KeyPath" == name)) - { - this.keyPathField = Enums.ParseYesNoType(value); - this.keyPathFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum RegistrationType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Data source is registered per machine. - /// - machine, - - /// - /// Data source is registered per user. - /// - user, - } - } - - /// - /// ODBCDriver for a Component - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ODBCDriver : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string fileField; - - private bool fileFieldSet; - - private string setupFileField; - - private bool setupFileFieldSet; - - private ISchemaElement parentElement; - - public ODBCDriver() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ODBCDataSource))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the driver. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name for the driver. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Required if not found as child of File element - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// Required if not found as child of File element or different from File attribute above - /// - public string SetupFile - { - get - { - return this.setupFileField; - } - set - { - this.setupFileFieldSet = true; - this.setupFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Property" == childName)) - { - childValue = new Property(); - } - if (("ODBCDataSource" == childName)) - { - childValue = new ODBCDataSource(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ODBCDriver", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.setupFileFieldSet) - { - writer.WriteAttributeString("SetupFile", this.setupFileField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("SetupFile" == name)) - { - this.setupFileField = value; - this.setupFileFieldSet = true; - } - } - } - - /// - /// ODBCTranslator for a Component - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ODBCTranslator : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string fileField; - - private bool fileFieldSet; - - private string setupFileField; - - private bool setupFileFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for the translator. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name for the translator. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Required if not found as child of File element - /// - public string File - { - get - { - return this.fileField; - } - set - { - this.fileFieldSet = true; - this.fileField = value; - } - } - - /// - /// Required if not found as child of File element or different from File attribute above - /// - public string SetupFile - { - get - { - return this.setupFileField; - } - set - { - this.setupFileFieldSet = true; - this.setupFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ODBCTranslator", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.fileFieldSet) - { - writer.WriteAttributeString("File", this.fileField); - } - if (this.setupFileFieldSet) - { - writer.WriteAttributeString("SetupFile", this.setupFileField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("File" == name)) - { - this.fileField = value; - this.fileFieldSet = true; - } - if (("SetupFile" == name)) - { - this.setupFileField = value; - this.setupFileFieldSet = true; - } - } - } - - /// - /// Searches for file and assigns to fullpath value of parent Property - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FileSearch : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string shortNameField; - - private bool shortNameFieldSet; - - private int minSizeField; - - private bool minSizeFieldSet; - - private int maxSizeField; - - private bool maxSizeFieldSet; - - private string minVersionField; - - private bool minVersionFieldSet; - - private string maxVersionField; - - private bool maxVersionFieldSet; - - private DateTime minDateField; - - private bool minDateFieldSet; - - private DateTime maxDateField; - - private bool maxDateFieldSet; - - private string languagesField; - - private bool languagesFieldSet; - - private ISchemaElement parentElement; - - /// - /// Unique identifier for the file search and external key into the Signature table. If this attribute value is not set then the parent element's @Id attribute is used. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// In prior versions of the WiX toolset, this attribute specified the short file name. - /// This attribute's value may now be either a short or long file name. - /// If a short file name is specified, the ShortName attribute may not be specified. - /// If you wish to manually specify the short file name, then the ShortName - /// attribute may be specified. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The short file name of the file in 8.3 format. - /// There is a Windows Installer bug which prevents the FileSearch functionality from working - /// if both a short and long file name are specified. Since the Name attribute allows either - /// a short or long name to be specified, it is the only attribute related to file names which - /// should be specified. - /// - public string ShortName - { - get - { - return this.shortNameField; - } - set - { - this.shortNameFieldSet = true; - this.shortNameField = value; - } - } - - /// - /// The minimum size of the file. - /// - public int MinSize - { - get - { - return this.minSizeField; - } - set - { - this.minSizeFieldSet = true; - this.minSizeField = value; - } - } - - /// - /// The maximum size of the file. - /// - public int MaxSize - { - get - { - return this.maxSizeField; - } - set - { - this.maxSizeFieldSet = true; - this.maxSizeField = value; - } - } - - /// - /// The minimum version of the file. - /// - public string MinVersion - { - get - { - return this.minVersionField; - } - set - { - this.minVersionFieldSet = true; - this.minVersionField = value; - } - } - - /// - /// The maximum version of the file. - /// - public string MaxVersion - { - get - { - return this.maxVersionField; - } - set - { - this.maxVersionFieldSet = true; - this.maxVersionField = value; - } - } - - /// - /// The minimum modification date and time of the file. Formatted as YYYY-MM-DDTHH:mm:ss, where YYYY is the year, MM is month, DD is day, 'T' is literal, HH is hour, mm is minute and ss is second. - /// - public DateTime MinDate - { - get - { - return this.minDateField; - } - set - { - this.minDateFieldSet = true; - this.minDateField = value; - } - } - - /// - /// The maximum modification date and time of the file. Formatted as YYYY-MM-DDTHH:mm:ss, where YYYY is the year, MM is month, DD is day, 'T' is literal, HH is hour, mm is minute and ss is second. - /// - public DateTime MaxDate - { - get - { - return this.maxDateField; - } - set - { - this.maxDateFieldSet = true; - this.maxDateField = value; - } - } - - /// - /// The languages supported by the file. - /// - public string Languages - { - get - { - return this.languagesField; - } - set - { - this.languagesFieldSet = true; - this.languagesField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.shortNameFieldSet) - { - writer.WriteAttributeString("ShortName", this.shortNameField); - } - if (this.minSizeFieldSet) - { - writer.WriteAttributeString("MinSize", this.minSizeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.maxSizeFieldSet) - { - writer.WriteAttributeString("MaxSize", this.maxSizeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.minVersionFieldSet) - { - writer.WriteAttributeString("MinVersion", this.minVersionField); - } - if (this.maxVersionFieldSet) - { - writer.WriteAttributeString("MaxVersion", this.maxVersionField); - } - if (this.minDateFieldSet) - { - writer.WriteAttributeString("MinDate", this.minDateField.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture.DateTimeFormat)); - } - if (this.maxDateFieldSet) - { - writer.WriteAttributeString("MaxDate", this.maxDateField.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture.DateTimeFormat)); - } - if (this.languagesFieldSet) - { - writer.WriteAttributeString("Languages", this.languagesField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("ShortName" == name)) - { - this.shortNameField = value; - this.shortNameFieldSet = true; - } - if (("MinSize" == name)) - { - this.minSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.minSizeFieldSet = true; - } - if (("MaxSize" == name)) - { - this.maxSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.maxSizeFieldSet = true; - } - if (("MinVersion" == name)) - { - this.minVersionField = value; - this.minVersionFieldSet = true; - } - if (("MaxVersion" == name)) - { - this.maxVersionField = value; - this.maxVersionFieldSet = true; - } - if (("MinDate" == name)) - { - this.minDateField = Convert.ToDateTime(value, CultureInfo.InvariantCulture); - this.minDateFieldSet = true; - } - if (("MaxDate" == name)) - { - this.maxDateField = Convert.ToDateTime(value, CultureInfo.InvariantCulture); - this.maxDateFieldSet = true; - } - if (("Languages" == name)) - { - this.languagesField = value; - this.languagesFieldSet = true; - } - } - } - - /// - /// References an existing FileSearch element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FileSearchRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// Specify the Id to the FileSearch to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Searches for directory and assigns to value of parent Property. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DirectorySearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private int depthField; - - private bool depthFieldSet; - - private YesNoType assignToPropertyField; - - private bool assignToPropertyFieldSet; - - private ISchemaElement parentElement; - - public DirectorySearch() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for the directory search. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Path on the user's system. Either absolute, or relative to containing directories. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - /// - /// Depth below the path that the installer searches for the file or directory specified by the search. See remarks for more information. - /// - public int Depth - { - get - { - return this.depthField; - } - set - { - this.depthFieldSet = true; - this.depthField = value; - } - } - - /// - /// Set the value of the outer Property to the result of this search. See remarks for more information. - /// - public YesNoType AssignToProperty - { - get - { - return this.assignToPropertyField; - } - set - { - this.assignToPropertyFieldSet = true; - this.assignToPropertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if (("DirectorySearchRef" == childName)) - { - childValue = new DirectorySearchRef(); - } - if (("FileSearch" == childName)) - { - childValue = new FileSearch(); - } - if (("FileSearchRef" == childName)) - { - childValue = new FileSearchRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - if (this.depthFieldSet) - { - writer.WriteAttributeString("Depth", this.depthField.ToString(CultureInfo.InvariantCulture)); - } - if (this.assignToPropertyFieldSet) - { - if ((this.assignToPropertyField == YesNoType.no)) - { - writer.WriteAttributeString("AssignToProperty", "no"); - } - if ((this.assignToPropertyField == YesNoType.yes)) - { - writer.WriteAttributeString("AssignToProperty", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - if (("Depth" == name)) - { - this.depthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.depthFieldSet = true; - } - if (("AssignToProperty" == name)) - { - this.assignToPropertyField = Enums.ParseYesNoType(value); - this.assignToPropertyFieldSet = true; - } - } - } - - /// - /// References an existing DirectorySearch element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DirectorySearchRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string parentField; - - private bool parentFieldSet; - - private string pathField; - - private bool pathFieldSet; - - private ISchemaElement parentElement; - - public DirectorySearchRef() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Id of the search being referred to. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This attribute is the signature of the parent directory of the file or directory in the Signature_ column. If this field is null, and the Path column does not expand to a full path, then all the fixed drives of the user's system are searched by using the Path. This field is a key into one of the following tables: the RegLocator, the IniLocator, the CompLocator, or the DrLocator tables. - /// - public string Parent - { - get - { - return this.parentField; - } - set - { - this.parentFieldSet = true; - this.parentField = value; - } - } - - /// - /// Path on the user's system. Either absolute, or relative to containing directories. - /// - public string Path - { - get - { - return this.pathField; - } - set - { - this.pathFieldSet = true; - this.pathField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if (("DirectorySearchRef" == childName)) - { - childValue = new DirectorySearchRef(); - } - if (("FileSearch" == childName)) - { - childValue = new FileSearch(); - } - if (("FileSearchRef" == childName)) - { - childValue = new FileSearchRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.parentFieldSet) - { - writer.WriteAttributeString("Parent", this.parentField); - } - if (this.pathFieldSet) - { - writer.WriteAttributeString("Path", this.pathField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Parent" == name)) - { - this.parentField = value; - this.parentFieldSet = true; - } - if (("Path" == name)) - { - this.pathField = value; - this.pathFieldSet = true; - } - } - } - - /// - /// Searches for file or directory and assigns to value of parent Property. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ComponentSearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string guidField; - - private bool guidFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private ISchemaElement parentElement; - - public ComponentSearch() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The component ID of the component whose key path is to be used for the search. - /// - public string Guid - { - get - { - return this.guidField; - } - set - { - this.guidFieldSet = true; - this.guidField = value; - } - } - - /// - /// Must be file if last child is FileSearch element and must be directory if last child is DirectorySearch element. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if (("DirectorySearchRef" == childName)) - { - childValue = new DirectorySearchRef(); - } - if (("FileSearch" == childName)) - { - childValue = new FileSearch(); - } - if (("FileSearchRef" == childName)) - { - childValue = new FileSearchRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - ComponentSearch.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("directory" == value)) - { - parsedValue = TypeType.directory; - } - else - { - if (("file" == value)) - { - parsedValue = TypeType.file; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.guidFieldSet) - { - writer.WriteAttributeString("Guid", this.guidField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.directory)) - { - writer.WriteAttributeString("Type", "directory"); - } - if ((this.typeField == TypeType.file)) - { - writer.WriteAttributeString("Type", "file"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Guid" == name)) - { - this.guidField = value; - this.guidFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = ComponentSearch.ParseTypeType(value); - this.typeFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The key path of the component is a directory. - /// - directory, - - /// - /// The key path of the component is a file. This is the default value. - /// - file, - } - } - - /// - /// Searches for file, directory or registry key and assigns to value of parent Property - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IniFileSearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private int fieldField; - - private bool fieldFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string sectionField; - - private bool sectionFieldSet; - - private string shortNameField; - - private bool shortNameFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private ISchemaElement parentElement; - - public IniFileSearch() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// External key into the Signature table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The field in the .ini line. If field is Null or 0, the entire line is read. - /// - public int Field - { - get - { - return this.fieldField; - } - set - { - this.fieldFieldSet = true; - this.fieldField = value; - } - } - - /// - /// The key value within the section. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// In prior versions of the WiX toolset, this attribute specified the short name. - /// This attribute's value may now be either a short or long name. - /// If a short name is specified, the ShortName attribute may not be specified. - /// Also, if this value is a long name, the ShortName attribute may be omitted to - /// allow WiX to attempt to generate a unique short name. - /// However, if you wish to manually specify the short name, then the ShortName - /// attribute may be specified. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The localizable .ini file section. - /// - public string Section - { - get - { - return this.sectionField; - } - set - { - this.sectionFieldSet = true; - this.sectionField = value; - } - } - - /// - /// The short name of the file in 8.3 format. - /// This attribute should only be set if the user wants to manually specify the short name. - /// - public string ShortName - { - get - { - return this.shortNameField; - } - set - { - this.shortNameFieldSet = true; - this.shortNameField = value; - } - } - - /// - /// Must be file if last child is FileSearch element and must be directory if last child is DirectorySearch element. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if (("DirectorySearchRef" == childName)) - { - childValue = new DirectorySearchRef(); - } - if (("FileSearch" == childName)) - { - childValue = new FileSearch(); - } - if (("FileSearchRef" == childName)) - { - childValue = new FileSearchRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - IniFileSearch.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("directory" == value)) - { - parsedValue = TypeType.directory; - } - else - { - if (("file" == value)) - { - parsedValue = TypeType.file; - } - else - { - if (("raw" == value)) - { - parsedValue = TypeType.raw; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IniFileSearch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.fieldFieldSet) - { - writer.WriteAttributeString("Field", this.fieldField.ToString(CultureInfo.InvariantCulture)); - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.sectionFieldSet) - { - writer.WriteAttributeString("Section", this.sectionField); - } - if (this.shortNameFieldSet) - { - writer.WriteAttributeString("ShortName", this.shortNameField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.directory)) - { - writer.WriteAttributeString("Type", "directory"); - } - if ((this.typeField == TypeType.file)) - { - writer.WriteAttributeString("Type", "file"); - } - if ((this.typeField == TypeType.raw)) - { - writer.WriteAttributeString("Type", "raw"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Field" == name)) - { - this.fieldField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.fieldFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Section" == name)) - { - this.sectionField = value; - this.sectionFieldSet = true; - } - if (("ShortName" == name)) - { - this.shortNameField = value; - this.shortNameFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = IniFileSearch.ParseTypeType(value); - this.typeFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// A directory location. - /// - directory, - - /// - /// A file location. This is the default value. - /// - file, - - /// - /// A raw .ini value. - /// - raw, - } - } - - /// - /// Searches for file, directory or registry key and assigns to value of parent Property - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegistrySearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private RootType rootField; - - private bool rootFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private YesNoType win64Field; - - private bool win64FieldSet; - - private ISchemaElement parentElement; - - public RegistrySearch() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Signature to be used for the file, directory or registry key being searched for. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Root key for the registry value. - /// - public RootType Root - { - get - { - return this.rootField; - } - set - { - this.rootFieldSet = true; - this.rootField = value; - } - } - - /// - /// Key for the registry value. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// Registry value name. If this value is null, then the value from the key's unnamed or default value, if any, is retrieved. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The value must be 'file' if the child is a FileSearch element, and must be 'directory' if child is a DirectorySearch element. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. - /// The default value is based on the platform set by the -arch switch to candle.exe - /// or the InstallerPlatform property in a .wixproj MSBuild project: - /// For x86 and ARM, the default value is 'no'. - /// For x64 and IA64, the default value is 'yes'. - /// - public YesNoType Win64 - { - get - { - return this.win64Field; - } - set - { - this.win64FieldSet = true; - this.win64Field = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if (("DirectorySearchRef" == childName)) - { - childValue = new DirectorySearchRef(); - } - if (("FileSearch" == childName)) - { - childValue = new FileSearch(); - } - if (("FileSearchRef" == childName)) - { - childValue = new FileSearchRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a RootType from a string. - /// - public static RootType ParseRootType(string value) - { - RootType parsedValue; - RegistrySearch.TryParseRootType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a RootType from a string. - /// - public static bool TryParseRootType(string value, out RootType parsedValue) - { - parsedValue = RootType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("HKCR" == value)) - { - parsedValue = RootType.HKCR; - } - else - { - if (("HKCU" == value)) - { - parsedValue = RootType.HKCU; - } - else - { - if (("HKLM" == value)) - { - parsedValue = RootType.HKLM; - } - else - { - if (("HKU" == value)) - { - parsedValue = RootType.HKU; - } - else - { - parsedValue = RootType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - RegistrySearch.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("directory" == value)) - { - parsedValue = TypeType.directory; - } - else - { - if (("file" == value)) - { - parsedValue = TypeType.file; - } - else - { - if (("raw" == value)) - { - parsedValue = TypeType.raw; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegistrySearch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.rootFieldSet) - { - if ((this.rootField == RootType.HKCR)) - { - writer.WriteAttributeString("Root", "HKCR"); - } - if ((this.rootField == RootType.HKCU)) - { - writer.WriteAttributeString("Root", "HKCU"); - } - if ((this.rootField == RootType.HKLM)) - { - writer.WriteAttributeString("Root", "HKLM"); - } - if ((this.rootField == RootType.HKU)) - { - writer.WriteAttributeString("Root", "HKU"); - } - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.directory)) - { - writer.WriteAttributeString("Type", "directory"); - } - if ((this.typeField == TypeType.file)) - { - writer.WriteAttributeString("Type", "file"); - } - if ((this.typeField == TypeType.raw)) - { - writer.WriteAttributeString("Type", "raw"); - } - } - if (this.win64FieldSet) - { - if ((this.win64Field == YesNoType.no)) - { - writer.WriteAttributeString("Win64", "no"); - } - if ((this.win64Field == YesNoType.yes)) - { - writer.WriteAttributeString("Win64", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Root" == name)) - { - this.rootField = RegistrySearch.ParseRootType(value); - this.rootFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = RegistrySearch.ParseTypeType(value); - this.typeFieldSet = true; - } - if (("Win64" == name)) - { - this.win64Field = Enums.ParseYesNoType(value); - this.win64FieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum RootType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// HKEY_CLASSES_ROOT - /// - HKCR, - - /// - /// HKEY_CURRENT_USER - /// - HKCU, - - /// - /// HKEY_LOCAL_MACHINE - /// - HKLM, - - /// - /// HKEY_USERS - /// - HKU, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The registry value contains the path to a directory. - /// - directory, - - /// - /// The registry value contains the path to a file. To return the full file path you must add a FileSearch element as a child of this element; otherwise, the parent directory of the file path is returned. - /// - file, - - /// - /// Sets the raw value from the registry value. Please note that this value will contain a prefix as follows: - /// - raw, - } - } - - /// - /// References an existing RegistrySearch element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegistrySearchRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// Specify the Id of the RegistrySearch to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegistrySearchRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Sets the parent of a nested DirectorySearch element to CCP_DRIVE. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ComplianceDrive : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public ComplianceDrive() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if (("DirectorySearchRef" == childName)) - { - childValue = new DirectorySearchRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComplianceDrive", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - /// - /// Adds a row to the CCPSearch table. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ComplianceCheck : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public ComplianceCheck() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComplianceDrive))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComponentSearch))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearch))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(IniFileSearch))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearch))); - childCollection0.AddCollection(childCollection1); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ComplianceDrive" == childName)) - { - childValue = new ComplianceDrive(); - } - if (("ComponentSearch" == childName)) - { - childValue = new ComponentSearch(); - } - if (("RegistrySearch" == childName)) - { - childValue = new RegistrySearch(); - } - if (("IniFileSearch" == childName)) - { - childValue = new IniFileSearch(); - } - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComplianceCheck", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - /// - /// Property value for a Package or Module. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Property : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private YesNoType complianceCheckField; - - private bool complianceCheckFieldSet; - - private YesNoType adminField; - - private bool adminFieldSet; - - private YesNoType secureField; - - private bool secureFieldSet; - - private YesNoType hiddenField; - - private bool hiddenFieldSet; - - private YesNoType suppressModularizationField; - - private bool suppressModularizationFieldSet; - - private ISchemaElement parentElement; - - public Property() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComplianceDrive))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComponentSearch))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearch))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearchRef))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(IniFileSearch))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearch))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearchRef))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ProductSearch))); - childCollection0.AddCollection(childCollection1); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for Property. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Sets a default value for the property. The value will be overwritten if the Property is used for a search. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// Adds a row to the CCPSearch table. This attribute is only valid when this Property contains a search element. - /// - public YesNoType ComplianceCheck - { - get - { - return this.complianceCheckField; - } - set - { - this.complianceCheckFieldSet = true; - this.complianceCheckField = value; - } - } - - /// - /// Denotes that the Property is saved during - /// - public YesNoType Admin - { - get - { - return this.adminField; - } - set - { - this.adminFieldSet = true; - this.adminField = value; - } - } - - /// - /// Denotes that the Property can be passed to the server side when doing a managed installation with elevated privileges. See the - /// - public YesNoType Secure - { - get - { - return this.secureField; - } - set - { - this.secureFieldSet = true; - this.secureField = value; - } - } - - /// - /// Denotes that the Property is not logged during installation. See the - /// - public YesNoType Hidden - { - get - { - return this.hiddenField; - } - set - { - this.hiddenFieldSet = true; - this.hiddenField = value; - } - } - - /// - /// Use to suppress modularization of this property identifier in merge modules. - /// Using this functionality is strongly discouraged; it should only be - /// necessary as a workaround of last resort in rare scenarios. - /// - public YesNoType SuppressModularization - { - get - { - return this.suppressModularizationField; - } - set - { - this.suppressModularizationFieldSet = true; - this.suppressModularizationField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ComplianceDrive" == childName)) - { - childValue = new ComplianceDrive(); - } - if (("ComponentSearch" == childName)) - { - childValue = new ComponentSearch(); - } - if (("RegistrySearch" == childName)) - { - childValue = new RegistrySearch(); - } - if (("RegistrySearchRef" == childName)) - { - childValue = new RegistrySearchRef(); - } - if (("IniFileSearch" == childName)) - { - childValue = new IniFileSearch(); - } - if (("DirectorySearch" == childName)) - { - childValue = new DirectorySearch(); - } - if (("DirectorySearchRef" == childName)) - { - childValue = new DirectorySearchRef(); - } - if (("ProductSearch" == childName)) - { - childValue = new ProductSearch(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Property", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.complianceCheckFieldSet) - { - if ((this.complianceCheckField == YesNoType.no)) - { - writer.WriteAttributeString("ComplianceCheck", "no"); - } - if ((this.complianceCheckField == YesNoType.yes)) - { - writer.WriteAttributeString("ComplianceCheck", "yes"); - } - } - if (this.adminFieldSet) - { - if ((this.adminField == YesNoType.no)) - { - writer.WriteAttributeString("Admin", "no"); - } - if ((this.adminField == YesNoType.yes)) - { - writer.WriteAttributeString("Admin", "yes"); - } - } - if (this.secureFieldSet) - { - if ((this.secureField == YesNoType.no)) - { - writer.WriteAttributeString("Secure", "no"); - } - if ((this.secureField == YesNoType.yes)) - { - writer.WriteAttributeString("Secure", "yes"); - } - } - if (this.hiddenFieldSet) - { - if ((this.hiddenField == YesNoType.no)) - { - writer.WriteAttributeString("Hidden", "no"); - } - if ((this.hiddenField == YesNoType.yes)) - { - writer.WriteAttributeString("Hidden", "yes"); - } - } - if (this.suppressModularizationFieldSet) - { - if ((this.suppressModularizationField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressModularization", "no"); - } - if ((this.suppressModularizationField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressModularization", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("ComplianceCheck" == name)) - { - this.complianceCheckField = Enums.ParseYesNoType(value); - this.complianceCheckFieldSet = true; - } - if (("Admin" == name)) - { - this.adminField = Enums.ParseYesNoType(value); - this.adminFieldSet = true; - } - if (("Secure" == name)) - { - this.secureField = Enums.ParseYesNoType(value); - this.secureFieldSet = true; - } - if (("Hidden" == name)) - { - this.hiddenField = Enums.ParseYesNoType(value); - this.hiddenFieldSet = true; - } - if (("SuppressModularization" == name)) - { - this.suppressModularizationField = Enums.ParseYesNoType(value); - this.suppressModularizationFieldSet = true; - } - } - } - - /// - /// Reference to a Property value. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PropertyRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier of Property to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PropertyRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Shortcut, default target is parent File, CreateFolder, or Component's Directory - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Shortcut : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string shortNameField; - - private bool shortNameFieldSet; - - private string targetField; - - private bool targetFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string argumentsField; - - private bool argumentsFieldSet; - - private int hotkeyField; - - private bool hotkeyFieldSet; - - private string iconField; - - private bool iconFieldSet; - - private int iconIndexField; - - private bool iconIndexFieldSet; - - private ShowType showField; - - private bool showFieldSet; - - private string workingDirectoryField; - - private bool workingDirectoryFieldSet; - - private YesNoType advertiseField; - - private bool advertiseFieldSet; - - private string displayResourceDllField; - - private bool displayResourceDllFieldSet; - - private int displayResourceIdField; - - private bool displayResourceIdFieldSet; - - private string descriptionResourceDllField; - - private bool descriptionResourceDllFieldSet; - - private int descriptionResourceIdField; - - private bool descriptionResourceIdFieldSet; - - private ISchemaElement parentElement; - - public Shortcut() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ShortcutProperty))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for the shortcut. This value will serve as the primary key for the row. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Identifier reference to Directory element where shortcut is to be created. When nested under a Component element, this attribute's value will default to the parent directory. Otherwise, this attribute is required. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// In prior versions of the WiX toolset, this attribute specified the short name. - /// This attribute's value may now be either a short or long name. - /// If a short name is specified, the ShortName attribute may not be specified. - /// Also, if this value is a long name, the ShortName attribute may be omitted to - /// allow WiX to attempt to generate a unique short name. - /// However, if this name collides with another shortcut or you wish to manually specify - /// the short name, then the ShortName attribute may be specified. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The short name of the shortcut in 8.3 format. - /// This attribute should only be set if there is a conflict between generated short names - /// or the user wants to manually specify the short name. - /// - public string ShortName - { - get - { - return this.shortNameField; - } - set - { - this.shortNameFieldSet = true; - this.shortNameField = value; - } - } - - /// - /// This attribute can only be set if this Shortcut element is nested under a Component element. - /// When nested under a Component element, this attribute's value will default to the parent directory. - /// This attribute's value is the target for a non-advertised shortcut. - /// This attribute is not valid for advertised shortcuts. - /// If you specify this value, its value should be a property identifier enclosed by square brackets ([ ]), that is expanded into the file or a folder pointed to by the shortcut. - /// - public string Target - { - get - { - return this.targetField; - } - set - { - this.targetFieldSet = true; - this.targetField = value; - } - } - - /// - /// The localizable description for the shortcut. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// The command-line arguments for the shortcut. Note that the resolution of properties - /// in the Arguments field is limited. A property formatted as [Property] in this field can only be resolved if the - /// property already has the intended value when the component owning the shortcut is installed. For example, for the - /// argument "[#MyDoc.doc]" to resolve to the correct value, the same process must be installing the file MyDoc.doc and - /// the component that owns the shortcut. - /// - public string Arguments - { - get - { - return this.argumentsField; - } - set - { - this.argumentsFieldSet = true; - this.argumentsField = value; - } - } - - /// - /// The hotkey for the shortcut. The low-order byte contains the virtual-key code for - /// the key, and the high-order byte contains modifier flags. This must be a non-negative number. Authors of - /// installation packages are generally recommend not to set this option, because this can add duplicate hotkeys to a - /// users desktop. In addition, the practice of assigning hotkeys to shortcuts can be problematic for users using hotkeys - /// for accessibility. - /// - public int Hotkey - { - get - { - return this.hotkeyField; - } - set - { - this.hotkeyFieldSet = true; - this.hotkeyField = value; - } - } - - /// - /// Identifier reference to Icon element. The Icon identifier should have the same extension - /// as the file that it points at. For example, a shortcut to an executable (e.g. "my.exe") should reference an Icon with identifier - /// like "MyIcon.exe" - /// - public string Icon - { - get - { - return this.iconField; - } - set - { - this.iconFieldSet = true; - this.iconField = value; - } - } - - /// - /// Identifier reference to Icon element. - /// - public int IconIndex - { - get - { - return this.iconIndexField; - } - set - { - this.iconIndexFieldSet = true; - this.iconIndexField = value; - } - } - - public ShowType Show - { - get - { - return this.showField; - } - set - { - this.showFieldSet = true; - this.showField = value; - } - } - - /// - /// Directory identifier (or Property identifier that resolves to a directory) that resolves - /// to the path of the working directory for the shortcut. - /// - public string WorkingDirectory - { - get - { - return this.workingDirectoryField; - } - set - { - this.workingDirectoryFieldSet = true; - this.workingDirectoryField = value; - } - } - - /// - /// Specifies if the shortcut should be advertised or not. Note that advertised shortcuts - /// always point at a particular application, identified by a ProductCode, and should not be shared between applications. - /// Advertised shortcuts only work for the most recently installed application, and are removed when that application is - /// removed. The default value is 'no'. - /// - public YesNoType Advertise - { - get - { - return this.advertiseField; - } - set - { - this.advertiseFieldSet = true; - this.advertiseField = value; - } - } - - /// - /// The Formatted string providing the full path to the language neutral file containing the MUI Manifest. Generally - /// authored using [#filekey] form. When this attribute is specified, the DisplayResourceId attribute must also - /// be provided. - /// - /// This attribute is only used on Windows Vista and above. If this attribute is not populated and the install - /// is running on Vista and above, the value in the Name attribute is used. If this attribute is populated and - /// the install is running on Vista and above, the value in the Name attribute is ignored. - /// - public string DisplayResourceDll - { - get - { - return this.displayResourceDllField; - } - set - { - this.displayResourceDllFieldSet = true; - this.displayResourceDllField = value; - } - } - - /// - /// The display name index for the shortcut. This must be a non-negative number. When this attribute is specified, the - /// DisplayResourceDll attribute must also be provided. - /// - /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install - /// is running on Vista and above, the value in the Name attribute is used. If this attribute is specified and - /// the install is running on Vista and above, the value in the Name attribute is ignored. - /// - public int DisplayResourceId - { - get - { - return this.displayResourceIdField; - } - set - { - this.displayResourceIdFieldSet = true; - this.displayResourceIdField = value; - } - } - - /// - /// The Formatted string providing the full path to the language neutral file containing the MUI Manifest. Generally - /// authored using [#filekey] form. When this attribute is specified, the DescriptionResourceId attribute must also - /// be provided. - /// - /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install - /// is running on Vista and above, the value in the Name attribute is used. If this attribute is provided and - /// the install is running on Vista and above, the value in the Name attribute is ignored. - /// - public string DescriptionResourceDll - { - get - { - return this.descriptionResourceDllField; - } - set - { - this.descriptionResourceDllFieldSet = true; - this.descriptionResourceDllField = value; - } - } - - /// - /// The description name index for the shortcut. This must be a non-negative number. When this attribute is specified, - /// the DescriptionResourceDll attribute must also be populated. - /// - /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install - /// is running on Vista and above, the value in the Name attribute is used. If this attribute is populated and the - /// install is running on Vista and above, the value in the Name attribute is ignored. - /// - public int DescriptionResourceId - { - get - { - return this.descriptionResourceIdField; - } - set - { - this.descriptionResourceIdFieldSet = true; - this.descriptionResourceIdField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Icon" == childName)) - { - childValue = new Icon(); - } - if (("ShortcutProperty" == childName)) - { - childValue = new ShortcutProperty(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a ShowType from a string. - /// - public static ShowType ParseShowType(string value) - { - ShowType parsedValue; - Shortcut.TryParseShowType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ShowType from a string. - /// - public static bool TryParseShowType(string value, out ShowType parsedValue) - { - parsedValue = ShowType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("normal" == value)) - { - parsedValue = ShowType.normal; - } - else - { - if (("minimized" == value)) - { - parsedValue = ShowType.minimized; - } - else - { - if (("maximized" == value)) - { - parsedValue = ShowType.maximized; - } - else - { - parsedValue = ShowType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Shortcut", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.shortNameFieldSet) - { - writer.WriteAttributeString("ShortName", this.shortNameField); - } - if (this.targetFieldSet) - { - writer.WriteAttributeString("Target", this.targetField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.argumentsFieldSet) - { - writer.WriteAttributeString("Arguments", this.argumentsField); - } - if (this.hotkeyFieldSet) - { - writer.WriteAttributeString("Hotkey", this.hotkeyField.ToString(CultureInfo.InvariantCulture)); - } - if (this.iconFieldSet) - { - writer.WriteAttributeString("Icon", this.iconField); - } - if (this.iconIndexFieldSet) - { - writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); - } - if (this.showFieldSet) - { - if ((this.showField == ShowType.normal)) - { - writer.WriteAttributeString("Show", "normal"); - } - if ((this.showField == ShowType.minimized)) - { - writer.WriteAttributeString("Show", "minimized"); - } - if ((this.showField == ShowType.maximized)) - { - writer.WriteAttributeString("Show", "maximized"); - } - } - if (this.workingDirectoryFieldSet) - { - writer.WriteAttributeString("WorkingDirectory", this.workingDirectoryField); - } - if (this.advertiseFieldSet) - { - if ((this.advertiseField == YesNoType.no)) - { - writer.WriteAttributeString("Advertise", "no"); - } - if ((this.advertiseField == YesNoType.yes)) - { - writer.WriteAttributeString("Advertise", "yes"); - } - } - if (this.displayResourceDllFieldSet) - { - writer.WriteAttributeString("DisplayResourceDll", this.displayResourceDllField); - } - if (this.displayResourceIdFieldSet) - { - writer.WriteAttributeString("DisplayResourceId", this.displayResourceIdField.ToString(CultureInfo.InvariantCulture)); - } - if (this.descriptionResourceDllFieldSet) - { - writer.WriteAttributeString("DescriptionResourceDll", this.descriptionResourceDllField); - } - if (this.descriptionResourceIdFieldSet) - { - writer.WriteAttributeString("DescriptionResourceId", this.descriptionResourceIdField.ToString(CultureInfo.InvariantCulture)); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("ShortName" == name)) - { - this.shortNameField = value; - this.shortNameFieldSet = true; - } - if (("Target" == name)) - { - this.targetField = value; - this.targetFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Arguments" == name)) - { - this.argumentsField = value; - this.argumentsFieldSet = true; - } - if (("Hotkey" == name)) - { - this.hotkeyField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.hotkeyFieldSet = true; - } - if (("Icon" == name)) - { - this.iconField = value; - this.iconFieldSet = true; - } - if (("IconIndex" == name)) - { - this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.iconIndexFieldSet = true; - } - if (("Show" == name)) - { - this.showField = Shortcut.ParseShowType(value); - this.showFieldSet = true; - } - if (("WorkingDirectory" == name)) - { - this.workingDirectoryField = value; - this.workingDirectoryFieldSet = true; - } - if (("Advertise" == name)) - { - this.advertiseField = Enums.ParseYesNoType(value); - this.advertiseFieldSet = true; - } - if (("DisplayResourceDll" == name)) - { - this.displayResourceDllField = value; - this.displayResourceDllFieldSet = true; - } - if (("DisplayResourceId" == name)) - { - this.displayResourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.displayResourceIdFieldSet = true; - } - if (("DescriptionResourceDll" == name)) - { - this.descriptionResourceDllField = value; - this.descriptionResourceDllFieldSet = true; - } - if (("DescriptionResourceId" == name)) - { - this.descriptionResourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.descriptionResourceIdFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ShowType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The shortcut target will be displayed using the SW_SHOWNORMAL attribute. - /// - normal, - - /// - /// The shortcut target will be displayed using the SW_SHOWMINNOACTIVE attribute. - /// - minimized, - - /// - /// The shortcut target will be displayed using the SW_SHOWMAXIMIZED attribute. - /// - maximized, - } - } - - /// - /// Property values for a shortcut. This element's functionality is available starting with MSI 5.0. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ShortcutProperty : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Unique identifier for MsiShortcutProperty table. If omitted, a stable identifier will be generated from the parent shortcut identifier and Key value. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// A formatted string identifying the property to be set. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// A formatted string supplying the value of the property. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ShortcutProperty", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Sets ACLs on File, Registry, or CreateFolder. When under a Registry element, this cannot be used - /// if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. - /// The table and key are taken from the parent element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Permission : ISchemaElement, ISetAttributes - { - - private string domainField; - - private bool domainFieldSet; - - private string userField; - - private bool userFieldSet; - - private YesNoType readField; - - private bool readFieldSet; - - private YesNoType deleteField; - - private bool deleteFieldSet; - - private YesNoType readPermissionField; - - private bool readPermissionFieldSet; - - private YesNoType changePermissionField; - - private bool changePermissionFieldSet; - - private YesNoType takeOwnershipField; - - private bool takeOwnershipFieldSet; - - private YesNoType specificRightsAllField; - - private bool specificRightsAllFieldSet; - - private YesNoType readAttributesField; - - private bool readAttributesFieldSet; - - private YesNoType writeAttributesField; - - private bool writeAttributesFieldSet; - - private YesNoType readExtendedAttributesField; - - private bool readExtendedAttributesFieldSet; - - private YesNoType writeExtendedAttributesField; - - private bool writeExtendedAttributesFieldSet; - - private YesNoType synchronizeField; - - private bool synchronizeFieldSet; - - private YesNoType createFileField; - - private bool createFileFieldSet; - - private YesNoType createChildField; - - private bool createChildFieldSet; - - private YesNoType deleteChildField; - - private bool deleteChildFieldSet; - - private YesNoType traverseField; - - private bool traverseFieldSet; - - private YesNoType appendField; - - private bool appendFieldSet; - - private YesNoType executeField; - - private bool executeFieldSet; - - private YesNoType fileAllRightsField; - - private bool fileAllRightsFieldSet; - - private YesNoType writeField; - - private bool writeFieldSet; - - private YesNoType createSubkeysField; - - private bool createSubkeysFieldSet; - - private YesNoType enumerateSubkeysField; - - private bool enumerateSubkeysFieldSet; - - private YesNoType notifyField; - - private bool notifyFieldSet; - - private YesNoType createLinkField; - - private bool createLinkFieldSet; - - private YesNoType genericAllField; - - private bool genericAllFieldSet; - - private YesNoType genericExecuteField; - - private bool genericExecuteFieldSet; - - private YesNoType genericWriteField; - - private bool genericWriteFieldSet; - - private YesNoType genericReadField; - - private bool genericReadFieldSet; - - private ISchemaElement parentElement; - - public string Domain - { - get - { - return this.domainField; - } - set - { - this.domainFieldSet = true; - this.domainField = value; - } - } - - public string User - { - get - { - return this.userField; - } - set - { - this.userFieldSet = true; - this.userField = value; - } - } - - public YesNoType Read - { - get - { - return this.readField; - } - set - { - this.readFieldSet = true; - this.readField = value; - } - } - - public YesNoType Delete - { - get - { - return this.deleteField; - } - set - { - this.deleteFieldSet = true; - this.deleteField = value; - } - } - - public YesNoType ReadPermission - { - get - { - return this.readPermissionField; - } - set - { - this.readPermissionFieldSet = true; - this.readPermissionField = value; - } - } - - public YesNoType ChangePermission - { - get - { - return this.changePermissionField; - } - set - { - this.changePermissionFieldSet = true; - this.changePermissionField = value; - } - } - - public YesNoType TakeOwnership - { - get - { - return this.takeOwnershipField; - } - set - { - this.takeOwnershipFieldSet = true; - this.takeOwnershipField = value; - } - } - - /// - /// Bit mask for SPECIFIC_RIGHTS_ALL from WinNT.h (0x0000FFFF). - /// - public YesNoType SpecificRightsAll - { - get - { - return this.specificRightsAllField; - } - set - { - this.specificRightsAllFieldSet = true; - this.specificRightsAllField = value; - } - } - - public YesNoType ReadAttributes - { - get - { - return this.readAttributesField; - } - set - { - this.readAttributesFieldSet = true; - this.readAttributesField = value; - } - } - - public YesNoType WriteAttributes - { - get - { - return this.writeAttributesField; - } - set - { - this.writeAttributesFieldSet = true; - this.writeAttributesField = value; - } - } - - public YesNoType ReadExtendedAttributes - { - get - { - return this.readExtendedAttributesField; - } - set - { - this.readExtendedAttributesFieldSet = true; - this.readExtendedAttributesField = value; - } - } - - public YesNoType WriteExtendedAttributes - { - get - { - return this.writeExtendedAttributesField; - } - set - { - this.writeExtendedAttributesFieldSet = true; - this.writeExtendedAttributesField = value; - } - } - - public YesNoType Synchronize - { - get - { - return this.synchronizeField; - } - set - { - this.synchronizeFieldSet = true; - this.synchronizeField = value; - } - } - - /// - /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. - /// - public YesNoType CreateFile - { - get - { - return this.createFileField; - } - set - { - this.createFileFieldSet = true; - this.createFileField = value; - } - } - - /// - /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. - /// - public YesNoType CreateChild - { - get - { - return this.createChildField; - } - set - { - this.createChildFieldSet = true; - this.createChildField = value; - } - } - - /// - /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. - /// - public YesNoType DeleteChild - { - get - { - return this.deleteChildField; - } - set - { - this.deleteChildFieldSet = true; - this.deleteChildField = value; - } - } - - /// - /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. - /// - public YesNoType Traverse - { - get - { - return this.traverseField; - } - set - { - this.traverseFieldSet = true; - this.traverseField = value; - } - } - - public YesNoType Append - { - get - { - return this.appendField; - } - set - { - this.appendFieldSet = true; - this.appendField = value; - } - } - - public YesNoType Execute - { - get - { - return this.executeField; - } - set - { - this.executeFieldSet = true; - this.executeField = value; - } - } - - /// - /// Bit mask for FILE_ALL_ACCESS from WinNT.h (0x001F01FF). - /// - public YesNoType FileAllRights - { - get - { - return this.fileAllRightsField; - } - set - { - this.fileAllRightsFieldSet = true; - this.fileAllRightsField = value; - } - } - - public YesNoType Write - { - get - { - return this.writeField; - } - set - { - this.writeFieldSet = true; - this.writeField = value; - } - } - - public YesNoType CreateSubkeys - { - get - { - return this.createSubkeysField; - } - set - { - this.createSubkeysFieldSet = true; - this.createSubkeysField = value; - } - } - - public YesNoType EnumerateSubkeys - { - get - { - return this.enumerateSubkeysField; - } - set - { - this.enumerateSubkeysFieldSet = true; - this.enumerateSubkeysField = value; - } - } - - public YesNoType Notify - { - get - { - return this.notifyField; - } - set - { - this.notifyFieldSet = true; - this.notifyField = value; - } - } - - public YesNoType CreateLink - { - get - { - return this.createLinkField; - } - set - { - this.createLinkFieldSet = true; - this.createLinkField = value; - } - } - - public YesNoType GenericAll - { - get - { - return this.genericAllField; - } - set - { - this.genericAllFieldSet = true; - this.genericAllField = value; - } - } - - public YesNoType GenericExecute - { - get - { - return this.genericExecuteField; - } - set - { - this.genericExecuteFieldSet = true; - this.genericExecuteField = value; - } - } - - public YesNoType GenericWrite - { - get - { - return this.genericWriteField; - } - set - { - this.genericWriteFieldSet = true; - this.genericWriteField = value; - } - } - - /// - /// specifying this will fail to grant read access - /// - public YesNoType GenericRead - { - get - { - return this.genericReadField; - } - set - { - this.genericReadFieldSet = true; - this.genericReadField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Permission", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.domainFieldSet) - { - writer.WriteAttributeString("Domain", this.domainField); - } - if (this.userFieldSet) - { - writer.WriteAttributeString("User", this.userField); - } - if (this.readFieldSet) - { - if ((this.readField == YesNoType.no)) - { - writer.WriteAttributeString("Read", "no"); - } - if ((this.readField == YesNoType.yes)) - { - writer.WriteAttributeString("Read", "yes"); - } - } - if (this.deleteFieldSet) - { - if ((this.deleteField == YesNoType.no)) - { - writer.WriteAttributeString("Delete", "no"); - } - if ((this.deleteField == YesNoType.yes)) - { - writer.WriteAttributeString("Delete", "yes"); - } - } - if (this.readPermissionFieldSet) - { - if ((this.readPermissionField == YesNoType.no)) - { - writer.WriteAttributeString("ReadPermission", "no"); - } - if ((this.readPermissionField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadPermission", "yes"); - } - } - if (this.changePermissionFieldSet) - { - if ((this.changePermissionField == YesNoType.no)) - { - writer.WriteAttributeString("ChangePermission", "no"); - } - if ((this.changePermissionField == YesNoType.yes)) - { - writer.WriteAttributeString("ChangePermission", "yes"); - } - } - if (this.takeOwnershipFieldSet) - { - if ((this.takeOwnershipField == YesNoType.no)) - { - writer.WriteAttributeString("TakeOwnership", "no"); - } - if ((this.takeOwnershipField == YesNoType.yes)) - { - writer.WriteAttributeString("TakeOwnership", "yes"); - } - } - if (this.specificRightsAllFieldSet) - { - if ((this.specificRightsAllField == YesNoType.no)) - { - writer.WriteAttributeString("SpecificRightsAll", "no"); - } - if ((this.specificRightsAllField == YesNoType.yes)) - { - writer.WriteAttributeString("SpecificRightsAll", "yes"); - } - } - if (this.readAttributesFieldSet) - { - if ((this.readAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("ReadAttributes", "no"); - } - if ((this.readAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadAttributes", "yes"); - } - } - if (this.writeAttributesFieldSet) - { - if ((this.writeAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("WriteAttributes", "no"); - } - if ((this.writeAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("WriteAttributes", "yes"); - } - } - if (this.readExtendedAttributesFieldSet) - { - if ((this.readExtendedAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("ReadExtendedAttributes", "no"); - } - if ((this.readExtendedAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadExtendedAttributes", "yes"); - } - } - if (this.writeExtendedAttributesFieldSet) - { - if ((this.writeExtendedAttributesField == YesNoType.no)) - { - writer.WriteAttributeString("WriteExtendedAttributes", "no"); - } - if ((this.writeExtendedAttributesField == YesNoType.yes)) - { - writer.WriteAttributeString("WriteExtendedAttributes", "yes"); - } - } - if (this.synchronizeFieldSet) - { - if ((this.synchronizeField == YesNoType.no)) - { - writer.WriteAttributeString("Synchronize", "no"); - } - if ((this.synchronizeField == YesNoType.yes)) - { - writer.WriteAttributeString("Synchronize", "yes"); - } - } - if (this.createFileFieldSet) - { - if ((this.createFileField == YesNoType.no)) - { - writer.WriteAttributeString("CreateFile", "no"); - } - if ((this.createFileField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateFile", "yes"); - } - } - if (this.createChildFieldSet) - { - if ((this.createChildField == YesNoType.no)) - { - writer.WriteAttributeString("CreateChild", "no"); - } - if ((this.createChildField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateChild", "yes"); - } - } - if (this.deleteChildFieldSet) - { - if ((this.deleteChildField == YesNoType.no)) - { - writer.WriteAttributeString("DeleteChild", "no"); - } - if ((this.deleteChildField == YesNoType.yes)) - { - writer.WriteAttributeString("DeleteChild", "yes"); - } - } - if (this.traverseFieldSet) - { - if ((this.traverseField == YesNoType.no)) - { - writer.WriteAttributeString("Traverse", "no"); - } - if ((this.traverseField == YesNoType.yes)) - { - writer.WriteAttributeString("Traverse", "yes"); - } - } - if (this.appendFieldSet) - { - if ((this.appendField == YesNoType.no)) - { - writer.WriteAttributeString("Append", "no"); - } - if ((this.appendField == YesNoType.yes)) - { - writer.WriteAttributeString("Append", "yes"); - } - } - if (this.executeFieldSet) - { - if ((this.executeField == YesNoType.no)) - { - writer.WriteAttributeString("Execute", "no"); - } - if ((this.executeField == YesNoType.yes)) - { - writer.WriteAttributeString("Execute", "yes"); - } - } - if (this.fileAllRightsFieldSet) - { - if ((this.fileAllRightsField == YesNoType.no)) - { - writer.WriteAttributeString("FileAllRights", "no"); - } - if ((this.fileAllRightsField == YesNoType.yes)) - { - writer.WriteAttributeString("FileAllRights", "yes"); - } - } - if (this.writeFieldSet) - { - if ((this.writeField == YesNoType.no)) - { - writer.WriteAttributeString("Write", "no"); - } - if ((this.writeField == YesNoType.yes)) - { - writer.WriteAttributeString("Write", "yes"); - } - } - if (this.createSubkeysFieldSet) - { - if ((this.createSubkeysField == YesNoType.no)) - { - writer.WriteAttributeString("CreateSubkeys", "no"); - } - if ((this.createSubkeysField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateSubkeys", "yes"); - } - } - if (this.enumerateSubkeysFieldSet) - { - if ((this.enumerateSubkeysField == YesNoType.no)) - { - writer.WriteAttributeString("EnumerateSubkeys", "no"); - } - if ((this.enumerateSubkeysField == YesNoType.yes)) - { - writer.WriteAttributeString("EnumerateSubkeys", "yes"); - } - } - if (this.notifyFieldSet) - { - if ((this.notifyField == YesNoType.no)) - { - writer.WriteAttributeString("Notify", "no"); - } - if ((this.notifyField == YesNoType.yes)) - { - writer.WriteAttributeString("Notify", "yes"); - } - } - if (this.createLinkFieldSet) - { - if ((this.createLinkField == YesNoType.no)) - { - writer.WriteAttributeString("CreateLink", "no"); - } - if ((this.createLinkField == YesNoType.yes)) - { - writer.WriteAttributeString("CreateLink", "yes"); - } - } - if (this.genericAllFieldSet) - { - if ((this.genericAllField == YesNoType.no)) - { - writer.WriteAttributeString("GenericAll", "no"); - } - if ((this.genericAllField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericAll", "yes"); - } - } - if (this.genericExecuteFieldSet) - { - if ((this.genericExecuteField == YesNoType.no)) - { - writer.WriteAttributeString("GenericExecute", "no"); - } - if ((this.genericExecuteField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericExecute", "yes"); - } - } - if (this.genericWriteFieldSet) - { - if ((this.genericWriteField == YesNoType.no)) - { - writer.WriteAttributeString("GenericWrite", "no"); - } - if ((this.genericWriteField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericWrite", "yes"); - } - } - if (this.genericReadFieldSet) - { - if ((this.genericReadField == YesNoType.no)) - { - writer.WriteAttributeString("GenericRead", "no"); - } - if ((this.genericReadField == YesNoType.yes)) - { - writer.WriteAttributeString("GenericRead", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Domain" == name)) - { - this.domainField = value; - this.domainFieldSet = true; - } - if (("User" == name)) - { - this.userField = value; - this.userFieldSet = true; - } - if (("Read" == name)) - { - this.readField = Enums.ParseYesNoType(value); - this.readFieldSet = true; - } - if (("Delete" == name)) - { - this.deleteField = Enums.ParseYesNoType(value); - this.deleteFieldSet = true; - } - if (("ReadPermission" == name)) - { - this.readPermissionField = Enums.ParseYesNoType(value); - this.readPermissionFieldSet = true; - } - if (("ChangePermission" == name)) - { - this.changePermissionField = Enums.ParseYesNoType(value); - this.changePermissionFieldSet = true; - } - if (("TakeOwnership" == name)) - { - this.takeOwnershipField = Enums.ParseYesNoType(value); - this.takeOwnershipFieldSet = true; - } - if (("SpecificRightsAll" == name)) - { - this.specificRightsAllField = Enums.ParseYesNoType(value); - this.specificRightsAllFieldSet = true; - } - if (("ReadAttributes" == name)) - { - this.readAttributesField = Enums.ParseYesNoType(value); - this.readAttributesFieldSet = true; - } - if (("WriteAttributes" == name)) - { - this.writeAttributesField = Enums.ParseYesNoType(value); - this.writeAttributesFieldSet = true; - } - if (("ReadExtendedAttributes" == name)) - { - this.readExtendedAttributesField = Enums.ParseYesNoType(value); - this.readExtendedAttributesFieldSet = true; - } - if (("WriteExtendedAttributes" == name)) - { - this.writeExtendedAttributesField = Enums.ParseYesNoType(value); - this.writeExtendedAttributesFieldSet = true; - } - if (("Synchronize" == name)) - { - this.synchronizeField = Enums.ParseYesNoType(value); - this.synchronizeFieldSet = true; - } - if (("CreateFile" == name)) - { - this.createFileField = Enums.ParseYesNoType(value); - this.createFileFieldSet = true; - } - if (("CreateChild" == name)) - { - this.createChildField = Enums.ParseYesNoType(value); - this.createChildFieldSet = true; - } - if (("DeleteChild" == name)) - { - this.deleteChildField = Enums.ParseYesNoType(value); - this.deleteChildFieldSet = true; - } - if (("Traverse" == name)) - { - this.traverseField = Enums.ParseYesNoType(value); - this.traverseFieldSet = true; - } - if (("Append" == name)) - { - this.appendField = Enums.ParseYesNoType(value); - this.appendFieldSet = true; - } - if (("Execute" == name)) - { - this.executeField = Enums.ParseYesNoType(value); - this.executeFieldSet = true; - } - if (("FileAllRights" == name)) - { - this.fileAllRightsField = Enums.ParseYesNoType(value); - this.fileAllRightsFieldSet = true; - } - if (("Write" == name)) - { - this.writeField = Enums.ParseYesNoType(value); - this.writeFieldSet = true; - } - if (("CreateSubkeys" == name)) - { - this.createSubkeysField = Enums.ParseYesNoType(value); - this.createSubkeysFieldSet = true; - } - if (("EnumerateSubkeys" == name)) - { - this.enumerateSubkeysField = Enums.ParseYesNoType(value); - this.enumerateSubkeysFieldSet = true; - } - if (("Notify" == name)) - { - this.notifyField = Enums.ParseYesNoType(value); - this.notifyFieldSet = true; - } - if (("CreateLink" == name)) - { - this.createLinkField = Enums.ParseYesNoType(value); - this.createLinkFieldSet = true; - } - if (("GenericAll" == name)) - { - this.genericAllField = Enums.ParseYesNoType(value); - this.genericAllFieldSet = true; - } - if (("GenericExecute" == name)) - { - this.genericExecuteField = Enums.ParseYesNoType(value); - this.genericExecuteFieldSet = true; - } - if (("GenericWrite" == name)) - { - this.genericWriteField = Enums.ParseYesNoType(value); - this.genericWriteFieldSet = true; - } - if (("GenericRead" == name)) - { - this.genericReadField = Enums.ParseYesNoType(value); - this.genericReadFieldSet = true; - } - } - } - - /// - /// Sets ACLs on File, Registry, or CreateFolder. When under a Registry element, this cannot be used - /// if the Action attribute's value is remove or removeKeyOnInstall. This element is only available - /// when installing with MSI 5.0. For downlevel support, see the PermissionEx element from the - /// WixUtilExtension. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PermissionEx : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string sddlField; - - private bool sddlFieldSet; - - private ISchemaElement parentElement; - - public PermissionEx() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Condition))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Primary key used to identify this particular entry. If this is not specified the parent element's Id attribute - /// will be used instead. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Security descriptor to apply to parent object. - /// - public string Sddl - { - get - { - return this.sddlField; - } - set - { - this.sddlFieldSet = true; - this.sddlField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Condition" == childName)) - { - childValue = new Condition(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PermissionEx", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sddlFieldSet) - { - writer.WriteAttributeString("Sddl", this.sddlField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Sddl" == name)) - { - this.sddlField = value; - this.sddlFieldSet = true; - } - } - } - - /// - /// Copy or move an existing file on the target machine, or copy a file that is being installed, to another destination. When - /// this element is nested under a File element, the parent file will be installed, then copied to the specified destination - /// if the parent component of the file is selected for installation or removal. When this element is nested under - /// a Component element and no FileId attribute is specified, the file to copy or move must already be on the target machine. - /// When this element is nested under a Component element and the FileId attribute is specified, the specified file is installed, - /// then copied to the specified destination if the parent component is selected for installation or removal (use - /// this option to control the copy of a file in a different component by the parent component's installation state). If the - /// specified destination directory is the same as the directory containing the original file and the name for the proposed source - /// file is the same as the original, then no action takes place. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CopyFile : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string fileIdField; - - private bool fileIdFieldSet; - - private string sourceDirectoryField; - - private bool sourceDirectoryFieldSet; - - private string sourcePropertyField; - - private bool sourcePropertyFieldSet; - - private string sourceNameField; - - private bool sourceNameFieldSet; - - private string destinationDirectoryField; - - private bool destinationDirectoryFieldSet; - - private string destinationPropertyField; - - private bool destinationPropertyFieldSet; - - private string destinationNameField; - - private bool destinationNameFieldSet; - - private string destinationShortNameField; - - private bool destinationShortNameFieldSet; - - private YesNoType deleteField; - - private bool deleteFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary key used to identify this particular entry. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This attribute cannot be specified if the element is nested under a File element. Set this attribute's value to the identifier - /// of a file from a different component to copy it based on the install state of the parent component. - /// - public string FileId - { - get - { - return this.fileIdField; - } - set - { - this.fileIdFieldSet = true; - this.fileIdField = value; - } - } - - /// - /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set - /// this value to the source directory from which to copy or move an existing file on the target machine. This Directory must - /// exist in the installer database at creation time. This attribute cannot be specified in conjunction with SourceProperty. - /// - public string SourceDirectory - { - get - { - return this.sourceDirectoryField; - } - set - { - this.sourceDirectoryFieldSet = true; - this.sourceDirectoryField = value; - } - } - - /// - /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set - /// this value to a property that will have a value that resolves to the full path of the source directory (or full path - /// including file name if SourceName is not specified). The property does not have to exist in the installer database at - /// creation time; it could be created at installation time by a custom action, on the command line, etc. This attribute - /// cannot be specified in conjunction with SourceDirectory. - /// - public string SourceProperty - { - get - { - return this.sourcePropertyField; - } - set - { - this.sourcePropertyFieldSet = true; - this.sourcePropertyField = value; - } - } - - /// - /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set - /// this value to the localizable name of the file(s) to be copied or moved. All of the files that - /// match the wild card will be removed from the specified directory. The value is a filename that may also - /// contain the wild card characters "?" for any single character or "*" for zero or more occurrences of any character. If this - /// attribute is not specified (and this element is not nested under a File element or specify a FileId attribute) then the - /// SourceProperty attribute should be set to the name of a property that will resolve to the full path of the source filename. - /// If the value of this attribute contains a "*" wildcard and the DestinationName attribute is specified, all moved or copied - /// files retain the file names from their sources. - /// - public string SourceName - { - get - { - return this.sourceNameField; - } - set - { - this.sourceNameFieldSet = true; - this.sourceNameField = value; - } - } - - /// - /// Set this value to the destination directory where an existing file on the target machine should be moved or copied to. This - /// Directory must exist in the installer database at creation time. This attribute cannot be specified in conjunction with - /// DestinationProperty. - /// - public string DestinationDirectory - { - get - { - return this.destinationDirectoryField; - } - set - { - this.destinationDirectoryFieldSet = true; - this.destinationDirectoryField = value; - } - } - - /// - /// Set this value to a property that will have a value that resolves to the full path of the destination directory. The property - /// does not have to exist in the installer database at creation time; it could be created at installation time by a custom - /// action, on the command line, etc. This attribute cannot be specified in conjunction with DestinationDirectory. - /// - public string DestinationProperty - { - get - { - return this.destinationPropertyField; - } - set - { - this.destinationPropertyFieldSet = true; - this.destinationPropertyField = value; - } - } - - /// - /// In prior versions of the WiX toolset, this attribute specified the short file name. - /// Now set this value to the localizable name to be given to the original file after it is moved or copied. - /// If this attribute is not specified, then the destination file is given the same name as the source file. - /// If a short file name is specified, the DestinationShortName attribute may not be specified. - /// Also, if this value is a long file name, the DestinationShortName attribute may be omitted to - /// allow WiX to attempt to generate a unique short file name. - /// However, if this name collides with another file or you wish to manually specify - /// the short file name, then the DestinationShortName attribute may be specified. - /// - public string DestinationName - { - get - { - return this.destinationNameField; - } - set - { - this.destinationNameFieldSet = true; - this.destinationNameField = value; - } - } - - /// - /// The short file name of the file in 8.3 format. - /// This attribute should only be set if there is a conflict between generated short file names - /// or you wish to manually specify the short file name. - /// - public string DestinationShortName - { - get - { - return this.destinationShortNameField; - } - set - { - this.destinationShortNameFieldSet = true; - this.destinationShortNameField = value; - } - } - - /// - /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. In other - /// cases, if the attribute is not specified, the default value is "no" and the file is copied, not moved. Set the value to "yes" - /// in order to move the file (thus deleting the source file) instead of copying it. - /// - public YesNoType Delete - { - get - { - return this.deleteField; - } - set - { - this.deleteFieldSet = true; - this.deleteField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CopyFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.fileIdFieldSet) - { - writer.WriteAttributeString("FileId", this.fileIdField); - } - if (this.sourceDirectoryFieldSet) - { - writer.WriteAttributeString("SourceDirectory", this.sourceDirectoryField); - } - if (this.sourcePropertyFieldSet) - { - writer.WriteAttributeString("SourceProperty", this.sourcePropertyField); - } - if (this.sourceNameFieldSet) - { - writer.WriteAttributeString("SourceName", this.sourceNameField); - } - if (this.destinationDirectoryFieldSet) - { - writer.WriteAttributeString("DestinationDirectory", this.destinationDirectoryField); - } - if (this.destinationPropertyFieldSet) - { - writer.WriteAttributeString("DestinationProperty", this.destinationPropertyField); - } - if (this.destinationNameFieldSet) - { - writer.WriteAttributeString("DestinationName", this.destinationNameField); - } - if (this.destinationShortNameFieldSet) - { - writer.WriteAttributeString("DestinationShortName", this.destinationShortNameField); - } - if (this.deleteFieldSet) - { - if ((this.deleteField == YesNoType.no)) - { - writer.WriteAttributeString("Delete", "no"); - } - if ((this.deleteField == YesNoType.yes)) - { - writer.WriteAttributeString("Delete", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("FileId" == name)) - { - this.fileIdField = value; - this.fileIdFieldSet = true; - } - if (("SourceDirectory" == name)) - { - this.sourceDirectoryField = value; - this.sourceDirectoryFieldSet = true; - } - if (("SourceProperty" == name)) - { - this.sourcePropertyField = value; - this.sourcePropertyFieldSet = true; - } - if (("SourceName" == name)) - { - this.sourceNameField = value; - this.sourceNameFieldSet = true; - } - if (("DestinationDirectory" == name)) - { - this.destinationDirectoryField = value; - this.destinationDirectoryFieldSet = true; - } - if (("DestinationProperty" == name)) - { - this.destinationPropertyField = value; - this.destinationPropertyFieldSet = true; - } - if (("DestinationName" == name)) - { - this.destinationNameField = value; - this.destinationNameFieldSet = true; - } - if (("DestinationShortName" == name)) - { - this.destinationShortNameField = value; - this.destinationShortNameFieldSet = true; - } - if (("Delete" == name)) - { - this.deleteField = Enums.ParseYesNoType(value); - this.deleteFieldSet = true; - } - } - } - - /// - /// File specification for File table, must be child node of Component. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class File : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string companionFileField; - - private bool companionFileFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private YesNoType keyPathField; - - private bool keyPathFieldSet; - - private string shortNameField; - - private bool shortNameFieldSet; - - private YesNoType readOnlyField; - - private bool readOnlyFieldSet; - - private YesNoType hiddenField; - - private bool hiddenFieldSet; - - private YesNoType systemField; - - private bool systemFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private YesNoType checksumField; - - private bool checksumFieldSet; - - private YesNoDefaultType compressedField; - - private bool compressedFieldSet; - - private string bindPathField; - - private bool bindPathFieldSet; - - private int selfRegCostField; - - private bool selfRegCostFieldSet; - - private YesNoType trueTypeField; - - private bool trueTypeFieldSet; - - private string fontTitleField; - - private bool fontTitleFieldSet; - - private string defaultLanguageField; - - private bool defaultLanguageFieldSet; - - private int defaultSizeField; - - private bool defaultSizeFieldSet; - - private string defaultVersionField; - - private bool defaultVersionFieldSet; - - private AssemblyType assemblyField; - - private bool assemblyFieldSet; - - private string assemblyManifestField; - - private bool assemblyManifestFieldSet; - - private string assemblyApplicationField; - - private bool assemblyApplicationFieldSet; - - private ProcessorArchitectureType processorArchitectureField; - - private bool processorArchitectureFieldSet; - - private string diskIdField; - - private bool diskIdFieldSet; - - private string sourceField; - - private bool sourceFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private int patchGroupField; - - private bool patchGroupFieldSet; - - private YesNoType patchIgnoreField; - - private bool patchIgnoreFieldSet; - - private YesNoType patchAllowIgnoreOnErrorField; - - private bool patchAllowIgnoreOnErrorFieldSet; - - private YesNoType patchWholeFileField; - - private bool patchWholeFileFieldSet; - - private ISchemaElement parentElement; - - public File() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AssemblyName))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CopyFile))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDriver))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCTranslator))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TypeLib))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The unique identifier for this File element. If you omit Id, it defaults to the file name portion of the Source attribute, if specified. May be referenced as a Property by specifying [#value]. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set this attribute to make this file a companion child of another file. The installation - /// state of a companion file depends not on its own file versioning information, but on the versioning of its - /// companion parent. A file that is the key path for its component can not be a companion file (that means - /// this attribute cannot be set if KeyPath="yes" for this file). The Version attribute cannot be set along - /// with this attribute since companion files are not installed based on their own version. - /// - public string CompanionFile - { - get - { - return this.companionFileField; - } - set - { - this.companionFileFieldSet = true; - this.companionFileField = value; - } - } - - /// - /// In prior versions of the WiX toolset, this attribute specified the short file name. - /// This attribute's value may now be either a short or long file name. - /// If a short file name is specified, the ShortName attribute may not be specified. - /// Also, if this value is a long file name, the ShortName attribute may be omitted to - /// allow WiX to attempt to generate a unique short file name. - /// However, if this name collides with another file or you wish to manually specify - /// the short file name, then the ShortName attribute may be specified. - /// Finally, if this attribute is omitted then its default value is the file name portion - /// of the Source attribute, if one is specified, or the value of the Id attribute, if - /// the Source attribute is omitted or doesn't contain a file name. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Set to yes in order to force this file to be the key path for the parent component. - /// - public YesNoType KeyPath - { - get - { - return this.keyPathField; - } - set - { - this.keyPathFieldSet = true; - this.keyPathField = value; - } - } - - /// - /// The short file name of the file in 8.3 format. - /// This attribute should only be set if there is a conflict between generated short file names - /// or the user wants to manually specify the short file name. - /// - public string ShortName - { - get - { - return this.shortNameField; - } - set - { - this.shortNameFieldSet = true; - this.shortNameField = value; - } - } - - /// - /// Set to yes in order to have the file's read-only attribute set when it is installed on the target machine. - /// - public YesNoType ReadOnly - { - get - { - return this.readOnlyField; - } - set - { - this.readOnlyFieldSet = true; - this.readOnlyField = value; - } - } - - /// - /// Set to yes in order to have the file's hidden attribute set when it is installed on the target machine. - /// - public YesNoType Hidden - { - get - { - return this.hiddenField; - } - set - { - this.hiddenFieldSet = true; - this.hiddenField = value; - } - } - - /// - /// Set to yes in order to have the file's system attribute set when it is installed on the target machine. - /// - public YesNoType System - { - get - { - return this.systemField; - } - set - { - this.systemFieldSet = true; - this.systemField = value; - } - } - - /// - /// If a file is vital, then installation cannot proceed unless the file is successfully installed. The user will have no option to ignore an error installing this file. If an error occurs, they can merely retry to install the file or abort the installation. The default is "yes," unless the -sfdvital switch (candle.exe) or SuppressFileDefaultVital property (.wixproj) is used. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// This attribute should be set to "yes" for every executable file in the installation that has a valid checksum stored in the Portable Executable (PE) file header. Only those files that have this attribute set will be verified for valid checksum during a reinstall. - /// - public YesNoType Checksum - { - get - { - return this.checksumField; - } - set - { - this.checksumFieldSet = true; - this.checksumField = value; - } - } - - /// - /// Sets the file's source type compression. A setting of "yes" or "no" will override the setting in the Word Count Summary Property. - /// - public YesNoDefaultType Compressed - { - get - { - return this.compressedField; - } - set - { - this.compressedFieldSet = true; - this.compressedField = value; - } - } - - /// - /// A list of paths, separated by semicolons, that represent the paths to be searched to find the imported DLLs. The list is usually a list of properties, with each property enclosed inside square brackets. The value may be set to an empty string. Including this attribute will cause an entry to be generated for the file in the BindImage table. - /// - public string BindPath - { - get - { - return this.bindPathField; - } - set - { - this.bindPathFieldSet = true; - this.bindPathField = value; - } - } - - /// - /// The cost of registering the file in bytes. This must be a non-negative number. Including this attribute will cause an entry to be generated for the file in the SelfReg table. - /// - public int SelfRegCost - { - get - { - return this.selfRegCostField; - } - set - { - this.selfRegCostFieldSet = true; - this.selfRegCostField = value; - } - } - - /// - /// Causes an entry to be generated for the file in the Font table with no FontTitle specified. This attribute is intended to be used to register the file as a TrueType font. - /// - public YesNoType TrueType - { - get - { - return this.trueTypeField; - } - set - { - this.trueTypeFieldSet = true; - this.trueTypeField = value; - } - } - - /// - /// Causes an entry to be generated for the file in the Font table with the specified FontTitle. This attribute is intended to be used to register the file as a non-TrueType font. - /// - public string FontTitle - { - get - { - return this.fontTitleField; - } - set - { - this.fontTitleFieldSet = true; - this.fontTitleField = value; - } - } - - /// - /// This is the default language of this file. The linker will replace this value from the value in the file if the suppress files option is not used. - /// - public string DefaultLanguage - { - get - { - return this.defaultLanguageField; - } - set - { - this.defaultLanguageFieldSet = true; - this.defaultLanguageField = value; - } - } - - /// - /// This is the default size of this file. The linker will replace this value from the value in the file if the suppress files option is not used. - /// - public int DefaultSize - { - get - { - return this.defaultSizeField; - } - set - { - this.defaultSizeFieldSet = true; - this.defaultSizeField = value; - } - } - - /// - /// This is the default version of this file. The linker will replace this value from the value in the file if the suppress files option is not used. - /// - public string DefaultVersion - { - get - { - return this.defaultVersionField; - } - set - { - this.defaultVersionFieldSet = true; - this.defaultVersionField = value; - } - } - - /// - /// Specifies if this File is a Win32 Assembly or .NET Assembly that needs to be installed into the - /// Global Assembly Cache (GAC). If the value is '.net' or 'win32', this file must also be the key path of the Component. - /// - public AssemblyType Assembly - { - get - { - return this.assemblyField; - } - set - { - this.assemblyFieldSet = true; - this.assemblyField = value; - } - } - - /// - /// Specifies the file identifier of the manifest file that describes this assembly. - /// The manifest file should be in the same component as the assembly it describes. - /// This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'. - /// - public string AssemblyManifest - { - get - { - return this.assemblyManifestField; - } - set - { - this.assemblyManifestFieldSet = true; - this.assemblyManifestField = value; - } - } - - /// - /// Specifies the file identifier of the application file. This assembly will be isolated - /// to the same directory as the application file. - /// If this attribute is absent, the assembly will be installed to the Global Assembly Cache (GAC). - /// This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'. - /// - public string AssemblyApplication - { - get - { - return this.assemblyApplicationField; - } - set - { - this.assemblyApplicationFieldSet = true; - this.assemblyApplicationField = value; - } - } - - /// - /// Specifies the architecture for this assembly. This attribute should only be used on .NET Framework 2.0 or higher assemblies. - /// - public ProcessorArchitectureType ProcessorArchitecture - { - get - { - return this.processorArchitectureField; - } - set - { - this.processorArchitectureFieldSet = true; - this.processorArchitectureField = value; - } - } - - /// - /// The value of this attribute should correspond to the Id attribute of a Media - /// element authored elsewhere. By creating this connection between a file and - /// its media, you set the packaging options to the values specified in the Media - /// element (values such as compression level, cab embedding, etc...). Specifying - /// the DiskId attribute on the File element overrides the default DiskId attribute - /// from the parent Component element. If no DiskId attribute is specified, - /// the default is "1". This DiskId attribute is ignored when creating a merge module - /// because merge modules do not have media. - /// - public string DiskId - { - get - { - return this.diskIdField; - } - set - { - this.diskIdFieldSet = true; - this.diskIdField = value; - } - } - - /// - /// Specifies the path to the File in the build process. Overrides default source path set by parent directories and Name attribute. This attribute must be set if no source information can be gathered from parent directories. For more information, see - /// - public string Source - { - get - { - return this.sourceField; - } - set - { - this.sourceFieldSet = true; - this.sourceField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - /// - /// This attribute must be set for patch-added files. Each patch should be assigned a different patch group number. Patch groups - /// numbers must be greater 0 and should be assigned consecutively. For example, the first patch should use PatchGroup='1', the - /// second patch will have PatchGroup='2', etc... - /// - public int PatchGroup - { - get - { - return this.patchGroupField; - } - set - { - this.patchGroupFieldSet = true; - this.patchGroupField = value; - } - } - - /// - /// Prevents the updating of the file that is in fact changed in the upgraded image relative to the target images. - /// - public YesNoType PatchIgnore - { - get - { - return this.patchIgnoreField; - } - set - { - this.patchIgnoreFieldSet = true; - this.patchIgnoreField = value; - } - } - - /// - /// Set to indicate that the patch is non-vital. - /// - public YesNoType PatchAllowIgnoreOnError - { - get - { - return this.patchAllowIgnoreOnErrorField; - } - set - { - this.patchAllowIgnoreOnErrorFieldSet = true; - this.patchAllowIgnoreOnErrorField = value; - } - } - - /// - /// Set if the entire file should be installed rather than creating a binary patch. - /// - public YesNoType PatchWholeFile - { - get - { - return this.patchWholeFileField; - } - set - { - this.patchWholeFileFieldSet = true; - this.patchWholeFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("AssemblyName" == childName)) - { - childValue = new AssemblyName(); - } - if (("Permission" == childName)) - { - childValue = new Permission(); - } - if (("PermissionEx" == childName)) - { - childValue = new PermissionEx(); - } - if (("CopyFile" == childName)) - { - childValue = new CopyFile(); - } - if (("Shortcut" == childName)) - { - childValue = new Shortcut(); - } - if (("ODBCDriver" == childName)) - { - childValue = new ODBCDriver(); - } - if (("ODBCTranslator" == childName)) - { - childValue = new ODBCTranslator(); - } - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if (("Class" == childName)) - { - childValue = new Class(); - } - if (("AppId" == childName)) - { - childValue = new AppId(); - } - if (("TypeLib" == childName)) - { - childValue = new TypeLib(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a AssemblyType from a string. - /// - public static AssemblyType ParseAssemblyType(string value) - { - AssemblyType parsedValue; - File.TryParseAssemblyType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a AssemblyType from a string. - /// - public static bool TryParseAssemblyType(string value, out AssemblyType parsedValue) - { - parsedValue = AssemblyType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if ((".net" == value)) - { - parsedValue = AssemblyType.net; - } - else - { - if (("no" == value)) - { - parsedValue = AssemblyType.no; - } - else - { - if (("win32" == value)) - { - parsedValue = AssemblyType.win32; - } - else - { - parsedValue = AssemblyType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a ProcessorArchitectureType from a string. - /// - public static ProcessorArchitectureType ParseProcessorArchitectureType(string value) - { - ProcessorArchitectureType parsedValue; - File.TryParseProcessorArchitectureType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ProcessorArchitectureType from a string. - /// - public static bool TryParseProcessorArchitectureType(string value, out ProcessorArchitectureType parsedValue) - { - parsedValue = ProcessorArchitectureType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("msil" == value)) - { - parsedValue = ProcessorArchitectureType.msil; - } - else - { - if (("x86" == value)) - { - parsedValue = ProcessorArchitectureType.x86; - } - else - { - if (("x64" == value)) - { - parsedValue = ProcessorArchitectureType.x64; - } - else - { - if (("ia64" == value)) - { - parsedValue = ProcessorArchitectureType.ia64; - } - else - { - parsedValue = ProcessorArchitectureType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("File", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.companionFileFieldSet) - { - writer.WriteAttributeString("CompanionFile", this.companionFileField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.keyPathFieldSet) - { - if ((this.keyPathField == YesNoType.no)) - { - writer.WriteAttributeString("KeyPath", "no"); - } - if ((this.keyPathField == YesNoType.yes)) - { - writer.WriteAttributeString("KeyPath", "yes"); - } - } - if (this.shortNameFieldSet) - { - writer.WriteAttributeString("ShortName", this.shortNameField); - } - if (this.readOnlyFieldSet) - { - if ((this.readOnlyField == YesNoType.no)) - { - writer.WriteAttributeString("ReadOnly", "no"); - } - if ((this.readOnlyField == YesNoType.yes)) - { - writer.WriteAttributeString("ReadOnly", "yes"); - } - } - if (this.hiddenFieldSet) - { - if ((this.hiddenField == YesNoType.no)) - { - writer.WriteAttributeString("Hidden", "no"); - } - if ((this.hiddenField == YesNoType.yes)) - { - writer.WriteAttributeString("Hidden", "yes"); - } - } - if (this.systemFieldSet) - { - if ((this.systemField == YesNoType.no)) - { - writer.WriteAttributeString("System", "no"); - } - if ((this.systemField == YesNoType.yes)) - { - writer.WriteAttributeString("System", "yes"); - } - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.checksumFieldSet) - { - if ((this.checksumField == YesNoType.no)) - { - writer.WriteAttributeString("Checksum", "no"); - } - if ((this.checksumField == YesNoType.yes)) - { - writer.WriteAttributeString("Checksum", "yes"); - } - } - if (this.compressedFieldSet) - { - if ((this.compressedField == YesNoDefaultType.@default)) - { - writer.WriteAttributeString("Compressed", "default"); - } - if ((this.compressedField == YesNoDefaultType.no)) - { - writer.WriteAttributeString("Compressed", "no"); - } - if ((this.compressedField == YesNoDefaultType.yes)) - { - writer.WriteAttributeString("Compressed", "yes"); - } - } - if (this.bindPathFieldSet) - { - writer.WriteAttributeString("BindPath", this.bindPathField); - } - if (this.selfRegCostFieldSet) - { - writer.WriteAttributeString("SelfRegCost", this.selfRegCostField.ToString(CultureInfo.InvariantCulture)); - } - if (this.trueTypeFieldSet) - { - if ((this.trueTypeField == YesNoType.no)) - { - writer.WriteAttributeString("TrueType", "no"); - } - if ((this.trueTypeField == YesNoType.yes)) - { - writer.WriteAttributeString("TrueType", "yes"); - } - } - if (this.fontTitleFieldSet) - { - writer.WriteAttributeString("FontTitle", this.fontTitleField); - } - if (this.defaultLanguageFieldSet) - { - writer.WriteAttributeString("DefaultLanguage", this.defaultLanguageField); - } - if (this.defaultSizeFieldSet) - { - writer.WriteAttributeString("DefaultSize", this.defaultSizeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.defaultVersionFieldSet) - { - writer.WriteAttributeString("DefaultVersion", this.defaultVersionField); - } - if (this.assemblyFieldSet) - { - if ((this.assemblyField == AssemblyType.net)) - { - writer.WriteAttributeString("Assembly", ".net"); - } - if ((this.assemblyField == AssemblyType.no)) - { - writer.WriteAttributeString("Assembly", "no"); - } - if ((this.assemblyField == AssemblyType.win32)) - { - writer.WriteAttributeString("Assembly", "win32"); - } - } - if (this.assemblyManifestFieldSet) - { - writer.WriteAttributeString("AssemblyManifest", this.assemblyManifestField); - } - if (this.assemblyApplicationFieldSet) - { - writer.WriteAttributeString("AssemblyApplication", this.assemblyApplicationField); - } - if (this.processorArchitectureFieldSet) - { - if ((this.processorArchitectureField == ProcessorArchitectureType.msil)) - { - writer.WriteAttributeString("ProcessorArchitecture", "msil"); - } - if ((this.processorArchitectureField == ProcessorArchitectureType.x86)) - { - writer.WriteAttributeString("ProcessorArchitecture", "x86"); - } - if ((this.processorArchitectureField == ProcessorArchitectureType.x64)) - { - writer.WriteAttributeString("ProcessorArchitecture", "x64"); - } - if ((this.processorArchitectureField == ProcessorArchitectureType.ia64)) - { - writer.WriteAttributeString("ProcessorArchitecture", "ia64"); - } - } - if (this.diskIdFieldSet) - { - writer.WriteAttributeString("DiskId", this.diskIdField); - } - if (this.sourceFieldSet) - { - writer.WriteAttributeString("Source", this.sourceField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - if (this.patchGroupFieldSet) - { - writer.WriteAttributeString("PatchGroup", this.patchGroupField.ToString(CultureInfo.InvariantCulture)); - } - if (this.patchIgnoreFieldSet) - { - if ((this.patchIgnoreField == YesNoType.no)) - { - writer.WriteAttributeString("PatchIgnore", "no"); - } - if ((this.patchIgnoreField == YesNoType.yes)) - { - writer.WriteAttributeString("PatchIgnore", "yes"); - } - } - if (this.patchAllowIgnoreOnErrorFieldSet) - { - if ((this.patchAllowIgnoreOnErrorField == YesNoType.no)) - { - writer.WriteAttributeString("PatchAllowIgnoreOnError", "no"); - } - if ((this.patchAllowIgnoreOnErrorField == YesNoType.yes)) - { - writer.WriteAttributeString("PatchAllowIgnoreOnError", "yes"); - } - } - if (this.patchWholeFileFieldSet) - { - if ((this.patchWholeFileField == YesNoType.no)) - { - writer.WriteAttributeString("PatchWholeFile", "no"); - } - if ((this.patchWholeFileField == YesNoType.yes)) - { - writer.WriteAttributeString("PatchWholeFile", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("CompanionFile" == name)) - { - this.companionFileField = value; - this.companionFileFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("KeyPath" == name)) - { - this.keyPathField = Enums.ParseYesNoType(value); - this.keyPathFieldSet = true; - } - if (("ShortName" == name)) - { - this.shortNameField = value; - this.shortNameFieldSet = true; - } - if (("ReadOnly" == name)) - { - this.readOnlyField = Enums.ParseYesNoType(value); - this.readOnlyFieldSet = true; - } - if (("Hidden" == name)) - { - this.hiddenField = Enums.ParseYesNoType(value); - this.hiddenFieldSet = true; - } - if (("System" == name)) - { - this.systemField = Enums.ParseYesNoType(value); - this.systemFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("Checksum" == name)) - { - this.checksumField = Enums.ParseYesNoType(value); - this.checksumFieldSet = true; - } - if (("Compressed" == name)) - { - this.compressedField = Enums.ParseYesNoDefaultType(value); - this.compressedFieldSet = true; - } - if (("BindPath" == name)) - { - this.bindPathField = value; - this.bindPathFieldSet = true; - } - if (("SelfRegCost" == name)) - { - this.selfRegCostField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.selfRegCostFieldSet = true; - } - if (("TrueType" == name)) - { - this.trueTypeField = Enums.ParseYesNoType(value); - this.trueTypeFieldSet = true; - } - if (("FontTitle" == name)) - { - this.fontTitleField = value; - this.fontTitleFieldSet = true; - } - if (("DefaultLanguage" == name)) - { - this.defaultLanguageField = value; - this.defaultLanguageFieldSet = true; - } - if (("DefaultSize" == name)) - { - this.defaultSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.defaultSizeFieldSet = true; - } - if (("DefaultVersion" == name)) - { - this.defaultVersionField = value; - this.defaultVersionFieldSet = true; - } - if (("Assembly" == name)) - { - this.assemblyField = File.ParseAssemblyType(value); - this.assemblyFieldSet = true; - } - if (("AssemblyManifest" == name)) - { - this.assemblyManifestField = value; - this.assemblyManifestFieldSet = true; - } - if (("AssemblyApplication" == name)) - { - this.assemblyApplicationField = value; - this.assemblyApplicationFieldSet = true; - } - if (("ProcessorArchitecture" == name)) - { - this.processorArchitectureField = File.ParseProcessorArchitectureType(value); - this.processorArchitectureFieldSet = true; - } - if (("DiskId" == name)) - { - this.diskIdField = value; - this.diskIdFieldSet = true; - } - if (("Source" == name)) - { - this.sourceField = value; - this.sourceFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - if (("PatchGroup" == name)) - { - this.patchGroupField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.patchGroupFieldSet = true; - } - if (("PatchIgnore" == name)) - { - this.patchIgnoreField = Enums.ParseYesNoType(value); - this.patchIgnoreFieldSet = true; - } - if (("PatchAllowIgnoreOnError" == name)) - { - this.patchAllowIgnoreOnErrorField = Enums.ParseYesNoType(value); - this.patchAllowIgnoreOnErrorFieldSet = true; - } - if (("PatchWholeFile" == name)) - { - this.patchWholeFileField = Enums.ParseYesNoType(value); - this.patchWholeFileFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum AssemblyType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The file is a .NET Framework assembly. - /// - net, - - /// - /// The file is not a .NET Framework or Win32 assembly. This is the default value. - /// - no, - - /// - /// The file is a Win32 assembly. - /// - win32, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ProcessorArchitectureType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The file is a .NET Framework assembly that is processor-neutral. - /// - msil, - - /// - /// The file is a .NET Framework assembly for the x86 processor. - /// - x86, - - /// - /// The file is a .NET Framework assembly for the x64 processor. - /// - x64, - - /// - /// The file is a .NET Framework assembly for the ia64 processor. - /// - ia64, - } - } - - /// - /// Use several of these elements to specify each registry value in a multiString registry value. This element - /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The - /// values should go in the text area of the MultiStringValue element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MultiStringValue : ISetAttributes, ISchemaElement - { - - private ISchemaElement parentElement; - - private string contentField; - - private bool contentFieldSet; - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Use several of these elements to specify each registry value in a multiString registry value. This element - /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The - /// values should go in the text area of the MultiStringValue element. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MultiStringValue", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - } - - /// - /// Used for organization of child RegistryValue elements or to create a registry key - /// (and optionally remove it during uninstallation). - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegistryKey : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private YesNoType forceCreateOnInstallField; - - private bool forceCreateOnInstallFieldSet; - - private YesNoType forceDeleteOnUninstallField; - - private bool forceDeleteOnUninstallFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private RegistryRootType rootField; - - private bool rootFieldSet; - - private ISchemaElement parentElement; - - public RegistryKey() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryKey))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be - /// generated by hashing the parent Component identifier, Root, Key, and Name. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The Action attribute has been deprecated. In most cases, you can simply omit @Action. If you need to force Windows Installer - /// to create an empty key or recursively delete the key, use the ForceCreateOnInstall or ForceDeleteOnUninstall attributes instead. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// Set this attribute to 'yes' to create an empty key, if absent, when the parent component is installed. - /// This value is needed only to create an empty key with no subkeys or values. Windows Installer creates - /// keys as needed to store subkeys and values. The default is "no". - /// - public YesNoType ForceCreateOnInstall - { - get - { - return this.forceCreateOnInstallField; - } - set - { - this.forceCreateOnInstallFieldSet = true; - this.forceCreateOnInstallField = value; - } - } - - /// - /// Set this attribute to 'yes' to remove the key with all its values and subkeys when the parent component is uninstalled. - /// Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already - /// removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall. - /// The default is "no". - /// - public YesNoType ForceDeleteOnUninstall - { - get - { - return this.forceDeleteOnUninstallField; - } - set - { - this.forceDeleteOnUninstallFieldSet = true; - this.forceDeleteOnUninstallField = value; - } - } - - /// - /// The localizable key for the registry value. - /// If the parent element is a RegistryKey, this value may be omitted to use the - /// path of the parent, or if its specified it will be appended to the path of the parent. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// The predefined root key for the registry value. - /// - public RegistryRootType Root - { - get - { - return this.rootField; - } - set - { - this.rootFieldSet = true; - this.rootField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("RegistryKey" == childName)) - { - childValue = new RegistryKey(); - } - if (("RegistryValue" == childName)) - { - childValue = new RegistryValue(); - } - if (("Permission" == childName)) - { - childValue = new Permission(); - } - if (("PermissionEx" == childName)) - { - childValue = new PermissionEx(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - RegistryKey.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("create" == value)) - { - parsedValue = ActionType.create; - } - else - { - if (("createAndRemoveOnUninstall" == value)) - { - parsedValue = ActionType.createAndRemoveOnUninstall; - } - else - { - if (("none" == value)) - { - parsedValue = ActionType.none; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegistryKey", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.create)) - { - writer.WriteAttributeString("Action", "create"); - } - if ((this.actionField == ActionType.createAndRemoveOnUninstall)) - { - writer.WriteAttributeString("Action", "createAndRemoveOnUninstall"); - } - if ((this.actionField == ActionType.none)) - { - writer.WriteAttributeString("Action", "none"); - } - } - if (this.forceCreateOnInstallFieldSet) - { - if ((this.forceCreateOnInstallField == YesNoType.no)) - { - writer.WriteAttributeString("ForceCreateOnInstall", "no"); - } - if ((this.forceCreateOnInstallField == YesNoType.yes)) - { - writer.WriteAttributeString("ForceCreateOnInstall", "yes"); - } - } - if (this.forceDeleteOnUninstallFieldSet) - { - if ((this.forceDeleteOnUninstallField == YesNoType.no)) - { - writer.WriteAttributeString("ForceDeleteOnUninstall", "no"); - } - if ((this.forceDeleteOnUninstallField == YesNoType.yes)) - { - writer.WriteAttributeString("ForceDeleteOnUninstall", "yes"); - } - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.rootFieldSet) - { - if ((this.rootField == RegistryRootType.HKMU)) - { - writer.WriteAttributeString("Root", "HKMU"); - } - if ((this.rootField == RegistryRootType.HKCR)) - { - writer.WriteAttributeString("Root", "HKCR"); - } - if ((this.rootField == RegistryRootType.HKCU)) - { - writer.WriteAttributeString("Root", "HKCU"); - } - if ((this.rootField == RegistryRootType.HKLM)) - { - writer.WriteAttributeString("Root", "HKLM"); - } - if ((this.rootField == RegistryRootType.HKU)) - { - writer.WriteAttributeString("Root", "HKU"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = RegistryKey.ParseActionType(value); - this.actionFieldSet = true; - } - if (("ForceCreateOnInstall" == name)) - { - this.forceCreateOnInstallField = Enums.ParseYesNoType(value); - this.forceCreateOnInstallFieldSet = true; - } - if (("ForceDeleteOnUninstall" == name)) - { - this.forceDeleteOnUninstallField = Enums.ParseYesNoType(value); - this.forceDeleteOnUninstallFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Root" == name)) - { - this.rootField = Enums.ParseRegistryRootType(value); - this.rootFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Creates the key, if absent, when the parent component is installed. - /// - create, - - /// - /// Creates the key, if absent, when the parent component is installed then remove the key with all its values and subkeys when the parent component is uninstalled. - /// Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already - /// removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall. - /// - createAndRemoveOnUninstall, - - /// - /// Does nothing; this element is used merely in WiX authoring for organization and does nothing to the final output. - /// This is the default value. - /// - none, - } - } - - /// - /// Used to create a registry value. For multi-string values, this can be used to prepend or append values. - /// - /// For legacy authoring: Use several of these elements to specify each registry value in a multiString registry value. This element - /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The - /// values should go in the text area of the RegistryValue element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegistryValue : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private RegistryRootType rootField; - - private bool rootFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private YesNoType keyPathField; - - private bool keyPathFieldSet; - - private ISchemaElement parentElement; - - public RegistryValue() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MultiStringValue))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be - /// generated by hashing the parent Component identifier, Root, Key, and Name. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The predefined root key for the registry value. - /// - public RegistryRootType Root - { - get - { - return this.rootField; - } - set - { - this.rootFieldSet = true; - this.rootField = value; - } - } - - /// - /// The localizable key for the registry value. - /// If the parent element is a RegistryKey, this value may be omitted to use the - /// path of the parent, or if its specified it will be appended to the path of the parent. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// The localizable registry value name. If this attribute is not provided the default value for the registry key will - /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not - /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Set this attribute to the localizable registry value. This value is formatted. The Windows Installer allows - /// several special values to be set for this attribute. You should not use them in WiX. Instead use appropriate - /// values in the Type attribute to get the desired behavior. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// Set this attribute to the type of the desired registry key. This attribute must be specified whenever the Value - /// attribute or a child RegistryValue element is specified. This attribute - /// should only be set when the value of the Action attribute does not include the word 'remove'. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// This is the action that will be taken for this registry value. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// Set this attribute to 'yes' to make this registry key the KeyPath of the parent component. - /// Only one resource (registry, file, etc) can be the KeyPath of a component. - /// - public YesNoType KeyPath - { - get - { - return this.keyPathField; - } - set - { - this.keyPathFieldSet = true; - this.keyPathField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Permission" == childName)) - { - childValue = new Permission(); - } - if (("PermissionEx" == childName)) - { - childValue = new PermissionEx(); - } - if (("MultiStringValue" == childName)) - { - childValue = new MultiStringValue(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - RegistryValue.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("string" == value)) - { - parsedValue = TypeType.@string; - } - else - { - if (("integer" == value)) - { - parsedValue = TypeType.integer; - } - else - { - if (("binary" == value)) - { - parsedValue = TypeType.binary; - } - else - { - if (("expandable" == value)) - { - parsedValue = TypeType.expandable; - } - else - { - if (("multiString" == value)) - { - parsedValue = TypeType.multiString; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - RegistryValue.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("append" == value)) - { - parsedValue = ActionType.append; - } - else - { - if (("prepend" == value)) - { - parsedValue = ActionType.prepend; - } - else - { - if (("write" == value)) - { - parsedValue = ActionType.write; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegistryValue", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.rootFieldSet) - { - if ((this.rootField == RegistryRootType.HKMU)) - { - writer.WriteAttributeString("Root", "HKMU"); - } - if ((this.rootField == RegistryRootType.HKCR)) - { - writer.WriteAttributeString("Root", "HKCR"); - } - if ((this.rootField == RegistryRootType.HKCU)) - { - writer.WriteAttributeString("Root", "HKCU"); - } - if ((this.rootField == RegistryRootType.HKLM)) - { - writer.WriteAttributeString("Root", "HKLM"); - } - if ((this.rootField == RegistryRootType.HKU)) - { - writer.WriteAttributeString("Root", "HKU"); - } - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.@string)) - { - writer.WriteAttributeString("Type", "string"); - } - if ((this.typeField == TypeType.integer)) - { - writer.WriteAttributeString("Type", "integer"); - } - if ((this.typeField == TypeType.binary)) - { - writer.WriteAttributeString("Type", "binary"); - } - if ((this.typeField == TypeType.expandable)) - { - writer.WriteAttributeString("Type", "expandable"); - } - if ((this.typeField == TypeType.multiString)) - { - writer.WriteAttributeString("Type", "multiString"); - } - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.append)) - { - writer.WriteAttributeString("Action", "append"); - } - if ((this.actionField == ActionType.prepend)) - { - writer.WriteAttributeString("Action", "prepend"); - } - if ((this.actionField == ActionType.write)) - { - writer.WriteAttributeString("Action", "write"); - } - } - if (this.keyPathFieldSet) - { - if ((this.keyPathField == YesNoType.no)) - { - writer.WriteAttributeString("KeyPath", "no"); - } - if ((this.keyPathField == YesNoType.yes)) - { - writer.WriteAttributeString("KeyPath", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Root" == name)) - { - this.rootField = Enums.ParseRegistryRootType(value); - this.rootFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = RegistryValue.ParseTypeType(value); - this.typeFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = RegistryValue.ParseActionType(value); - this.actionFieldSet = true; - } - if (("KeyPath" == name)) - { - this.keyPathField = Enums.ParseYesNoType(value); - this.keyPathFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The value is interpreted and stored as a string (REG_SZ). - /// - @string, - - /// - /// The value is interpreted and stored as an integer (REG_DWORD). - /// - integer, - - /// - /// The value is interpreted and stored as a hexadecimal value (REG_BINARY). - /// - binary, - - /// - /// The value is interpreted and stored as an expandable string (REG_EXPAND_SZ). - /// - expandable, - - /// - /// The value is interpreted and stored as a multiple strings (REG_MULTI_SZ). - /// Please note that this value will only result in a multi-string value if there is more than one registry value - /// or the Action attribute's value is 'append' or 'prepend'. Otherwise a string value will be created. - /// - multiString, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Appends the specified value(s) to a multiString registry value. - /// - append, - - /// - /// Prepends the specified value(s) to a multiString registry value. - /// - prepend, - - /// - /// Writes a registry value. This is the default value. - /// - write, - } - } - - /// - /// Used for removing registry keys and all child keys either during install or uninstall. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveRegistryKey : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private RegistryRootType rootField; - - private bool rootFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be - /// generated by hashing the parent Component identifier, Root, Key, and Name. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This is the action that will be taken for this registry value. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// The localizable key for the registry value. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// The predefined root key for the registry value. - /// - public RegistryRootType Root - { - get - { - return this.rootField; - } - set - { - this.rootFieldSet = true; - this.rootField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - RemoveRegistryKey.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("removeOnInstall" == value)) - { - parsedValue = ActionType.removeOnInstall; - } - else - { - if (("removeOnUninstall" == value)) - { - parsedValue = ActionType.removeOnUninstall; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveRegistryKey", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.removeOnInstall)) - { - writer.WriteAttributeString("Action", "removeOnInstall"); - } - if ((this.actionField == ActionType.removeOnUninstall)) - { - writer.WriteAttributeString("Action", "removeOnUninstall"); - } - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.rootFieldSet) - { - if ((this.rootField == RegistryRootType.HKMU)) - { - writer.WriteAttributeString("Root", "HKMU"); - } - if ((this.rootField == RegistryRootType.HKCR)) - { - writer.WriteAttributeString("Root", "HKCR"); - } - if ((this.rootField == RegistryRootType.HKCU)) - { - writer.WriteAttributeString("Root", "HKCU"); - } - if ((this.rootField == RegistryRootType.HKLM)) - { - writer.WriteAttributeString("Root", "HKLM"); - } - if ((this.rootField == RegistryRootType.HKU)) - { - writer.WriteAttributeString("Root", "HKU"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = RemoveRegistryKey.ParseActionType(value); - this.actionFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Root" == name)) - { - this.rootField = Enums.ParseRegistryRootType(value); - this.rootFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Removes a key with all its values and subkeys when the parent component is installed. - /// - removeOnInstall, - - /// - /// Removes a key with all its values and subkeys when the parent component is uninstalled. - /// - removeOnUninstall, - } - } - - /// - /// Used to remove a registry value during installation. - /// There is no standard way to remove a single registry value during uninstall (but you can remove an entire key with RemoveRegistryKey). - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveRegistryValue : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private RegistryRootType rootField; - - private bool rootFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be - /// generated by hashing the parent Component identifier, Root, Key, and Name. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The localizable key for the registry value. - /// If the parent element is a RegistryKey, this value may be omitted to use the - /// path of the parent, or if its specified it will be appended to the path of the parent. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// The localizable registry value name. If this attribute is not provided the default value for the registry key will - /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not - /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The predefined root key for the registry value. - /// - public RegistryRootType Root - { - get - { - return this.rootField; - } - set - { - this.rootFieldSet = true; - this.rootField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveRegistryValue", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.rootFieldSet) - { - if ((this.rootField == RegistryRootType.HKMU)) - { - writer.WriteAttributeString("Root", "HKMU"); - } - if ((this.rootField == RegistryRootType.HKCR)) - { - writer.WriteAttributeString("Root", "HKCR"); - } - if ((this.rootField == RegistryRootType.HKCU)) - { - writer.WriteAttributeString("Root", "HKCU"); - } - if ((this.rootField == RegistryRootType.HKLM)) - { - writer.WriteAttributeString("Root", "HKLM"); - } - if ((this.rootField == RegistryRootType.HKU)) - { - writer.WriteAttributeString("Root", "HKU"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Root" == name)) - { - this.rootField = Enums.ParseRegistryRootType(value); - this.rootFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Registry : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private string keyField; - - private bool keyFieldSet; - - private YesNoType keyPathField; - - private bool keyPathFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private RegistryRootType rootField; - - private bool rootFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - public Registry() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Registry))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be - /// generated by hashing the parent Component identifier, Root, Key, and Name. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This is the action that will be taken for this registry key. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// The localizable key for the registry value. - /// - public string Key - { - get - { - return this.keyField; - } - set - { - this.keyFieldSet = true; - this.keyField = value; - } - } - - /// - /// Set this attribute to 'yes' to make this registry key the KeyPath of the parent component. Only one resource (registry, - /// file, etc) can be the KeyPath of a component. - /// - public YesNoType KeyPath - { - get - { - return this.keyPathField; - } - set - { - this.keyPathFieldSet = true; - this.keyPathField = value; - } - } - - /// - /// The localizable registry value name. If this attribute is not provided the default value for the registry key will - /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not - /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The predefined root key for the registry value. - /// - public RegistryRootType Root - { - get - { - return this.rootField; - } - set - { - this.rootFieldSet = true; - this.rootField = value; - } - } - - /// - /// Set this attribute to the type of the desired registry key. This attribute must be specified whenever the Value - /// attribute or a child RegistryValue element is specified. This attribute - /// should only be set when the value of the Action attribute does not include the word 'remove'. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Set this attribute to the localizable registry value. This value is formatted. The Windows Installer allows - /// several special values to be set for this attribute. You should not use them in WiX. Instead use appropriate - /// values in the Type attribute to get the desired behavior. This attribute cannot be specified if the Action - /// attribute's value contains the word 'remove'. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Permission" == childName)) - { - childValue = new Permission(); - } - if (("PermissionEx" == childName)) - { - childValue = new PermissionEx(); - } - if (("RegistryValue" == childName)) - { - childValue = new RegistryValue(); - } - if (("Registry" == childName)) - { - childValue = new Registry(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - Registry.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("append" == value)) - { - parsedValue = ActionType.append; - } - else - { - if (("createKey" == value)) - { - parsedValue = ActionType.createKey; - } - else - { - if (("createKeyAndRemoveKeyOnUninstall" == value)) - { - parsedValue = ActionType.createKeyAndRemoveKeyOnUninstall; - } - else - { - if (("prepend" == value)) - { - parsedValue = ActionType.prepend; - } - else - { - if (("remove" == value)) - { - parsedValue = ActionType.remove; - } - else - { - if (("removeKeyOnInstall" == value)) - { - parsedValue = ActionType.removeKeyOnInstall; - } - else - { - if (("removeKeyOnUninstall" == value)) - { - parsedValue = ActionType.removeKeyOnUninstall; - } - else - { - if (("write" == value)) - { - parsedValue = ActionType.write; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - } - } - } - } - } - return true; - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - Registry.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("string" == value)) - { - parsedValue = TypeType.@string; - } - else - { - if (("integer" == value)) - { - parsedValue = TypeType.integer; - } - else - { - if (("binary" == value)) - { - parsedValue = TypeType.binary; - } - else - { - if (("expandable" == value)) - { - parsedValue = TypeType.expandable; - } - else - { - if (("multiString" == value)) - { - parsedValue = TypeType.multiString; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Registry", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.append)) - { - writer.WriteAttributeString("Action", "append"); - } - if ((this.actionField == ActionType.createKey)) - { - writer.WriteAttributeString("Action", "createKey"); - } - if ((this.actionField == ActionType.createKeyAndRemoveKeyOnUninstall)) - { - writer.WriteAttributeString("Action", "createKeyAndRemoveKeyOnUninstall"); - } - if ((this.actionField == ActionType.prepend)) - { - writer.WriteAttributeString("Action", "prepend"); - } - if ((this.actionField == ActionType.remove)) - { - writer.WriteAttributeString("Action", "remove"); - } - if ((this.actionField == ActionType.removeKeyOnInstall)) - { - writer.WriteAttributeString("Action", "removeKeyOnInstall"); - } - if ((this.actionField == ActionType.removeKeyOnUninstall)) - { - writer.WriteAttributeString("Action", "removeKeyOnUninstall"); - } - if ((this.actionField == ActionType.write)) - { - writer.WriteAttributeString("Action", "write"); - } - } - if (this.keyFieldSet) - { - writer.WriteAttributeString("Key", this.keyField); - } - if (this.keyPathFieldSet) - { - if ((this.keyPathField == YesNoType.no)) - { - writer.WriteAttributeString("KeyPath", "no"); - } - if ((this.keyPathField == YesNoType.yes)) - { - writer.WriteAttributeString("KeyPath", "yes"); - } - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.rootFieldSet) - { - if ((this.rootField == RegistryRootType.HKMU)) - { - writer.WriteAttributeString("Root", "HKMU"); - } - if ((this.rootField == RegistryRootType.HKCR)) - { - writer.WriteAttributeString("Root", "HKCR"); - } - if ((this.rootField == RegistryRootType.HKCU)) - { - writer.WriteAttributeString("Root", "HKCU"); - } - if ((this.rootField == RegistryRootType.HKLM)) - { - writer.WriteAttributeString("Root", "HKLM"); - } - if ((this.rootField == RegistryRootType.HKU)) - { - writer.WriteAttributeString("Root", "HKU"); - } - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.@string)) - { - writer.WriteAttributeString("Type", "string"); - } - if ((this.typeField == TypeType.integer)) - { - writer.WriteAttributeString("Type", "integer"); - } - if ((this.typeField == TypeType.binary)) - { - writer.WriteAttributeString("Type", "binary"); - } - if ((this.typeField == TypeType.expandable)) - { - writer.WriteAttributeString("Type", "expandable"); - } - if ((this.typeField == TypeType.multiString)) - { - writer.WriteAttributeString("Type", "multiString"); - } - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = Registry.ParseActionType(value); - this.actionFieldSet = true; - } - if (("Key" == name)) - { - this.keyField = value; - this.keyFieldSet = true; - } - if (("KeyPath" == name)) - { - this.keyPathField = Enums.ParseYesNoType(value); - this.keyPathFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Root" == name)) - { - this.rootField = Enums.ParseRegistryRootType(value); - this.rootFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = Registry.ParseTypeType(value); - this.typeFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Appends the specified value(s) to a multiString registry key. - /// - append, - - /// - /// Creates the key, if absent, when the parent component is installed. - /// - createKey, - - /// - /// Creates the key, if absent, when the parent component is installed then remove the key with all its values and subkeys when the parent component is uninstalled. - /// - createKeyAndRemoveKeyOnUninstall, - - /// - /// Prepends the specified value(s) to a multiString registry key. - /// - prepend, - - /// - /// Removes a registry name when the parent component is installed. - /// - remove, - - /// - /// Removes a key with all its values and subkeys when the parent component is installed. - /// - removeKeyOnInstall, - - /// - /// Removes a key with all its values and subkeys when the parent component is uninstalled. - /// - removeKeyOnUninstall, - - /// - /// Writes a registry value. - /// - write, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The value is interpreted and stored as a string (REG_SZ). - /// - @string, - - /// - /// The value is interpreted and stored as an integer (REG_DWORD). - /// - integer, - - /// - /// The value is interpreted and stored as a hexadecimal value (REG_BINARY). - /// - binary, - - /// - /// The value is interpreted and stored as an expandable string (REG_EXPAND_SZ). - /// - expandable, - - /// - /// The value is interpreted and stored as a multiple strings (REG_MULTI_SZ). - /// Please note that this value will only result in a multi-string value if there is more than one registry value - /// or the Action attribute's value is 'append' or 'prepend'. Otherwise a string value will be created. - /// - multiString, - } - } - - /// - /// Remove a file(s) if the parent component is selected for installation or removal. Multiple files can be removed - /// by specifying a wildcard for the value of the Name attribute. By default, the source - /// directory of the file is the directory of the parent component. This can be overridden by specifying the - /// Directory attribute with a value corresponding to the Id of the source directory, or by specifying the Property - /// attribute with a value corresponding to a property that will have a value that resolves to the full path - /// to the source directory. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveFile : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string shortNameField; - - private bool shortNameFieldSet; - - private InstallUninstallType onField; - - private bool onFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary key used to identify this particular entry. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Overrides the directory of the parent component with a specific Directory. This Directory must exist in the - /// installer database at creation time. This attribute cannot be specified in conjunction with the Property attribute. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// Overrides the directory of the parent component with the value of the specified property. The property - /// should have a value that resolves to the full path of the source directory. The property does not have - /// to exist in the installer database at creation time; it could be created at installation time by a custom - /// action, on the command line, etc. This attribute cannot be specified in conjunction with the Directory attribute. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// This value should be set to the localizable name of the file(s) to be removed. All of the files that - /// match the wild card will be removed from the specified directory. The value is a filename that may also - /// contain the wild card characters "?" for any single character or "*" for zero or more occurrences of any character. - /// In prior versions of the WiX toolset, this attribute specified the short file name. - /// This attribute's value may now be either a short or long file name. - /// If a short file name is specified, the ShortName attribute may not be specified. - /// Also, if this value is a long file name, the ShortName attribute may be omitted to - /// allow WiX to attempt to generate a unique short file name. - /// However, if you wish to manually specify the short file name, then the ShortName attribute may be specified. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The short file name of the file in 8.3 format. - /// This attribute should only be set if you want to manually specify the short file name. - /// - public string ShortName - { - get - { - return this.shortNameField; - } - set - { - this.shortNameFieldSet = true; - this.shortNameField = value; - } - } - - /// - /// This value determines the time at which the file(s) may be removed. For 'install', the file will - /// be removed only when the parent component is being installed (msiInstallStateLocal or - /// msiInstallStateSource); for 'uninstall', the file will be removed only when the parent component - /// is being removed (msiInstallStateAbsent); for 'both', the file will be removed in both cases. - /// - public InstallUninstallType On - { - get - { - return this.onField; - } - set - { - this.onFieldSet = true; - this.onField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveFile", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.shortNameFieldSet) - { - writer.WriteAttributeString("ShortName", this.shortNameField); - } - if (this.onFieldSet) - { - if ((this.onField == InstallUninstallType.install)) - { - writer.WriteAttributeString("On", "install"); - } - if ((this.onField == InstallUninstallType.uninstall)) - { - writer.WriteAttributeString("On", "uninstall"); - } - if ((this.onField == InstallUninstallType.both)) - { - writer.WriteAttributeString("On", "both"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("ShortName" == name)) - { - this.shortNameField = value; - this.shortNameFieldSet = true; - } - if (("On" == name)) - { - this.onField = Enums.ParseInstallUninstallType(value); - this.onFieldSet = true; - } - } - } - - /// - /// Remove an empty folder if the parent component is selected for installation or removal. By default, the folder - /// is the directory of the parent component. This can be overridden by specifying the Directory attribute - /// with a value corresponding to the Id of the directory, or by specifying the Property attribute with a value - /// corresponding to a property that will have a value that resolves to the full path of the folder. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveFolder : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private InstallUninstallType onField; - - private bool onFieldSet; - - private ISchemaElement parentElement; - - /// - /// Primary key used to identify this particular entry. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Overrides the directory of the parent component with a specific Directory. This Directory must exist in the - /// installer database at creation time. This attribute cannot be specified in conjunction with the Property attribute. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// Overrides the directory of the parent component with the value of the specified property. The property - /// should have a value that resolves to the full path of the source directory. The property does not have - /// to exist in the installer database at creation time; it could be created at installation time by a custom - /// action, on the command line, etc. This attribute cannot be specified in conjunction with the Directory attribute. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// This value determines the time at which the folder may be removed, based on the install/uninstall of the parent component. - /// For 'install', the folder will be removed only when the parent component is being installed (msiInstallStateLocal or - /// msiInstallStateSource); for 'uninstall', the folder will be removed only when the parent component - /// is being removed (msiInstallStateAbsent); for 'both', the folder will be removed in both cases. - /// - public InstallUninstallType On - { - get - { - return this.onField; - } - set - { - this.onFieldSet = true; - this.onField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveFolder", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.onFieldSet) - { - if ((this.onField == InstallUninstallType.install)) - { - writer.WriteAttributeString("On", "install"); - } - if ((this.onField == InstallUninstallType.uninstall)) - { - writer.WriteAttributeString("On", "uninstall"); - } - if ((this.onField == InstallUninstallType.both)) - { - writer.WriteAttributeString("On", "both"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("On" == name)) - { - this.onField = Enums.ParseInstallUninstallType(value); - this.onFieldSet = true; - } - } - } - - /// - /// Create folder as part of parent Component. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CreateFolder : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string directoryField; - - private bool directoryFieldSet; - - private ISchemaElement parentElement; - - public CreateFolder() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier of Directory to create. Defaults to Directory of parent Component. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Shortcut" == childName)) - { - childValue = new Shortcut(); - } - if (("Permission" == childName)) - { - childValue = new Permission(); - } - if (("PermissionEx" == childName)) - { - childValue = new PermissionEx(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CreateFolder", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - } - } - - /// - /// Optional way for defining AppData, generally used for complex CDATA. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AppData : ISetAttributes, ISchemaElement - { - - private ISchemaElement parentElement; - - private string contentField; - - private bool contentFieldSet; - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Optional way for defining AppData, generally used for complex CDATA. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AppData", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - } - - /// - /// Qualified published component for parent Component - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Category : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string qualifierField; - - private bool qualifierFieldSet; - - private string appDataField; - - private bool appDataFieldSet; - - private string featureField; - - private bool featureFieldSet; - - private ISchemaElement parentElement; - - public Category() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(AppData))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// A string GUID that represents the category of components being grouped together. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// A text string that qualifies the value in the Id attribute. A qualifier is used to distinguish multiple forms of the same Component, such as a Component that is implemented in multiple languages. - /// - public string Qualifier - { - get - { - return this.qualifierField; - } - set - { - this.qualifierFieldSet = true; - this.qualifierField = value; - } - } - - /// - /// An optional localizable text describing the category. The string is commonly parsed by the application and can be displayed to the user. It should describe the category. - /// - public string AppData - { - get - { - return this.appDataField; - } - set - { - this.appDataFieldSet = true; - this.appDataField = value; - } - } - - /// - /// Feature that controls the advertisement of the category. Defaults to the primary Feature for the parent Component . - /// - public string Feature - { - get - { - return this.featureField; - } - set - { - this.featureFieldSet = true; - this.featureField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("AppData" == childName)) - { - childValue = new AppData(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Category", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.qualifierFieldSet) - { - writer.WriteAttributeString("Qualifier", this.qualifierField); - } - if (this.appDataFieldSet) - { - writer.WriteAttributeString("AppData", this.appDataField); - } - if (this.featureFieldSet) - { - writer.WriteAttributeString("Feature", this.featureField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Qualifier" == name)) - { - this.qualifierField = value; - this.qualifierFieldSet = true; - } - if (("AppData" == name)) - { - this.appDataField = value; - this.appDataFieldSet = true; - } - if (("Feature" == name)) - { - this.featureField = value; - this.featureFieldSet = true; - } - } - } - - /// - /// MIME content-type for an Extension - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MIME : ISchemaElement, ISetAttributes - { - - private YesNoType advertiseField; - - private bool advertiseFieldSet; - - private string contentTypeField; - - private bool contentTypeFieldSet; - - private string classField; - - private bool classFieldSet; - - private YesNoType defaultField; - - private bool defaultFieldSet; - - private ISchemaElement parentElement; - - /// - /// Whether this MIME is to be advertised. The default is to match whatever the parent extension element uses. If the parent element is not advertised, then this element cannot be advertised either. - /// - public YesNoType Advertise - { - get - { - return this.advertiseField; - } - set - { - this.advertiseFieldSet = true; - this.advertiseField = value; - } - } - - /// - /// This is the identifier for the MIME content. It is commonly written in the form of type/format. - /// - public string ContentType - { - get - { - return this.contentTypeField; - } - set - { - this.contentTypeFieldSet = true; - this.contentTypeField = value; - } - } - - /// - /// Class ID for the COM server that is to be associated with the MIME content. - /// - public string Class - { - get - { - return this.classField; - } - set - { - this.classFieldSet = true; - this.classField = value; - } - } - - /// - /// If 'yes', become the content type for the parent Extension. The default value is 'no'. - /// - public YesNoType Default - { - get - { - return this.defaultField; - } - set - { - this.defaultFieldSet = true; - this.defaultField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MIME", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.advertiseFieldSet) - { - if ((this.advertiseField == YesNoType.no)) - { - writer.WriteAttributeString("Advertise", "no"); - } - if ((this.advertiseField == YesNoType.yes)) - { - writer.WriteAttributeString("Advertise", "yes"); - } - } - if (this.contentTypeFieldSet) - { - writer.WriteAttributeString("ContentType", this.contentTypeField); - } - if (this.classFieldSet) - { - writer.WriteAttributeString("Class", this.classField); - } - if (this.defaultFieldSet) - { - if ((this.defaultField == YesNoType.no)) - { - writer.WriteAttributeString("Default", "no"); - } - if ((this.defaultField == YesNoType.yes)) - { - writer.WriteAttributeString("Default", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Advertise" == name)) - { - this.advertiseField = Enums.ParseYesNoType(value); - this.advertiseFieldSet = true; - } - if (("ContentType" == name)) - { - this.contentTypeField = value; - this.contentTypeFieldSet = true; - } - if (("Class" == name)) - { - this.classField = value; - this.classFieldSet = true; - } - if (("Default" == name)) - { - this.defaultField = Enums.ParseYesNoType(value); - this.defaultFieldSet = true; - } - } - } - - /// - /// Verb definition for an Extension. When advertised, this element creates a row in the - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Verb : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string commandField; - - private bool commandFieldSet; - - private string argumentField; - - private bool argumentFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private string targetField; - - private bool targetFieldSet; - - private string targetFileField; - - private bool targetFileFieldSet; - - private string targetPropertyField; - - private bool targetPropertyFieldSet; - - private ISchemaElement parentElement; - - /// - /// The verb for the command. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The localized text displayed on the context menu. - /// - public string Command - { - get - { - return this.commandField; - } - set - { - this.commandFieldSet = true; - this.commandField = value; - } - } - - /// - /// Value for the command arguments. Note that the resolution of properties in the - /// Argument field is limited. A property formatted as [Property] in this field can only be resolved if the property - /// already has the intended value when the component owning the verb is installed. For example, for the argument - /// "[#MyDoc.doc]" to resolve to the correct value, the same process must be installing the file MyDoc.doc and the - /// component that owns the verb. - /// - public string Argument - { - get - { - return this.argumentField; - } - set - { - this.argumentFieldSet = true; - this.argumentField = value; - } - } - - /// - /// The sequence of the commands. Only verbs for which the Sequence is specified - /// are used to prepare an ordered list for the default value of the shell key. The Verb with the lowest value in this - /// column becomes the default verb. Used only for Advertised verbs. - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - public string Target - { - get - { - return this.targetField; - } - set - { - this.targetFieldSet = true; - this.targetField = value; - } - } - - /// - /// Either this attribute or the TargetProperty attribute must be specified for a non-advertised verb. - /// The value should be the identifier of the target file to be executed for the verb. - /// - public string TargetFile - { - get - { - return this.targetFileField; - } - set - { - this.targetFileFieldSet = true; - this.targetFileField = value; - } - } - - /// - /// Either this attribute or the TargetFile attribute must be specified for a non-advertised verb. - /// The value should be the identifier of the property which will resolve to the path to the target file to be executed for the verb. - /// - public string TargetProperty - { - get - { - return this.targetPropertyField; - } - set - { - this.targetPropertyFieldSet = true; - this.targetPropertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Verb", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.commandFieldSet) - { - writer.WriteAttributeString("Command", this.commandField); - } - if (this.argumentFieldSet) - { - writer.WriteAttributeString("Argument", this.argumentField); - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.targetFieldSet) - { - writer.WriteAttributeString("Target", this.targetField); - } - if (this.targetFileFieldSet) - { - writer.WriteAttributeString("TargetFile", this.targetFileField); - } - if (this.targetPropertyFieldSet) - { - writer.WriteAttributeString("TargetProperty", this.targetPropertyField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Command" == name)) - { - this.commandField = value; - this.commandFieldSet = true; - } - if (("Argument" == name)) - { - this.argumentField = value; - this.argumentFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("Target" == name)) - { - this.targetField = value; - this.targetFieldSet = true; - } - if (("TargetFile" == name)) - { - this.targetFileField = value; - this.targetFileFieldSet = true; - } - if (("TargetProperty" == name)) - { - this.targetPropertyField = value; - this.targetPropertyFieldSet = true; - } - } - } - - /// - /// Extension for a Component - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Extension : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string contentTypeField; - - private bool contentTypeFieldSet; - - private YesNoType advertiseField; - - private bool advertiseFieldSet; - - private ISchemaElement parentElement; - - public Extension() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MIME))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Verb))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// This is simply the file extension, like "doc" or "xml". Do not include the preceding period. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The MIME type that is to be written. - /// - public string ContentType - { - get - { - return this.contentTypeField; - } - set - { - this.contentTypeFieldSet = true; - this.contentTypeField = value; - } - } - - /// - /// Whether this extension is to be advertised. The default is "no". - /// - public YesNoType Advertise - { - get - { - return this.advertiseField; - } - set - { - this.advertiseFieldSet = true; - this.advertiseField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("MIME" == childName)) - { - childValue = new MIME(); - } - if (("Verb" == childName)) - { - childValue = new Verb(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Extension", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.contentTypeFieldSet) - { - writer.WriteAttributeString("ContentType", this.contentTypeField); - } - if (this.advertiseFieldSet) - { - if ((this.advertiseField == YesNoType.no)) - { - writer.WriteAttributeString("Advertise", "no"); - } - if ((this.advertiseField == YesNoType.yes)) - { - writer.WriteAttributeString("Advertise", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("ContentType" == name)) - { - this.contentTypeField = value; - this.contentTypeFieldSet = true; - } - if (("Advertise" == name)) - { - this.advertiseField = Enums.ParseYesNoType(value); - this.advertiseFieldSet = true; - } - } - } - - /// - /// Register a type library (TypeLib). Please note that in order to properly use this - /// non-advertised, you will need use this element with Advertise='no' and also author the - /// appropriate child Interface elements by extracting them from the type library itself. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class TypeLib : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private YesNoType advertiseField; - - private bool advertiseFieldSet; - - private YesNoType controlField; - - private bool controlFieldSet; - - private int costField; - - private bool costFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private YesNoType hasDiskImageField; - - private bool hasDiskImageFieldSet; - - private string helpDirectoryField; - - private bool helpDirectoryFieldSet; - - private YesNoType hiddenField; - - private bool hiddenFieldSet; - - private int languageField; - - private bool languageFieldSet; - - private int majorVersionField; - - private bool majorVersionFieldSet; - - private int minorVersionField; - - private bool minorVersionFieldSet; - - private int resourceIdField; - - private bool resourceIdFieldSet; - - private YesNoType restrictedField; - - private bool restrictedFieldSet; - - private ISchemaElement parentElement; - - public TypeLib() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The GUID that identifes the type library. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Value of 'yes' will create a row in the TypeLib table. - /// Value of 'no' will create rows in the Registry table. - /// The default value is 'no'. - /// - public YesNoType Advertise - { - get - { - return this.advertiseField; - } - set - { - this.advertiseFieldSet = true; - this.advertiseField = value; - } - } - - /// - /// Value of 'yes' means the type library describes controls, and should not be displayed in type browsers intended for nonvisual objects. - /// This attribute can only be set if Advertise='no'. - /// - public YesNoType Control - { - get - { - return this.controlField; - } - set - { - this.controlFieldSet = true; - this.controlField = value; - } - } - - /// - /// The cost associated with the registration of the type library in bytes. This attribute cannot be set if Advertise='no'. - /// - public int Cost - { - get - { - return this.costField; - } - set - { - this.costFieldSet = true; - this.costField = value; - } - } - - /// - /// The localizable description of the type library. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Value of 'yes' means the type library exists in a persisted form on disk. This attribute can only be set if Advertise='no'. - /// - public YesNoType HasDiskImage - { - get - { - return this.hasDiskImageField; - } - set - { - this.hasDiskImageFieldSet = true; - this.hasDiskImageField = value; - } - } - - /// - /// The identifier of the Directory element for the help directory. - /// - public string HelpDirectory - { - get - { - return this.helpDirectoryField; - } - set - { - this.helpDirectoryFieldSet = true; - this.helpDirectoryField = value; - } - } - - /// - /// Value of 'yes' means the type library should not be displayed to users, although its use is not restricted. - /// Should be used by controls. Hosts should create a new type library that wraps the control with extended properties. - /// This attribute can only be set if Advertise='no'. - /// - public YesNoType Hidden - { - get - { - return this.hiddenField; - } - set - { - this.hiddenFieldSet = true; - this.hiddenField = value; - } - } - - /// - /// The language of the type library. This must be a non-negative integer. - /// - public int Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - /// - /// The major version of the type library. The value should be an integer from 0 - 255. - /// - public int MajorVersion - { - get - { - return this.majorVersionField; - } - set - { - this.majorVersionFieldSet = true; - this.majorVersionField = value; - } - } - - /// - /// The minor version of the type library. The value should be an integer from 0 - 255. - /// - public int MinorVersion - { - get - { - return this.minorVersionField; - } - set - { - this.minorVersionFieldSet = true; - this.minorVersionField = value; - } - } - - /// - /// The resource id of a typelib. The value is appended to the end of the typelib path in the registry. - /// - public int ResourceId - { - get - { - return this.resourceIdField; - } - set - { - this.resourceIdFieldSet = true; - this.resourceIdField = value; - } - } - - /// - /// Value of 'yes' means the type library is restricted, and should not be displayed to users. This attribute can only be set if Advertise='no'. - /// - public YesNoType Restricted - { - get - { - return this.restrictedField; - } - set - { - this.restrictedFieldSet = true; - this.restrictedField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("AppId" == childName)) - { - childValue = new AppId(); - } - if (("Class" == childName)) - { - childValue = new Class(); - } - if (("Interface" == childName)) - { - childValue = new Interface(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("TypeLib", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.advertiseFieldSet) - { - if ((this.advertiseField == YesNoType.no)) - { - writer.WriteAttributeString("Advertise", "no"); - } - if ((this.advertiseField == YesNoType.yes)) - { - writer.WriteAttributeString("Advertise", "yes"); - } - } - if (this.controlFieldSet) - { - if ((this.controlField == YesNoType.no)) - { - writer.WriteAttributeString("Control", "no"); - } - if ((this.controlField == YesNoType.yes)) - { - writer.WriteAttributeString("Control", "yes"); - } - } - if (this.costFieldSet) - { - writer.WriteAttributeString("Cost", this.costField.ToString(CultureInfo.InvariantCulture)); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.hasDiskImageFieldSet) - { - if ((this.hasDiskImageField == YesNoType.no)) - { - writer.WriteAttributeString("HasDiskImage", "no"); - } - if ((this.hasDiskImageField == YesNoType.yes)) - { - writer.WriteAttributeString("HasDiskImage", "yes"); - } - } - if (this.helpDirectoryFieldSet) - { - writer.WriteAttributeString("HelpDirectory", this.helpDirectoryField); - } - if (this.hiddenFieldSet) - { - if ((this.hiddenField == YesNoType.no)) - { - writer.WriteAttributeString("Hidden", "no"); - } - if ((this.hiddenField == YesNoType.yes)) - { - writer.WriteAttributeString("Hidden", "yes"); - } - } - if (this.languageFieldSet) - { - writer.WriteAttributeString("Language", this.languageField.ToString(CultureInfo.InvariantCulture)); - } - if (this.majorVersionFieldSet) - { - writer.WriteAttributeString("MajorVersion", this.majorVersionField.ToString(CultureInfo.InvariantCulture)); - } - if (this.minorVersionFieldSet) - { - writer.WriteAttributeString("MinorVersion", this.minorVersionField.ToString(CultureInfo.InvariantCulture)); - } - if (this.resourceIdFieldSet) - { - writer.WriteAttributeString("ResourceId", this.resourceIdField.ToString(CultureInfo.InvariantCulture)); - } - if (this.restrictedFieldSet) - { - if ((this.restrictedField == YesNoType.no)) - { - writer.WriteAttributeString("Restricted", "no"); - } - if ((this.restrictedField == YesNoType.yes)) - { - writer.WriteAttributeString("Restricted", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Advertise" == name)) - { - this.advertiseField = Enums.ParseYesNoType(value); - this.advertiseFieldSet = true; - } - if (("Control" == name)) - { - this.controlField = Enums.ParseYesNoType(value); - this.controlFieldSet = true; - } - if (("Cost" == name)) - { - this.costField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.costFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("HasDiskImage" == name)) - { - this.hasDiskImageField = Enums.ParseYesNoType(value); - this.hasDiskImageFieldSet = true; - } - if (("HelpDirectory" == name)) - { - this.helpDirectoryField = value; - this.helpDirectoryFieldSet = true; - } - if (("Hidden" == name)) - { - this.hiddenField = Enums.ParseYesNoType(value); - this.hiddenFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.languageFieldSet = true; - } - if (("MajorVersion" == name)) - { - this.majorVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.majorVersionFieldSet = true; - } - if (("MinorVersion" == name)) - { - this.minorVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.minorVersionFieldSet = true; - } - if (("ResourceId" == name)) - { - this.resourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.resourceIdFieldSet = true; - } - if (("Restricted" == name)) - { - this.restrictedField = Enums.ParseYesNoType(value); - this.restrictedFieldSet = true; - } - } - } - - /// - /// ProgId registration for parent Component. If ProgId has an associated Class, it must be a child of that element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ProgId : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string iconField; - - private bool iconFieldSet; - - private int iconIndexField; - - private bool iconIndexFieldSet; - - private YesNoType advertiseField; - - private bool advertiseFieldSet; - - private string noOpenField; - - private bool noOpenFieldSet; - - private ISchemaElement parentElement; - - public ProgId() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ProgId))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Extension))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// For an advertised ProgId, the Id of an Icon element. For a non-advertised ProgId, this is the Id of a file containing an icon resource. - /// - public string Icon - { - get - { - return this.iconField; - } - set - { - this.iconFieldSet = true; - this.iconField = value; - } - } - - public int IconIndex - { - get - { - return this.iconIndexField; - } - set - { - this.iconIndexFieldSet = true; - this.iconIndexField = value; - } - } - - public YesNoType Advertise - { - get - { - return this.advertiseField; - } - set - { - this.advertiseFieldSet = true; - this.advertiseField = value; - } - } - - /// - /// Specifies that the associated ProgId should not be opened by users. The value is presented as a warning to users. An empty string is also valid for this attribute. - /// - public string NoOpen - { - get - { - return this.noOpenField; - } - set - { - this.noOpenFieldSet = true; - this.noOpenField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ProgId" == childName)) - { - childValue = new ProgId(); - } - if (("Extension" == childName)) - { - childValue = new Extension(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProgId", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.iconFieldSet) - { - writer.WriteAttributeString("Icon", this.iconField); - } - if (this.iconIndexFieldSet) - { - writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); - } - if (this.advertiseFieldSet) - { - if ((this.advertiseField == YesNoType.no)) - { - writer.WriteAttributeString("Advertise", "no"); - } - if ((this.advertiseField == YesNoType.yes)) - { - writer.WriteAttributeString("Advertise", "yes"); - } - } - if (this.noOpenFieldSet) - { - writer.WriteAttributeString("NoOpen", this.noOpenField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Icon" == name)) - { - this.iconField = value; - this.iconFieldSet = true; - } - if (("IconIndex" == name)) - { - this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.iconIndexFieldSet = true; - } - if (("Advertise" == name)) - { - this.advertiseField = Enums.ParseYesNoType(value); - this.advertiseFieldSet = true; - } - if (("NoOpen" == name)) - { - this.noOpenField = value; - this.noOpenFieldSet = true; - } - } - } - - /// - /// Application ID containing DCOM information for the associated application GUID. - /// If this element is nested under a Fragment, Module, or Package element, it must be - /// advertised. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AppId : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private YesNoType activateAtStorageField; - - private bool activateAtStorageFieldSet; - - private YesNoType advertiseField; - - private bool advertiseFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string dllSurrogateField; - - private bool dllSurrogateFieldSet; - - private string idField; - - private bool idFieldSet; - - private string localServiceField; - - private bool localServiceFieldSet; - - private string remoteServerNameField; - - private bool remoteServerNameFieldSet; - - private YesNoType runAsInteractiveUserField; - - private bool runAsInteractiveUserFieldSet; - - private string serviceParametersField; - - private bool serviceParametersFieldSet; - - private ISchemaElement parentElement; - - public AppId() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Set this value to 'yes' to configure the client to activate on the same system as persistent storage. - /// - public YesNoType ActivateAtStorage - { - get - { - return this.activateAtStorageField; - } - set - { - this.activateAtStorageFieldSet = true; - this.activateAtStorageField = value; - } - } - - /// - /// Set this value to 'yes' in order to create a normal AppId table row. Set this value to 'no' in order to - /// generate Registry rows that perform similar registration (without the often problematic Windows Installer - /// advertising behavior). - /// - public YesNoType Advertise - { - get - { - return this.advertiseField; - } - set - { - this.advertiseFieldSet = true; - this.advertiseField = value; - } - } - - /// - /// Set this value to the description of the AppId. It can only be specified when the AppId is not being advertised. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Set this value to specify that the class is a DLL that is to be activated in a surrogate EXE - /// process, and the surrogate process to be used is the path of a surrogate EXE file specified by the value. - /// - public string DllSurrogate - { - get - { - return this.dllSurrogateField; - } - set - { - this.dllSurrogateFieldSet = true; - this.dllSurrogateField = value; - } - } - - /// - /// Set this value to the AppID GUID that corresponds to the named executable. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set this value to the name of a service to allow the object to be installed as a Win32 service. - /// - public string LocalService - { - get - { - return this.localServiceField; - } - set - { - this.localServiceFieldSet = true; - this.localServiceField = value; - } - } - - /// - /// Set this value to the name of the remote server to configure the client to request the object - /// be run at a particular machine whenever an activation function is called for which a COSERVERINFO - /// structure is not specified. - /// - public string RemoteServerName - { - get - { - return this.remoteServerNameField; - } - set - { - this.remoteServerNameFieldSet = true; - this.remoteServerNameField = value; - } - } - - /// - /// Set this value to 'yes' to configure a class to run under the identity of the user currently - /// logged on and connected to the interactive desktop when activated by a remote client without - /// being written as a Win32 service. - /// - public YesNoType RunAsInteractiveUser - { - get - { - return this.runAsInteractiveUserField; - } - set - { - this.runAsInteractiveUserFieldSet = true; - this.runAsInteractiveUserField = value; - } - } - - /// - /// Set this value to the parameters to be passed to a LocalService on invocation. - /// - public string ServiceParameters - { - get - { - return this.serviceParametersField; - } - set - { - this.serviceParametersFieldSet = true; - this.serviceParametersField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Class" == childName)) - { - childValue = new Class(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AppId", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.activateAtStorageFieldSet) - { - if ((this.activateAtStorageField == YesNoType.no)) - { - writer.WriteAttributeString("ActivateAtStorage", "no"); - } - if ((this.activateAtStorageField == YesNoType.yes)) - { - writer.WriteAttributeString("ActivateAtStorage", "yes"); - } - } - if (this.advertiseFieldSet) - { - if ((this.advertiseField == YesNoType.no)) - { - writer.WriteAttributeString("Advertise", "no"); - } - if ((this.advertiseField == YesNoType.yes)) - { - writer.WriteAttributeString("Advertise", "yes"); - } - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.dllSurrogateFieldSet) - { - writer.WriteAttributeString("DllSurrogate", this.dllSurrogateField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.localServiceFieldSet) - { - writer.WriteAttributeString("LocalService", this.localServiceField); - } - if (this.remoteServerNameFieldSet) - { - writer.WriteAttributeString("RemoteServerName", this.remoteServerNameField); - } - if (this.runAsInteractiveUserFieldSet) - { - if ((this.runAsInteractiveUserField == YesNoType.no)) - { - writer.WriteAttributeString("RunAsInteractiveUser", "no"); - } - if ((this.runAsInteractiveUserField == YesNoType.yes)) - { - writer.WriteAttributeString("RunAsInteractiveUser", "yes"); - } - } - if (this.serviceParametersFieldSet) - { - writer.WriteAttributeString("ServiceParameters", this.serviceParametersField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("ActivateAtStorage" == name)) - { - this.activateAtStorageField = Enums.ParseYesNoType(value); - this.activateAtStorageFieldSet = true; - } - if (("Advertise" == name)) - { - this.advertiseField = Enums.ParseYesNoType(value); - this.advertiseFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("DllSurrogate" == name)) - { - this.dllSurrogateField = value; - this.dllSurrogateFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("LocalService" == name)) - { - this.localServiceField = value; - this.localServiceFieldSet = true; - } - if (("RemoteServerName" == name)) - { - this.remoteServerNameField = value; - this.remoteServerNameFieldSet = true; - } - if (("RunAsInteractiveUser" == name)) - { - this.runAsInteractiveUserField = Enums.ParseYesNoType(value); - this.runAsInteractiveUserFieldSet = true; - } - if (("ServiceParameters" == name)) - { - this.serviceParametersField = value; - this.serviceParametersFieldSet = true; - } - } - } - - /// - /// COM Class registration for parent Component. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Class : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ContextType contextField; - - private bool contextFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string appIdField; - - private bool appIdFieldSet; - - private string iconField; - - private bool iconFieldSet; - - private int iconIndexField; - - private bool iconIndexFieldSet; - - private string handlerField; - - private bool handlerFieldSet; - - private string argumentField; - - private bool argumentFieldSet; - - private YesNoType relativePathField; - - private bool relativePathFieldSet; - - private YesNoType advertiseField; - - private bool advertiseFieldSet; - - private ThreadingModelType threadingModelField; - - private bool threadingModelFieldSet; - - private string versionField; - - private bool versionFieldSet; - - private YesNoType insertableField; - - private bool insertableFieldSet; - - private YesNoType programmableField; - - private bool programmableFieldSet; - - private string foreignServerField; - - private bool foreignServerFieldSet; - - private string serverField; - - private bool serverFieldSet; - - private YesNoType shortPathField; - - private bool shortPathFieldSet; - - private YesNoType safeForScriptingField; - - private bool safeForScriptingFieldSet; - - private YesNoType safeForInitializingField; - - private bool safeForInitializingFieldSet; - - private YesNoType controlField; - - private bool controlFieldSet; - - private ISchemaElement parentElement; - - public Class() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgId))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileTypeMask))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The Class identifier (CLSID) of a COM server. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The server context(s) for this COM server. This attribute is optional for VB6 libraries that are marked "PublicNotCreateable". - /// Class elements marked Advertised must specify at least one server context. It is most common for there to be a single value - /// for the Context attribute. - /// - public ContextType Context - { - get - { - return this.contextField; - } - set - { - this.contextFieldSet = true; - this.contextField = value; - } - } - - /// - /// Localized description associated with the Class ID and Program ID. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// This attribute is only allowed when a Class is advertised. Using this attribute will reference an Application ID - /// containing DCOM information for the associated application GUID. The value must correspond to an AppId/@Id of an - /// AppId element nested under a Fragment, Module, or Package element. To associate an AppId with a non-advertised - /// class, nest the class within a parent AppId element. - /// - public string AppId - { - get - { - return this.appIdField; - } - set - { - this.appIdFieldSet = true; - this.appIdField = value; - } - } - - /// - /// The file providing the icon associated with this CLSID. Reference to an Icon element - /// (should match the Id attribute of an Icon element). This is currently not supported if the - /// value of the Advertise attribute is "no". - /// - public string Icon - { - get - { - return this.iconField; - } - set - { - this.iconFieldSet = true; - this.iconField = value; - } - } - - /// - /// Icon index into the icon file. - /// - public int IconIndex - { - get - { - return this.iconIndexField; - } - set - { - this.iconIndexFieldSet = true; - this.iconIndexField = value; - } - } - - /// - /// The default inproc handler. May be optionally provided only for Context = LocalServer or - /// LocalServer32. Value of "1" creates a 16-bit InprocHandler (appearing as the InprocHandler - /// value). Value of "2" creates a 32-bit InprocHandler (appearing as the InprocHandler32 value). - /// Value of "3" creates 16-bit as well as 32-bit InprocHandlers. A non-numeric value is treated - /// as a system file that serves as the 32-bit InprocHandler (appearing as the InprocHandler32 value). - /// - public string Handler - { - get - { - return this.handlerField; - } - set - { - this.handlerFieldSet = true; - this.handlerField = value; - } - } - - /// - /// This column is optional only when the Context column is set to "LocalServer" - /// or "LocalServer32" server context. The text is registered as the argument against - /// the OLE server and is used by OLE for invoking the server. Note that the resolution - /// of properties in the Argument field is limited. A property formatted as [Property] in - /// this field can only be resolved if the property already has the intended value when - /// the component owning the class is installed. For example, for the argument "[#MyDoc.doc]" - /// to resolve to the correct value, the same process must be installing the file MyDoc.doc and the - /// component that owns the class. - /// - public string Argument - { - get - { - return this.argumentField; - } - set - { - this.argumentFieldSet = true; - this.argumentField = value; - } - } - - /// - /// When the value is "yes", the bare file name can be used for COM servers. The installer - /// registers the file name only instead of the complete path. This enables the server in - /// the current directory to take precedence and allows multiple copies of the same component. - /// - public YesNoType RelativePath - { - get - { - return this.relativePathField; - } - set - { - this.relativePathFieldSet = true; - this.relativePathField = value; - } - } - - /// - /// Set this value to "yes" in order to create a normal Class table row. Set this value to - /// "no" in order to generate Registry rows that perform similar registration (without the - /// often problematic Windows Installer advertising behavior). - /// - public YesNoType Advertise - { - get - { - return this.advertiseField; - } - set - { - this.advertiseFieldSet = true; - this.advertiseField = value; - } - } - - /// - /// Threading model for the CLSID. - /// - public ThreadingModelType ThreadingModel - { - get - { - return this.threadingModelField; - } - set - { - this.threadingModelFieldSet = true; - this.threadingModelField = value; - } - } - - /// - /// Version for the CLSID. - /// - public string Version - { - get - { - return this.versionField; - } - set - { - this.versionFieldSet = true; - this.versionField = value; - } - } - - /// - /// Specifies the CLSID may be insertable. - /// - public YesNoType Insertable - { - get - { - return this.insertableField; - } - set - { - this.insertableFieldSet = true; - this.insertableField = value; - } - } - - /// - /// Specifies the CLSID may be programmable. - /// - public YesNoType Programmable - { - get - { - return this.programmableField; - } - set - { - this.programmableFieldSet = true; - this.programmableField = value; - } - } - - /// - /// May only be specified if the value of the Advertise attribute is "no" and Server has not been specified. In addition, it may only - /// be used when the Class element is directly under the Component element. The value can be - /// that of an registry type (REG_SZ). This attribute should be used to specify foreign servers, such as mscoree.dll if needed. - /// - public string ForeignServer - { - get - { - return this.foreignServerField; - } - set - { - this.foreignServerFieldSet = true; - this.foreignServerField = value; - } - } - - /// - /// May only be specified if the value of the Advertise attribute is "no" and the ForeignServer attribute is not specified. File Id of the - /// COM server file. If this element is nested under a File element, this value defaults to - /// the value of the parent File/@Id. - /// - public string Server - { - get - { - return this.serverField; - } - set - { - this.serverFieldSet = true; - this.serverField = value; - } - } - - /// - /// Specifies whether or not to use the short path for the COM server. This can only apply when Advertise is set to 'no'. The default is 'no' meaning that it will use the long file name for the COM server. - /// - public YesNoType ShortPath - { - get - { - return this.shortPathField; - } - set - { - this.shortPathFieldSet = true; - this.shortPathField = value; - } - } - - /// - /// May only be specified if the value of the Advertise attribute is "no". - /// - public YesNoType SafeForScripting - { - get - { - return this.safeForScriptingField; - } - set - { - this.safeForScriptingFieldSet = true; - this.safeForScriptingField = value; - } - } - - /// - /// May only be specified if the value of the Advertise attribute is "no". - /// - public YesNoType SafeForInitializing - { - get - { - return this.safeForInitializingField; - } - set - { - this.safeForInitializingFieldSet = true; - this.safeForInitializingField = value; - } - } - - /// - /// Set this attribute's value to 'yes' to identify an object as an ActiveX Control. The default value is 'no'. - /// - public YesNoType Control - { - get - { - return this.controlField; - } - set - { - this.controlFieldSet = true; - this.controlField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ProgId" == childName)) - { - childValue = new ProgId(); - } - if (("FileTypeMask" == childName)) - { - childValue = new FileTypeMask(); - } - if (("Interface" == childName)) - { - childValue = new Interface(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Tries to parse a ContextType from a string. - /// - public static bool TryParseContextType(string value, out ContextType parsedValue) - { - parsedValue = ContextType.None; - if (string.IsNullOrEmpty(value)) - { - return false; - } - string[] splitValue = value.Split(" \t\r\n".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries); - for (System.Collections.IEnumerator enumerator = splitValue.GetEnumerator(); enumerator.MoveNext(); - ) - { - string currentValue = ((string)(enumerator.Current)); - if (("LocalServer" == currentValue)) - { - parsedValue = (parsedValue | ContextType.LocalServer); - } - else - { - if (("LocalServer32" == currentValue)) - { - parsedValue = (parsedValue | ContextType.LocalServer32); - } - else - { - if (("InprocServer" == currentValue)) - { - parsedValue = (parsedValue | ContextType.InprocServer); - } - else - { - if (("InprocServer32" == currentValue)) - { - parsedValue = (parsedValue | ContextType.InprocServer32); - } - else - { - parsedValue = ContextType.None; - return false; - } - } - } - } - } - return true; - } - - /// - /// Parses a ThreadingModelType from a string. - /// - public static ThreadingModelType ParseThreadingModelType(string value) - { - ThreadingModelType parsedValue; - Class.TryParseThreadingModelType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ThreadingModelType from a string. - /// - public static bool TryParseThreadingModelType(string value, out ThreadingModelType parsedValue) - { - parsedValue = ThreadingModelType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("apartment" == value)) - { - parsedValue = ThreadingModelType.apartment; - } - else - { - if (("free" == value)) - { - parsedValue = ThreadingModelType.free; - } - else - { - if (("both" == value)) - { - parsedValue = ThreadingModelType.both; - } - else - { - if (("neutral" == value)) - { - parsedValue = ThreadingModelType.neutral; - } - else - { - if (("single" == value)) - { - parsedValue = ThreadingModelType.single; - } - else - { - if (("rental" == value)) - { - parsedValue = ThreadingModelType.rental; - } - else - { - parsedValue = ThreadingModelType.IllegalValue; - return false; - } - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Class", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.contextFieldSet) - { - string outputValue = ""; - if (((this.contextField & ContextType.LocalServer) - != 0)) - { - if ((outputValue.Length != 0)) - { - outputValue = (outputValue + " "); - } - outputValue = (outputValue + "LocalServer"); - } - if (((this.contextField & ContextType.LocalServer32) - != 0)) - { - if ((outputValue.Length != 0)) - { - outputValue = (outputValue + " "); - } - outputValue = (outputValue + "LocalServer32"); - } - if (((this.contextField & ContextType.InprocServer) - != 0)) - { - if ((outputValue.Length != 0)) - { - outputValue = (outputValue + " "); - } - outputValue = (outputValue + "InprocServer"); - } - if (((this.contextField & ContextType.InprocServer32) - != 0)) - { - if ((outputValue.Length != 0)) - { - outputValue = (outputValue + " "); - } - outputValue = (outputValue + "InprocServer32"); - } - writer.WriteAttributeString("Context", outputValue); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.appIdFieldSet) - { - writer.WriteAttributeString("AppId", this.appIdField); - } - if (this.iconFieldSet) - { - writer.WriteAttributeString("Icon", this.iconField); - } - if (this.iconIndexFieldSet) - { - writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); - } - if (this.handlerFieldSet) - { - writer.WriteAttributeString("Handler", this.handlerField); - } - if (this.argumentFieldSet) - { - writer.WriteAttributeString("Argument", this.argumentField); - } - if (this.relativePathFieldSet) - { - if ((this.relativePathField == YesNoType.no)) - { - writer.WriteAttributeString("RelativePath", "no"); - } - if ((this.relativePathField == YesNoType.yes)) - { - writer.WriteAttributeString("RelativePath", "yes"); - } - } - if (this.advertiseFieldSet) - { - if ((this.advertiseField == YesNoType.no)) - { - writer.WriteAttributeString("Advertise", "no"); - } - if ((this.advertiseField == YesNoType.yes)) - { - writer.WriteAttributeString("Advertise", "yes"); - } - } - if (this.threadingModelFieldSet) - { - if ((this.threadingModelField == ThreadingModelType.apartment)) - { - writer.WriteAttributeString("ThreadingModel", "apartment"); - } - if ((this.threadingModelField == ThreadingModelType.free)) - { - writer.WriteAttributeString("ThreadingModel", "free"); - } - if ((this.threadingModelField == ThreadingModelType.both)) - { - writer.WriteAttributeString("ThreadingModel", "both"); - } - if ((this.threadingModelField == ThreadingModelType.neutral)) - { - writer.WriteAttributeString("ThreadingModel", "neutral"); - } - if ((this.threadingModelField == ThreadingModelType.single)) - { - writer.WriteAttributeString("ThreadingModel", "single"); - } - if ((this.threadingModelField == ThreadingModelType.rental)) - { - writer.WriteAttributeString("ThreadingModel", "rental"); - } - } - if (this.versionFieldSet) - { - writer.WriteAttributeString("Version", this.versionField); - } - if (this.insertableFieldSet) - { - if ((this.insertableField == YesNoType.no)) - { - writer.WriteAttributeString("Insertable", "no"); - } - if ((this.insertableField == YesNoType.yes)) - { - writer.WriteAttributeString("Insertable", "yes"); - } - } - if (this.programmableFieldSet) - { - if ((this.programmableField == YesNoType.no)) - { - writer.WriteAttributeString("Programmable", "no"); - } - if ((this.programmableField == YesNoType.yes)) - { - writer.WriteAttributeString("Programmable", "yes"); - } - } - if (this.foreignServerFieldSet) - { - writer.WriteAttributeString("ForeignServer", this.foreignServerField); - } - if (this.serverFieldSet) - { - writer.WriteAttributeString("Server", this.serverField); - } - if (this.shortPathFieldSet) - { - if ((this.shortPathField == YesNoType.no)) - { - writer.WriteAttributeString("ShortPath", "no"); - } - if ((this.shortPathField == YesNoType.yes)) - { - writer.WriteAttributeString("ShortPath", "yes"); - } - } - if (this.safeForScriptingFieldSet) - { - if ((this.safeForScriptingField == YesNoType.no)) - { - writer.WriteAttributeString("SafeForScripting", "no"); - } - if ((this.safeForScriptingField == YesNoType.yes)) - { - writer.WriteAttributeString("SafeForScripting", "yes"); - } - } - if (this.safeForInitializingFieldSet) - { - if ((this.safeForInitializingField == YesNoType.no)) - { - writer.WriteAttributeString("SafeForInitializing", "no"); - } - if ((this.safeForInitializingField == YesNoType.yes)) - { - writer.WriteAttributeString("SafeForInitializing", "yes"); - } - } - if (this.controlFieldSet) - { - if ((this.controlField == YesNoType.no)) - { - writer.WriteAttributeString("Control", "no"); - } - if ((this.controlField == YesNoType.yes)) - { - writer.WriteAttributeString("Control", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Context" == name)) - { - Class.TryParseContextType(value, out this.contextField); - this.contextFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("AppId" == name)) - { - this.appIdField = value; - this.appIdFieldSet = true; - } - if (("Icon" == name)) - { - this.iconField = value; - this.iconFieldSet = true; - } - if (("IconIndex" == name)) - { - this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.iconIndexFieldSet = true; - } - if (("Handler" == name)) - { - this.handlerField = value; - this.handlerFieldSet = true; - } - if (("Argument" == name)) - { - this.argumentField = value; - this.argumentFieldSet = true; - } - if (("RelativePath" == name)) - { - this.relativePathField = Enums.ParseYesNoType(value); - this.relativePathFieldSet = true; - } - if (("Advertise" == name)) - { - this.advertiseField = Enums.ParseYesNoType(value); - this.advertiseFieldSet = true; - } - if (("ThreadingModel" == name)) - { - this.threadingModelField = Class.ParseThreadingModelType(value); - this.threadingModelFieldSet = true; - } - if (("Version" == name)) - { - this.versionField = value; - this.versionFieldSet = true; - } - if (("Insertable" == name)) - { - this.insertableField = Enums.ParseYesNoType(value); - this.insertableFieldSet = true; - } - if (("Programmable" == name)) - { - this.programmableField = Enums.ParseYesNoType(value); - this.programmableFieldSet = true; - } - if (("ForeignServer" == name)) - { - this.foreignServerField = value; - this.foreignServerFieldSet = true; - } - if (("Server" == name)) - { - this.serverField = value; - this.serverFieldSet = true; - } - if (("ShortPath" == name)) - { - this.shortPathField = Enums.ParseYesNoType(value); - this.shortPathFieldSet = true; - } - if (("SafeForScripting" == name)) - { - this.safeForScriptingField = Enums.ParseYesNoType(value); - this.safeForScriptingFieldSet = true; - } - if (("SafeForInitializing" == name)) - { - this.safeForInitializingField = Enums.ParseYesNoType(value); - this.safeForInitializingFieldSet = true; - } - if (("Control" == name)) - { - this.controlField = Enums.ParseYesNoType(value); - this.controlFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - [Flags()] - public enum ContextType - { - - None = 0, - - /// - /// A 16-bit local server application. - /// - LocalServer = 1, - - /// - /// A 32-bit local server application. - /// - LocalServer32 = 2, - - /// - /// A 16-bit in-process server DLL. - /// - InprocServer = 4, - - /// - /// A 32-bit in-process server DLL. - /// - InprocServer32 = 8, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ThreadingModelType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - apartment, - - free, - - both, - - neutral, - - single, - - rental, - } - } - - /// - /// COM Interface registration for parent TypeLib. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Interface : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string baseInterfaceField; - - private bool baseInterfaceFieldSet; - - private string proxyStubClassIdField; - - private bool proxyStubClassIdFieldSet; - - private string proxyStubClassId32Field; - - private bool proxyStubClassId32FieldSet; - - private int numMethodsField; - - private bool numMethodsFieldSet; - - private YesNoType versionedField; - - private bool versionedFieldSet; - - private ISchemaElement parentElement; - - /// - /// GUID identifier for COM Interface. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name for COM Interface. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Identifies the interface from which the current interface is derived. - /// - public string BaseInterface - { - get - { - return this.baseInterfaceField; - } - set - { - this.baseInterfaceFieldSet = true; - this.baseInterfaceField = value; - } - } - - /// - /// GUID CLSID for proxy stub to COM Interface. - /// - public string ProxyStubClassId - { - get - { - return this.proxyStubClassIdField; - } - set - { - this.proxyStubClassIdFieldSet = true; - this.proxyStubClassIdField = value; - } - } - - /// - /// GUID CLSID for 32-bit proxy stub to COM Interface. - /// - public string ProxyStubClassId32 - { - get - { - return this.proxyStubClassId32Field; - } - set - { - this.proxyStubClassId32FieldSet = true; - this.proxyStubClassId32Field = value; - } - } - - /// - /// Number of methods implemented on COM Interface. - /// - public int NumMethods - { - get - { - return this.numMethodsField; - } - set - { - this.numMethodsFieldSet = true; - this.numMethodsField = value; - } - } - - /// - /// Determines whether a Typelib version entry should be created with the other COM Interface registry keys. Default is 'yes'. - /// - public YesNoType Versioned - { - get - { - return this.versionedField; - } - set - { - this.versionedFieldSet = true; - this.versionedField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Interface", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.baseInterfaceFieldSet) - { - writer.WriteAttributeString("BaseInterface", this.baseInterfaceField); - } - if (this.proxyStubClassIdFieldSet) - { - writer.WriteAttributeString("ProxyStubClassId", this.proxyStubClassIdField); - } - if (this.proxyStubClassId32FieldSet) - { - writer.WriteAttributeString("ProxyStubClassId32", this.proxyStubClassId32Field); - } - if (this.numMethodsFieldSet) - { - writer.WriteAttributeString("NumMethods", this.numMethodsField.ToString(CultureInfo.InvariantCulture)); - } - if (this.versionedFieldSet) - { - if ((this.versionedField == YesNoType.no)) - { - writer.WriteAttributeString("Versioned", "no"); - } - if ((this.versionedField == YesNoType.yes)) - { - writer.WriteAttributeString("Versioned", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("BaseInterface" == name)) - { - this.baseInterfaceField = value; - this.baseInterfaceFieldSet = true; - } - if (("ProxyStubClassId" == name)) - { - this.proxyStubClassIdField = value; - this.proxyStubClassIdFieldSet = true; - } - if (("ProxyStubClassId32" == name)) - { - this.proxyStubClassId32Field = value; - this.proxyStubClassId32FieldSet = true; - } - if (("NumMethods" == name)) - { - this.numMethodsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.numMethodsFieldSet = true; - } - if (("Versioned" == name)) - { - this.versionedField = Enums.ParseYesNoType(value); - this.versionedFieldSet = true; - } - } - } - - /// - /// FileType data for class Id registration. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FileTypeMask : ISchemaElement, ISetAttributes - { - - private int offsetField; - - private bool offsetFieldSet; - - private string maskField; - - private bool maskFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Offset into file. If positive, offset is from the beginning; if negative, offset is from the end. - /// - public int Offset - { - get - { - return this.offsetField; - } - set - { - this.offsetFieldSet = true; - this.offsetField = value; - } - } - - /// - /// Hex value that is AND'd against the bytes in the file at Offset. - /// - public string Mask - { - get - { - return this.maskField; - } - set - { - this.maskFieldSet = true; - this.maskField = value; - } - } - - /// - /// If the result of the AND'ing of Mask with the bytes in the file is Value, the file is a match for this File Type. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileTypeMask", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.offsetFieldSet) - { - writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); - } - if (this.maskFieldSet) - { - writer.WriteAttributeString("Mask", this.maskField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Offset" == name)) - { - this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.offsetFieldSet = true; - } - if (("Mask" == name)) - { - this.maskField = value; - this.maskFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Service or group of services that must start before the parent service. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ServiceDependency : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType groupField; - - private bool groupFieldSet; - - private ISchemaElement parentElement; - - /// - /// The value of this attribute should be one of the following: - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set to 'yes' to indicate that the value in the Id attribute is the name of a group of services. - /// - public YesNoType Group - { - get - { - return this.groupField; - } - set - { - this.groupFieldSet = true; - this.groupField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ServiceDependency", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.groupFieldSet) - { - if ((this.groupField == YesNoType.no)) - { - writer.WriteAttributeString("Group", "no"); - } - if ((this.groupField == YesNoType.yes)) - { - writer.WriteAttributeString("Group", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Group" == name)) - { - this.groupField = Enums.ParseYesNoType(value); - this.groupFieldSet = true; - } - } - } - - /// - /// Adds services for parent Component. Use the ServiceControl element to remove services. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ServiceInstall : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string displayNameField; - - private bool displayNameFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private YesNoType interactiveField; - - private bool interactiveFieldSet; - - private StartType startField; - - private bool startFieldSet; - - private ErrorControlType errorControlField; - - private bool errorControlFieldSet; - - private YesNoType vitalField; - - private bool vitalFieldSet; - - private string loadOrderGroupField; - - private bool loadOrderGroupFieldSet; - - private string accountField; - - private bool accountFieldSet; - - private string passwordField; - - private bool passwordFieldSet; - - private string argumentsField; - - private bool argumentsFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private YesNoType eraseDescriptionField; - - private bool eraseDescriptionFieldSet; - - private ISchemaElement parentElement; - - public ServiceInstall() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceDependency))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfig))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfigFailureActions))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for this service configuration. This value will default to the Name attribute if not - /// specified. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This column is the string that gives the service name to install. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// This column is the localizable string that user interface programs use to identify the service. - /// - public string DisplayName - { - get - { - return this.displayNameField; - } - set - { - this.displayNameFieldSet = true; - this.displayNameField = value; - } - } - - /// - /// The Windows Installer does not currently support kernelDriver or systemDriver. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Whether or not the service interacts with the desktop. - /// - public YesNoType Interactive - { - get - { - return this.interactiveField; - } - set - { - this.interactiveFieldSet = true; - this.interactiveField = value; - } - } - - /// - /// Determines when the service should be started. The Windows Installer does not support boot or system. - /// - public StartType Start - { - get - { - return this.startField; - } - set - { - this.startFieldSet = true; - this.startField = value; - } - } - - /// - /// Determines what action should be taken on an error. - /// - public ErrorControlType ErrorControl - { - get - { - return this.errorControlField; - } - set - { - this.errorControlFieldSet = true; - this.errorControlField = value; - } - } - - /// - /// The overall install should fail if this service fails to install. - /// - public YesNoType Vital - { - get - { - return this.vitalField; - } - set - { - this.vitalFieldSet = true; - this.vitalField = value; - } - } - - /// - /// The load ordering group that this service should be a part of. - /// - public string LoadOrderGroup - { - get - { - return this.loadOrderGroupField; - } - set - { - this.loadOrderGroupFieldSet = true; - this.loadOrderGroupField = value; - } - } - - /// - /// Fully qualified names must be used even for local accounts, e.g.: ".\LOCAL_ACCOUNT". Valid only when ServiceType is ownProcess. - /// - public string Account - { - get - { - return this.accountField; - } - set - { - this.accountFieldSet = true; - this.accountField = value; - } - } - - /// - /// The password for the account. Valid only when the account has a password. - /// - public string Password - { - get - { - return this.passwordField; - } - set - { - this.passwordFieldSet = true; - this.passwordField = value; - } - } - - /// - /// Contains any command line arguments or properties required to run the service. - /// - public string Arguments - { - get - { - return this.argumentsField; - } - set - { - this.argumentsFieldSet = true; - this.argumentsField = value; - } - } - - /// - /// Sets the description of the service. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Determines whether the existing service description will be ignored. If 'yes', the service description will be null, even if the Description attribute is set. - /// - public YesNoType EraseDescription - { - get - { - return this.eraseDescriptionField; - } - set - { - this.eraseDescriptionFieldSet = true; - this.eraseDescriptionField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("PermissionEx" == childName)) - { - childValue = new PermissionEx(); - } - if (("ServiceDependency" == childName)) - { - childValue = new ServiceDependency(); - } - if (("ServiceConfig" == childName)) - { - childValue = new ServiceConfig(); - } - if (("ServiceConfigFailureActions" == childName)) - { - childValue = new ServiceConfigFailureActions(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - ServiceInstall.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("ownProcess" == value)) - { - parsedValue = TypeType.ownProcess; - } - else - { - if (("shareProcess" == value)) - { - parsedValue = TypeType.shareProcess; - } - else - { - if (("kernelDriver" == value)) - { - parsedValue = TypeType.kernelDriver; - } - else - { - if (("systemDriver" == value)) - { - parsedValue = TypeType.systemDriver; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a StartType from a string. - /// - public static StartType ParseStartType(string value) - { - StartType parsedValue; - ServiceInstall.TryParseStartType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a StartType from a string. - /// - public static bool TryParseStartType(string value, out StartType parsedValue) - { - parsedValue = StartType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("auto" == value)) - { - parsedValue = StartType.auto; - } - else - { - if (("demand" == value)) - { - parsedValue = StartType.demand; - } - else - { - if (("disabled" == value)) - { - parsedValue = StartType.disabled; - } - else - { - if (("boot" == value)) - { - parsedValue = StartType.boot; - } - else - { - if (("system" == value)) - { - parsedValue = StartType.system; - } - else - { - parsedValue = StartType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Parses a ErrorControlType from a string. - /// - public static ErrorControlType ParseErrorControlType(string value) - { - ErrorControlType parsedValue; - ServiceInstall.TryParseErrorControlType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ErrorControlType from a string. - /// - public static bool TryParseErrorControlType(string value, out ErrorControlType parsedValue) - { - parsedValue = ErrorControlType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("ignore" == value)) - { - parsedValue = ErrorControlType.ignore; - } - else - { - if (("normal" == value)) - { - parsedValue = ErrorControlType.normal; - } - else - { - if (("critical" == value)) - { - parsedValue = ErrorControlType.critical; - } - else - { - parsedValue = ErrorControlType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ServiceInstall", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.displayNameFieldSet) - { - writer.WriteAttributeString("DisplayName", this.displayNameField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.ownProcess)) - { - writer.WriteAttributeString("Type", "ownProcess"); - } - if ((this.typeField == TypeType.shareProcess)) - { - writer.WriteAttributeString("Type", "shareProcess"); - } - if ((this.typeField == TypeType.kernelDriver)) - { - writer.WriteAttributeString("Type", "kernelDriver"); - } - if ((this.typeField == TypeType.systemDriver)) - { - writer.WriteAttributeString("Type", "systemDriver"); - } - } - if (this.interactiveFieldSet) - { - if ((this.interactiveField == YesNoType.no)) - { - writer.WriteAttributeString("Interactive", "no"); - } - if ((this.interactiveField == YesNoType.yes)) - { - writer.WriteAttributeString("Interactive", "yes"); - } - } - if (this.startFieldSet) - { - if ((this.startField == StartType.auto)) - { - writer.WriteAttributeString("Start", "auto"); - } - if ((this.startField == StartType.demand)) - { - writer.WriteAttributeString("Start", "demand"); - } - if ((this.startField == StartType.disabled)) - { - writer.WriteAttributeString("Start", "disabled"); - } - if ((this.startField == StartType.boot)) - { - writer.WriteAttributeString("Start", "boot"); - } - if ((this.startField == StartType.system)) - { - writer.WriteAttributeString("Start", "system"); - } - } - if (this.errorControlFieldSet) - { - if ((this.errorControlField == ErrorControlType.ignore)) - { - writer.WriteAttributeString("ErrorControl", "ignore"); - } - if ((this.errorControlField == ErrorControlType.normal)) - { - writer.WriteAttributeString("ErrorControl", "normal"); - } - if ((this.errorControlField == ErrorControlType.critical)) - { - writer.WriteAttributeString("ErrorControl", "critical"); - } - } - if (this.vitalFieldSet) - { - if ((this.vitalField == YesNoType.no)) - { - writer.WriteAttributeString("Vital", "no"); - } - if ((this.vitalField == YesNoType.yes)) - { - writer.WriteAttributeString("Vital", "yes"); - } - } - if (this.loadOrderGroupFieldSet) - { - writer.WriteAttributeString("LoadOrderGroup", this.loadOrderGroupField); - } - if (this.accountFieldSet) - { - writer.WriteAttributeString("Account", this.accountField); - } - if (this.passwordFieldSet) - { - writer.WriteAttributeString("Password", this.passwordField); - } - if (this.argumentsFieldSet) - { - writer.WriteAttributeString("Arguments", this.argumentsField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.eraseDescriptionFieldSet) - { - if ((this.eraseDescriptionField == YesNoType.no)) - { - writer.WriteAttributeString("EraseDescription", "no"); - } - if ((this.eraseDescriptionField == YesNoType.yes)) - { - writer.WriteAttributeString("EraseDescription", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("DisplayName" == name)) - { - this.displayNameField = value; - this.displayNameFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = ServiceInstall.ParseTypeType(value); - this.typeFieldSet = true; - } - if (("Interactive" == name)) - { - this.interactiveField = Enums.ParseYesNoType(value); - this.interactiveFieldSet = true; - } - if (("Start" == name)) - { - this.startField = ServiceInstall.ParseStartType(value); - this.startFieldSet = true; - } - if (("ErrorControl" == name)) - { - this.errorControlField = ServiceInstall.ParseErrorControlType(value); - this.errorControlFieldSet = true; - } - if (("Vital" == name)) - { - this.vitalField = Enums.ParseYesNoType(value); - this.vitalFieldSet = true; - } - if (("LoadOrderGroup" == name)) - { - this.loadOrderGroupField = value; - this.loadOrderGroupFieldSet = true; - } - if (("Account" == name)) - { - this.accountField = value; - this.accountFieldSet = true; - } - if (("Password" == name)) - { - this.passwordField = value; - this.passwordFieldSet = true; - } - if (("Arguments" == name)) - { - this.argumentsField = value; - this.argumentsFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("EraseDescription" == name)) - { - this.eraseDescriptionField = Enums.ParseYesNoType(value); - this.eraseDescriptionFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// A Win32 service that runs its own process. - /// - ownProcess, - - /// - /// A Win32 service that shares a process. - /// - shareProcess, - - /// - /// A kernel driver service. This value is not currently supported by the Windows Installer. - /// - kernelDriver, - - /// - /// A file system driver service. This value is not currently supported by the Windows Installer. - /// - systemDriver, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum StartType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// The service will start during startup of the system. - /// - auto, - - /// - /// The service will start when the service control manager calls the StartService function. - /// - demand, - - /// - /// The service can no longer be started. - /// - disabled, - - /// - /// The service is a device driver that will be started by the operating system boot loader. This value is not currently supported by the Windows Installer. - /// - boot, - - /// - /// The service is a device driver that will be started by the IoInitSystem function. This value is not currently supported by the Windows Installer. - /// - system, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ErrorControlType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Logs the error and continues with the startup operation. - /// - ignore, - - /// - /// Logs the error, displays a message box and continues the startup operation. - /// - normal, - - /// - /// Logs the error if it is possible and the system is restarted with the last configuration known to be good. If the last-known-good configuration is being started, the startup operation fails. - /// - critical, - } - } - - /// - /// Argument used in ServiceControl parent - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ServiceArgument : ISetAttributes, ISchemaElement - { - - private ISchemaElement parentElement; - - private string contentField; - - private bool contentFieldSet; - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Argument used in ServiceControl parent - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ServiceArgument", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - } - - /// - /// Starts, stops, and removes services for parent Component. This element is used to control the state - /// of a service installed by the MSI or MSM file by using the start, stop and remove attributes. - /// For example, Start='install' Stop='both' Remove='uninstall' would mean: start the service on install, - /// remove the service when the product is uninstalled, and stop the service both on install and uninstall. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ServiceControl : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private InstallUninstallType startField; - - private bool startFieldSet; - - private InstallUninstallType stopField; - - private bool stopFieldSet; - - private InstallUninstallType removeField; - - private bool removeFieldSet; - - private YesNoType waitField; - - private bool waitFieldSet; - - private ISchemaElement parentElement; - - public ServiceControl() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ServiceArgument))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the service. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Specifies whether the service should be started by the StartServices action on install, uninstall or both. - /// For 'install', the service will be started only when the parent component is being installed (msiInstallStateLocal or - /// msiInstallStateSource); for 'uninstall', the service will be started only when the parent component - /// is being removed (msiInstallStateAbsent); for 'both', the service will be started in both cases. - /// - public InstallUninstallType Start - { - get - { - return this.startField; - } - set - { - this.startFieldSet = true; - this.startField = value; - } - } - - /// - /// Specifies whether the service should be stopped by the StopServices action on install, uninstall or both. - /// For 'install', the service will be stopped only when the parent component is being installed (msiInstallStateLocal or - /// msiInstallStateSource); for 'uninstall', the service will be stopped only when the parent component - /// is being removed (msiInstallStateAbsent); for 'both', the service will be stopped in both cases. - /// - public InstallUninstallType Stop - { - get - { - return this.stopField; - } - set - { - this.stopFieldSet = true; - this.stopField = value; - } - } - - /// - /// Specifies whether the service should be removed by the DeleteServices action on install, uninstall or both. - /// For 'install', the service will be removed only when the parent component is being installed (msiInstallStateLocal or - /// msiInstallStateSource); for 'uninstall', the service will be removed only when the parent component - /// is being removed (msiInstallStateAbsent); for 'both', the service will be removed in both cases. - /// - public InstallUninstallType Remove - { - get - { - return this.removeField; - } - set - { - this.removeFieldSet = true; - this.removeField = value; - } - } - - /// - /// Specifies whether or not to wait for the service to complete before continuing. The default is 'yes'. - /// - public YesNoType Wait - { - get - { - return this.waitField; - } - set - { - this.waitFieldSet = true; - this.waitField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ServiceArgument" == childName)) - { - childValue = new ServiceArgument(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ServiceControl", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.startFieldSet) - { - if ((this.startField == InstallUninstallType.install)) - { - writer.WriteAttributeString("Start", "install"); - } - if ((this.startField == InstallUninstallType.uninstall)) - { - writer.WriteAttributeString("Start", "uninstall"); - } - if ((this.startField == InstallUninstallType.both)) - { - writer.WriteAttributeString("Start", "both"); - } - } - if (this.stopFieldSet) - { - if ((this.stopField == InstallUninstallType.install)) - { - writer.WriteAttributeString("Stop", "install"); - } - if ((this.stopField == InstallUninstallType.uninstall)) - { - writer.WriteAttributeString("Stop", "uninstall"); - } - if ((this.stopField == InstallUninstallType.both)) - { - writer.WriteAttributeString("Stop", "both"); - } - } - if (this.removeFieldSet) - { - if ((this.removeField == InstallUninstallType.install)) - { - writer.WriteAttributeString("Remove", "install"); - } - if ((this.removeField == InstallUninstallType.uninstall)) - { - writer.WriteAttributeString("Remove", "uninstall"); - } - if ((this.removeField == InstallUninstallType.both)) - { - writer.WriteAttributeString("Remove", "both"); - } - } - if (this.waitFieldSet) - { - if ((this.waitField == YesNoType.no)) - { - writer.WriteAttributeString("Wait", "no"); - } - if ((this.waitField == YesNoType.yes)) - { - writer.WriteAttributeString("Wait", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Start" == name)) - { - this.startField = Enums.ParseInstallUninstallType(value); - this.startFieldSet = true; - } - if (("Stop" == name)) - { - this.stopField = Enums.ParseInstallUninstallType(value); - this.stopFieldSet = true; - } - if (("Remove" == name)) - { - this.removeField = Enums.ParseInstallUninstallType(value); - this.removeFieldSet = true; - } - if (("Wait" == name)) - { - this.waitField = Enums.ParseYesNoType(value); - this.waitFieldSet = true; - } - } - } - - /// - /// Privilege required by service configured by ServiceConfig parent. Valid values are a - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RequiredPrivilege : ISetAttributes, ISchemaElement - { - - private ISchemaElement parentElement; - - private string contentField; - - private bool contentFieldSet; - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Privilege required by service configured by ServiceConfig parent. Valid values are a - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RequiredPrivilege", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - } - - /// - /// Configures a service being installed or one that already exists. This element's functionality is available starting with MSI 5.0. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ServiceConfig : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string delayedAutoStartField; - - private bool delayedAutoStartFieldSet; - - private string failureActionsWhenField; - - private bool failureActionsWhenFieldSet; - - private string preShutdownDelayField; - - private bool preShutdownDelayFieldSet; - - private YesNoType onInstallField; - - private bool onInstallFieldSet; - - private YesNoType onReinstallField; - - private bool onReinstallFieldSet; - - private YesNoType onUninstallField; - - private bool onUninstallFieldSet; - - private string serviceNameField; - - private bool serviceNameFieldSet; - - private string serviceSidField; - - private bool serviceSidFieldSet; - - private ISchemaElement parentElement; - - public ServiceConfig() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RequiredPrivilege))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for this service configuration. This value will default to the ServiceName attribute if not - /// specified. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This attribute specifies whether an auto-start service should delay its start until after all other auto-start - /// services. This attribute only affects auto-start services. Allowed values are "yes", "no" or a Formatted property that - /// resolves to "1" (for "yes") or "0" (for "no"). If this attribute is not present the setting is not configured. - /// - public string DelayedAutoStart - { - get - { - return this.delayedAutoStartField; - } - set - { - this.delayedAutoStartFieldSet = true; - this.delayedAutoStartField = value; - } - } - - /// - /// This attribute specifies when failure actions should be applied. Allowed values are "failedToStop", "failedToStopOrReturnedError" - /// or a Formatted property that resolves to "1" (for "failedToStopOrReturnedError") or "0" (for "failedToStop"). If this attribute - /// is not present the setting is not configured. - /// - public string FailureActionsWhen - { - get - { - return this.failureActionsWhenField; - } - set - { - this.failureActionsWhenFieldSet = true; - this.failureActionsWhenField = value; - } - } - - /// - /// This attribute specifies time in milliseconds that the Service Control Manager (SCM) waits after notifying the service of a system - /// shutdown. If this attribute is not present the default value, 3 minutes, is used. - /// - public string PreShutdownDelay - { - get - { - return this.preShutdownDelayField; - } - set - { - this.preShutdownDelayFieldSet = true; - this.preShutdownDelayField = value; - } - } - - /// - /// Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall - /// and OnUninstall. - /// - public YesNoType OnInstall - { - get - { - return this.onInstallField; - } - set - { - this.onInstallFieldSet = true; - this.onInstallField = value; - } - } - - /// - /// Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall - /// and OnUninstall. - /// - public YesNoType OnReinstall - { - get - { - return this.onReinstallField; - } - set - { - this.onReinstallFieldSet = true; - this.onReinstallField = value; - } - } - - /// - /// Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall - /// and OnReinstall. - /// - public YesNoType OnUninstall - { - get - { - return this.onUninstallField; - } - set - { - this.onUninstallFieldSet = true; - this.onUninstallField = value; - } - } - - /// - /// Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under - /// a ServiceInstall element. - /// - public string ServiceName - { - get - { - return this.serviceNameField; - } - set - { - this.serviceNameFieldSet = true; - this.serviceNameField = value; - } - } - - /// - /// Specifies the service SID to apply to the service. Valid values are "none", "restricted", "unrestricted" or a Formatted property - /// that resolves to "0" (for "none"), "3" (for "restricted") or "1" (for "unrestricted"). If this attribute is not present the - /// setting is not configured. - /// - public string ServiceSid - { - get - { - return this.serviceSidField; - } - set - { - this.serviceSidFieldSet = true; - this.serviceSidField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("RequiredPrivilege" == childName)) - { - childValue = new RequiredPrivilege(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ServiceConfig", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.delayedAutoStartFieldSet) - { - writer.WriteAttributeString("DelayedAutoStart", this.delayedAutoStartField); - } - if (this.failureActionsWhenFieldSet) - { - writer.WriteAttributeString("FailureActionsWhen", this.failureActionsWhenField); - } - if (this.preShutdownDelayFieldSet) - { - writer.WriteAttributeString("PreShutdownDelay", this.preShutdownDelayField); - } - if (this.onInstallFieldSet) - { - if ((this.onInstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnInstall", "no"); - } - if ((this.onInstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnInstall", "yes"); - } - } - if (this.onReinstallFieldSet) - { - if ((this.onReinstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnReinstall", "no"); - } - if ((this.onReinstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnReinstall", "yes"); - } - } - if (this.onUninstallFieldSet) - { - if ((this.onUninstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnUninstall", "no"); - } - if ((this.onUninstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnUninstall", "yes"); - } - } - if (this.serviceNameFieldSet) - { - writer.WriteAttributeString("ServiceName", this.serviceNameField); - } - if (this.serviceSidFieldSet) - { - writer.WriteAttributeString("ServiceSid", this.serviceSidField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("DelayedAutoStart" == name)) - { - this.delayedAutoStartField = value; - this.delayedAutoStartFieldSet = true; - } - if (("FailureActionsWhen" == name)) - { - this.failureActionsWhenField = value; - this.failureActionsWhenFieldSet = true; - } - if (("PreShutdownDelay" == name)) - { - this.preShutdownDelayField = value; - this.preShutdownDelayFieldSet = true; - } - if (("OnInstall" == name)) - { - this.onInstallField = Enums.ParseYesNoType(value); - this.onInstallFieldSet = true; - } - if (("OnReinstall" == name)) - { - this.onReinstallField = Enums.ParseYesNoType(value); - this.onReinstallFieldSet = true; - } - if (("OnUninstall" == name)) - { - this.onUninstallField = Enums.ParseYesNoType(value); - this.onUninstallFieldSet = true; - } - if (("ServiceName" == name)) - { - this.serviceNameField = value; - this.serviceNameFieldSet = true; - } - if (("ServiceSid" == name)) - { - this.serviceSidField = value; - this.serviceSidFieldSet = true; - } - } - } - - /// - /// Failure action for a ServiceConfigFailureActions element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Failure : ISchemaElement, ISetAttributes - { - - private string actionField; - - private bool actionFieldSet; - - private string delayField; - - private bool delayFieldSet; - - private ISchemaElement parentElement; - - /// - /// Specifies the action to take when the service fails. Valid values are "none", "restartComputer", "restartService", "runCommand" or a Formatted property - /// that resolves to "0" (for "none"), "1" (for "restartService"), "2" (for "restartComputer") or "3" (for "runCommand"). - /// - public string Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// Specifies the time in milliseconds to wait before performing the value from the Action attribute. - /// - public string Delay - { - get - { - return this.delayField; - } - set - { - this.delayFieldSet = true; - this.delayField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Failure", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.actionFieldSet) - { - writer.WriteAttributeString("Action", this.actionField); - } - if (this.delayFieldSet) - { - writer.WriteAttributeString("Delay", this.delayField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Action" == name)) - { - this.actionField = value; - this.actionFieldSet = true; - } - if (("Delay" == name)) - { - this.delayField = value; - this.delayFieldSet = true; - } - } - } - - /// - /// Configures the failure actions for a service being installed or one that already exists. This element's functionality is available starting with MSI 5.0. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ServiceConfigFailureActions : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string commandField; - - private bool commandFieldSet; - - private YesNoType onInstallField; - - private bool onInstallFieldSet; - - private YesNoType onReinstallField; - - private bool onReinstallFieldSet; - - private YesNoType onUninstallField; - - private bool onUninstallFieldSet; - - private string rebootMessageField; - - private bool rebootMessageFieldSet; - - private string resetPeriodField; - - private bool resetPeriodFieldSet; - - private string serviceNameField; - - private bool serviceNameFieldSet; - - private ISchemaElement parentElement; - - public ServiceConfigFailureActions() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Failure))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for this service configuration. This value will default to the ServiceName attribute if not - /// specified. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This attribute specifies command to execute when a "runCommand" failure action hit. If an empty string is provided it clears - /// the existing command. If this attribute is not present the setting is not changed. - /// - public string Command - { - get - { - return this.commandField; - } - set - { - this.commandFieldSet = true; - this.commandField = value; - } - } - - /// - /// Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall - /// and OnUninstall. - /// - public YesNoType OnInstall - { - get - { - return this.onInstallField; - } - set - { - this.onInstallFieldSet = true; - this.onInstallField = value; - } - } - - /// - /// Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall - /// and OnUninstall. - /// - public YesNoType OnReinstall - { - get - { - return this.onReinstallField; - } - set - { - this.onReinstallFieldSet = true; - this.onReinstallField = value; - } - } - - /// - /// Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall - /// and OnReinstall. - /// - public YesNoType OnUninstall - { - get - { - return this.onUninstallField; - } - set - { - this.onUninstallFieldSet = true; - this.onUninstallField = value; - } - } - - /// - /// Specifies the message to show for a reboot failure action. If an empty string is provided it clears any existing reboot message. If this - /// attribute is not present the setting is not changed. - /// - public string RebootMessage - { - get - { - return this.rebootMessageField; - } - set - { - this.rebootMessageFieldSet = true; - this.rebootMessageField = value; - } - } - - /// - /// Specifies the time in seconds to reset the failure count. If this attribute is not present the failure count will not be reset. - /// - public string ResetPeriod - { - get - { - return this.resetPeriodField; - } - set - { - this.resetPeriodFieldSet = true; - this.resetPeriodField = value; - } - } - - /// - /// Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under - /// a ServiceInstall element. - /// - public string ServiceName - { - get - { - return this.serviceNameField; - } - set - { - this.serviceNameFieldSet = true; - this.serviceNameField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Failure" == childName)) - { - childValue = new Failure(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ServiceConfigFailureActions", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.commandFieldSet) - { - writer.WriteAttributeString("Command", this.commandField); - } - if (this.onInstallFieldSet) - { - if ((this.onInstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnInstall", "no"); - } - if ((this.onInstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnInstall", "yes"); - } - } - if (this.onReinstallFieldSet) - { - if ((this.onReinstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnReinstall", "no"); - } - if ((this.onReinstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnReinstall", "yes"); - } - } - if (this.onUninstallFieldSet) - { - if ((this.onUninstallField == YesNoType.no)) - { - writer.WriteAttributeString("OnUninstall", "no"); - } - if ((this.onUninstallField == YesNoType.yes)) - { - writer.WriteAttributeString("OnUninstall", "yes"); - } - } - if (this.rebootMessageFieldSet) - { - writer.WriteAttributeString("RebootMessage", this.rebootMessageField); - } - if (this.resetPeriodFieldSet) - { - writer.WriteAttributeString("ResetPeriod", this.resetPeriodField); - } - if (this.serviceNameFieldSet) - { - writer.WriteAttributeString("ServiceName", this.serviceNameField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Command" == name)) - { - this.commandField = value; - this.commandFieldSet = true; - } - if (("OnInstall" == name)) - { - this.onInstallField = Enums.ParseYesNoType(value); - this.onInstallFieldSet = true; - } - if (("OnReinstall" == name)) - { - this.onReinstallField = Enums.ParseYesNoType(value); - this.onReinstallFieldSet = true; - } - if (("OnUninstall" == name)) - { - this.onUninstallField = Enums.ParseYesNoType(value); - this.onUninstallFieldSet = true; - } - if (("RebootMessage" == name)) - { - this.rebootMessageField = value; - this.rebootMessageFieldSet = true; - } - if (("ResetPeriod" == name)) - { - this.resetPeriodField = value; - this.resetPeriodFieldSet = true; - } - if (("ServiceName" == name)) - { - this.serviceNameField = value; - this.serviceNameFieldSet = true; - } - } - } - - /// - /// Environment variables added or removed for the parent component. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Environment : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private string separatorField; - - private bool separatorFieldSet; - - private ActionType actionField; - - private bool actionFieldSet; - - private PartType partField; - - private bool partFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private YesNoType systemField; - - private bool systemFieldSet; - - private ISchemaElement parentElement; - - /// - /// Unique identifier for environment entry. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Name of the environment variable. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The value to set into the environment variable. - /// If this attribute is not set, the environment variable is removed during installation if it exists on the machine. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// Optional attribute to change the separator used between values. By default a semicolon is used. - /// - public string Separator - { - get - { - return this.separatorField; - } - set - { - this.separatorFieldSet = true; - this.separatorField = value; - } - } - - /// - /// Specfies whether the environmental variable should be created, set or removed when the parent component is installed. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - public PartType Part - { - get - { - return this.partField; - } - set - { - this.partFieldSet = true; - this.partField = value; - } - } - - /// - /// Specifies that the environment variable should not be removed on uninstall. - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// Specifies that the environment variable should be added to the system environment space. The default - /// is 'no' which indicates the environment variable is added to the user environment space. - /// - public YesNoType System - { - get - { - return this.systemField; - } - set - { - this.systemFieldSet = true; - this.systemField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - Environment.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("create" == value)) - { - parsedValue = ActionType.create; - } - else - { - if (("set" == value)) - { - parsedValue = ActionType.set; - } - else - { - if (("remove" == value)) - { - parsedValue = ActionType.remove; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a PartType from a string. - /// - public static PartType ParsePartType(string value) - { - PartType parsedValue; - Environment.TryParsePartType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a PartType from a string. - /// - public static bool TryParsePartType(string value, out PartType parsedValue) - { - parsedValue = PartType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("all" == value)) - { - parsedValue = PartType.all; - } - else - { - if (("first" == value)) - { - parsedValue = PartType.first; - } - else - { - if (("last" == value)) - { - parsedValue = PartType.last; - } - else - { - parsedValue = PartType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Environment", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.separatorFieldSet) - { - writer.WriteAttributeString("Separator", this.separatorField); - } - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.create)) - { - writer.WriteAttributeString("Action", "create"); - } - if ((this.actionField == ActionType.set)) - { - writer.WriteAttributeString("Action", "set"); - } - if ((this.actionField == ActionType.remove)) - { - writer.WriteAttributeString("Action", "remove"); - } - } - if (this.partFieldSet) - { - if ((this.partField == PartType.all)) - { - writer.WriteAttributeString("Part", "all"); - } - if ((this.partField == PartType.first)) - { - writer.WriteAttributeString("Part", "first"); - } - if ((this.partField == PartType.last)) - { - writer.WriteAttributeString("Part", "last"); - } - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.systemFieldSet) - { - if ((this.systemField == YesNoType.no)) - { - writer.WriteAttributeString("System", "no"); - } - if ((this.systemField == YesNoType.yes)) - { - writer.WriteAttributeString("System", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Separator" == name)) - { - this.separatorField = value; - this.separatorFieldSet = true; - } - if (("Action" == name)) - { - this.actionField = Environment.ParseActionType(value); - this.actionFieldSet = true; - } - if (("Part" == name)) - { - this.partField = Environment.ParsePartType(value); - this.partFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("System" == name)) - { - this.systemField = Enums.ParseYesNoType(value); - this.systemFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Creates the environment variable if it does not exist, then set it during installation. This has no effect on the value of the environment variable if it already exists. - /// - create, - - /// - /// Creates the environment variable if it does not exist, and then set it during installation. If the environment variable exists, set it during the installation. - /// - set, - - /// - /// Removes the environment variable during an installation. - /// The installer only removes an environment variable during an installation if the name and value - /// of the variable match the entries in the Name and Value attributes. - /// If you want to remove an environment variable, regardless of its value, do not set the Value attribute. - /// - remove, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum PartType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// This value is the entire environmental variable. This is the default. - /// - all, - - /// - /// This value is prefixed. - /// - first, - - /// - /// This value is appended. - /// - last, - } - } - - /// - /// Conditions for components, controls, features, and products. The condition is specified in the inner text of the element. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Condition : ISchemaElement, ISetAttributes - { - - private ActionType actionField; - - private bool actionFieldSet; - - private int levelField; - - private bool levelFieldSet; - - private string messageField; - - private bool messageFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Used only under Control elements and is required. Allows specific actions to be applied to a control based - /// on the result of this condition. - /// - public ActionType Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// Used only under Feature elements and is required. Allows modifying the level of a Feature based on the - /// result of this condition. - /// - public int Level - { - get - { - return this.levelField; - } - set - { - this.levelFieldSet = true; - this.levelField = value; - } - } - - /// - /// Used only under Fragment or Package elements and is required. Set the value to the text to display when the - /// condition fails and the installation must be terminated. - /// - public string Message - { - get - { - return this.messageField; - } - set - { - this.messageFieldSet = true; - this.messageField = value; - } - } - - /// - /// Under a Component element, the condition becomes the condition of the component. Under a Control element, - /// the condition becomes a ControlCondition entry. Under a Feature element, the condition becomes a Condition - /// entry. Under a Fragment or Package element, the condition becomes a LaunchCondition entry. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ActionType from a string. - /// - public static ActionType ParseActionType(string value) - { - ActionType parsedValue; - Condition.TryParseActionType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ActionType from a string. - /// - public static bool TryParseActionType(string value, out ActionType parsedValue) - { - parsedValue = ActionType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("default" == value)) - { - parsedValue = ActionType.@default; - } - else - { - if (("enable" == value)) - { - parsedValue = ActionType.enable; - } - else - { - if (("disable" == value)) - { - parsedValue = ActionType.disable; - } - else - { - if (("hide" == value)) - { - parsedValue = ActionType.hide; - } - else - { - if (("show" == value)) - { - parsedValue = ActionType.show; - } - else - { - parsedValue = ActionType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Condition", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.actionFieldSet) - { - if ((this.actionField == ActionType.@default)) - { - writer.WriteAttributeString("Action", "default"); - } - if ((this.actionField == ActionType.enable)) - { - writer.WriteAttributeString("Action", "enable"); - } - if ((this.actionField == ActionType.disable)) - { - writer.WriteAttributeString("Action", "disable"); - } - if ((this.actionField == ActionType.hide)) - { - writer.WriteAttributeString("Action", "hide"); - } - if ((this.actionField == ActionType.show)) - { - writer.WriteAttributeString("Action", "show"); - } - } - if (this.levelFieldSet) - { - writer.WriteAttributeString("Level", this.levelField.ToString(CultureInfo.InvariantCulture)); - } - if (this.messageFieldSet) - { - writer.WriteAttributeString("Message", this.messageField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Action" == name)) - { - this.actionField = Condition.ParseActionType(value); - this.actionFieldSet = true; - } - if (("Level" == name)) - { - this.levelField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.levelFieldSet = true; - } - if (("Message" == name)) - { - this.messageField = value; - this.messageFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ActionType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Set the Control as the default. Only used under Control elements. - /// - @default, - - /// - /// Enable the Control. Only used under Control elements. - /// - enable, - - /// - /// Disable the Control. Only used under Control elements. - /// - disable, - - /// - /// Hide the Control. Only used under Control elements. - /// - hide, - - /// - /// Display the Control. Only used under Control elements. - /// - show, - } - } - - /// - /// Shared Component to be privately replicated in folder of parent Component - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IsolateComponent : ISchemaElement, ISetAttributes - { - - private string sharedField; - - private bool sharedFieldSet; - - private ISchemaElement parentElement; - - /// - /// Shared Component for this application Component. - /// - public string Shared - { - get - { - return this.sharedField; - } - set - { - this.sharedFieldSet = true; - this.sharedField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IsolateComponent", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sharedFieldSet) - { - writer.WriteAttributeString("Shared", this.sharedField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Shared" == name)) - { - this.sharedField = value; - this.sharedFieldSet = true; - } - } - } - - /// - /// Disk cost to reserve in a folder for running locally and/or from source. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ReserveCost : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private int runFromSourceField; - - private bool runFromSourceFieldSet; - - private int runLocalField; - - private bool runLocalFieldSet; - - private ISchemaElement parentElement; - - /// - /// A primary key that uniquely identifies this ReserveCost entry. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Adds the amount of disk space specified in RunFromSource or RunLocal to the volume cost of the device containing the directory. - /// If this attribute is not set, it will default to the directory of parent component. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// The number of bytes of disk space to reserve if the component is installed to run from source. - /// - public int RunFromSource - { - get - { - return this.runFromSourceField; - } - set - { - this.runFromSourceFieldSet = true; - this.runFromSourceField = value; - } - } - - /// - /// The number of bytes of disk space to reserve if the component is installed to run locally. - /// - public int RunLocal - { - get - { - return this.runLocalField; - } - set - { - this.runLocalFieldSet = true; - this.runLocalField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ReserveCost", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.runFromSourceFieldSet) - { - writer.WriteAttributeString("RunFromSource", this.runFromSourceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.runLocalFieldSet) - { - writer.WriteAttributeString("RunLocal", this.runLocalField.ToString(CultureInfo.InvariantCulture)); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("RunFromSource" == name)) - { - this.runFromSourceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.runFromSourceFieldSet = true; - } - if (("RunLocal" == name)) - { - this.runLocalField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.runLocalFieldSet = true; - } - } - } - - /// - /// Component for parent Directory - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Component : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private int comPlusFlagsField; - - private bool comPlusFlagsFieldSet; - - private YesNoType disableRegistryReflectionField; - - private bool disableRegistryReflectionFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string diskIdField; - - private bool diskIdFieldSet; - - private string featureField; - - private bool featureFieldSet; - - private string guidField; - - private bool guidFieldSet; - - private YesNoType keyPathField; - - private bool keyPathFieldSet; - - private LocationType locationField; - - private bool locationFieldSet; - - private YesNoType multiInstanceField; - - private bool multiInstanceFieldSet; - - private YesNoType neverOverwriteField; - - private bool neverOverwriteFieldSet; - - private YesNoType permanentField; - - private bool permanentFieldSet; - - private YesNoType sharedField; - - private bool sharedFieldSet; - - private YesNoType sharedDllRefCountField; - - private bool sharedDllRefCountFieldSet; - - private YesNoType transitiveField; - - private bool transitiveFieldSet; - - private YesNoType uninstallWhenSupersededField; - - private bool uninstallWhenSupersededFieldSet; - - private YesNoType win64Field; - - private bool win64FieldSet; - - private ISchemaElement parentElement; - - public Component() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Category))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CopyFile))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateFolder))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Environment))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Extension))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(File))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IniFile))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponent))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDataSource))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDriver))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCTranslator))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgId))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Registry))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryKey))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFile))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFolder))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryKey))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryValue))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ReserveCost))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceControl))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfig))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfigFailureActions))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceInstall))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TypeLib))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Component identifier; this is the primary key for identifying components. If omitted, - /// the compiler defaults the identifier to the identifier of the resource that is the - /// explicit keypath of the component (for example, a child File element with KeyPath - /// attribute with value 'yes'. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set this attribute to create a ComPlus entry. The value should be the export flags used - /// during the generation of the .msi file. For more information see the COM+ documentation - /// in the Platform SDK. - /// - public int ComPlusFlags - { - get - { - return this.comPlusFlagsField; - } - set - { - this.comPlusFlagsFieldSet = true; - this.comPlusFlagsField = value; - } - } - - /// - /// Set this attribute to 'yes' in order to disable registry reflection on all existing and - /// new registry keys affected by this component. - /// When set to 'yes', the Windows Installer calls the RegDisableReflectionKey on each key - /// being accessed by the component. - /// This bit is available with Windows Installer version 4.0 and is ignored on 32-bit systems. - /// - public YesNoType DisableRegistryReflection - { - get - { - return this.disableRegistryReflectionField; - } - set - { - this.disableRegistryReflectionFieldSet = true; - this.disableRegistryReflectionField = value; - } - } - - /// - /// Sets the Directory of the Component. If this element is nested under a Directory element, - /// this value defaults to the value of the parent Directory/@Id. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// This attribute provides a default DiskId attribute for all child File elements. Specifying - /// the DiskId on a Component element will override any DiskId attributes set by parent Directory - /// or DirectoryRef elements. See the File element's DiskId attribute for more information about - /// the purpose of the DiskId. - /// - public string DiskId - { - get - { - return this.diskIdField; - } - set - { - this.diskIdFieldSet = true; - this.diskIdField = value; - } - } - - /// - /// Identifies a feature to which this component belongs, as a shorthand for a child - /// ComponentRef element of the Feature element. The value of this attribute should - /// correspond to the Id attribute of a Feature element authored elsewhere. Note that - /// a single component can belong to multiple features but this attribute allows you - /// to specify only a single feature. - /// - public string Feature - { - get - { - return this.featureField; - } - set - { - this.featureFieldSet = true; - this.featureField = value; - } - } - - /// - /// This value should be a guid that uniquely identifies this component's contents, language, platform, and version. - /// If omitted, the default value is '*' which indicates that the linker should generate a stable guid. - /// Generatable guids are supported only for components with a single file as the component's keypath - /// or no files and a registry value as the keypath. - /// It's also possible to set the value to an empty string to specify an unmanaged component. - /// Unmanaged components are a security vulnerability because the component cannot be removed or repaired - /// by Windows Installer (it is essentially an unpatchable, permanent component). Therefore, a guid should - /// always be specified for any component which contains resources that may need to be patched in the future. - /// - public string Guid - { - get - { - return this.guidField; - } - set - { - this.guidFieldSet = true; - this.guidField = value; - } - } - - /// - /// If this attribute's value is set to 'yes', then the Directory of this Component is used - /// as the KeyPath. To set a Registry value or File as the KeyPath of a component, set the - /// KeyPath attribute to 'yes' on one of those child elements. If KeyPath is not set to 'yes' for the - /// Component or for a child Registry value or File, WiX will look at the child elements under the - /// Component in sequential order and try to automatically select one of them as a key path. Allowing - /// WiX to automatically select a key path can be dangerous because adding or removing child elements - /// under the Component can inadvertantly cause the key path to change, which can lead to - /// installation problems. - /// - public YesNoType KeyPath - { - get - { - return this.keyPathField; - } - set - { - this.keyPathFieldSet = true; - this.keyPathField = value; - } - } - - /// - /// Optional value that specifies the location that the component can be run from. - /// - public LocationType Location - { - get - { - return this.locationField; - } - set - { - this.locationFieldSet = true; - this.locationField = value; - } - } - - /// - /// If this attribute is set to 'yes', a new Component/@Guid will be generated for each - /// instance transform. Ensure that all of the resources contained in a multi-instance - /// Component will be installed to different paths based on the instance Property; otherwise, - /// the Component Rules will be violated. - /// - public YesNoType MultiInstance - { - get - { - return this.multiInstanceField; - } - set - { - this.multiInstanceFieldSet = true; - this.multiInstanceField = value; - } - } - - /// - /// If this attribute is set to 'yes', the installer does not install or reinstall the - /// component if a key path file or a key path registry entry for the component already - /// exists. The application does register itself as a client of the component. Use this - /// flag only for components that are being registered by the Registry table. Do not use - /// this flag for components registered by the AppId, Class, Extension, ProgId, MIME, and - /// Verb tables. - /// - public YesNoType NeverOverwrite - { - get - { - return this.neverOverwriteField; - } - set - { - this.neverOverwriteFieldSet = true; - this.neverOverwriteField = value; - } - } - - /// - /// If this attribute is set to 'yes', the installer does not remove the component during - /// an uninstall. The installer registers an extra system client for the component in - /// the Windows Installer registry settings (which basically just means that at least one - /// product is always referencing this component). Note that this option differs from the - /// behavior of not setting a guid because although the component is permanent, it is still - /// patchable (because Windows Installer still tracks it), it's just not uninstallable. - /// - public YesNoType Permanent - { - get - { - return this.permanentField; - } - set - { - this.permanentFieldSet = true; - this.permanentField = value; - } - } - - /// - /// If this attribute's value is set to 'yes', enables advanced patching semantics for - /// Components that are shared across multiple Products. Specifically, the Windows Installer - /// will cache the shared files to improve patch uninstall. This functionality is available - /// in Windows Installer 4.5 and later. - /// - public YesNoType Shared - { - get - { - return this.sharedField; - } - set - { - this.sharedFieldSet = true; - this.sharedField = value; - } - } - - /// - /// If this attribute's value is set to 'yes', the installer increments the reference count - /// in the shared DLL registry of the component's key file. If this bit is not set, the - /// installer increments the reference count only if the reference count already exists. - /// - public YesNoType SharedDllRefCount - { - get - { - return this.sharedDllRefCountField; - } - set - { - this.sharedDllRefCountFieldSet = true; - this.sharedDllRefCountField = value; - } - } - - /// - /// If this attribute is set to 'yes', the installer reevaluates the value of the statement - /// in the Condition upon a reinstall. If the value was previously False and has changed to - /// True, the installer installs the component. If the value was previously True and has - /// changed to False, the installer removes the component even if the component has other - /// products as clients. - /// - public YesNoType Transitive - { - get - { - return this.transitiveField; - } - set - { - this.transitiveFieldSet = true; - this.transitiveField = value; - } - } - - /// - /// If this attribute is set to 'yes', the installer will uninstall the Component's files - /// and registry keys when it is superseded by a patch. This functionality is available in - /// Windows Installer 4.5 and later. - /// - public YesNoType UninstallWhenSuperseded - { - get - { - return this.uninstallWhenSupersededField; - } - set - { - this.uninstallWhenSupersededFieldSet = true; - this.uninstallWhenSupersededField = value; - } - } - - /// - /// Set this attribute to 'yes' to mark this as a 64-bit component. This attribute facilitates - /// the installation of packages that include both 32-bit and 64-bit components. If this is a 64-bit - /// component replacing a 32-bit component, set this attribute to 'yes' and assign a new GUID in the Guid attribute. - /// The default value is based on the platform set by the -arch switch to candle.exe - /// or the InstallerPlatform property in a .wixproj MSBuild project: - /// For x86 and ARM, the default value is 'no'. - /// For x64 and IA64, the default value is 'yes'. - /// - public YesNoType Win64 - { - get - { - return this.win64Field; - } - set - { - this.win64FieldSet = true; - this.win64Field = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("AppId" == childName)) - { - childValue = new AppId(); - } - if (("Category" == childName)) - { - childValue = new Category(); - } - if (("Class" == childName)) - { - childValue = new Class(); - } - if (("Condition" == childName)) - { - childValue = new Condition(); - } - if (("CopyFile" == childName)) - { - childValue = new CopyFile(); - } - if (("CreateFolder" == childName)) - { - childValue = new CreateFolder(); - } - if (("Environment" == childName)) - { - childValue = new Environment(); - } - if (("Extension" == childName)) - { - childValue = new Extension(); - } - if (("File" == childName)) - { - childValue = new File(); - } - if (("IniFile" == childName)) - { - childValue = new IniFile(); - } - if (("Interface" == childName)) - { - childValue = new Interface(); - } - if (("IsolateComponent" == childName)) - { - childValue = new IsolateComponent(); - } - if (("ODBCDataSource" == childName)) - { - childValue = new ODBCDataSource(); - } - if (("ODBCDriver" == childName)) - { - childValue = new ODBCDriver(); - } - if (("ODBCTranslator" == childName)) - { - childValue = new ODBCTranslator(); - } - if (("ProgId" == childName)) - { - childValue = new ProgId(); - } - if (("Registry" == childName)) - { - childValue = new Registry(); - } - if (("RegistryKey" == childName)) - { - childValue = new RegistryKey(); - } - if (("RegistryValue" == childName)) - { - childValue = new RegistryValue(); - } - if (("RemoveFile" == childName)) - { - childValue = new RemoveFile(); - } - if (("RemoveFolder" == childName)) - { - childValue = new RemoveFolder(); - } - if (("RemoveRegistryKey" == childName)) - { - childValue = new RemoveRegistryKey(); - } - if (("RemoveRegistryValue" == childName)) - { - childValue = new RemoveRegistryValue(); - } - if (("ReserveCost" == childName)) - { - childValue = new ReserveCost(); - } - if (("ServiceControl" == childName)) - { - childValue = new ServiceControl(); - } - if (("ServiceConfig" == childName)) - { - childValue = new ServiceConfig(); - } - if (("ServiceConfigFailureActions" == childName)) - { - childValue = new ServiceConfigFailureActions(); - } - if (("ServiceInstall" == childName)) - { - childValue = new ServiceInstall(); - } - if (("Shortcut" == childName)) - { - childValue = new Shortcut(); - } - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if (("TypeLib" == childName)) - { - childValue = new TypeLib(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a LocationType from a string. - /// - public static LocationType ParseLocationType(string value) - { - LocationType parsedValue; - Component.TryParseLocationType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a LocationType from a string. - /// - public static bool TryParseLocationType(string value, out LocationType parsedValue) - { - parsedValue = LocationType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("local" == value)) - { - parsedValue = LocationType.local; - } - else - { - if (("source" == value)) - { - parsedValue = LocationType.source; - } - else - { - if (("either" == value)) - { - parsedValue = LocationType.either; - } - else - { - parsedValue = LocationType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Component", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.comPlusFlagsFieldSet) - { - writer.WriteAttributeString("ComPlusFlags", this.comPlusFlagsField.ToString(CultureInfo.InvariantCulture)); - } - if (this.disableRegistryReflectionFieldSet) - { - if ((this.disableRegistryReflectionField == YesNoType.no)) - { - writer.WriteAttributeString("DisableRegistryReflection", "no"); - } - if ((this.disableRegistryReflectionField == YesNoType.yes)) - { - writer.WriteAttributeString("DisableRegistryReflection", "yes"); - } - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.diskIdFieldSet) - { - writer.WriteAttributeString("DiskId", this.diskIdField); - } - if (this.featureFieldSet) - { - writer.WriteAttributeString("Feature", this.featureField); - } - if (this.guidFieldSet) - { - writer.WriteAttributeString("Guid", this.guidField); - } - if (this.keyPathFieldSet) - { - if ((this.keyPathField == YesNoType.no)) - { - writer.WriteAttributeString("KeyPath", "no"); - } - if ((this.keyPathField == YesNoType.yes)) - { - writer.WriteAttributeString("KeyPath", "yes"); - } - } - if (this.locationFieldSet) - { - if ((this.locationField == LocationType.local)) - { - writer.WriteAttributeString("Location", "local"); - } - if ((this.locationField == LocationType.source)) - { - writer.WriteAttributeString("Location", "source"); - } - if ((this.locationField == LocationType.either)) - { - writer.WriteAttributeString("Location", "either"); - } - } - if (this.multiInstanceFieldSet) - { - if ((this.multiInstanceField == YesNoType.no)) - { - writer.WriteAttributeString("MultiInstance", "no"); - } - if ((this.multiInstanceField == YesNoType.yes)) - { - writer.WriteAttributeString("MultiInstance", "yes"); - } - } - if (this.neverOverwriteFieldSet) - { - if ((this.neverOverwriteField == YesNoType.no)) - { - writer.WriteAttributeString("NeverOverwrite", "no"); - } - if ((this.neverOverwriteField == YesNoType.yes)) - { - writer.WriteAttributeString("NeverOverwrite", "yes"); - } - } - if (this.permanentFieldSet) - { - if ((this.permanentField == YesNoType.no)) - { - writer.WriteAttributeString("Permanent", "no"); - } - if ((this.permanentField == YesNoType.yes)) - { - writer.WriteAttributeString("Permanent", "yes"); - } - } - if (this.sharedFieldSet) - { - if ((this.sharedField == YesNoType.no)) - { - writer.WriteAttributeString("Shared", "no"); - } - if ((this.sharedField == YesNoType.yes)) - { - writer.WriteAttributeString("Shared", "yes"); - } - } - if (this.sharedDllRefCountFieldSet) - { - if ((this.sharedDllRefCountField == YesNoType.no)) - { - writer.WriteAttributeString("SharedDllRefCount", "no"); - } - if ((this.sharedDllRefCountField == YesNoType.yes)) - { - writer.WriteAttributeString("SharedDllRefCount", "yes"); - } - } - if (this.transitiveFieldSet) - { - if ((this.transitiveField == YesNoType.no)) - { - writer.WriteAttributeString("Transitive", "no"); - } - if ((this.transitiveField == YesNoType.yes)) - { - writer.WriteAttributeString("Transitive", "yes"); - } - } - if (this.uninstallWhenSupersededFieldSet) - { - if ((this.uninstallWhenSupersededField == YesNoType.no)) - { - writer.WriteAttributeString("UninstallWhenSuperseded", "no"); - } - if ((this.uninstallWhenSupersededField == YesNoType.yes)) - { - writer.WriteAttributeString("UninstallWhenSuperseded", "yes"); - } - } - if (this.win64FieldSet) - { - if ((this.win64Field == YesNoType.no)) - { - writer.WriteAttributeString("Win64", "no"); - } - if ((this.win64Field == YesNoType.yes)) - { - writer.WriteAttributeString("Win64", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("ComPlusFlags" == name)) - { - this.comPlusFlagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.comPlusFlagsFieldSet = true; - } - if (("DisableRegistryReflection" == name)) - { - this.disableRegistryReflectionField = Enums.ParseYesNoType(value); - this.disableRegistryReflectionFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("DiskId" == name)) - { - this.diskIdField = value; - this.diskIdFieldSet = true; - } - if (("Feature" == name)) - { - this.featureField = value; - this.featureFieldSet = true; - } - if (("Guid" == name)) - { - this.guidField = value; - this.guidFieldSet = true; - } - if (("KeyPath" == name)) - { - this.keyPathField = Enums.ParseYesNoType(value); - this.keyPathFieldSet = true; - } - if (("Location" == name)) - { - this.locationField = Component.ParseLocationType(value); - this.locationFieldSet = true; - } - if (("MultiInstance" == name)) - { - this.multiInstanceField = Enums.ParseYesNoType(value); - this.multiInstanceFieldSet = true; - } - if (("NeverOverwrite" == name)) - { - this.neverOverwriteField = Enums.ParseYesNoType(value); - this.neverOverwriteFieldSet = true; - } - if (("Permanent" == name)) - { - this.permanentField = Enums.ParseYesNoType(value); - this.permanentFieldSet = true; - } - if (("Shared" == name)) - { - this.sharedField = Enums.ParseYesNoType(value); - this.sharedFieldSet = true; - } - if (("SharedDllRefCount" == name)) - { - this.sharedDllRefCountField = Enums.ParseYesNoType(value); - this.sharedDllRefCountFieldSet = true; - } - if (("Transitive" == name)) - { - this.transitiveField = Enums.ParseYesNoType(value); - this.transitiveFieldSet = true; - } - if (("UninstallWhenSuperseded" == name)) - { - this.uninstallWhenSupersededField = Enums.ParseYesNoType(value); - this.uninstallWhenSupersededFieldSet = true; - } - if (("Win64" == name)) - { - this.win64Field = Enums.ParseYesNoType(value); - this.win64FieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum LocationType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Prevents the component from running from the source or the network (this is the default behavior if this attribute is not set). - /// - local, - - /// - /// Enforces that the component can only be run from the source (it cannot be run from the user's computer). - /// - source, - - /// - /// Allows the component to run from source or locally. - /// - either, - } - } - - /// - /// Groups together multiple components to be used in other locations. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ComponentGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string sourceField; - - private bool sourceFieldSet; - - private ISchemaElement parentElement; - - public ComponentGroup() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the ComponentGroup. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Sets the default directory identifier for child Component elements. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// Used to set the default file system source for child Component elements. For more information, see - /// - public string Source - { - get - { - return this.sourceField; - } - set - { - this.sourceFieldSet = true; - this.sourceField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("ComponentGroupRef" == childName)) - { - childValue = new ComponentGroupRef(); - } - if (("ComponentRef" == childName)) - { - childValue = new ComponentRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComponentGroup", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.sourceFieldSet) - { - writer.WriteAttributeString("Source", this.sourceField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("Source" == name)) - { - this.sourceField = value; - this.sourceFieldSet = true; - } - } - } - - /// - /// Create a reference to a ComponentGroup in another Fragment. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ComponentGroupRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType primaryField; - - private bool primaryFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the ComponentGroup to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set this attribute to 'yes' in order to make the parent feature of this component - /// the primary feature for this component. Components may belong to multiple features. - /// By designating a feature as the primary feature of a component, you ensure that - /// whenever a component is selected for install-on-demand (IOD), the primary feature - /// will be the one to install it. This attribute should only be set if a component - /// actually nests under multiple features. If a component nests under only one feature, - /// that feature is the primary feature for the component. You cannot set more than one - /// feature as the primary feature of a given component. - /// - public YesNoType Primary - { - get - { - return this.primaryField; - } - set - { - this.primaryFieldSet = true; - this.primaryField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComponentGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.primaryFieldSet) - { - if ((this.primaryField == YesNoType.no)) - { - writer.WriteAttributeString("Primary", "no"); - } - if ((this.primaryField == YesNoType.yes)) - { - writer.WriteAttributeString("Primary", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Primary" == name)) - { - this.primaryField = Enums.ParseYesNoType(value); - this.primaryFieldSet = true; - } - } - } - - /// - /// Used only for PatchFamilies to include all changes between the baseline and upgraded packages in a patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class All : ISetAttributes, ISchemaElement - { - - private ISchemaElement parentElement; - - private string contentField; - - private bool contentFieldSet; - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Used only for PatchFamilies to include all changes between the baseline and upgraded packages in a patch. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("All", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - } - - /// - /// Used only for PatchFamilies to include only a binary table entry in a patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class BinaryRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the Binary element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("BinaryRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Used only for PatchFamilies to include only a icon table entry in a patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IconRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the Icon element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IconRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Create a reference to a Feature element in another Fragment. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ComponentRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType primaryField; - - private bool primaryFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the Component element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set this attribute to 'yes' in order to make the parent feature of this component - /// the primary feature for this component. Components may belong to multiple features. - /// By designating a feature as the primary feature of a component, you ensure that - /// whenever a component is selected for install-on-demand (IOD), the primary feature - /// will be the one to install it. This attribute should only be set if a component - /// actually nests under multiple features. If a component nests under only one feature, - /// that feature is the primary feature for the component. You cannot set more than one - /// feature as the primary feature of a given component. - /// - public YesNoType Primary - { - get - { - return this.primaryField; - } - set - { - this.primaryFieldSet = true; - this.primaryField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComponentRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.primaryFieldSet) - { - if ((this.primaryField == YesNoType.no)) - { - writer.WriteAttributeString("Primary", "no"); - } - if ((this.primaryField == YesNoType.yes)) - { - writer.WriteAttributeString("Primary", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Primary" == name)) - { - this.primaryField = Enums.ParseYesNoType(value); - this.primaryFieldSet = true; - } - } - } - - /// - /// Merge directive to bring in a merge module that will be redirected to the parent directory. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Merge : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string diskIdField; - - private bool diskIdFieldSet; - - private YesNoType fileCompressionField; - - private bool fileCompressionFieldSet; - - private string languageField; - - private bool languageFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private ISchemaElement parentElement; - - public Merge() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ConfigurationData))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The unique identifier for the Merge element in the source code. Referenced by the MergeRef/@Id. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The value of this attribute should correspond to the Id attribute of a - /// Media element authored elsewhere. By creating this connection between the merge module and Media - /// element, you set the packaging options to the values specified in the Media - /// element (values such as compression level, cab embedding, etc...). - /// - public string DiskId - { - get - { - return this.diskIdField; - } - set - { - this.diskIdFieldSet = true; - this.diskIdField = value; - } - } - - /// - /// Specifies if the files in the merge module should be compressed. - /// - public YesNoType FileCompression - { - get - { - return this.fileCompressionField; - } - set - { - this.fileCompressionFieldSet = true; - this.fileCompressionField = value; - } - } - - /// - /// Specifies the decimal LCID or localization token for the language to merge the Module in as. - /// - public string Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - /// - /// Path to the source location of the merge module. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ConfigurationData" == childName)) - { - childValue = new ConfigurationData(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Merge", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.diskIdFieldSet) - { - writer.WriteAttributeString("DiskId", this.diskIdField); - } - if (this.fileCompressionFieldSet) - { - if ((this.fileCompressionField == YesNoType.no)) - { - writer.WriteAttributeString("FileCompression", "no"); - } - if ((this.fileCompressionField == YesNoType.yes)) - { - writer.WriteAttributeString("FileCompression", "yes"); - } - } - if (this.languageFieldSet) - { - writer.WriteAttributeString("Language", this.languageField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("DiskId" == name)) - { - this.diskIdField = value; - this.diskIdFieldSet = true; - } - if (("FileCompression" == name)) - { - this.fileCompressionField = Enums.ParseYesNoType(value); - this.fileCompressionFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = value; - this.languageFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - } - } - - /// - /// Merge reference to connect a Merge Module to parent Feature - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MergeRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType primaryField; - - private bool primaryFieldSet; - - private ISchemaElement parentElement; - - /// - /// The unique identifier for the Merge element to be referenced. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Specifies whether the feature containing this MergeRef is the primary feature for advertising the merge module's components. - /// - public YesNoType Primary - { - get - { - return this.primaryField; - } - set - { - this.primaryFieldSet = true; - this.primaryField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MergeRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.primaryFieldSet) - { - if ((this.primaryField == YesNoType.no)) - { - writer.WriteAttributeString("Primary", "no"); - } - if ((this.primaryField == YesNoType.yes)) - { - writer.WriteAttributeString("Primary", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Primary" == name)) - { - this.primaryField = Enums.ParseYesNoType(value); - this.primaryFieldSet = true; - } - } - } - - /// - /// Data to use as input to a configurable merge module. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ConfigurationData : ISchemaElement, ISetAttributes - { - - private string nameField; - - private bool nameFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// Name of the item in the ModuleConfiguration table. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Value to be passed to configurable merge module. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ConfigurationData", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Directory layout for the product. Also specifies the mappings between source and target directories. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Directory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string componentGuidGenerationSeedField; - - private bool componentGuidGenerationSeedFieldSet; - - private string diskIdField; - - private bool diskIdFieldSet; - - private string fileSourceField; - - private bool fileSourceFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string shortNameField; - - private bool shortNameFieldSet; - - private string shortSourceNameField; - - private bool shortSourceNameFieldSet; - - private string sourceNameField; - - private bool sourceNameFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private ISchemaElement parentElement; - - public Directory() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Merge))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// This value is the unique identifier of the directory entry. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The Component Guid Generation Seed is a guid that must be used when a Component with the generate guid directive ("*") - /// is not rooted in a standard Windows Installer directory (for example, ProgramFilesFolder or CommonFilesFolder). - /// It is recommended that this attribute be avoided and that developers install their Components under standard - /// directories with unique names instead (for example, "ProgramFilesFolder\Company Name Product Name Version"). It is - /// important to note that once a directory is assigned a Component Guid Generation Seed the value must not change until - /// (and must be changed when) the path to that directory, including itself and all parent directories, changes. - /// - public string ComponentGuidGenerationSeed - { - get - { - return this.componentGuidGenerationSeedField; - } - set - { - this.componentGuidGenerationSeedFieldSet = true; - this.componentGuidGenerationSeedField = value; - } - } - - /// - /// Sets the default disk identifier for the files contained in this directory. - /// This attribute's value may be overridden by a child Component, Directory, - /// Merge or File element. See the File or Merge elements' DiskId attribute for - /// more information. - /// - public string DiskId - { - get - { - return this.diskIdField; - } - set - { - this.diskIdFieldSet = true; - this.diskIdField = value; - } - } - - /// - /// Used to set the file system source for this directory's child elements. For more information, see - /// - public string FileSource - { - get - { - return this.fileSourceField; - } - set - { - this.fileSourceFieldSet = true; - this.fileSourceField = value; - } - } - - /// - /// The name of the directory. - /// - /// Do not specify this attribute if this directory represents - /// the same directory as the parent (see the Windows Installer SDK's - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The short name of the directory in 8.3 format. - /// This attribute should only be set if there is a conflict between generated short directory names - /// or the user wants to manually specify the short directory name. - /// - public string ShortName - { - get - { - return this.shortNameField; - } - set - { - this.shortNameFieldSet = true; - this.shortNameField = value; - } - } - - /// - /// The short name of the directory on the source media in 8.3 format. - /// This attribute should only be set if there is a conflict between generated short directory names - /// or the user wants to manually specify the short source directory name. - /// - public string ShortSourceName - { - get - { - return this.shortSourceNameField; - } - set - { - this.shortSourceNameFieldSet = true; - this.shortSourceNameField = value; - } - } - - /// - /// The name of the directory on the source media. - /// If this attribute is not specified, Windows Installer will default to the Name attribute. - /// - /// In prior versions of the WiX toolset, this attribute specified the short source directory name. - /// This attribute's value may now be either a short or long directory name. - /// If a short directory name is specified, the ShortSourceName attribute may not be specified. - /// If a long directory name is specified, the LongSource attribute may not be specified. - /// Also, if this value is a long directory name, the ShortSourceName attribute may be omitted to - /// allow WiX to attempt to generate a unique short directory name. - /// However, if this name collides with another directory or you wish to manually specify - /// the short directory name, then the ShortSourceName attribute may be specified. - /// - public string SourceName - { - get - { - return this.sourceNameField; - } - set - { - this.sourceNameFieldSet = true; - this.sourceNameField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("Directory" == childName)) - { - childValue = new Directory(); - } - if (("Merge" == childName)) - { - childValue = new Merge(); - } - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Directory", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.componentGuidGenerationSeedFieldSet) - { - writer.WriteAttributeString("ComponentGuidGenerationSeed", this.componentGuidGenerationSeedField); - } - if (this.diskIdFieldSet) - { - writer.WriteAttributeString("DiskId", this.diskIdField); - } - if (this.fileSourceFieldSet) - { - writer.WriteAttributeString("FileSource", this.fileSourceField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.shortNameFieldSet) - { - writer.WriteAttributeString("ShortName", this.shortNameField); - } - if (this.shortSourceNameFieldSet) - { - writer.WriteAttributeString("ShortSourceName", this.shortSourceNameField); - } - if (this.sourceNameFieldSet) - { - writer.WriteAttributeString("SourceName", this.sourceNameField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("ComponentGuidGenerationSeed" == name)) - { - this.componentGuidGenerationSeedField = value; - this.componentGuidGenerationSeedFieldSet = true; - } - if (("DiskId" == name)) - { - this.diskIdField = value; - this.diskIdFieldSet = true; - } - if (("FileSource" == name)) - { - this.fileSourceField = value; - this.fileSourceFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("ShortName" == name)) - { - this.shortNameField = value; - this.shortNameFieldSet = true; - } - if (("ShortSourceName" == name)) - { - this.shortSourceNameField = value; - this.shortSourceNameFieldSet = true; - } - if (("SourceName" == name)) - { - this.sourceNameField = value; - this.sourceNameFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - } - } - - /// - /// Create a reference to a Directory element in another Fragment. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DirectoryRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string diskIdField; - - private bool diskIdFieldSet; - - private string fileSourceField; - - private bool fileSourceFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private ISchemaElement parentElement; - - public DirectoryRef() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Merge))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The identifier of the Directory element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Sets the default disk identifier for the files contained in this directory. - /// This attribute's value may be overridden by a child Component, Directory, - /// Merge or File element. See the File or Merge elements' DiskId attribute for - /// more information. - /// - public string DiskId - { - get - { - return this.diskIdField; - } - set - { - this.diskIdFieldSet = true; - this.diskIdField = value; - } - } - - /// - /// Used to set the file system source for this DirectoryRef's child elements. For more information, see - /// - public string FileSource - { - get - { - return this.fileSourceField; - } - set - { - this.fileSourceFieldSet = true; - this.fileSourceField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("Directory" == childName)) - { - childValue = new Directory(); - } - if (("Merge" == childName)) - { - childValue = new Merge(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DirectoryRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.diskIdFieldSet) - { - writer.WriteAttributeString("DiskId", this.diskIdField); - } - if (this.fileSourceFieldSet) - { - writer.WriteAttributeString("FileSource", this.fileSourceField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("DiskId" == name)) - { - this.diskIdField = value; - this.diskIdFieldSet = true; - } - if (("FileSource" == name)) - { - this.fileSourceField = value; - this.fileSourceFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UpgradeVersion : ISchemaElement, ISetAttributes - { - - private string minimumField; - - private bool minimumFieldSet; - - private string maximumField; - - private bool maximumFieldSet; - - private string languageField; - - private bool languageFieldSet; - - private string removeFeaturesField; - - private bool removeFeaturesFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private YesNoType migrateFeaturesField; - - private bool migrateFeaturesFieldSet; - - private YesNoType onlyDetectField; - - private bool onlyDetectFieldSet; - - private YesNoType ignoreRemoveFailureField; - - private bool ignoreRemoveFailureFieldSet; - - private YesNoType includeMinimumField; - - private bool includeMinimumFieldSet; - - private YesNoType includeMaximumField; - - private bool includeMaximumFieldSet; - - private YesNoType excludeLanguagesField; - - private bool excludeLanguagesFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Specifies the lower bound on the range of product versions to be detected by FindRelatedProducts. - /// - public string Minimum - { - get - { - return this.minimumField; - } - set - { - this.minimumFieldSet = true; - this.minimumField = value; - } - } - - /// - /// Specifies the upper boundary of the range of product versions detected by FindRelatedProducts. - /// - public string Maximum - { - get - { - return this.maximumField; - } - set - { - this.maximumFieldSet = true; - this.maximumField = value; - } - } - - /// - /// Specifies the set of languages detected by FindRelatedProducts. Enter a list of numeric language identifiers (LANGID) separated by commas (,). Leave this value null to specify all languages. Set ExcludeLanguages to "yes" in order detect all languages, excluding the languages listed in this value. - /// - public string Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - /// - /// The installer sets the REMOVE property to features specified in this column. The features to be removed can be determined at run time. The Formatted string entered in this field must evaluate to a comma-delimited list of feature names. For example: [Feature1],[Feature2],[Feature3]. No features are removed if the field contains formatted text that evaluates to an empty string. The installer sets REMOVE=ALL only if the Remove field is empty. - /// - public string RemoveFeatures - { - get - { - return this.removeFeaturesField; - } - set - { - this.removeFeaturesFieldSet = true; - this.removeFeaturesField = value; - } - } - - /// - /// When the FindRelatedProducts action detects a related product installed on the system, it appends the product code to the property specified in this field. Windows Installer documentation for the - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// Set to "yes" to migrate feature states from upgraded products by enabling the logic in the MigrateFeatureStates action. - /// - public YesNoType MigrateFeatures - { - get - { - return this.migrateFeaturesField; - } - set - { - this.migrateFeaturesFieldSet = true; - this.migrateFeaturesField = value; - } - } - - /// - /// Set to "yes" to detect products and applications but do not uninstall. - /// - public YesNoType OnlyDetect - { - get - { - return this.onlyDetectField; - } - set - { - this.onlyDetectFieldSet = true; - this.onlyDetectField = value; - } - } - - /// - /// Set to "yes" to continue installation upon failure to remove a product or application. - /// - public YesNoType IgnoreRemoveFailure - { - get - { - return this.ignoreRemoveFailureField; - } - set - { - this.ignoreRemoveFailureFieldSet = true; - this.ignoreRemoveFailureField = value; - } - } - - /// - /// Set to "no" to make the range of versions detected exclude the value specified in Minimum. This attribute is "yes" by default. - /// - public YesNoType IncludeMinimum - { - get - { - return this.includeMinimumField; - } - set - { - this.includeMinimumFieldSet = true; - this.includeMinimumField = value; - } - } - - /// - /// Set to "yes" to make the range of versions detected include the value specified in Maximum. - /// - public YesNoType IncludeMaximum - { - get - { - return this.includeMaximumField; - } - set - { - this.includeMaximumFieldSet = true; - this.includeMaximumField = value; - } - } - - /// - /// Set to "yes" to detect all languages, excluding the languages listed in the Language attribute. - /// - public YesNoType ExcludeLanguages - { - get - { - return this.excludeLanguagesField; - } - set - { - this.excludeLanguagesFieldSet = true; - this.excludeLanguagesField = value; - } - } - - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UpgradeVersion", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.minimumFieldSet) - { - writer.WriteAttributeString("Minimum", this.minimumField); - } - if (this.maximumFieldSet) - { - writer.WriteAttributeString("Maximum", this.maximumField); - } - if (this.languageFieldSet) - { - writer.WriteAttributeString("Language", this.languageField); - } - if (this.removeFeaturesFieldSet) - { - writer.WriteAttributeString("RemoveFeatures", this.removeFeaturesField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.migrateFeaturesFieldSet) - { - if ((this.migrateFeaturesField == YesNoType.no)) - { - writer.WriteAttributeString("MigrateFeatures", "no"); - } - if ((this.migrateFeaturesField == YesNoType.yes)) - { - writer.WriteAttributeString("MigrateFeatures", "yes"); - } - } - if (this.onlyDetectFieldSet) - { - if ((this.onlyDetectField == YesNoType.no)) - { - writer.WriteAttributeString("OnlyDetect", "no"); - } - if ((this.onlyDetectField == YesNoType.yes)) - { - writer.WriteAttributeString("OnlyDetect", "yes"); - } - } - if (this.ignoreRemoveFailureFieldSet) - { - if ((this.ignoreRemoveFailureField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreRemoveFailure", "no"); - } - if ((this.ignoreRemoveFailureField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreRemoveFailure", "yes"); - } - } - if (this.includeMinimumFieldSet) - { - if ((this.includeMinimumField == YesNoType.no)) - { - writer.WriteAttributeString("IncludeMinimum", "no"); - } - if ((this.includeMinimumField == YesNoType.yes)) - { - writer.WriteAttributeString("IncludeMinimum", "yes"); - } - } - if (this.includeMaximumFieldSet) - { - if ((this.includeMaximumField == YesNoType.no)) - { - writer.WriteAttributeString("IncludeMaximum", "no"); - } - if ((this.includeMaximumField == YesNoType.yes)) - { - writer.WriteAttributeString("IncludeMaximum", "yes"); - } - } - if (this.excludeLanguagesFieldSet) - { - if ((this.excludeLanguagesField == YesNoType.no)) - { - writer.WriteAttributeString("ExcludeLanguages", "no"); - } - if ((this.excludeLanguagesField == YesNoType.yes)) - { - writer.WriteAttributeString("ExcludeLanguages", "yes"); - } - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Minimum" == name)) - { - this.minimumField = value; - this.minimumFieldSet = true; - } - if (("Maximum" == name)) - { - this.maximumField = value; - this.maximumFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = value; - this.languageFieldSet = true; - } - if (("RemoveFeatures" == name)) - { - this.removeFeaturesField = value; - this.removeFeaturesFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("MigrateFeatures" == name)) - { - this.migrateFeaturesField = Enums.ParseYesNoType(value); - this.migrateFeaturesFieldSet = true; - } - if (("OnlyDetect" == name)) - { - this.onlyDetectField = Enums.ParseYesNoType(value); - this.onlyDetectFieldSet = true; - } - if (("IgnoreRemoveFailure" == name)) - { - this.ignoreRemoveFailureField = Enums.ParseYesNoType(value); - this.ignoreRemoveFailureFieldSet = true; - } - if (("IncludeMinimum" == name)) - { - this.includeMinimumField = Enums.ParseYesNoType(value); - this.includeMinimumFieldSet = true; - } - if (("IncludeMaximum" == name)) - { - this.includeMaximumField = Enums.ParseYesNoType(value); - this.includeMaximumFieldSet = true; - } - if (("ExcludeLanguages" == name)) - { - this.excludeLanguagesField = Enums.ParseYesNoType(value); - this.excludeLanguagesFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Upgrade info for a particular UpgradeCode - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Upgrade : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public Upgrade() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UpgradeVersion))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// This value specifies the upgrade code for the products that are to be detected by the FindRelatedProducts action. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("UpgradeVersion" == childName)) - { - childValue = new UpgradeVersion(); - } - if (("Property" == childName)) - { - childValue = new Property(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Upgrade", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// A feature for the Feature table. Features are the smallest installable unit. See msi.chm for more - /// detailed information on the myriad installation options for a feature. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Feature : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private AbsentType absentField; - - private bool absentFieldSet; - - private AllowAdvertiseType allowAdvertiseField; - - private bool allowAdvertiseFieldSet; - - private string configurableDirectoryField; - - private bool configurableDirectoryFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private string displayField; - - private bool displayFieldSet; - - private InstallDefaultType installDefaultField; - - private bool installDefaultFieldSet; - - private int levelField; - - private bool levelFieldSet; - - private string titleField; - - private bool titleFieldSet; - - private TypicalDefaultType typicalDefaultField; - - private bool typicalDefaultFieldSet; - - private ISchemaElement parentElement; - - public Feature() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier of the feature. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This attribute determines if a user will have the option to set a feature to absent in the user interface. - /// - public AbsentType Absent - { - get - { - return this.absentField; - } - set - { - this.absentFieldSet = true; - this.absentField = value; - } - } - - /// - /// This attribute determines the possible advertise states for this feature. - /// - public AllowAdvertiseType AllowAdvertise - { - get - { - return this.allowAdvertiseField; - } - set - { - this.allowAdvertiseFieldSet = true; - this.allowAdvertiseField = value; - } - } - - /// - /// Specify the Id of a Directory that can be configured by the user at installation time. This identifier - /// must be a public property and therefore completely uppercase. - /// - public string ConfigurableDirectory - { - get - { - return this.configurableDirectoryField; - } - set - { - this.configurableDirectoryFieldSet = true; - this.configurableDirectoryField = value; - } - } - - /// - /// Longer string of text describing the feature. This localizable string is displayed by the - /// Text Control of the Selection Dialog. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// Determines the initial display of this feature in the feature tree. - /// This attribute's value should be one of the following: - /// - public string Display - { - get - { - return this.displayField; - } - set - { - this.displayFieldSet = true; - this.displayField = value; - } - } - - /// - /// This attribute determines the default install/run location of a feature. This attribute cannot be specified - /// if the value of the FollowParent attribute is 'yes' since that would ask the installer to force this feature - /// to follow the parent installation state and simultaneously favor a particular installation state just for this feature. - /// - public InstallDefaultType InstallDefault - { - get - { - return this.installDefaultField; - } - set - { - this.installDefaultFieldSet = true; - this.installDefaultField = value; - } - } - - /// - /// Sets the install level of this feature. A value of 0 will disable the feature. Processing the - /// Condition Table can modify the level value (this is set via the Condition child element). The - /// default value is "1". - /// - public int Level - { - get - { - return this.levelField; - } - set - { - this.levelFieldSet = true; - this.levelField = value; - } - } - - /// - /// Short string of text identifying the feature. This string is listed as an item by the - /// SelectionTree control of the Selection Dialog. - /// - public string Title - { - get - { - return this.titleField; - } - set - { - this.titleFieldSet = true; - this.titleField = value; - } - } - - /// - /// This attribute determines the default advertise state of the feature. - /// - public TypicalDefaultType TypicalDefault - { - get - { - return this.typicalDefaultField; - } - set - { - this.typicalDefaultFieldSet = true; - this.typicalDefaultField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("ComponentGroupRef" == childName)) - { - childValue = new ComponentGroupRef(); - } - if (("ComponentRef" == childName)) - { - childValue = new ComponentRef(); - } - if (("Condition" == childName)) - { - childValue = new Condition(); - } - if (("Feature" == childName)) - { - childValue = new Feature(); - } - if (("FeatureGroupRef" == childName)) - { - childValue = new FeatureGroupRef(); - } - if (("FeatureRef" == childName)) - { - childValue = new FeatureRef(); - } - if (("MergeRef" == childName)) - { - childValue = new MergeRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a AbsentType from a string. - /// - public static AbsentType ParseAbsentType(string value) - { - AbsentType parsedValue; - Feature.TryParseAbsentType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a AbsentType from a string. - /// - public static bool TryParseAbsentType(string value, out AbsentType parsedValue) - { - parsedValue = AbsentType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("allow" == value)) - { - parsedValue = AbsentType.allow; - } - else - { - if (("disallow" == value)) - { - parsedValue = AbsentType.disallow; - } - else - { - parsedValue = AbsentType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a AllowAdvertiseType from a string. - /// - public static AllowAdvertiseType ParseAllowAdvertiseType(string value) - { - AllowAdvertiseType parsedValue; - Feature.TryParseAllowAdvertiseType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a AllowAdvertiseType from a string. - /// - public static bool TryParseAllowAdvertiseType(string value, out AllowAdvertiseType parsedValue) - { - parsedValue = AllowAdvertiseType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("no" == value)) - { - parsedValue = AllowAdvertiseType.no; - } - else - { - if (("system" == value)) - { - parsedValue = AllowAdvertiseType.system; - } - else - { - if (("yes" == value)) - { - parsedValue = AllowAdvertiseType.yes; - } - else - { - parsedValue = AllowAdvertiseType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a InstallDefaultType from a string. - /// - public static InstallDefaultType ParseInstallDefaultType(string value) - { - InstallDefaultType parsedValue; - Feature.TryParseInstallDefaultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a InstallDefaultType from a string. - /// - public static bool TryParseInstallDefaultType(string value, out InstallDefaultType parsedValue) - { - parsedValue = InstallDefaultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("followParent" == value)) - { - parsedValue = InstallDefaultType.followParent; - } - else - { - if (("local" == value)) - { - parsedValue = InstallDefaultType.local; - } - else - { - if (("source" == value)) - { - parsedValue = InstallDefaultType.source; - } - else - { - parsedValue = InstallDefaultType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a TypicalDefaultType from a string. - /// - public static TypicalDefaultType ParseTypicalDefaultType(string value) - { - TypicalDefaultType parsedValue; - Feature.TryParseTypicalDefaultType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypicalDefaultType from a string. - /// - public static bool TryParseTypicalDefaultType(string value, out TypicalDefaultType parsedValue) - { - parsedValue = TypicalDefaultType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("advertise" == value)) - { - parsedValue = TypicalDefaultType.advertise; - } - else - { - if (("install" == value)) - { - parsedValue = TypicalDefaultType.install; - } - else - { - parsedValue = TypicalDefaultType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Feature", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.absentFieldSet) - { - if ((this.absentField == AbsentType.allow)) - { - writer.WriteAttributeString("Absent", "allow"); - } - if ((this.absentField == AbsentType.disallow)) - { - writer.WriteAttributeString("Absent", "disallow"); - } - } - if (this.allowAdvertiseFieldSet) - { - if ((this.allowAdvertiseField == AllowAdvertiseType.no)) - { - writer.WriteAttributeString("AllowAdvertise", "no"); - } - if ((this.allowAdvertiseField == AllowAdvertiseType.system)) - { - writer.WriteAttributeString("AllowAdvertise", "system"); - } - if ((this.allowAdvertiseField == AllowAdvertiseType.yes)) - { - writer.WriteAttributeString("AllowAdvertise", "yes"); - } - } - if (this.configurableDirectoryFieldSet) - { - writer.WriteAttributeString("ConfigurableDirectory", this.configurableDirectoryField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.displayFieldSet) - { - writer.WriteAttributeString("Display", this.displayField); - } - if (this.installDefaultFieldSet) - { - if ((this.installDefaultField == InstallDefaultType.followParent)) - { - writer.WriteAttributeString("InstallDefault", "followParent"); - } - if ((this.installDefaultField == InstallDefaultType.local)) - { - writer.WriteAttributeString("InstallDefault", "local"); - } - if ((this.installDefaultField == InstallDefaultType.source)) - { - writer.WriteAttributeString("InstallDefault", "source"); - } - } - if (this.levelFieldSet) - { - writer.WriteAttributeString("Level", this.levelField.ToString(CultureInfo.InvariantCulture)); - } - if (this.titleFieldSet) - { - writer.WriteAttributeString("Title", this.titleField); - } - if (this.typicalDefaultFieldSet) - { - if ((this.typicalDefaultField == TypicalDefaultType.advertise)) - { - writer.WriteAttributeString("TypicalDefault", "advertise"); - } - if ((this.typicalDefaultField == TypicalDefaultType.install)) - { - writer.WriteAttributeString("TypicalDefault", "install"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Absent" == name)) - { - this.absentField = Feature.ParseAbsentType(value); - this.absentFieldSet = true; - } - if (("AllowAdvertise" == name)) - { - this.allowAdvertiseField = Feature.ParseAllowAdvertiseType(value); - this.allowAdvertiseFieldSet = true; - } - if (("ConfigurableDirectory" == name)) - { - this.configurableDirectoryField = value; - this.configurableDirectoryFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Display" == name)) - { - this.displayField = value; - this.displayFieldSet = true; - } - if (("InstallDefault" == name)) - { - this.installDefaultField = Feature.ParseInstallDefaultType(value); - this.installDefaultFieldSet = true; - } - if (("Level" == name)) - { - this.levelField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.levelFieldSet = true; - } - if (("Title" == name)) - { - this.titleField = value; - this.titleFieldSet = true; - } - if (("TypicalDefault" == name)) - { - this.typicalDefaultField = Feature.ParseTypicalDefaultType(value); - this.typicalDefaultFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum AbsentType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Allows the user interface to display an option to change the feature state to Absent. - /// - allow, - - /// - /// Prevents the user interface from displaying an option to change the feature state - /// to Absent by setting the msidbFeatureAttributesUIDisallowAbsent attribute. This will force the feature - /// to the installation state, whether or not the feature is visible in the UI. - /// - disallow, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum AllowAdvertiseType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Prevents this feature from being advertised by setting the msidbFeatureAttributesDisallowAdvertise attribute. - /// - no, - - /// - /// Prevents advertising for this feature if the operating system shell does not support Windows Installer - /// descriptors by setting the msidbFeatureAttributesNoUnsupportedAdvertise attribute. - /// - system, - - /// - /// Allows the feature to be advertised. - /// - yes, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum InstallDefaultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Forces the feature to follow the same installation state as its parent feature. - /// - followParent, - - /// - /// Favors installing this feature locally by setting the msidbFeatureAttributesFavorLocal attribute. - /// - local, - - /// - /// Favors running this feature from source by setting the msidbFeatureAttributesFavorSource attribute. - /// - source, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypicalDefaultType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Sets the feature to be advertised by setting the msidbFeatureAttributesFavorAdvertise attribute. - /// This value cannot be set if the value of the AllowAdvertise attribute is 'no' since that would ask the installer to - /// disallow the advertised state for this feature while at the same time favoring it. - /// - advertise, - - /// - /// Sets the feature to the default non-advertised installation option. - /// - install, - } - } - - /// - /// Groups together multiple components, features, and merges to be used in other locations. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FeatureGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public FeatureGroup() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the FeatureGroup. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("ComponentGroupRef" == childName)) - { - childValue = new ComponentGroupRef(); - } - if (("ComponentRef" == childName)) - { - childValue = new ComponentRef(); - } - if (("Feature" == childName)) - { - childValue = new Feature(); - } - if (("FeatureGroupRef" == childName)) - { - childValue = new FeatureGroupRef(); - } - if (("FeatureRef" == childName)) - { - childValue = new FeatureRef(); - } - if (("MergeRef" == childName)) - { - childValue = new MergeRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FeatureGroup", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Create a reference to a FeatureGroup in another Fragment. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FeatureGroupRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType ignoreParentField; - - private bool ignoreParentFieldSet; - - private YesNoType primaryField; - - private bool primaryFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the FeatureGroup to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Normally feature group references that end up nested under a parent element create a - /// connection to that parent. This behavior is undesirable when trying to simply reference - /// to a FeatureGroup in a different Fragment. Specify 'yes' to have this feature group - /// reference not create a connection to its parent. The default is 'no'. - /// - public YesNoType IgnoreParent - { - get - { - return this.ignoreParentField; - } - set - { - this.ignoreParentFieldSet = true; - this.ignoreParentField = value; - } - } - - /// - /// Set this attribute to 'yes' in order to make the parent feature of this group - /// the primary feature for any components and merges contained in the group. - /// Features may belong to multiple features. By designating a feature as the - /// primary feature of a component or merge, you ensure that whenever a component is - /// selected for install-on-demand (IOD), the primary feature will be the one to install - /// it. This attribute should only be set if a component actually nests under multiple - /// features. If a component nests under only one feature, that feature is the primary - /// feature for the component. You cannot set more than one feature as the primary - /// feature of a given component. - /// - public YesNoType Primary - { - get - { - return this.primaryField; - } - set - { - this.primaryFieldSet = true; - this.primaryField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FeatureGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.ignoreParentFieldSet) - { - if ((this.ignoreParentField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreParent", "no"); - } - if ((this.ignoreParentField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreParent", "yes"); - } - } - if (this.primaryFieldSet) - { - if ((this.primaryField == YesNoType.no)) - { - writer.WriteAttributeString("Primary", "no"); - } - if ((this.primaryField == YesNoType.yes)) - { - writer.WriteAttributeString("Primary", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("IgnoreParent" == name)) - { - this.ignoreParentField = Enums.ParseYesNoType(value); - this.ignoreParentFieldSet = true; - } - if (("Primary" == name)) - { - this.primaryField = Enums.ParseYesNoType(value); - this.primaryFieldSet = true; - } - } - } - - /// - /// Create a reference to a Feature element in another Fragment. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FeatureRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private YesNoType ignoreParentField; - - private bool ignoreParentFieldSet; - - private ISchemaElement parentElement; - - public FeatureRef() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The identifier of the Feature element to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Normally feature references that are nested under a parent element create a connection to that - /// parent. This behavior is undesirable when trying to simply reference a Feature in a different - /// Fragment. Specify 'yes' to have this feature reference not create a connection to its parent. - /// The default is 'no'. - /// - public YesNoType IgnoreParent - { - get - { - return this.ignoreParentField; - } - set - { - this.ignoreParentFieldSet = true; - this.ignoreParentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Component" == childName)) - { - childValue = new Component(); - } - if (("ComponentGroupRef" == childName)) - { - childValue = new ComponentGroupRef(); - } - if (("ComponentRef" == childName)) - { - childValue = new ComponentRef(); - } - if (("Feature" == childName)) - { - childValue = new Feature(); - } - if (("FeatureRef" == childName)) - { - childValue = new FeatureRef(); - } - if (("FeatureGroup" == childName)) - { - childValue = new FeatureGroup(); - } - if (("FeatureGroupRef" == childName)) - { - childValue = new FeatureGroupRef(); - } - if (("MergeRef" == childName)) - { - childValue = new MergeRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FeatureRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.ignoreParentFieldSet) - { - if ((this.ignoreParentField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreParent", "no"); - } - if ((this.ignoreParentField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreParent", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("IgnoreParent" == name)) - { - this.ignoreParentField = Enums.ParseYesNoType(value); - this.ignoreParentFieldSet = true; - } - } - } - - /// - /// Media element describes a disk that makes up the source media for the installation. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Media : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string cabinetField; - - private bool cabinetFieldSet; - - private CompressionLevelType compressionLevelField; - - private bool compressionLevelFieldSet; - - private string diskPromptField; - - private bool diskPromptFieldSet; - - private YesNoType embedCabField; - - private bool embedCabFieldSet; - - private string layoutField; - - private bool layoutFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private string volumeLabelField; - - private bool volumeLabelFieldSet; - - private string sourceField; - - private bool sourceFieldSet; - - private ISchemaElement parentElement; - - public Media() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalSignature))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchBaseline))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Disk identifier for Media table. This number must be equal to or greater than 1. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The name of the cabinet if some or all of the files stored on the media are in a cabinet file. If no cabinets are used, this attribute must not be set. - /// - public string Cabinet - { - get - { - return this.cabinetField; - } - set - { - this.cabinetFieldSet = true; - this.cabinetField = value; - } - } - - /// - /// Indicates the compression level for the Media's cabinet. This attribute can - /// only be used in conjunction with the Cabinet attribute. The default is 'mszip'. - /// - public CompressionLevelType CompressionLevel - { - get - { - return this.compressionLevelField; - } - set - { - this.compressionLevelFieldSet = true; - this.compressionLevelField = value; - } - } - - /// - /// The disk name, which is usually the visible text printed on the disk. This localizable text is used to prompt the user when this disk needs to be inserted. This value will be used in the "[1]" of the DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. - /// - public string DiskPrompt - { - get - { - return this.diskPromptField; - } - set - { - this.diskPromptFieldSet = true; - this.diskPromptField = value; - } - } - - /// - /// Instructs the binder to embed the cabinet in the product if 'yes'. This attribute can only be specified in conjunction with the Cabinet attribute. - /// - public YesNoType EmbedCab - { - get - { - return this.embedCabField; - } - set - { - this.embedCabFieldSet = true; - this.embedCabField = value; - } - } - - /// - /// This attribute specifies the root directory for the uncompressed files that - /// are a part of this Media element. By default, the src will be the output - /// directory for the final image. The default value ensures the binder generates - /// an installable image. If a relative path is specified in the src attribute, - /// the value will be appended to the image's output directory. If an absolute - /// path is provided, that path will be used without modification. The latter two - /// options are provided to ease the layout of an image onto multiple medias (CDs/DVDs). - /// - public string Layout - { - get - { - return this.layoutField; - } - set - { - this.layoutFieldSet = true; - this.layoutField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - /// - /// The label attributed to the volume. This is the volume label returned - /// by the GetVolumeInformation function. If the SourceDir property refers - /// to a removable (floppy or CD-ROM) volume, then this volume label is - /// used to verify that the proper disk is in the drive before attempting - /// to install files. The entry in this column must match the volume label - /// of the physical media. - /// - public string VolumeLabel - { - get - { - return this.volumeLabelField; - } - set - { - this.volumeLabelFieldSet = true; - this.volumeLabelField = value; - } - } - - /// - /// Optional property that identifies the source of the embedded cabinet. - /// If a cabinet is specified for a patch, this property should be defined - /// and unique to each patch so that the embedded cabinet containing patched - /// and new files can be located in the patch package. If the cabinet is not - /// embedded - this is not typical - the cabinet can be found in the directory - /// referenced in this column. If empty, the external cabinet must be located - /// in the SourceDir directory. - /// - public string Source - { - get - { - return this.sourceField; - } - set - { - this.sourceFieldSet = true; - this.sourceField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("DigitalSignature" == childName)) - { - childValue = new DigitalSignature(); - } - if (("PatchBaseline" == childName)) - { - childValue = new PatchBaseline(); - } - if (("SymbolPath" == childName)) - { - childValue = new SymbolPath(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Media", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.cabinetFieldSet) - { - writer.WriteAttributeString("Cabinet", this.cabinetField); - } - if (this.compressionLevelFieldSet) - { - if ((this.compressionLevelField == CompressionLevelType.high)) - { - writer.WriteAttributeString("CompressionLevel", "high"); - } - if ((this.compressionLevelField == CompressionLevelType.low)) - { - writer.WriteAttributeString("CompressionLevel", "low"); - } - if ((this.compressionLevelField == CompressionLevelType.medium)) - { - writer.WriteAttributeString("CompressionLevel", "medium"); - } - if ((this.compressionLevelField == CompressionLevelType.mszip)) - { - writer.WriteAttributeString("CompressionLevel", "mszip"); - } - if ((this.compressionLevelField == CompressionLevelType.none)) - { - writer.WriteAttributeString("CompressionLevel", "none"); - } - } - if (this.diskPromptFieldSet) - { - writer.WriteAttributeString("DiskPrompt", this.diskPromptField); - } - if (this.embedCabFieldSet) - { - if ((this.embedCabField == YesNoType.no)) - { - writer.WriteAttributeString("EmbedCab", "no"); - } - if ((this.embedCabField == YesNoType.yes)) - { - writer.WriteAttributeString("EmbedCab", "yes"); - } - } - if (this.layoutFieldSet) - { - writer.WriteAttributeString("Layout", this.layoutField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - if (this.volumeLabelFieldSet) - { - writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); - } - if (this.sourceFieldSet) - { - writer.WriteAttributeString("Source", this.sourceField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Cabinet" == name)) - { - this.cabinetField = value; - this.cabinetFieldSet = true; - } - if (("CompressionLevel" == name)) - { - this.compressionLevelField = Enums.ParseCompressionLevelType(value); - this.compressionLevelFieldSet = true; - } - if (("DiskPrompt" == name)) - { - this.diskPromptField = value; - this.diskPromptFieldSet = true; - } - if (("EmbedCab" == name)) - { - this.embedCabField = Enums.ParseYesNoType(value); - this.embedCabFieldSet = true; - } - if (("Layout" == name)) - { - this.layoutField = value; - this.layoutFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - if (("VolumeLabel" == name)) - { - this.volumeLabelField = value; - this.volumeLabelFieldSet = true; - } - if (("Source" == name)) - { - this.sourceField = value; - this.sourceFieldSet = true; - } - } - } - - /// - /// MediaTeplate element describes information to automatically assign files to cabinets. - /// A maximumum number of cabinets created is 999. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MediaTemplate : ISchemaElement, ISetAttributes - { - - private string cabinetTemplateField; - - private bool cabinetTemplateFieldSet; - - private CompressionLevelType compressionLevelField; - - private bool compressionLevelFieldSet; - - private string diskPromptField; - - private bool diskPromptFieldSet; - - private YesNoType embedCabField; - - private bool embedCabFieldSet; - - private string volumeLabelField; - - private bool volumeLabelFieldSet; - - private int maximumUncompressedMediaSizeField; - - private bool maximumUncompressedMediaSizeFieldSet; - - private int maximumCabinetSizeForLargeFileSplittingField; - - private bool maximumCabinetSizeForLargeFileSplittingFieldSet; - - private ISchemaElement parentElement; - - /// - /// Templated name of the cabinet if some or all of the files stored on the media are in - /// a cabinet file. This name must begin with either a letter or an underscore, contain - /// maximum of five characters and {0} in the cabinet name part and must end three character extension. - /// The default is cab{0}.cab. - /// - public string CabinetTemplate - { - get - { - return this.cabinetTemplateField; - } - set - { - this.cabinetTemplateFieldSet = true; - this.cabinetTemplateField = value; - } - } - - /// - /// Indicates the compression level for the Media's cabinet. This attribute can - /// only be used in conjunction with the Cabinet attribute. The default is 'mszip'. - /// - public CompressionLevelType CompressionLevel - { - get - { - return this.compressionLevelField; - } - set - { - this.compressionLevelFieldSet = true; - this.compressionLevelField = value; - } - } - - /// - /// The disk name, which is usually the visible text printed on the disk. This localizable text is used - /// to prompt the user when this disk needs to be inserted. This value will be used in the "[1]" of the - /// DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. - /// - public string DiskPrompt - { - get - { - return this.diskPromptField; - } - set - { - this.diskPromptFieldSet = true; - this.diskPromptField = value; - } - } - - /// - /// Instructs the binder to embed the cabinets in the product if 'yes'. - /// - public YesNoType EmbedCab - { - get - { - return this.embedCabField; - } - set - { - this.embedCabFieldSet = true; - this.embedCabField = value; - } - } - - /// - /// The label attributed to the volume. This is the volume label returned - /// by the GetVolumeInformation function. If the SourceDir property refers - /// to a removable (floppy or CD-ROM) volume, then this volume label is - /// used to verify that the proper disk is in the drive before attempting - /// to install files. The entry in this column must match the volume label - /// of the physical media. - /// - public string VolumeLabel - { - get - { - return this.volumeLabelField; - } - set - { - this.volumeLabelFieldSet = true; - this.volumeLabelField = value; - } - } - - /// - /// Size of uncompressed files in each cabinet, in megabytes. WIX_MUMS environment variable - /// can be used to override this value. Default value is 200 MB. - /// - public int MaximumUncompressedMediaSize - { - get - { - return this.maximumUncompressedMediaSizeField; - } - set - { - this.maximumUncompressedMediaSizeFieldSet = true; - this.maximumUncompressedMediaSizeField = value; - } - } - - /// - /// Maximum size of cabinet files in megabytes for large files. This attribute is used for packaging - /// files that are larger than MaximumUncompressedMediaSize into smaller cabinets. If cabinet size - /// exceed this value, then setting this attribute will cause the file to be split into multiple - /// cabinets of this maximum size. For simply controlling cabinet size without file splitting use - /// MaximumUncompressedMediaSize attribute. Setting this attribute will disable smart cabbing feature - /// for this Fragment / Package. Setting WIX_MCSLFS environment variable can be used to override this - /// value. Minimum allowed value of this attribute is 20 MB. Maximum allowed value and the Default - /// value of this attribute is 2048 MB (2 GB). - /// - public int MaximumCabinetSizeForLargeFileSplitting - { - get - { - return this.maximumCabinetSizeForLargeFileSplittingField; - } - set - { - this.maximumCabinetSizeForLargeFileSplittingFieldSet = true; - this.maximumCabinetSizeForLargeFileSplittingField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a CompressionLevelType from a string. - /// - public static CompressionLevelType ParseCompressionLevelType(string value) - { - CompressionLevelType parsedValue; - MediaTemplate.TryParseCompressionLevelType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a CompressionLevelType from a string. - /// - public static bool TryParseCompressionLevelType(string value, out CompressionLevelType parsedValue) - { - parsedValue = CompressionLevelType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("high" == value)) - { - parsedValue = CompressionLevelType.high; - } - else - { - if (("low" == value)) - { - parsedValue = CompressionLevelType.low; - } - else - { - if (("medium" == value)) - { - parsedValue = CompressionLevelType.medium; - } - else - { - if (("mszip" == value)) - { - parsedValue = CompressionLevelType.mszip; - } - else - { - if (("none" == value)) - { - parsedValue = CompressionLevelType.none; - } - else - { - parsedValue = CompressionLevelType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MediaTemplate", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.cabinetTemplateFieldSet) - { - writer.WriteAttributeString("CabinetTemplate", this.cabinetTemplateField); - } - if (this.compressionLevelFieldSet) - { - if ((this.compressionLevelField == CompressionLevelType.high)) - { - writer.WriteAttributeString("CompressionLevel", "high"); - } - if ((this.compressionLevelField == CompressionLevelType.low)) - { - writer.WriteAttributeString("CompressionLevel", "low"); - } - if ((this.compressionLevelField == CompressionLevelType.medium)) - { - writer.WriteAttributeString("CompressionLevel", "medium"); - } - if ((this.compressionLevelField == CompressionLevelType.mszip)) - { - writer.WriteAttributeString("CompressionLevel", "mszip"); - } - if ((this.compressionLevelField == CompressionLevelType.none)) - { - writer.WriteAttributeString("CompressionLevel", "none"); - } - } - if (this.diskPromptFieldSet) - { - writer.WriteAttributeString("DiskPrompt", this.diskPromptField); - } - if (this.embedCabFieldSet) - { - if ((this.embedCabField == YesNoType.no)) - { - writer.WriteAttributeString("EmbedCab", "no"); - } - if ((this.embedCabField == YesNoType.yes)) - { - writer.WriteAttributeString("EmbedCab", "yes"); - } - } - if (this.volumeLabelFieldSet) - { - writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); - } - if (this.maximumUncompressedMediaSizeFieldSet) - { - writer.WriteAttributeString("MaximumUncompressedMediaSize", this.maximumUncompressedMediaSizeField.ToString(CultureInfo.InvariantCulture)); - } - if (this.maximumCabinetSizeForLargeFileSplittingFieldSet) - { - writer.WriteAttributeString("MaximumCabinetSizeForLargeFileSplitting", this.maximumCabinetSizeForLargeFileSplittingField.ToString(CultureInfo.InvariantCulture)); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("CabinetTemplate" == name)) - { - this.cabinetTemplateField = value; - this.cabinetTemplateFieldSet = true; - } - if (("CompressionLevel" == name)) - { - this.compressionLevelField = MediaTemplate.ParseCompressionLevelType(value); - this.compressionLevelFieldSet = true; - } - if (("DiskPrompt" == name)) - { - this.diskPromptField = value; - this.diskPromptFieldSet = true; - } - if (("EmbedCab" == name)) - { - this.embedCabField = Enums.ParseYesNoType(value); - this.embedCabFieldSet = true; - } - if (("VolumeLabel" == name)) - { - this.volumeLabelField = value; - this.volumeLabelFieldSet = true; - } - if (("MaximumUncompressedMediaSize" == name)) - { - this.maximumUncompressedMediaSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.maximumUncompressedMediaSizeFieldSet = true; - } - if (("MaximumCabinetSizeForLargeFileSplitting" == name)) - { - this.maximumCabinetSizeForLargeFileSplittingField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.maximumCabinetSizeForLargeFileSplittingFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum CompressionLevelType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - high, - - low, - - medium, - - mszip, - - none, - } - } - - /// - /// This element has been deprecated. - /// Use the Binary/@SuppressModularization, CustomAction/@SuppressModularization, or Property/@SuppressModularization attributes instead. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IgnoreModularization : ISchemaElement, ISetAttributes - { - - private string nameField; - - private bool nameFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of the item to ignore modularization for. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// The type of the item to ignore modularization for. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - IgnoreModularization.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("Action" == value)) - { - parsedValue = TypeType.Action; - } - else - { - if (("Property" == value)) - { - parsedValue = TypeType.Property; - } - else - { - if (("Directory" == value)) - { - parsedValue = TypeType.Directory; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IgnoreModularization", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.Action)) - { - writer.WriteAttributeString("Type", "Action"); - } - if ((this.typeField == TypeType.Property)) - { - writer.WriteAttributeString("Type", "Property"); - } - if ((this.typeField == TypeType.Directory)) - { - writer.WriteAttributeString("Type", "Directory"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = IgnoreModularization.ParseTypeType(value); - this.typeFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - Action, - - Property, - - Directory, - } - } - - /// - /// Specifies a custom action to be added to the MSI CustomAction table. Various combinations of the attributes for this element - /// correspond to different custom action types. For more information about custom actions see the - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CustomAction : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string binaryKeyField; - - private bool binaryKeyFieldSet; - - private string fileKeyField; - - private bool fileKeyFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private string directoryField; - - private bool directoryFieldSet; - - private string dllEntryField; - - private bool dllEntryFieldSet; - - private string exeCommandField; - - private bool exeCommandFieldSet; - - private string jScriptCallField; - - private bool jScriptCallFieldSet; - - private string vBScriptCallField; - - private bool vBScriptCallFieldSet; - - private ScriptType scriptField; - - private bool scriptFieldSet; - - private YesNoType suppressModularizationField; - - private bool suppressModularizationFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private string errorField; - - private bool errorFieldSet; - - private ReturnType returnField; - - private bool returnFieldSet; - - private ExecuteType executeField; - - private bool executeFieldSet; - - private YesNoType impersonateField; - - private bool impersonateFieldSet; - - private YesNoType patchUninstallField; - - private bool patchUninstallFieldSet; - - private YesNoType win64Field; - - private bool win64FieldSet; - - private YesNoType terminalServerAwareField; - - private bool terminalServerAwareFieldSet; - - private YesNoType hideTargetField; - - private bool hideTargetFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the custom action. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// This attribute is a reference to a Binary element with matching Id attribute. That binary stream contains - /// the custom action for use during install. The custom action will not be installed into a target directory. This attribute is - /// typically used with the DllEntry attribute to specify the custom action DLL to use for a type 1 custom action, with the ExeCommand - /// attribute to specify a type 17 custom action that runs an embedded executable, or with the VBScriptCall or JScriptCall attributes - /// to specify a type 5 or 6 custom action. - /// - public string BinaryKey - { - get - { - return this.binaryKeyField; - } - set - { - this.binaryKeyFieldSet = true; - this.binaryKeyField = value; - } - } - - /// - /// This attribute specifies a reference to a File element with matching Id attribute that - /// will execute the custom action code in the file after the file is installed. This - /// attribute is typically used with the ExeCommand attribute to specify a type 18 custom action - /// that runs an installed executable, with the DllEntry attribute to specify an installed custom - /// action DLL to use for a type 17 custom action, or with the VBScriptCall or JScriptCall - /// attributes to specify a type 21 or 22 custom action. - /// - public string FileKey - { - get - { - return this.fileKeyField; - } - set - { - this.fileKeyFieldSet = true; - this.fileKeyField = value; - } - } - - /// - /// This attribute specifies a reference to a Property element with matching Id attribute that specifies the Property - /// to be used or updated on execution of this custom action. This attribute is - /// typically used with the Value attribute to create a type 51 custom action that parses - /// the text in Value and places it into the specified Property. This attribute is also used with - /// the ExeCommand attribute to create a type 50 custom action that uses the value of the - /// given property to specify the path to the executable. Type 51 custom actions are often useful to - /// pass values to a deferred custom action. - /// See - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// This attribute specifies a reference to a Directory element with matching Id attribute containing a directory path. - /// This attribute is typically used with the ExeCommand attribute to specify the source executable for a type 34 - /// custom action, or with the Value attribute to specify a formatted string to place in the specified Directory - /// table entry in a type 35 custom action. - /// - public string Directory - { - get - { - return this.directoryField; - } - set - { - this.directoryFieldSet = true; - this.directoryField = value; - } - } - - /// - /// This attribute specifies the name of a function in a custom action to execute. - /// This attribute is used with the BinaryKey attribute to create a type 1 custom - /// action, or with the FileKey attribute to create a type 17 custom action. - /// - public string DllEntry - { - get - { - return this.dllEntryField; - } - set - { - this.dllEntryFieldSet = true; - this.dllEntryField = value; - } - } - - /// - /// This attribute specifies the command line parameters to supply to an externally - /// run executable. This attribute is typically used with the BinaryKey attribute for a type 2 custom action, - /// the FileKey attribute for a type 18 custom action, the Property attribute for a type 50 custom action, - /// or the Directory attribute for a type 34 custom action that specify the executable to run. - /// - public string ExeCommand - { - get - { - return this.exeCommandField; - } - set - { - this.exeCommandFieldSet = true; - this.exeCommandField = value; - } - } - - /// - /// This attribute specifies the name of the JScript function to execute in a script. The script must be - /// provided in a Binary element identified by the BinaryKey attribute described above. In other words, this - /// attribute must be specified in conjunction with the BinaryKey attribute. - /// - public string JScriptCall - { - get - { - return this.jScriptCallField; - } - set - { - this.jScriptCallFieldSet = true; - this.jScriptCallField = value; - } - } - - /// - /// This attribute specifies the name of the VBScript Subroutine to execute in a script. The script must be - /// provided in a Binary element identified by the BinaryKey attribute described above. In other words, this - /// attribute must be specified in conjunction with the BinaryKey attribute. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public string VBScriptCall - { - get - { - return this.vBScriptCallField; - } - set - { - this.vBScriptCallFieldSet = true; - this.vBScriptCallField = value; - } - } - - /// - /// Creates a type 37 or 38 custom action. The text of the element should contain the script to be embedded in the package. - /// - public ScriptType Script - { - get - { - return this.scriptField; - } - set - { - this.scriptFieldSet = true; - this.scriptField = value; - } - } - - /// - /// Use to suppress modularization of this custom action name in merge modules. - /// This should only be necessary for table-driven custom actions because the - /// table name which they interact with cannot be modularized, so there can only - /// be one instance of the table. - /// - public YesNoType SuppressModularization - { - get - { - return this.suppressModularizationField; - } - set - { - this.suppressModularizationFieldSet = true; - this.suppressModularizationField = value; - } - } - - /// - /// This attribute specifies a string value to use in the custom action. This attribute - /// must be used with the Property attribute to set the property as part of a - /// type 51 custom action or with the Directory attribute to set a directory path in that - /// table in a type 35 custom action. The value can be a literal value or derived from a - /// Property element using the - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// This attribute specifies an index in the MSI Error table to use as an error message for a - /// type 19 custom action that displays the error message and aborts a product's installation. - /// - public string Error - { - get - { - return this.errorField; - } - set - { - this.errorFieldSet = true; - this.errorField = value; - } - } - - /// - /// Set this attribute to set the return behavior of the custom action. - /// - public ReturnType Return - { - get - { - return this.returnField; - } - set - { - this.returnFieldSet = true; - this.returnField = value; - } - } - - /// - /// This attribute indicates the scheduling of the custom action. - /// - public ExecuteType Execute - { - get - { - return this.executeField; - } - set - { - this.executeFieldSet = true; - this.executeField = value; - } - } - - /// - /// This attribute specifies whether the Windows Installer, which executes as LocalSystem, - /// should impersonate the user context of the installing user when executing this custom action. - /// Typically the value should be 'yes', except when the custom action needs elevated privileges - /// to apply changes to the machine. - /// - public YesNoType Impersonate - { - get - { - return this.impersonateField; - } - set - { - this.impersonateFieldSet = true; - this.impersonateField = value; - } - } - - /// - /// This attribute specifies that the Windows Installer, execute the custom action only when - /// a patch is being uninstalled. These custom actions should also be conditioned using the - /// MSIPATCHREMOVE property to ensure proper down level (less than Windows Installer 4.5) - /// behavior. - /// - public YesNoType PatchUninstall - { - get - { - return this.patchUninstallField; - } - set - { - this.patchUninstallFieldSet = true; - this.patchUninstallField = value; - } - } - - /// - /// Specifies that a script custom action targets a 64-bit platform. Valid only when used with - /// the Script, VBScriptCall, and JScriptCall attributes. - /// The default value is based on the platform set by the -arch switch to candle.exe - /// or the InstallerPlatform property in a .wixproj MSBuild project: - /// For x86 and ARM, the default value is 'no'. - /// For x64 and IA64, the default value is 'yes'. - /// - public YesNoType Win64 - { - get - { - return this.win64Field; - } - set - { - this.win64FieldSet = true; - this.win64Field = value; - } - } - - /// - /// This attribute specifies controls whether the custom action will impersonate the - /// installing user during per-machine installs on Terminal Server machines. - /// Deferred execution custom actions that do not specify this attribute, or explicitly set it 'no', - /// will run with no user impersonation on Terminal Server machines during - /// per-machine installations. This attribute is only applicable when installing on the - /// Windows Server 2003 family. - /// - public YesNoType TerminalServerAware - { - get - { - return this.terminalServerAwareField; - } - set - { - this.terminalServerAwareFieldSet = true; - this.terminalServerAwareField = value; - } - } - - /// - /// Ensures the installer does not log the CustomActionData for the deferred custom action. - /// - public YesNoType HideTarget - { - get - { - return this.hideTargetField; - } - set - { - this.hideTargetFieldSet = true; - this.hideTargetField = value; - } - } - - /// - /// The text node is only valid if the Script attribute is specified. In that case, the text node contains the script to embed. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ScriptType from a string. - /// - public static ScriptType ParseScriptType(string value) - { - ScriptType parsedValue; - CustomAction.TryParseScriptType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ScriptType from a string. - /// - public static bool TryParseScriptType(string value, out ScriptType parsedValue) - { - parsedValue = ScriptType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("jscript" == value)) - { - parsedValue = ScriptType.jscript; - } - else - { - if (("vbscript" == value)) - { - parsedValue = ScriptType.vbscript; - } - else - { - parsedValue = ScriptType.IllegalValue; - return false; - } - } - return true; - } - - /// - /// Parses a ReturnType from a string. - /// - public static ReturnType ParseReturnType(string value) - { - ReturnType parsedValue; - CustomAction.TryParseReturnType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ReturnType from a string. - /// - public static bool TryParseReturnType(string value, out ReturnType parsedValue) - { - parsedValue = ReturnType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("asyncNoWait" == value)) - { - parsedValue = ReturnType.asyncNoWait; - } - else - { - if (("asyncWait" == value)) - { - parsedValue = ReturnType.asyncWait; - } - else - { - if (("check" == value)) - { - parsedValue = ReturnType.check; - } - else - { - if (("ignore" == value)) - { - parsedValue = ReturnType.ignore; - } - else - { - parsedValue = ReturnType.IllegalValue; - return false; - } - } - } - } - return true; - } - - /// - /// Parses a ExecuteType from a string. - /// - public static ExecuteType ParseExecuteType(string value) - { - ExecuteType parsedValue; - CustomAction.TryParseExecuteType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ExecuteType from a string. - /// - public static bool TryParseExecuteType(string value, out ExecuteType parsedValue) - { - parsedValue = ExecuteType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("commit" == value)) - { - parsedValue = ExecuteType.commit; - } - else - { - if (("deferred" == value)) - { - parsedValue = ExecuteType.deferred; - } - else - { - if (("firstSequence" == value)) - { - parsedValue = ExecuteType.firstSequence; - } - else - { - if (("immediate" == value)) - { - parsedValue = ExecuteType.immediate; - } - else - { - if (("oncePerProcess" == value)) - { - parsedValue = ExecuteType.oncePerProcess; - } - else - { - if (("rollback" == value)) - { - parsedValue = ExecuteType.rollback; - } - else - { - if (("secondSequence" == value)) - { - parsedValue = ExecuteType.secondSequence; - } - else - { - parsedValue = ExecuteType.IllegalValue; - return false; - } - } - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CustomAction", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.binaryKeyFieldSet) - { - writer.WriteAttributeString("BinaryKey", this.binaryKeyField); - } - if (this.fileKeyFieldSet) - { - writer.WriteAttributeString("FileKey", this.fileKeyField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.directoryFieldSet) - { - writer.WriteAttributeString("Directory", this.directoryField); - } - if (this.dllEntryFieldSet) - { - writer.WriteAttributeString("DllEntry", this.dllEntryField); - } - if (this.exeCommandFieldSet) - { - writer.WriteAttributeString("ExeCommand", this.exeCommandField); - } - if (this.jScriptCallFieldSet) - { - writer.WriteAttributeString("JScriptCall", this.jScriptCallField); - } - if (this.vBScriptCallFieldSet) - { - writer.WriteAttributeString("VBScriptCall", this.vBScriptCallField); - } - if (this.scriptFieldSet) - { - if ((this.scriptField == ScriptType.jscript)) - { - writer.WriteAttributeString("Script", "jscript"); - } - if ((this.scriptField == ScriptType.vbscript)) - { - writer.WriteAttributeString("Script", "vbscript"); - } - } - if (this.suppressModularizationFieldSet) - { - if ((this.suppressModularizationField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressModularization", "no"); - } - if ((this.suppressModularizationField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressModularization", "yes"); - } - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.errorFieldSet) - { - writer.WriteAttributeString("Error", this.errorField); - } - if (this.returnFieldSet) - { - if ((this.returnField == ReturnType.asyncNoWait)) - { - writer.WriteAttributeString("Return", "asyncNoWait"); - } - if ((this.returnField == ReturnType.asyncWait)) - { - writer.WriteAttributeString("Return", "asyncWait"); - } - if ((this.returnField == ReturnType.check)) - { - writer.WriteAttributeString("Return", "check"); - } - if ((this.returnField == ReturnType.ignore)) - { - writer.WriteAttributeString("Return", "ignore"); - } - } - if (this.executeFieldSet) - { - if ((this.executeField == ExecuteType.commit)) - { - writer.WriteAttributeString("Execute", "commit"); - } - if ((this.executeField == ExecuteType.deferred)) - { - writer.WriteAttributeString("Execute", "deferred"); - } - if ((this.executeField == ExecuteType.firstSequence)) - { - writer.WriteAttributeString("Execute", "firstSequence"); - } - if ((this.executeField == ExecuteType.immediate)) - { - writer.WriteAttributeString("Execute", "immediate"); - } - if ((this.executeField == ExecuteType.oncePerProcess)) - { - writer.WriteAttributeString("Execute", "oncePerProcess"); - } - if ((this.executeField == ExecuteType.rollback)) - { - writer.WriteAttributeString("Execute", "rollback"); - } - if ((this.executeField == ExecuteType.secondSequence)) - { - writer.WriteAttributeString("Execute", "secondSequence"); - } - } - if (this.impersonateFieldSet) - { - if ((this.impersonateField == YesNoType.no)) - { - writer.WriteAttributeString("Impersonate", "no"); - } - if ((this.impersonateField == YesNoType.yes)) - { - writer.WriteAttributeString("Impersonate", "yes"); - } - } - if (this.patchUninstallFieldSet) - { - if ((this.patchUninstallField == YesNoType.no)) - { - writer.WriteAttributeString("PatchUninstall", "no"); - } - if ((this.patchUninstallField == YesNoType.yes)) - { - writer.WriteAttributeString("PatchUninstall", "yes"); - } - } - if (this.win64FieldSet) - { - if ((this.win64Field == YesNoType.no)) - { - writer.WriteAttributeString("Win64", "no"); - } - if ((this.win64Field == YesNoType.yes)) - { - writer.WriteAttributeString("Win64", "yes"); - } - } - if (this.terminalServerAwareFieldSet) - { - if ((this.terminalServerAwareField == YesNoType.no)) - { - writer.WriteAttributeString("TerminalServerAware", "no"); - } - if ((this.terminalServerAwareField == YesNoType.yes)) - { - writer.WriteAttributeString("TerminalServerAware", "yes"); - } - } - if (this.hideTargetFieldSet) - { - if ((this.hideTargetField == YesNoType.no)) - { - writer.WriteAttributeString("HideTarget", "no"); - } - if ((this.hideTargetField == YesNoType.yes)) - { - writer.WriteAttributeString("HideTarget", "yes"); - } - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("BinaryKey" == name)) - { - this.binaryKeyField = value; - this.binaryKeyFieldSet = true; - } - if (("FileKey" == name)) - { - this.fileKeyField = value; - this.fileKeyFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("Directory" == name)) - { - this.directoryField = value; - this.directoryFieldSet = true; - } - if (("DllEntry" == name)) - { - this.dllEntryField = value; - this.dllEntryFieldSet = true; - } - if (("ExeCommand" == name)) - { - this.exeCommandField = value; - this.exeCommandFieldSet = true; - } - if (("JScriptCall" == name)) - { - this.jScriptCallField = value; - this.jScriptCallFieldSet = true; - } - if (("VBScriptCall" == name)) - { - this.vBScriptCallField = value; - this.vBScriptCallFieldSet = true; - } - if (("Script" == name)) - { - this.scriptField = CustomAction.ParseScriptType(value); - this.scriptFieldSet = true; - } - if (("SuppressModularization" == name)) - { - this.suppressModularizationField = Enums.ParseYesNoType(value); - this.suppressModularizationFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Error" == name)) - { - this.errorField = value; - this.errorFieldSet = true; - } - if (("Return" == name)) - { - this.returnField = CustomAction.ParseReturnType(value); - this.returnFieldSet = true; - } - if (("Execute" == name)) - { - this.executeField = CustomAction.ParseExecuteType(value); - this.executeFieldSet = true; - } - if (("Impersonate" == name)) - { - this.impersonateField = Enums.ParseYesNoType(value); - this.impersonateFieldSet = true; - } - if (("PatchUninstall" == name)) - { - this.patchUninstallField = Enums.ParseYesNoType(value); - this.patchUninstallFieldSet = true; - } - if (("Win64" == name)) - { - this.win64Field = Enums.ParseYesNoType(value); - this.win64FieldSet = true; - } - if (("TerminalServerAware" == name)) - { - this.terminalServerAwareField = Enums.ParseYesNoType(value); - this.terminalServerAwareFieldSet = true; - } - if (("HideTarget" == name)) - { - this.hideTargetField = Enums.ParseYesNoType(value); - this.hideTargetFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ScriptType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - jscript, - - vbscript, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ReturnType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Indicates that the custom action will run asyncronously and execution may continue after the installer terminates. - /// - asyncNoWait, - - /// - /// Indicates that the custom action will run asynchronously but the installer will wait for the return code at sequence end. - /// - asyncWait, - - /// - /// Indicates that the custom action will run synchronously and the return code will be checked for success. This is the default. - /// - check, - - /// - /// Indicates that the custom action will run synchronously and the return code will not be checked. - /// - ignore, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ExecuteType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Indicates that the custom action will run after successful completion of the installation script (at the end of the installation). - /// - commit, - - /// - /// Indicates that the custom action runs in-script (possibly with elevated privileges). - /// - deferred, - - /// - /// Indicates that the custom action will only run in the first sequence that runs it. - /// - firstSequence, - - /// - /// Indicates that the custom action will run during normal processing time with user privileges. This is the default. - /// - immediate, - - /// - /// Indicates that the custom action will only run in the first sequence that runs it in the same process. - /// - oncePerProcess, - - /// - /// Indicates that a custom action will run in the rollback sequence when a failure - /// occurs during installation, usually to undo changes made by a deferred custom action. - /// - rollback, - - /// - /// Indicates that a custom action should be run a second time if it was previously run in an earlier sequence. - /// - secondSequence, - } - } - - /// - /// This will cause the entire contents of the Fragment containing the referenced CustomAction to be - /// included in the installer database. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CustomActionRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the CustomAction to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CustomActionRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Sets a Directory to a particular value. This is accomplished by creating a Type 51 custom action that is appropriately scheduled in - /// the InstallUISequence and InstallExecuteSequence. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SetDirectory : ISchemaElement, ISetAttributes - { - - private string actionField; - - private bool actionFieldSet; - - private string idField; - - private bool idFieldSet; - - private SequenceType sequenceField; - - private bool sequenceFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// By default the action is "Set" + Id attribute's value. This optional attribute can override the action name in the case - /// where multiple SetDirectory elements target the same Id (probably with mutually exclusive conditions). - /// - public string Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// This attribute specifies a reference to a Directory element with matching Id attribute. The path of the Directory will be set to - /// the Value attribute. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Controls which sequences the Directory assignment is sequenced in. - /// For 'execute', the assignment is scheduled in the InstallExecuteSequence. - /// For 'ui', the assignment is scheduled in the InstallUISequence. - /// For 'first', the assignment is scheduled in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped at install time. - /// For 'both', the assignment is scheduled in both the InstallUISequence and the InstallExecuteSequence. - /// The default is 'both'. - /// - public SequenceType Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// This attribute specifies a string value to assign to the Directory. The value can be a literal value or derived from a - /// Property element using the - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// The condition that determines whether the Directory is set. If the condition evaluates to false, the SetDirectory is skipped. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SetDirectory", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.actionFieldSet) - { - writer.WriteAttributeString("Action", this.actionField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sequenceFieldSet) - { - if ((this.sequenceField == SequenceType.both)) - { - writer.WriteAttributeString("Sequence", "both"); - } - if ((this.sequenceField == SequenceType.first)) - { - writer.WriteAttributeString("Sequence", "first"); - } - if ((this.sequenceField == SequenceType.execute)) - { - writer.WriteAttributeString("Sequence", "execute"); - } - if ((this.sequenceField == SequenceType.ui)) - { - writer.WriteAttributeString("Sequence", "ui"); - } - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Action" == name)) - { - this.actionField = value; - this.actionFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Enums.ParseSequenceType(value); - this.sequenceFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Sets a Property to a particular value. This is accomplished by creating a Type 51 custom action that is appropriately scheduled in - /// the InstallUISequence and InstallExecuteSequence. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SetProperty : ISchemaElement, ISetAttributes - { - - private string actionField; - - private bool actionFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private string beforeField; - - private bool beforeFieldSet; - - private string idField; - - private bool idFieldSet; - - private SequenceType sequenceField; - - private bool sequenceFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// By default the action is "Set" + Id attribute's value. This optional attribute can override the action name in the case - /// where multiple SetProperty elements target the same Id (probably with mutually exclusive conditions). - /// - public string Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// The name of the standard or custom action after which this action should be performed. Mutually exclusive with the Before attribute. A Before or After attribute is required when setting a Property. - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// The name of the standard or custom action before which this action should be performed. Mutually exclusive with the After attribute. A Before or After attribute is required when setting a Property. - /// - public string Before - { - get - { - return this.beforeField; - } - set - { - this.beforeFieldSet = true; - this.beforeField = value; - } - } - - /// - /// This attribute specifies the Property to set to the Value. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Controls which sequences the Property assignment is sequenced in. - /// For 'execute', the assignment is scheduled in the InstallExecuteSequence. - /// For 'ui', the assignment is scheduled in the InstallUISequence. - /// For 'first', the assignment is scheduled in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped at install time. - /// For 'both', the assignment is scheduled in both the InstallUISequence and the InstallExecuteSequence. - /// The default is 'both'. - /// - public SequenceType Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// This attribute specifies a string value to assign to the Property. The value can be a literal value or derived from a - /// Property element using the - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// The condition that determines whether the Property is set. If the condition evaluates to false, the Set is skipped. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SetProperty", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.actionFieldSet) - { - writer.WriteAttributeString("Action", this.actionField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.beforeFieldSet) - { - writer.WriteAttributeString("Before", this.beforeField); - } - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sequenceFieldSet) - { - if ((this.sequenceField == SequenceType.both)) - { - writer.WriteAttributeString("Sequence", "both"); - } - if ((this.sequenceField == SequenceType.first)) - { - writer.WriteAttributeString("Sequence", "first"); - } - if ((this.sequenceField == SequenceType.execute)) - { - writer.WriteAttributeString("Sequence", "execute"); - } - if ((this.sequenceField == SequenceType.ui)) - { - writer.WriteAttributeString("Sequence", "ui"); - } - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Action" == name)) - { - this.actionField = value; - this.actionFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Before" == name)) - { - this.beforeField = value; - this.beforeFieldSet = true; - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Enums.ParseSequenceType(value); - this.sequenceFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// This will cause the entire contents of the Fragment containing the referenced PatchFamily to be - /// used in the process of creating a patch. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchFamilyRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string productCodeField; - - private bool productCodeFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the PatchFamily to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Specifies the ProductCode of the product that this family applies to. - /// - public string ProductCode - { - get - { - return this.productCodeField; - } - set - { - this.productCodeFieldSet = true; - this.productCodeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchFamilyRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.productCodeFieldSet) - { - writer.WriteAttributeString("ProductCode", this.productCodeField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("ProductCode" == name)) - { - this.productCodeField = value; - this.productCodeFieldSet = true; - } - } - } - - /// - /// Sets the ProductID property to the full product identifier. This action must be sequenced before the user interface wizard in the InstallUISequence table and before the RegisterUser action in the InstallExecuteSequence table. If the product identifier has already been validated successfully, the ValidateProductID action does nothing. The ValidateProductID action always returns a success, whether or not the product identifier is valid, so that the product identifier can be entered on the command line the first time the product is run. The product identifier can be validated without having the user reenter this information by setting the PIDKEY property on the command line or by using a transform. The display of the dialog box requesting the user to enter the product identifier can then be made conditional upon the presence of the ProductID property, which is set when the PIDKEY property is validated. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ValidateProductID : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ValidateProductID", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Initiates the internal installation costing process. Any standard or custom actions that affect costing should be sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action. Then call the CostFinalize action following the CostInitialize action to make all final cost calculations available to the installer through the Component table. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CostInitialize : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CostInitialize", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Initiates dynamic costing of standard installation actions. Any standard or custom actions that affect costing should sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action. Then call the CostFinalize action following the FileCost action to make all final cost calculations available to the installer through the Component table. The CostInitialize action must be executed before the FileCost action. The installer then determines the disk-space cost of every file in the File table, on a per-component basis, taking both volume clustering and the presence of existing files that may need to be overwritten into account. All actions that consume or release disk space are also considered. If an existing file is found, a file version check is performed to determine whether the new file actually needs to be installed or not. If the existing file is of an equal or greater version number, the existing file is not overwritten and no disk-space cost is incurred. In all cases, the installer uses the results of version number checking to set the installation state of each file. The FileCost action initializes cost calculation with the installer. Actual dynamic costing does not occur until the CostFinalize action is executed. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FileCost : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FileCost", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Installs a copy of a component (commonly a shared DLL) into a private location for use by a specific application (typically an .exe). This isolates the application from other copies of the component that may be installed to a shared location on the computer. The action refers to each record of the IsolatedComponent table and associates the files of the component listed in the Component_Shared field with the component listed in the Component_Application field. The installer installs the files of Component_Shared into the same directory as Component_Application. The installer generates a file in this directory, zero bytes in length, having the short filename name of the key file for Component_Application (typically this is the same file name as the .exe) appended with .local. The IsolatedComponent action does not affect the installation of Component_Application. Uninstalling Component_Application also removes the Component_Shared files and the .local file from the directory. The IsolateComponents action can be used only in the InstallUISequence table and the InstallExecuteSequence table. This action must come after the CostInitialize action and before the CostFinalize action. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class IsolateComponents : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("IsolateComponents", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Ends the internal installation costing process begun by the CostInitialize action. Any standard or custom actions that affect costing should be sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action and then call the CostFinalize action to make all final cost calculations available to the installer through the Component table. The CostFinalize action must be executed before starting any user interface sequence which allows the user to view or modify Feature table selections or directories. The CostFinalize action queries the Condition table to determine which features are scheduled to be installed. Costing is done for each component in the Component table. The CostFinalize action also verifies that all the target directories are writable before allowing the installation to continue. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CostFinalize : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CostFinalize", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Checks for existing ODBC drivers and sets the target directory for each new driver to the location of an existing driver. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SetODBCFolders : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SetODBCFolders", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Used for upgrading or installing over an existing application. Reads feature states from existing application and sets these feature states for the pending installation. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MigrateFeatureStates : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MigrateFeatureStates", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Initiates the execution sequence. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ExecuteAction : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ExecuteAction", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Verifies that all costed volumes have enough space for the installation. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallValidate : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallValidate", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Marks the beginning of a sequence of actions that change the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallInitialize : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallInitialize", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Ensures the needed amount of space exists in the registry. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AllocateRegistrySpace : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AllocateRegistrySpace", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers and unregisters components, their key paths, and the component clients. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ProcessComponents : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProcessComponents", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the unadvertisement of components listed in the PublishComponent table. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnpublishComponents : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnpublishComponents", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the unadvertisement of CLR and Win32 assemblies that are being removed. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MsiUnpublishAssemblies : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MsiUnpublishAssemblies", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes selection-state and feature-component mapping information from the registry. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnpublishFeatures : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnpublishFeatures", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Stops system services. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class StopServices : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("StopServices", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Stops a service and removes its registration from the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DeleteServices : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DeleteServices", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes COM+ applications from the registry. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnregisterComPlus : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnregisterComPlus", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Unregisters all modules listed in the SelfReg table that are scheduled to be uninstalled. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SelfUnregModules : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SelfUnregModules", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Unregisters type libraries from the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnregisterTypeLibraries : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnregisterTypeLibraries", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes the data sources, translators, and drivers listed for removal during the installation. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveODBC : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveODBC", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes registration information about installed fonts from the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnregisterFonts : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnregisterFonts", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes a registry value that has been authored into the registry table if the associated component was installed locally or as run from source, and is now set to be uninstalled. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveRegistryValues : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveRegistryValues", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the removal of COM class information from the system registry. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnregisterClassInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnregisterClassInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the removal of extension-related information from the system registry. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnregisterExtensionInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnregisterExtensionInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the unregistration of OLE ProgId information with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnregisterProgIdInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnregisterProgIdInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Unregisters MIME-related registry information from the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UnregisterMIMEInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UnregisterMIMEInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes .ini file information specified for removal in the RemoveIniFile table if the component is set to be installed locally or run from source. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveIniValues : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveIniValues", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the removal of an advertised shortcut whose feature is selected for uninstallation or a nonadvertised shortcut whose component is selected for uninstallation. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveShortcuts : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveShortcuts", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Modifies the values of environment variables. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveEnvironmentStrings : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveEnvironmentStrings", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Deletes files installed by the DuplicateFiles action. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveDuplicateFiles : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveDuplicateFiles", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes files previously installed by the InstallFiles action. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveFiles : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveFiles", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Removes any folders linked to components set to be removed or run from source. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveFolders : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveFolders", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Creates empty folders for components that are set to be installed. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CreateFolders : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CreateFolders", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Locates existing files on the system and moves or copies those files to a new location. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MoveFiles : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MoveFiles", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Copies the product database to the administrative installation point. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallAdminPackage : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallAdminPackage", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Copies files specified in the File table from the source directory to the destination directory. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallFiles : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallFiles", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Duplicates files installed by the InstallFiles action. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DuplicateFiles : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DuplicateFiles", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Queries the Patch table to determine which patches are to be applied. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PatchFiles : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PatchFiles", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Binds each executable or DLL that must be bound to the DLLs imported by it. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class BindImage : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("BindImage", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the creation of shortcuts. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CreateShortcuts : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CreateShortcuts", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the registration of COM class information with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterClassInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterClassInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the registration of extension related information with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterExtensionInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterExtensionInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the registration of OLE ProgId information with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterProgIdInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterProgIdInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers MIME-related registry information with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterMIMEInfo : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterMIMEInfo", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Sets up an application's registry information. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class WriteRegistryValues : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WriteRegistryValues", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Writes the .ini file information that the application needs written to its .ini files. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class WriteIniValues : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WriteIniValues", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Modifies the values of environment variables. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class WriteEnvironmentStrings : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WriteEnvironmentStrings", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers installed fonts with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterFonts : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterFonts", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Installs the drivers, translators, and data sources in the ODBCDriver table, ODBCTranslator table, and ODBCDataSource table. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallODBC : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallODBC", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers type libraries with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterTypeLibraries : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterTypeLibraries", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Processes all modules listed in the SelfReg table and registers all installed modules with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class SelfRegModules : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("SelfRegModules", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers COM+ applications. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterComPlus : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterComPlus", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers a service for the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallServices : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallServices", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Starts system services. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class StartServices : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("StartServices", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers the user information with the installer to identify the user of a product. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterUser : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterUser", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Registers the product information with the installer. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RegisterProduct : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RegisterProduct", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the advertisement of the components from the PublishComponent table. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PublishComponents : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PublishComponents", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the advertisement of CLR and Win32 assemblies. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MsiPublishAssemblies : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MsiPublishAssemblies", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Writes each feature's state into the system registry. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PublishFeatures : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PublishFeatures", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Manages the advertisement of the product information with the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class PublishProduct : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("PublishProduct", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Marks the end of a sequence of actions that change the system. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallFinalize : ActionSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallFinalize", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Uses file signatures to search for existing versions of products. The AppSearch action may use this information to determine where upgrades are to be installed. The AppSearch action can also be used to set a property to the existing value of an registry or .ini file entry. AppSearch should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents The AppSearch action from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The AppSearch action searches for file signatures using the CompLocator table first, the RegLocator table next, then the IniLocator table, and finally the DrLocator table. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AppSearch : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AppSearch", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Uses file signatures to validate that qualifying products are installed on a system before an upgrade installation is performed. The CCPSearch action should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents the CCPSearch action from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The CCPSearch action must come before the RMCCPSearch action. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CCPSearch : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CCPSearch", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Uses file signatures to validate that qualifying products are installed on a system before an upgrade installation is performed. The RMCCPSearch action should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents RMCCPSearch from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The RMCCPSearch action requires the CCP_DRIVE property to be set to the root path on the removable volume that has the installation for any of the qualifying products. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RMCCPSearch : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RMCCPSearch", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Queries the LaunchCondition table and evaluates each conditional statement recorded there. If any of these conditional statements fail, an error message is displayed to the user and the installation is terminated. The LaunchConditions action is optional. This action is normally the first in the sequence, but the AppSearch Action may be sequenced before the LaunchConditions action. If there are launch conditions that do not apply to all installation modes, the appropriate installation mode property should be used in a conditional expression in the appropriate sequence table. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class LaunchConditions : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("LaunchConditions", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Runs through each record of the Upgrade table in sequence and compares the upgrade code, product version, and language in each row to products installed on the system. When FindRelatedProducts detects a correspondence between the upgrade information and an installed product, it appends the product code to the property specified in the ActionProperty column of the UpgradeTable. The FindRelatedProducts action only runs the first time the product is installed. The FindRelatedProducts action does not run during maintenance mode or uninstallation. FindRelatedProducts should be authored into the InstallUISequence table and InstallExecuteSequence tables. The installer prevents FindRelatedProducts from running in InstallExecuteSequence if the action has already run in InstallUISequence. The FindRelatedProducts action must come before the MigrateFeatureStates action and the RemoveExistingProducts action. The condition for this action may be specified in the element's inner text. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class FindRelatedProducts : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("FindRelatedProducts", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Runs a script containing all operations spooled since either the start of the installation or the last InstallExecute action, or InstallExecuteAgain action. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallExecute : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallExecute", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Runs a script containing all operations spooled since either the start of the installation or the last InstallExecute action, or InstallExecuteAgain action. Should only be used after InstallExecute. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallExecuteAgain : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallExecuteAgain", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Disables rollback for the remainder of the installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DisableRollback : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DisableRollback", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Goes through the product codes listed in the ActionProperty column of the Upgrade table and removes the products in sequence. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RemoveExistingProducts : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RemoveExistingProducts", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Prompts the user to restart the system at the end of installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ScheduleReboot : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ScheduleReboot", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Prompts the user for a restart of the system during the installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ForceReboot : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ForceReboot", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Determines the location of the source and sets the SourceDir property if the source has not been resolved yet. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ResolveSource : ActionModuleSequenceType, ISchemaElement - { - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public override void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ResolveSource", "http://wixtoolset.org/schemas/v4/wxs"); - base.OutputXml(writer); - writer.WriteEndElement(); - } - } - - /// - /// Use to sequence a custom action. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Custom : ISchemaElement, ISetAttributes - { - - private string actionField; - - private bool actionFieldSet; - - private ExitType onExitField; - - private bool onExitFieldSet; - - private string beforeField; - - private bool beforeFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private YesNoType overridableField; - - private bool overridableFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// The action to which the Custom element applies. - /// - public string Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// Mutually exclusive with Before, After, and Sequence attributes - /// - public ExitType OnExit - { - get - { - return this.onExitField; - } - set - { - this.onExitFieldSet = true; - this.onExitField = value; - } - } - - /// - /// The name of the standard or custom action before which this action should be performed. Mutually exclusive with OnExit, After, and Sequence attributes - /// - public string Before - { - get - { - return this.beforeField; - } - set - { - this.beforeFieldSet = true; - this.beforeField = value; - } - } - - /// - /// The name of the standard or custom action after which this action should be performed. Mutually exclusive with Before, OnExit, and Sequence attributes - /// - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// If "yes", the sequencing of this action may be overridden by sequencing elsewhere. - /// - public YesNoType Overridable - { - get - { - return this.overridableField; - } - set - { - this.overridableFieldSet = true; - this.overridableField = value; - } - } - - /// - /// The sequence number for this action. Mutually exclusive with Before, After, and OnExit attributes - /// - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - /// - /// Text node specifies the condition of the action. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Custom", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.actionFieldSet) - { - writer.WriteAttributeString("Action", this.actionField); - } - if (this.onExitFieldSet) - { - if ((this.onExitField == ExitType.success)) - { - writer.WriteAttributeString("OnExit", "success"); - } - if ((this.onExitField == ExitType.cancel)) - { - writer.WriteAttributeString("OnExit", "cancel"); - } - if ((this.onExitField == ExitType.error)) - { - writer.WriteAttributeString("OnExit", "error"); - } - if ((this.onExitField == ExitType.suspend)) - { - writer.WriteAttributeString("OnExit", "suspend"); - } - } - if (this.beforeFieldSet) - { - writer.WriteAttributeString("Before", this.beforeField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.overridableFieldSet) - { - if ((this.overridableField == YesNoType.no)) - { - writer.WriteAttributeString("Overridable", "no"); - } - if ((this.overridableField == YesNoType.yes)) - { - writer.WriteAttributeString("Overridable", "yes"); - } - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Action" == name)) - { - this.actionField = value; - this.actionFieldSet = true; - } - if (("OnExit" == name)) - { - this.onExitField = Enums.ParseExitType(value); - this.onExitFieldSet = true; - } - if (("Before" == name)) - { - this.beforeField = value; - this.beforeFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Overridable" == name)) - { - this.overridableField = Enums.ParseYesNoType(value); - this.overridableFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Show : ISchemaElement, ISetAttributes - { - - private string dialogField; - - private bool dialogFieldSet; - - private ExitType onExitField; - - private bool onExitFieldSet; - - private string beforeField; - - private bool beforeFieldSet; - - private string afterField; - - private bool afterFieldSet; - - private YesNoType overridableField; - - private bool overridableFieldSet; - - private int sequenceField; - - private bool sequenceFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - public string Dialog - { - get - { - return this.dialogField; - } - set - { - this.dialogFieldSet = true; - this.dialogField = value; - } - } - - /// - /// mutually exclusive with Before, After, and Sequence attributes - /// - public ExitType OnExit - { - get - { - return this.onExitField; - } - set - { - this.onExitFieldSet = true; - this.onExitField = value; - } - } - - public string Before - { - get - { - return this.beforeField; - } - set - { - this.beforeFieldSet = true; - this.beforeField = value; - } - } - - public string After - { - get - { - return this.afterField; - } - set - { - this.afterFieldSet = true; - this.afterField = value; - } - } - - /// - /// If "yes", the sequencing of this dialog may be overridden by sequencing elsewhere. - /// - public YesNoType Overridable - { - get - { - return this.overridableField; - } - set - { - this.overridableFieldSet = true; - this.overridableField = value; - } - } - - public int Sequence - { - get - { - return this.sequenceField; - } - set - { - this.sequenceFieldSet = true; - this.sequenceField = value; - } - } - - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Show", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.dialogFieldSet) - { - writer.WriteAttributeString("Dialog", this.dialogField); - } - if (this.onExitFieldSet) - { - if ((this.onExitField == ExitType.success)) - { - writer.WriteAttributeString("OnExit", "success"); - } - if ((this.onExitField == ExitType.cancel)) - { - writer.WriteAttributeString("OnExit", "cancel"); - } - if ((this.onExitField == ExitType.error)) - { - writer.WriteAttributeString("OnExit", "error"); - } - if ((this.onExitField == ExitType.suspend)) - { - writer.WriteAttributeString("OnExit", "suspend"); - } - } - if (this.beforeFieldSet) - { - writer.WriteAttributeString("Before", this.beforeField); - } - if (this.afterFieldSet) - { - writer.WriteAttributeString("After", this.afterField); - } - if (this.overridableFieldSet) - { - if ((this.overridableField == YesNoType.no)) - { - writer.WriteAttributeString("Overridable", "no"); - } - if ((this.overridableField == YesNoType.yes)) - { - writer.WriteAttributeString("Overridable", "yes"); - } - } - if (this.sequenceFieldSet) - { - writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Dialog" == name)) - { - this.dialogField = value; - this.dialogFieldSet = true; - } - if (("OnExit" == name)) - { - this.onExitField = Enums.ParseExitType(value); - this.onExitFieldSet = true; - } - if (("Before" == name)) - { - this.beforeField = value; - this.beforeFieldSet = true; - } - if (("After" == name)) - { - this.afterField = value; - this.afterFieldSet = true; - } - if (("Overridable" == name)) - { - this.overridableField = Enums.ParseYesNoType(value); - this.overridableFieldSet = true; - } - if (("Sequence" == name)) - { - this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.sequenceFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallUISequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public InstallUISequence() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Show))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ScheduleReboot))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FindRelatedProducts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CCPSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RMCCPSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ValidateProductID))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponents))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MigrateFeatureStates))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExecuteAction))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Custom" == childName)) - { - childValue = new Custom(); - } - if (("Show" == childName)) - { - childValue = new Show(); - } - if (("ScheduleReboot" == childName)) - { - childValue = new ScheduleReboot(); - } - if (("LaunchConditions" == childName)) - { - childValue = new LaunchConditions(); - } - if (("FindRelatedProducts" == childName)) - { - childValue = new FindRelatedProducts(); - } - if (("AppSearch" == childName)) - { - childValue = new AppSearch(); - } - if (("CCPSearch" == childName)) - { - childValue = new CCPSearch(); - } - if (("RMCCPSearch" == childName)) - { - childValue = new RMCCPSearch(); - } - if (("ValidateProductID" == childName)) - { - childValue = new ValidateProductID(); - } - if (("CostInitialize" == childName)) - { - childValue = new CostInitialize(); - } - if (("FileCost" == childName)) - { - childValue = new FileCost(); - } - if (("IsolateComponents" == childName)) - { - childValue = new IsolateComponents(); - } - if (("ResolveSource" == childName)) - { - childValue = new ResolveSource(); - } - if (("CostFinalize" == childName)) - { - childValue = new CostFinalize(); - } - if (("MigrateFeatureStates" == childName)) - { - childValue = new MigrateFeatureStates(); - } - if (("ExecuteAction" == childName)) - { - childValue = new ExecuteAction(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallUISequence", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstallExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public InstallExecuteSequence() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ScheduleReboot))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ForceReboot))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FindRelatedProducts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CCPSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RMCCPSearch))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ValidateProductID))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponents))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetODBCFolders))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MigrateFeatureStates))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AllocateRegistrySpace))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProcessComponents))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnpublishComponents))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnpublishFeatures))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(StopServices))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DeleteServices))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterComPlus))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SelfUnregModules))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterTypeLibraries))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveODBC))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterFonts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryValues))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterClassInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterExtensionInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterProgIdInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterMIMEInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveIniValues))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveShortcuts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveEnvironmentStrings))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveDuplicateFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFolders))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateFolders))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MoveFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DuplicateFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BindImage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateShortcuts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterClassInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterExtensionInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProgIdInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterMIMEInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteRegistryValues))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteIniValues))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteEnvironmentStrings))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterFonts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallODBC))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterTypeLibraries))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SelfRegModules))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterComPlus))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallServices))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(StartServices))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterUser))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProduct))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishComponents))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishFeatures))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishProduct))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveExistingProducts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DisableRollback))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallExecute))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallExecuteAgain))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPublishAssemblies))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiUnpublishAssemblies))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Custom" == childName)) - { - childValue = new Custom(); - } - if (("ScheduleReboot" == childName)) - { - childValue = new ScheduleReboot(); - } - if (("ForceReboot" == childName)) - { - childValue = new ForceReboot(); - } - if (("ResolveSource" == childName)) - { - childValue = new ResolveSource(); - } - if (("LaunchConditions" == childName)) - { - childValue = new LaunchConditions(); - } - if (("FindRelatedProducts" == childName)) - { - childValue = new FindRelatedProducts(); - } - if (("AppSearch" == childName)) - { - childValue = new AppSearch(); - } - if (("CCPSearch" == childName)) - { - childValue = new CCPSearch(); - } - if (("RMCCPSearch" == childName)) - { - childValue = new RMCCPSearch(); - } - if (("ValidateProductID" == childName)) - { - childValue = new ValidateProductID(); - } - if (("CostInitialize" == childName)) - { - childValue = new CostInitialize(); - } - if (("FileCost" == childName)) - { - childValue = new FileCost(); - } - if (("IsolateComponents" == childName)) - { - childValue = new IsolateComponents(); - } - if (("CostFinalize" == childName)) - { - childValue = new CostFinalize(); - } - if (("SetODBCFolders" == childName)) - { - childValue = new SetODBCFolders(); - } - if (("MigrateFeatureStates" == childName)) - { - childValue = new MigrateFeatureStates(); - } - if (("InstallValidate" == childName)) - { - childValue = new InstallValidate(); - } - if (("InstallInitialize" == childName)) - { - childValue = new InstallInitialize(); - } - if (("AllocateRegistrySpace" == childName)) - { - childValue = new AllocateRegistrySpace(); - } - if (("ProcessComponents" == childName)) - { - childValue = new ProcessComponents(); - } - if (("UnpublishComponents" == childName)) - { - childValue = new UnpublishComponents(); - } - if (("UnpublishFeatures" == childName)) - { - childValue = new UnpublishFeatures(); - } - if (("StopServices" == childName)) - { - childValue = new StopServices(); - } - if (("DeleteServices" == childName)) - { - childValue = new DeleteServices(); - } - if (("UnregisterComPlus" == childName)) - { - childValue = new UnregisterComPlus(); - } - if (("SelfUnregModules" == childName)) - { - childValue = new SelfUnregModules(); - } - if (("UnregisterTypeLibraries" == childName)) - { - childValue = new UnregisterTypeLibraries(); - } - if (("RemoveODBC" == childName)) - { - childValue = new RemoveODBC(); - } - if (("UnregisterFonts" == childName)) - { - childValue = new UnregisterFonts(); - } - if (("RemoveRegistryValues" == childName)) - { - childValue = new RemoveRegistryValues(); - } - if (("UnregisterClassInfo" == childName)) - { - childValue = new UnregisterClassInfo(); - } - if (("UnregisterExtensionInfo" == childName)) - { - childValue = new UnregisterExtensionInfo(); - } - if (("UnregisterProgIdInfo" == childName)) - { - childValue = new UnregisterProgIdInfo(); - } - if (("UnregisterMIMEInfo" == childName)) - { - childValue = new UnregisterMIMEInfo(); - } - if (("RemoveIniValues" == childName)) - { - childValue = new RemoveIniValues(); - } - if (("RemoveShortcuts" == childName)) - { - childValue = new RemoveShortcuts(); - } - if (("RemoveEnvironmentStrings" == childName)) - { - childValue = new RemoveEnvironmentStrings(); - } - if (("RemoveDuplicateFiles" == childName)) - { - childValue = new RemoveDuplicateFiles(); - } - if (("RemoveFiles" == childName)) - { - childValue = new RemoveFiles(); - } - if (("RemoveFolders" == childName)) - { - childValue = new RemoveFolders(); - } - if (("CreateFolders" == childName)) - { - childValue = new CreateFolders(); - } - if (("MoveFiles" == childName)) - { - childValue = new MoveFiles(); - } - if (("InstallFiles" == childName)) - { - childValue = new InstallFiles(); - } - if (("DuplicateFiles" == childName)) - { - childValue = new DuplicateFiles(); - } - if (("PatchFiles" == childName)) - { - childValue = new PatchFiles(); - } - if (("BindImage" == childName)) - { - childValue = new BindImage(); - } - if (("CreateShortcuts" == childName)) - { - childValue = new CreateShortcuts(); - } - if (("RegisterClassInfo" == childName)) - { - childValue = new RegisterClassInfo(); - } - if (("RegisterExtensionInfo" == childName)) - { - childValue = new RegisterExtensionInfo(); - } - if (("RegisterProgIdInfo" == childName)) - { - childValue = new RegisterProgIdInfo(); - } - if (("RegisterMIMEInfo" == childName)) - { - childValue = new RegisterMIMEInfo(); - } - if (("WriteRegistryValues" == childName)) - { - childValue = new WriteRegistryValues(); - } - if (("WriteIniValues" == childName)) - { - childValue = new WriteIniValues(); - } - if (("WriteEnvironmentStrings" == childName)) - { - childValue = new WriteEnvironmentStrings(); - } - if (("RegisterFonts" == childName)) - { - childValue = new RegisterFonts(); - } - if (("InstallODBC" == childName)) - { - childValue = new InstallODBC(); - } - if (("RegisterTypeLibraries" == childName)) - { - childValue = new RegisterTypeLibraries(); - } - if (("SelfRegModules" == childName)) - { - childValue = new SelfRegModules(); - } - if (("RegisterComPlus" == childName)) - { - childValue = new RegisterComPlus(); - } - if (("InstallServices" == childName)) - { - childValue = new InstallServices(); - } - if (("StartServices" == childName)) - { - childValue = new StartServices(); - } - if (("RegisterUser" == childName)) - { - childValue = new RegisterUser(); - } - if (("RegisterProduct" == childName)) - { - childValue = new RegisterProduct(); - } - if (("PublishComponents" == childName)) - { - childValue = new PublishComponents(); - } - if (("PublishFeatures" == childName)) - { - childValue = new PublishFeatures(); - } - if (("PublishProduct" == childName)) - { - childValue = new PublishProduct(); - } - if (("InstallFinalize" == childName)) - { - childValue = new InstallFinalize(); - } - if (("RemoveExistingProducts" == childName)) - { - childValue = new RemoveExistingProducts(); - } - if (("DisableRollback" == childName)) - { - childValue = new DisableRollback(); - } - if (("InstallExecute" == childName)) - { - childValue = new InstallExecute(); - } - if (("InstallExecuteAgain" == childName)) - { - childValue = new InstallExecuteAgain(); - } - if (("MsiPublishAssemblies" == childName)) - { - childValue = new MsiPublishAssemblies(); - } - if (("MsiUnpublishAssemblies" == childName)) - { - childValue = new MsiUnpublishAssemblies(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstallExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AdminUISequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public AdminUISequence() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Show))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExecuteAction))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallAdminPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Custom" == childName)) - { - childValue = new Custom(); - } - if (("Show" == childName)) - { - childValue = new Show(); - } - if (("CostInitialize" == childName)) - { - childValue = new CostInitialize(); - } - if (("FileCost" == childName)) - { - childValue = new FileCost(); - } - if (("CostFinalize" == childName)) - { - childValue = new CostFinalize(); - } - if (("ExecuteAction" == childName)) - { - childValue = new ExecuteAction(); - } - if (("InstallValidate" == childName)) - { - childValue = new InstallValidate(); - } - if (("InstallInitialize" == childName)) - { - childValue = new InstallInitialize(); - } - if (("InstallAdminPackage" == childName)) - { - childValue = new InstallAdminPackage(); - } - if (("InstallFiles" == childName)) - { - childValue = new InstallFiles(); - } - if (("InstallFinalize" == childName)) - { - childValue = new InstallFinalize(); - } - if (("LaunchConditions" == childName)) - { - childValue = new LaunchConditions(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AdminUISequence", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AdminExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public AdminExecuteSequence() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallAdminPackage))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFiles))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Custom" == childName)) - { - childValue = new Custom(); - } - if (("CostInitialize" == childName)) - { - childValue = new CostInitialize(); - } - if (("FileCost" == childName)) - { - childValue = new FileCost(); - } - if (("CostFinalize" == childName)) - { - childValue = new CostFinalize(); - } - if (("InstallValidate" == childName)) - { - childValue = new InstallValidate(); - } - if (("InstallInitialize" == childName)) - { - childValue = new InstallInitialize(); - } - if (("InstallAdminPackage" == childName)) - { - childValue = new InstallAdminPackage(); - } - if (("InstallFiles" == childName)) - { - childValue = new InstallFiles(); - } - if (("PatchFiles" == childName)) - { - childValue = new PatchFiles(); - } - if (("InstallFinalize" == childName)) - { - childValue = new InstallFinalize(); - } - if (("LaunchConditions" == childName)) - { - childValue = new LaunchConditions(); - } - if (("ResolveSource" == childName)) - { - childValue = new ResolveSource(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AdminExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class AdvertiseExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public AdvertiseExecuteSequence() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateShortcuts))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterClassInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterExtensionInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterMIMEInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProgIdInfo))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishComponents))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishFeatures))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishProduct))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPublishAssemblies))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("CostInitialize" == childName)) - { - childValue = new CostInitialize(); - } - if (("CostFinalize" == childName)) - { - childValue = new CostFinalize(); - } - if (("Custom" == childName)) - { - childValue = new Custom(); - } - if (("InstallValidate" == childName)) - { - childValue = new InstallValidate(); - } - if (("InstallInitialize" == childName)) - { - childValue = new InstallInitialize(); - } - if (("CreateShortcuts" == childName)) - { - childValue = new CreateShortcuts(); - } - if (("RegisterClassInfo" == childName)) - { - childValue = new RegisterClassInfo(); - } - if (("RegisterExtensionInfo" == childName)) - { - childValue = new RegisterExtensionInfo(); - } - if (("RegisterMIMEInfo" == childName)) - { - childValue = new RegisterMIMEInfo(); - } - if (("RegisterProgIdInfo" == childName)) - { - childValue = new RegisterProgIdInfo(); - } - if (("PublishComponents" == childName)) - { - childValue = new PublishComponents(); - } - if (("PublishFeatures" == childName)) - { - childValue = new PublishFeatures(); - } - if (("PublishProduct" == childName)) - { - childValue = new PublishProduct(); - } - if (("InstallFinalize" == childName)) - { - childValue = new InstallFinalize(); - } - if (("MsiPublishAssemblies" == childName)) - { - childValue = new MsiPublishAssemblies(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("AdvertiseExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - /// - /// Binary data used for CustomAction elements and UI controls. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Binary : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private YesNoType suppressModularizationField; - - private bool suppressModularizationFieldSet; - - private ISchemaElement parentElement; - - public Binary() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The Id cannot be longer than 55 characters. In order to prevent errors in cases where the Id is modularized, it should not be longer than 18 characters. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Path to the binary file. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - /// - /// Use to suppress modularization of this Binary identifier in merge modules. - /// - public YesNoType SuppressModularization - { - get - { - return this.suppressModularizationField; - } - set - { - this.suppressModularizationFieldSet = true; - this.suppressModularizationField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Binary", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - if (this.suppressModularizationFieldSet) - { - if ((this.suppressModularizationField == YesNoType.no)) - { - writer.WriteAttributeString("SuppressModularization", "no"); - } - if ((this.suppressModularizationField == YesNoType.yes)) - { - writer.WriteAttributeString("SuppressModularization", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - if (("SuppressModularization" == name)) - { - this.suppressModularizationField = Enums.ParseYesNoType(value); - this.suppressModularizationFieldSet = true; - } - } - } - - /// - /// Icon used for Shortcut, ProgId, or Class elements (but not UI controls) - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Icon : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private ISchemaElement parentElement; - - /// - /// The Id cannot be longer than 55 characters. In order to prevent errors in cases where the Id is modularized, it should not be longer than 18 characters. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Path to the icon file. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Icon", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class EmbeddedChainer : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string commandLineField; - - private bool commandLineFieldSet; - - private string binarySourceField; - - private bool binarySourceFieldSet; - - private string fileSourceField; - - private bool fileSourceFieldSet; - - private string propertySourceField; - - private bool propertySourceFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Unique identifier for embedded chainer. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Value to append to the transaction handle and passed to the chainer executable. - /// - public string CommandLine - { - get - { - return this.commandLineField; - } - set - { - this.commandLineFieldSet = true; - this.commandLineField = value; - } - } - - /// - /// Reference to the Binary element that contains the chainer executable. Mutually exclusive with - /// the FileSource and PropertySource attributes. - /// - public string BinarySource - { - get - { - return this.binarySourceField; - } - set - { - this.binarySourceFieldSet = true; - this.binarySourceField = value; - } - } - - /// - /// Reference to the File element that is the chainer executable. Mutually exclusive with - /// the BinarySource and PropertySource attributes. - /// - public string FileSource - { - get - { - return this.fileSourceField; - } - set - { - this.fileSourceFieldSet = true; - this.fileSourceField = value; - } - } - - /// - /// Reference to a Property that resolves to the full path to the chainer executable. Mutually exclusive with - /// the BinarySource and FileSource attributes. - /// - public string PropertySource - { - get - { - return this.propertySourceField; - } - set - { - this.propertySourceFieldSet = true; - this.propertySourceField = value; - } - } - - /// - /// Element value is the condition. CDATA may be used to when a condition contains many XML characters - /// that must be escaped. It is important to note that each EmbeddedChainer element must have a mutually exclusive condition - /// to ensure that only one embedded chainer will execute at a time. If the conditions are not mutually exclusive the chainer - /// that executes is undeterministic. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("EmbeddedChainer", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.commandLineFieldSet) - { - writer.WriteAttributeString("CommandLine", this.commandLineField); - } - if (this.binarySourceFieldSet) - { - writer.WriteAttributeString("BinarySource", this.binarySourceField); - } - if (this.fileSourceFieldSet) - { - writer.WriteAttributeString("FileSource", this.fileSourceField); - } - if (this.propertySourceFieldSet) - { - writer.WriteAttributeString("PropertySource", this.propertySourceField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("CommandLine" == name)) - { - this.commandLineField = value; - this.commandLineFieldSet = true; - } - if (("BinarySource" == name)) - { - this.binarySourceField = value; - this.binarySourceFieldSet = true; - } - if (("FileSource" == name)) - { - this.fileSourceField = value; - this.fileSourceFieldSet = true; - } - if (("PropertySource" == name)) - { - this.propertySourceField = value; - this.propertySourceFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Reference to an EmbeddedChainer element. This will force the entire referenced Fragment's contents - /// to be included in the installer database. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class EmbeddedChainerRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("EmbeddedChainerRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Element value is the condition. Use CDATA if message contains delimiter characters. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class EmbeddedUI : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private YesNoType ignoreFatalExitField; - - private bool ignoreFatalExitFieldSet; - - private YesNoType ignoreErrorField; - - private bool ignoreErrorFieldSet; - - private YesNoType ignoreWarningField; - - private bool ignoreWarningFieldSet; - - private YesNoType ignoreUserField; - - private bool ignoreUserFieldSet; - - private YesNoType ignoreInfoField; - - private bool ignoreInfoFieldSet; - - private YesNoType ignoreFilesInUseField; - - private bool ignoreFilesInUseFieldSet; - - private YesNoType ignoreResolveSourceField; - - private bool ignoreResolveSourceFieldSet; - - private YesNoType ignoreOutOfDiskSpaceField; - - private bool ignoreOutOfDiskSpaceFieldSet; - - private YesNoType ignoreActionStartField; - - private bool ignoreActionStartFieldSet; - - private YesNoType ignoreActionDataField; - - private bool ignoreActionDataFieldSet; - - private YesNoType ignoreProgressField; - - private bool ignoreProgressFieldSet; - - private YesNoType ignoreCommonDataField; - - private bool ignoreCommonDataFieldSet; - - private YesNoType ignoreInitializeField; - - private bool ignoreInitializeFieldSet; - - private YesNoType ignoreTerminateField; - - private bool ignoreTerminateFieldSet; - - private YesNoType ignoreShowDialogField; - - private bool ignoreShowDialogFieldSet; - - private YesNoType ignoreRMFilesInUseField; - - private bool ignoreRMFilesInUseFieldSet; - - private YesNoType ignoreInstallStartField; - - private bool ignoreInstallStartFieldSet; - - private YesNoType ignoreInstallEndField; - - private bool ignoreInstallEndFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private YesNoType supportBasicUIField; - - private bool supportBasicUIFieldSet; - - private ISchemaElement parentElement; - - public EmbeddedUI() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(EmbeddedUIResource))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for embedded UI.If this attribute is not specified the Name attribute or the file name - /// portion of the SourceFile attribute will be used. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_FATALEXIT messages. - /// - public YesNoType IgnoreFatalExit - { - get - { - return this.ignoreFatalExitField; - } - set - { - this.ignoreFatalExitFieldSet = true; - this.ignoreFatalExitField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_ERROR messages. - /// - public YesNoType IgnoreError - { - get - { - return this.ignoreErrorField; - } - set - { - this.ignoreErrorFieldSet = true; - this.ignoreErrorField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_WARNING messages. - /// - public YesNoType IgnoreWarning - { - get - { - return this.ignoreWarningField; - } - set - { - this.ignoreWarningFieldSet = true; - this.ignoreWarningField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_USER messages. - /// - public YesNoType IgnoreUser - { - get - { - return this.ignoreUserField; - } - set - { - this.ignoreUserFieldSet = true; - this.ignoreUserField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_INFO messages. - /// - public YesNoType IgnoreInfo - { - get - { - return this.ignoreInfoField; - } - set - { - this.ignoreInfoFieldSet = true; - this.ignoreInfoField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_FILESINUSE messages. - /// - public YesNoType IgnoreFilesInUse - { - get - { - return this.ignoreFilesInUseField; - } - set - { - this.ignoreFilesInUseFieldSet = true; - this.ignoreFilesInUseField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_RESOLVESOURCE messages. - /// - public YesNoType IgnoreResolveSource - { - get - { - return this.ignoreResolveSourceField; - } - set - { - this.ignoreResolveSourceFieldSet = true; - this.ignoreResolveSourceField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_OUTOFDISKSPACE messages. - /// - public YesNoType IgnoreOutOfDiskSpace - { - get - { - return this.ignoreOutOfDiskSpaceField; - } - set - { - this.ignoreOutOfDiskSpaceFieldSet = true; - this.ignoreOutOfDiskSpaceField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_ACTIONSTART messages. - /// - public YesNoType IgnoreActionStart - { - get - { - return this.ignoreActionStartField; - } - set - { - this.ignoreActionStartFieldSet = true; - this.ignoreActionStartField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_ACTIONDATA messages. - /// - public YesNoType IgnoreActionData - { - get - { - return this.ignoreActionDataField; - } - set - { - this.ignoreActionDataFieldSet = true; - this.ignoreActionDataField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_PROGRESS messages. - /// - public YesNoType IgnoreProgress - { - get - { - return this.ignoreProgressField; - } - set - { - this.ignoreProgressFieldSet = true; - this.ignoreProgressField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_COMMONDATA messages. - /// - public YesNoType IgnoreCommonData - { - get - { - return this.ignoreCommonDataField; - } - set - { - this.ignoreCommonDataFieldSet = true; - this.ignoreCommonDataField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_INITIALIZE messages. - /// - public YesNoType IgnoreInitialize - { - get - { - return this.ignoreInitializeField; - } - set - { - this.ignoreInitializeFieldSet = true; - this.ignoreInitializeField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_TERMINATE messages. - /// - public YesNoType IgnoreTerminate - { - get - { - return this.ignoreTerminateField; - } - set - { - this.ignoreTerminateFieldSet = true; - this.ignoreTerminateField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_SHOWDIALOG messages. - /// - public YesNoType IgnoreShowDialog - { - get - { - return this.ignoreShowDialogField; - } - set - { - this.ignoreShowDialogFieldSet = true; - this.ignoreShowDialogField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_RMFILESINUSE messages. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType IgnoreRMFilesInUse - { - get - { - return this.ignoreRMFilesInUseField; - } - set - { - this.ignoreRMFilesInUseFieldSet = true; - this.ignoreRMFilesInUseField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_INSTALLSTART messages. - /// - public YesNoType IgnoreInstallStart - { - get - { - return this.ignoreInstallStartField; - } - set - { - this.ignoreInstallStartFieldSet = true; - this.ignoreInstallStartField = value; - } - } - - /// - /// Embedded UI will not recieve any INSTALLLOGMODE_INSTALLEND messages. - /// - public YesNoType IgnoreInstallEnd - { - get - { - return this.ignoreInstallEndField; - } - set - { - this.ignoreInstallEndFieldSet = true; - this.ignoreInstallEndField = value; - } - } - - /// - /// The name for the embedded UI DLL when it is extracted from the package and executed. (Windows Installer - /// does not support the typical short filename and long filename combination for embedded UI files as it - /// does for other kinds of files.) If this attribute is not specified the file name portion of the SourceFile - /// attribute will be used. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Path to the binary file that is the embedded UI. This must be a DLL that exports the following - /// three entry points: InitializeEmbeddedUI, EmbeddedUIHandler and ShutdownEmbeddedUI. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - /// - /// Set yes to allow the Windows Installer to display the embedded UI during basic UI level installation. - /// - public YesNoType SupportBasicUI - { - get - { - return this.supportBasicUIField; - } - set - { - this.supportBasicUIFieldSet = true; - this.supportBasicUIField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("EmbeddedUIResource" == childName)) - { - childValue = new EmbeddedUIResource(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("EmbeddedUI", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.ignoreFatalExitFieldSet) - { - if ((this.ignoreFatalExitField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreFatalExit", "no"); - } - if ((this.ignoreFatalExitField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreFatalExit", "yes"); - } - } - if (this.ignoreErrorFieldSet) - { - if ((this.ignoreErrorField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreError", "no"); - } - if ((this.ignoreErrorField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreError", "yes"); - } - } - if (this.ignoreWarningFieldSet) - { - if ((this.ignoreWarningField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreWarning", "no"); - } - if ((this.ignoreWarningField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreWarning", "yes"); - } - } - if (this.ignoreUserFieldSet) - { - if ((this.ignoreUserField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreUser", "no"); - } - if ((this.ignoreUserField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreUser", "yes"); - } - } - if (this.ignoreInfoFieldSet) - { - if ((this.ignoreInfoField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreInfo", "no"); - } - if ((this.ignoreInfoField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreInfo", "yes"); - } - } - if (this.ignoreFilesInUseFieldSet) - { - if ((this.ignoreFilesInUseField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreFilesInUse", "no"); - } - if ((this.ignoreFilesInUseField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreFilesInUse", "yes"); - } - } - if (this.ignoreResolveSourceFieldSet) - { - if ((this.ignoreResolveSourceField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreResolveSource", "no"); - } - if ((this.ignoreResolveSourceField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreResolveSource", "yes"); - } - } - if (this.ignoreOutOfDiskSpaceFieldSet) - { - if ((this.ignoreOutOfDiskSpaceField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreOutOfDiskSpace", "no"); - } - if ((this.ignoreOutOfDiskSpaceField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreOutOfDiskSpace", "yes"); - } - } - if (this.ignoreActionStartFieldSet) - { - if ((this.ignoreActionStartField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreActionStart", "no"); - } - if ((this.ignoreActionStartField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreActionStart", "yes"); - } - } - if (this.ignoreActionDataFieldSet) - { - if ((this.ignoreActionDataField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreActionData", "no"); - } - if ((this.ignoreActionDataField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreActionData", "yes"); - } - } - if (this.ignoreProgressFieldSet) - { - if ((this.ignoreProgressField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreProgress", "no"); - } - if ((this.ignoreProgressField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreProgress", "yes"); - } - } - if (this.ignoreCommonDataFieldSet) - { - if ((this.ignoreCommonDataField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreCommonData", "no"); - } - if ((this.ignoreCommonDataField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreCommonData", "yes"); - } - } - if (this.ignoreInitializeFieldSet) - { - if ((this.ignoreInitializeField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreInitialize", "no"); - } - if ((this.ignoreInitializeField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreInitialize", "yes"); - } - } - if (this.ignoreTerminateFieldSet) - { - if ((this.ignoreTerminateField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreTerminate", "no"); - } - if ((this.ignoreTerminateField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreTerminate", "yes"); - } - } - if (this.ignoreShowDialogFieldSet) - { - if ((this.ignoreShowDialogField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreShowDialog", "no"); - } - if ((this.ignoreShowDialogField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreShowDialog", "yes"); - } - } - if (this.ignoreRMFilesInUseFieldSet) - { - if ((this.ignoreRMFilesInUseField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreRMFilesInUse", "no"); - } - if ((this.ignoreRMFilesInUseField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreRMFilesInUse", "yes"); - } - } - if (this.ignoreInstallStartFieldSet) - { - if ((this.ignoreInstallStartField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreInstallStart", "no"); - } - if ((this.ignoreInstallStartField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreInstallStart", "yes"); - } - } - if (this.ignoreInstallEndFieldSet) - { - if ((this.ignoreInstallEndField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreInstallEnd", "no"); - } - if ((this.ignoreInstallEndField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreInstallEnd", "yes"); - } - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.supportBasicUIFieldSet) - { - if ((this.supportBasicUIField == YesNoType.no)) - { - writer.WriteAttributeString("SupportBasicUI", "no"); - } - if ((this.supportBasicUIField == YesNoType.yes)) - { - writer.WriteAttributeString("SupportBasicUI", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("IgnoreFatalExit" == name)) - { - this.ignoreFatalExitField = Enums.ParseYesNoType(value); - this.ignoreFatalExitFieldSet = true; - } - if (("IgnoreError" == name)) - { - this.ignoreErrorField = Enums.ParseYesNoType(value); - this.ignoreErrorFieldSet = true; - } - if (("IgnoreWarning" == name)) - { - this.ignoreWarningField = Enums.ParseYesNoType(value); - this.ignoreWarningFieldSet = true; - } - if (("IgnoreUser" == name)) - { - this.ignoreUserField = Enums.ParseYesNoType(value); - this.ignoreUserFieldSet = true; - } - if (("IgnoreInfo" == name)) - { - this.ignoreInfoField = Enums.ParseYesNoType(value); - this.ignoreInfoFieldSet = true; - } - if (("IgnoreFilesInUse" == name)) - { - this.ignoreFilesInUseField = Enums.ParseYesNoType(value); - this.ignoreFilesInUseFieldSet = true; - } - if (("IgnoreResolveSource" == name)) - { - this.ignoreResolveSourceField = Enums.ParseYesNoType(value); - this.ignoreResolveSourceFieldSet = true; - } - if (("IgnoreOutOfDiskSpace" == name)) - { - this.ignoreOutOfDiskSpaceField = Enums.ParseYesNoType(value); - this.ignoreOutOfDiskSpaceFieldSet = true; - } - if (("IgnoreActionStart" == name)) - { - this.ignoreActionStartField = Enums.ParseYesNoType(value); - this.ignoreActionStartFieldSet = true; - } - if (("IgnoreActionData" == name)) - { - this.ignoreActionDataField = Enums.ParseYesNoType(value); - this.ignoreActionDataFieldSet = true; - } - if (("IgnoreProgress" == name)) - { - this.ignoreProgressField = Enums.ParseYesNoType(value); - this.ignoreProgressFieldSet = true; - } - if (("IgnoreCommonData" == name)) - { - this.ignoreCommonDataField = Enums.ParseYesNoType(value); - this.ignoreCommonDataFieldSet = true; - } - if (("IgnoreInitialize" == name)) - { - this.ignoreInitializeField = Enums.ParseYesNoType(value); - this.ignoreInitializeFieldSet = true; - } - if (("IgnoreTerminate" == name)) - { - this.ignoreTerminateField = Enums.ParseYesNoType(value); - this.ignoreTerminateFieldSet = true; - } - if (("IgnoreShowDialog" == name)) - { - this.ignoreShowDialogField = Enums.ParseYesNoType(value); - this.ignoreShowDialogFieldSet = true; - } - if (("IgnoreRMFilesInUse" == name)) - { - this.ignoreRMFilesInUseField = Enums.ParseYesNoType(value); - this.ignoreRMFilesInUseFieldSet = true; - } - if (("IgnoreInstallStart" == name)) - { - this.ignoreInstallStartField = Enums.ParseYesNoType(value); - this.ignoreInstallStartFieldSet = true; - } - if (("IgnoreInstallEnd" == name)) - { - this.ignoreInstallEndField = Enums.ParseYesNoType(value); - this.ignoreInstallEndFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("SupportBasicUI" == name)) - { - this.supportBasicUIField = Enums.ParseYesNoType(value); - this.supportBasicUIFieldSet = true; - } - } - } - - /// - /// Defines a resource for use by the embedded UI. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class EmbeddedUIResource : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string nameField; - - private bool nameFieldSet; - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for the embedded UI resource. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The name for the resource when it is extracted from the package for use by the embedded UI DLL. (Windows - /// Installer does not support the typical short filename and long filename combination for embedded UI files - /// as it does for other kinds of files.) If this attribute is not specified the Id attribute will be used. - /// - public string Name - { - get - { - return this.nameField; - } - set - { - this.nameFieldSet = true; - this.nameField = value; - } - } - - /// - /// Path to the binary file that is the embedded UI resource. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("EmbeddedUIResource", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.nameFieldSet) - { - writer.WriteAttributeString("Name", this.nameField); - } - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Name" == name)) - { - this.nameField = value; - this.nameFieldSet = true; - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Error : ISchemaElement, ISetAttributes - { - - private int idField; - - private bool idFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Number of the error for which a message is being provided. See MSI SDK for error definitions. - /// - public int Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Element value is Message, use CDATA if message contains delimiter characters - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Error", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField.ToString(CultureInfo.InvariantCulture)); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.idFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Publish : ISchemaElement, ISetAttributes - { - - private string controlField; - - private bool controlFieldSet; - - private string dialogField; - - private bool dialogFieldSet; - - private string eventField; - - private bool eventFieldSet; - - private string orderField; - - private bool orderFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// The parent Control for this Publish element, should only be specified when this element is a child of the UI element. - /// - public string Control - { - get - { - return this.controlField; - } - set - { - this.controlFieldSet = true; - this.controlField = value; - } - } - - /// - /// The parent Dialog for this Publish element, should only be specified when this element is a child of the UI element. - /// This attribute will create a reference to the specified Dialog, so an additional DialogRef is not necessary. - /// - public string Dialog - { - get - { - return this.dialogField; - } - set - { - this.dialogFieldSet = true; - this.dialogField = value; - } - } - - /// - /// Set this attribute's value to one of the standard control events to trigger that event. - /// Either this attribute or the Property attribute must be set, but not both at the same time. - /// - public string Event - { - get - { - return this.eventField; - } - set - { - this.eventFieldSet = true; - this.eventField = value; - } - } - - /// - /// This attribute should only need to be set if this element is nested under a UI element in order to - /// control the order in which this publish event will be started. - /// If this element is nested under a Control element, the default value will be one greater than any - /// previous Publish element's order (the first element's default value is 1). - /// If this element is nested under a UI element, the default value is always 1 (it does not get a - /// default value based on any previous Publish elements). - /// - public string Order - { - get - { - return this.orderField; - } - set - { - this.orderFieldSet = true; - this.orderField = value; - } - } - - /// - /// Set this attribute's value to a property name to set that property. - /// Either this attribute or the Event attribute must be set, but not both at the same time. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// If the Property attribute is specified, set the value of this attribute to the new value for the property. - /// To set a property to null, do not set this attribute (the ControlEvent Argument column will be set to '{}'). - /// Otherwise, this attribute's value should be the argument for the event specified in the Event attribute. - /// If the event doesn't take an attribute, a common value to use is "0". - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// The element value is the optional Condition expression. - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Publish", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.controlFieldSet) - { - writer.WriteAttributeString("Control", this.controlField); - } - if (this.dialogFieldSet) - { - writer.WriteAttributeString("Dialog", this.dialogField); - } - if (this.eventFieldSet) - { - writer.WriteAttributeString("Event", this.eventField); - } - if (this.orderFieldSet) - { - writer.WriteAttributeString("Order", this.orderField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Control" == name)) - { - this.controlField = value; - this.controlFieldSet = true; - } - if (("Dialog" == name)) - { - this.dialogField = value; - this.dialogFieldSet = true; - } - if (("Event" == name)) - { - this.eventField = value; - this.eventFieldSet = true; - } - if (("Order" == name)) - { - this.orderField = value; - this.orderFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Sets attributes for events in the EventMapping table - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Subscribe : ISchemaElement, ISetAttributes - { - - private string eventField; - - private bool eventFieldSet; - - private string attributeField; - - private bool attributeFieldSet; - - private ISchemaElement parentElement; - - /// - /// must be one of the standard control events' - /// - public string Event - { - get - { - return this.eventField; - } - set - { - this.eventFieldSet = true; - this.eventField = value; - } - } - - /// - /// if not present can only handle enable, disable, hide, unhide events - /// - public string Attribute - { - get - { - return this.attributeField; - } - set - { - this.attributeFieldSet = true; - this.attributeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Subscribe", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.eventFieldSet) - { - writer.WriteAttributeString("Event", this.eventField); - } - if (this.attributeFieldSet) - { - writer.WriteAttributeString("Attribute", this.attributeField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Event" == name)) - { - this.eventField = value; - this.eventFieldSet = true; - } - if (("Attribute" == name)) - { - this.attributeField = value; - this.attributeFieldSet = true; - } - } - } - - /// - /// An alternative to using the Text attribute when the value contains special XML characters like <, >, or &. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Text : ISchemaElement, ISetAttributes - { - - private string sourceFileField; - - private bool sourceFileFieldSet; - - private string srcField; - - private bool srcFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Instructs the text to be imported from a file instead of the element value during the binding process. - /// - public string SourceFile - { - get - { - return this.sourceFileField; - } - set - { - this.sourceFileFieldSet = true; - this.sourceFileField = value; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] - public string src - { - get - { - return this.srcField; - } - set - { - this.srcFieldSet = true; - this.srcField = value; - } - } - - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Text", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.sourceFileFieldSet) - { - writer.WriteAttributeString("SourceFile", this.sourceFileField); - } - if (this.srcFieldSet) - { - writer.WriteAttributeString("src", this.srcField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("SourceFile" == name)) - { - this.sourceFileField = value; - this.sourceFileFieldSet = true; - } - if (("src" == name)) - { - this.srcField = value; - this.srcFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Contains the controls that appear on each dialog. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Control : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string typeField; - - private bool typeFieldSet; - - private string xField; - - private bool xFieldSet; - - private string yField; - - private bool yFieldSet; - - private string widthField; - - private bool widthFieldSet; - - private string heightField; - - private bool heightFieldSet; - - private string propertyField; - - private bool propertyFieldSet; - - private string textField; - - private bool textFieldSet; - - private string helpField; - - private bool helpFieldSet; - - private string toolTipField; - - private bool toolTipFieldSet; - - private string checkBoxValueField; - - private bool checkBoxValueFieldSet; - - private string checkBoxPropertyRefField; - - private bool checkBoxPropertyRefFieldSet; - - private YesNoType tabSkipField; - - private bool tabSkipFieldSet; - - private YesNoType defaultField; - - private bool defaultFieldSet; - - private YesNoType cancelField; - - private bool cancelFieldSet; - - private YesNoType hiddenField; - - private bool hiddenFieldSet; - - private YesNoType disabledField; - - private bool disabledFieldSet; - - private YesNoType sunkenField; - - private bool sunkenFieldSet; - - private YesNoType indirectField; - - private bool indirectFieldSet; - - private YesNoType integerField; - - private bool integerFieldSet; - - private YesNoType rightToLeftField; - - private bool rightToLeftFieldSet; - - private YesNoType rightAlignedField; - - private bool rightAlignedFieldSet; - - private YesNoType leftScrollField; - - private bool leftScrollFieldSet; - - private YesNoType transparentField; - - private bool transparentFieldSet; - - private YesNoType noPrefixField; - - private bool noPrefixFieldSet; - - private YesNoType noWrapField; - - private bool noWrapFieldSet; - - private YesNoType formatSizeField; - - private bool formatSizeFieldSet; - - private YesNoType userLanguageField; - - private bool userLanguageFieldSet; - - private YesNoType multilineField; - - private bool multilineFieldSet; - - private YesNoType passwordField; - - private bool passwordFieldSet; - - private YesNoType progressBlocksField; - - private bool progressBlocksFieldSet; - - private YesNoType removableField; - - private bool removableFieldSet; - - private YesNoType fixedField; - - private bool fixedFieldSet; - - private YesNoType remoteField; - - private bool remoteFieldSet; - - private YesNoType cDROMField; - - private bool cDROMFieldSet; - - private YesNoType rAMDiskField; - - private bool rAMDiskFieldSet; - - private YesNoType floppyField; - - private bool floppyFieldSet; - - private YesNoType showRollbackCostField; - - private bool showRollbackCostFieldSet; - - private YesNoType sortedField; - - private bool sortedFieldSet; - - private YesNoType comboListField; - - private bool comboListFieldSet; - - private YesNoType imageField; - - private bool imageFieldSet; - - private IconSizeType iconSizeField; - - private bool iconSizeFieldSet; - - private YesNoType fixedSizeField; - - private bool fixedSizeFieldSet; - - private YesNoType iconField; - - private bool iconFieldSet; - - private YesNoType bitmapField; - - private bool bitmapFieldSet; - - private YesNoType pushLikeField; - - private bool pushLikeFieldSet; - - private YesNoType hasBorderField; - - private bool hasBorderFieldSet; - - private YesNoType elevationShieldField; - - private bool elevationShieldFieldSet; - - private ISchemaElement parentElement; - - public Control() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Text))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ComboBox))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListBox))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListView))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RadioButtonGroup))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Binary))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Publish))); - childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Subscribe))); - childCollection0.AddCollection(childCollection1); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Combined with the Dialog Id to make up the primary key of the Control table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The type of the control. Could be one of the following: Billboard, Bitmap, CheckBox, ComboBox, DirectoryCombo, DirectoryList, Edit, GroupBox, Hyperlink, Icon, Line, ListBox, ListView, MaskedEdit, PathEdit, ProgressBar, PushButton, RadioButtonGroup, ScrollableText, SelectionTree, Text, VolumeCostList, VolumeSelectCombo - /// - public string Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Horizontal coordinate of the upper-left corner of the rectangular boundary of the control. This must be a non-negative number. - /// - public string X - { - get - { - return this.xField; - } - set - { - this.xFieldSet = true; - this.xField = value; - } - } - - /// - /// Vertical coordinate of the upper-left corner of the rectangular boundary of the control. This must be a non-negative number. - /// - public string Y - { - get - { - return this.yField; - } - set - { - this.yFieldSet = true; - this.yField = value; - } - } - - /// - /// Width of the rectangular boundary of the control. This must be a non-negative number. - /// - public string Width - { - get - { - return this.widthField; - } - set - { - this.widthFieldSet = true; - this.widthField = value; - } - } - - /// - /// Height of the rectangular boundary of the control. This must be a non-negative number. - /// - public string Height - { - get - { - return this.heightField; - } - set - { - this.heightFieldSet = true; - this.heightField = value; - } - } - - /// - /// The name of a defined property to be linked to this control. This column is required for active controls. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - /// - /// A localizable string used to set the initial text contained in a control. This attribute can contain a formatted string that is processed at install time to insert the values of properties using [PropertyName] syntax. Also supported are environment variables, file installation paths, and component installation directories; see - /// - public string Text - { - get - { - return this.textField; - } - set - { - this.textFieldSet = true; - this.textField = value; - } - } - - /// - /// This attribute is reserved for future use. There is no need to use this until Windows Installer uses it for something. - /// - public string Help - { - get - { - return this.helpField; - } - set - { - this.helpFieldSet = true; - this.helpField = value; - } - } - - /// - /// The string used for the Tooltip. - /// - public string ToolTip - { - get - { - return this.toolTipField; - } - set - { - this.toolTipFieldSet = true; - this.toolTipField = value; - } - } - - /// - /// This attribute is only valid for CheckBox Controls. When set, the linked Property will be set to this value when the check box is checked. - /// - public string CheckBoxValue - { - get - { - return this.checkBoxValueField; - } - set - { - this.checkBoxValueFieldSet = true; - this.checkBoxValueField = value; - } - } - - /// - /// This attribute is only valid for CheckBox controls. The value is the name of a Property that was already used as the Property for another CheckBox control. The Property attribute cannot be specified. The attribute exists to support multiple checkboxes on different dialogs being tied to the same property. - /// - public string CheckBoxPropertyRef - { - get - { - return this.checkBoxPropertyRefField; - } - set - { - this.checkBoxPropertyRefFieldSet = true; - this.checkBoxPropertyRefField = value; - } - } - - /// - /// Set this attribute to "yes" to cause this Control to be skipped in the tab sequence. - /// - public YesNoType TabSkip - { - get - { - return this.tabSkipField; - } - set - { - this.tabSkipFieldSet = true; - this.tabSkipField = value; - } - } - - /// - /// Set this attribute to "yes" to cause this Control to be invoked by the return key. - /// - public YesNoType Default - { - get - { - return this.defaultField; - } - set - { - this.defaultFieldSet = true; - this.defaultField = value; - } - } - - /// - /// Set this attribute to "yes" to cause this Control to be invoked by the escape key. - /// - public YesNoType Cancel - { - get - { - return this.cancelField; - } - set - { - this.cancelFieldSet = true; - this.cancelField = value; - } - } - - /// - /// Set this attribute to "yes" to cause the Control to be hidden. - /// - public YesNoType Hidden - { - get - { - return this.hiddenField; - } - set - { - this.hiddenFieldSet = true; - this.hiddenField = value; - } - } - - /// - /// Set this attribute to "yes" to cause the Control to be disabled. - /// - public YesNoType Disabled - { - get - { - return this.disabledField; - } - set - { - this.disabledFieldSet = true; - this.disabledField = value; - } - } - - /// - /// Set this attribute to "yes" to cause the Control to be sunken. - /// - public YesNoType Sunken - { - get - { - return this.sunkenField; - } - set - { - this.sunkenFieldSet = true; - this.sunkenField = value; - } - } - - /// - /// Specifies whether the value displayed or changed by this control is referenced indirectly. If this bit is set, the control displays or changes the value of the property that has the identifier listed in the Property column of the Control table. - /// - public YesNoType Indirect - { - get - { - return this.indirectField; - } - set - { - this.indirectFieldSet = true; - this.indirectField = value; - } - } - - /// - /// Set this attribute to "yes" to cause the linked Property value for the Control to be treated as an integer. Otherwise, the Property will be treated as a string. - /// - public YesNoType Integer - { - get - { - return this.integerField; - } - set - { - this.integerFieldSet = true; - this.integerField = value; - } - } - - /// - /// Set this attribute to "yes" to cause the Control to display from right to left. - /// - public YesNoType RightToLeft - { - get - { - return this.rightToLeftField; - } - set - { - this.rightToLeftFieldSet = true; - this.rightToLeftField = value; - } - } - - /// - /// Set this attribute to "yes" to cause the Control to be right aligned. - /// - public YesNoType RightAligned - { - get - { - return this.rightAlignedField; - } - set - { - this.rightAlignedFieldSet = true; - this.rightAlignedField = value; - } - } - - /// - /// Set this attribute to "yes" to cause the scroll bar to display on the left side of the Control. - /// - public YesNoType LeftScroll - { - get - { - return this.leftScrollField; - } - set - { - this.leftScrollFieldSet = true; - this.leftScrollField = value; - } - } - - /// - /// This attribute is only valid for Text Controls. - /// - public YesNoType Transparent - { - get - { - return this.transparentField; - } - set - { - this.transparentFieldSet = true; - this.transparentField = value; - } - } - - /// - /// This attribute is only valid for Text Controls. - /// - public YesNoType NoPrefix - { - get - { - return this.noPrefixField; - } - set - { - this.noPrefixFieldSet = true; - this.noPrefixField = value; - } - } - - /// - /// This attribute is only valid for Text Controls. - /// - public YesNoType NoWrap - { - get - { - return this.noWrapField; - } - set - { - this.noWrapFieldSet = true; - this.noWrapField = value; - } - } - - /// - /// This attribute is only valid for Text Controls. - /// - public YesNoType FormatSize - { - get - { - return this.formatSizeField; - } - set - { - this.formatSizeFieldSet = true; - this.formatSizeField = value; - } - } - - /// - /// This attribute is only valid for Text Controls. - /// - public YesNoType UserLanguage - { - get - { - return this.userLanguageField; - } - set - { - this.userLanguageFieldSet = true; - this.userLanguageField = value; - } - } - - /// - /// This attribute is only valid for Edit Controls. - /// - public YesNoType Multiline - { - get - { - return this.multilineField; - } - set - { - this.multilineFieldSet = true; - this.multilineField = value; - } - } - - /// - /// This attribute is only valid for Edit Controls. - /// - public YesNoType Password - { - get - { - return this.passwordField; - } - set - { - this.passwordFieldSet = true; - this.passwordField = value; - } - } - - /// - /// This attribute is only valid for ProgressBar Controls. - /// - public YesNoType ProgressBlocks - { - get - { - return this.progressBlocksField; - } - set - { - this.progressBlocksFieldSet = true; - this.progressBlocksField = value; - } - } - - /// - /// This attribute is only valid for Volume and Directory Controls. - /// - public YesNoType Removable - { - get - { - return this.removableField; - } - set - { - this.removableFieldSet = true; - this.removableField = value; - } - } - - /// - /// This attribute is only valid for Volume and Directory Controls. - /// - public YesNoType Fixed - { - get - { - return this.fixedField; - } - set - { - this.fixedFieldSet = true; - this.fixedField = value; - } - } - - /// - /// This attribute is only valid for Volume and Directory Controls. - /// - public YesNoType Remote - { - get - { - return this.remoteField; - } - set - { - this.remoteFieldSet = true; - this.remoteField = value; - } - } - - /// - /// This attribute is only valid for Volume and Directory Controls. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType CDROM - { - get - { - return this.cDROMField; - } - set - { - this.cDROMFieldSet = true; - this.cDROMField = value; - } - } - - /// - /// This attribute is only valid for Volume and Directory Controls. - /// - [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] - public YesNoType RAMDisk - { - get - { - return this.rAMDiskField; - } - set - { - this.rAMDiskFieldSet = true; - this.rAMDiskField = value; - } - } - - /// - /// This attribute is only valid for Volume and Directory Controls. - /// - public YesNoType Floppy - { - get - { - return this.floppyField; - } - set - { - this.floppyFieldSet = true; - this.floppyField = value; - } - } - - /// - /// This attribute is only valid for VolumeCostList Controls. - /// - public YesNoType ShowRollbackCost - { - get - { - return this.showRollbackCostField; - } - set - { - this.showRollbackCostFieldSet = true; - this.showRollbackCostField = value; - } - } - - /// - /// This attribute is only valid for ListBox, ListView, and ComboBox Controls. Set - /// the value of this attribute to "yes" to have entries appear in the order specified under the Control. - /// If the attribute value is "no" or absent the entries in the control will appear in alphabetical order. - /// - public YesNoType Sorted - { - get - { - return this.sortedField; - } - set - { - this.sortedFieldSet = true; - this.sortedField = value; - } - } - - /// - /// This attribute is only valid for ComboBox Controls. - /// - public YesNoType ComboList - { - get - { - return this.comboListField; - } - set - { - this.comboListFieldSet = true; - this.comboListField = value; - } - } - - /// - /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. - /// - public YesNoType Image - { - get - { - return this.imageField; - } - set - { - this.imageFieldSet = true; - this.imageField = value; - } - } - - /// - /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. - /// - public IconSizeType IconSize - { - get - { - return this.iconSizeField; - } - set - { - this.iconSizeFieldSet = true; - this.iconSizeField = value; - } - } - - /// - /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. - /// - public YesNoType FixedSize - { - get - { - return this.fixedSizeField; - } - set - { - this.fixedSizeFieldSet = true; - this.fixedSizeField = value; - } - } - - /// - /// This attribute is only valid for RadioButton and PushButton Controls. - /// - public YesNoType Icon - { - get - { - return this.iconField; - } - set - { - this.iconFieldSet = true; - this.iconField = value; - } - } - - /// - /// This attribute is only valid for RadioButton and PushButton Controls. - /// - public YesNoType Bitmap - { - get - { - return this.bitmapField; - } - set - { - this.bitmapFieldSet = true; - this.bitmapField = value; - } - } - - /// - /// This attribute is only valid for RadioButton and Checkbox Controls. - /// - public YesNoType PushLike - { - get - { - return this.pushLikeField; - } - set - { - this.pushLikeFieldSet = true; - this.pushLikeField = value; - } - } - - /// - /// This attribute is only valid for RadioButton Controls. - /// - public YesNoType HasBorder - { - get - { - return this.hasBorderField; - } - set - { - this.hasBorderFieldSet = true; - this.hasBorderField = value; - } - } - - /// - /// This attribute is only valid for PushButton controls. - /// Set this attribute to "yes" to add the User Account Control (UAC) elevation icon (shield icon) to the PushButton control. - /// If this attribute's value is "yes" and the installation is not yet running with elevated privileges, - /// the pushbutton control is created using the User Account Control (UAC) elevation icon (shield icon). - /// If this attribute's value is "yes" and the installation is already running with elevated privileges, - /// the pushbutton control is created using the other icon attributes. - /// Otherwise, the pushbutton control is created using the other icon attributes. - /// - public YesNoType ElevationShield - { - get - { - return this.elevationShieldField; - } - set - { - this.elevationShieldFieldSet = true; - this.elevationShieldField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Text" == childName)) - { - childValue = new Text(); - } - if (("ComboBox" == childName)) - { - childValue = new ComboBox(); - } - if (("ListBox" == childName)) - { - childValue = new ListBox(); - } - if (("ListView" == childName)) - { - childValue = new ListView(); - } - if (("RadioButtonGroup" == childName)) - { - childValue = new RadioButtonGroup(); - } - if (("Property" == childName)) - { - childValue = new Property(); - } - if (("Binary" == childName)) - { - childValue = new Binary(); - } - if (("Condition" == childName)) - { - childValue = new Condition(); - } - if (("Publish" == childName)) - { - childValue = new Publish(); - } - if (("Subscribe" == childName)) - { - childValue = new Subscribe(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Parses a IconSizeType from a string. - /// - public static IconSizeType ParseIconSizeType(string value) - { - IconSizeType parsedValue; - Control.TryParseIconSizeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a IconSizeType from a string. - /// - public static bool TryParseIconSizeType(string value, out IconSizeType parsedValue) - { - parsedValue = IconSizeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("16" == value)) - { - parsedValue = IconSizeType.Item16; - } - else - { - if (("32" == value)) - { - parsedValue = IconSizeType.Item32; - } - else - { - if (("48" == value)) - { - parsedValue = IconSizeType.Item48; - } - else - { - parsedValue = IconSizeType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Control", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.typeFieldSet) - { - writer.WriteAttributeString("Type", this.typeField); - } - if (this.xFieldSet) - { - writer.WriteAttributeString("X", this.xField); - } - if (this.yFieldSet) - { - writer.WriteAttributeString("Y", this.yField); - } - if (this.widthFieldSet) - { - writer.WriteAttributeString("Width", this.widthField); - } - if (this.heightFieldSet) - { - writer.WriteAttributeString("Height", this.heightField); - } - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - if (this.textFieldSet) - { - writer.WriteAttributeString("Text", this.textField); - } - if (this.helpFieldSet) - { - writer.WriteAttributeString("Help", this.helpField); - } - if (this.toolTipFieldSet) - { - writer.WriteAttributeString("ToolTip", this.toolTipField); - } - if (this.checkBoxValueFieldSet) - { - writer.WriteAttributeString("CheckBoxValue", this.checkBoxValueField); - } - if (this.checkBoxPropertyRefFieldSet) - { - writer.WriteAttributeString("CheckBoxPropertyRef", this.checkBoxPropertyRefField); - } - if (this.tabSkipFieldSet) - { - if ((this.tabSkipField == YesNoType.no)) - { - writer.WriteAttributeString("TabSkip", "no"); - } - if ((this.tabSkipField == YesNoType.yes)) - { - writer.WriteAttributeString("TabSkip", "yes"); - } - } - if (this.defaultFieldSet) - { - if ((this.defaultField == YesNoType.no)) - { - writer.WriteAttributeString("Default", "no"); - } - if ((this.defaultField == YesNoType.yes)) - { - writer.WriteAttributeString("Default", "yes"); - } - } - if (this.cancelFieldSet) - { - if ((this.cancelField == YesNoType.no)) - { - writer.WriteAttributeString("Cancel", "no"); - } - if ((this.cancelField == YesNoType.yes)) - { - writer.WriteAttributeString("Cancel", "yes"); - } - } - if (this.hiddenFieldSet) - { - if ((this.hiddenField == YesNoType.no)) - { - writer.WriteAttributeString("Hidden", "no"); - } - if ((this.hiddenField == YesNoType.yes)) - { - writer.WriteAttributeString("Hidden", "yes"); - } - } - if (this.disabledFieldSet) - { - if ((this.disabledField == YesNoType.no)) - { - writer.WriteAttributeString("Disabled", "no"); - } - if ((this.disabledField == YesNoType.yes)) - { - writer.WriteAttributeString("Disabled", "yes"); - } - } - if (this.sunkenFieldSet) - { - if ((this.sunkenField == YesNoType.no)) - { - writer.WriteAttributeString("Sunken", "no"); - } - if ((this.sunkenField == YesNoType.yes)) - { - writer.WriteAttributeString("Sunken", "yes"); - } - } - if (this.indirectFieldSet) - { - if ((this.indirectField == YesNoType.no)) - { - writer.WriteAttributeString("Indirect", "no"); - } - if ((this.indirectField == YesNoType.yes)) - { - writer.WriteAttributeString("Indirect", "yes"); - } - } - if (this.integerFieldSet) - { - if ((this.integerField == YesNoType.no)) - { - writer.WriteAttributeString("Integer", "no"); - } - if ((this.integerField == YesNoType.yes)) - { - writer.WriteAttributeString("Integer", "yes"); - } - } - if (this.rightToLeftFieldSet) - { - if ((this.rightToLeftField == YesNoType.no)) - { - writer.WriteAttributeString("RightToLeft", "no"); - } - if ((this.rightToLeftField == YesNoType.yes)) - { - writer.WriteAttributeString("RightToLeft", "yes"); - } - } - if (this.rightAlignedFieldSet) - { - if ((this.rightAlignedField == YesNoType.no)) - { - writer.WriteAttributeString("RightAligned", "no"); - } - if ((this.rightAlignedField == YesNoType.yes)) - { - writer.WriteAttributeString("RightAligned", "yes"); - } - } - if (this.leftScrollFieldSet) - { - if ((this.leftScrollField == YesNoType.no)) - { - writer.WriteAttributeString("LeftScroll", "no"); - } - if ((this.leftScrollField == YesNoType.yes)) - { - writer.WriteAttributeString("LeftScroll", "yes"); - } - } - if (this.transparentFieldSet) - { - if ((this.transparentField == YesNoType.no)) - { - writer.WriteAttributeString("Transparent", "no"); - } - if ((this.transparentField == YesNoType.yes)) - { - writer.WriteAttributeString("Transparent", "yes"); - } - } - if (this.noPrefixFieldSet) - { - if ((this.noPrefixField == YesNoType.no)) - { - writer.WriteAttributeString("NoPrefix", "no"); - } - if ((this.noPrefixField == YesNoType.yes)) - { - writer.WriteAttributeString("NoPrefix", "yes"); - } - } - if (this.noWrapFieldSet) - { - if ((this.noWrapField == YesNoType.no)) - { - writer.WriteAttributeString("NoWrap", "no"); - } - if ((this.noWrapField == YesNoType.yes)) - { - writer.WriteAttributeString("NoWrap", "yes"); - } - } - if (this.formatSizeFieldSet) - { - if ((this.formatSizeField == YesNoType.no)) - { - writer.WriteAttributeString("FormatSize", "no"); - } - if ((this.formatSizeField == YesNoType.yes)) - { - writer.WriteAttributeString("FormatSize", "yes"); - } - } - if (this.userLanguageFieldSet) - { - if ((this.userLanguageField == YesNoType.no)) - { - writer.WriteAttributeString("UserLanguage", "no"); - } - if ((this.userLanguageField == YesNoType.yes)) - { - writer.WriteAttributeString("UserLanguage", "yes"); - } - } - if (this.multilineFieldSet) - { - if ((this.multilineField == YesNoType.no)) - { - writer.WriteAttributeString("Multiline", "no"); - } - if ((this.multilineField == YesNoType.yes)) - { - writer.WriteAttributeString("Multiline", "yes"); - } - } - if (this.passwordFieldSet) - { - if ((this.passwordField == YesNoType.no)) - { - writer.WriteAttributeString("Password", "no"); - } - if ((this.passwordField == YesNoType.yes)) - { - writer.WriteAttributeString("Password", "yes"); - } - } - if (this.progressBlocksFieldSet) - { - if ((this.progressBlocksField == YesNoType.no)) - { - writer.WriteAttributeString("ProgressBlocks", "no"); - } - if ((this.progressBlocksField == YesNoType.yes)) - { - writer.WriteAttributeString("ProgressBlocks", "yes"); - } - } - if (this.removableFieldSet) - { - if ((this.removableField == YesNoType.no)) - { - writer.WriteAttributeString("Removable", "no"); - } - if ((this.removableField == YesNoType.yes)) - { - writer.WriteAttributeString("Removable", "yes"); - } - } - if (this.fixedFieldSet) - { - if ((this.fixedField == YesNoType.no)) - { - writer.WriteAttributeString("Fixed", "no"); - } - if ((this.fixedField == YesNoType.yes)) - { - writer.WriteAttributeString("Fixed", "yes"); - } - } - if (this.remoteFieldSet) - { - if ((this.remoteField == YesNoType.no)) - { - writer.WriteAttributeString("Remote", "no"); - } - if ((this.remoteField == YesNoType.yes)) - { - writer.WriteAttributeString("Remote", "yes"); - } - } - if (this.cDROMFieldSet) - { - if ((this.cDROMField == YesNoType.no)) - { - writer.WriteAttributeString("CDROM", "no"); - } - if ((this.cDROMField == YesNoType.yes)) - { - writer.WriteAttributeString("CDROM", "yes"); - } - } - if (this.rAMDiskFieldSet) - { - if ((this.rAMDiskField == YesNoType.no)) - { - writer.WriteAttributeString("RAMDisk", "no"); - } - if ((this.rAMDiskField == YesNoType.yes)) - { - writer.WriteAttributeString("RAMDisk", "yes"); - } - } - if (this.floppyFieldSet) - { - if ((this.floppyField == YesNoType.no)) - { - writer.WriteAttributeString("Floppy", "no"); - } - if ((this.floppyField == YesNoType.yes)) - { - writer.WriteAttributeString("Floppy", "yes"); - } - } - if (this.showRollbackCostFieldSet) - { - if ((this.showRollbackCostField == YesNoType.no)) - { - writer.WriteAttributeString("ShowRollbackCost", "no"); - } - if ((this.showRollbackCostField == YesNoType.yes)) - { - writer.WriteAttributeString("ShowRollbackCost", "yes"); - } - } - if (this.sortedFieldSet) - { - if ((this.sortedField == YesNoType.no)) - { - writer.WriteAttributeString("Sorted", "no"); - } - if ((this.sortedField == YesNoType.yes)) - { - writer.WriteAttributeString("Sorted", "yes"); - } - } - if (this.comboListFieldSet) - { - if ((this.comboListField == YesNoType.no)) - { - writer.WriteAttributeString("ComboList", "no"); - } - if ((this.comboListField == YesNoType.yes)) - { - writer.WriteAttributeString("ComboList", "yes"); - } - } - if (this.imageFieldSet) - { - if ((this.imageField == YesNoType.no)) - { - writer.WriteAttributeString("Image", "no"); - } - if ((this.imageField == YesNoType.yes)) - { - writer.WriteAttributeString("Image", "yes"); - } - } - if (this.iconSizeFieldSet) - { - if ((this.iconSizeField == IconSizeType.Item16)) - { - writer.WriteAttributeString("IconSize", "16"); - } - if ((this.iconSizeField == IconSizeType.Item32)) - { - writer.WriteAttributeString("IconSize", "32"); - } - if ((this.iconSizeField == IconSizeType.Item48)) - { - writer.WriteAttributeString("IconSize", "48"); - } - } - if (this.fixedSizeFieldSet) - { - if ((this.fixedSizeField == YesNoType.no)) - { - writer.WriteAttributeString("FixedSize", "no"); - } - if ((this.fixedSizeField == YesNoType.yes)) - { - writer.WriteAttributeString("FixedSize", "yes"); - } - } - if (this.iconFieldSet) - { - if ((this.iconField == YesNoType.no)) - { - writer.WriteAttributeString("Icon", "no"); - } - if ((this.iconField == YesNoType.yes)) - { - writer.WriteAttributeString("Icon", "yes"); - } - } - if (this.bitmapFieldSet) - { - if ((this.bitmapField == YesNoType.no)) - { - writer.WriteAttributeString("Bitmap", "no"); - } - if ((this.bitmapField == YesNoType.yes)) - { - writer.WriteAttributeString("Bitmap", "yes"); - } - } - if (this.pushLikeFieldSet) - { - if ((this.pushLikeField == YesNoType.no)) - { - writer.WriteAttributeString("PushLike", "no"); - } - if ((this.pushLikeField == YesNoType.yes)) - { - writer.WriteAttributeString("PushLike", "yes"); - } - } - if (this.hasBorderFieldSet) - { - if ((this.hasBorderField == YesNoType.no)) - { - writer.WriteAttributeString("HasBorder", "no"); - } - if ((this.hasBorderField == YesNoType.yes)) - { - writer.WriteAttributeString("HasBorder", "yes"); - } - } - if (this.elevationShieldFieldSet) - { - if ((this.elevationShieldField == YesNoType.no)) - { - writer.WriteAttributeString("ElevationShield", "no"); - } - if ((this.elevationShieldField == YesNoType.yes)) - { - writer.WriteAttributeString("ElevationShield", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = value; - this.typeFieldSet = true; - } - if (("X" == name)) - { - this.xField = value; - this.xFieldSet = true; - } - if (("Y" == name)) - { - this.yField = value; - this.yFieldSet = true; - } - if (("Width" == name)) - { - this.widthField = value; - this.widthFieldSet = true; - } - if (("Height" == name)) - { - this.heightField = value; - this.heightFieldSet = true; - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - if (("Text" == name)) - { - this.textField = value; - this.textFieldSet = true; - } - if (("Help" == name)) - { - this.helpField = value; - this.helpFieldSet = true; - } - if (("ToolTip" == name)) - { - this.toolTipField = value; - this.toolTipFieldSet = true; - } - if (("CheckBoxValue" == name)) - { - this.checkBoxValueField = value; - this.checkBoxValueFieldSet = true; - } - if (("CheckBoxPropertyRef" == name)) - { - this.checkBoxPropertyRefField = value; - this.checkBoxPropertyRefFieldSet = true; - } - if (("TabSkip" == name)) - { - this.tabSkipField = Enums.ParseYesNoType(value); - this.tabSkipFieldSet = true; - } - if (("Default" == name)) - { - this.defaultField = Enums.ParseYesNoType(value); - this.defaultFieldSet = true; - } - if (("Cancel" == name)) - { - this.cancelField = Enums.ParseYesNoType(value); - this.cancelFieldSet = true; - } - if (("Hidden" == name)) - { - this.hiddenField = Enums.ParseYesNoType(value); - this.hiddenFieldSet = true; - } - if (("Disabled" == name)) - { - this.disabledField = Enums.ParseYesNoType(value); - this.disabledFieldSet = true; - } - if (("Sunken" == name)) - { - this.sunkenField = Enums.ParseYesNoType(value); - this.sunkenFieldSet = true; - } - if (("Indirect" == name)) - { - this.indirectField = Enums.ParseYesNoType(value); - this.indirectFieldSet = true; - } - if (("Integer" == name)) - { - this.integerField = Enums.ParseYesNoType(value); - this.integerFieldSet = true; - } - if (("RightToLeft" == name)) - { - this.rightToLeftField = Enums.ParseYesNoType(value); - this.rightToLeftFieldSet = true; - } - if (("RightAligned" == name)) - { - this.rightAlignedField = Enums.ParseYesNoType(value); - this.rightAlignedFieldSet = true; - } - if (("LeftScroll" == name)) - { - this.leftScrollField = Enums.ParseYesNoType(value); - this.leftScrollFieldSet = true; - } - if (("Transparent" == name)) - { - this.transparentField = Enums.ParseYesNoType(value); - this.transparentFieldSet = true; - } - if (("NoPrefix" == name)) - { - this.noPrefixField = Enums.ParseYesNoType(value); - this.noPrefixFieldSet = true; - } - if (("NoWrap" == name)) - { - this.noWrapField = Enums.ParseYesNoType(value); - this.noWrapFieldSet = true; - } - if (("FormatSize" == name)) - { - this.formatSizeField = Enums.ParseYesNoType(value); - this.formatSizeFieldSet = true; - } - if (("UserLanguage" == name)) - { - this.userLanguageField = Enums.ParseYesNoType(value); - this.userLanguageFieldSet = true; - } - if (("Multiline" == name)) - { - this.multilineField = Enums.ParseYesNoType(value); - this.multilineFieldSet = true; - } - if (("Password" == name)) - { - this.passwordField = Enums.ParseYesNoType(value); - this.passwordFieldSet = true; - } - if (("ProgressBlocks" == name)) - { - this.progressBlocksField = Enums.ParseYesNoType(value); - this.progressBlocksFieldSet = true; - } - if (("Removable" == name)) - { - this.removableField = Enums.ParseYesNoType(value); - this.removableFieldSet = true; - } - if (("Fixed" == name)) - { - this.fixedField = Enums.ParseYesNoType(value); - this.fixedFieldSet = true; - } - if (("Remote" == name)) - { - this.remoteField = Enums.ParseYesNoType(value); - this.remoteFieldSet = true; - } - if (("CDROM" == name)) - { - this.cDROMField = Enums.ParseYesNoType(value); - this.cDROMFieldSet = true; - } - if (("RAMDisk" == name)) - { - this.rAMDiskField = Enums.ParseYesNoType(value); - this.rAMDiskFieldSet = true; - } - if (("Floppy" == name)) - { - this.floppyField = Enums.ParseYesNoType(value); - this.floppyFieldSet = true; - } - if (("ShowRollbackCost" == name)) - { - this.showRollbackCostField = Enums.ParseYesNoType(value); - this.showRollbackCostFieldSet = true; - } - if (("Sorted" == name)) - { - this.sortedField = Enums.ParseYesNoType(value); - this.sortedFieldSet = true; - } - if (("ComboList" == name)) - { - this.comboListField = Enums.ParseYesNoType(value); - this.comboListFieldSet = true; - } - if (("Image" == name)) - { - this.imageField = Enums.ParseYesNoType(value); - this.imageFieldSet = true; - } - if (("IconSize" == name)) - { - this.iconSizeField = Control.ParseIconSizeType(value); - this.iconSizeFieldSet = true; - } - if (("FixedSize" == name)) - { - this.fixedSizeField = Enums.ParseYesNoType(value); - this.fixedSizeFieldSet = true; - } - if (("Icon" == name)) - { - this.iconField = Enums.ParseYesNoType(value); - this.iconFieldSet = true; - } - if (("Bitmap" == name)) - { - this.bitmapField = Enums.ParseYesNoType(value); - this.bitmapFieldSet = true; - } - if (("PushLike" == name)) - { - this.pushLikeField = Enums.ParseYesNoType(value); - this.pushLikeFieldSet = true; - } - if (("HasBorder" == name)) - { - this.hasBorderField = Enums.ParseYesNoType(value); - this.hasBorderFieldSet = true; - } - if (("ElevationShield" == name)) - { - this.elevationShieldField = Enums.ParseYesNoType(value); - this.elevationShieldFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum IconSizeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - Item16, - - Item32, - - Item48, - } - } - - /// - /// Billboard to display during install of a Feature - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Billboard : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private string featureField; - - private bool featureFieldSet; - - private ISchemaElement parentElement; - - public Billboard() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Control))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for the Billboard. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Feature whose state determines if the Billboard is shown. - /// - public string Feature - { - get - { - return this.featureField; - } - set - { - this.featureFieldSet = true; - this.featureField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Control" == childName)) - { - childValue = new Control(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Billboard", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.featureFieldSet) - { - writer.WriteAttributeString("Feature", this.featureField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Feature" == name)) - { - this.featureField = value; - this.featureFieldSet = true; - } - } - } - - /// - /// Billboard action during which child Billboards are displayed - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class BillboardAction : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public BillboardAction() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Billboard))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Action name that determines when the Billboard should be shown. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Billboard" == childName)) - { - childValue = new Billboard(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("BillboardAction", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Defines a dialog box in the Dialog Table. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Dialog : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private int xField; - - private bool xFieldSet; - - private int yField; - - private bool yFieldSet; - - private int widthField; - - private bool widthFieldSet; - - private int heightField; - - private bool heightFieldSet; - - private string titleField; - - private bool titleFieldSet; - - private YesNoType hiddenField; - - private bool hiddenFieldSet; - - private YesNoType modelessField; - - private bool modelessFieldSet; - - private YesNoType noMinimizeField; - - private bool noMinimizeFieldSet; - - private YesNoType systemModalField; - - private bool systemModalFieldSet; - - private YesNoType keepModelessField; - - private bool keepModelessFieldSet; - - private YesNoType trackDiskSpaceField; - - private bool trackDiskSpaceFieldSet; - - private YesNoType customPaletteField; - - private bool customPaletteFieldSet; - - private YesNoType rightToLeftField; - - private bool rightToLeftFieldSet; - - private YesNoType rightAlignedField; - - private bool rightAlignedFieldSet; - - private YesNoType leftScrollField; - - private bool leftScrollFieldSet; - - private YesNoType errorDialogField; - - private bool errorDialogFieldSet; - - private ISchemaElement parentElement; - - public Dialog() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Control))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Unique identifier for the dialog. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Horizontal placement of the dialog box as a percentage of screen width. The default value is 50. - /// - public int X - { - get - { - return this.xField; - } - set - { - this.xFieldSet = true; - this.xField = value; - } - } - - /// - /// Vertical placement of the dialog box as a percentage of screen height. The default value is 50. - /// - public int Y - { - get - { - return this.yField; - } - set - { - this.yFieldSet = true; - this.yField = value; - } - } - - /// - /// The width of the dialog box in dialog units. - /// - public int Width - { - get - { - return this.widthField; - } - set - { - this.widthFieldSet = true; - this.widthField = value; - } - } - - /// - /// The height of the dialog box in dialog units. - /// - public int Height - { - get - { - return this.heightField; - } - set - { - this.heightFieldSet = true; - this.heightField = value; - } - } - - /// - /// The title of the dialog box. - /// - public string Title - { - get - { - return this.titleField; - } - set - { - this.titleFieldSet = true; - this.titleField = value; - } - } - - /// - /// Used to hide the dialog. - /// - public YesNoType Hidden - { - get - { - return this.hiddenField; - } - set - { - this.hiddenFieldSet = true; - this.hiddenField = value; - } - } - - /// - /// Used to set the dialog as modeless. - /// - public YesNoType Modeless - { - get - { - return this.modelessField; - } - set - { - this.modelessFieldSet = true; - this.modelessField = value; - } - } - - /// - /// Used to specify if the dialog can be minimized. - /// - public YesNoType NoMinimize - { - get - { - return this.noMinimizeField; - } - set - { - this.noMinimizeFieldSet = true; - this.noMinimizeField = value; - } - } - - /// - /// Used to set the dialog as system modal. - /// - public YesNoType SystemModal - { - get - { - return this.systemModalField; - } - set - { - this.systemModalFieldSet = true; - this.systemModalField = value; - } - } - - /// - /// Keep modeless dialogs alive when this dialog is created through DoAction. - /// - public YesNoType KeepModeless - { - get - { - return this.keepModelessField; - } - set - { - this.keepModelessFieldSet = true; - this.keepModelessField = value; - } - } - - /// - /// Have the dialog periodically call the installer to check if available disk space has changed. - /// - public YesNoType TrackDiskSpace - { - get - { - return this.trackDiskSpaceField; - } - set - { - this.trackDiskSpaceFieldSet = true; - this.trackDiskSpaceField = value; - } - } - - /// - /// Used to specify if pictures in the dialog box are rendered with a custom palette. - /// - public YesNoType CustomPalette - { - get - { - return this.customPaletteField; - } - set - { - this.customPaletteFieldSet = true; - this.customPaletteField = value; - } - } - - /// - /// Used to specify if the text in the dialog should be displayed in right to left reading order. - /// - public YesNoType RightToLeft - { - get - { - return this.rightToLeftField; - } - set - { - this.rightToLeftFieldSet = true; - this.rightToLeftField = value; - } - } - - /// - /// Align text on the right. - /// - public YesNoType RightAligned - { - get - { - return this.rightAlignedField; - } - set - { - this.rightAlignedFieldSet = true; - this.rightAlignedField = value; - } - } - - /// - /// Used to align the scroll bar on the left. - /// - public YesNoType LeftScroll - { - get - { - return this.leftScrollField; - } - set - { - this.leftScrollFieldSet = true; - this.leftScrollField = value; - } - } - - /// - /// Specifies this dialog as an error dialog. - /// - public YesNoType ErrorDialog - { - get - { - return this.errorDialogField; - } - set - { - this.errorDialogFieldSet = true; - this.errorDialogField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Control" == childName)) - { - childValue = new Control(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Dialog", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.xFieldSet) - { - writer.WriteAttributeString("X", this.xField.ToString(CultureInfo.InvariantCulture)); - } - if (this.yFieldSet) - { - writer.WriteAttributeString("Y", this.yField.ToString(CultureInfo.InvariantCulture)); - } - if (this.widthFieldSet) - { - writer.WriteAttributeString("Width", this.widthField.ToString(CultureInfo.InvariantCulture)); - } - if (this.heightFieldSet) - { - writer.WriteAttributeString("Height", this.heightField.ToString(CultureInfo.InvariantCulture)); - } - if (this.titleFieldSet) - { - writer.WriteAttributeString("Title", this.titleField); - } - if (this.hiddenFieldSet) - { - if ((this.hiddenField == YesNoType.no)) - { - writer.WriteAttributeString("Hidden", "no"); - } - if ((this.hiddenField == YesNoType.yes)) - { - writer.WriteAttributeString("Hidden", "yes"); - } - } - if (this.modelessFieldSet) - { - if ((this.modelessField == YesNoType.no)) - { - writer.WriteAttributeString("Modeless", "no"); - } - if ((this.modelessField == YesNoType.yes)) - { - writer.WriteAttributeString("Modeless", "yes"); - } - } - if (this.noMinimizeFieldSet) - { - if ((this.noMinimizeField == YesNoType.no)) - { - writer.WriteAttributeString("NoMinimize", "no"); - } - if ((this.noMinimizeField == YesNoType.yes)) - { - writer.WriteAttributeString("NoMinimize", "yes"); - } - } - if (this.systemModalFieldSet) - { - if ((this.systemModalField == YesNoType.no)) - { - writer.WriteAttributeString("SystemModal", "no"); - } - if ((this.systemModalField == YesNoType.yes)) - { - writer.WriteAttributeString("SystemModal", "yes"); - } - } - if (this.keepModelessFieldSet) - { - if ((this.keepModelessField == YesNoType.no)) - { - writer.WriteAttributeString("KeepModeless", "no"); - } - if ((this.keepModelessField == YesNoType.yes)) - { - writer.WriteAttributeString("KeepModeless", "yes"); - } - } - if (this.trackDiskSpaceFieldSet) - { - if ((this.trackDiskSpaceField == YesNoType.no)) - { - writer.WriteAttributeString("TrackDiskSpace", "no"); - } - if ((this.trackDiskSpaceField == YesNoType.yes)) - { - writer.WriteAttributeString("TrackDiskSpace", "yes"); - } - } - if (this.customPaletteFieldSet) - { - if ((this.customPaletteField == YesNoType.no)) - { - writer.WriteAttributeString("CustomPalette", "no"); - } - if ((this.customPaletteField == YesNoType.yes)) - { - writer.WriteAttributeString("CustomPalette", "yes"); - } - } - if (this.rightToLeftFieldSet) - { - if ((this.rightToLeftField == YesNoType.no)) - { - writer.WriteAttributeString("RightToLeft", "no"); - } - if ((this.rightToLeftField == YesNoType.yes)) - { - writer.WriteAttributeString("RightToLeft", "yes"); - } - } - if (this.rightAlignedFieldSet) - { - if ((this.rightAlignedField == YesNoType.no)) - { - writer.WriteAttributeString("RightAligned", "no"); - } - if ((this.rightAlignedField == YesNoType.yes)) - { - writer.WriteAttributeString("RightAligned", "yes"); - } - } - if (this.leftScrollFieldSet) - { - if ((this.leftScrollField == YesNoType.no)) - { - writer.WriteAttributeString("LeftScroll", "no"); - } - if ((this.leftScrollField == YesNoType.yes)) - { - writer.WriteAttributeString("LeftScroll", "yes"); - } - } - if (this.errorDialogFieldSet) - { - if ((this.errorDialogField == YesNoType.no)) - { - writer.WriteAttributeString("ErrorDialog", "no"); - } - if ((this.errorDialogField == YesNoType.yes)) - { - writer.WriteAttributeString("ErrorDialog", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("X" == name)) - { - this.xField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.xFieldSet = true; - } - if (("Y" == name)) - { - this.yField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.yFieldSet = true; - } - if (("Width" == name)) - { - this.widthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.widthFieldSet = true; - } - if (("Height" == name)) - { - this.heightField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.heightFieldSet = true; - } - if (("Title" == name)) - { - this.titleField = value; - this.titleFieldSet = true; - } - if (("Hidden" == name)) - { - this.hiddenField = Enums.ParseYesNoType(value); - this.hiddenFieldSet = true; - } - if (("Modeless" == name)) - { - this.modelessField = Enums.ParseYesNoType(value); - this.modelessFieldSet = true; - } - if (("NoMinimize" == name)) - { - this.noMinimizeField = Enums.ParseYesNoType(value); - this.noMinimizeFieldSet = true; - } - if (("SystemModal" == name)) - { - this.systemModalField = Enums.ParseYesNoType(value); - this.systemModalFieldSet = true; - } - if (("KeepModeless" == name)) - { - this.keepModelessField = Enums.ParseYesNoType(value); - this.keepModelessFieldSet = true; - } - if (("TrackDiskSpace" == name)) - { - this.trackDiskSpaceField = Enums.ParseYesNoType(value); - this.trackDiskSpaceFieldSet = true; - } - if (("CustomPalette" == name)) - { - this.customPaletteField = Enums.ParseYesNoType(value); - this.customPaletteFieldSet = true; - } - if (("RightToLeft" == name)) - { - this.rightToLeftField = Enums.ParseYesNoType(value); - this.rightToLeftFieldSet = true; - } - if (("RightAligned" == name)) - { - this.rightAlignedField = Enums.ParseYesNoType(value); - this.rightAlignedFieldSet = true; - } - if (("LeftScroll" == name)) - { - this.leftScrollField = Enums.ParseYesNoType(value); - this.leftScrollFieldSet = true; - } - if (("ErrorDialog" == name)) - { - this.errorDialogField = Enums.ParseYesNoType(value); - this.errorDialogFieldSet = true; - } - } - } - - /// - /// Reference to a Dialog. This will cause the entire referenced section's contents - /// to be included in the installer database. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class DialogRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identifier of the Dialog to reference. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("DialogRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ProgressText : ISchemaElement, ISetAttributes - { - - private string actionField; - - private bool actionFieldSet; - - private string templateField; - - private bool templateFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - public string Action - { - get - { - return this.actionField; - } - set - { - this.actionFieldSet = true; - this.actionField = value; - } - } - - /// - /// used to format ActionData messages from action processing - /// - public string Template - { - get - { - return this.templateField; - } - set - { - this.templateFieldSet = true; - this.templateField = value; - } - } - - /// - /// Element value is progress message text for action - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProgressText", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.actionFieldSet) - { - writer.WriteAttributeString("Action", this.actionField); - } - if (this.templateFieldSet) - { - writer.WriteAttributeString("Template", this.templateField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Action" == name)) - { - this.actionField = value; - this.actionFieldSet = true; - } - if (("Template" == name)) - { - this.templateField = value; - this.templateFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class TextStyle : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string faceNameField; - - private bool faceNameFieldSet; - - private string sizeField; - - private bool sizeFieldSet; - - private int redField; - - private bool redFieldSet; - - private int greenField; - - private bool greenFieldSet; - - private int blueField; - - private bool blueFieldSet; - - private YesNoType boldField; - - private bool boldFieldSet; - - private YesNoType italicField; - - private bool italicFieldSet; - - private YesNoType underlineField; - - private bool underlineFieldSet; - - private YesNoType strikeField; - - private bool strikeFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public string FaceName - { - get - { - return this.faceNameField; - } - set - { - this.faceNameFieldSet = true; - this.faceNameField = value; - } - } - - public string Size - { - get - { - return this.sizeField; - } - set - { - this.sizeFieldSet = true; - this.sizeField = value; - } - } - - /// - /// 0 to 255 - /// - public int Red - { - get - { - return this.redField; - } - set - { - this.redFieldSet = true; - this.redField = value; - } - } - - /// - /// 0 to 255 - /// - public int Green - { - get - { - return this.greenField; - } - set - { - this.greenFieldSet = true; - this.greenField = value; - } - } - - /// - /// 0 to 255 - /// - public int Blue - { - get - { - return this.blueField; - } - set - { - this.blueFieldSet = true; - this.blueField = value; - } - } - - public YesNoType Bold - { - get - { - return this.boldField; - } - set - { - this.boldFieldSet = true; - this.boldField = value; - } - } - - public YesNoType Italic - { - get - { - return this.italicField; - } - set - { - this.italicFieldSet = true; - this.italicField = value; - } - } - - public YesNoType Underline - { - get - { - return this.underlineField; - } - set - { - this.underlineFieldSet = true; - this.underlineField = value; - } - } - - public YesNoType Strike - { - get - { - return this.strikeField; - } - set - { - this.strikeFieldSet = true; - this.strikeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("TextStyle", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.faceNameFieldSet) - { - writer.WriteAttributeString("FaceName", this.faceNameField); - } - if (this.sizeFieldSet) - { - writer.WriteAttributeString("Size", this.sizeField); - } - if (this.redFieldSet) - { - writer.WriteAttributeString("Red", this.redField.ToString(CultureInfo.InvariantCulture)); - } - if (this.greenFieldSet) - { - writer.WriteAttributeString("Green", this.greenField.ToString(CultureInfo.InvariantCulture)); - } - if (this.blueFieldSet) - { - writer.WriteAttributeString("Blue", this.blueField.ToString(CultureInfo.InvariantCulture)); - } - if (this.boldFieldSet) - { - if ((this.boldField == YesNoType.no)) - { - writer.WriteAttributeString("Bold", "no"); - } - if ((this.boldField == YesNoType.yes)) - { - writer.WriteAttributeString("Bold", "yes"); - } - } - if (this.italicFieldSet) - { - if ((this.italicField == YesNoType.no)) - { - writer.WriteAttributeString("Italic", "no"); - } - if ((this.italicField == YesNoType.yes)) - { - writer.WriteAttributeString("Italic", "yes"); - } - } - if (this.underlineFieldSet) - { - if ((this.underlineField == YesNoType.no)) - { - writer.WriteAttributeString("Underline", "no"); - } - if ((this.underlineField == YesNoType.yes)) - { - writer.WriteAttributeString("Underline", "yes"); - } - } - if (this.strikeFieldSet) - { - if ((this.strikeField == YesNoType.no)) - { - writer.WriteAttributeString("Strike", "no"); - } - if ((this.strikeField == YesNoType.yes)) - { - writer.WriteAttributeString("Strike", "yes"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("FaceName" == name)) - { - this.faceNameField = value; - this.faceNameFieldSet = true; - } - if (("Size" == name)) - { - this.sizeField = value; - this.sizeFieldSet = true; - } - if (("Red" == name)) - { - this.redField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.redFieldSet = true; - } - if (("Green" == name)) - { - this.greenField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.greenFieldSet = true; - } - if (("Blue" == name)) - { - this.blueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.blueFieldSet = true; - } - if (("Bold" == name)) - { - this.boldField = Enums.ParseYesNoType(value); - this.boldFieldSet = true; - } - if (("Italic" == name)) - { - this.italicField = Enums.ParseYesNoType(value); - this.italicFieldSet = true; - } - if (("Underline" == name)) - { - this.underlineField = Enums.ParseYesNoType(value); - this.underlineFieldSet = true; - } - if (("Strike" == name)) - { - this.strikeField = Enums.ParseYesNoType(value); - this.strikeFieldSet = true; - } - } - } - - /// - /// The value (and optional text) associated with an item in a ComboBox, ListBox, or ListView. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ListItem : ISchemaElement, ISetAttributes - { - - private string valueField; - - private bool valueFieldSet; - - private string textField; - - private bool textFieldSet; - - private string iconField; - - private bool iconFieldSet; - - private ISchemaElement parentElement; - - /// - /// The value assigned to the associated ComboBox, ListBox, or ListView property if this item is selected. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - /// - /// The localizable, visible text to be assigned to the item. - /// If not specified, this will default to the value of the Value attribute. - /// - public string Text - { - get - { - return this.textField; - } - set - { - this.textFieldSet = true; - this.textField = value; - } - } - - /// - /// The identifier of the Binary (not Icon) element containing the icon to associate with this item. - /// This value is only valid when nested under a ListView element. - /// - public string Icon - { - get - { - return this.iconField; - } - set - { - this.iconFieldSet = true; - this.iconField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ListItem", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.textFieldSet) - { - writer.WriteAttributeString("Text", this.textField); - } - if (this.iconFieldSet) - { - writer.WriteAttributeString("Icon", this.iconField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Text" == name)) - { - this.textField = value; - this.textFieldSet = true; - } - if (("Icon" == name)) - { - this.iconField = value; - this.iconFieldSet = true; - } - } - } - - /// - /// Set of items for a particular ListBox control tied to an install Property - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ListBox : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string propertyField; - - private bool propertyFieldSet; - - private ISchemaElement parentElement; - - public ListBox() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Property tied to this group - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ListItem" == childName)) - { - childValue = new ListItem(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ListBox", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - } - } - - /// - /// Set of items for a particular ComboBox control tied to an install Property - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ComboBox : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string propertyField; - - private bool propertyFieldSet; - - private ISchemaElement parentElement; - - public ComboBox() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Property tied to this group - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ListItem" == childName)) - { - childValue = new ListItem(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ComboBox", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - } - } - - /// - /// Set of items for a particular ListView control tied to an install Property - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ListView : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string propertyField; - - private bool propertyFieldSet; - - private ISchemaElement parentElement; - - public ListView() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Property tied to this group - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("ListItem" == childName)) - { - childValue = new ListItem(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ListView", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - } - } - - /// - /// Text or Icon plus Value that is assigned to the Property of the parent Control (RadioButtonGroup). - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RadioButton : ISchemaElement, ISetAttributes - { - - private string bitmapField; - - private bool bitmapFieldSet; - - private string heightField; - - private bool heightFieldSet; - - private string helpField; - - private bool helpFieldSet; - - private string iconField; - - private bool iconFieldSet; - - private string textField; - - private bool textFieldSet; - - private string toolTipField; - - private bool toolTipFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private string widthField; - - private bool widthFieldSet; - - private string xField; - - private bool xFieldSet; - - private string yField; - - private bool yFieldSet; - - private ISchemaElement parentElement; - - /// - /// This attribute defines the bitmap displayed with the radio button. The value of the attribute creates a reference - /// to a Binary element that represents the bitmap. This attribute is mutually exclusive with the Icon and Text - /// attributes. - /// - public string Bitmap - { - get - { - return this.bitmapField; - } - set - { - this.bitmapFieldSet = true; - this.bitmapField = value; - } - } - - public string Height - { - get - { - return this.heightField; - } - set - { - this.heightFieldSet = true; - this.heightField = value; - } - } - - public string Help - { - get - { - return this.helpField; - } - set - { - this.helpFieldSet = true; - this.helpField = value; - } - } - - /// - /// This attribute defines the icon displayed with the radio button. The value of the attribute creates a reference - /// to a Binary element that represents the icon. This attribute is mutually exclusive with the Bitmap and Text - /// attributes. - /// - public string Icon - { - get - { - return this.iconField; - } - set - { - this.iconFieldSet = true; - this.iconField = value; - } - } - - /// - /// Text displayed with the radio button. This attribute is mutually exclusive with the Bitmap and Icon attributes. - /// - public string Text - { - get - { - return this.textField; - } - set - { - this.textFieldSet = true; - this.textField = value; - } - } - - public string ToolTip - { - get - { - return this.toolTipField; - } - set - { - this.toolTipFieldSet = true; - this.toolTipField = value; - } - } - - /// - /// Value assigned to the associated control Property when this radio button is selected. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public string Width - { - get - { - return this.widthField; - } - set - { - this.widthFieldSet = true; - this.widthField = value; - } - } - - public string X - { - get - { - return this.xField; - } - set - { - this.xFieldSet = true; - this.xField = value; - } - } - - public string Y - { - get - { - return this.yField; - } - set - { - this.yFieldSet = true; - this.yField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RadioButton", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.bitmapFieldSet) - { - writer.WriteAttributeString("Bitmap", this.bitmapField); - } - if (this.heightFieldSet) - { - writer.WriteAttributeString("Height", this.heightField); - } - if (this.helpFieldSet) - { - writer.WriteAttributeString("Help", this.helpField); - } - if (this.iconFieldSet) - { - writer.WriteAttributeString("Icon", this.iconField); - } - if (this.textFieldSet) - { - writer.WriteAttributeString("Text", this.textField); - } - if (this.toolTipFieldSet) - { - writer.WriteAttributeString("ToolTip", this.toolTipField); - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - if (this.widthFieldSet) - { - writer.WriteAttributeString("Width", this.widthField); - } - if (this.xFieldSet) - { - writer.WriteAttributeString("X", this.xField); - } - if (this.yFieldSet) - { - writer.WriteAttributeString("Y", this.yField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Bitmap" == name)) - { - this.bitmapField = value; - this.bitmapFieldSet = true; - } - if (("Height" == name)) - { - this.heightField = value; - this.heightFieldSet = true; - } - if (("Help" == name)) - { - this.helpField = value; - this.helpFieldSet = true; - } - if (("Icon" == name)) - { - this.iconField = value; - this.iconFieldSet = true; - } - if (("Text" == name)) - { - this.textField = value; - this.textFieldSet = true; - } - if (("ToolTip" == name)) - { - this.toolTipField = value; - this.toolTipFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - if (("Width" == name)) - { - this.widthField = value; - this.widthFieldSet = true; - } - if (("X" == name)) - { - this.xField = value; - this.xFieldSet = true; - } - if (("Y" == name)) - { - this.yField = value; - this.yFieldSet = true; - } - } - } - - /// - /// Set of radio buttons tied to the specified Property - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class RadioButtonGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string propertyField; - - private bool propertyFieldSet; - - private ISchemaElement parentElement; - - public RadioButtonGroup() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RadioButton))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Property tied to this group. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("RadioButton" == childName)) - { - childValue = new RadioButton(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("RadioButtonGroup", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - } - } - - /// - /// Text associated with certain controls - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UIText : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Element value is text, may use CDATA if needed to escape XML delimiters - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UIText", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Reference to a UI element. This will force the entire referenced Fragment's contents - /// to be included in the installer database. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UIRef : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UIRef", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Enclosing element to compartmentalize UI specifications. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class UI : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - public UI() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedUI))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Error))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgressText))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BillboardAction))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComboBox))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ListBox))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ListView))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RadioButtonGroup))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TextStyle))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIText))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Dialog))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DialogRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Publish))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); - ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); - childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); - childCollection0.AddCollection(childCollection1); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("EmbeddedUI" == childName)) - { - childValue = new EmbeddedUI(); - } - if (("Error" == childName)) - { - childValue = new Error(); - } - if (("ProgressText" == childName)) - { - childValue = new ProgressText(); - } - if (("BillboardAction" == childName)) - { - childValue = new BillboardAction(); - } - if (("ComboBox" == childName)) - { - childValue = new ComboBox(); - } - if (("ListBox" == childName)) - { - childValue = new ListBox(); - } - if (("ListView" == childName)) - { - childValue = new ListView(); - } - if (("RadioButtonGroup" == childName)) - { - childValue = new RadioButtonGroup(); - } - if (("TextStyle" == childName)) - { - childValue = new TextStyle(); - } - if (("UIText" == childName)) - { - childValue = new UIText(); - } - if (("Dialog" == childName)) - { - childValue = new Dialog(); - } - if (("DialogRef" == childName)) - { - childValue = new DialogRef(); - } - if (("Publish" == childName)) - { - childValue = new Publish(); - } - if (("PropertyRef" == childName)) - { - childValue = new PropertyRef(); - } - if (("Property" == childName)) - { - childValue = new Property(); - } - if (("Binary" == childName)) - { - childValue = new Binary(); - } - if (("AdminUISequence" == childName)) - { - childValue = new AdminUISequence(); - } - if (("InstallUISequence" == childName)) - { - childValue = new InstallUISequence(); - } - if (("UIRef" == childName)) - { - childValue = new UIRef(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("UI", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// Defines a custom table for use from a custom action. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class CustomTable : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string idField; - - private bool idFieldSet; - - private YesNoType bootstrapperApplicationDataField; - - private bool bootstrapperApplicationDataFieldSet; - - private ISchemaElement parentElement; - - public CustomTable() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Column))); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Row))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// Identifier for the custom table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Indicates the table data is transformed into the bootstrapper application data manifest. - /// - public YesNoType BootstrapperApplicationData - { - get - { - return this.bootstrapperApplicationDataField; - } - set - { - this.bootstrapperApplicationDataFieldSet = true; - this.bootstrapperApplicationDataField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Column" == childName)) - { - childValue = new Column(); - } - if (("Row" == childName)) - { - childValue = new Row(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("CustomTable", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.bootstrapperApplicationDataFieldSet) - { - if ((this.bootstrapperApplicationDataField == YesNoType.no)) - { - writer.WriteAttributeString("BootstrapperApplicationData", "no"); - } - if ((this.bootstrapperApplicationDataField == YesNoType.yes)) - { - writer.WriteAttributeString("BootstrapperApplicationData", "yes"); - } - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("BootstrapperApplicationData" == name)) - { - this.bootstrapperApplicationDataField = Enums.ParseYesNoType(value); - this.bootstrapperApplicationDataFieldSet = true; - } - } - } - - /// - /// Column definition for a Custom Table - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Column : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType primaryKeyField; - - private bool primaryKeyFieldSet; - - private TypeType typeField; - - private bool typeFieldSet; - - private int widthField; - - private bool widthFieldSet; - - private YesNoType nullableField; - - private bool nullableFieldSet; - - private YesNoType localizableField; - - private bool localizableFieldSet; - - private long minValueField; - - private bool minValueFieldSet; - - private long maxValueField; - - private bool maxValueFieldSet; - - private string keyTableField; - - private bool keyTableFieldSet; - - private int keyColumnField; - - private bool keyColumnFieldSet; - - private CategoryType categoryField; - - private bool categoryFieldSet; - - private string setField; - - private bool setFieldSet; - - private string descriptionField; - - private bool descriptionFieldSet; - - private ModularizeType modularizeField; - - private bool modularizeFieldSet; - - private ISchemaElement parentElement; - - /// - /// Identifier for the column. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Whether this column is a primary key. - /// - public YesNoType PrimaryKey - { - get - { - return this.primaryKeyField; - } - set - { - this.primaryKeyFieldSet = true; - this.primaryKeyField = value; - } - } - - /// - /// The type of this column. - /// - public TypeType Type - { - get - { - return this.typeField; - } - set - { - this.typeFieldSet = true; - this.typeField = value; - } - } - - /// - /// Width of this column. - /// - public int Width - { - get - { - return this.widthField; - } - set - { - this.widthFieldSet = true; - this.widthField = value; - } - } - - /// - /// Whether this column can be left null. - /// - public YesNoType Nullable - { - get - { - return this.nullableField; - } - set - { - this.nullableFieldSet = true; - this.nullableField = value; - } - } - - /// - /// Whether this column can be localized. - /// - public YesNoType Localizable - { - get - { - return this.localizableField; - } - set - { - this.localizableFieldSet = true; - this.localizableField = value; - } - } - - /// - /// Minimum value for a numeric value, date or version in this column. - /// - public long MinValue - { - get - { - return this.minValueField; - } - set - { - this.minValueFieldSet = true; - this.minValueField = value; - } - } - - /// - /// Maximum value for a numeric value, date or version in this column. - /// - public long MaxValue - { - get - { - return this.maxValueField; - } - set - { - this.maxValueFieldSet = true; - this.maxValueField = value; - } - } - - /// - /// Table in which this column is an external key. Can be semicolon delimited. - /// - public string KeyTable - { - get - { - return this.keyTableField; - } - set - { - this.keyTableFieldSet = true; - this.keyTableField = value; - } - } - - /// - /// Column in the table in KeyTable attribute. - /// - public int KeyColumn - { - get - { - return this.keyColumnField; - } - set - { - this.keyColumnFieldSet = true; - this.keyColumnField = value; - } - } - - /// - /// Category of this column. - /// This attribute must be specified with a value of 'Binary' if the Type attribute's value is 'binary'. - /// - public CategoryType Category - { - get - { - return this.categoryField; - } - set - { - this.categoryFieldSet = true; - this.categoryField = value; - } - } - - /// - /// Semicolon delimited list of permissible values. - /// - public string Set - { - get - { - return this.setField; - } - set - { - this.setFieldSet = true; - this.setField = value; - } - } - - /// - /// Description of this column. - /// - public string Description - { - get - { - return this.descriptionField; - } - set - { - this.descriptionFieldSet = true; - this.descriptionField = value; - } - } - - /// - /// How this column should be modularized, if at all. - /// - public ModularizeType Modularize - { - get - { - return this.modularizeField; - } - set - { - this.modularizeFieldSet = true; - this.modularizeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a TypeType from a string. - /// - public static TypeType ParseTypeType(string value) - { - TypeType parsedValue; - Column.TryParseTypeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a TypeType from a string. - /// - public static bool TryParseTypeType(string value, out TypeType parsedValue) - { - parsedValue = TypeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("binary" == value)) - { - parsedValue = TypeType.binary; - } - else - { - if (("int" == value)) - { - parsedValue = TypeType.@int; - } - else - { - if (("string" == value)) - { - parsedValue = TypeType.@string; - } - else - { - parsedValue = TypeType.IllegalValue; - return false; - } - } - } - return true; - } - - /// - /// Parses a CategoryType from a string. - /// - public static CategoryType ParseCategoryType(string value) - { - CategoryType parsedValue; - Column.TryParseCategoryType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a CategoryType from a string. - /// - public static bool TryParseCategoryType(string value, out CategoryType parsedValue) - { - parsedValue = CategoryType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("Text" == value)) - { - parsedValue = CategoryType.text; - } - else - { - if (("UpperCase" == value)) - { - parsedValue = CategoryType.upperCase; - } - else - { - if (("LowerCase" == value)) - { - parsedValue = CategoryType.lowerCase; - } - else - { - if (("Integer" == value)) - { - parsedValue = CategoryType.integer; - } - else - { - if (("DoubleInteger" == value)) - { - parsedValue = CategoryType.doubleInteger; - } - else - { - if (("TimeDate" == value)) - { - parsedValue = CategoryType.timeDate; - } - else - { - if (("Identifier" == value)) - { - parsedValue = CategoryType.identifier; - } - else - { - if (("Property" == value)) - { - parsedValue = CategoryType.property; - } - else - { - if (("Filename" == value)) - { - parsedValue = CategoryType.filename; - } - else - { - if (("WildCardFilename" == value)) - { - parsedValue = CategoryType.wildCardFilename; - } - else - { - if (("Path" == value)) - { - parsedValue = CategoryType.path; - } - else - { - if (("Paths" == value)) - { - parsedValue = CategoryType.paths; - } - else - { - if (("AnyPath" == value)) - { - parsedValue = CategoryType.anyPath; - } - else - { - if (("DefaultDir" == value)) - { - parsedValue = CategoryType.defaultDir; - } - else - { - if (("RegPath" == value)) - { - parsedValue = CategoryType.regPath; - } - else - { - if (("Formatted" == value)) - { - parsedValue = CategoryType.formatted; - } - else - { - if (("FormattedSddl" == value)) - { - parsedValue = CategoryType.formattedSddl; - } - else - { - if (("Template" == value)) - { - parsedValue = CategoryType.template; - } - else - { - if (("Condition" == value)) - { - parsedValue = CategoryType.condition; - } - else - { - if (("Guid" == value)) - { - parsedValue = CategoryType.guid; - } - else - { - if (("Version" == value)) - { - parsedValue = CategoryType.version; - } - else - { - if (("Language" == value)) - { - parsedValue = CategoryType.language; - } - else - { - if (("Binary" == value)) - { - parsedValue = CategoryType.binary; - } - else - { - if (("CustomSource" == value)) - { - parsedValue = CategoryType.customSource; - } - else - { - if (("Cabinet" == value)) - { - parsedValue = CategoryType.cabinet; - } - else - { - if (("Shortcut" == value)) - { - parsedValue = CategoryType.shortcut; - } - else - { - parsedValue = CategoryType.IllegalValue; - return false; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return true; - } - - /// - /// Parses a ModularizeType from a string. - /// - public static ModularizeType ParseModularizeType(string value) - { - ModularizeType parsedValue; - Column.TryParseModularizeType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ModularizeType from a string. - /// - public static bool TryParseModularizeType(string value, out ModularizeType parsedValue) - { - parsedValue = ModularizeType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("None" == value)) - { - parsedValue = ModularizeType.None; - } - else - { - if (("Column" == value)) - { - parsedValue = ModularizeType.Column; - } - else - { - if (("Condition" == value)) - { - parsedValue = ModularizeType.Condition; - } - else - { - if (("Icon" == value)) - { - parsedValue = ModularizeType.Icon; - } - else - { - if (("Property" == value)) - { - parsedValue = ModularizeType.Property; - } - else - { - if (("SemicolonDelimited" == value)) - { - parsedValue = ModularizeType.SemicolonDelimited; - } - else - { - parsedValue = ModularizeType.IllegalValue; - return false; - } - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Column", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.primaryKeyFieldSet) - { - if ((this.primaryKeyField == YesNoType.no)) - { - writer.WriteAttributeString("PrimaryKey", "no"); - } - if ((this.primaryKeyField == YesNoType.yes)) - { - writer.WriteAttributeString("PrimaryKey", "yes"); - } - } - if (this.typeFieldSet) - { - if ((this.typeField == TypeType.binary)) - { - writer.WriteAttributeString("Type", "binary"); - } - if ((this.typeField == TypeType.@int)) - { - writer.WriteAttributeString("Type", "int"); - } - if ((this.typeField == TypeType.@string)) - { - writer.WriteAttributeString("Type", "string"); - } - } - if (this.widthFieldSet) - { - writer.WriteAttributeString("Width", this.widthField.ToString(CultureInfo.InvariantCulture)); - } - if (this.nullableFieldSet) - { - if ((this.nullableField == YesNoType.no)) - { - writer.WriteAttributeString("Nullable", "no"); - } - if ((this.nullableField == YesNoType.yes)) - { - writer.WriteAttributeString("Nullable", "yes"); - } - } - if (this.localizableFieldSet) - { - if ((this.localizableField == YesNoType.no)) - { - writer.WriteAttributeString("Localizable", "no"); - } - if ((this.localizableField == YesNoType.yes)) - { - writer.WriteAttributeString("Localizable", "yes"); - } - } - if (this.minValueFieldSet) - { - writer.WriteAttributeString("MinValue", this.minValueField.ToString(CultureInfo.InvariantCulture)); - } - if (this.maxValueFieldSet) - { - writer.WriteAttributeString("MaxValue", this.maxValueField.ToString(CultureInfo.InvariantCulture)); - } - if (this.keyTableFieldSet) - { - writer.WriteAttributeString("KeyTable", this.keyTableField); - } - if (this.keyColumnFieldSet) - { - writer.WriteAttributeString("KeyColumn", this.keyColumnField.ToString(CultureInfo.InvariantCulture)); - } - if (this.categoryFieldSet) - { - if ((this.categoryField == CategoryType.text)) - { - writer.WriteAttributeString("Category", "text"); - } - if ((this.categoryField == CategoryType.upperCase)) - { - writer.WriteAttributeString("Category", "upperCase"); - } - if ((this.categoryField == CategoryType.lowerCase)) - { - writer.WriteAttributeString("Category", "lowerCase"); - } - if ((this.categoryField == CategoryType.integer)) - { - writer.WriteAttributeString("Category", "integer"); - } - if ((this.categoryField == CategoryType.doubleInteger)) - { - writer.WriteAttributeString("Category", "doubleInteger"); - } - if ((this.categoryField == CategoryType.timeDate)) - { - writer.WriteAttributeString("Category", "timeDate"); - } - if ((this.categoryField == CategoryType.identifier)) - { - writer.WriteAttributeString("Category", "identifier"); - } - if ((this.categoryField == CategoryType.property)) - { - writer.WriteAttributeString("Category", "property"); - } - if ((this.categoryField == CategoryType.filename)) - { - writer.WriteAttributeString("Category", "filename"); - } - if ((this.categoryField == CategoryType.wildCardFilename)) - { - writer.WriteAttributeString("Category", "wildCardFilename"); - } - if ((this.categoryField == CategoryType.path)) - { - writer.WriteAttributeString("Category", "path"); - } - if ((this.categoryField == CategoryType.paths)) - { - writer.WriteAttributeString("Category", "paths"); - } - if ((this.categoryField == CategoryType.anyPath)) - { - writer.WriteAttributeString("Category", "anyPath"); - } - if ((this.categoryField == CategoryType.defaultDir)) - { - writer.WriteAttributeString("Category", "defaultDir"); - } - if ((this.categoryField == CategoryType.regPath)) - { - writer.WriteAttributeString("Category", "regPath"); - } - if ((this.categoryField == CategoryType.formatted)) - { - writer.WriteAttributeString("Category", "formatted"); - } - if ((this.categoryField == CategoryType.formattedSddl)) - { - writer.WriteAttributeString("Category", "formattedSddl"); - } - if ((this.categoryField == CategoryType.template)) - { - writer.WriteAttributeString("Category", "template"); - } - if ((this.categoryField == CategoryType.condition)) - { - writer.WriteAttributeString("Category", "condition"); - } - if ((this.categoryField == CategoryType.guid)) - { - writer.WriteAttributeString("Category", "guid"); - } - if ((this.categoryField == CategoryType.version)) - { - writer.WriteAttributeString("Category", "version"); - } - if ((this.categoryField == CategoryType.language)) - { - writer.WriteAttributeString("Category", "language"); - } - if ((this.categoryField == CategoryType.binary)) - { - writer.WriteAttributeString("Category", "Binary"); - } - if ((this.categoryField == CategoryType.customSource)) - { - writer.WriteAttributeString("Category", "customSource"); - } - if ((this.categoryField == CategoryType.cabinet)) - { - writer.WriteAttributeString("Category", "cabinet"); - } - if ((this.categoryField == CategoryType.shortcut)) - { - writer.WriteAttributeString("Category", "shortcut"); - } - } - if (this.setFieldSet) - { - writer.WriteAttributeString("Set", this.setField); - } - if (this.descriptionFieldSet) - { - writer.WriteAttributeString("Description", this.descriptionField); - } - if (this.modularizeFieldSet) - { - if ((this.modularizeField == ModularizeType.None)) - { - writer.WriteAttributeString("Modularize", "None"); - } - if ((this.modularizeField == ModularizeType.Column)) - { - writer.WriteAttributeString("Modularize", "Column"); - } - if ((this.modularizeField == ModularizeType.Condition)) - { - writer.WriteAttributeString("Modularize", "Condition"); - } - if ((this.modularizeField == ModularizeType.Icon)) - { - writer.WriteAttributeString("Modularize", "Icon"); - } - if ((this.modularizeField == ModularizeType.Property)) - { - writer.WriteAttributeString("Modularize", "Property"); - } - if ((this.modularizeField == ModularizeType.SemicolonDelimited)) - { - writer.WriteAttributeString("Modularize", "SemicolonDelimited"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("PrimaryKey" == name)) - { - this.primaryKeyField = Enums.ParseYesNoType(value); - this.primaryKeyFieldSet = true; - } - if (("Type" == name)) - { - this.typeField = Column.ParseTypeType(value); - this.typeFieldSet = true; - } - if (("Width" == name)) - { - this.widthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.widthFieldSet = true; - } - if (("Nullable" == name)) - { - this.nullableField = Enums.ParseYesNoType(value); - this.nullableFieldSet = true; - } - if (("Localizable" == name)) - { - this.localizableField = Enums.ParseYesNoType(value); - this.localizableFieldSet = true; - } - if (("MinValue" == name)) - { - this.minValueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.minValueFieldSet = true; - } - if (("MaxValue" == name)) - { - this.maxValueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.maxValueFieldSet = true; - } - if (("KeyTable" == name)) - { - this.keyTableField = value; - this.keyTableFieldSet = true; - } - if (("KeyColumn" == name)) - { - this.keyColumnField = Convert.ToInt32(value, CultureInfo.InvariantCulture); - this.keyColumnFieldSet = true; - } - if (("Category" == name)) - { - this.categoryField = Column.ParseCategoryType(value); - this.categoryFieldSet = true; - } - if (("Set" == name)) - { - this.setField = value; - this.setFieldSet = true; - } - if (("Description" == name)) - { - this.descriptionField = value; - this.descriptionFieldSet = true; - } - if (("Modularize" == name)) - { - this.modularizeField = Column.ParseModularizeType(value); - this.modularizeFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum TypeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Column contains a path to a file that will be inserted into the column as a binary object. - /// If this value is set, the Category attribute must also be set with a value of 'Binary' to pass ICE validation. - /// - binary, - - /// - /// Column contains an integer or datetime value (the MinValue and MaxValue attributes should also be set). - /// - @int, - - /// - /// Column contains a non-localizable string value. - /// - @string, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum CategoryType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - text, - - upperCase, - - lowerCase, - - integer, - - doubleInteger, - - timeDate, - - identifier, - - property, - - filename, - - wildCardFilename, - - path, - - paths, - - anyPath, - - defaultDir, - - regPath, - - formatted, - - formattedSddl, - - template, - - condition, - - guid, - - version, - - language, - - binary, - - customSource, - - cabinet, - - shortcut, - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ModularizeType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// Column should not be modularized. This is the default value. - /// - None, - - /// - /// Column should be modularized. - /// - Column, - - /// - /// Column is a condition and should be modularized. - /// - Condition, - - /// - /// When the column is an primary or foreign key to the Icon table it should be modularized special. - /// - Icon, - - /// - /// Any Properties in the column should be modularized. - /// - Property, - - /// - /// Semi-colon list of keys, all of which need to be modularized. - /// - SemicolonDelimited, - } - } - - /// - /// Row data for a Custom Table - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Row : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private ISchemaElement parentElement; - - public Row() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); - childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Data))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Data" == childName)) - { - childValue = new Data(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Row", "http://wixtoolset.org/schemas/v4/wxs"); - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - } - } - - /// - /// Used for a Custom Table. Specifies the data for the parent Row and specified Column. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Data : ISchemaElement, ISetAttributes - { - - private string columnField; - - private bool columnFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Specifies in which column to insert this data. - /// - public string Column - { - get - { - return this.columnField; - } - set - { - this.columnFieldSet = true; - this.columnField = value; - } - } - - /// - /// A data value - /// - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Data", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.columnFieldSet) - { - writer.WriteAttributeString("Column", this.columnField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Column" == name)) - { - this.columnField = value; - this.columnFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } - - /// - /// Use this element to ensure that a table appears in the installer database, even if its empty. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class EnsureTable : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of the table. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("EnsureTable", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - } - } - - /// - /// This element exposes advanced WiX functionality. Use this element to declare WiX variables - /// from directly within your authoring. WiX variables are not resolved until the final msi/msm/pcp - /// file is actually generated. WiX variables do not persist into the msi/msm/pcp file, so they cannot - /// be used when an MSI file is being installed; it's a WiX-only concept. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class WixVariable : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private YesNoType overridableField; - - private bool overridableFieldSet; - - private string valueField; - - private bool valueFieldSet; - - private ISchemaElement parentElement; - - /// - /// The name of the variable. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// Set this value to 'yes' in order to make the variable's value overridable either by - /// another WixVariable entry or via the command-line option -d<name>=<value> - /// for light.exe. If the same variable is declared overridable in multiple places it - /// will cause an error (since WiX won't know which value is correct). The default value - /// is 'no'. - /// - public YesNoType Overridable - { - get - { - return this.overridableField; - } - set - { - this.overridableFieldSet = true; - this.overridableField = value; - } - } - - /// - /// The value of the variable. The value cannot be an empty string because that would - /// make it possible to accidentally set a column to null. - /// - public string Value - { - get - { - return this.valueField; - } - set - { - this.valueFieldSet = true; - this.valueField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("WixVariable", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.overridableFieldSet) - { - if ((this.overridableField == YesNoType.no)) - { - writer.WriteAttributeString("Overridable", "no"); - } - if ((this.overridableField == YesNoType.yes)) - { - writer.WriteAttributeString("Overridable", "yes"); - } - } - if (this.valueFieldSet) - { - writer.WriteAttributeString("Value", this.valueField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("Overridable" == name)) - { - this.overridableField = Enums.ParseYesNoType(value); - this.overridableFieldSet = true; - } - if (("Value" == name)) - { - this.valueField = value; - this.valueFieldSet = true; - } - } - } - - /// - /// Use this element to contain definitions for instance transforms. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class InstanceTransforms : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes - { - - private ElementCollection children; - - private string propertyField; - - private bool propertyFieldSet; - - private ISchemaElement parentElement; - - public InstanceTransforms() - { - ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); - childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Instance))); - this.children = childCollection0; - } - - public virtual IEnumerable Children - { - get - { - return this.children; - } - } - - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] - public virtual IEnumerable this[System.Type childType] - { - get - { - return this.children.Filter(childType); - } - } - - /// - /// The Id of the Property who's value should change for each instance. - /// - public string Property - { - get - { - return this.propertyField; - } - set - { - this.propertyFieldSet = true; - this.propertyField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - public virtual void AddChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.AddElement(child); - child.ParentElement = this; - } - - public virtual void RemoveChild(ISchemaElement child) - { - if ((null == child)) - { - throw new ArgumentNullException("child"); - } - this.children.RemoveElement(child); - child.ParentElement = null; - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ISchemaElement ICreateChildren.CreateChild(string childName) - { - if (String.IsNullOrEmpty(childName)) - { - throw new ArgumentNullException("childName"); - } - ISchemaElement childValue = null; - if (("Instance" == childName)) - { - childValue = new Instance(); - } - if ((null == childValue)) - { - throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); - } - return childValue; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("InstanceTransforms", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.propertyFieldSet) - { - writer.WriteAttributeString("Property", this.propertyField); - } - for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) - { - ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); - childElement.OutputXml(writer); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Property" == name)) - { - this.propertyField = value; - this.propertyFieldSet = true; - } - } - } - - /// - /// Defines an instance transform for your product. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class Instance : ISchemaElement, ISetAttributes - { - - private string idField; - - private bool idFieldSet; - - private string productCodeField; - - private bool productCodeFieldSet; - - private string productNameField; - - private bool productNameFieldSet; - - private string upgradeCodeField; - - private bool upgradeCodeFieldSet; - - private ISchemaElement parentElement; - - /// - /// The identity of the instance transform. This value will define the name by which the instance - /// should be referred to on the command line. In addition, the value of the this attribute will - /// determine what the value of the property specified in Property attribute on InstanceTransforms - /// will change to for each instance. - /// - public string Id - { - get - { - return this.idField; - } - set - { - this.idFieldSet = true; - this.idField = value; - } - } - - /// - /// The ProductCode for this instance. - /// - public string ProductCode - { - get - { - return this.productCodeField; - } - set - { - this.productCodeFieldSet = true; - this.productCodeField = value; - } - } - - /// - /// The ProductName for this instance. - /// - public string ProductName - { - get - { - return this.productNameField; - } - set - { - this.productNameFieldSet = true; - this.productNameField = value; - } - } - - /// - /// The UpgradeCode for this instance. - /// - public string UpgradeCode - { - get - { - return this.upgradeCodeField; - } - set - { - this.upgradeCodeFieldSet = true; - this.upgradeCodeField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("Instance", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.idFieldSet) - { - writer.WriteAttributeString("Id", this.idField); - } - if (this.productCodeFieldSet) - { - writer.WriteAttributeString("ProductCode", this.productCodeField); - } - if (this.productNameFieldSet) - { - writer.WriteAttributeString("ProductName", this.productNameField); - } - if (this.upgradeCodeFieldSet) - { - writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Id" == name)) - { - this.idField = value; - this.idFieldSet = true; - } - if (("ProductCode" == name)) - { - this.productCodeField = value; - this.productCodeFieldSet = true; - } - if (("ProductName" == name)) - { - this.productNameField = value; - this.productNameFieldSet = true; - } - if (("UpgradeCode" == name)) - { - this.upgradeCodeField = value; - this.upgradeCodeFieldSet = true; - } - } - } - - /// - /// Simplifies authoring for major upgrades, including support for preventing downgrades. - /// - /// The parent Package element must have valid UpgradeCode and Version attributes. - /// - /// When the FindRelatedProducts action detects a related product installed on the system, - /// it appends the product code to the property named WIX_UPGRADE_DETECTED. After the - /// FindRelatedProducts action is run, the value of the WIX_UPGRADE_DETECTED property is a - /// list of product codes, separated by semicolons (;), detected on the system. - /// - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class MajorUpgrade : ISchemaElement, ISetAttributes - { - - private YesNoType allowDowngradesField; - - private bool allowDowngradesFieldSet; - - private YesNoType allowSameVersionUpgradesField; - - private bool allowSameVersionUpgradesFieldSet; - - private YesNoType disallowField; - - private bool disallowFieldSet; - - private string downgradeErrorMessageField; - - private bool downgradeErrorMessageFieldSet; - - private string disallowUpgradeErrorMessageField; - - private bool disallowUpgradeErrorMessageFieldSet; - - private YesNoType migrateFeaturesField; - - private bool migrateFeaturesFieldSet; - - private YesNoType ignoreLanguageField; - - private bool ignoreLanguageFieldSet; - - private YesNoType ignoreRemoveFailureField; - - private bool ignoreRemoveFailureFieldSet; - - private string removeFeaturesField; - - private bool removeFeaturesFieldSet; - - private ScheduleType scheduleField; - - private bool scheduleFieldSet; - - private ISchemaElement parentElement; - - /// - /// When set to no (the default), products with lower version numbers are blocked from - /// installing when a product with a higher version is installed; the DowngradeErrorMessage - /// attribute must also be specified. - /// - /// When set to yes, any version can be installed over any other version. - /// - public YesNoType AllowDowngrades - { - get - { - return this.allowDowngradesField; - } - set - { - this.allowDowngradesFieldSet = true; - this.allowDowngradesField = value; - } - } - - /// - /// When set to no (the default), installing a product with the same version and upgrade code - /// (but different product code) is allowed and treated by MSI as two products. When set to yes, - /// WiX sets the msidbUpgradeAttributesVersionMaxInclusive attribute, which tells MSI to treat - /// a product with the same version as a major upgrade. - /// - /// This is useful when two product versions differ only in the fourth version field. MSI - /// specifically ignores that field when comparing product versions, so two products that - /// differ only in the fourth version field are the same product and need this attribute set to - /// yes to be detected. - /// - /// Note that because MSI ignores the fourth product version field, setting this attribute to - /// yes also allows downgrades when the first three product version fields are identical. - /// For example, product version 1.0.0.1 will "upgrade" 1.0.0.2998 because they're seen as the - /// same version (1.0.0). That could reintroduce serious bugs so the safest choice is to change - /// the first three version fields and omit this attribute to get the default of no. - /// - /// This attribute cannot be "yes" when AllowDowngrades is also "yes" -- AllowDowngrades - /// already allows two products with the same version number to upgrade each other. - /// - public YesNoType AllowSameVersionUpgrades - { - get - { - return this.allowSameVersionUpgradesField; - } - set - { - this.allowSameVersionUpgradesFieldSet = true; - this.allowSameVersionUpgradesField = value; - } - } - - /// - /// When set to yes, products with higer version numbers are blocked from - /// installing when a product with a lower version is installed; the UpgradeErrorMessage - /// attribute must also be specified. - /// - /// When set to no (the default), any version can be installed over any lower version. - /// - public YesNoType Disallow - { - get - { - return this.disallowField; - } - set - { - this.disallowFieldSet = true; - this.disallowField = value; - } - } - - /// - /// The message displayed if users try to install a product with a lower version number - /// when a product with a higher version is installed. Used only when AllowDowngrades - /// is no (the default). - /// - public string DowngradeErrorMessage - { - get - { - return this.downgradeErrorMessageField; - } - set - { - this.downgradeErrorMessageFieldSet = true; - this.downgradeErrorMessageField = value; - } - } - - /// - /// The message displayed if users try to install a product with a higer version number - /// when a product with a lower version is installed. Used only when Disallow - /// is yes. - /// - public string DisallowUpgradeErrorMessage - { - get - { - return this.disallowUpgradeErrorMessageField; - } - set - { - this.disallowUpgradeErrorMessageFieldSet = true; - this.disallowUpgradeErrorMessageField = value; - } - } - - /// - /// When set to yes (the default), the MigrateFeatureStates standard action will set the - /// feature states of the upgrade product to those of the installed product. - /// - /// When set to no, the installed features have no effect on the upgrade installation. - /// - public YesNoType MigrateFeatures - { - get - { - return this.migrateFeaturesField; - } - set - { - this.migrateFeaturesFieldSet = true; - this.migrateFeaturesField = value; - } - } - - /// - /// When set to yes, the Upgrade table rows will match any product with the same UpgradeCode. - /// - /// When set to no (the default), the Upgrade table rows will match only products with the - /// same UpgradeCode and ProductLanguage. - /// - public YesNoType IgnoreLanguage - { - get - { - return this.ignoreLanguageField; - } - set - { - this.ignoreLanguageFieldSet = true; - this.ignoreLanguageField = value; - } - } - - /// - /// When set to yes, failures removing the installed product during the upgrade will be - /// ignored. - /// - /// When set to no (the default), failures removing the installed product during the upgrade - /// will be considered a failure and, depending on the scheduling, roll back the upgrade. - /// - public YesNoType IgnoreRemoveFailure - { - get - { - return this.ignoreRemoveFailureField; - } - set - { - this.ignoreRemoveFailureFieldSet = true; - this.ignoreRemoveFailureField = value; - } - } - - /// - /// A formatted string that contains the list of features to remove from the installed - /// product. The default is to remove all features. Note that if you use formatted property - /// values that evaluate to an empty string, no features will be removed; only omitting - /// this attribute defaults to removing all features. - /// - public string RemoveFeatures - { - get - { - return this.removeFeaturesField; - } - set - { - this.removeFeaturesFieldSet = true; - this.removeFeaturesField = value; - } - } - - /// - /// Determines the scheduling of the RemoveExistingProducts standard action, which is when - /// the installed product is removed. The default is "afterInstallValidate" which removes - /// the installed product entirely before installing the upgrade product. It's slowest but - /// gives the most flexibility in changing components and features in the upgrade product. - /// - /// For more information, see - /// - public ScheduleType Schedule - { - get - { - return this.scheduleField; - } - set - { - this.scheduleFieldSet = true; - this.scheduleField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Parses a ScheduleType from a string. - /// - public static ScheduleType ParseScheduleType(string value) - { - ScheduleType parsedValue; - MajorUpgrade.TryParseScheduleType(value, out parsedValue); - return parsedValue; - } - - /// - /// Tries to parse a ScheduleType from a string. - /// - public static bool TryParseScheduleType(string value, out ScheduleType parsedValue) - { - parsedValue = ScheduleType.NotSet; - if (string.IsNullOrEmpty(value)) - { - return false; - } - if (("afterInstallValidate" == value)) - { - parsedValue = ScheduleType.afterInstallValidate; - } - else - { - if (("afterInstallInitialize" == value)) - { - parsedValue = ScheduleType.afterInstallInitialize; - } - else - { - if (("afterInstallExecute" == value)) - { - parsedValue = ScheduleType.afterInstallExecute; - } - else - { - if (("afterInstallExecuteAgain" == value)) - { - parsedValue = ScheduleType.afterInstallExecuteAgain; - } - else - { - if (("afterInstallFinalize" == value)) - { - parsedValue = ScheduleType.afterInstallFinalize; - } - else - { - parsedValue = ScheduleType.IllegalValue; - return false; - } - } - } - } - } - return true; - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("MajorUpgrade", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.allowDowngradesFieldSet) - { - if ((this.allowDowngradesField == YesNoType.no)) - { - writer.WriteAttributeString("AllowDowngrades", "no"); - } - if ((this.allowDowngradesField == YesNoType.yes)) - { - writer.WriteAttributeString("AllowDowngrades", "yes"); - } - } - if (this.allowSameVersionUpgradesFieldSet) - { - if ((this.allowSameVersionUpgradesField == YesNoType.no)) - { - writer.WriteAttributeString("AllowSameVersionUpgrades", "no"); - } - if ((this.allowSameVersionUpgradesField == YesNoType.yes)) - { - writer.WriteAttributeString("AllowSameVersionUpgrades", "yes"); - } - } - if (this.disallowFieldSet) - { - if ((this.disallowField == YesNoType.no)) - { - writer.WriteAttributeString("Disallow", "no"); - } - if ((this.disallowField == YesNoType.yes)) - { - writer.WriteAttributeString("Disallow", "yes"); - } - } - if (this.downgradeErrorMessageFieldSet) - { - writer.WriteAttributeString("DowngradeErrorMessage", this.downgradeErrorMessageField); - } - if (this.disallowUpgradeErrorMessageFieldSet) - { - writer.WriteAttributeString("DisallowUpgradeErrorMessage", this.disallowUpgradeErrorMessageField); - } - if (this.migrateFeaturesFieldSet) - { - if ((this.migrateFeaturesField == YesNoType.no)) - { - writer.WriteAttributeString("MigrateFeatures", "no"); - } - if ((this.migrateFeaturesField == YesNoType.yes)) - { - writer.WriteAttributeString("MigrateFeatures", "yes"); - } - } - if (this.ignoreLanguageFieldSet) - { - if ((this.ignoreLanguageField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreLanguage", "no"); - } - if ((this.ignoreLanguageField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreLanguage", "yes"); - } - } - if (this.ignoreRemoveFailureFieldSet) - { - if ((this.ignoreRemoveFailureField == YesNoType.no)) - { - writer.WriteAttributeString("IgnoreRemoveFailure", "no"); - } - if ((this.ignoreRemoveFailureField == YesNoType.yes)) - { - writer.WriteAttributeString("IgnoreRemoveFailure", "yes"); - } - } - if (this.removeFeaturesFieldSet) - { - writer.WriteAttributeString("RemoveFeatures", this.removeFeaturesField); - } - if (this.scheduleFieldSet) - { - if ((this.scheduleField == ScheduleType.afterInstallValidate)) - { - writer.WriteAttributeString("Schedule", "afterInstallValidate"); - } - if ((this.scheduleField == ScheduleType.afterInstallInitialize)) - { - writer.WriteAttributeString("Schedule", "afterInstallInitialize"); - } - if ((this.scheduleField == ScheduleType.afterInstallExecute)) - { - writer.WriteAttributeString("Schedule", "afterInstallExecute"); - } - if ((this.scheduleField == ScheduleType.afterInstallExecuteAgain)) - { - writer.WriteAttributeString("Schedule", "afterInstallExecuteAgain"); - } - if ((this.scheduleField == ScheduleType.afterInstallFinalize)) - { - writer.WriteAttributeString("Schedule", "afterInstallFinalize"); - } - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("AllowDowngrades" == name)) - { - this.allowDowngradesField = Enums.ParseYesNoType(value); - this.allowDowngradesFieldSet = true; - } - if (("AllowSameVersionUpgrades" == name)) - { - this.allowSameVersionUpgradesField = Enums.ParseYesNoType(value); - this.allowSameVersionUpgradesFieldSet = true; - } - if (("Disallow" == name)) - { - this.disallowField = Enums.ParseYesNoType(value); - this.disallowFieldSet = true; - } - if (("DowngradeErrorMessage" == name)) - { - this.downgradeErrorMessageField = value; - this.downgradeErrorMessageFieldSet = true; - } - if (("DisallowUpgradeErrorMessage" == name)) - { - this.disallowUpgradeErrorMessageField = value; - this.disallowUpgradeErrorMessageFieldSet = true; - } - if (("MigrateFeatures" == name)) - { - this.migrateFeaturesField = Enums.ParseYesNoType(value); - this.migrateFeaturesFieldSet = true; - } - if (("IgnoreLanguage" == name)) - { - this.ignoreLanguageField = Enums.ParseYesNoType(value); - this.ignoreLanguageFieldSet = true; - } - if (("IgnoreRemoveFailure" == name)) - { - this.ignoreRemoveFailureField = Enums.ParseYesNoType(value); - this.ignoreRemoveFailureFieldSet = true; - } - if (("RemoveFeatures" == name)) - { - this.removeFeaturesField = value; - this.removeFeaturesFieldSet = true; - } - if (("Schedule" == name)) - { - this.scheduleField = MajorUpgrade.ParseScheduleType(value); - this.scheduleFieldSet = true; - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public enum ScheduleType - { - - IllegalValue = int.MaxValue, - - NotSet = -1, - - /// - /// (Default) Schedules RemoveExistingProducts after the InstallValidate standard - /// action. This scheduling removes the installed product entirely before installing - /// the upgrade product. It's slowest but gives the most flexibility in changing - /// components and features in the upgrade product. Note that if the installation - /// of the upgrade product fails, the machine will have neither version installed. - /// - afterInstallValidate, - - /// - /// Schedules RemoveExistingProducts after the InstallInitialize standard action. - /// This is similar to the afterInstallValidate scheduling, but if the installation - /// of the upgrade product fails, Windows Installer also rolls back the removal of - /// the installed product -- in other words, reinstalls it. - /// - afterInstallInitialize, - - /// - /// Schedules RemoveExistingProducts between the InstallExecute and InstallFinalize standard actions. - /// This scheduling installs the upgrade product "on top of" the installed product then lets - /// RemoveExistingProducts uninstall any components that don't also exist in the upgrade product. - /// Note that this scheduling requires strict adherence to the component rules because it relies - /// on component reference counts to be accurate during installation of the upgrade product and - /// removal of the installed product. For more information, see - /// - afterInstallExecute, - - /// - /// Schedules RemoveExistingProducts between the InstallExecuteAgain and InstallFinalize standard actions. - /// This is identical to the afterInstallExecute scheduling but after the InstallExecuteAgain standard - /// action instead of InstallExecute. - /// - afterInstallExecuteAgain, - - /// - /// Schedules RemoveExistingProducts after the InstallFinalize standard action. This is similar to the - /// afterInstallExecute and afterInstallExecuteAgain schedulings but takes place outside the - /// installation transaction so if installation of the upgrade product fails, Windows Installer does - /// not roll back the removal of the installed product, so the machine will have both versions - /// installed. - /// - afterInstallFinalize, - } - } - - [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] - public class ProductSearch : ISchemaElement, ISetAttributes - { - - private string minimumField; - - private bool minimumFieldSet; - - private string maximumField; - - private bool maximumFieldSet; - - private string languageField; - - private bool languageFieldSet; - - private YesNoType includeMinimumField; - - private bool includeMinimumFieldSet; - - private YesNoType includeMaximumField; - - private bool includeMaximumFieldSet; - - private YesNoType excludeLanguagesField; - - private bool excludeLanguagesFieldSet; - - private string upgradeCodeField; - - private bool upgradeCodeFieldSet; - - private string contentField; - - private bool contentFieldSet; - - private ISchemaElement parentElement; - - /// - /// Specifies the lower bound on the range of product versions to be detected by FindRelatedProducts. - /// - public string Minimum - { - get - { - return this.minimumField; - } - set - { - this.minimumFieldSet = true; - this.minimumField = value; - } - } - - /// - /// Specifies the upper boundary of the range of product versions detected by FindRelatedProducts. - /// - public string Maximum - { - get - { - return this.maximumField; - } - set - { - this.maximumFieldSet = true; - this.maximumField = value; - } - } - - /// - /// Specifies the set of languages detected by FindRelatedProducts. Enter a list of numeric language identifiers (LANGID) separated by commas (,). Leave this value null to specify all languages. Set ExcludeLanguages to "yes" in order detect all languages, excluding the languages listed in this value. - /// - public string Language - { - get - { - return this.languageField; - } - set - { - this.languageFieldSet = true; - this.languageField = value; - } - } - - /// - /// Set to "no" to make the range of versions detected exclude the value specified in Minimum. This attribute is "yes" by default. - /// - public YesNoType IncludeMinimum - { - get - { - return this.includeMinimumField; - } - set - { - this.includeMinimumFieldSet = true; - this.includeMinimumField = value; - } - } - - /// - /// Set to "yes" to make the range of versions detected include the value specified in Maximum. - /// - public YesNoType IncludeMaximum - { - get - { - return this.includeMaximumField; - } - set - { - this.includeMaximumFieldSet = true; - this.includeMaximumField = value; - } - } - - /// - /// Set to "yes" to detect all languages, excluding the languages listed in the Language attribute. - /// - public YesNoType ExcludeLanguages - { - get - { - return this.excludeLanguagesField; - } - set - { - this.excludeLanguagesFieldSet = true; - this.excludeLanguagesField = value; - } - } - - /// - /// This value specifies the upgrade code for the products that are to be detected by the FindRelatedProducts action. - /// - public string UpgradeCode - { - get - { - return this.upgradeCodeField; - } - set - { - this.upgradeCodeFieldSet = true; - this.upgradeCodeField = value; - } - } - - public string Content - { - get - { - return this.contentField; - } - set - { - this.contentFieldSet = true; - this.contentField = value; - } - } - - public virtual ISchemaElement ParentElement - { - get - { - return this.parentElement; - } - set - { - this.parentElement = value; - } - } - - /// - /// Processes this element and all child elements into an XmlWriter. - /// - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - public virtual void OutputXml(XmlWriter writer) - { - if ((null == writer)) - { - throw new ArgumentNullException("writer"); - } - writer.WriteStartElement("ProductSearch", "http://wixtoolset.org/schemas/v4/wxs"); - if (this.minimumFieldSet) - { - writer.WriteAttributeString("Minimum", this.minimumField); - } - if (this.maximumFieldSet) - { - writer.WriteAttributeString("Maximum", this.maximumField); - } - if (this.languageFieldSet) - { - writer.WriteAttributeString("Language", this.languageField); - } - if (this.includeMinimumFieldSet) - { - if ((this.includeMinimumField == YesNoType.no)) - { - writer.WriteAttributeString("IncludeMinimum", "no"); - } - if ((this.includeMinimumField == YesNoType.yes)) - { - writer.WriteAttributeString("IncludeMinimum", "yes"); - } - } - if (this.includeMaximumFieldSet) - { - if ((this.includeMaximumField == YesNoType.no)) - { - writer.WriteAttributeString("IncludeMaximum", "no"); - } - if ((this.includeMaximumField == YesNoType.yes)) - { - writer.WriteAttributeString("IncludeMaximum", "yes"); - } - } - if (this.excludeLanguagesFieldSet) - { - if ((this.excludeLanguagesField == YesNoType.no)) - { - writer.WriteAttributeString("ExcludeLanguages", "no"); - } - if ((this.excludeLanguagesField == YesNoType.yes)) - { - writer.WriteAttributeString("ExcludeLanguages", "yes"); - } - } - if (this.upgradeCodeFieldSet) - { - writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); - } - if (this.contentFieldSet) - { - writer.WriteString(this.contentField); - } - writer.WriteEndElement(); - } - - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - void ISetAttributes.SetAttribute(string name, string value) - { - if (String.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - if (("Minimum" == name)) - { - this.minimumField = value; - this.minimumFieldSet = true; - } - if (("Maximum" == name)) - { - this.maximumField = value; - this.maximumFieldSet = true; - } - if (("Language" == name)) - { - this.languageField = value; - this.languageFieldSet = true; - } - if (("IncludeMinimum" == name)) - { - this.includeMinimumField = Enums.ParseYesNoType(value); - this.includeMinimumFieldSet = true; - } - if (("IncludeMaximum" == name)) - { - this.includeMaximumField = Enums.ParseYesNoType(value); - this.includeMaximumFieldSet = true; - } - if (("ExcludeLanguages" == name)) - { - this.excludeLanguagesField = Enums.ParseYesNoType(value); - this.excludeLanguagesFieldSet = true; - } - if (("UpgradeCode" == name)) - { - this.upgradeCodeField = value; - this.upgradeCodeFieldSet = true; - } - if (("Content" == name)) - { - this.contentField = value; - this.contentFieldSet = true; - } - } - } -} diff --git a/src/heat/TypeLibraryHarvester.cs b/src/heat/TypeLibraryHarvester.cs deleted file mode 100644 index 4a271a35..00000000 --- a/src/heat/TypeLibraryHarvester.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Globalization; - using System.Runtime.InteropServices; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring from a type library file. - /// - internal class TypeLibraryHarvester - { - /// - /// Harvest the registry values written by RegisterTypeLib. - /// - /// The file to harvest registry values from. - /// The harvested registry values. - public Wix.RegistryValue[] HarvestRegistryValues(string path) - { - using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) - { - NativeMethods.RegisterTypeLibrary(path); - - return registryHarvester.HarvestRegistry(); - } - } - - /// - /// Parses a hexadecimal version string into a Version object. - /// - /// Hexadecimal version string, for example "1.A.3C.F241" - /// Version object, or null if versionString is not a valid hex version. - public static Version ParseHexVersion(string versionString) - { - if (String.IsNullOrEmpty(versionString)) - { - return null; - } - - int[] versionNumbers = new int[4]; - string[] versionNumberStrings = versionString.Split('.'); - - for (int i = 0; i < versionNumbers.Length && i < versionNumberStrings.Length; i++) - { - if (!Int32.TryParse(versionNumberStrings[i], NumberStyles.HexNumber, CultureInfo.InvariantCulture, out versionNumbers[i])) - { - return null; - } - } - - return new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]); - } - - /// - /// Native methods for registering type libraries. - /// - private sealed class NativeMethods - { - /// - /// Registers a type library. - /// - /// The type library file to register. - internal static void RegisterTypeLibrary(string typeLibraryFile) - { - IntPtr ptlib; - - LoadTypeLib(typeLibraryFile, out ptlib); - - RegisterTypeLib(ptlib, typeLibraryFile, null); - } - - /// - /// Loads and registers a type library. - /// - /// Contains the name of the file from which LoadTypeLib should attempt to load a type library. - /// On return, contains a pointer to a pointer to the loaded type library. - /// LoadTypeLib will not register the type library if the path of the type library is specified. - [DllImport("oleaut32.dll", PreserveSig = false)] - private static extern void LoadTypeLib([MarshalAs(UnmanagedType.BStr)] string szFile, out IntPtr pptlib); - - /// - /// Adds information about a type library to the system registry. - /// - /// Pointer to the type library being registered. - /// Fully qualified path specification for the type library being registered. - /// Directory in which the Help file for the library being registered can be found. Can be Null. - [DllImport("oleaut32.dll", PreserveSig = false)] - private static extern void RegisterTypeLib(IntPtr ptlib, [MarshalAs(UnmanagedType.BStr)] string szFullPath, [MarshalAs(UnmanagedType.BStr)] string szHelpDir); - } - } -} diff --git a/src/heat/UtilFinalizeHarvesterMutator.cs b/src/heat/UtilFinalizeHarvesterMutator.cs deleted file mode 100644 index 3e9f1ce7..00000000 --- a/src/heat/UtilFinalizeHarvesterMutator.cs +++ /dev/null @@ -1,1185 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.Specialized; - using System.Globalization; - using System.IO; - using System.Runtime.InteropServices; - using System.Text; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The finalize harvester mutator for the WiX Toolset Utility Extension. - /// - internal class UtilFinalizeHarvesterMutator : BaseMutatorExtension - { - private ArrayList components; - private ArrayList directories; - private SortedList directoryPaths; - private Hashtable filePaths; - private ArrayList files; - private ArrayList registryValues; - private bool suppressCOMElements; - private bool suppressVB6COMElements; - private string preprocessorVariable; - - /// - /// Instantiate a new UtilFinalizeHarvesterMutator. - /// - public UtilFinalizeHarvesterMutator() - { - this.components = new ArrayList(); - this.directories = new ArrayList(); - this.directoryPaths = new SortedList(); - this.filePaths = new Hashtable(); - this.files = new ArrayList(); - this.registryValues = new ArrayList(); - } - - /// - /// Gets or sets the preprocessor variable for substitution. - /// - /// The preprocessor variable for substitution. - public string PreprocessorVariable - { - get { return this.preprocessorVariable; } - set { this.preprocessorVariable = value; } - } - - /// - /// Gets the sequence of the extension. - /// - /// The sequence of the extension. - public override int Sequence - { - get { return 2000; } - } - - /// - /// Gets or sets the option to suppress COM elements. - /// - /// The option to suppress COM elements. - public bool SuppressCOMElements - { - get { return this.suppressCOMElements; } - set { this.suppressCOMElements = value; } - } - - /// - /// Gets or sets the option to suppress VB6 COM elements. - /// - /// The option to suppress VB6 COM elements. - public bool SuppressVB6COMElements - { - get { return this.suppressVB6COMElements; } - set { this.suppressVB6COMElements = value; } - } - - /// - /// Mutate a WiX document. - /// - /// The Wix document element. - public override void Mutate(Wix.Wix wix) - { - this.components.Clear(); - this.directories.Clear(); - this.directoryPaths.Clear(); - this.filePaths.Clear(); - this.files.Clear(); - this.registryValues.Clear(); - - // index elements in this wix document - this.IndexElement(wix); - - this.MutateDirectories(); - this.MutateFiles(); - this.MutateRegistryValues(); - - // must occur after all the registry values have been formatted - this.MutateComponents(); - } - - /// - /// Index an element. - /// - /// The element to index. - private void IndexElement(Wix.ISchemaElement element) - { - if (element is Wix.Component) - { - // Component elements only need to be indexed if COM registry values will be strongly typed - if (!this.suppressCOMElements) - { - this.components.Add(element); - } - } - else if (element is Wix.Directory) - { - this.directories.Add(element); - } - else if (element is Wix.File) - { - this.files.Add(element); - } - else if (element is Wix.RegistryValue) - { - this.registryValues.Add(element); - } - - // index the child elements - if (element is Wix.IParentElement) - { - foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) - { - this.IndexElement(childElement); - } - } - } - - /// - /// Mutate the components. - /// - private void MutateComponents() - { - if (this.suppressVB6COMElements) - { - // Search for VB6 specific COM registrations - foreach (Wix.Component component in this.components) - { - ArrayList vb6RegistryValues = new ArrayList(); - - foreach (Wix.RegistryValue registryValue in component[typeof(Wix.RegistryValue)]) - { - if (Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root) - { - string[] parts = registryValue.Key.Split('\\'); - - if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) - { - // Search for the VB6 CLSID {D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731} - if (2 <= parts.Length) - { - if (String.Equals(parts[1], "{D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731}", StringComparison.OrdinalIgnoreCase)) - { - if (!vb6RegistryValues.Contains(registryValue)) - { - vb6RegistryValues.Add(registryValue); - } - } - } - } - else if (String.Equals(parts[0], "TypeLib", StringComparison.OrdinalIgnoreCase)) - { - // Search for the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} - if (2 <= parts.Length) - { - if (String.Equals(parts[1], "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || - String.Equals(parts[1], "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) - { - if (!vb6RegistryValues.Contains(registryValue)) - { - vb6RegistryValues.Add(registryValue); - } - } - } - } - else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) - { - // Search for any Interfaces that reference the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} - if (3 <= parts.Length) - { - if (String.Equals(parts[2], "TypeLib", StringComparison.OrdinalIgnoreCase)) - { - if (String.Equals(registryValue.Value, "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || - String.Equals(registryValue.Value, "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) - { - // Having found a match we have to loop through again finding the matching Interface entries - foreach (Wix.RegistryValue regValue in component[typeof(Wix.RegistryValue)]) - { - if (Wix.RegistryValue.ActionType.write == regValue.Action && Wix.RegistryRootType.HKCR == regValue.Root) - { - string[] rvparts = regValue.Key.Split('\\'); - if (String.Equals(rvparts[0], "Interface", StringComparison.OrdinalIgnoreCase)) - { - if (2 <= rvparts.Length) - { - if (String.Equals(rvparts[1], parts[1], StringComparison.OrdinalIgnoreCase)) - { - if (!vb6RegistryValues.Contains(regValue)) - { - vb6RegistryValues.Add(regValue); - } - } - } - } - } - } - } - } - } - } - } - } - - // Remove all the VB6 specific COM registry values - foreach (Object entry in vb6RegistryValues) - { - component.RemoveChild((Wix.RegistryValue)entry); - } - } - } - - foreach (Wix.Component component in this.components) - { - SortedList indexedElements = CollectionsUtil.CreateCaseInsensitiveSortedList(); - SortedList indexedRegistryValues = CollectionsUtil.CreateCaseInsensitiveSortedList(); - List duplicateRegistryValues = new List(); - - // index all the File elements - foreach (Wix.File file in component[typeof(Wix.File)]) - { - indexedElements.Add(String.Concat("file/", file.Id), file); - } - - // group all the registry values by the COM element they would correspond to and - // create a COM element for each group - foreach (Wix.RegistryValue registryValue in component[typeof(Wix.RegistryValue)]) - { - if (!String.IsNullOrEmpty(registryValue.Key) && Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root && Wix.RegistryValue.TypeType.@string == registryValue.Type) - { - string index = null; - string[] parts = registryValue.Key.Split('\\'); - - // create a COM element for COM registration and index it - if (1 <= parts.Length) - { - if (String.Equals(parts[0], "AppID", StringComparison.OrdinalIgnoreCase)) - { - // only work with GUID AppIds here - if (2 <= parts.Length && parts[1].StartsWith("{", StringComparison.Ordinal) && parts[1].EndsWith("}", StringComparison.Ordinal)) - { - index = String.Concat(parts[0], '/', parts[1]); - - if (!indexedElements.Contains(index)) - { - Wix.AppId appId = new Wix.AppId(); - appId.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); - indexedElements.Add(index, appId); - } - } - } - else if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) - { - if (2 <= parts.Length) - { - index = String.Concat(parts[0], '/', parts[1]); - - if (!indexedElements.Contains(index)) - { - Wix.Class wixClass = new Wix.Class(); - wixClass.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); - indexedElements.Add(index, wixClass); - } - } - } - else if (String.Equals(parts[0], "Component Categories", StringComparison.OrdinalIgnoreCase)) - { - // If this is the .NET Component Category it should not end up in the authoring. Therefore, add - // the registry key to the duplicate list to ensure it gets removed later. - if (String.Equals(parts[1], "{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}", StringComparison.OrdinalIgnoreCase)) - { - duplicateRegistryValues.Add(registryValue); - } - else - { - // TODO: add support for Component Categories to the compiler. - } - } - else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) - { - if (2 <= parts.Length) - { - index = String.Concat(parts[0], '/', parts[1]); - - if (!indexedElements.Contains(index)) - { - Wix.Interface wixInterface = new Wix.Interface(); - wixInterface.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); - indexedElements.Add(index, wixInterface); - } - } - } - else if (String.Equals(parts[0], "TypeLib", StringComparison.Ordinal)) - { - if (3 <= parts.Length) - { - // use a special index to ensure progIds are processed before classes - index = String.Concat(".typelib/", parts[1], '/', parts[2]); - - if (!indexedElements.Contains(index)) - { - Version version = TypeLibraryHarvester.ParseHexVersion(parts[2]); - if (version != null) - { - Wix.TypeLib typeLib = new Wix.TypeLib(); - typeLib.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); - typeLib.MajorVersion = version.Major; - typeLib.MinorVersion = version.Minor; - indexedElements.Add(index, typeLib); - } - else // not a valid type library registry value - { - index = null; - } - } - } - } - else if (parts[0].StartsWith(".", StringComparison.Ordinal)) - { - // extension - } - else // ProgId (hopefully) - { - // use a special index to ensure progIds are processed before classes - index = String.Concat(".progid/", parts[0]); - - if (!indexedElements.Contains(index)) - { - Wix.ProgId progId = new Wix.ProgId(); - progId.Id = parts[0]; - indexedElements.Add(index, progId); - } - } - } - - // index the RegistryValue element according to the COM element it corresponds to - if (null != index) - { - SortedList registryValues = (SortedList)indexedRegistryValues[index]; - - if (null == registryValues) - { - registryValues = CollectionsUtil.CreateCaseInsensitiveSortedList(); - indexedRegistryValues.Add(index, registryValues); - } - - try - { - registryValues.Add(String.Concat(registryValue.Key, '/', registryValue.Name), registryValue); - } - catch (ArgumentException) - { - duplicateRegistryValues.Add(registryValue); - - if (String.IsNullOrEmpty(registryValue.Value)) - { - this.Core.Messaging.Write(HarvesterWarnings.DuplicateDllRegistryEntry(String.Concat(registryValue.Key, '/', registryValue.Name), component.Id)); - } - else - { - this.Core.Messaging.Write(HarvesterWarnings.DuplicateDllRegistryEntry(String.Concat(registryValue.Key, '/', registryValue.Name), registryValue.Value, component.Id)); - } - } - } - } - } - - foreach (Wix.RegistryValue removeRegistryEntry in duplicateRegistryValues) - { - component.RemoveChild(removeRegistryEntry); - } - - // set various values on the COM elements from their corresponding registry values - Hashtable indexedProcessedRegistryValues = new Hashtable(); - foreach (DictionaryEntry entry in indexedRegistryValues) - { - Wix.ISchemaElement element = (Wix.ISchemaElement)indexedElements[entry.Key]; - string parentIndex = null; - SortedList registryValues = (SortedList)entry.Value; - - // element-specific variables (for really tough situations) - string classAppId = null; - bool threadingModelSet = false; - - foreach (Wix.RegistryValue registryValue in registryValues.Values) - { - string[] parts = registryValue.Key.ToLower(CultureInfo.InvariantCulture).Split('\\'); - bool processed = false; - - if (element is Wix.AppId) - { - Wix.AppId appId = (Wix.AppId)element; - - if (2 == parts.Length) - { - if (null == registryValue.Name) - { - appId.Description = registryValue.Value; - processed = true; - } - } - } - else if (element is Wix.Class) - { - Wix.Class wixClass = (Wix.Class)element; - - if (2 == parts.Length) - { - if (null == registryValue.Name) - { - wixClass.Description = registryValue.Value; - processed = true; - } - else if (String.Equals(registryValue.Name, "AppID", StringComparison.OrdinalIgnoreCase)) - { - classAppId = registryValue.Value; - processed = true; - } - } - else if (3 == parts.Length) - { - Wix.Class.ContextType contextType = Wix.Class.ContextType.None; - - switch (parts[2]) - { - case "control": - wixClass.Control = Wix.YesNoType.yes; - processed = true; - break; - case "inprochandler": - if (null == registryValue.Name) - { - if (null == wixClass.Handler) - { - wixClass.Handler = "1"; - processed = true; - } - else if ("2" == wixClass.Handler) - { - wixClass.Handler = "3"; - processed = true; - } - } - break; - case "inprochandler32": - if (null == registryValue.Name) - { - if (null == wixClass.Handler) - { - wixClass.Handler = "2"; - processed = true; - } - else if ("1" == wixClass.Handler) - { - wixClass.Handler = "3"; - processed = true; - } - } - break; - case "inprocserver": - contextType = Wix.Class.ContextType.InprocServer; - break; - case "inprocserver32": - contextType = Wix.Class.ContextType.InprocServer32; - break; - case "insertable": - wixClass.Insertable = Wix.YesNoType.yes; - processed = true; - break; - case "localserver": - contextType = Wix.Class.ContextType.LocalServer; - break; - case "localserver32": - contextType = Wix.Class.ContextType.LocalServer32; - break; - case "progid": - if (null == registryValue.Name) - { - Wix.ProgId progId = (Wix.ProgId)indexedElements[String.Concat(".progid/", registryValue.Value)]; - - // verify that the versioned ProgId appears under this Class element - // if not, toss the entire element - if (null == progId || wixClass != progId.ParentElement) - { - element = null; - } - else - { - processed = true; - } - } - break; - case "programmable": - wixClass.Programmable = Wix.YesNoType.yes; - processed = true; - break; - case "typelib": - if (null == registryValue.Name) - { - foreach (DictionaryEntry indexedEntry in indexedElements) - { - string key = (string)indexedEntry.Key; - Wix.ISchemaElement possibleTypeLib = (Wix.ISchemaElement)indexedEntry.Value; - - if (key.StartsWith(".typelib/", StringComparison.Ordinal) && - 0 == String.Compare(key, 9, registryValue.Value, 0, registryValue.Value.Length, StringComparison.OrdinalIgnoreCase)) - { - // ensure the TypeLib is nested under the same thing we want the Class under - if (null == parentIndex || indexedElements[parentIndex] == possibleTypeLib.ParentElement) - { - parentIndex = key; - processed = true; - } - } - } - } - break; - case "version": - if (null == registryValue.Name) - { - wixClass.Version = registryValue.Value; - processed = true; - } - break; - case "versionindependentprogid": - if (null == registryValue.Name) - { - Wix.ProgId progId = (Wix.ProgId)indexedElements[String.Concat(".progid/", registryValue.Value)]; - - // verify that the version independent ProgId appears somewhere - // under this Class element - if not, toss the entire element - if (null == progId || wixClass != progId.ParentElement) - { - // check the parent of the parent - if (null == progId || null == progId.ParentElement || wixClass != progId.ParentElement.ParentElement) - { - element = null; - } - } - - processed = true; - } - break; - } - - if (Wix.Class.ContextType.None != contextType) - { - wixClass.Context |= contextType; - - if (null == registryValue.Name) - { - if ((registryValue.Value.StartsWith("[!", StringComparison.Ordinal) || registryValue.Value.StartsWith("[#", StringComparison.Ordinal)) - && registryValue.Value.EndsWith("]", StringComparison.Ordinal)) - { - parentIndex = String.Concat("file/", registryValue.Value.Substring(2, registryValue.Value.Length - 3)); - processed = true; - } - else if (String.Equals(Path.GetFileName(registryValue.Value), "mscoree.dll", StringComparison.OrdinalIgnoreCase)) - { - wixClass.ForeignServer = "mscoree.dll"; - processed = true; - } - else if (String.Equals(Path.GetFileName(registryValue.Value), "msvbvm60.dll", StringComparison.OrdinalIgnoreCase)) - { - wixClass.ForeignServer = "msvbvm60.dll"; - processed = true; - } - else - { - // Some servers are specifying relative paths (which the above code doesn't find) - // If there's any ambiguity leave it alone and let the developer figure it out when it breaks in the compiler - - bool possibleDuplicate = false; - string possibleParentIndex = null; - - foreach (Wix.File file in this.files) - { - if (String.Equals(registryValue.Value, Path.GetFileName(file.Source), StringComparison.OrdinalIgnoreCase)) - { - if (null == possibleParentIndex) - { - possibleParentIndex = String.Concat("file/", file.Id); - } - else - { - possibleDuplicate = true; - break; - } - } - } - - if (!possibleDuplicate) - { - if (null == possibleParentIndex) - { - wixClass.ForeignServer = registryValue.Value; - processed = true; - } - else - { - parentIndex = possibleParentIndex; - wixClass.RelativePath = Wix.YesNoType.yes; - processed = true; - } - } - } - } - else if (String.Equals(registryValue.Name, "ThreadingModel", StringComparison.OrdinalIgnoreCase)) - { - Wix.Class.ThreadingModelType threadingModel; - - if (String.Equals(registryValue.Value, "apartment", StringComparison.OrdinalIgnoreCase)) - { - threadingModel = Wix.Class.ThreadingModelType.apartment; - processed = true; - } - else if (String.Equals(registryValue.Value, "both", StringComparison.OrdinalIgnoreCase)) - { - threadingModel = Wix.Class.ThreadingModelType.both; - processed = true; - } - else if (String.Equals(registryValue.Value, "free", StringComparison.OrdinalIgnoreCase)) - { - threadingModel = Wix.Class.ThreadingModelType.free; - processed = true; - } - else if (String.Equals(registryValue.Value, "neutral", StringComparison.OrdinalIgnoreCase)) - { - threadingModel = Wix.Class.ThreadingModelType.neutral; - processed = true; - } - else if (String.Equals(registryValue.Value, "rental", StringComparison.OrdinalIgnoreCase)) - { - threadingModel = Wix.Class.ThreadingModelType.rental; - processed = true; - } - else if (String.Equals(registryValue.Value, "single", StringComparison.OrdinalIgnoreCase)) - { - threadingModel = Wix.Class.ThreadingModelType.single; - processed = true; - } - else - { - continue; - } - - if (!threadingModelSet || wixClass.ThreadingModel == threadingModel) - { - wixClass.ThreadingModel = threadingModel; - threadingModelSet = true; - } - else - { - element = null; - break; - } - } - } - } - else if (4 == parts.Length) - { - if (String.Equals(parts[2], "implemented categories", StringComparison.Ordinal)) - { - switch (parts[3]) - { - case "{7dd95801-9882-11cf-9fa9-00aa006c42c4}": - wixClass.SafeForScripting = Wix.YesNoType.yes; - processed = true; - break; - case "{7dd95802-9882-11cf-9fa9-00aa006c42c4}": - wixClass.SafeForInitializing = Wix.YesNoType.yes; - processed = true; - break; - } - } - } - } - else if (element is Wix.Interface) - { - Wix.Interface wixInterface = (Wix.Interface)element; - - if (2 == parts.Length && null == registryValue.Name) - { - wixInterface.Name = registryValue.Value; - processed = true; - } - else if (3 == parts.Length) - { - switch (parts[2]) - { - case "proxystubclsid": - if (null == registryValue.Name) - { - wixInterface.ProxyStubClassId = registryValue.Value.ToUpper(CultureInfo.InvariantCulture); - processed = true; - } - break; - case "proxystubclsid32": - if (null == registryValue.Name) - { - wixInterface.ProxyStubClassId32 = registryValue.Value.ToUpper(CultureInfo.InvariantCulture); - processed = true; - } - break; - case "nummethods": - if (null == registryValue.Name) - { - wixInterface.NumMethods = Convert.ToInt32(registryValue.Value, CultureInfo.InvariantCulture); - processed = true; - } - break; - case "typelib": - if (String.Equals("Version", registryValue.Name, StringComparison.OrdinalIgnoreCase)) - { - parentIndex = String.Concat(parentIndex, registryValue.Value); - processed = true; - } - else if (null == registryValue.Name) // TypeLib guid - { - parentIndex = String.Concat(".typelib/", registryValue.Value, '/', parentIndex); - processed = true; - } - break; - } - } - } - else if (element is Wix.ProgId) - { - Wix.ProgId progId = (Wix.ProgId)element; - - if (null == registryValue.Name) - { - if (1 == parts.Length) - { - progId.Description = registryValue.Value; - processed = true; - } - else if (2 == parts.Length) - { - if (String.Equals(parts[1], "CLSID", StringComparison.OrdinalIgnoreCase)) - { - parentIndex = String.Concat("CLSID/", registryValue.Value); - processed = true; - } - else if (String.Equals(parts[1], "CurVer", StringComparison.OrdinalIgnoreCase)) - { - // If a progId points to its own ProgId with CurVer, it isn't meaningful, so ignore it - if (!String.Equals(progId.Id, registryValue.Value, StringComparison.OrdinalIgnoreCase)) - { - // this registry value should usually be processed second so the - // version independent ProgId should be under the versioned one - parentIndex = String.Concat(".progid/", registryValue.Value); - processed = true; - } - } - } - } - } - else if (element is Wix.TypeLib) - { - Wix.TypeLib typeLib = (Wix.TypeLib)element; - - if (null == registryValue.Name) - { - if (3 == parts.Length) - { - typeLib.Description = registryValue.Value; - processed = true; - } - else if (4 == parts.Length) - { - if (String.Equals(parts[3], "flags", StringComparison.OrdinalIgnoreCase)) - { - int flags = Convert.ToInt32(registryValue.Value, CultureInfo.InvariantCulture); - - if (0x1 == (flags & 0x1)) - { - typeLib.Restricted = Wix.YesNoType.yes; - } - - if (0x2 == (flags & 0x2)) - { - typeLib.Control = Wix.YesNoType.yes; - } - - if (0x4 == (flags & 0x4)) - { - typeLib.Hidden = Wix.YesNoType.yes; - } - - if (0x8 == (flags & 0x8)) - { - typeLib.HasDiskImage = Wix.YesNoType.yes; - } - - processed = true; - } - else if (String.Equals(parts[3], "helpdir", StringComparison.OrdinalIgnoreCase)) - { - if (registryValue.Value.StartsWith("[", StringComparison.Ordinal) && (registryValue.Value.EndsWith("]", StringComparison.Ordinal) - || registryValue.Value.EndsWith("]\\", StringComparison.Ordinal))) - { - typeLib.HelpDirectory = registryValue.Value.Substring(1, registryValue.Value.LastIndexOf(']') - 1); - } - else if (0 == String.Compare(registryValue.Value, Environment.SystemDirectory, StringComparison.OrdinalIgnoreCase)) // VB6 DLLs register their help directory as SystemFolder - { - typeLib.HelpDirectory = "SystemFolder"; - } - else if (null != component.Directory) // -sfrag has not been specified - { - typeLib.HelpDirectory = component.Directory; - } - else if (component.ParentElement is Wix.Directory) // -sfrag has been specified - { - typeLib.HelpDirectory = ((Wix.Directory)component.ParentElement).Id; - } - else if (component.ParentElement is Wix.DirectoryRef) // -sfrag has been specified - { - typeLib.HelpDirectory = ((Wix.DirectoryRef)component.ParentElement).Id; - } - - //If the helpdir has not matched a known directory, drop it because it cannot be resolved. - processed = true; - } - } - else if (5 == parts.Length && String.Equals("win32", parts[4], StringComparison.OrdinalIgnoreCase)) - { - typeLib.Language = Convert.ToInt32(parts[3], CultureInfo.InvariantCulture); - - if ((registryValue.Value.StartsWith("[!", StringComparison.Ordinal) || registryValue.Value.StartsWith("[#", StringComparison.Ordinal)) - && registryValue.Value.EndsWith("]", StringComparison.Ordinal)) - { - parentIndex = String.Concat("file/", registryValue.Value.Substring(2, registryValue.Value.Length - 3)); - } - - processed = true; - } - } - } - - // index the processed registry values by their corresponding COM element - if (processed) - { - indexedProcessedRegistryValues.Add(registryValue, element); - } - } - - // parent the COM element - if (null != element) - { - if (null != parentIndex) - { - Wix.IParentElement parentElement = (Wix.IParentElement)indexedElements[parentIndex]; - - if (null != parentElement) - { - parentElement.AddChild(element); - } - } - else if (0 < indexedProcessedRegistryValues.Count) - { - component.AddChild(element); - } - - // special handling for AppID since it doesn't fit the general model - if (null != classAppId) - { - Wix.AppId appId = (Wix.AppId)indexedElements[String.Concat("AppID/", classAppId)]; - - // move the Class element under the AppId (and put the AppId under its old parent) - if (null != appId) - { - // move the AppId element - ((Wix.IParentElement)appId.ParentElement).RemoveChild(appId); - ((Wix.IParentElement)element.ParentElement).AddChild(appId); - - // move the Class element - ((Wix.IParentElement)element.ParentElement).RemoveChild(element); - appId.AddChild(element); - } - } - } - } - - // remove the RegistryValue elements which were converted into COM elements - // that were successfully nested under the Component element - foreach (DictionaryEntry entry in indexedProcessedRegistryValues) - { - Wix.ISchemaElement element = (Wix.ISchemaElement)entry.Value; - Wix.RegistryValue registryValue = (Wix.RegistryValue)entry.Key; - - while (null != element) - { - if (element == component) - { - ((Wix.IParentElement)registryValue.ParentElement).RemoveChild(registryValue); - break; - } - - element = element.ParentElement; - } - } - } - } - - /// - /// Mutate the directories. - /// - private void MutateDirectories() - { - foreach (Wix.Directory directory in this.directories) - { - string path = directory.FileSource; - - // create a new directory element without the FileSource attribute - if (null != path) - { - Wix.Directory newDirectory = new Wix.Directory(); - - newDirectory.Id = directory.Id; - newDirectory.Name = directory.Name; - - foreach (Wix.ISchemaElement element in directory.Children) - { - newDirectory.AddChild(element); - } - - ((Wix.IParentElement)directory.ParentElement).AddChild(newDirectory); - ((Wix.IParentElement)directory.ParentElement).RemoveChild(directory); - - if (null != newDirectory.Id) - { - this.directoryPaths[path.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[", newDirectory.Id, "]"); - } - } - } - } - - /// - /// Mutate the files. - /// - private void MutateFiles() - { - string sourceDirSubstitution = this.preprocessorVariable; - if (sourceDirSubstitution != null) - { - string prefix = "$("; - if (sourceDirSubstitution.StartsWith("wix.", StringComparison.Ordinal)) - { - prefix = "!("; - } - sourceDirSubstitution = String.Concat(prefix, sourceDirSubstitution, ")"); - } - - foreach (Wix.File file in this.files) - { - if (null != file.Id && null != file.Source) - { - string fileSource = this.Core.ResolveFilePath(file.Source); - - // index the long path - this.filePaths[fileSource.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[#", file.Id, "]"); - - // index the long path as a URL for assembly harvesting - Uri fileUri = new Uri(fileSource); - this.filePaths[fileUri.ToString().ToLower(CultureInfo.InvariantCulture)] = String.Concat("file:///[#", file.Id, "]"); - - // index the short path - string shortPath = NativeMethods.GetShortPathName(fileSource); - this.filePaths[shortPath.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[!", file.Id, "]"); - - // escape literal $ characters - file.Source = file.Source.Replace("$", "$$"); - - if (null != sourceDirSubstitution && file.Source.StartsWith("SourceDir\\", StringComparison.Ordinal)) - { - file.Source = file.Source.Substring(9).Insert(0, sourceDirSubstitution); - } - } - } - } - - /// - /// Mutate an individual registry string, according to a collection of replacement items. - /// - /// The string to mutate. - /// The collection of items to replace within the string. - /// The mutated registry string. - private string MutateRegistryString(string value, ICollection replace) - { - int index; - string lowercaseValue = value.ToLower(CultureInfo.InvariantCulture); - - foreach (DictionaryEntry entry in replace) - { - while (0 <= (index = lowercaseValue.IndexOf((string)entry.Key, StringComparison.Ordinal))) - { - value = value.Remove(index, ((string)entry.Key).Length); - value = value.Insert(index, (string)entry.Value); - lowercaseValue = value.ToLower(CultureInfo.InvariantCulture); - } - } - - return value; - } - - /// - /// Mutate the registry values. - /// - private void MutateRegistryValues() - { - if (this.SuppressVB6COMElements && this.SuppressCOMElements) - { - var vb6RegistryValues = new List(); - foreach (Wix.RegistryValue registryValue in this.registryValues) - { - if (IsVb6RegistryValue(registryValue)) - { - if (!vb6RegistryValues.Contains(registryValue)) - { - vb6RegistryValues.Add(registryValue); - } - } - } - - // Remove all the VB6 specific COM registry values - foreach (var reg in vb6RegistryValues) - { - if (reg.ParentElement is Wix.Component component) - { - component.RemoveChild(reg); - } - this.registryValues.Remove(reg); - } - } - - - ArrayList reversedDirectoryPaths = new ArrayList(); - - // reverse the indexed directory paths to ensure the longest paths are found first - foreach (DictionaryEntry entry in this.directoryPaths) - { - reversedDirectoryPaths.Insert(0, entry); - } - - foreach (Wix.RegistryValue registryValue in this.registryValues) - { - // Multi-string values are stored as children - their "Value" member is null - if (Wix.RegistryValue.TypeType.multiString == registryValue.Type) - { - foreach (Wix.MultiStringValue multiStringValue in registryValue.Children) - { - // first replace file paths with their MSI tokens - multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)this.filePaths); - // next replace directory paths with their MSI tokens - multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)reversedDirectoryPaths); - } - } - else - { - // first replace file paths with their MSI tokens - registryValue.Value = this.MutateRegistryString(registryValue.Value, (ICollection)this.filePaths); - // next replace directory paths with their MSI tokens - registryValue.Value = this.MutateRegistryString(registryValue.Value, (ICollection)reversedDirectoryPaths); - } - } - } - - private static bool IsVb6RegistryValue(Wix.RegistryValue registryValue) - { - if (Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root) - { - string[] parts = registryValue.Key.Split('\\'); - if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) - { - // Search for the VB6 CLSID {D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731} - if (2 <= parts.Length) - { - if (String.Equals(parts[1], "{D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731}", StringComparison.OrdinalIgnoreCase)) - { - return true; - } - } - } - else if (String.Equals(parts[0], "TypeLib", StringComparison.OrdinalIgnoreCase)) - { - // Search for the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} - if (2 <= parts.Length) - { - if (String.Equals(parts[1], "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || - String.Equals(parts[1], "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) - { - return true; - } - } - } - else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) - { - // Search for any Interfaces that reference the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} - if (3 <= parts.Length) - { - if (String.Equals(parts[2], "TypeLib", StringComparison.OrdinalIgnoreCase)) - { - if (String.Equals(registryValue.Value, "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || - String.Equals(registryValue.Value, "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) - { - return true; - } - } - } - } - } - return false; - } - - /// - /// The native methods for grabbing machine-specific short file paths. - /// - private class NativeMethods - { - /// - /// Gets the short name for a file. - /// - /// Fullpath to file on disk. - /// Short name for file. - internal static string GetShortPathName(string fullPath) - { - var bufferSize = (int)GetShortPathName(fullPath, null, 0); - if (0 == bufferSize) - { - int err = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); - throw new System.Runtime.InteropServices.COMException(String.Concat("Failed to get short path buffer size for file: ", fullPath), err); - } - - bufferSize += 1; - var shortPath = new StringBuilder(bufferSize, bufferSize); - - uint result = GetShortPathName(fullPath, shortPath, bufferSize); - - if (0 == result) - { - int err = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); - throw new System.Runtime.InteropServices.COMException(String.Concat("Failed to get short path name for file: ", fullPath), err); - } - - return shortPath.ToString(); - } - - /// - /// Gets the short name for a file. - /// - /// Long path to convert to short path. - /// Short path from long path. - /// Size of short path. - /// zero if success. - [DllImport("kernel32.dll", EntryPoint = "GetShortPathNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - internal static extern uint GetShortPathName(string longPath, StringBuilder shortPath, [MarshalAs(UnmanagedType.U4)]int buffer); - } - } -} diff --git a/src/heat/UtilHarvesterMutator.cs b/src/heat/UtilHarvesterMutator.cs deleted file mode 100644 index 59fb9a93..00000000 --- a/src/heat/UtilHarvesterMutator.cs +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.IO; - using System.Reflection; - using System.Runtime.InteropServices; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The WiX Toolset harvester mutator. - /// - internal class UtilHarvesterMutator : BaseMutatorExtension - { - // Flags for SetErrorMode() native method. - private const UInt32 SEM_FAILCRITICALERRORS = 0x0001; - private const UInt32 SEM_NOGPFAULTERRORBOX = 0x0002; - private const UInt32 SEM_NOALIGNMENTFAULTEXCEPT = 0x0004; - private const UInt32 SEM_NOOPENFILEERRORBOX = 0x8000; - - // Remember whether we were able to call OaEnablePerUserTLibRegistration - private bool calledPerUserTLibReg; - - /// - /// allow process to handle serious system errors. - /// - [DllImport("Kernel32.dll")] - private static extern void SetErrorMode(UInt32 uiMode); - - /// - /// enable the RegisterTypeLib API to use the appropriate override mapping for non-admin users on Vista - /// - [DllImport("Oleaut32.dll")] - private static extern void OaEnablePerUserTLibRegistration(); - - public UtilHarvesterMutator() - { - this.calledPerUserTLibReg = false; - - SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); - - try - { - OaEnablePerUserTLibRegistration(); - this.calledPerUserTLibReg = true; - } - catch (EntryPointNotFoundException) - { - } - } - - /// - /// Gets the sequence of this mutator extension. - /// - /// The sequence of this mutator extension. - public override int Sequence - { - get { return 100; } - } - - /// - /// Mutate a WiX document. - /// - /// The Wix document element. - public override void Mutate(Wix.Wix wix) - { - this.MutateElement(null, wix); - } - - /// - /// Mutate an element. - /// - /// The parent of the element to mutate. - /// The element to mutate. - private void MutateElement(Wix.IParentElement parentElement, Wix.ISchemaElement element) - { - if (element is Wix.File) - { - this.MutateFile(parentElement, (Wix.File)element); - } - - // mutate the child elements - if (element is Wix.IParentElement) - { - ArrayList childElements = new ArrayList(); - - // copy the child elements to a temporary array (to allow them to be deleted/moved) - foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) - { - childElements.Add(childElement); - } - - foreach (Wix.ISchemaElement childElement in childElements) - { - this.MutateElement((Wix.IParentElement)element, childElement); - } - } - } - - /// - /// Mutate a file. - /// - /// The parent of the element to mutate. - /// The file to mutate. - private void MutateFile(Wix.IParentElement parentElement, Wix.File file) - { - if (null != file.Source) - { - string fileExtension = Path.GetExtension(file.Source); - string fileSource = this.Core.ResolveFilePath(file.Source); - - if (String.Equals(".ax", fileExtension, StringComparison.OrdinalIgnoreCase) || // DirectShow filter - String.Equals(".dll", fileExtension, StringComparison.OrdinalIgnoreCase) || - String.Equals(".exe", fileExtension, StringComparison.OrdinalIgnoreCase) || - String.Equals(".ocx", fileExtension, StringComparison.OrdinalIgnoreCase)) // ActiveX - { - // try the assembly harvester - try - { - AssemblyHarvester assemblyHarvester = new AssemblyHarvester(); - - this.Core.Messaging.Write(HarvesterVerboses.HarvestingAssembly(fileSource)); - Wix.RegistryValue[] registryValues = assemblyHarvester.HarvestRegistryValues(fileSource); - - foreach (Wix.RegistryValue registryValue in registryValues) - { - parentElement.AddChild(registryValue); - } - - // also try self-reg since we could have a mixed-mode assembly - this.HarvestSelfReg(parentElement, fileSource); - } - catch (BadImageFormatException) // not an assembly, try raw DLL. - { - this.HarvestSelfReg(parentElement, fileSource); - } - catch (Exception ex) - { - this.Core.Messaging.Write(HarvesterWarnings.AssemblyHarvestFailed(fileSource, ex.Message)); - } - } - else if (String.Equals(".olb", fileExtension, StringComparison.OrdinalIgnoreCase) || // type library - String.Equals(".tlb", fileExtension, StringComparison.OrdinalIgnoreCase)) // type library - { - // try the type library harvester - try - { - TypeLibraryHarvester typeLibHarvester = new TypeLibraryHarvester(); - - this.Core.Messaging.Write(HarvesterVerboses.HarvestingTypeLib(fileSource)); - Wix.RegistryValue[] registryValues = typeLibHarvester.HarvestRegistryValues(fileSource); - - foreach (Wix.RegistryValue registryValue in registryValues) - { - parentElement.AddChild(registryValue); - } - } - catch (COMException ce) - { - // 0x8002801C (TYPE_E_REGISTRYACCESS) - // If we don't have permission to harvest typelibs, it's likely because we're on - // Vista or higher and aren't an Admin, or don't have the appropriate QFE installed. - if (!this.calledPerUserTLibReg && (0x8002801c == unchecked((uint)ce.ErrorCode))) - { - this.Core.Messaging.Write(WarningMessages.InsufficientPermissionHarvestTypeLib()); - } - else if (0x80029C4A == unchecked((uint)ce.ErrorCode)) // generic can't load type library - { - this.Core.Messaging.Write(HarvesterWarnings.TypeLibLoadFailed(fileSource, ce.Message)); - } - } - } - } - } - - /// - /// Calls self-reg harvester. - /// - /// The parent element. - /// The file source. - private void HarvestSelfReg(Wix.IParentElement parentElement, string fileSource) - { - // try the self-reg harvester - try - { - DllHarvester dllHarvester = new DllHarvester(); - - this.Core.Messaging.Write(HarvesterVerboses.HarvestingSelfReg(fileSource)); - Wix.RegistryValue[] registryValues = dllHarvester.HarvestRegistryValues(fileSource); - - foreach (Wix.RegistryValue registryValue in registryValues) - { - parentElement.AddChild(registryValue); - } - } - catch (TargetInvocationException tie) - { - if (tie.InnerException is EntryPointNotFoundException) - { - // No DllRegisterServer(), which is fine by me. - } - else - { - this.Core.Messaging.Write(HarvesterWarnings.SelfRegHarvestFailed(fileSource, tie.Message)); - } - } - catch (Exception ex) - { - this.Core.Messaging.Write(HarvesterWarnings.SelfRegHarvestFailed(fileSource, ex.Message)); - } - } - } -} diff --git a/src/heat/UtilHeatExtension.cs b/src/heat/UtilHeatExtension.cs deleted file mode 100644 index 7296a3b3..00000000 --- a/src/heat/UtilHeatExtension.cs +++ /dev/null @@ -1,405 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections.Generic; - using System.IO; - using WixToolset.Core.Burn.Interfaces; - using WixToolset.Data; - using WixToolset.Data.Symbols; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - /// - /// A utility heat extension for the WiX Toolset Harvester application. - /// - internal class UtilHeatExtension : BaseHeatExtension - { - public UtilHeatExtension(IServiceProvider serviceProvider) - { - this.PayloadHarvester = serviceProvider.GetService(); - } - - private IPayloadHarvester PayloadHarvester { get; } - - /// - /// Gets the supported command line types for this extension. - /// - /// The supported command line types for this extension. - public override HeatCommandLineOption[] CommandLineTypes - { - get - { - return new HeatCommandLineOption[] - { - new HeatCommandLineOption("dir", "harvest a directory"), - new HeatCommandLineOption("file", "harvest a file"), - new HeatCommandLineOption("exepackagepayload", "harvest a bundle payload as ExePackagePayload"), - new HeatCommandLineOption("msupackagepayload", "harvest a bundle payload as MsuPackagePayload"), - new HeatCommandLineOption("perf", "harvest performance counters"), - new HeatCommandLineOption("reg", "harvest a .reg file"), - new HeatCommandLineOption("-ag", "autogenerate component guids at compile time"), - new HeatCommandLineOption("-cg ", "component group name (cannot contain spaces e.g -cg MyComponentGroup)"), - new HeatCommandLineOption("-dr ", "directory reference to root directories (cannot contain spaces e.g. -dr MyAppDirRef)"), - new HeatCommandLineOption("-var ", "substitute File/@Source=\"SourceDir\" with a preprocessor or a wix variable" + Environment.NewLine + - "(e.g. -var var.MySource will become File/@Source=\"$(var.MySource)\\myfile.txt\" and " + Environment.NewLine + - "-var wix.MySource will become File/@Source=\"!(wix.MySource)\\myfile.txt\""), - new HeatCommandLineOption("-gg", "generate guids now"), - new HeatCommandLineOption("-g1", "generated guids are not in brackets"), - new HeatCommandLineOption("-ke", "keep empty directories"), - new HeatCommandLineOption("-scom", "suppress COM elements"), - new HeatCommandLineOption("-sfrag", "suppress fragments"), - new HeatCommandLineOption("-srd", "suppress harvesting the root directory as an element"), - new HeatCommandLineOption("-svb6", "suppress VB6 COM elements"), - new HeatCommandLineOption("-sreg", "suppress registry harvesting"), - new HeatCommandLineOption("-suid", "suppress unique identifiers for files, components, & directories"), - new HeatCommandLineOption("-t", "transform harvested output with XSL file"), - new HeatCommandLineOption("-template", "use template, one of: fragment,module,product"), - }; - } - } - - /// - /// Parse the command line options for this extension. - /// - /// The active harvester type. - /// The option arguments. - public override void ParseOptions(string type, string[] args) - { - bool active = false; - IHarvesterExtension harvesterExtension = null; - bool suppressHarvestingRegistryValues = false; - UtilFinalizeHarvesterMutator utilFinalizeHarvesterMutator = new UtilFinalizeHarvesterMutator(); - UtilMutator utilMutator = new UtilMutator(); - List transformMutators = new List(); - GenerateType generateType = GenerateType.Components; - - // select the harvester - switch (type) - { - case "dir": - harvesterExtension = new DirectoryHarvester(); - active = true; - break; - case "file": - harvesterExtension = new FileHarvester(); - active = true; - break; - case "exepackagepayload": - harvesterExtension = new PayloadHarvester(this.PayloadHarvester, WixBundlePackageType.Exe); - active = true; - break; - case "msupackagepayload": - harvesterExtension = new PayloadHarvester(this.PayloadHarvester, WixBundlePackageType.Msu); - active = true; - break; - case "perf": - harvesterExtension = new PerformanceCategoryHarvester(); - active = true; - break; - case "reg": - harvesterExtension = new RegFileHarvester(); - active = true; - break; - } - - // set default settings - utilMutator.CreateFragments = true; - utilMutator.SetUniqueIdentifiers = true; - - // parse the options - for (int i = 0; i < args.Length; i++) - { - string commandSwitch = args[i]; - - if (null == commandSwitch || 0 == commandSwitch.Length) // skip blank arguments - { - continue; - } - - if ('-' == commandSwitch[0] || '/' == commandSwitch[0]) - { - string truncatedCommandSwitch = commandSwitch.Substring(1); - - if ("ag" == truncatedCommandSwitch) - { - utilMutator.AutogenerateGuids = true; - } - else if ("cg" == truncatedCommandSwitch) - { - utilMutator.ComponentGroupName = this.GetArgumentParameter(args, i); - - if (this.Core.Messaging.EncounteredError) - { - return; - } - } - else if ("dr" == truncatedCommandSwitch) - { - string dr = this.GetArgumentParameter(args, i); - - if (this.Core.Messaging.EncounteredError) - { - return; - } - - if (harvesterExtension is DirectoryHarvester) - { - ((DirectoryHarvester)harvesterExtension).RootedDirectoryRef = dr; - } - else if (harvesterExtension is FileHarvester) - { - ((FileHarvester)harvesterExtension).RootedDirectoryRef = dr; - } - } - else if ("gg" == truncatedCommandSwitch) - { - utilMutator.GenerateGuids = true; - } - else if ("g1" == truncatedCommandSwitch) - { - utilMutator.GuidFormat = "D"; - } - else if ("ke" == truncatedCommandSwitch) - { - if (harvesterExtension is DirectoryHarvester) - { - ((DirectoryHarvester)harvesterExtension).KeepEmptyDirectories = true; - } - else if (active) - { - // TODO: error message - not applicable to file harvester - } - } - else if ("scom" == truncatedCommandSwitch) - { - if (active) - { - utilFinalizeHarvesterMutator.SuppressCOMElements = true; - } - else - { - // TODO: error message - not applicable - } - } - else if ("svb6" == truncatedCommandSwitch) - { - if (active) - { - utilFinalizeHarvesterMutator.SuppressVB6COMElements = true; - } - else - { - // TODO: error message - not applicable - } - } - else if ("sfrag" == truncatedCommandSwitch) - { - utilMutator.CreateFragments = false; - } - else if ("srd" == truncatedCommandSwitch) - { - if (harvesterExtension is DirectoryHarvester) - { - ((DirectoryHarvester)harvesterExtension).SuppressRootDirectory = true; - } - else if (harvesterExtension is FileHarvester) - { - ((FileHarvester)harvesterExtension).SuppressRootDirectory = true; - } - } - else if ("sreg" == truncatedCommandSwitch) - { - suppressHarvestingRegistryValues = true; - } - else if ("suid" == truncatedCommandSwitch) - { - utilMutator.SetUniqueIdentifiers = false; - - if (harvesterExtension is DirectoryHarvester) - { - ((DirectoryHarvester)harvesterExtension).SetUniqueIdentifiers = false; - } - else if (harvesterExtension is FileHarvester) - { - ((FileHarvester)harvesterExtension).SetUniqueIdentifiers = false; - } - } - else if (truncatedCommandSwitch.StartsWith("t:", StringComparison.Ordinal) || "t" == truncatedCommandSwitch) - { - string xslFile; - if (truncatedCommandSwitch.StartsWith("t:", StringComparison.Ordinal)) - { - this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("t:", "t")); - xslFile = truncatedCommandSwitch.Substring(2); - } - else - { - xslFile = this.GetArgumentParameter(args, i, true); - } - - if (0 <= xslFile.IndexOf('\"')) - { - this.Core.Messaging.Write(ErrorMessages.PathCannotContainQuote(xslFile)); - return; - } - - try - { - xslFile = Path.GetFullPath(xslFile); - } - catch (Exception e) - { - this.Core.Messaging.Write(ErrorMessages.InvalidCommandLineFileName(xslFile, e.Message)); - return; - } - - transformMutators.Add(new UtilTransformMutator(xslFile, transformMutators.Count)); - } - else if (truncatedCommandSwitch.StartsWith("template:", StringComparison.Ordinal) || "template" == truncatedCommandSwitch) - { - string template; - if(truncatedCommandSwitch.StartsWith("template:", StringComparison.Ordinal)) - { - this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("template:", "template")); - template = truncatedCommandSwitch.Substring(9); - } - else - { - template = this.GetArgumentParameter(args, i); - } - - switch (template) - { - case "fragment": - utilMutator.TemplateType = TemplateType.Fragment; - break; - case "module": - utilMutator.TemplateType = TemplateType.Module; - break; - case "product": - utilMutator.TemplateType = TemplateType.Package ; - break; - default: - // TODO: error - break; - } - } - else if ("var" == truncatedCommandSwitch) - { - if (active) - { - utilFinalizeHarvesterMutator.PreprocessorVariable = this.GetArgumentParameter(args, i); - - if (this.Core.Messaging.EncounteredError) - { - return; - } - } - } - else if ("generate" == truncatedCommandSwitch) - { - if (harvesterExtension is DirectoryHarvester) - { - string genType = this.GetArgumentParameter(args, i).ToUpperInvariant(); - switch (genType) - { - case "COMPONENTS": - generateType = GenerateType.Components; - break; - case "PAYLOADGROUP": - generateType = GenerateType.PayloadGroup; - break; - default: - throw new WixException(HarvesterErrors.InvalidDirectoryOutputType(genType)); - } - } - else - { - // TODO: error message - not applicable - } - } - } - } - - // set the appropriate harvester extension - if (active) - { - this.Core.Harvester.Extension = harvesterExtension; - - if (!suppressHarvestingRegistryValues) - { - this.Core.Mutator.AddExtension(new UtilHarvesterMutator()); - } - - this.Core.Mutator.AddExtension(utilFinalizeHarvesterMutator); - - if (harvesterExtension is DirectoryHarvester directoryHarvester) - { - directoryHarvester.GenerateType = generateType; - this.Core.Harvester.Core.RootDirectory = this.Core.Harvester.Core.ExtensionArgument; - } - else if (harvesterExtension is FileHarvester) - { - if (((FileHarvester)harvesterExtension).SuppressRootDirectory) - { - this.Core.Harvester.Core.RootDirectory = Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument)); - } - else - { - this.Core.Harvester.Core.RootDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument))); - - // GetDirectoryName() returns null for root paths such as "c:\", so make sure to support that as well - if (null == this.Core.Harvester.Core.RootDirectory) - { - this.Core.Harvester.Core.RootDirectory = Path.GetPathRoot(Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument))); - } - } - } - } - - // set the mutator - this.Core.Mutator.AddExtension(utilMutator); - - // add the transforms - foreach (UtilTransformMutator transformMutator in transformMutators) - { - this.Core.Mutator.AddExtension(transformMutator); - } - } - - private string GetArgumentParameter(string[] args, int index) - { - return this.GetArgumentParameter(args, index, false); - } - - private string GetArgumentParameter(string[] args, int index, bool allowSpaces) - { - string truncatedCommandSwitch = args[index]; - string commandSwitchValue = args[index + 1]; - - //increment the index to the switch value - index++; - - if (IsValidArg(args, index) && !String.IsNullOrEmpty(commandSwitchValue.Trim())) - { - if (!allowSpaces && commandSwitchValue.Contains(" ")) - { - this.Core.Messaging.Write(HarvesterErrors.SpacesNotAllowedInArgumentValue(truncatedCommandSwitch, commandSwitchValue)); - } - else - { - return commandSwitchValue; - } - } - else - { - this.Core.Messaging.Write(HarvesterErrors.ArgumentRequiresValue(truncatedCommandSwitch)); - } - - return null; - } - } -} diff --git a/src/heat/UtilMutator.cs b/src/heat/UtilMutator.cs deleted file mode 100644 index 3ba3a8eb..00000000 --- a/src/heat/UtilMutator.cs +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using System.Diagnostics; - using System.Globalization; - using System.IO; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// The template type. - /// - internal enum TemplateType - { - /// - /// A fragment template. - /// - Fragment, - - /// - /// A module template. - /// - Module, - - /// - /// A product template. - /// - Package - } - - /// - /// The mutator for the WiX Toolset Internet Information Services Extension. - /// - internal class UtilMutator : BaseMutatorExtension - { - private ArrayList components; - private ArrayList componentGroups; - private string componentGroupName; - private bool createFragments; - private ArrayList directories; - private ArrayList directoryRefs; - private ArrayList files; - private ArrayList features; - private SortedList fragments; - private bool autogenerateGuids; - private bool generateGuids; - private string guidFormat = "B"; // Defaults to guid in {} - private Wix.IParentElement rootElement; - private bool setUniqueIdentifiers; - private TemplateType templateType; - - /// - /// Instantiate a new UtilMutator. - /// - public UtilMutator() - { - this.components = new ArrayList(); - this.componentGroups = new ArrayList(); - this.directories = new ArrayList(); - this.directoryRefs = new ArrayList(); - this.features = new ArrayList(); - this.files = new ArrayList(); - this.fragments = new SortedList(); - } - - /// - /// Gets or sets the value of the component group name. - /// - /// The component group name. - public string ComponentGroupName - { - get { return this.componentGroupName; } - set { this.componentGroupName = value; } - } - - /// - /// Gets or sets the option to create fragments. - /// - /// The option to create fragments. - public bool CreateFragments - { - get { return this.createFragments; } - set { this.createFragments = value; } - } - - /// - /// Gets or sets the option to autogenerate component guids at compile time. - /// - /// The option to autogenerate component guids. - public bool AutogenerateGuids - { - get { return this.autogenerateGuids; } - set { this.autogenerateGuids = value; } - } - - /// - /// Gets or sets the option to generate missing guids. - /// - /// The option to generate missing guids. - public bool GenerateGuids - { - get { return this.generateGuids; } - set { this.generateGuids = value; } - } - - /// - /// Gets or sets the option to set the format of guids. - /// D - 32 digits separated by hyphens: - /// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - /// B - 32 digits separated by hyphens, enclosed in brackets: - /// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - /// - /// Guid format either B or D. - public string GuidFormat - { - get { return this.guidFormat; } - set { this.guidFormat = value; } - } - - /// - /// Gets the sequence of the extension. - /// - /// The sequence of the extension. - public override int Sequence - { - get { return 1000; } - } - - /// - /// Gets of sets the option to set unique identifiers. - /// - /// The option to set unique identifiers. - public bool SetUniqueIdentifiers - { - get { return this.setUniqueIdentifiers; } - set { this.setUniqueIdentifiers = value; } - } - - /// - /// Gets or sets the template type. - /// - /// The template type. - public TemplateType TemplateType - { - get { return this.templateType; } - set { this.templateType = value; } - } - - /// - /// Mutate a WiX document. - /// - /// The Wix document element. - public override void Mutate(Wix.Wix wix) - { - this.components.Clear(); - this.directories.Clear(); - this.directoryRefs.Clear(); - this.features.Clear(); - this.files.Clear(); - this.fragments.Clear(); - this.rootElement = null; - - // index elements in this wix document - this.IndexElement(wix); - - this.MutateWix(wix); - - this.MutateFiles(); - - this.MutateDirectories(); - - this.MutateComponents(); - - if (null != this.componentGroupName) - { - this.CreateComponentGroup(wix); - } - - // add the components to the product feature after all the identifiers have been set - if (TemplateType.Package == this.templateType) - { - Wix.Feature feature = (Wix.Feature)this.features[0]; - - foreach (Wix.ComponentGroup group in this.componentGroups) - { - Wix.ComponentGroupRef componentGroupRef = new Wix.ComponentGroupRef(); - componentGroupRef.Id = group.Id; - - feature.AddChild(componentGroupRef); - } - } - else if (TemplateType.Module == this.templateType) - { - foreach (Wix.ISchemaElement element in wix.Children) - { - if (element is Wix.Module) - { - foreach (Wix.ComponentGroup group in this.componentGroups) - { - Wix.ComponentGroupRef componentGroupRef = new Wix.ComponentGroupRef(); - componentGroupRef.Id = group.Id; - - ((Wix.IParentElement)element).AddChild(componentGroupRef); - } - break; - } - } - } - - //if(!this.createFragments && TemplateType.Package - foreach (Wix.Fragment fragment in this.fragments.Values) - { - wix.AddChild(fragment); - } - } - - /// - /// Creates a component group with a given name. - /// - /// The Wix document element. - private void CreateComponentGroup(Wix.Wix wix) - { - Wix.ComponentGroup componentGroup = new Wix.ComponentGroup(); - componentGroup.Id = this.componentGroupName; - this.componentGroups.Add(componentGroup); - - Wix.Fragment cgFragment = new Wix.Fragment(); - cgFragment.AddChild(componentGroup); - wix.AddChild(cgFragment); - - int componentCount = 0; - for (; componentCount < this.components.Count; componentCount++) - { - Wix.Component c = this.components[componentCount] as Wix.Component; - - if (this.createFragments) - { - if (c.ParentElement is Wix.Directory) - { - Wix.Directory parentDirectory = c.ParentElement as Wix.Directory; - - componentGroup.AddChild(c); - c.Directory = parentDirectory.Id; - parentDirectory.RemoveChild(c); - } - else if (c.ParentElement is Wix.DirectoryRef) - { - Wix.DirectoryRef parentDirectory = c.ParentElement as Wix.DirectoryRef; - - componentGroup.AddChild(c); - c.Directory = parentDirectory.Id; - parentDirectory.RemoveChild(c); - - // Remove whole fragment if moving the component to the component group just leaves an empty DirectoryRef - if (0 < this.fragments.Count && parentDirectory.ParentElement is Wix.Fragment) - { - Wix.Fragment parentFragment = parentDirectory.ParentElement as Wix.Fragment; - int childCount = 0; - foreach (Wix.ISchemaElement element in parentFragment.Children) - { - childCount++; - } - - // Component should always have an Id but the SortedList creation allows for null and bases the name on the fragment count which we cannot reverse engineer here. - if (1 == childCount && !String.IsNullOrEmpty(c.Id)) - { - int removeIndex = this.fragments.IndexOfKey(String.Concat("Component:", c.Id)); - if (0 <= removeIndex) - { - this.fragments.RemoveAt(removeIndex); - } - } - } - } - } - else - { - Wix.ComponentRef componentRef = new Wix.ComponentRef(); - componentRef.Id = c.Id; - componentGroup.AddChild(componentRef); - } - } - } - - /// - /// Index an element. - /// - /// The element to index. - private void IndexElement(Wix.ISchemaElement element) - { - if (element is Wix.Component) - { - this.components.Add(element); - } - else if (element is Wix.ComponentGroup) - { - this.componentGroups.Add(element); - } - else if (element is Wix.Directory) - { - this.directories.Add(element); - } - else if (element is Wix.DirectoryRef) - { - this.directoryRefs.Add(element); - } - else if (element is Wix.Feature) - { - this.features.Add(element); - } - else if (element is Wix.File) - { - this.files.Add(element); - } - else if (element is Wix.Module || element is Wix.PatchCreation || element is Wix.Package) - { - Debug.Assert(null == this.rootElement); - this.rootElement = (Wix.IParentElement)element; - } - - // index the child elements - if (element is Wix.IParentElement) - { - foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) - { - this.IndexElement(childElement); - } - } - } - - /// - /// Mutate the components. - /// - private void MutateComponents() - { - IdentifierGenerator identifierGenerator = new IdentifierGenerator("Component", this.Core); - if (TemplateType.Module == this.templateType) - { - identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; - } - - foreach (Wix.Component component in this.components) - { - if (null == component.Id) - { - string firstFileId = string.Empty; - - // attempt to create a possible identifier from the first file identifier in the component - foreach (Wix.File file in component[typeof(Wix.File)]) - { - firstFileId = file.Id; - break; - } - - if (string.IsNullOrEmpty(firstFileId)) - { - firstFileId = this.GetGuid(); - } - - component.Id = identifierGenerator.GetIdentifier(firstFileId); - } - - if (null == component.Guid) - { - if (this.AutogenerateGuids) - { - component.Guid = "*"; - } - else - { - component.Guid = this.GetGuid(); - } - } - - if (this.createFragments && component.ParentElement is Wix.Directory) - { - Wix.Directory directory = (Wix.Directory)component.ParentElement; - - // parent directory must have an identifier to create a reference to it - if (null == directory.Id) - { - break; - } - - if (this.rootElement is Wix.Module) - { - // add a ComponentRef for the Component - Wix.ComponentRef componentRef = new Wix.ComponentRef(); - componentRef.Id = component.Id; - this.rootElement.AddChild(componentRef); - } - - // create a new Fragment - Wix.Fragment fragment = new Wix.Fragment(); - this.fragments.Add(String.Concat("Component:", (null != component.Id ? component.Id : this.fragments.Count.ToString())), fragment); - - // create a new DirectoryRef - Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); - directoryRef.Id = directory.Id; - fragment.AddChild(directoryRef); - - // move the Component from the the Directory to the DirectoryRef - directory.RemoveChild(component); - directoryRef.AddChild(component); - } - } - } - - /// - /// Mutate the directories. - /// - private void MutateDirectories() - { - if (!this.setUniqueIdentifiers) - { - // assign all identifiers before fragmenting (because fragmenting requires them all to be present) - IdentifierGenerator identifierGenerator = new IdentifierGenerator("Directory", this.Core); - if (TemplateType.Module == this.templateType) - { - identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; - } - - foreach (Wix.Directory directory in this.directories) - { - if (null == directory.Id) - { - directory.Id = identifierGenerator.GetIdentifier(directory.Name); - } - } - } - - if (this.createFragments) - { - foreach (Wix.Directory directory in this.directories) - { - if (directory.ParentElement is Wix.Directory) - { - Wix.Directory parentDirectory = (Wix.Directory)directory.ParentElement; - - // parent directory must have an identifier to create a reference to it - if (null == parentDirectory.Id) - { - return; - } - - // create a new Fragment - Wix.Fragment fragment = new Wix.Fragment(); - this.fragments.Add(String.Concat("Directory:", ("TARGETDIR" == directory.Id ? null : (null != directory.Id ? directory.Id : this.fragments.Count.ToString()))), fragment); - - // create a new DirectoryRef - Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); - directoryRef.Id = parentDirectory.Id; - fragment.AddChild(directoryRef); - - // move the Directory from the parent Directory to DirectoryRef - parentDirectory.RemoveChild(directory); - directoryRef.AddChild(directory); - } - else if (directory.ParentElement is Wix.Fragment) - { - // When creating fragments, remove any top-level Directory elements; - // the fragments should be pulled in by their DirectoryRefs instead. - Wix.Fragment parent = (Wix.Fragment)directory.ParentElement; - parent.RemoveChild(directory); - - // Remove the fragment if it is empty. - if (parent.Children.GetEnumerator().Current == null && parent.ParentElement != null) - { - ((Wix.IParentElement)parent.ParentElement).RemoveChild(parent); - } - } - else if (directory.ParentElement == this.rootElement) - { - // create a new Fragment - Wix.Fragment fragment = new Wix.Fragment(); - this.fragments.Add(String.Concat("Directory:", ("TARGETDIR" == directory.Id ? null : (null != directory.Id ? directory.Id : this.fragments.Count.ToString()))), fragment); - - // move the Directory from the root element to the Fragment - this.rootElement.RemoveChild(directory); - fragment.AddChild(directory); - } - } - } - } - - /// - /// Mutate the files. - /// - private void MutateFiles() - { - IdentifierGenerator identifierGenerator = new IdentifierGenerator("File", this.Core); - if (TemplateType.Module == this.templateType) - { - identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; - } - - foreach (Wix.File file in this.files) - { - if (null == file.Id) - { - file.Id = identifierGenerator.GetIdentifier(Path.GetFileName(file.Source)); - } - } - } - - /// - /// Mutate a Wix element. - /// - /// The Wix element to mutate. - private void MutateWix(Wix.Wix wix) - { - if (TemplateType.Fragment != this.templateType) - { - if (null != this.rootElement || 0 != this.features.Count) - { - throw new Exception("The template option cannot be used with Feature, Package, or Module elements present."); - } - - // create a package element although it won't always be used - Wix.SummaryInformation package = new Wix.SummaryInformation(); - if (TemplateType.Module == this.templateType) - { - package.Id = this.GetGuid(); - } - else - { - package.Compressed = Wix.YesNoType.yes; - } - - package.InstallerVersion = 200; - - Wix.Directory targetDir = new Wix.Directory(); - targetDir.Id = "TARGETDIR"; - targetDir.Name = "SourceDir"; - - foreach (Wix.DirectoryRef directoryRef in this.directoryRefs) - { - if (String.Equals(directoryRef.Id, "TARGETDIR", StringComparison.OrdinalIgnoreCase)) - { - Wix.IParentElement parent = directoryRef.ParentElement as Wix.IParentElement; - - foreach (Wix.ISchemaElement element in directoryRef.Children) - { - targetDir.AddChild(element); - } - - parent.RemoveChild(directoryRef); - - if (null != ((Wix.ISchemaElement)parent).ParentElement) - { - int i = 0; - - foreach (Wix.ISchemaElement element in parent.Children) - { - i++; - } - - if (0 == i) - { - Wix.IParentElement supParent = (Wix.IParentElement)((Wix.ISchemaElement)parent).ParentElement; - supParent.RemoveChild((Wix.ISchemaElement)parent); - } - } - - break; - } - } - - if (TemplateType.Module == this.templateType) - { - Wix.Module module = new Wix.Module(); - module.Id = "PUT-MODULE-NAME-HERE"; - module.Language = "1033"; - module.Version = "1.0.0.0"; - - package.Manufacturer = "PUT-COMPANY-NAME-HERE"; - module.AddChild(package); - module.AddChild(targetDir); - - wix.AddChild(module); - this.rootElement = module; - } - else // product - { - Wix.Package product = new Wix.Package(); - product.Id = this.GetGuid(); - product.Language = "1033"; - product.Manufacturer = "PUT-COMPANY-NAME-HERE"; - product.Name = "PUT-PRODUCT-NAME-HERE"; - product.UpgradeCode = this.GetGuid(); - product.Version = "1.0.0.0"; - product.AddChild(package); - product.AddChild(targetDir); - - Wix.Media media = new Wix.Media(); - media.Id = "1"; - media.Cabinet = "product.cab"; - media.EmbedCab = Wix.YesNoType.yes; - product.AddChild(media); - - Wix.Feature feature = new Wix.Feature(); - feature.Id = "ProductFeature"; - feature.Title = "PUT-FEATURE-TITLE-HERE"; - feature.Level = 1; - product.AddChild(feature); - this.features.Add(feature); - - wix.AddChild(product); - this.rootElement = product; - } - } - } - - /// - /// Get a generated guid or a placeholder for a guid. - /// - /// A generated guid or placeholder. - private string GetGuid() - { - if (this.generateGuids) - { - return Guid.NewGuid().ToString(this.guidFormat, CultureInfo.InvariantCulture).ToUpper(CultureInfo.InvariantCulture); - } - else - { - return "PUT-GUID-HERE"; - } - } - } -} diff --git a/src/heat/UtilTransformMutator.cs b/src/heat/UtilTransformMutator.cs deleted file mode 100644 index f4dda3c5..00000000 --- a/src/heat/UtilTransformMutator.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.IO; - using System.Xml; - using System.Xml.Xsl; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - internal class UtilTransformMutator : BaseMutatorExtension - { - private string transform; - private int transformSequence; - - /// - /// Instantiate a new UtilTransformMutator. - /// - /// Path to the XSL transform file. - /// Order in which the transform should be applied, - /// relative to other transforms. - public UtilTransformMutator(string transform, int transformSequence) - { - this.transform = transform; - this.transformSequence = transformSequence; - } - - /// - /// Gets the sequence of the extension. - /// - /// The sequence of the extension. - public override int Sequence - { - get { return 3000 + this.transformSequence; } - } - - /// - /// Mutate a WiX document as a string. - /// - /// The Wix document element as a string. - /// The mutated Wix document as a string. - public override string Mutate(string wixString) - { - try - { - XslCompiledTransform xslt = new XslCompiledTransform(); - xslt.Load(this.transform, XsltSettings.TrustedXslt, new XmlUrlResolver()); - - using (XmlTextReader xmlReader = new XmlTextReader(new StringReader(wixString))) - { - using (StringWriter stringWriter = new StringWriter()) - { - XmlWriterSettings xmlSettings = new XmlWriterSettings(); - xmlSettings.Indent = true; - xmlSettings.IndentChars = " "; - xmlSettings.OmitXmlDeclaration = true; - - using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) - { - xslt.Transform(xmlReader, xmlWriter); - } - - wixString = stringWriter.ToString(); - } - } - } - catch (Exception ex) - { - this.Core.Messaging.Write(HarvesterErrors.ErrorTransformingHarvestedWiX(this.transform, ex.Message)); - return null; - } - - return wixString; - } - } -} diff --git a/src/heat/VSHeatExtension.cs b/src/heat/VSHeatExtension.cs deleted file mode 100644 index 7c0539bf..00000000 --- a/src/heat/VSHeatExtension.cs +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.Collections; - using WixToolset.Data; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - /// - /// Defines generated element types. - /// - internal enum GenerateType - { - /// Generate Components. - Components, - - /// Generate a Container with Payloads. - Container, - - /// Generate a Bundle PackageGroups. - PackageGroup, - - /// Generate a PayloadGroup with Payloads. - PayloadGroup, - } - - /// - /// VS-related extensions for the WiX Toolset Harvester application. - /// - internal class VSHeatExtension : BaseHeatExtension - { - /// - /// Gets the supported command line types for this extension. - /// - /// The supported command line types for this extension. - public override HeatCommandLineOption[] CommandLineTypes - { - get - { - return new HeatCommandLineOption[] - { - new HeatCommandLineOption("project", "harvest outputs of a VS project"), - new HeatCommandLineOption("-configuration", "configuration to set when harvesting the project"), - new HeatCommandLineOption("-directoryid", "overridden directory id for generated directory elements"), - new HeatCommandLineOption("-generate", Environment.NewLine + - " specify what elements to generate, one of:" + Environment.NewLine + - " components, container, payloadgroup, packagegroup" + Environment.NewLine + - " (default is components)"), - new HeatCommandLineOption("-msbuildbinpath", "msbuild bin directory path"), - new HeatCommandLineOption("-platform", "platform to set when harvesting the project"), - new HeatCommandLineOption("-pog", Environment.NewLine + - " specify output group of VS project, one of:" + Environment.NewLine + - " " + String.Join(",", VSProjectHarvester.GetOutputGroupNames()) + Environment.NewLine + - " This option may be repeated for multiple output groups."), - new HeatCommandLineOption("-projectname", "overridden project name to use in variables"), - new HeatCommandLineOption("-usetoolsversion", "ignore msbuildbinpath if project specifies known msbuild version"), - new HeatCommandLineOption("-wixvar", "generate binder variables instead of preprocessor variables"), - }; - } - } - - /// - /// Parse the command line options for this extension. - /// - /// The active harvester type. - /// The option arguments. - public override void ParseOptions(string type, string[] args) - { - if ("project" == type) - { - string[] allOutputGroups = VSProjectHarvester.GetOutputGroupNames(); - bool suppressUniqueId = false; - bool generateWixVars = false; - bool useToolsVersion = false; - GenerateType generateType = GenerateType.Components; - string directoryIds = null; - string msbuildBinPath = null; - string projectName = null; - string configuration = null; - string platform = null; - ArrayList outputGroups = new ArrayList(); - - for (int i = 0; i < args.Length; i++) - { - if ("-configuration" == args[i]) - { - configuration = args[++i]; - } - else if ("-directoryid" == args[i]) - { - if (!IsValidArg(args, ++i)) - { - throw new WixException(HarvesterErrors.InvalidDirectoryId(args[i])); - } - - directoryIds = args[i]; - } - else if ("-generate" == args[i]) - { - if (!IsValidArg(args, ++i)) - { - throw new WixException(HarvesterErrors.InvalidProjectOutputType(args[i])); - } - - string genType = args[i].ToUpperInvariant(); - switch(genType) - { - case "CONTAINER": - generateType = GenerateType.Container; - break; - case "COMPONENTS": - generateType = GenerateType.Components; - break; - case "PACKAGEGROUP": - generateType = GenerateType.PackageGroup; - break; - case "PAYLOADGROUP": - generateType = GenerateType.PayloadGroup; - break; - default: - throw new WixException(HarvesterErrors.InvalidProjectOutputType(genType)); - } - } - else if ("-msbuildbinpath" == args[i]) - { - if (!IsValidArg(args, ++i)) - { - throw new WixException(HarvesterErrors.ArgumentRequiresValue(args[i-1])); - } - - msbuildBinPath = args[i]; - } - else if ("-platform" == args[i]) - { - platform = args[++i]; - } - else if ("-pog" == args[i]) - { - if (!IsValidArg(args, ++i)) - { - throw new WixException(HarvesterErrors.InvalidOutputGroup(args[i])); - } - - string pogName = args[i]; - bool found = false; - foreach (string availableOutputGroup in allOutputGroups) - { - if (String.Equals(pogName, availableOutputGroup, StringComparison.Ordinal)) - { - outputGroups.Add(availableOutputGroup); - found = true; - break; - } - } - - if (!found) - { - throw new WixException(HarvesterErrors.InvalidOutputGroup(pogName)); - } - } - else if (args[i].StartsWith("-pog:", StringComparison.Ordinal)) - { - this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("pog:", "pog")); - - string pogName = args[i].Substring(5); - bool found = false; - foreach (string availableOutputGroup in allOutputGroups) - { - if (String.Equals(pogName, availableOutputGroup, StringComparison.Ordinal)) - { - outputGroups.Add(availableOutputGroup); - found = true; - break; - } - } - - if (!found) - { - throw new WixException(HarvesterErrors.InvalidOutputGroup(pogName)); - } - } - else if ("-projectname" == args[i]) - { - if (!IsValidArg(args, ++i)) - { - throw new WixException(HarvesterErrors.InvalidProjectName(args[i])); - } - - projectName = args[i]; - } - else if ("-suid" == args[i]) - { - suppressUniqueId = true; - } - else if ("-usetoolsversion" == args[i]) - { - useToolsVersion = true; - } - else if ("-wixvar" == args[i]) - { - generateWixVars = true; - } - } - - if (outputGroups.Count == 0) - { - throw new WixException(HarvesterErrors.NoOutputGroupSpecified()); - } - - VSProjectHarvester harvester = new VSProjectHarvester( - (string[]) outputGroups.ToArray(typeof(string))); - - harvester.SetUniqueIdentifiers = !suppressUniqueId; - harvester.GenerateWixVars = generateWixVars; - harvester.GenerateType = generateType; - harvester.DirectoryIds = directoryIds; - harvester.MsbuildBinPath = msbuildBinPath; - harvester.ProjectName = projectName; - harvester.Configuration = configuration; - harvester.Platform = platform; - harvester.UseToolsVersion = String.IsNullOrEmpty(msbuildBinPath) || useToolsVersion; - - this.Core.Harvester.Extension = harvester; - } - } - } -} diff --git a/src/heat/VSProjectHarvester.cs b/src/heat/VSProjectHarvester.cs deleted file mode 100644 index 115ee828..00000000 --- a/src/heat/VSProjectHarvester.cs +++ /dev/null @@ -1,1455 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Harvesters -{ - using System; - using System.IO; - using System.Reflection; - using System.Collections; - using System.Collections.Generic; - using System.Globalization; - using System.Text.RegularExpressions; - using System.Xml; - using WixToolset.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - using Wix = WixToolset.Harvesters.Serialize; - - /// - /// Harvest WiX authoring for the outputs of a VS project. - /// - internal class VSProjectHarvester : BaseHarvesterExtension - { - // These format strings are used for generated element identifiers. - // {0} = project name - // {1} = POG name - // {2} = file name - private const string DirectoryIdFormat = "{0}.{1}"; - private const string ComponentIdFormat = "{0}.{1}.{2}"; - private const string FileIdFormat = "{0}.{1}.{2}"; - private const string VariableFormat = "$(var.{0}.{1})"; - private const string WixVariableFormat = "!(wix.{0}.{1})"; - - private const string ComponentPrefix = "cmp"; - private const string DirectoryPrefix = "dir"; - private const string FilePrefix = "fil"; - - private string projectGUID; - private string directoryIds; - private string directoryRefSeed; - private string projectName; - private string configuration; - private string platform; - private bool setUniqueIdentifiers; - private GenerateType generateType; - private bool generateWixVars; - - - private static readonly ProjectOutputGroup[] allOutputGroups = new ProjectOutputGroup[] - { - new ProjectOutputGroup("Binaries", "BuiltProjectOutputGroup", "TargetDir"), - new ProjectOutputGroup("Symbols", "DebugSymbolsProjectOutputGroup", "TargetDir"), - new ProjectOutputGroup("Documents", "DocumentationProjectOutputGroup", "ProjectDir"), - new ProjectOutputGroup("Satellites", "SatelliteDllsProjectOutputGroup", "TargetDir"), - new ProjectOutputGroup("Sources", "SourceFilesProjectOutputGroup", "ProjectDir"), - new ProjectOutputGroup("Content", "ContentFilesProjectOutputGroup", "ProjectDir"), - }; - - private string[] outputGroups; - - /// - /// Instantiate a new VSProjectHarvester. - /// - /// List of project output groups to harvest. - public VSProjectHarvester(string[] outputGroups) - { - if (outputGroups == null) - { - throw new ArgumentNullException("outputGroups"); - } - - this.outputGroups = outputGroups; - } - - /// - /// Gets or sets the configuration to set when harvesting. - /// - /// The configuration to set when harvesting. - public string Configuration - { - get { return this.configuration; } - set { this.configuration = value; } - } - - public string DirectoryIds - { - get { return this.directoryIds; } - set { this.directoryIds = value; } - } - - /// - /// Gets or sets what type of elements are to be generated. - /// - /// The type of elements being generated. - public GenerateType GenerateType - { - get { return this.generateType; } - set { this.generateType = value; } - } - - /// - /// Gets or sets whether or not to use wix variables. - /// - /// Whether or not to use wix variables. - public bool GenerateWixVars - { - get { return this.generateWixVars; } - set { this.generateWixVars = value; } - } - - /// - /// Gets or sets the location to load MSBuild from. - /// - public string MsbuildBinPath { get; set; } - - /// - /// Gets or sets the platform to set when harvesting. - /// - /// The platform to set when harvesting. - public string Platform - { - get { return this.platform; } - set { this.platform = value; } - } - - /// - /// Gets or sets the project name to use in wix variables. - /// - /// The project name to use in wix variables. - public string ProjectName - { - get { return this.projectName; } - set { this.projectName = value; } - } - - /// - /// Gets or sets the option to set unique identifiers. - /// - /// The option to set unique identifiers. - public bool SetUniqueIdentifiers - { - get { return this.setUniqueIdentifiers; } - set { this.setUniqueIdentifiers = value; } - } - - /// - /// Gets or sets whether to ignore MsbuildBinPath when the project file specifies a known MSBuild version. - /// - public bool UseToolsVersion { get; set; } - - /// - /// Gets a list of friendly output group names that will be recognized on the command-line. - /// - /// Array of output group names. - public static string[] GetOutputGroupNames() - { - string[] names = new string[VSProjectHarvester.allOutputGroups.Length]; - for (int i = 0; i < names.Length; i++) - { - names[i] = VSProjectHarvester.allOutputGroups[i].Name; - } - return names; - } - - /// - /// Harvest a VS project. - /// - /// The path of the VS project file. - /// The harvested directory. - public override Wix.Fragment[] Harvest(string argument) - { - if (null == argument) - { - throw new ArgumentNullException("argument"); - } - - if (!System.IO.File.Exists(argument)) - { - throw new FileNotFoundException(argument); - } - - // Match specified output group names to available POG structures - // and collect list of build output groups to pass to MSBuild. - ProjectOutputGroup[] pogs = new ProjectOutputGroup[this.outputGroups.Length]; - string[] buildOutputGroups = new string[this.outputGroups.Length]; - for (int i = 0; i < this.outputGroups.Length; i++) - { - foreach (ProjectOutputGroup pog in VSProjectHarvester.allOutputGroups) - { - if (pog.Name == this.outputGroups[i]) - { - pogs[i] = pog; - buildOutputGroups[i] = pog.BuildOutputGroup; - } - } - - if (buildOutputGroups[i] == null) - { - throw new WixException(HarvesterErrors.InvalidOutputGroup(this.outputGroups[i])); - } - } - - string projectFile = Path.GetFullPath(argument); - - IDictionary buildOutputs = this.GetProjectBuildOutputs(projectFile, buildOutputGroups); - - ArrayList fragmentList = new ArrayList(); - - for (int i = 0; i < pogs.Length; i++) - { - this.HarvestProjectOutputGroup(projectFile, buildOutputs, pogs[i], fragmentList); - } - - return (Wix.Fragment[]) fragmentList.ToArray(typeof(Wix.Fragment)); - } - - /// - /// Runs MSBuild on a project file to get the list of filenames for the specified output groups. - /// - /// VS MSBuild project file to load. - /// List of MSBuild output group names. - /// Dictionary mapping output group names to lists of filenames in the group. - private IDictionary GetProjectBuildOutputs(string projectFile, string[] buildOutputGroups) - { - MSBuildProject project = this.GetMsbuildProject(projectFile); - - project.Load(projectFile); - - IDictionary buildOutputs = new Hashtable(); - - string originalDirectory = System.IO.Directory.GetCurrentDirectory(); - System.IO.Directory.SetCurrentDirectory(Path.GetDirectoryName(projectFile)); - bool buildSuccess = false; - try - { - buildSuccess = project.Build(projectFile, buildOutputGroups, buildOutputs); - } - finally - { - System.IO.Directory.SetCurrentDirectory(originalDirectory); - } - - if (!buildSuccess) - { - throw new WixException(HarvesterErrors.BuildFailed()); - } - - this.projectGUID = project.GetEvaluatedProperty("ProjectGuid"); - - if (null == this.projectGUID) - { - throw new WixException(HarvesterErrors.BuildFailed()); - } - - IDictionary newDictionary = new Dictionary(); - foreach (string buildOutput in buildOutputs.Keys) - { - IEnumerable buildOutputFiles = buildOutputs[buildOutput] as IEnumerable; - - bool hasFiles = false; - - foreach (object file in buildOutputFiles) - { - hasFiles = true; - break; - } - - // Try the item group if no outputs - if (!hasFiles) - { - IEnumerable itemFiles = project.GetEvaluatedItemsByName(String.Concat(buildOutput, "Output")); - List itemFileList = new List(); - - // Get each BuildItem and add the file path to our list - foreach (object itemFile in itemFiles) - { - itemFileList.Add(project.GetBuildItem(itemFile)); - } - - // Use our list for this build output - newDictionary.Add(buildOutput, itemFileList); - } - else - { - newDictionary.Add(buildOutput, buildOutputFiles); - } - } - - return newDictionary; - } - - /// - /// Creates WiX fragments for files in one output group. - /// - /// VS MSBuild project file. - /// Dictionary of build outputs retrieved from an MSBuild run on the project file. - /// Project output group parameters. - /// List to which generated fragments will be added. - /// Count of harvested files. - private int HarvestProjectOutputGroup(string projectFile, IDictionary buildOutputs, ProjectOutputGroup pog, IList fragmentList) - { - string projectName = Path.GetFileNameWithoutExtension(projectFile); - string projectBaseDir = null; - - if (this.ProjectName != null) - { - projectName = this.ProjectName; - } - - string sanitizedProjectName = this.Core.CreateIdentifierFromFilename(projectName); - - Wix.IParentElement harvestParent; - - if (this.GenerateType == GenerateType.Container) - { - Wix.Container container = new Wix.Container(); - harvestParent = container; - - container.Name = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); - } - else if (this.GenerateType == GenerateType.PayloadGroup) - { - Wix.PayloadGroup payloadGroup = new Wix.PayloadGroup(); - harvestParent = payloadGroup; - - payloadGroup.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); - } - else if (this.GenerateType == GenerateType.PackageGroup) - { - Wix.PackageGroup packageGroup = new Wix.PackageGroup(); - harvestParent = packageGroup; - - packageGroup.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); - } - else - { - Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); - harvestParent = directoryRef; - - if (!String.IsNullOrEmpty(this.directoryIds)) - { - directoryRef.Id = this.directoryIds; - } - else if (this.setUniqueIdentifiers) - { - directoryRef.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); - } - else - { - directoryRef.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name)); - } - - this.directoryRefSeed = this.Core.GenerateIdentifier(DirectoryPrefix, this.projectGUID, pog.Name); - } - - IEnumerable pogFiles = buildOutputs[pog.BuildOutputGroup] as IEnumerable; - if (pogFiles == null) - { - throw new WixException(HarvesterErrors.MissingProjectOutputGroup( - projectFile, pog.BuildOutputGroup)); - } - - if (pog.FileSource == "ProjectDir") - { - projectBaseDir = Path.GetDirectoryName(projectFile) + "\\"; - } - - int harvestCount = this.HarvestProjectOutputGroupFiles(projectBaseDir, projectName, pog.Name, pog.FileSource, pogFiles, harvestParent); - - if (this.GenerateType == GenerateType.Container) - { - // harvestParent must be a Container at this point - Wix.Container container = harvestParent as Wix.Container; - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(container); - fragmentList.Add(fragment); - } - else if (this.GenerateType == GenerateType.PackageGroup) - { - // harvestParent must be a PackageGroup at this point - Wix.PackageGroup packageGroup = harvestParent as Wix.PackageGroup; - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(packageGroup); - fragmentList.Add(fragment); - } - else if (this.GenerateType == GenerateType.PayloadGroup) - { - // harvestParent must be a Container at this point - Wix.PayloadGroup payloadGroup = harvestParent as Wix.PayloadGroup; - - Wix.Fragment fragment = new Wix.Fragment(); - fragment.AddChild(payloadGroup); - fragmentList.Add(fragment); - } - else - { - // harvestParent must be a DirectoryRef at this point - Wix.DirectoryRef directoryRef = harvestParent as Wix.DirectoryRef; - - if (harvestCount > 0) - { - Wix.Fragment drf = new Wix.Fragment(); - drf.AddChild(directoryRef); - fragmentList.Add(drf); - } - - Wix.ComponentGroup cg = new Wix.ComponentGroup(); - - if (this.setUniqueIdentifiers || !String.IsNullOrEmpty(this.directoryIds)) - { - cg.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); - } - else - { - cg.Id = directoryRef.Id; - } - - if (harvestCount > 0) - { - this.AddComponentsToComponentGroup(directoryRef, cg); - } - - Wix.Fragment cgf = new Wix.Fragment(); - cgf.AddChild(cg); - fragmentList.Add(cgf); - } - - return harvestCount; - } - - /// - /// Add all Components in an element tree to a ComponentGroup. - /// - /// Parent of an element tree that will be searched for Components. - /// The ComponentGroup the Components will be added to. - private void AddComponentsToComponentGroup(Wix.IParentElement parent, Wix.ComponentGroup cg) - { - foreach (Wix.ISchemaElement childElement in parent.Children) - { - Wix.Component c = childElement as Wix.Component; - if (c != null) - { - Wix.ComponentRef cr = new Wix.ComponentRef(); - cr.Id = c.Id; - cg.AddChild(cr); - } - else - { - Wix.IParentElement p = childElement as Wix.IParentElement; - if (p != null) - { - this.AddComponentsToComponentGroup(p, cg); - } - } - } - } - - /// - /// Harvest files from one output group of a VS project. - /// - /// The base directory of the files. - /// Name of the project, to be used as a prefix for generated identifiers. - /// Name of the project output group, used for generating identifiers for WiX elements. - /// The ProjectOutputGroup file source. - /// The files from one output group to harvest. - /// The parent element that will contain the components of the harvested files. - /// The number of files harvested. - private int HarvestProjectOutputGroupFiles(string baseDir, string projectName, string pogName, string pogFileSource, IEnumerable outputGroupFiles, Wix.IParentElement parent) - { - int fileCount = 0; - - Wix.ISchemaElement exeFile = null; - Wix.ISchemaElement dllFile = null; - Wix.ISchemaElement appConfigFile = null; - - // Keep track of files inserted - // Files can have different absolute paths but get mapped to the same SourceFile - // after the project variables have been used. For example, a WiX project that - // is building multiple cultures will have many output MSIs/MSMs, but will all get - // mapped to $(var.ProjName.TargetDir)\ProjName.msm. These duplicates would - // prevent generated code from compiling. - Dictionary seenList = new Dictionary(); - - foreach (object output in outputGroupFiles) - { - string filePath = output.ToString(); - string fileName = Path.GetFileName(filePath); - string fileDir = Path.GetDirectoryName(filePath); - string link = null; - - MethodInfo getMetadataMethod = output.GetType().GetMethod("GetMetadata"); - if (getMetadataMethod != null) - { - link = (string)getMetadataMethod.Invoke(output, new object[] { "Link" }); - if (!String.IsNullOrEmpty(link)) - { - fileDir = Path.GetDirectoryName(Path.Combine(baseDir, link)); - } - } - - Wix.IParentElement parentDir = parent; - // Ignore Containers and PayloadGroups because they do not have a nested structure. - if (baseDir != null && !String.Equals(Path.GetDirectoryName(baseDir), fileDir, StringComparison.OrdinalIgnoreCase) - && this.GenerateType != GenerateType.Container && this.GenerateType != GenerateType.PackageGroup && this.GenerateType != GenerateType.PayloadGroup) - { - Uri baseUri = new Uri(baseDir); - Uri relativeUri = baseUri.MakeRelativeUri(new Uri(fileDir)); - parentDir = this.GetSubDirElement(parentDir, relativeUri); - } - - string parentDirId = null; - - if (parentDir is Wix.DirectoryRef) - { - parentDirId = this.directoryRefSeed; - } - else if (parentDir is Wix.Directory) - { - parentDirId = ((Wix.Directory)parentDir).Id; - } - - if (this.GenerateType == GenerateType.Container || this.GenerateType == GenerateType.PayloadGroup) - { - Wix.Payload payload = new Wix.Payload(); - - this.HarvestProjectOutputGroupPayloadFile(baseDir, projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, payload, seenList); - } - else if (this.GenerateType == GenerateType.PackageGroup) - { - this.HarvestProjectOutputGroupPackage(projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, seenList); - } - else - { - Wix.Component component = new Wix.Component(); - Wix.File file = new Wix.File(); - - this.HarvestProjectOutputGroupFile(baseDir, projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, parentDirId, component, file, seenList); - - if (String.Equals(Path.GetExtension(file.Source), ".exe", StringComparison.OrdinalIgnoreCase)) - { - exeFile = file; - } - else if (String.Equals(Path.GetExtension(file.Source), ".dll", StringComparison.OrdinalIgnoreCase)) - { - dllFile = file; - } - else if (file.Source.EndsWith("app.config", StringComparison.OrdinalIgnoreCase)) - { - appConfigFile = file; - } - } - - fileCount++; - } - - // if there was no exe file found fallback on the dll file found - if (exeFile == null && dllFile != null) - { - exeFile = dllFile; - } - - // Special case for the app.config file in the Binaries POG... - // The POG refers to the files in the OBJ directory, while the - // generated WiX code references them in the bin directory. - // The app.config file gets renamed to match the exe name. - if ("Binaries" == pogName && null != exeFile && null != appConfigFile) - { - if (appConfigFile is Wix.File) - { - Wix.File appConfigFileAsWixFile = appConfigFile as Wix.File; - Wix.File exeFileAsWixFile = exeFile as Wix.File; - // Case insensitive replace - appConfigFileAsWixFile.Source = Regex.Replace(appConfigFileAsWixFile.Source, @"app\.config", Path.GetFileName(exeFileAsWixFile.Source) + ".config", RegexOptions.IgnoreCase); - } - } - - return fileCount; - } - - private void HarvestProjectOutputGroupFile(string baseDir, string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, string parentDirId, Wix.Component component, Wix.File file, Dictionary seenList) - { - string varFormat = VariableFormat; - if (this.generateWixVars) - { - varFormat = WixVariableFormat; - } - - if (pogName.Equals("Satellites", StringComparison.OrdinalIgnoreCase)) - { - Wix.Directory locDirectory = new Wix.Directory(); - - locDirectory.Name = Path.GetFileName(Path.GetDirectoryName(Path.GetFullPath(filePath))); - file.Source = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", locDirectory.Name, "\\", Path.GetFileName(filePath)); - - if (!seenList.ContainsKey(file.Source)) - { - parentDir.AddChild(locDirectory); - locDirectory.AddChild(component); - component.AddChild(file); - seenList.Add(file.Source, true); - - if (this.setUniqueIdentifiers) - { - locDirectory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, parentDirId, locDirectory.Name); - file.Id = this.Core.GenerateIdentifier(FilePrefix, locDirectory.Id, fileName); - component.Id = this.Core.GenerateIdentifier(ComponentPrefix, locDirectory.Id, file.Id); - } - else - { - locDirectory.Id = this.Core.CreateIdentifierFromFilename(String.Format(DirectoryIdFormat, (parentDir is Wix.DirectoryRef) ? ((Wix.DirectoryRef)parentDir).Id : parentDirId, locDirectory.Name)); - file.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.FileIdFormat, projectName, pogName, String.Concat(locDirectory.Name, ".", fileName))); - component.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.ComponentIdFormat, projectName, pogName, String.Concat(locDirectory.Name, ".", fileName))); - } - } - } - else - { - file.Source = GenerateSourceFilePath(baseDir, projectName, pogFileSource, filePath, link, varFormat); - - if (!seenList.ContainsKey(file.Source)) - { - component.AddChild(file); - parentDir.AddChild(component); - seenList.Add(file.Source, true); - - if (this.setUniqueIdentifiers) - { - file.Id = this.Core.GenerateIdentifier(FilePrefix, parentDirId, fileName); - component.Id = this.Core.GenerateIdentifier(ComponentPrefix, parentDirId, file.Id); - } - else - { - file.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.FileIdFormat, projectName, pogName, fileName)); - component.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.ComponentIdFormat, projectName, pogName, fileName)); - } - } - } - } - - private void HarvestProjectOutputGroupPackage(string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, Dictionary seenList) - { - string varFormat = VariableFormat; - if (this.generateWixVars) - { - varFormat = WixVariableFormat; - } - - if (pogName.Equals("Binaries", StringComparison.OrdinalIgnoreCase)) - { - if (String.Equals(Path.GetExtension(filePath), ".exe", StringComparison.OrdinalIgnoreCase)) - { - Wix.ExePackage exePackage = new Wix.ExePackage(); - exePackage.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); - if (!seenList.ContainsKey(exePackage.SourceFile)) - { - parentDir.AddChild(exePackage); - seenList.Add(exePackage.SourceFile, true); - } - } - else if (String.Equals(Path.GetExtension(filePath), ".msi", StringComparison.OrdinalIgnoreCase)) - { - Wix.MsiPackage msiPackage = new Wix.MsiPackage(); - msiPackage.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); - if (!seenList.ContainsKey(msiPackage.SourceFile)) - { - parentDir.AddChild(msiPackage); - seenList.Add(msiPackage.SourceFile, true); - } - } - } - } - - private void HarvestProjectOutputGroupPayloadFile(string baseDir, string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, Wix.Payload file, Dictionary seenList) - { - string varFormat = VariableFormat; - if (this.generateWixVars) - { - varFormat = WixVariableFormat; - } - - if (pogName.Equals("Satellites", StringComparison.OrdinalIgnoreCase)) - { - string locDirectoryName = Path.GetFileName(Path.GetDirectoryName(Path.GetFullPath(filePath))); - file.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", locDirectoryName, "\\", Path.GetFileName(filePath)); - - if (!seenList.ContainsKey(file.SourceFile)) - { - parentDir.AddChild(file); - seenList.Add(file.SourceFile, true); - } - } - else - { - file.SourceFile = GenerateSourceFilePath(baseDir, projectName, pogFileSource, filePath, link, varFormat); - - if (!seenList.ContainsKey(file.SourceFile)) - { - parentDir.AddChild(file); - seenList.Add(file.SourceFile, true); - } - } - } - - /// - /// Helper function to generates a source file path when harvesting files. - /// - /// - /// - /// - /// - /// - /// - /// - private static string GenerateSourceFilePath(string baseDir, string projectName, string pogFileSource, string filePath, string link, string varFormat) - { - string ret; - - if (null == baseDir && !String.IsNullOrEmpty(link)) - { - // This needs to be the absolute path as a link can be located anywhere. - ret = filePath; - } - else if (null == baseDir) - { - ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); - } - else if (filePath.StartsWith(baseDir, StringComparison.OrdinalIgnoreCase)) - { - ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", filePath.Substring(baseDir.Length)); - } - else - { - // come up with a relative path to the file - Uri sourcePathUri = new Uri(filePath); - Uri baseDirUri = new Uri(baseDir); - Uri sourceRelativeUri = baseDirUri.MakeRelativeUri(sourcePathUri); - string relativePath = sourceRelativeUri.ToString().Replace('/', Path.DirectorySeparatorChar); - if (!sourceRelativeUri.UserEscaped) - { - relativePath = Uri.UnescapeDataString(relativePath); - } - - ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", relativePath); - } - - return ret; - } - - /// - /// Gets a Directory element corresponding to a relative subdirectory within the project, - /// either by locating a suitable existing Directory or creating a new one. - /// - /// The parent element which the subdirectory is relative to. - /// Relative path of the subdirectory. - /// Directory element for the relative path. - private Wix.IParentElement GetSubDirElement(Wix.IParentElement parentDir, Uri relativeUri) - { - string[] segments = relativeUri.ToString().Split('\\', '/'); - string firstSubDirName = Uri.UnescapeDataString(segments[0]); - DirectoryAttributeAccessor subDir = null; - - if (String.Equals(firstSubDirName, "..", StringComparison.Ordinal)) - { - return parentDir; - } - - Type directoryType; - Type directoryRefType; - if (parentDir is Wix.Directory || parentDir is Wix.DirectoryRef) - { - directoryType = typeof(Wix.Directory); - directoryRefType = typeof(Wix.DirectoryRef); - } - else - { - throw new ArgumentException("GetSubDirElement parentDir"); - } - - // Search for an existing directory element. - foreach (Wix.ISchemaElement childElement in parentDir.Children) - { - if(VSProjectHarvester.AreTypesEquivalent(childElement.GetType(), directoryType)) - { - DirectoryAttributeAccessor childDir = new DirectoryAttributeAccessor(childElement); - if (String.Equals(childDir.Name, firstSubDirName, StringComparison.OrdinalIgnoreCase)) - { - subDir = childDir; - break; - } - } - } - - if (subDir == null) - { - string parentId = null; - DirectoryAttributeAccessor parentDirectory = null; - DirectoryAttributeAccessor parentDirectoryRef = null; - - if (VSProjectHarvester.AreTypesEquivalent(parentDir.GetType(), directoryType)) - { - parentDirectory = new DirectoryAttributeAccessor((Wix.ISchemaElement)parentDir); - } - else if (VSProjectHarvester.AreTypesEquivalent(parentDir.GetType(), directoryRefType)) - { - parentDirectoryRef = new DirectoryAttributeAccessor((Wix.ISchemaElement)parentDir); - } - - if (parentDirectory != null) - { - parentId = parentDirectory.Id; - } - else if (parentDirectoryRef != null) - { - if (this.setUniqueIdentifiers) - { - //Use the GUID of the project instead of the project name to help keep things stable. - parentId = this.directoryRefSeed; - } - else - { - parentId = parentDirectoryRef.Id; - } - } - - Wix.ISchemaElement newDirectory = (Wix.ISchemaElement)directoryType.GetConstructor(new Type[] { }).Invoke(null); - subDir = new DirectoryAttributeAccessor(newDirectory); - - if (this.setUniqueIdentifiers) - { - subDir.Id = this.Core.GenerateIdentifier(DirectoryPrefix, parentId, firstSubDirName); - } - else - { - subDir.Id = String.Format(DirectoryIdFormat, parentId, firstSubDirName); - } - - subDir.Name = firstSubDirName; - - parentDir.AddChild(subDir.Element); - } - - if (segments.Length == 1) - { - return subDir.ElementAsParent; - } - else - { - Uri nextRelativeUri = new Uri(Uri.UnescapeDataString(relativeUri.ToString()).Substring(firstSubDirName.Length + 1), UriKind.Relative); - return this.GetSubDirElement(subDir.ElementAsParent, nextRelativeUri); - } - } - - private MSBuildProject GetMsbuildProject(string projectFile) - { - XmlDocument document = new XmlDocument(); - try - { - document.Load(projectFile); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotLoadProject(projectFile, e.Message)); - } - - string version = null; - - if (this.UseToolsVersion) - { - foreach (XmlNode child in document.ChildNodes) - { - if (String.Equals(child.Name, "Project", StringComparison.Ordinal) && child.Attributes != null) - { - XmlNode toolsVersionAttribute = child.Attributes["ToolsVersion"]; - if (toolsVersionAttribute != null) - { - version = toolsVersionAttribute.Value; - this.Core.Messaging.Write(HarvesterVerboses.FoundToolsVersion(version)); - - break; - } - } - } - - switch (version) - { - case "4.0": - version = "4.0.0.0"; - break; - case "12.0": - version = "12.0.0.0"; - break; - case "14.0": - version = "14.0.0.0"; - break; - default: - if (String.IsNullOrEmpty(this.MsbuildBinPath)) - { - throw new WixException(HarvesterErrors.MsbuildBinPathRequired(version ?? "(none)")); - } - - version = null; - break; - } - } - - var project = this.ConstructMsbuild40Project(version); - return project; - } - - private Assembly ResolveFromMsbuildBinPath(object sender, ResolveEventArgs args) - { - var assemblyName = new AssemblyName(args.Name); - - var assemblyPath = Path.Combine(this.MsbuildBinPath, $"{assemblyName.Name}.dll"); - if (!File.Exists(assemblyPath)) - { - return null; - } - - return Assembly.LoadFrom(assemblyPath); - } - - private MSBuildProject ConstructMsbuild40Project(string loadVersion) - { - const string MSBuildEngineAssemblyName = "Microsoft.Build, Version={0}, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - const string MSBuildFrameworkAssemblyName = "Microsoft.Build.Framework, Version={0}, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - Assembly msbuildAssembly; - Assembly msbuildFrameworkAssembly; - - if (loadVersion == null) - { - this.Core.Messaging.Write(HarvesterVerboses.LoadingProjectWithBinPath(this.MsbuildBinPath)); - AppDomain.CurrentDomain.AssemblyResolve += this.ResolveFromMsbuildBinPath; - - try - { - msbuildAssembly = Assembly.Load("Microsoft.Build"); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); - } - - try - { - msbuildFrameworkAssembly = Assembly.Load("Microsoft.Build.Framework"); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); - } - } - else - { - this.Core.Messaging.Write(HarvesterVerboses.LoadingProjectWithVersion(loadVersion)); - - try - { - msbuildAssembly = Assembly.Load(String.Format(MSBuildEngineAssemblyName, loadVersion)); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); - } - - try - { - msbuildFrameworkAssembly = Assembly.Load(String.Format(MSBuildFrameworkAssemblyName, loadVersion)); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); - } - } - - Type projectType; - Type buildItemType; - - Type buildManagerType; - Type buildParametersType; - Type buildRequestDataFlagsType; - Type buildRequestDataType; - Type hostServicesType; - Type projectCollectionType; - Type projectInstanceType; - - Type writeHandlerType; - Type colorSetterType; - Type colorResetterType; - Type loggerVerbosityType; - Type consoleLoggerType; - Type iLoggerType; - - try - { - buildItemType = msbuildAssembly.GetType("Microsoft.Build.Execution.ProjectItemInstance", true); - projectType = msbuildAssembly.GetType("Microsoft.Build.Evaluation.Project", true); - - buildManagerType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildManager", true); - buildParametersType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildParameters", true); - buildRequestDataFlagsType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildRequestDataFlags", true); - buildRequestDataType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildRequestData", true); - hostServicesType = msbuildAssembly.GetType("Microsoft.Build.Execution.HostServices", true); - projectCollectionType = msbuildAssembly.GetType("Microsoft.Build.Evaluation.ProjectCollection", true); - projectInstanceType = msbuildAssembly.GetType("Microsoft.Build.Execution.ProjectInstance", true); - - writeHandlerType = msbuildAssembly.GetType("Microsoft.Build.Logging.WriteHandler", true); - colorSetterType = msbuildAssembly.GetType("Microsoft.Build.Logging.ColorSetter", true); - colorResetterType = msbuildAssembly.GetType("Microsoft.Build.Logging.ColorResetter", true); - loggerVerbosityType = msbuildFrameworkAssembly.GetType("Microsoft.Build.Framework.LoggerVerbosity", true); - consoleLoggerType = msbuildAssembly.GetType("Microsoft.Build.Logging.ConsoleLogger", true); - iLoggerType = msbuildFrameworkAssembly.GetType("Microsoft.Build.Framework.ILogger", true); - } - catch (TargetInvocationException tie) - { - throw new WixException(HarvesterErrors.CannotLoadMSBuildEngine(tie.InnerException.Message)); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotLoadMSBuildEngine(e.Message)); - } - - MSBuild40Types types = new MSBuild40Types(); - types.buildManagerType = buildManagerType; - types.buildParametersType = buildParametersType; - types.buildRequestDataFlagsType = buildRequestDataFlagsType; - types.buildRequestDataType = buildRequestDataType; - types.hostServicesType = hostServicesType; - types.projectCollectionType = projectCollectionType; - types.projectInstanceType = projectInstanceType; - types.writeHandlerType = writeHandlerType; - types.colorSetterType = colorSetterType; - types.colorResetterType = colorResetterType; - types.loggerVerbosityType = loggerVerbosityType; - types.consoleLoggerType = consoleLoggerType; - types.iLoggerType = iLoggerType; - return new MSBuild40Project(null, projectType, buildItemType, loadVersion, types, this.Core, this.configuration, this.platform); - } - - private static bool AreTypesEquivalent(Type a, Type b) - { - return (a == b) || (a.IsAssignableFrom(b) && b.IsAssignableFrom(a)); - } - - private abstract class MSBuildProject - { - protected Type projectType; - protected Type buildItemType; - protected object project; - private string loadVersion; - - public MSBuildProject(object project, Type projectType, Type buildItemType, string loadVersion) - { - this.project = project; - this.projectType = projectType; - this.buildItemType = buildItemType; - this.loadVersion = loadVersion; - } - - public string LoadVersion - { - get { return this.loadVersion; } - } - - public abstract bool Build(string projectFileName, string[] targetNames, IDictionary targetOutputs); - - public abstract MSBuildProjectItemType GetBuildItem(object buildItem); - - public abstract IEnumerable GetEvaluatedItemsByName(string itemName); - - public abstract string GetEvaluatedProperty(string propertyName); - - public abstract void Load(string projectFileName); - } - - private abstract class MSBuildProjectItemType - { - public MSBuildProjectItemType(object buildItem) - { - this.buildItem = buildItem; - } - - public abstract override string ToString(); - - public abstract string GetMetadata(string name); - - protected object buildItem; - } - - - private struct MSBuild40Types - { - public Type buildManagerType; - public Type buildParametersType; - public Type buildRequestDataFlagsType; - public Type buildRequestDataType; - public Type hostServicesType; - public Type projectCollectionType; - public Type projectInstanceType; - public Type writeHandlerType; - public Type colorSetterType; - public Type colorResetterType; - public Type loggerVerbosityType; - public Type consoleLoggerType; - public Type iLoggerType; - } - - private class MSBuild40Project : MSBuildProject - { - private MSBuild40Types types; - private object projectCollection; - private object currentProjectInstance; - private object buildManager; - private object buildParameters; - private IHarvesterCore harvesterCore; - - public MSBuild40Project(object project, Type projectType, Type buildItemType, string loadVersion, MSBuild40Types types, IHarvesterCore harvesterCore, string configuration, string platform) - : base(project, projectType, buildItemType, loadVersion) - { - this.types = types; - this.harvesterCore = harvesterCore; - - this.buildParameters = this.types.buildParametersType.GetConstructor(new Type[] { }).Invoke(null); - - try - { - var loggers = this.CreateLoggers(); - - // this.buildParameters.Loggers = loggers; - this.types.buildParametersType.GetProperty("Loggers").SetValue(this.buildParameters, loggers, null); - } - catch (TargetInvocationException tie) - { - if (this.harvesterCore != null) - { - this.harvesterCore.Messaging.Write(HarvesterWarnings.NoLogger(tie.InnerException.Message)); - } - } - catch (Exception e) - { - if (this.harvesterCore != null) - { - this.harvesterCore.Messaging.Write(HarvesterWarnings.NoLogger(e.Message)); - } - } - - this.buildManager = this.types.buildManagerType.GetConstructor(new Type[] { }).Invoke(null); - - if (configuration != null || platform != null) - { - Dictionary globalVariables = new Dictionary(); - if (configuration != null) - { - globalVariables.Add("Configuration", configuration); - } - - if (platform != null) - { - globalVariables.Add("Platform", platform); - } - - this.projectCollection = this.types.projectCollectionType.GetConstructor(new Type[] { typeof(IDictionary) }).Invoke(new object[] { globalVariables }); - } - else - { - this.projectCollection = this.types.projectCollectionType.GetConstructor(new Type[] {}).Invoke(null); - } - } - - private object CreateLoggers() - { - var logger = new HarvestLogger(this.harvesterCore.Messaging); - var loggerVerbosity = Enum.Parse(this.types.loggerVerbosityType, "Minimal"); - var writeHandler = Delegate.CreateDelegate(this.types.writeHandlerType, logger, nameof(logger.LogMessage)); - var colorSetter = Delegate.CreateDelegate(this.types.colorSetterType, logger, nameof(logger.SetColor)); - var colorResetter = Delegate.CreateDelegate(this.types.colorResetterType, logger, nameof(logger.ResetColor)); - - var consoleLoggerCtor = this.types.consoleLoggerType.GetConstructor(new Type[] { - this.types.loggerVerbosityType, - this.types.writeHandlerType, - this.types.colorSetterType, - this.types.colorResetterType, - }); - var consoleLogger = consoleLoggerCtor.Invoke(new object[] { loggerVerbosity, writeHandler, colorSetter, colorResetter }); - - var loggers = Array.CreateInstance(this.types.iLoggerType, 1); - loggers.SetValue(consoleLogger, 0); - - return loggers; - } - - public override bool Build(string projectFileName, string[] targetNames, IDictionary targetOutputs) - { - try - { - // this.buildManager.BeginBuild(this.buildParameters); - this.types.buildManagerType.GetMethod("BeginBuild", new Type[] { this.types.buildParametersType }).Invoke(this.buildManager, new object[] { this.buildParameters }); - - // buildRequestData = new BuildRequestData(this.currentProjectInstance, targetNames, null, BuildRequestData.BuildRequestDataFlags.ReplaceExistingProjectInstance); - ConstructorInfo buildRequestDataCtor = this.types.buildRequestDataType.GetConstructor( - new Type[] - { - this.types.projectInstanceType, typeof(string[]), this.types.hostServicesType, this.types.buildRequestDataFlagsType - }); - object buildRequestDataFlags = this.types.buildRequestDataFlagsType.GetField("ReplaceExistingProjectInstance").GetRawConstantValue(); - object buildRequestData = buildRequestDataCtor.Invoke(new object[] { this.currentProjectInstance, targetNames, null, buildRequestDataFlags }); - - // BuildSubmission submission = this.buildManager.PendBuildRequest(buildRequestData); - object submission = this.types.buildManagerType.GetMethod("PendBuildRequest", new Type[] { this.types.buildRequestDataType }) - .Invoke(this.buildManager, new object[] { buildRequestData }); - - // BuildResult buildResult = submission.Execute(); - object buildResult = submission.GetType().GetMethod("Execute", new Type[] { }).Invoke(submission, null); - - // bool buildSucceeded = buildResult.OverallResult == BuildResult.Success; - object overallResult = buildResult.GetType().GetProperty("OverallResult").GetValue(buildResult, null); - bool buildSucceeded = String.Equals(overallResult.ToString(), "Success", StringComparison.Ordinal); - - // this.buildManager.EndBuild(); - this.types.buildManagerType.GetMethod("EndBuild", new Type[] { }).Invoke(this.buildManager, null); - - // fill in empty lists for each target so that heat will look at the item group later - foreach (string target in targetNames) - { - targetOutputs.Add(target, new List()); - } - - return buildSucceeded; - } - catch (TargetInvocationException tie) - { - throw new WixException(HarvesterErrors.CannotBuildProject(projectFileName, tie.InnerException.Message)); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotBuildProject(projectFileName, e.Message)); - } - } - - public override MSBuildProjectItemType GetBuildItem(object buildItem) - { - return new MSBuild40ProjectItemType(buildItem); - } - - public override IEnumerable GetEvaluatedItemsByName(string itemName) - { - MethodInfo getEvaluatedItem = this.types.projectInstanceType.GetMethod("GetItems", new Type[] { typeof(string) }); - return (IEnumerable)getEvaluatedItem.Invoke(this.currentProjectInstance, new object[] { itemName }); - } - - public override string GetEvaluatedProperty(string propertyName) - { - MethodInfo getProperty = this.types.projectInstanceType.GetMethod("GetPropertyValue", new Type[] { typeof(string) }); - return (string)getProperty.Invoke(this.currentProjectInstance, new object[] { propertyName }); - } - - public override void Load(string projectFileName) - { - try - { - //this.project = this.projectCollection.LoadProject(projectFileName); - this.project = this.types.projectCollectionType.GetMethod("LoadProject", new Type[] { typeof(string) }).Invoke(this.projectCollection, new object[] { projectFileName }); - - // this.currentProjectInstance = this.project.CreateProjectInstance(); - MethodInfo createProjectInstanceMethod = this.projectType.GetMethod("CreateProjectInstance", new Type[] { }); - this.currentProjectInstance = createProjectInstanceMethod.Invoke(this.project, null); - } - catch (TargetInvocationException tie) - { - throw new WixException(HarvesterErrors.CannotLoadProject(projectFileName, tie.InnerException.Message)); - } - catch (Exception e) - { - throw new WixException(HarvesterErrors.CannotLoadProject(projectFileName, e.Message)); - } - } - } - - private class MSBuild40ProjectItemType : MSBuildProjectItemType - { - public MSBuild40ProjectItemType(object buildItem) - : base(buildItem) - { - } - - public override string ToString() - { - PropertyInfo includeProperty = this.buildItem.GetType().GetProperty("EvaluatedInclude"); - return (string)includeProperty.GetValue(this.buildItem, null); - } - - public override string GetMetadata(string name) - { - MethodInfo getMetadataMethod = this.buildItem.GetType().GetMethod("GetMetadataValue"); - if (null != getMetadataMethod) - { - return (string)getMetadataMethod.Invoke(this.buildItem, new object[] { name }); - } - return string.Empty; - } - } - - /// - /// Used internally in the VSProjectHarvester class to encapsulate - /// the settings for a particular MSBuild "project output group". - /// - private struct ProjectOutputGroup - { - public readonly string Name; - public readonly string BuildOutputGroup; - public readonly string FileSource; - - /// - /// Creates a new project output group. - /// - /// Friendly name used by heat. - /// MSBuild's name of the project output group. - /// VS directory token containing the files of the POG. - public ProjectOutputGroup(string name, string buildOutputGroup, string fileSource) - { - this.Name = name; - this.BuildOutputGroup = buildOutputGroup; - this.FileSource = fileSource; - } - } - - /// - /// Internal class for getting and setting common attrbiutes on - /// directory elements. - /// - internal class DirectoryAttributeAccessor - { - public Wix.ISchemaElement directoryElement; - - public DirectoryAttributeAccessor(Wix.ISchemaElement directoryElement) - { - this.directoryElement = directoryElement; - } - - /// - /// Gets the element as a ISchemaElement. - /// - public Wix.ISchemaElement Element - { - get { return this.directoryElement; } - } - - /// - /// Gets the element as a IParentElement. - /// - public Wix.IParentElement ElementAsParent - { - get { return (Wix.IParentElement)this.directoryElement; } - } - - /// - /// Gets or sets the Id attrbiute. - /// - public string Id - { - get - { - if (this.directoryElement is Wix.Directory wixDirectory) - { - return wixDirectory.Id; - } - else if (this.directoryElement is Wix.DirectoryRef wixDirectoryRef) - { - return wixDirectoryRef.Id; - } - else - { - throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Id")); - } - } - set - { - if (this.directoryElement is Wix.Directory wixDirectory) - { - wixDirectory.Id = value; - } - else if (this.directoryElement is Wix.DirectoryRef wixDirectoryRef) - { - wixDirectoryRef.Id = value; - } - else - { - throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Id")); - } - } - } - - /// - /// Gets or sets the Name attribute. - /// - public string Name - { - get - { - if (this.directoryElement is Wix.Directory wixDirectory) - { - return wixDirectory.Name; - } - else - { - throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Name")); - } - } - set - { - if (this.directoryElement is Wix.Directory wixDirectory) - { - wixDirectory.Name = value; - } - else - { - throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Name")); - } - } - } - } - - internal class HarvestLogger - { - public HarvestLogger(IMessaging messaging) - { - this.Color = ConsoleColor.Black; - this.Messaging = messaging; - } - - private ConsoleColor Color { get; set; } - private IMessaging Messaging { get; } - - public void LogMessage(string message) - { - if (this.Color == ConsoleColor.Red) - { - this.Messaging.Write(HarvesterErrors.BuildErrorDuringHarvesting(message)); - } - } - - public void SetColor(ConsoleColor color) - { - this.Color = color; - } - - public void ResetColor() - { - this.Color = ConsoleColor.Black; - } - } - } -} diff --git a/src/heat/app.config b/src/heat/app.config deleted file mode 100644 index 65d3d6c3..00000000 --- a/src/heat/app.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/heat/heat.csproj b/src/heat/heat.csproj deleted file mode 100644 index 650203b0..00000000 --- a/src/heat/heat.csproj +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - netcoreapp3.1;net461 - Exe - Harvester - WiX Harvester - embedded - true - - win-x86 - app.config - heat.exe.manifest - LatestMajor - - - - - - - - - True - True - WixHarvesterStrings.resx - - - - - - ResXFileCodeGenerator - WixHarvesterStrings.Designer.cs - - - - - - - - - - - - - - - - - - - - diff --git a/src/heat/heat.exe.manifest b/src/heat/heat.exe.manifest deleted file mode 100644 index b4adfbb7..00000000 --- a/src/heat/heat.exe.manifest +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - WiX Toolset Harvester - - - - - - - - - - true - - - diff --git a/src/heat/heat.net461.v3.ncrunchproject b/src/heat/heat.net461.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/heat/heat.net461.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/heat/heat.netcoreapp2.1.v3.ncrunchproject b/src/heat/heat.netcoreapp2.1.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/heat/heat.netcoreapp2.1.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/samples/ThmViewerPackage/Package.wxs b/src/samples/ThmViewerPackage/Package.wxs new file mode 100644 index 00000000..cb2139cf --- /dev/null +++ b/src/samples/ThmViewerPackage/Package.wxs @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/samples/ThmViewerPackage/ThmViewerPackage.wixproj b/src/samples/ThmViewerPackage/ThmViewerPackage.wixproj new file mode 100644 index 00000000..23d24654 --- /dev/null +++ b/src/samples/ThmViewerPackage/ThmViewerPackage.wixproj @@ -0,0 +1,35 @@ + + + + + + 59c4b122-5167-445b-8fc4-09dcd4eced89 + thmviewer + Package + + + + + + + + + + + + + thmviewer + {95228C13-97F5-484A-B4A2-ECF4618B0881} + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + diff --git a/src/samples/ThmViewerPackage/packages.config b/src/samples/ThmViewerPackage/packages.config new file mode 100644 index 00000000..7e55f706 --- /dev/null +++ b/src/samples/ThmViewerPackage/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/samples/thmviewer/Resources/LoremIpsum.rtf b/src/samples/thmviewer/Resources/LoremIpsum.rtf new file mode 100644 index 00000000..1ab0e65b Binary files /dev/null and b/src/samples/thmviewer/Resources/LoremIpsum.rtf differ diff --git a/src/samples/thmviewer/Resources/thm.xml b/src/samples/thmviewer/Resources/thm.xml new file mode 100644 index 00000000..6394f0f1 --- /dev/null +++ b/src/samples/thmviewer/Resources/thm.xml @@ -0,0 +1,11 @@ + + + + + + Consolas + Consolas + + + + diff --git a/src/samples/thmviewer/display.cpp b/src/samples/thmviewer/display.cpp new file mode 100644 index 00000000..52fa3cf8 --- /dev/null +++ b/src/samples/thmviewer/display.cpp @@ -0,0 +1,354 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +static const LPCWSTR THMVWR_WINDOW_CLASS_DISPLAY = L"ThmViewerDisplay"; + +struct DISPLAY_THREAD_CONTEXT +{ + HWND hWnd; + HINSTANCE hInstance; + + HANDLE hInit; +}; + +static DWORD WINAPI DisplayThreadProc( + __in LPVOID pvContext + ); +static LRESULT CALLBACK DisplayWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ); +static BOOL DisplayOnCreate( + __in THEME* pTheme, + __in HWND hWnd + ); + + +extern "C" HRESULT DisplayStart( + __in HINSTANCE hInstance, + __in HWND hWnd, + __out HANDLE *phThread, + __out DWORD* pdwThreadId + ) +{ + HRESULT hr = S_OK; + HANDLE rgHandles[2] = { }; + DISPLAY_THREAD_CONTEXT context = { }; + + rgHandles[0] = ::CreateEventW(NULL, TRUE, FALSE, NULL); + ExitOnNullWithLastError(rgHandles[0], hr, "Failed to create load init event."); + + context.hWnd = hWnd; + context.hInstance = hInstance; + context.hInit = rgHandles[0]; + + rgHandles[1] = ::CreateThread(NULL, 0, DisplayThreadProc, reinterpret_cast(&context), 0, pdwThreadId); + ExitOnNullWithLastError(rgHandles[1], hr, "Failed to create display thread."); + + ::WaitForMultipleObjects(countof(rgHandles), rgHandles, FALSE, INFINITE); + + *phThread = rgHandles[1]; + rgHandles[1] = NULL; + +LExit: + ReleaseHandle(rgHandles[1]); + ReleaseHandle(rgHandles[0]); + return hr; +} + +static DWORD WINAPI DisplayThreadProc( + __in LPVOID pvContext + ) +{ + HRESULT hr = S_OK; + + DISPLAY_THREAD_CONTEXT* pContext = static_cast(pvContext); + HINSTANCE hInstance = pContext->hInstance; + HWND hwndParent = pContext->hWnd; + + // We can signal the initialization event as soon as we have copied the context + // values into local variables. + ::SetEvent(pContext->hInit); + + BOOL fComInitialized = FALSE; + + HANDLE_THEME* pCurrentHandle = NULL; + ATOM atomWc = 0; + WNDCLASSW wc = { }; // the following are constant for the display window class. + wc.lpfnWndProc = DisplayWndProc; + wc.hInstance = hInstance; + wc.lpszClassName = THMVWR_WINDOW_CLASS_DISPLAY; + + HWND hWnd = NULL; + RECT rc = { }; + int x = CW_USEDEFAULT; + int y = CW_USEDEFAULT; + + BOOL fRedoMsg = FALSE; + BOOL fRet = FALSE; + MSG msg = { }; + + BOOL fCreateIfNecessary = FALSE; + + hr = ::CoInitialize(NULL); + ExitOnFailure(hr, "Failed to initialize COM on display thread."); + fComInitialized = TRUE; + + // As long as the parent window is alive and kicking, keep this thread going (with or without a theme to display ). + while (::IsWindow(hwndParent)) + { + if (pCurrentHandle && fCreateIfNecessary) + { + THEME* pTheme = pCurrentHandle->pTheme; + + if (CW_USEDEFAULT == x && CW_USEDEFAULT == y && ::GetWindowRect(hwndParent, &rc)) + { + x = rc.left; + y = rc.bottom + 20; + } + + hr = ThemeCreateParentWindow(pTheme, 0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, hwndParent, hInstance, pCurrentHandle, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); + ExitOnFailure(hr, "Failed to create display window."); + + fCreateIfNecessary = FALSE; + } + + // message pump + while (fRedoMsg || 0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0))) + { + if (fRedoMsg) + { + fRedoMsg = FALSE; + } + + if (-1 == fRet) + { + hr = E_UNEXPECTED; + ExitOnFailure(hr, "Unexpected return value from display message pump."); + } + else if (NULL == msg.hwnd) // Thread message. + { + if (WM_THMVWR_NEW_THEME == msg.message) + { + // If there is already a handle, release it. + if (pCurrentHandle) + { + DecrementHandleTheme(pCurrentHandle); + pCurrentHandle = NULL; + } + + // If the window was created, remember its window location before we destroy + // it so so we can open the new window in the same place. + if (::IsWindow(hWnd)) + { + ::GetWindowRect(hWnd, &rc); + x = rc.left; + y = rc.top; + + ::DestroyWindow(hWnd); + } + + // If the display window class was registered, unregister it so we can + // reuse the same window class name for the new theme. + if (atomWc) + { + if (!::UnregisterClassW(reinterpret_cast(atomWc), hInstance)) + { + DWORD er = ::GetLastError(); + er = er; + } + + atomWc = 0; + } + + // If we were provided a new theme handle, create a new window class to + // support it. + pCurrentHandle = reinterpret_cast(msg.lParam); + if (pCurrentHandle) + { + wc.hIcon = reinterpret_cast(pCurrentHandle->pTheme->hIcon); + wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); + if (0 < pCurrentHandle->pTheme->cFonts) + { + wc.hbrBackground = pCurrentHandle->pTheme->rgFonts[pCurrentHandle->pTheme->dwFontId].hBackground; + } + atomWc = ::RegisterClassW(&wc); + if (!atomWc) + { + ExitWithLastError(hr, "Failed to register display window class."); + } + } + } + else if (WM_THMVWR_SHOWPAGE == msg.message) + { + if (pCurrentHandle && ::IsWindow(hWnd) && pCurrentHandle->pTheme->hwndParent == hWnd) + { + DWORD dwPageId = static_cast(msg.lParam); + int nCmdShow = static_cast(msg.wParam); + + // First show/hide the controls not associated with a page. + for (DWORD i = 0; i < pCurrentHandle->pTheme->cControls; ++i) + { + THEME_CONTROL* pControl = pCurrentHandle->pTheme->rgControls + i; + if (!pControl->wPageId) + { + ThemeShowControl(pCurrentHandle->pTheme, pControl->wId, nCmdShow); + } + } + + // If a page id was provided also, show/hide those controls + if (dwPageId) + { + // Ignore error since we aren't using variables and it can only fail when using variables. + ThemeShowPage(pCurrentHandle->pTheme, dwPageId, nCmdShow); + } + } + else // display window isn't visible or it doesn't match the current handle. + { + // Keep the current message around to try again after we break out of this loop + // and create the window. + fRedoMsg = TRUE; + fCreateIfNecessary = TRUE; + break; + } + } + } + else if (!ThemeHandleKeyboardMessage(pCurrentHandle->pTheme, hwndParent, &msg)) // Window message. + { + ::TranslateMessage(&msg); + ::DispatchMessageW(&msg); + } + } + } + +LExit: + if (::IsWindow(hWnd)) + { + ::DestroyWindow(hWnd); + } + + if (atomWc) + { + if (!::UnregisterClassW(THMVWR_WINDOW_CLASS_DISPLAY, hInstance)) + { + DWORD er = ::GetLastError(); + er = er; + } + } + + DecrementHandleTheme(pCurrentHandle); + + if (fComInitialized) + { + ::CoUninitialize(); + } + + return hr; +} + +static LRESULT CALLBACK DisplayWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ) +{ + static DWORD dwProgress = 0; + HANDLE_THEME* pHandleTheme = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); + + switch (uMsg) + { + case WM_NCCREATE: + { + LPCREATESTRUCT lpcs = reinterpret_cast(lParam); + pHandleTheme = reinterpret_cast(lpcs->lpCreateParams); + IncrementHandleTheme(pHandleTheme); + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pHandleTheme)); + } + break; + + case WM_CREATE: + if (!DisplayOnCreate(pHandleTheme->pTheme, hWnd)) + { + return -1; + } + break; + + case WM_TIMER: + if (!lParam && SUCCEEDED(ThemeSetProgressControl(pHandleTheme->pTheme, wParam, dwProgress))) + { + dwProgress += rand() % 10 + 1; + if (dwProgress > 100) + { + dwProgress = 0; + } + + return 0; + } + break; + + case WM_COMMAND: + { + WCHAR wzText[1024]; + ::StringCchPrintfW(wzText, countof(wzText), L"Command %u\r\n", LOWORD(wParam)); + OutputDebugStringW(wzText); + //::MessageBoxW(hWnd, wzText, L"Command fired", MB_OK); + } + break; + + case WM_SYSCOMMAND: + { + WCHAR wzText[1024]; + ::StringCchPrintfW(wzText, countof(wzText), L"SysCommand %u\r\n", LOWORD(wParam)); + OutputDebugStringW(wzText); + //::MessageBoxW(hWnd, wzText, L"Command fired", MB_OK); + } + break; + + case WM_DESTROY: + ThemeUnloadControls(pHandleTheme->pTheme); + ::PostQuitMessage(0); + break; + + case WM_NCDESTROY: + DecrementHandleTheme(pHandleTheme); + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, 0); + break; + } + + return ThemeDefWindowProc(pHandleTheme ? pHandleTheme->pTheme : NULL, hWnd, uMsg, wParam, lParam); +} + +static BOOL DisplayOnCreate( + __in THEME* pTheme, + __in HWND hWnd + ) +{ + HRESULT hr = S_OK; + + hr = ThemeLoadControls(pTheme, NULL, 0); + ExitOnFailure(hr, "Failed to load theme controls"); + + // Pre-populate some control types with data. + for (DWORD i = 0; i < pTheme->cControls; ++i) + { + THEME_CONTROL* pControl = pTheme->rgControls + i; + if (THEME_CONTROL_TYPE_RICHEDIT == pControl->type) + { + hr = ThemeLoadRichEditFromResource(pTheme, pControl->wId, MAKEINTRESOURCEA(THMVWR_RES_RICHEDIT_FILE), ::GetModuleHandleW(NULL)); + ExitOnFailure(hr, "Failed to load richedit text."); + } + else if (THEME_CONTROL_TYPE_PROGRESSBAR == pControl->type) + { + DWORD dwId = ::SetTimer(hWnd, pControl->wId, 500, NULL); + dwId = dwId; // prevents warning in "ship" build. + Assert(dwId == pControl->wId); + } + } + +LExit: + return SUCCEEDED(hr); +} diff --git a/src/samples/thmviewer/load.cpp b/src/samples/thmviewer/load.cpp new file mode 100644 index 00000000..0267402a --- /dev/null +++ b/src/samples/thmviewer/load.cpp @@ -0,0 +1,221 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +struct LOAD_THREAD_CONTEXT +{ + HWND hWnd; + LPCWSTR wzThemePath; + LPCWSTR wzWxlPath; + + HANDLE hInit; +}; + +static DWORD WINAPI LoadThreadProc( + __in LPVOID pvContext + ); + + +extern "C" HRESULT LoadStart( + __in_z LPCWSTR wzThemePath, + __in_z_opt LPCWSTR wzWxlPath, + __in HWND hWnd, + __out HANDLE* phThread + ) +{ + HRESULT hr = S_OK; + HANDLE rgHandles[2] = { }; + LOAD_THREAD_CONTEXT context = { }; + + rgHandles[0] = ::CreateEventW(NULL, TRUE, FALSE, NULL); + ExitOnNullWithLastError(rgHandles[0], hr, "Failed to create load init event."); + + context.hWnd = hWnd; + context.wzThemePath = wzThemePath; + context.wzWxlPath = wzWxlPath; + context.hInit = rgHandles[0]; + + rgHandles[1] = ::CreateThread(NULL, 0, LoadThreadProc, &context, 0, NULL); + ExitOnNullWithLastError(rgHandles[1], hr, "Failed to create load thread."); + + ::WaitForMultipleObjects(countof(rgHandles), rgHandles, FALSE, INFINITE); + + *phThread = rgHandles[1]; + rgHandles[1] = NULL; + +LExit: + ReleaseHandle(rgHandles[1]); + ReleaseHandle(rgHandles[0]); + return hr; +} + + +static DWORD WINAPI LoadThreadProc( + __in LPVOID pvContext + ) +{ + HRESULT hr = S_OK; + WIX_LOCALIZATION* pWixLoc = NULL; + LPWSTR sczThemePath = NULL; + LPWSTR sczWxlPath = NULL; + BOOL fComInitialized = FALSE; + HANDLE hDirectory = INVALID_HANDLE_VALUE; + LPWSTR sczDirectory = NULL; + LPWSTR wzFileName = NULL; + + THEME* pTheme = NULL; + HANDLE_THEME* pHandle = NULL; + + LOAD_THREAD_CONTEXT* pContext = static_cast(pvContext); + HWND hWnd = pContext->hWnd; + + hr = StrAllocString(&sczThemePath, pContext->wzThemePath, 0); + ExitOnFailure(hr, "Failed to copy path to initial theme file."); + + if (pContext->wzWxlPath) + { + hr = StrAllocString(&sczWxlPath, pContext->wzWxlPath, 0); + ExitOnFailure(hr, "Failed to copy .wxl path to initial file."); + } + + // We can signal the initialization event as soon as we have copied the context + // values into local variables. + ::SetEvent(pContext->hInit); + + hr = ::CoInitialize(NULL); + ExitOnFailure(hr, "Failed to initialize COM on load thread."); + fComInitialized = TRUE; + + // Open a handle to the directory so we can put a notification on it. + hr = PathGetDirectory(sczThemePath, &sczDirectory); + ExitOnFailure(hr, "Failed to get path directory."); + + wzFileName = PathFile(sczThemePath); + + hDirectory = ::CreateFileW(sczDirectory, FILE_LIST_DIRECTORY, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + if (INVALID_HANDLE_VALUE == hDirectory) + { + ExitWithLastError(hr, "Failed to open directory: %ls", sczDirectory); + } + + BOOL fUpdated = FALSE; + do + { + // Get the last modified time on the file we're loading for verification that the + // file actually gets changed down below. + FILETIME ftModified = { }; + FileGetTime(sczThemePath, NULL, NULL, &ftModified); + + ::SendMessageW(hWnd, WM_THMVWR_THEME_LOAD_BEGIN, 0, 0); + + // Try to load the theme file. + hr = ThemeLoadFromFile(sczThemePath, &pTheme); + if (FAILED(hr)) + { + ::SendMessageW(hWnd, WM_THMVWR_THEME_LOAD_ERROR, 0, hr); + } + else + { + if (sczWxlPath) + { + hr = LocLoadFromFile(sczWxlPath, &pWixLoc); + ExitOnFailure(hr, "Failed to load loc file from path: %ls", sczWxlPath); + + hr = ThemeLocalize(pTheme, pWixLoc); + ExitOnFailure(hr, "Failed to localize theme: %ls", sczWxlPath); + } + + hr = AllocHandleTheme(pTheme, &pHandle); + ExitOnFailure(hr, "Failed to allocate handle to theme"); + + ::SendMessageW(hWnd, WM_THMVWR_NEW_THEME, 0, reinterpret_cast(pHandle)); + pHandle = NULL; + } + + fUpdated = FALSE; + do + { + DWORD rgbNotifications[1024]; + DWORD cbRead = 0; + if (!::ReadDirectoryChangesW(hDirectory, rgbNotifications, sizeof(rgbNotifications), FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE, &cbRead, NULL, NULL)) + { + ExitWithLastError(hr, "Failed while watching directory: %ls", sczDirectory); + } + + // Wait for half a second to let all the file handles get closed to minimize access + // denied errors. + ::Sleep(500); + + FILE_NOTIFY_INFORMATION* pNotification = reinterpret_cast(rgbNotifications); + while (pNotification) + { + // If our file was updated, check to see if the modified time really changed. The notifications + // are often trigger happy thinking the file changed two or three times in a row. Maybe it's AV + // software creating the problems but actually checking the modified date works well. + if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pNotification->FileName, pNotification->FileNameLength / sizeof(WCHAR), wzFileName, -1)) + { + FILETIME ft = { }; + FileGetTime(sczThemePath, NULL, NULL, &ft); + + fUpdated = (ftModified.dwHighDateTime < ft.dwHighDateTime) || (ftModified.dwHighDateTime == ft.dwHighDateTime && ftModified.dwLowDateTime < ft.dwLowDateTime); + break; + } + + pNotification = pNotification->NextEntryOffset ? reinterpret_cast(reinterpret_cast(pNotification) + pNotification->NextEntryOffset) : NULL; + } + } while (!fUpdated); + } while(fUpdated); + +LExit: + if (fComInitialized) + { + ::CoUninitialize(); + } + + LocFree(pWixLoc); + ReleaseFileHandle(hDirectory); + ReleaseStr(sczDirectory); + ReleaseStr(sczThemePath); + ReleaseStr(sczWxlPath); + return hr; +} + +extern "C" HRESULT AllocHandleTheme( + __in THEME* pTheme, + __out HANDLE_THEME** ppHandle + ) +{ + HRESULT hr = S_OK; + HANDLE_THEME* pHandle = NULL; + + pHandle = static_cast(MemAlloc(sizeof(HANDLE_THEME), TRUE)); + ExitOnNull(pHandle, hr, E_OUTOFMEMORY, "Failed to allocate theme handle."); + + pHandle->cReferences = 1; + pHandle->pTheme = pTheme; + + *ppHandle = pHandle; + pHandle = NULL; + +LExit: + ReleaseMem(pHandle); + return hr; +} + +extern "C" void IncrementHandleTheme( + __in HANDLE_THEME* pHandle + ) +{ + ::InterlockedIncrement(reinterpret_cast(&pHandle->cReferences)); +} + +extern "C" void DecrementHandleTheme( + __in HANDLE_THEME* pHandle + ) +{ + if (pHandle && 0 == ::InterlockedDecrement(reinterpret_cast(&pHandle->cReferences))) + { + ThemeFree(pHandle->pTheme); + MemFree(pHandle); + } +} diff --git a/src/samples/thmviewer/packages.config b/src/samples/thmviewer/packages.config new file mode 100644 index 00000000..a98c0c8e --- /dev/null +++ b/src/samples/thmviewer/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/samples/thmviewer/precomp.cpp b/src/samples/thmviewer/precomp.cpp new file mode 100644 index 00000000..37664a1c --- /dev/null +++ b/src/samples/thmviewer/precomp.cpp @@ -0,0 +1,3 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" diff --git a/src/samples/thmviewer/precomp.h b/src/samples/thmviewer/precomp.h new file mode 100644 index 00000000..15d889fc --- /dev/null +++ b/src/samples/thmviewer/precomp.h @@ -0,0 +1,70 @@ +#pragma once +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + + +#include +#include +#include +#include +#include +#include +#include + +#pragma warning(push) +#pragma warning(disable:4458) +#include +#pragma warning(pop) + +#include "dutil.h" +#include "apputil.h" +#include "memutil.h" +#include "dirutil.h" +#include "fileutil.h" +#include "locutil.h" +#include "logutil.h" +#include "pathutil.h" +#include "resrutil.h" +#include "shelutil.h" +#include "strutil.h" +#include "thmutil.h" + +#include "resource.h" + +struct HANDLE_THEME +{ + DWORD cReferences; + THEME* pTheme; +}; + +enum WM_THMVWR +{ + WM_THMVWR_SHOWPAGE = WM_APP, + WM_THMVWR_PARSE_FILE, + WM_THMVWR_NEW_THEME, + WM_THMVWR_THEME_LOAD_ERROR, + WM_THMVWR_THEME_LOAD_BEGIN, +}; + +extern "C" HRESULT DisplayStart( + __in HINSTANCE hInstance, + __in HWND hWnd, + __out HANDLE *phThread, + __out DWORD* pdwThreadId + ); +extern "C" HRESULT LoadStart( + __in_z LPCWSTR wzThemePath, + __in_z LPCWSTR wzWxlPath, + __in HWND hWnd, + __out HANDLE* phThread + ); + +extern "C" HRESULT AllocHandleTheme( + __in THEME* pTheme, + __out HANDLE_THEME** ppHandle + ); +extern "C" void IncrementHandleTheme( + __in HANDLE_THEME* pHandle + ); +extern "C" void DecrementHandleTheme( + __in HANDLE_THEME* pHandle + ); diff --git a/src/samples/thmviewer/resource.h b/src/samples/thmviewer/resource.h new file mode 100644 index 00000000..4acc32cc --- /dev/null +++ b/src/samples/thmviewer/resource.h @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#define IDC_STATIC -1 +#define THMVWR_RES_THEME_FILE 1 +#define THMVWR_RES_RICHEDIT_FILE 2 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1003 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/samples/thmviewer/thmviewer.cpp b/src/samples/thmviewer/thmviewer.cpp new file mode 100644 index 00000000..f83182d3 --- /dev/null +++ b/src/samples/thmviewer/thmviewer.cpp @@ -0,0 +1,543 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include "precomp.h" + +static const LPCWSTR THMVWR_WINDOW_CLASS_MAIN = L"ThmViewerMain"; + +static THEME* vpTheme = NULL; +static DWORD vdwDisplayThreadId = 0; +static LPWSTR vsczThemeLoadErrors = NULL; + +enum THMVWR_CONTROL +{ + // Non-paged controls + THMVWR_CONTROL_TREE = THEME_FIRST_ASSIGN_CONTROL_ID, +}; + +static THEME_ASSIGN_CONTROL_ID vrgInitControls[] = { + { THMVWR_CONTROL_TREE, L"Tree" }, +}; + +// Internal functions + +static HRESULT ProcessCommandLine( + __in_z_opt LPCWSTR wzCommandLine, + __out_z LPWSTR* psczThemeFile, + __out_z LPWSTR* psczWxlFile + ); +static HRESULT CreateTheme( + __in HINSTANCE hInstance, + __out THEME** ppTheme + ); +static HRESULT CreateMainWindowClass( + __in HINSTANCE hInstance, + __in THEME* pTheme, + __out ATOM* pAtom + ); +static LRESULT CALLBACK MainWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ); +static void OnThemeLoadBegin( + __in_z_opt LPWSTR sczThemeLoadErrors + ); +static void OnThemeLoadError( + __in THEME* pTheme, + __in HRESULT hrFailure + ); +static void OnNewTheme( + __in THEME* pTheme, + __in HWND hWnd, + __in HANDLE_THEME* pHandle + ); +static void CALLBACK ThmviewerTraceError( + __in_z LPCSTR szFile, + __in int iLine, + __in REPORT_LEVEL rl, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ); + + +int WINAPI wWinMain( + __in HINSTANCE hInstance, + __in_opt HINSTANCE /* hPrevInstance */, + __in_z LPWSTR lpCmdLine, + __in int /*nCmdShow*/ + ) +{ + ::HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); + + HRESULT hr = S_OK; + BOOL fComInitialized = FALSE; + LPWSTR sczThemeFile = NULL; + LPWSTR sczWxlFile = NULL; + ATOM atom = 0; + HWND hWnd = NULL; + + HANDLE hDisplayThread = NULL; + HANDLE hLoadThread = NULL; + + BOOL fRet = FALSE; + MSG msg = { }; + + hr = ::CoInitialize(NULL); + ExitOnFailure(hr, "Failed to initialize COM."); + fComInitialized = TRUE; + + DutilInitialize(&ThmviewerTraceError); + + hr = ProcessCommandLine(lpCmdLine, &sczThemeFile, &sczWxlFile); + ExitOnFailure(hr, "Failed to process command line."); + + hr = CreateTheme(hInstance, &vpTheme); + ExitOnFailure(hr, "Failed to create theme."); + + hr = CreateMainWindowClass(hInstance, vpTheme, &atom); + ExitOnFailure(hr, "Failed to create main window."); + + hr = ThemeCreateParentWindow(vpTheme, 0, reinterpret_cast(atom), vpTheme->sczCaption, vpTheme->dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, hInstance, NULL, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); + ExitOnFailure(hr, "Failed to create window."); + + if (!sczThemeFile) + { + // Prompt for a path to the theme file. + OPENFILENAMEW ofn = { }; + WCHAR wzFile[MAX_PATH] = { }; + + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = hWnd; + ofn.lpstrFile = wzFile; + ofn.nMaxFile = countof(wzFile); + ofn.lpstrFilter = L"Theme Files (*.thm)\0*.thm\0XML Files (*.xml)\0*.xml\0All Files (*.*)\0*.*\0"; + ofn.nFilterIndex = 1; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + ofn.lpstrTitle = vpTheme->sczCaption; + + if (::GetOpenFileNameW(&ofn)) + { + hr = StrAllocString(&sczThemeFile, wzFile, 0); + ExitOnFailure(hr, "Failed to copy opened file to theme file."); + } + else + { + ::MessageBoxW(hWnd, L"Must specify a path to theme file.", vpTheme->sczCaption, MB_OK | MB_ICONERROR); + ExitFunction1(hr = E_INVALIDARG); + } + } + + hr = DisplayStart(hInstance, hWnd, &hDisplayThread, &vdwDisplayThreadId); + ExitOnFailure(hr, "Failed to start display."); + + hr = LoadStart(sczThemeFile, sczWxlFile, hWnd, &hLoadThread); + ExitOnFailure(hr, "Failed to start load."); + + // message pump + while (0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0))) + { + if (-1 == fRet) + { + hr = E_UNEXPECTED; + ExitOnFailure(hr, "Unexpected return value from message pump."); + } + else if (!ThemeHandleKeyboardMessage(vpTheme, msg.hwnd, &msg)) + { + ::TranslateMessage(&msg); + ::DispatchMessageW(&msg); + } + } + +LExit: + if (::IsWindow(hWnd)) + { + ::DestroyWindow(hWnd); + } + + if (hDisplayThread) + { + ::PostThreadMessageW(vdwDisplayThreadId, WM_QUIT, 0, 0); + ::WaitForSingleObject(hDisplayThread, 10000); + ::CloseHandle(hDisplayThread); + } + + // TODO: come up with a good way to kill the load thread, probably need to switch + // the ReadDirectoryW() to overlapped mode. + ReleaseHandle(hLoadThread); + + if (atom && !::UnregisterClassW(reinterpret_cast(atom), hInstance)) + { + DWORD er = ::GetLastError(); + er = er; + } + + ThemeFree(vpTheme); + ThemeUninitialize(); + DutilUninitialize(); + + // uninitialize COM + if (fComInitialized) + { + ::CoUninitialize(); + } + + ReleaseNullStr(vsczThemeLoadErrors); + ReleaseStr(sczThemeFile); + ReleaseStr(sczWxlFile); + return hr; +} + +static void CALLBACK ThmviewerTraceError( + __in_z LPCSTR /*szFile*/, + __in int /*iLine*/, + __in REPORT_LEVEL /*rl*/, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ) +{ + HRESULT hr = S_OK; + LPSTR sczFormattedAnsi = NULL; + LPWSTR sczMessage = NULL; + + if (DUTIL_SOURCE_THMUTIL != source) + { + ExitFunction(); + } + + hr = StrAnsiAllocFormattedArgs(&sczFormattedAnsi, szFormat, args); + ExitOnFailure(hr, "Failed to format error log string."); + + hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x: %S\r\n", hrError, sczFormattedAnsi); + ExitOnFailure(hr, "Failed to prepend error number to error log string."); + + hr = StrAllocConcat(&vsczThemeLoadErrors, sczMessage, 0); + ExitOnFailure(hr, "Failed to append theme load error."); + +LExit: + ReleaseStr(sczFormattedAnsi); + ReleaseStr(sczMessage); +} + + +// +// ProcessCommandLine - process the provided command line arguments. +// +static HRESULT ProcessCommandLine( + __in_z_opt LPCWSTR wzCommandLine, + __out_z LPWSTR* psczThemeFile, + __out_z LPWSTR* psczWxlFile + ) +{ + HRESULT hr = S_OK; + int argc = 0; + LPWSTR* argv = NULL; + + if (wzCommandLine && *wzCommandLine) + { + hr = AppParseCommandLine(wzCommandLine, &argc, &argv); + ExitOnFailure(hr, "Failed to parse command line."); + + for (int i = 0; i < argc; ++i) + { + if (argv[i][0] == L'-' || argv[i][0] == L'/') + { + if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"lang", -1)) + { + if (i + 1 >= argc) + { + ExitOnRootFailure(hr = E_INVALIDARG, "Must specify a language."); + } + + ++i; + } + } + else + { + LPCWSTR wzExtension = PathExtension(argv[i]); + if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, wzExtension, -1, L".wxl", -1)) + { + hr = StrAllocString(psczWxlFile, argv[i], 0); + } + else + { + hr = StrAllocString(psczThemeFile, argv[i], 0); + } + ExitOnFailure(hr, "Failed to copy path to file."); + } + } + } + +LExit: + if (argv) + { + AppFreeCommandLineArgs(argv); + } + + return hr; +} + +static HRESULT CreateTheme( + __in HINSTANCE hInstance, + __out THEME** ppTheme + ) +{ + HRESULT hr = S_OK; + + hr = ThemeInitialize(hInstance); + ExitOnFailure(hr, "Failed to initialize theme manager."); + + hr = ThemeLoadFromResource(hInstance, MAKEINTRESOURCEA(THMVWR_RES_THEME_FILE), ppTheme); + ExitOnFailure(hr, "Failed to load theme from thmviewer.thm."); + +LExit: + return hr; +} + +static HRESULT CreateMainWindowClass( + __in HINSTANCE hInstance, + __in THEME* pTheme, + __out ATOM* pAtom + ) +{ + HRESULT hr = S_OK; + ATOM atom = 0; + WNDCLASSW wc = { }; + + wc.lpfnWndProc = MainWndProc; + wc.hInstance = hInstance; + wc.hIcon = reinterpret_cast(pTheme->hIcon); + wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); + wc.hbrBackground = pTheme->rgFonts[pTheme->dwFontId].hBackground; + wc.lpszMenuName = NULL; + wc.lpszClassName = THMVWR_WINDOW_CLASS_MAIN; + atom = ::RegisterClassW(&wc); + if (!atom) + { + ExitWithLastError(hr, "Failed to register main windowclass ."); + } + + *pAtom = atom; + +LExit: + return hr; +} + +static LRESULT CALLBACK MainWndProc( + __in HWND hWnd, + __in UINT uMsg, + __in WPARAM wParam, + __in LPARAM lParam + ) +{ + HANDLE_THEME* pHandleTheme = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); + + switch (uMsg) + { + case WM_NCCREATE: + { + //LPCREATESTRUCT lpcs = reinterpret_cast(lParam); + //pBA = reinterpret_cast(lpcs->lpCreateParams); + //::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pBA)); + } + break; + + case WM_NCDESTROY: + DecrementHandleTheme(pHandleTheme); + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, 0); + break; + + case WM_CREATE: + { + HRESULT hr = ThemeLoadControls(vpTheme, vrgInitControls, countof(vrgInitControls)); + if (FAILED(hr)) + { + return -1; + } + } + break; + + case WM_THMVWR_THEME_LOAD_BEGIN: + OnThemeLoadBegin(vsczThemeLoadErrors); + return 0; + + case WM_THMVWR_THEME_LOAD_ERROR: + OnThemeLoadError(vpTheme, lParam); + return 0; + + case WM_THMVWR_NEW_THEME: + OnNewTheme(vpTheme, hWnd, reinterpret_cast(lParam)); + return 0; + + case WM_DESTROY: + ::PostQuitMessage(0); + break; + + case WM_NOTIFY: + { + NMHDR* pnmhdr = reinterpret_cast(lParam); + switch (pnmhdr->code) + { + case TVN_SELCHANGEDW: + { + NMTREEVIEWW* ptv = reinterpret_cast(lParam); + ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_HIDE, ptv->itemOld.lParam); + ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_SHOW, ptv->itemNew.lParam); + } + break; + + //case NM_DBLCLK: + // TVITEM item = { }; + // item.mask = TVIF_PARAM; + // item.hItem = TreeView_GetSelection(pnmhdr->hwndFrom); + // TreeView_GetItem(pnmhdr->hwndFrom, &item); + // ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_SHOW, item.lParam); + // return 1; + } + } + break; + } + + return ThemeDefWindowProc(vpTheme, hWnd, uMsg, wParam, lParam); +} + +static void OnThemeLoadBegin( + __in_z_opt LPWSTR sczThemeLoadErrors + ) +{ + ReleaseNullStr(sczThemeLoadErrors); +} + +static void OnThemeLoadError( + __in THEME* pTheme, + __in HRESULT hrFailure + ) +{ + HRESULT hr = S_OK; + LPWSTR sczMessage = NULL; + LPWSTR* psczErrors = NULL; + UINT cErrors = 0; + TVINSERTSTRUCTW tvi = { }; + + // Add the application node. + tvi.hParent = NULL; + tvi.hInsertAfter = TVI_ROOT; + tvi.item.mask = TVIF_TEXT | TVIF_PARAM; + tvi.item.lParam = 0; + tvi.item.pszText = L"Failed to load theme."; + tvi.hParent = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); + + if (!vsczThemeLoadErrors) + { + hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x.", hrFailure); + ExitOnFailure(hr, "Failed to format error message."); + + tvi.item.pszText = sczMessage; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + + hr = StrAllocFromError(&sczMessage, hrFailure, NULL); + ExitOnFailure(hr, "Failed to format error message text."); + + tvi.item.pszText = sczMessage; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + } + else + { + hr = StrSplitAllocArray(&psczErrors, &cErrors, vsczThemeLoadErrors, L"\r\n"); + ExitOnFailure(hr, "Failed to split theme load errors."); + + for (DWORD i = 0; i < cErrors; ++i) + { + tvi.item.pszText = psczErrors[i]; + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); + } + } + + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_EXPAND, TVE_EXPAND, reinterpret_cast(tvi.hParent)); + +LExit: + ReleaseStr(sczMessage); + ReleaseMem(psczErrors); +} + + +static void OnNewTheme( + __in THEME* pTheme, + __in HWND hWnd, + __in HANDLE_THEME* pHandle + ) +{ + HANDLE_THEME* pOldHandle = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); + THEME* pNewTheme = pHandle->pTheme; + + WCHAR wzSelectedPage[MAX_PATH] = { }; + HTREEITEM htiSelected = NULL; + TVINSERTSTRUCTW tvi = { }; + TVITEMW item = { }; + + if (pOldHandle) + { + DecrementHandleTheme(pOldHandle); + pOldHandle = NULL; + } + + // Pass the new theme handle to the display thread so it can get the display window prepared + // to show the new theme. + IncrementHandleTheme(pHandle); + ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_NEW_THEME, 0, reinterpret_cast(pHandle)); + + ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pHandle)); + + // Remember the currently selected item by name so we can try to automatically select it later. + // Otherwise, the user would see their window destroyed after every save of their theme file and + // have to click to get the window back. + item.mask = TVIF_TEXT; + item.pszText = wzSelectedPage; + item.cchTextMax = countof(wzSelectedPage); + item.hItem = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_GETNEXTITEM, TVGN_CARET, NULL)); + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_GETITEM, 0, reinterpret_cast(&item)); + + // Remove the previous items in the tree. + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_DELETEITEM, 0, reinterpret_cast(TVI_ROOT)); + + // Add the application node. + tvi.hParent = NULL; + tvi.hInsertAfter = TVI_ROOT; + tvi.item.mask = TVIF_TEXT | TVIF_PARAM; + tvi.item.lParam = 0; + tvi.item.pszText = pHandle && pHandle->pTheme && pHandle->pTheme->sczCaption ? pHandle->pTheme->sczCaption : L"Window"; + + // Add the pages. + tvi.hParent = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); + tvi.hInsertAfter = TVI_SORT; + for (DWORD i = 0; i < pNewTheme->cPages; ++i) + { + THEME_PAGE* pPage = pNewTheme->rgPages + i; + if (pPage->sczName && *pPage->sczName) + { + tvi.item.pszText = pPage->sczName; + tvi.item.lParam = i + 1; //prgdwPageIds[i]; - TODO: do the right thing here by calling ThemeGetPageIds(), should not assume we know how the page ids will be calculated. + + HTREEITEM hti = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); + if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pPage->sczName, -1, wzSelectedPage, -1)) + { + htiSelected = hti; + } + } + } + + if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, L"Application", -1, wzSelectedPage, -1)) + { + htiSelected = tvi.hParent; + } + + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_EXPAND, TVE_EXPAND, reinterpret_cast(tvi.hParent)); + if (htiSelected) + { + ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_SELECTITEM, TVGN_CARET, reinterpret_cast(htiSelected)); + } +} diff --git a/src/samples/thmviewer/thmviewer.manifest b/src/samples/thmviewer/thmviewer.manifest new file mode 100644 index 00000000..4663b61c --- /dev/null +++ b/src/samples/thmviewer/thmviewer.manifest @@ -0,0 +1,19 @@ + + + + + + + WiX Toolset Theme Viewer + + + + + + true/pm + + PerMonitorV2, PerMonitor, System + + + + diff --git a/src/samples/thmviewer/thmviewer.rc b/src/samples/thmviewer/thmviewer.rc new file mode 100644 index 00000000..dc6d7242 --- /dev/null +++ b/src/samples/thmviewer/thmviewer.rc @@ -0,0 +1,12 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#include +#include +#include "resource.h" + +//#define MANIFEST_RESOURCE_ID 1 +//MANIFEST_RESOURCE_ID RT_MANIFEST "thmviewer.manifest" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +THMVWR_RES_THEME_FILE RCDATA "Resources\\thm.xml" +THMVWR_RES_RICHEDIT_FILE RCDATA "Resources\\LoremIpsum.rtf" diff --git a/src/samples/thmviewer/thmviewer.v3.ncrunchproject b/src/samples/thmviewer/thmviewer.v3.ncrunchproject new file mode 100644 index 00000000..3cffd6ce --- /dev/null +++ b/src/samples/thmviewer/thmviewer.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + thmviewer.manifest + + + \ No newline at end of file diff --git a/src/samples/thmviewer/thmviewer.vcxproj b/src/samples/thmviewer/thmviewer.vcxproj new file mode 100644 index 00000000..c02dc237 --- /dev/null +++ b/src/samples/thmviewer/thmviewer.vcxproj @@ -0,0 +1,88 @@ + + + + + + + + + + + + Debug + Win32 + + + Release + Win32 + + + + + {95228C13-97F5-484A-B4A2-ECF4618B0881} + Win32Proj + Application + v142 + Unicode + WiX Toolset Theme Viewer + + + + + + + + + + + + + comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib + + + + + + + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + \ No newline at end of file diff --git a/src/samples/thmviewer/thmviewer.vcxproj.filters b/src/samples/thmviewer/thmviewer.vcxproj.filters new file mode 100644 index 00000000..488d5510 --- /dev/null +++ b/src/samples/thmviewer/thmviewer.vcxproj.filters @@ -0,0 +1,56 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + Resource Files + + + + + + Header Files + + + Header Files + + + + + Resource Files + + + + + + \ No newline at end of file diff --git a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs deleted file mode 100644 index 9d132f66..00000000 --- a/src/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.BuildTasks -{ - using System.IO; - using System.Linq; - using Microsoft.Build.Utilities; - using WixBuildTools.TestSupport; - using WixToolset.BuildTasks; - using WixToolset.Data; - using WixToolset.Data.Symbols; - using Xunit; - - public class WixBuildTaskFixture - { - [Fact] - public void CanBuildSimpleMsiPackage() - { - var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var intermediateFolder = Path.Combine(baseFolder, "obj"); - var pdbPath = Path.Combine(baseFolder, @"bin\testpackage.wixpdb"); - var engine = new FakeBuildEngine(); - - var task = new WixBuild - { - BuildEngine = engine, - SourceFiles = new[] - { - new TaskItem(Path.Combine(folder, "Package.wxs")), - new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), - }, - LocalizationFiles = new[] - { - new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), - }, - BindInputPaths = new[] - { - new TaskItem(Path.Combine(folder, "data")), - }, - IntermediateDirectory = new TaskItem(intermediateFolder), - OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), - PdbType = "Full", - PdbFile = new TaskItem(pdbPath), - DefaultCompressionLevel = "nOnE", - }; - - var result = task.Execute(); - Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}"); - - Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); - Assert.True(File.Exists(pdbPath)); - Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); - Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); - } - } - } -} diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj deleted file mode 100644 index c01860cd..00000000 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - net461 - false - embedded - win-x86 - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject b/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject deleted file mode 100644 index f1d03cd7..00000000 --- a/src/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Heat/HeatRunner.cs b/src/test/WixToolsetTest.Heat/HeatRunner.cs deleted file mode 100644 index 287698a9..00000000 --- a/src/test/WixToolsetTest.Heat/HeatRunner.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.Harvesters -{ - using System; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Core; - using WixToolset.Core.Burn; - using WixToolset.Core.TestPackage; - using WixToolset.Data; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters; - - /// - /// Utility class to emulate heat.exe. - /// - public static class HeatRunner - { - /// - /// Emulates calling heat.exe. - /// - /// - /// - /// - /// - public static int Execute(string[] args, out List messages, bool warningsAsErrors = true) - { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - var task = Execute(args, serviceProvider, out messages, warningsAsErrors: warningsAsErrors); - return task.Result; - } - - /// - /// Emulates calling wix.exe with standard backends. - /// This overload always treats warnings as errors. - /// - /// - /// - public static WixRunnerResult Execute(params string[] args) - { - return Execute(true, args); - } - - /// - /// Emulates calling wix.exe with standard backends. - /// - /// - /// - /// - public static WixRunnerResult Execute(bool warningsAsErrors, params string[] args) - { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); - var exitCode = Execute(args, serviceProvider, out var messages, warningsAsErrors: warningsAsErrors); - return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; - } - - /// - /// Emulates calling wix.exe with standard backends. - /// - /// - /// - /// - /// - /// - public static Task Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List messages, bool warningsAsErrors = true) - { - coreProvider.AddBundleBackend(); - - var listener = new TestMessageListener(); - - messages = listener.Messages; - - var messaging = coreProvider.GetService(); - messaging.SetListener(listener); - - if (warningsAsErrors) - { - messaging.WarningsAsError = true; - } - - var arguments = coreProvider.GetService(); - arguments.Populate(args); - - var commandLine = HeatCommandLineFactory.CreateCommandLine(coreProvider); - var command = commandLine.ParseStandardCommandLine(arguments); - return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); - } - } -} diff --git a/src/test/WixToolsetTest.Heat/PayloadTests.cs b/src/test/WixToolsetTest.Heat/PayloadTests.cs deleted file mode 100644 index 8072f50d..00000000 --- a/src/test/WixToolsetTest.Heat/PayloadTests.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.Harvesters -{ - using System; - using System.IO; - using WixBuildTools.TestSupport; - using Xunit; - - public class PayloadTests - { - [Fact] - public void CanHarvestExePackagePayload() - { - var folder = TestData.Get(@"TestData"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var outputFilePath = Path.Combine(baseFolder, "test.wxs"); - - var result = HeatRunner.Execute(new[] - { - "exepackagepayload", - Path.Combine(folder, ".Data", "burn.exe"), - "-o", outputFilePath, - }); - - result.AssertSuccess(); - - Assert.True(File.Exists(outputFilePath)); - - var expected = File.ReadAllText(Path.Combine(folder, "Payload", "HarvestedExePackagePayload.wxs")).Replace("\r\n", "\n"); - var actual = File.ReadAllText(outputFilePath).Replace("\r\n", "\n"); - Assert.Equal(expected, actual); - } - } - - [Fact] - public void CanHarvestMsuPackagePayload() - { - var folder = TestData.Get(@"TestData"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var outputFilePath = Path.Combine(baseFolder, "test.wxs"); - - var result = HeatRunner.Execute(new[] - { - "msupackagepayload", - Path.Combine(folder, ".Data", "Windows8.1-KB2937592-x86.msu"), - "-o", outputFilePath, - }); - - result.AssertSuccess(); - - Assert.True(File.Exists(outputFilePath)); - - var expected = File.ReadAllText(Path.Combine(folder, "Payload", "HarvestedMsuPackagePayload.wxs")).Replace("\r\n", "\n"); - var actual = File.ReadAllText(outputFilePath).Replace("\r\n", "\n"); - Assert.Equal(expected, actual); - } - } - } -} diff --git a/src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu b/src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu deleted file mode 100644 index c39f53b0..00000000 Binary files a/src/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu and /dev/null differ diff --git a/src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe b/src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe deleted file mode 100644 index 2a4f423f..00000000 Binary files a/src/test/WixToolsetTest.Heat/TestData/.Data/burn.exe and /dev/null differ diff --git a/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs b/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs deleted file mode 100644 index 40100f22..00000000 --- a/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs b/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs deleted file mode 100644 index f203fe27..00000000 --- a/src/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj b/src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj deleted file mode 100644 index 4af6749c..00000000 --- a/src/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - netcoreapp3.1 - false - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs deleted file mode 100644 index 3c8e79e7..00000000 --- a/src/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.Sdk -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - using Xunit; - - public class MsbuildFixture - { - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleBundle(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = Path.Combine(fs.BaseFolder, "SimpleBundle"); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - WixAssert.CompareLineByLine(new[] - { - @"bin\x86\Release\SimpleBundle.exe", - @"bin\x86\Release\SimpleBundle.wixpdb", - }, paths); - } - } - - [Theory(Skip = "Test demonstrates failure")] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildUncompressedBundle(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = Path.Combine(fs.BaseFolder, "UncompressedBundle"); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "UncompressedBundle.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - WixAssert.CompareLineByLine(new[] - { - @"bin\x86\Release\SimpleBundle.exe", - @"bin\x86\Release\SimpleBundle.wixpdb", - @"bin\x86\Release\test.txt", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMergeModule(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - WixAssert.CompareLineByLine(new[] - { - @"bin\x86\Release\SimpleMergeModule.msm", - @"bin\x86\Release\SimpleMergeModule.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); - Assert.Single(platformSwitches); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Equal(4, warnings.Count()); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - WixAssert.CompareLineByLine(new[] - { - @"bin\x86\Release\en-US\cab1.cab", - @"bin\x86\Release\en-US\MsiPackage.msi", - @"bin\x86\Release\en-US\MsiPackage.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\MergeModule"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage"); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - WixAssert.CompareLineByLine(new[] - { - @"bin\x86\Release\cab1.cab", - @"bin\x86\Release\MergeMsiPackage.msi", - @"bin\x86\Release\MergeMsiPackage.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) - { - var expectedOutputs = new[] - { - @"bin\x86\Release\en-US\cab1.cab", - @"bin\x86\Release\en-US\MsiPackage.msi", - @"bin\x86\Release\en-US\MsiPackage.wixpdb", - }; - - this.AssertWixpdb(buildSystem, null, expectedOutputs); - this.AssertWixpdb(buildSystem, "Full", expectedOutputs); - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildWithNoWixpdb(BuildSystem buildSystem) - { - this.AssertWixpdb(buildSystem, "NONE", new[] - { - @"bin\x86\Release\en-US\cab1.cab", - @"bin\x86\Release\en-US\MsiPackage.msi", - }); - } - - private void AssertWixpdb(BuildSystem buildSystem, string wixpdbType, string[] expectedOutputFiles) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", - }); - result.AssertSuccess(); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - WixAssert.CompareLineByLine(expectedOutputFiles, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuild64BitMsiPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - $"-p:Platform=x64", - }); - result.AssertSuccess(); - - var platformSwitches = result.Output.Where(line => line.Contains("-platform x64")); - Assert.Single(platformSwitches); - - var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - WixAssert.CompareLineByLine(new[] - { - @"bin\x64\Release\en-US\cab1.cab", - @"bin\x64\Release\en-US\MsiPackage.msi", - @"bin\x64\Release\en-US\MsiPackage.wixpdb", - }, paths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackageWithIceSuppressions(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressIces", "ICE45;ICE46"), - }); - result.AssertSuccess(); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildSimpleMsiPackageWithWarningSuppressions(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressSpecificWarnings", "1118;1102"), - }); - result.AssertSuccess(); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk, null)] - [InlineData(BuildSystem.DotNetCoreSdk, true)] - [InlineData(BuildSystem.MSBuild, null)] - [InlineData(BuildSystem.MSBuild, true)] - [InlineData(BuildSystem.MSBuild64, null)] - [InlineData(BuildSystem.MSBuild64, true)] - public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - "-p:OutputType=IntermediatePostLink", - }, outOfProc: outOfProc); - result.AssertSuccess(); - - var wixBuildCommands = MsbuildUtilities.GetToolCommandLines(result, "wix", "build", buildSystem, outOfProc); - Assert.Single(wixBuildCommands); - - var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .Single(); - Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildAndCleanSimpleMsiPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - // Build - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, verbosityLevel: "diag"); - result.AssertSuccess(); - - var buildOutput = String.Join("\r\n", result.Output); - - var createdPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .OrderBy(s => s) - .ToArray(); - Assert.NotEmpty(createdPaths); - - // Clean - result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - "-t:Clean", - }, verbosityLevel: "diag"); - result.AssertSuccess(); - - var cleanOutput = String.Join("\r\n", result.Output); - - // Clean is only expected to delete the files listed in {Project}.FileListAbsolute.txt, - // so this is not quite right but close enough. - var allowedFiles = new HashSet - { - "MsiPackage.wixproj", - "Package.en-us.wxl", - "Package.wxs", - "PackageComponents.wxs", - @"data\test.txt", - @"obj\x86\Release\MsiPackage.wixproj.FileListAbsolute.txt", - }; - - var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) - .Select(s => s.Substring(baseFolder.Length + 1)) - .Where(s => !allowedFiles.Contains(s)) - .OrderBy(s => s) - .ToArray(); - Assert.Empty(remainingPaths); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildUtilities.WixMsbuildPath, "broken", "net461")), - }, outOfProc: true); - Assert.Equal(1, result.ExitCode); - - var expectedMessage = "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from"; - Assert.Contains(result.Output, m => m.Contains(expectedMessage)); - } - } - } -} diff --git a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs deleted file mode 100644 index 8b2e8e3d..00000000 --- a/src/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.Sdk -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - using WixToolset.Core.TestPackage; - using WixToolset.Data; - using WixToolset.Data.Symbols; - using Xunit; - - public class MsbuildHeatFixture - { - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildHeatFilePackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\HeatFilePackage"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var projectPath = Path.Combine(baseFolder, "HeatFilePackage.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); - Assert.Single(heatCommandLines); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal(@"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFilePackage.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath()?.Path); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk)] - [InlineData(BuildSystem.MSBuild)] - [InlineData(BuildSystem.MSBuild64)] - public void CanBuildHeatFileWithMultipleFilesPackage(BuildSystem buildSystem) - { - var sourceFolder = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = fs.BaseFolder; - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var projectPath = Path.Combine(baseFolder, "HeatFileMultipleFilesSameFileName.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); - result.AssertSuccess(); - - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); - Assert.Equal(2, heatCommandLines.Count()); - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal("" + - "" + - "" + - "" + - @"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - generatedContents = File.ReadAllText(generatedFilePath); - testXml = generatedContents.GetTestXml(); - Assert.Equal("" + - "" + - "" + - "" + - @"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFileMultipleFilesSameFileName.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileSymbols = section.Symbols.OfType().ToArray(); - Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); - Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk, true)] - [InlineData(BuildSystem.DotNetCoreSdk, false)] - [InlineData(BuildSystem.MSBuild, true)] - [InlineData(BuildSystem.MSBuild, false)] - [InlineData(BuildSystem.MSBuild64, true)] - [InlineData(BuildSystem.MSBuild64, false)] - public void CanBuildHeatProjectPreSdkStyle(BuildSystem buildSystem, bool useToolsVersion) - { - var sourceFolder = TestData.Get(@"TestData\HeatProject"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectPreSdkStyle"); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var projectPath = Path.Combine(baseFolder, "HeatProjectPreSdkStyle.wixproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, - }); - result.AssertSuccess(); - - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); - var heatCommandLine = Assert.Single(heatCommandLines); - - if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) - { - Assert.Contains("-usetoolsversion", heatCommandLine); - } - else - { - Assert.DoesNotContain("-usetoolsversion", heatCommandLine); - } - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ToolsVersion4Cs.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal(@"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatProjectPreSdkStyle.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); - } - } - - [Theory] - [InlineData(BuildSystem.DotNetCoreSdk, true)] - [InlineData(BuildSystem.DotNetCoreSdk, false)] - [InlineData(BuildSystem.MSBuild, true)] - [InlineData(BuildSystem.MSBuild, false)] - [InlineData(BuildSystem.MSBuild64, true)] - [InlineData(BuildSystem.MSBuild64, false)] - public void CanBuildHeatProjectSdkStyle(BuildSystem buildSystem, bool useToolsVersion) - { - var sourceFolder = TestData.Get(@"TestData\HeatProject"); - - using (var fs = new TestDataFolderFileSystem()) - { - fs.Initialize(sourceFolder); - var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectSdkStyle"); - var binFolder = Path.Combine(baseFolder, @"bin\"); - var intermediateFolder = Path.Combine(baseFolder, @"obj\"); - var projectPath = Path.Combine(baseFolder, "HeatProjectSdkStyle.wixproj"); - var referencedProjectPath = Path.Combine(fs.BaseFolder, "SdkStyleCs", "SdkStyleCs.csproj"); - - var result = MsbuildUtilities.BuildProject(buildSystem, referencedProjectPath, new[] - { - "-t:restore", - }); - result.AssertSuccess(); - - result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] - { - useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, - }); - result.AssertSuccess(); - - var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); - var heatCommandLine = Assert.Single(heatCommandLines); - - if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) - { - Assert.Contains("-usetoolsversion", heatCommandLine); - } - else - { - Assert.DoesNotContain("-usetoolsversion", heatCommandLine); - } - - var warnings = result.Output.Where(line => line.Contains(": warning")); - Assert.Empty(warnings); - - var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_SdkStyleCs.wxs"); - Assert.True(File.Exists(generatedFilePath)); - - var generatedContents = File.ReadAllText(generatedFilePath); - var testXml = generatedContents.GetTestXml(); - Assert.Equal(@"" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "", testXml); - - var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatProjectSdkStyle.wixpdb"); - Assert.True(File.Exists(pdbPath)); - - var intermediate = Intermediate.Load(pdbPath); - var section = intermediate.Sections.Single(); - - var fileSymbol = section.Symbols.OfType().Single(); - Assert.Equal(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); - } - } - } -} diff --git a/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs b/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs deleted file mode 100644 index 2e07af3a..00000000 --- a/src/test/WixToolsetTest.Sdk/MsbuildUtilities.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright(c) .NET Foundation and contributors.All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolsetTest.Sdk -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using WixBuildTools.TestSupport; - - public enum BuildSystem - { - DotNetCoreSdk, - MSBuild, - MSBuild64, - } - - public static class MsbuildUtilities - { - public static readonly string WixMsbuildPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath), "..", "publish", "WixToolset.Sdk"); - public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.Sdk.props"); - - public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") - { - var allArgs = new List - { - $"-verbosity:{verbosityLevel}", - $"-p:Configuration={configuration}", - GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildUtilities.WixPropsPath), - // Node reuse means that child msbuild processes can stay around after the build completes. - // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. - "-nr:false", - }; - - if (outOfProc.HasValue) - { - allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); - } - - if (arguments != null) - { - allArgs.AddRange(arguments); - } - - switch (buildSystem) - { - case BuildSystem.DotNetCoreSdk: - { - allArgs.Add(projectPath); - var result = DotnetRunner.Execute("msbuild", allArgs.ToArray()); - return new MsbuildRunnerResult - { - ExitCode = result.ExitCode, - Output = result.StandardOutput, - }; - } - case BuildSystem.MSBuild: - case BuildSystem.MSBuild64: - { - return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); - } - default: - { - throw new NotImplementedException(); - } - } - } - - public static string GetQuotedPropertySwitch(BuildSystem buildSystem, string propertyName, string valueToQuote) - { - switch (buildSystem) - { - case BuildSystem.DotNetCoreSdk: - { - return $"-p:{propertyName}=\\\"{valueToQuote}\\\""; - } - case BuildSystem.MSBuild: - case BuildSystem.MSBuild64: - { - return $"-p:{propertyName}=\"{valueToQuote}\""; - } - default: - { - throw new NotImplementedException(); - } - } - } - - public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem, bool? outOfProc = null) - { - var expectedOutOfProc = buildSystem == BuildSystem.DotNetCoreSdk || outOfProc.HasValue && outOfProc.Value; - var expectedToolExe = !expectedOutOfProc ? $"({toolName}.exe)" : - buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; - var expectedToolCommand = $"{expectedToolExe} {operation}"; - return result.Output.Where(line => line.Contains(expectedToolCommand)); - } - } -} diff --git a/src/test/WixToolsetTest.Sdk/README.md b/src/test/WixToolsetTest.Sdk/README.md deleted file mode 100644 index 7faf34b9..00000000 --- a/src/test/WixToolsetTest.Sdk/README.md +++ /dev/null @@ -1,5 +0,0 @@ -In order to properly test wix.targets, -all of the supported architectures for WixToolset.BuildTasks need to be available in the layout used in the Nuget package. -Making this happen on every build for the solution takes too long, -so this project relies on manually running appveyor.cmd to publish everything before the tests can be run. -appveyor.cmd needs to be ran again every time changes are made in other projects, including the targets themselves. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj deleted file mode 100644 index 7d751319..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - - - - - TxtProductComponents - INSTALLFOLDER - true - - - JsonProductComponents - INSTALLFOLDER - true - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json deleted file mode 100644 index 5f282702..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt deleted file mode 100644 index 5f282702..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs deleted file mode 100644 index 5abcee9f..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj deleted file mode 100644 index 3988acaf..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - - - - - ProductComponents - INSTALLFOLDER - true - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs deleted file mode 100644 index f5fa8cf6..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj deleted file mode 100644 index c569e8ac..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Debug - x86 - - - - BB919765-DD69-41E7-91C5-415A69BE923E - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - true - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs deleted file mode 100644 index 6c12861b..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj deleted file mode 100644 index 907f0bb0..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Debug - x86 - - - - CE998A54-9BEC-4268-BFA2-8E3DAE5831C8 - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - true - true - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs deleted file mode 100644 index d30218f3..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs deleted file mode 100644 index 2b2c5be2..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace SdkStyleCs -{ - public class SdkStyleCs - { - } -} diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj deleted file mode 100644 index 755976bc..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - netstandard2.0 - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs deleted file mode 100644 index c29a2303..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("ToolsVersion4Cs")] -[assembly: AssemblyDescription("ToolsVersion4Cs")] -[assembly: AssemblyProduct("WiX Toolset")] -[assembly: AssemblyCompany("WiX Toolset Team")] -[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and contributors. All rights reserved.")] diff --git a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj b/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj deleted file mode 100644 index 9c55f7a5..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - {8B19578A-816A-48A1-A6C4-58067334EB79} - ToolsVersion4Cs - Library - ToolsVersion4Cs - v4.0 - - - true - false - $(DefineConstants);DEBUG;TRACE - bin\Debug\ - - - true - true - $(DefineConstants);TRACE - bin\Release\ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj deleted file mode 100644 index 77ee4420..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Debug - x86 - - - - {B00939D5-7952-4ADF-BEB1-507D227B2FE2} - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - SimpleMergeModule - {9F84998B-7F45-4CB3-8795-915801DBBB74} - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs deleted file mode 100644 index ef62c31b..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs deleted file mode 100644 index b892debd..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj deleted file mode 100644 index 91579790..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Debug - x86 - Module - - - - {9F84998B-7F45-4CB3-8795-915801DBBB74} - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt b/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj deleted file mode 100644 index 555addbe..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Debug - x86 - 0.9 - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - MsiPackage - Package - MsiPackage - MsiPackage - en-US,en;de-DE - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl deleted file mode 100644 index 23493ace..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - German DowngradeError - German FeatureTitle - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - A newer version of [ProductName] is already installed. - MsiPackage - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs deleted file mode 100644 index df24aa33..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs deleted file mode 100644 index e26c4509..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln deleted file mode 100644 index 2c88704e..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} - EndGlobalSection -EndGlobal diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj deleted file mode 100644 index 18ae08b2..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Debug - x86 - - - - 7fb77005-c6e0-454f-8c2d-0a4a79c918ba - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl deleted file mode 100644 index 38c12ac1..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - A newer version of [ProductName] is already installed. - MsiPackage - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs deleted file mode 100644 index 0a133c7d..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs deleted file mode 100644 index ddb95faf..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is test.txt. \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs deleted file mode 100644 index 3b4a9d6a..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj deleted file mode 100644 index 199eb6d9..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Debug - x86 - - - - 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d - Bundle - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln deleted file mode 100644 index dd21489d..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30011.22 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" -EndProject -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SimpleBundle", "SimpleBundle\SimpleBundle.wixproj", "{6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 - {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x64.ActiveCfg = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.ActiveCfg = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.Build.0 = Debug|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x64.ActiveCfg = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.ActiveCfg = Release|x86 - {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} - EndGlobalSection -EndGlobal diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs deleted file mode 100644 index 6ab9a016..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj b/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj deleted file mode 100644 index 199eb6d9..00000000 --- a/src/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Debug - x86 - - - - 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d - Bundle - - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - Debug - - - $(Platform) - bin\$(Platform)\$(Configuration)\ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj deleted file mode 100644 index 35ed053a..00000000 --- a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - net461 - false - embedded - TestData\**;$(DefaultItemExcludes) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject b/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject deleted file mode 100644 index f1d03cd7..00000000 --- a/src/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/thmviewer/Resources/LoremIpsum.rtf b/src/thmviewer/Resources/LoremIpsum.rtf deleted file mode 100644 index 1ab0e65b..00000000 Binary files a/src/thmviewer/Resources/LoremIpsum.rtf and /dev/null differ diff --git a/src/thmviewer/Resources/thm.xml b/src/thmviewer/Resources/thm.xml deleted file mode 100644 index 6394f0f1..00000000 --- a/src/thmviewer/Resources/thm.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Consolas - Consolas - - - - diff --git a/src/thmviewer/display.cpp b/src/thmviewer/display.cpp deleted file mode 100644 index 52fa3cf8..00000000 --- a/src/thmviewer/display.cpp +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#include "precomp.h" - -static const LPCWSTR THMVWR_WINDOW_CLASS_DISPLAY = L"ThmViewerDisplay"; - -struct DISPLAY_THREAD_CONTEXT -{ - HWND hWnd; - HINSTANCE hInstance; - - HANDLE hInit; -}; - -static DWORD WINAPI DisplayThreadProc( - __in LPVOID pvContext - ); -static LRESULT CALLBACK DisplayWndProc( - __in HWND hWnd, - __in UINT uMsg, - __in WPARAM wParam, - __in LPARAM lParam - ); -static BOOL DisplayOnCreate( - __in THEME* pTheme, - __in HWND hWnd - ); - - -extern "C" HRESULT DisplayStart( - __in HINSTANCE hInstance, - __in HWND hWnd, - __out HANDLE *phThread, - __out DWORD* pdwThreadId - ) -{ - HRESULT hr = S_OK; - HANDLE rgHandles[2] = { }; - DISPLAY_THREAD_CONTEXT context = { }; - - rgHandles[0] = ::CreateEventW(NULL, TRUE, FALSE, NULL); - ExitOnNullWithLastError(rgHandles[0], hr, "Failed to create load init event."); - - context.hWnd = hWnd; - context.hInstance = hInstance; - context.hInit = rgHandles[0]; - - rgHandles[1] = ::CreateThread(NULL, 0, DisplayThreadProc, reinterpret_cast(&context), 0, pdwThreadId); - ExitOnNullWithLastError(rgHandles[1], hr, "Failed to create display thread."); - - ::WaitForMultipleObjects(countof(rgHandles), rgHandles, FALSE, INFINITE); - - *phThread = rgHandles[1]; - rgHandles[1] = NULL; - -LExit: - ReleaseHandle(rgHandles[1]); - ReleaseHandle(rgHandles[0]); - return hr; -} - -static DWORD WINAPI DisplayThreadProc( - __in LPVOID pvContext - ) -{ - HRESULT hr = S_OK; - - DISPLAY_THREAD_CONTEXT* pContext = static_cast(pvContext); - HINSTANCE hInstance = pContext->hInstance; - HWND hwndParent = pContext->hWnd; - - // We can signal the initialization event as soon as we have copied the context - // values into local variables. - ::SetEvent(pContext->hInit); - - BOOL fComInitialized = FALSE; - - HANDLE_THEME* pCurrentHandle = NULL; - ATOM atomWc = 0; - WNDCLASSW wc = { }; // the following are constant for the display window class. - wc.lpfnWndProc = DisplayWndProc; - wc.hInstance = hInstance; - wc.lpszClassName = THMVWR_WINDOW_CLASS_DISPLAY; - - HWND hWnd = NULL; - RECT rc = { }; - int x = CW_USEDEFAULT; - int y = CW_USEDEFAULT; - - BOOL fRedoMsg = FALSE; - BOOL fRet = FALSE; - MSG msg = { }; - - BOOL fCreateIfNecessary = FALSE; - - hr = ::CoInitialize(NULL); - ExitOnFailure(hr, "Failed to initialize COM on display thread."); - fComInitialized = TRUE; - - // As long as the parent window is alive and kicking, keep this thread going (with or without a theme to display ). - while (::IsWindow(hwndParent)) - { - if (pCurrentHandle && fCreateIfNecessary) - { - THEME* pTheme = pCurrentHandle->pTheme; - - if (CW_USEDEFAULT == x && CW_USEDEFAULT == y && ::GetWindowRect(hwndParent, &rc)) - { - x = rc.left; - y = rc.bottom + 20; - } - - hr = ThemeCreateParentWindow(pTheme, 0, wc.lpszClassName, pTheme->sczCaption, pTheme->dwStyle, x, y, hwndParent, hInstance, pCurrentHandle, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); - ExitOnFailure(hr, "Failed to create display window."); - - fCreateIfNecessary = FALSE; - } - - // message pump - while (fRedoMsg || 0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0))) - { - if (fRedoMsg) - { - fRedoMsg = FALSE; - } - - if (-1 == fRet) - { - hr = E_UNEXPECTED; - ExitOnFailure(hr, "Unexpected return value from display message pump."); - } - else if (NULL == msg.hwnd) // Thread message. - { - if (WM_THMVWR_NEW_THEME == msg.message) - { - // If there is already a handle, release it. - if (pCurrentHandle) - { - DecrementHandleTheme(pCurrentHandle); - pCurrentHandle = NULL; - } - - // If the window was created, remember its window location before we destroy - // it so so we can open the new window in the same place. - if (::IsWindow(hWnd)) - { - ::GetWindowRect(hWnd, &rc); - x = rc.left; - y = rc.top; - - ::DestroyWindow(hWnd); - } - - // If the display window class was registered, unregister it so we can - // reuse the same window class name for the new theme. - if (atomWc) - { - if (!::UnregisterClassW(reinterpret_cast(atomWc), hInstance)) - { - DWORD er = ::GetLastError(); - er = er; - } - - atomWc = 0; - } - - // If we were provided a new theme handle, create a new window class to - // support it. - pCurrentHandle = reinterpret_cast(msg.lParam); - if (pCurrentHandle) - { - wc.hIcon = reinterpret_cast(pCurrentHandle->pTheme->hIcon); - wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); - if (0 < pCurrentHandle->pTheme->cFonts) - { - wc.hbrBackground = pCurrentHandle->pTheme->rgFonts[pCurrentHandle->pTheme->dwFontId].hBackground; - } - atomWc = ::RegisterClassW(&wc); - if (!atomWc) - { - ExitWithLastError(hr, "Failed to register display window class."); - } - } - } - else if (WM_THMVWR_SHOWPAGE == msg.message) - { - if (pCurrentHandle && ::IsWindow(hWnd) && pCurrentHandle->pTheme->hwndParent == hWnd) - { - DWORD dwPageId = static_cast(msg.lParam); - int nCmdShow = static_cast(msg.wParam); - - // First show/hide the controls not associated with a page. - for (DWORD i = 0; i < pCurrentHandle->pTheme->cControls; ++i) - { - THEME_CONTROL* pControl = pCurrentHandle->pTheme->rgControls + i; - if (!pControl->wPageId) - { - ThemeShowControl(pCurrentHandle->pTheme, pControl->wId, nCmdShow); - } - } - - // If a page id was provided also, show/hide those controls - if (dwPageId) - { - // Ignore error since we aren't using variables and it can only fail when using variables. - ThemeShowPage(pCurrentHandle->pTheme, dwPageId, nCmdShow); - } - } - else // display window isn't visible or it doesn't match the current handle. - { - // Keep the current message around to try again after we break out of this loop - // and create the window. - fRedoMsg = TRUE; - fCreateIfNecessary = TRUE; - break; - } - } - } - else if (!ThemeHandleKeyboardMessage(pCurrentHandle->pTheme, hwndParent, &msg)) // Window message. - { - ::TranslateMessage(&msg); - ::DispatchMessageW(&msg); - } - } - } - -LExit: - if (::IsWindow(hWnd)) - { - ::DestroyWindow(hWnd); - } - - if (atomWc) - { - if (!::UnregisterClassW(THMVWR_WINDOW_CLASS_DISPLAY, hInstance)) - { - DWORD er = ::GetLastError(); - er = er; - } - } - - DecrementHandleTheme(pCurrentHandle); - - if (fComInitialized) - { - ::CoUninitialize(); - } - - return hr; -} - -static LRESULT CALLBACK DisplayWndProc( - __in HWND hWnd, - __in UINT uMsg, - __in WPARAM wParam, - __in LPARAM lParam - ) -{ - static DWORD dwProgress = 0; - HANDLE_THEME* pHandleTheme = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); - - switch (uMsg) - { - case WM_NCCREATE: - { - LPCREATESTRUCT lpcs = reinterpret_cast(lParam); - pHandleTheme = reinterpret_cast(lpcs->lpCreateParams); - IncrementHandleTheme(pHandleTheme); - ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pHandleTheme)); - } - break; - - case WM_CREATE: - if (!DisplayOnCreate(pHandleTheme->pTheme, hWnd)) - { - return -1; - } - break; - - case WM_TIMER: - if (!lParam && SUCCEEDED(ThemeSetProgressControl(pHandleTheme->pTheme, wParam, dwProgress))) - { - dwProgress += rand() % 10 + 1; - if (dwProgress > 100) - { - dwProgress = 0; - } - - return 0; - } - break; - - case WM_COMMAND: - { - WCHAR wzText[1024]; - ::StringCchPrintfW(wzText, countof(wzText), L"Command %u\r\n", LOWORD(wParam)); - OutputDebugStringW(wzText); - //::MessageBoxW(hWnd, wzText, L"Command fired", MB_OK); - } - break; - - case WM_SYSCOMMAND: - { - WCHAR wzText[1024]; - ::StringCchPrintfW(wzText, countof(wzText), L"SysCommand %u\r\n", LOWORD(wParam)); - OutputDebugStringW(wzText); - //::MessageBoxW(hWnd, wzText, L"Command fired", MB_OK); - } - break; - - case WM_DESTROY: - ThemeUnloadControls(pHandleTheme->pTheme); - ::PostQuitMessage(0); - break; - - case WM_NCDESTROY: - DecrementHandleTheme(pHandleTheme); - ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, 0); - break; - } - - return ThemeDefWindowProc(pHandleTheme ? pHandleTheme->pTheme : NULL, hWnd, uMsg, wParam, lParam); -} - -static BOOL DisplayOnCreate( - __in THEME* pTheme, - __in HWND hWnd - ) -{ - HRESULT hr = S_OK; - - hr = ThemeLoadControls(pTheme, NULL, 0); - ExitOnFailure(hr, "Failed to load theme controls"); - - // Pre-populate some control types with data. - for (DWORD i = 0; i < pTheme->cControls; ++i) - { - THEME_CONTROL* pControl = pTheme->rgControls + i; - if (THEME_CONTROL_TYPE_RICHEDIT == pControl->type) - { - hr = ThemeLoadRichEditFromResource(pTheme, pControl->wId, MAKEINTRESOURCEA(THMVWR_RES_RICHEDIT_FILE), ::GetModuleHandleW(NULL)); - ExitOnFailure(hr, "Failed to load richedit text."); - } - else if (THEME_CONTROL_TYPE_PROGRESSBAR == pControl->type) - { - DWORD dwId = ::SetTimer(hWnd, pControl->wId, 500, NULL); - dwId = dwId; // prevents warning in "ship" build. - Assert(dwId == pControl->wId); - } - } - -LExit: - return SUCCEEDED(hr); -} diff --git a/src/thmviewer/load.cpp b/src/thmviewer/load.cpp deleted file mode 100644 index 0267402a..00000000 --- a/src/thmviewer/load.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#include "precomp.h" - -struct LOAD_THREAD_CONTEXT -{ - HWND hWnd; - LPCWSTR wzThemePath; - LPCWSTR wzWxlPath; - - HANDLE hInit; -}; - -static DWORD WINAPI LoadThreadProc( - __in LPVOID pvContext - ); - - -extern "C" HRESULT LoadStart( - __in_z LPCWSTR wzThemePath, - __in_z_opt LPCWSTR wzWxlPath, - __in HWND hWnd, - __out HANDLE* phThread - ) -{ - HRESULT hr = S_OK; - HANDLE rgHandles[2] = { }; - LOAD_THREAD_CONTEXT context = { }; - - rgHandles[0] = ::CreateEventW(NULL, TRUE, FALSE, NULL); - ExitOnNullWithLastError(rgHandles[0], hr, "Failed to create load init event."); - - context.hWnd = hWnd; - context.wzThemePath = wzThemePath; - context.wzWxlPath = wzWxlPath; - context.hInit = rgHandles[0]; - - rgHandles[1] = ::CreateThread(NULL, 0, LoadThreadProc, &context, 0, NULL); - ExitOnNullWithLastError(rgHandles[1], hr, "Failed to create load thread."); - - ::WaitForMultipleObjects(countof(rgHandles), rgHandles, FALSE, INFINITE); - - *phThread = rgHandles[1]; - rgHandles[1] = NULL; - -LExit: - ReleaseHandle(rgHandles[1]); - ReleaseHandle(rgHandles[0]); - return hr; -} - - -static DWORD WINAPI LoadThreadProc( - __in LPVOID pvContext - ) -{ - HRESULT hr = S_OK; - WIX_LOCALIZATION* pWixLoc = NULL; - LPWSTR sczThemePath = NULL; - LPWSTR sczWxlPath = NULL; - BOOL fComInitialized = FALSE; - HANDLE hDirectory = INVALID_HANDLE_VALUE; - LPWSTR sczDirectory = NULL; - LPWSTR wzFileName = NULL; - - THEME* pTheme = NULL; - HANDLE_THEME* pHandle = NULL; - - LOAD_THREAD_CONTEXT* pContext = static_cast(pvContext); - HWND hWnd = pContext->hWnd; - - hr = StrAllocString(&sczThemePath, pContext->wzThemePath, 0); - ExitOnFailure(hr, "Failed to copy path to initial theme file."); - - if (pContext->wzWxlPath) - { - hr = StrAllocString(&sczWxlPath, pContext->wzWxlPath, 0); - ExitOnFailure(hr, "Failed to copy .wxl path to initial file."); - } - - // We can signal the initialization event as soon as we have copied the context - // values into local variables. - ::SetEvent(pContext->hInit); - - hr = ::CoInitialize(NULL); - ExitOnFailure(hr, "Failed to initialize COM on load thread."); - fComInitialized = TRUE; - - // Open a handle to the directory so we can put a notification on it. - hr = PathGetDirectory(sczThemePath, &sczDirectory); - ExitOnFailure(hr, "Failed to get path directory."); - - wzFileName = PathFile(sczThemePath); - - hDirectory = ::CreateFileW(sczDirectory, FILE_LIST_DIRECTORY, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); - if (INVALID_HANDLE_VALUE == hDirectory) - { - ExitWithLastError(hr, "Failed to open directory: %ls", sczDirectory); - } - - BOOL fUpdated = FALSE; - do - { - // Get the last modified time on the file we're loading for verification that the - // file actually gets changed down below. - FILETIME ftModified = { }; - FileGetTime(sczThemePath, NULL, NULL, &ftModified); - - ::SendMessageW(hWnd, WM_THMVWR_THEME_LOAD_BEGIN, 0, 0); - - // Try to load the theme file. - hr = ThemeLoadFromFile(sczThemePath, &pTheme); - if (FAILED(hr)) - { - ::SendMessageW(hWnd, WM_THMVWR_THEME_LOAD_ERROR, 0, hr); - } - else - { - if (sczWxlPath) - { - hr = LocLoadFromFile(sczWxlPath, &pWixLoc); - ExitOnFailure(hr, "Failed to load loc file from path: %ls", sczWxlPath); - - hr = ThemeLocalize(pTheme, pWixLoc); - ExitOnFailure(hr, "Failed to localize theme: %ls", sczWxlPath); - } - - hr = AllocHandleTheme(pTheme, &pHandle); - ExitOnFailure(hr, "Failed to allocate handle to theme"); - - ::SendMessageW(hWnd, WM_THMVWR_NEW_THEME, 0, reinterpret_cast(pHandle)); - pHandle = NULL; - } - - fUpdated = FALSE; - do - { - DWORD rgbNotifications[1024]; - DWORD cbRead = 0; - if (!::ReadDirectoryChangesW(hDirectory, rgbNotifications, sizeof(rgbNotifications), FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE, &cbRead, NULL, NULL)) - { - ExitWithLastError(hr, "Failed while watching directory: %ls", sczDirectory); - } - - // Wait for half a second to let all the file handles get closed to minimize access - // denied errors. - ::Sleep(500); - - FILE_NOTIFY_INFORMATION* pNotification = reinterpret_cast(rgbNotifications); - while (pNotification) - { - // If our file was updated, check to see if the modified time really changed. The notifications - // are often trigger happy thinking the file changed two or three times in a row. Maybe it's AV - // software creating the problems but actually checking the modified date works well. - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pNotification->FileName, pNotification->FileNameLength / sizeof(WCHAR), wzFileName, -1)) - { - FILETIME ft = { }; - FileGetTime(sczThemePath, NULL, NULL, &ft); - - fUpdated = (ftModified.dwHighDateTime < ft.dwHighDateTime) || (ftModified.dwHighDateTime == ft.dwHighDateTime && ftModified.dwLowDateTime < ft.dwLowDateTime); - break; - } - - pNotification = pNotification->NextEntryOffset ? reinterpret_cast(reinterpret_cast(pNotification) + pNotification->NextEntryOffset) : NULL; - } - } while (!fUpdated); - } while(fUpdated); - -LExit: - if (fComInitialized) - { - ::CoUninitialize(); - } - - LocFree(pWixLoc); - ReleaseFileHandle(hDirectory); - ReleaseStr(sczDirectory); - ReleaseStr(sczThemePath); - ReleaseStr(sczWxlPath); - return hr; -} - -extern "C" HRESULT AllocHandleTheme( - __in THEME* pTheme, - __out HANDLE_THEME** ppHandle - ) -{ - HRESULT hr = S_OK; - HANDLE_THEME* pHandle = NULL; - - pHandle = static_cast(MemAlloc(sizeof(HANDLE_THEME), TRUE)); - ExitOnNull(pHandle, hr, E_OUTOFMEMORY, "Failed to allocate theme handle."); - - pHandle->cReferences = 1; - pHandle->pTheme = pTheme; - - *ppHandle = pHandle; - pHandle = NULL; - -LExit: - ReleaseMem(pHandle); - return hr; -} - -extern "C" void IncrementHandleTheme( - __in HANDLE_THEME* pHandle - ) -{ - ::InterlockedIncrement(reinterpret_cast(&pHandle->cReferences)); -} - -extern "C" void DecrementHandleTheme( - __in HANDLE_THEME* pHandle - ) -{ - if (pHandle && 0 == ::InterlockedDecrement(reinterpret_cast(&pHandle->cReferences))) - { - ThemeFree(pHandle->pTheme); - MemFree(pHandle); - } -} diff --git a/src/thmviewer/packages.config b/src/thmviewer/packages.config deleted file mode 100644 index a98c0c8e..00000000 --- a/src/thmviewer/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/thmviewer/precomp.cpp b/src/thmviewer/precomp.cpp deleted file mode 100644 index 37664a1c..00000000 --- a/src/thmviewer/precomp.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#include "precomp.h" diff --git a/src/thmviewer/precomp.h b/src/thmviewer/precomp.h deleted file mode 100644 index 15d889fc..00000000 --- a/src/thmviewer/precomp.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - - -#include -#include -#include -#include -#include -#include -#include - -#pragma warning(push) -#pragma warning(disable:4458) -#include -#pragma warning(pop) - -#include "dutil.h" -#include "apputil.h" -#include "memutil.h" -#include "dirutil.h" -#include "fileutil.h" -#include "locutil.h" -#include "logutil.h" -#include "pathutil.h" -#include "resrutil.h" -#include "shelutil.h" -#include "strutil.h" -#include "thmutil.h" - -#include "resource.h" - -struct HANDLE_THEME -{ - DWORD cReferences; - THEME* pTheme; -}; - -enum WM_THMVWR -{ - WM_THMVWR_SHOWPAGE = WM_APP, - WM_THMVWR_PARSE_FILE, - WM_THMVWR_NEW_THEME, - WM_THMVWR_THEME_LOAD_ERROR, - WM_THMVWR_THEME_LOAD_BEGIN, -}; - -extern "C" HRESULT DisplayStart( - __in HINSTANCE hInstance, - __in HWND hWnd, - __out HANDLE *phThread, - __out DWORD* pdwThreadId - ); -extern "C" HRESULT LoadStart( - __in_z LPCWSTR wzThemePath, - __in_z LPCWSTR wzWxlPath, - __in HWND hWnd, - __out HANDLE* phThread - ); - -extern "C" HRESULT AllocHandleTheme( - __in THEME* pTheme, - __out HANDLE_THEME** ppHandle - ); -extern "C" void IncrementHandleTheme( - __in HANDLE_THEME* pHandle - ); -extern "C" void DecrementHandleTheme( - __in HANDLE_THEME* pHandle - ); diff --git a/src/thmviewer/resource.h b/src/thmviewer/resource.h deleted file mode 100644 index 4acc32cc..00000000 --- a/src/thmviewer/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#define IDC_STATIC -1 -#define THMVWR_RES_THEME_FILE 1 -#define THMVWR_RES_RICHEDIT_FILE 2 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1003 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/src/thmviewer/thmviewer.cpp b/src/thmviewer/thmviewer.cpp deleted file mode 100644 index f83182d3..00000000 --- a/src/thmviewer/thmviewer.cpp +++ /dev/null @@ -1,543 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#include "precomp.h" - -static const LPCWSTR THMVWR_WINDOW_CLASS_MAIN = L"ThmViewerMain"; - -static THEME* vpTheme = NULL; -static DWORD vdwDisplayThreadId = 0; -static LPWSTR vsczThemeLoadErrors = NULL; - -enum THMVWR_CONTROL -{ - // Non-paged controls - THMVWR_CONTROL_TREE = THEME_FIRST_ASSIGN_CONTROL_ID, -}; - -static THEME_ASSIGN_CONTROL_ID vrgInitControls[] = { - { THMVWR_CONTROL_TREE, L"Tree" }, -}; - -// Internal functions - -static HRESULT ProcessCommandLine( - __in_z_opt LPCWSTR wzCommandLine, - __out_z LPWSTR* psczThemeFile, - __out_z LPWSTR* psczWxlFile - ); -static HRESULT CreateTheme( - __in HINSTANCE hInstance, - __out THEME** ppTheme - ); -static HRESULT CreateMainWindowClass( - __in HINSTANCE hInstance, - __in THEME* pTheme, - __out ATOM* pAtom - ); -static LRESULT CALLBACK MainWndProc( - __in HWND hWnd, - __in UINT uMsg, - __in WPARAM wParam, - __in LPARAM lParam - ); -static void OnThemeLoadBegin( - __in_z_opt LPWSTR sczThemeLoadErrors - ); -static void OnThemeLoadError( - __in THEME* pTheme, - __in HRESULT hrFailure - ); -static void OnNewTheme( - __in THEME* pTheme, - __in HWND hWnd, - __in HANDLE_THEME* pHandle - ); -static void CALLBACK ThmviewerTraceError( - __in_z LPCSTR szFile, - __in int iLine, - __in REPORT_LEVEL rl, - __in UINT source, - __in HRESULT hrError, - __in_z __format_string LPCSTR szFormat, - __in va_list args - ); - - -int WINAPI wWinMain( - __in HINSTANCE hInstance, - __in_opt HINSTANCE /* hPrevInstance */, - __in_z LPWSTR lpCmdLine, - __in int /*nCmdShow*/ - ) -{ - ::HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0); - - HRESULT hr = S_OK; - BOOL fComInitialized = FALSE; - LPWSTR sczThemeFile = NULL; - LPWSTR sczWxlFile = NULL; - ATOM atom = 0; - HWND hWnd = NULL; - - HANDLE hDisplayThread = NULL; - HANDLE hLoadThread = NULL; - - BOOL fRet = FALSE; - MSG msg = { }; - - hr = ::CoInitialize(NULL); - ExitOnFailure(hr, "Failed to initialize COM."); - fComInitialized = TRUE; - - DutilInitialize(&ThmviewerTraceError); - - hr = ProcessCommandLine(lpCmdLine, &sczThemeFile, &sczWxlFile); - ExitOnFailure(hr, "Failed to process command line."); - - hr = CreateTheme(hInstance, &vpTheme); - ExitOnFailure(hr, "Failed to create theme."); - - hr = CreateMainWindowClass(hInstance, vpTheme, &atom); - ExitOnFailure(hr, "Failed to create main window."); - - hr = ThemeCreateParentWindow(vpTheme, 0, reinterpret_cast(atom), vpTheme->sczCaption, vpTheme->dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, hInstance, NULL, THEME_WINDOW_INITIAL_POSITION_DEFAULT, &hWnd); - ExitOnFailure(hr, "Failed to create window."); - - if (!sczThemeFile) - { - // Prompt for a path to the theme file. - OPENFILENAMEW ofn = { }; - WCHAR wzFile[MAX_PATH] = { }; - - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = hWnd; - ofn.lpstrFile = wzFile; - ofn.nMaxFile = countof(wzFile); - ofn.lpstrFilter = L"Theme Files (*.thm)\0*.thm\0XML Files (*.xml)\0*.xml\0All Files (*.*)\0*.*\0"; - ofn.nFilterIndex = 1; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; - ofn.lpstrTitle = vpTheme->sczCaption; - - if (::GetOpenFileNameW(&ofn)) - { - hr = StrAllocString(&sczThemeFile, wzFile, 0); - ExitOnFailure(hr, "Failed to copy opened file to theme file."); - } - else - { - ::MessageBoxW(hWnd, L"Must specify a path to theme file.", vpTheme->sczCaption, MB_OK | MB_ICONERROR); - ExitFunction1(hr = E_INVALIDARG); - } - } - - hr = DisplayStart(hInstance, hWnd, &hDisplayThread, &vdwDisplayThreadId); - ExitOnFailure(hr, "Failed to start display."); - - hr = LoadStart(sczThemeFile, sczWxlFile, hWnd, &hLoadThread); - ExitOnFailure(hr, "Failed to start load."); - - // message pump - while (0 != (fRet = ::GetMessageW(&msg, NULL, 0, 0))) - { - if (-1 == fRet) - { - hr = E_UNEXPECTED; - ExitOnFailure(hr, "Unexpected return value from message pump."); - } - else if (!ThemeHandleKeyboardMessage(vpTheme, msg.hwnd, &msg)) - { - ::TranslateMessage(&msg); - ::DispatchMessageW(&msg); - } - } - -LExit: - if (::IsWindow(hWnd)) - { - ::DestroyWindow(hWnd); - } - - if (hDisplayThread) - { - ::PostThreadMessageW(vdwDisplayThreadId, WM_QUIT, 0, 0); - ::WaitForSingleObject(hDisplayThread, 10000); - ::CloseHandle(hDisplayThread); - } - - // TODO: come up with a good way to kill the load thread, probably need to switch - // the ReadDirectoryW() to overlapped mode. - ReleaseHandle(hLoadThread); - - if (atom && !::UnregisterClassW(reinterpret_cast(atom), hInstance)) - { - DWORD er = ::GetLastError(); - er = er; - } - - ThemeFree(vpTheme); - ThemeUninitialize(); - DutilUninitialize(); - - // uninitialize COM - if (fComInitialized) - { - ::CoUninitialize(); - } - - ReleaseNullStr(vsczThemeLoadErrors); - ReleaseStr(sczThemeFile); - ReleaseStr(sczWxlFile); - return hr; -} - -static void CALLBACK ThmviewerTraceError( - __in_z LPCSTR /*szFile*/, - __in int /*iLine*/, - __in REPORT_LEVEL /*rl*/, - __in UINT source, - __in HRESULT hrError, - __in_z __format_string LPCSTR szFormat, - __in va_list args - ) -{ - HRESULT hr = S_OK; - LPSTR sczFormattedAnsi = NULL; - LPWSTR sczMessage = NULL; - - if (DUTIL_SOURCE_THMUTIL != source) - { - ExitFunction(); - } - - hr = StrAnsiAllocFormattedArgs(&sczFormattedAnsi, szFormat, args); - ExitOnFailure(hr, "Failed to format error log string."); - - hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x: %S\r\n", hrError, sczFormattedAnsi); - ExitOnFailure(hr, "Failed to prepend error number to error log string."); - - hr = StrAllocConcat(&vsczThemeLoadErrors, sczMessage, 0); - ExitOnFailure(hr, "Failed to append theme load error."); - -LExit: - ReleaseStr(sczFormattedAnsi); - ReleaseStr(sczMessage); -} - - -// -// ProcessCommandLine - process the provided command line arguments. -// -static HRESULT ProcessCommandLine( - __in_z_opt LPCWSTR wzCommandLine, - __out_z LPWSTR* psczThemeFile, - __out_z LPWSTR* psczWxlFile - ) -{ - HRESULT hr = S_OK; - int argc = 0; - LPWSTR* argv = NULL; - - if (wzCommandLine && *wzCommandLine) - { - hr = AppParseCommandLine(wzCommandLine, &argc, &argv); - ExitOnFailure(hr, "Failed to parse command line."); - - for (int i = 0; i < argc; ++i) - { - if (argv[i][0] == L'-' || argv[i][0] == L'/') - { - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"lang", -1)) - { - if (i + 1 >= argc) - { - ExitOnRootFailure(hr = E_INVALIDARG, "Must specify a language."); - } - - ++i; - } - } - else - { - LPCWSTR wzExtension = PathExtension(argv[i]); - if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, wzExtension, -1, L".wxl", -1)) - { - hr = StrAllocString(psczWxlFile, argv[i], 0); - } - else - { - hr = StrAllocString(psczThemeFile, argv[i], 0); - } - ExitOnFailure(hr, "Failed to copy path to file."); - } - } - } - -LExit: - if (argv) - { - AppFreeCommandLineArgs(argv); - } - - return hr; -} - -static HRESULT CreateTheme( - __in HINSTANCE hInstance, - __out THEME** ppTheme - ) -{ - HRESULT hr = S_OK; - - hr = ThemeInitialize(hInstance); - ExitOnFailure(hr, "Failed to initialize theme manager."); - - hr = ThemeLoadFromResource(hInstance, MAKEINTRESOURCEA(THMVWR_RES_THEME_FILE), ppTheme); - ExitOnFailure(hr, "Failed to load theme from thmviewer.thm."); - -LExit: - return hr; -} - -static HRESULT CreateMainWindowClass( - __in HINSTANCE hInstance, - __in THEME* pTheme, - __out ATOM* pAtom - ) -{ - HRESULT hr = S_OK; - ATOM atom = 0; - WNDCLASSW wc = { }; - - wc.lpfnWndProc = MainWndProc; - wc.hInstance = hInstance; - wc.hIcon = reinterpret_cast(pTheme->hIcon); - wc.hCursor = ::LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); - wc.hbrBackground = pTheme->rgFonts[pTheme->dwFontId].hBackground; - wc.lpszMenuName = NULL; - wc.lpszClassName = THMVWR_WINDOW_CLASS_MAIN; - atom = ::RegisterClassW(&wc); - if (!atom) - { - ExitWithLastError(hr, "Failed to register main windowclass ."); - } - - *pAtom = atom; - -LExit: - return hr; -} - -static LRESULT CALLBACK MainWndProc( - __in HWND hWnd, - __in UINT uMsg, - __in WPARAM wParam, - __in LPARAM lParam - ) -{ - HANDLE_THEME* pHandleTheme = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); - - switch (uMsg) - { - case WM_NCCREATE: - { - //LPCREATESTRUCT lpcs = reinterpret_cast(lParam); - //pBA = reinterpret_cast(lpcs->lpCreateParams); - //::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pBA)); - } - break; - - case WM_NCDESTROY: - DecrementHandleTheme(pHandleTheme); - ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, 0); - break; - - case WM_CREATE: - { - HRESULT hr = ThemeLoadControls(vpTheme, vrgInitControls, countof(vrgInitControls)); - if (FAILED(hr)) - { - return -1; - } - } - break; - - case WM_THMVWR_THEME_LOAD_BEGIN: - OnThemeLoadBegin(vsczThemeLoadErrors); - return 0; - - case WM_THMVWR_THEME_LOAD_ERROR: - OnThemeLoadError(vpTheme, lParam); - return 0; - - case WM_THMVWR_NEW_THEME: - OnNewTheme(vpTheme, hWnd, reinterpret_cast(lParam)); - return 0; - - case WM_DESTROY: - ::PostQuitMessage(0); - break; - - case WM_NOTIFY: - { - NMHDR* pnmhdr = reinterpret_cast(lParam); - switch (pnmhdr->code) - { - case TVN_SELCHANGEDW: - { - NMTREEVIEWW* ptv = reinterpret_cast(lParam); - ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_HIDE, ptv->itemOld.lParam); - ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_SHOW, ptv->itemNew.lParam); - } - break; - - //case NM_DBLCLK: - // TVITEM item = { }; - // item.mask = TVIF_PARAM; - // item.hItem = TreeView_GetSelection(pnmhdr->hwndFrom); - // TreeView_GetItem(pnmhdr->hwndFrom, &item); - // ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_SHOWPAGE, SW_SHOW, item.lParam); - // return 1; - } - } - break; - } - - return ThemeDefWindowProc(vpTheme, hWnd, uMsg, wParam, lParam); -} - -static void OnThemeLoadBegin( - __in_z_opt LPWSTR sczThemeLoadErrors - ) -{ - ReleaseNullStr(sczThemeLoadErrors); -} - -static void OnThemeLoadError( - __in THEME* pTheme, - __in HRESULT hrFailure - ) -{ - HRESULT hr = S_OK; - LPWSTR sczMessage = NULL; - LPWSTR* psczErrors = NULL; - UINT cErrors = 0; - TVINSERTSTRUCTW tvi = { }; - - // Add the application node. - tvi.hParent = NULL; - tvi.hInsertAfter = TVI_ROOT; - tvi.item.mask = TVIF_TEXT | TVIF_PARAM; - tvi.item.lParam = 0; - tvi.item.pszText = L"Failed to load theme."; - tvi.hParent = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); - - if (!vsczThemeLoadErrors) - { - hr = StrAllocFormatted(&sczMessage, L"Error 0x%08x.", hrFailure); - ExitOnFailure(hr, "Failed to format error message."); - - tvi.item.pszText = sczMessage; - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); - - hr = StrAllocFromError(&sczMessage, hrFailure, NULL); - ExitOnFailure(hr, "Failed to format error message text."); - - tvi.item.pszText = sczMessage; - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); - } - else - { - hr = StrSplitAllocArray(&psczErrors, &cErrors, vsczThemeLoadErrors, L"\r\n"); - ExitOnFailure(hr, "Failed to split theme load errors."); - - for (DWORD i = 0; i < cErrors; ++i) - { - tvi.item.pszText = psczErrors[i]; - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi)); - } - } - - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_EXPAND, TVE_EXPAND, reinterpret_cast(tvi.hParent)); - -LExit: - ReleaseStr(sczMessage); - ReleaseMem(psczErrors); -} - - -static void OnNewTheme( - __in THEME* pTheme, - __in HWND hWnd, - __in HANDLE_THEME* pHandle - ) -{ - HANDLE_THEME* pOldHandle = reinterpret_cast(::GetWindowLongPtrW(hWnd, GWLP_USERDATA)); - THEME* pNewTheme = pHandle->pTheme; - - WCHAR wzSelectedPage[MAX_PATH] = { }; - HTREEITEM htiSelected = NULL; - TVINSERTSTRUCTW tvi = { }; - TVITEMW item = { }; - - if (pOldHandle) - { - DecrementHandleTheme(pOldHandle); - pOldHandle = NULL; - } - - // Pass the new theme handle to the display thread so it can get the display window prepared - // to show the new theme. - IncrementHandleTheme(pHandle); - ::PostThreadMessageW(vdwDisplayThreadId, WM_THMVWR_NEW_THEME, 0, reinterpret_cast(pHandle)); - - ::SetWindowLongPtrW(hWnd, GWLP_USERDATA, reinterpret_cast(pHandle)); - - // Remember the currently selected item by name so we can try to automatically select it later. - // Otherwise, the user would see their window destroyed after every save of their theme file and - // have to click to get the window back. - item.mask = TVIF_TEXT; - item.pszText = wzSelectedPage; - item.cchTextMax = countof(wzSelectedPage); - item.hItem = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_GETNEXTITEM, TVGN_CARET, NULL)); - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_GETITEM, 0, reinterpret_cast(&item)); - - // Remove the previous items in the tree. - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_DELETEITEM, 0, reinterpret_cast(TVI_ROOT)); - - // Add the application node. - tvi.hParent = NULL; - tvi.hInsertAfter = TVI_ROOT; - tvi.item.mask = TVIF_TEXT | TVIF_PARAM; - tvi.item.lParam = 0; - tvi.item.pszText = pHandle && pHandle->pTheme && pHandle->pTheme->sczCaption ? pHandle->pTheme->sczCaption : L"Window"; - - // Add the pages. - tvi.hParent = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); - tvi.hInsertAfter = TVI_SORT; - for (DWORD i = 0; i < pNewTheme->cPages; ++i) - { - THEME_PAGE* pPage = pNewTheme->rgPages + i; - if (pPage->sczName && *pPage->sczName) - { - tvi.item.pszText = pPage->sczName; - tvi.item.lParam = i + 1; //prgdwPageIds[i]; - TODO: do the right thing here by calling ThemeGetPageIds(), should not assume we know how the page ids will be calculated. - - HTREEITEM hti = reinterpret_cast(ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_INSERTITEMW, 0, reinterpret_cast(&tvi))); - if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, pPage->sczName, -1, wzSelectedPage, -1)) - { - htiSelected = hti; - } - } - } - - if (*wzSelectedPage && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, L"Application", -1, wzSelectedPage, -1)) - { - htiSelected = tvi.hParent; - } - - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_EXPAND, TVE_EXPAND, reinterpret_cast(tvi.hParent)); - if (htiSelected) - { - ThemeSendControlMessage(pTheme, THMVWR_CONTROL_TREE, TVM_SELECTITEM, TVGN_CARET, reinterpret_cast(htiSelected)); - } -} diff --git a/src/thmviewer/thmviewer.manifest b/src/thmviewer/thmviewer.manifest deleted file mode 100644 index 4663b61c..00000000 --- a/src/thmviewer/thmviewer.manifest +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - WiX Toolset Theme Viewer - - - - - - true/pm - - PerMonitorV2, PerMonitor, System - - - - diff --git a/src/thmviewer/thmviewer.rc b/src/thmviewer/thmviewer.rc deleted file mode 100644 index dc6d7242..00000000 --- a/src/thmviewer/thmviewer.rc +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -#include -#include -#include "resource.h" - -//#define MANIFEST_RESOURCE_ID 1 -//MANIFEST_RESOURCE_ID RT_MANIFEST "thmviewer.manifest" - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -THMVWR_RES_THEME_FILE RCDATA "Resources\\thm.xml" -THMVWR_RES_RICHEDIT_FILE RCDATA "Resources\\LoremIpsum.rtf" diff --git a/src/thmviewer/thmviewer.v3.ncrunchproject b/src/thmviewer/thmviewer.v3.ncrunchproject deleted file mode 100644 index 3cffd6ce..00000000 --- a/src/thmviewer/thmviewer.v3.ncrunchproject +++ /dev/null @@ -1,7 +0,0 @@ - - - - thmviewer.manifest - - - \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj b/src/thmviewer/thmviewer.vcxproj deleted file mode 100644 index c02dc237..00000000 --- a/src/thmviewer/thmviewer.vcxproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - Debug - Win32 - - - Release - Win32 - - - - - {95228C13-97F5-484A-B4A2-ECF4618B0881} - Win32Proj - Application - v142 - Unicode - WiX Toolset Theme Viewer - - - - - - - - - - - - - comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib - - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - \ No newline at end of file diff --git a/src/thmviewer/thmviewer.vcxproj.filters b/src/thmviewer/thmviewer.vcxproj.filters deleted file mode 100644 index 488d5510..00000000 --- a/src/thmviewer/thmviewer.vcxproj.filters +++ /dev/null @@ -1,56 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Resource Files - - - Resource Files - - - - - - Header Files - - - Header Files - - - - - Resource Files - - - - - - \ No newline at end of file diff --git a/src/version.json b/src/version.json new file mode 100644 index 00000000..eaeb2c79 --- /dev/null +++ b/src/version.json @@ -0,0 +1,11 @@ +{ + "version": "4.0.0-build.{height}", + "publicReleaseRefSpec": [ + "^refs/heads/master$" + ], + "cloudBuild": { + "buildNumber": { + "enabled": true + } + } +} diff --git a/src/wix/ConsoleMessageListener.cs b/src/wix/ConsoleMessageListener.cs deleted file mode 100644 index ebf1622b..00000000 --- a/src/wix/ConsoleMessageListener.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools.Core -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Text; - using System.Threading; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - - public sealed class ConsoleMessageListener : IMessageListener - { - public ConsoleMessageListener(string prefix, string appName) - { - this.Prefix = prefix; - this.AppName = appName; - - PrepareConsoleForLocalization(); - } - - public string AppName { get; } - - public string Prefix { get; } - - public void Write(Message message) - { - var filename = message.SourceLineNumbers?.FileName ?? this.AppName; - var type = message.Level.ToString().ToLowerInvariant(); - var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; - - if (message.SourceLineNumbers?.LineNumber.HasValue == true) - { - filename = String.Concat(filename, "(", message.SourceLineNumbers?.LineNumber.Value, ")"); - } - - output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.Prefix, message.Id, message.ToString()); - - var fileNames = GetFileNames(message.SourceLineNumbers); - if (fileNames.Count > 1) - { - foreach (var fileName in fileNames) - { - output.WriteLine("Source trace: {0}", fileName); - } - } - } - - public void Write(string message) => Console.Out.WriteLine(message); - - public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; - - private static IList GetFileNames(SourceLineNumber sourceLineNumbers) - { - var fileNames = new List(); - - for (var sln = sourceLineNumbers; null != sln; sln = sln.Parent) - { - if (String.IsNullOrEmpty(sln.FileName)) - { - continue; - } - else if (sln.LineNumber.HasValue) - { - fileNames.Add(String.Format(CultureInfo.CurrentUICulture, "{0}: line {1}", sln.FileName, sln.LineNumber)); - } - else - { - fileNames.Add(sln.FileName); - } - } - - return fileNames; - } - - private static void PrepareConsoleForLocalization() - { - Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); - - if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && - Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && - Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) - { - Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); - } - } - } -} diff --git a/src/wix/Directory.Build.props b/src/wix/Directory.Build.props new file mode 100644 index 00000000..b3c6287c --- /dev/null +++ b/src/wix/Directory.Build.props @@ -0,0 +1,27 @@ + + + + + + Debug + false + MSB3246 + + $(MSBuildProjectName) + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) + $(BaseOutputPath)obj\$(ProjectName)\ + $(BaseOutputPath)$(Configuration)\ + + WiX Toolset Team + WiX Toolset + Copyright (c) .NET Foundation and contributors. All rights reserved. + MS-RL + WiX Toolset + + + + + diff --git a/src/wix/Directory.Build.targets b/src/wix/Directory.Build.targets new file mode 100644 index 00000000..2fcc765a --- /dev/null +++ b/src/wix/Directory.Build.targets @@ -0,0 +1,51 @@ + + + + + + + true + $(SolutionPath) + $(NCrunchOriginalSolutionPath) + + + + + + + $([System.IO.File]::ReadAllText($(TheSolutionPath))) + $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) + (?<="[PackageName]", ")(.*)(?=", ") + + + + + + %(Identity) + $(SolutionFileContent.Contains('\%(Identity).csproj')) + + + + + $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) + $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) + + + + + + + + + + + + + + diff --git a/src/wix/Directory.csproj.props b/src/wix/Directory.csproj.props new file mode 100644 index 00000000..81d24ad1 --- /dev/null +++ b/src/wix/Directory.csproj.props @@ -0,0 +1,13 @@ + + + + + true + true + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + false + + diff --git a/src/wix/Directory.csproj.targets b/src/wix/Directory.csproj.targets new file mode 100644 index 00000000..c3270426 --- /dev/null +++ b/src/wix/Directory.csproj.targets @@ -0,0 +1,26 @@ + + + + + false + $(OutputPath)\$(AssemblyName).xml + + + + + $(PrivateRepositoryUrl.Replace('.git','')) + + $(MSBuildProjectName).nuspec + $(OutputPath)..\ + $(NuspecProperties);Id=$(PackageId);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description);Title=$(Title) + $(NuspecProperties);Version=$(PackageVersion);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl);ProjectFolder=$(MSBuildProjectDirectory)\;ProjectUrl=$(ProjectUrl) + true + snupkg + + + + diff --git a/src/wix/Directory.vcxproj.props b/src/wix/Directory.vcxproj.props new file mode 100644 index 00000000..bcf26c57 --- /dev/null +++ b/src/wix/Directory.vcxproj.props @@ -0,0 +1,111 @@ + + + + + + Win32 + $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ + $(OutputPath)$(Platform)\ + + + $(Company) + $(Copyright) + + win-x86;win-x64;win-arm64 + native,Version=v0.0 + + + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + + + + + $(DisableSpecificCompilerWarnings) + Level4 + $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0501;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + Use + precomp.h + StdCall + true + false + -YlprecompDefine + /Zc:threadSafeInit- %(AdditionalOptions) + true + + + $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) + $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) + + + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) + + + $(ProjectSubSystem) + $(ProjectModuleDefinitionFile) + $(ResourceOnlyDll) + true + $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) + /IGNORE:4099 %(AdditionalOptions) + + + + + + NoExtensions + + + + + CDecl + + + + + OldStyle + true + true + + + + + Disabled + EnableFastChecks + _DEBUG;DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + + MultiThreadedDebugDll + + + + + MinSpace + NDEBUG;%(PreprocessorDefinitions) + true + true + MultiThreaded + + + true + true + + + + + + MultiThreadedDll + + + + + $(LinkKeyFile) + $(LinkDelaySign) + + + diff --git a/src/wix/Directory.wixproj.props b/src/wix/Directory.wixproj.props new file mode 100644 index 00000000..a0aaa658 --- /dev/null +++ b/src/wix/Directory.wixproj.props @@ -0,0 +1,14 @@ + + + + + + $(DefineConstants);CompanyName=$(Company) + + + + + + + + diff --git a/src/wix/Program.cs b/src/wix/Program.cs deleted file mode 100644 index d1818df0..00000000 --- a/src/wix/Program.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Tools -{ - using System; - using System.Runtime.InteropServices; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Converters; - using WixToolset.Core; - using WixToolset.Core.Burn; - using WixToolset.Core.ExtensionCache; - using WixToolset.Core.WindowsInstaller; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - using WixToolset.Tools.Core; - - /// - /// Wix Toolset Command-Line Interface. - /// - public sealed class Program - { - /// - /// The main entry point for wix command-line interface. - /// - /// Commandline arguments for the application. - /// Returns the application error code. - [MTAThread] - public static async Task Main(string[] args) - { - var cts = new CancellationTokenSource(); - var listener = new ConsoleMessageListener("WIX", "wix.exe"); - - Console.CancelKeyPress += (s, e) => - { - cts.Cancel(); - e.Cancel = true; - }; - - try - { - var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() - .AddWindowsInstallerBackend() - .AddBundleBackend() - .AddExtensionCacheManager() - .AddConverter(); - - return await Run(serviceProvider, listener, args, cts.Token); - } - catch (OperationCanceledException) - { - return -1; - } - catch (WixException e) - { - listener.Write(e.Error); - - return e.Error.Id; - } - catch (Exception e) - { - listener.Write(ErrorMessages.UnexpectedException(e)); - - if (e is NullReferenceException || e is SEHException) - { - throw; - } - - return e.HResult; - } - } - - /// - /// Executes the wix command-line interface. - /// - /// Service provider to use throughout this execution. - /// Listener to use for the messaging system. - /// Command-line arguments to execute. - /// Cancellation token. - /// Returns the application error code. - public static Task Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args, CancellationToken cancellationToken) - { - var messaging = serviceProvider.GetService(); - messaging.SetListener(listener); - - var commandLine = serviceProvider.GetService(); - var command = commandLine.CreateCommand(args); - return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); - } - } -} diff --git a/src/wix/README-Tools.md b/src/wix/README-Tools.md new file mode 100644 index 00000000..a806dbde --- /dev/null +++ b/src/wix/README-Tools.md @@ -0,0 +1,4 @@ +# Tools + +Command line tools and MSBuild integration + diff --git a/src/wix/Tools.sln b/src/wix/Tools.sln new file mode 100644 index 00000000..23f8a4d9 --- /dev/null +++ b/src/wix/Tools.sln @@ -0,0 +1,105 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.BuildTasks", "src\test\WixToolsetTest.BuildTasks\WixToolsetTest.BuildTasks.csproj", "{4B0098A4-B581-4D04-BA1E-6DC2370A7D43}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wix", "src\wix\wix.csproj", "{DA5CA026-6165-48C4-BDA5-BB4B17D56A18}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.BuildTasks", "src\WixToolset.BuildTasks\WixToolset.BuildTasks.csproj", "{65141CE1-0BDD-41EF-8043-35B96C423CB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-wix", "src\dotnet-wix\dotnet-wix.csproj", "{938BCA04-610B-4B99-9CB7-02BF7397A972}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.Sdk", "src\WixToolset.Sdk\WixToolset.Sdk.csproj", "{0DF5D4CF-8457-469D-8288-13775E984F70}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{449BE9B0-422F-4039-A030-BDD3E7D97878}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thmviewer", "src\thmviewer\thmviewer.vcxproj", "{95228C13-97F5-484A-B4A2-ECF4618B0881}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "heat", "src\heat\heat.csproj", "{B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.Sdk", "src\test\WixToolsetTest.Sdk\WixToolsetTest.Sdk.csproj", "{7B610B7B-C69D-4A4C-9D65-F304C44479E7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|x86.ActiveCfg = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Debug|x86.Build.0 = Debug|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|Any CPU.Build.0 = Release|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|x86.ActiveCfg = Release|Any CPU + {4B0098A4-B581-4D04-BA1E-6DC2370A7D43}.Release|x86.Build.0 = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|x86.ActiveCfg = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Debug|x86.Build.0 = Debug|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|Any CPU.Build.0 = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|x86.ActiveCfg = Release|Any CPU + {DA5CA026-6165-48C4-BDA5-BB4B17D56A18}.Release|x86.Build.0 = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|x86.ActiveCfg = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Debug|x86.Build.0 = Debug|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|Any CPU.Build.0 = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|x86.ActiveCfg = Release|Any CPU + {65141CE1-0BDD-41EF-8043-35B96C423CB6}.Release|x86.Build.0 = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|Any CPU.Build.0 = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|x86.ActiveCfg = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Debug|x86.Build.0 = Debug|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.ActiveCfg = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|Any CPU.Build.0 = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|x86.ActiveCfg = Release|Any CPU + {938BCA04-610B-4B99-9CB7-02BF7397A972}.Release|x86.Build.0 = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|x86.ActiveCfg = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Debug|x86.Build.0 = Debug|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|Any CPU.Build.0 = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.ActiveCfg = Release|Any CPU + {0DF5D4CF-8457-469D-8288-13775E984F70}.Release|x86.Build.0 = Release|Any CPU + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|Any CPU.Build.0 = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.ActiveCfg = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Debug|x86.Build.0 = Debug|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|Any CPU.ActiveCfg = Release|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.ActiveCfg = Release|Win32 + {95228C13-97F5-484A-B4A2-ECF4618B0881}.Release|x86.Build.0 = Release|Win32 + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|x86.ActiveCfg = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Debug|x86.Build.0 = Debug|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|Any CPU.Build.0 = Release|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.ActiveCfg = Release|Any CPU + {B1F18B6F-FBD8-4911-B3BF-40D801DA77D7}.Release|x86.Build.0 = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|x86.ActiveCfg = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Debug|x86.Build.0 = Debug|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|Any CPU.Build.0 = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|x86.ActiveCfg = Release|Any CPU + {7B610B7B-C69D-4A4C-9D65-F304C44479E7}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AEB88B8C-8C84-4E97-9886-30CBDD32B34B} + EndGlobalSection +EndGlobal diff --git a/src/wix/Tools.v3.ncrunchsolution b/src/wix/Tools.v3.ncrunchsolution new file mode 100644 index 00000000..10420ac9 --- /dev/null +++ b/src/wix/Tools.v3.ncrunchsolution @@ -0,0 +1,6 @@ + + + True + True + + \ No newline at end of file diff --git a/src/wix/WixToolset.BuildTasks/AssemblyInfo.cs b/src/wix/WixToolset.BuildTasks/AssemblyInfo.cs new file mode 100644 index 00000000..ae52fce8 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] diff --git a/src/wix/WixToolset.BuildTasks/BuildException.cs b/src/wix/WixToolset.BuildTasks/BuildException.cs new file mode 100644 index 00000000..953134ba --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/BuildException.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Globalization; + + class BuildException : Exception + { + public BuildException() + { + } + + public BuildException(string message) : base(message) + { + } + + public BuildException(string message, Exception innerException) : base(message, innerException) + { + } + + public BuildException(string format, params string[] args) : this(String.Format(CultureInfo.CurrentCulture, format, args)) + { + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/Common.cs b/src/wix/WixToolset.BuildTasks/Common.cs new file mode 100644 index 00000000..c5b709c2 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/Common.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Text.RegularExpressions; + + /// + /// Common WixTasks utility methods and types. + /// + public static class ToolsCommon + { + /// Metadata key name to turn off harvesting of project references. + public const string DoNotHarvest = "DoNotHarvest"; + + private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); + private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters + + /// + /// Return an identifier based on passed file/directory name + /// + /// File/directory name to generate identifer from + /// A version of the name that is a legal identifier. + /// This is duplicated from WiX's Common class. + public static string GetIdentifierFromName(string name) + { + string result = IllegalIdentifierCharacters.Replace(name, "_"); // replace illegal characters with "_". + + // MSI identifiers must begin with an alphabetic character or an + // underscore. Prefix all other values with an underscore. + if (AddPrefix.IsMatch(name)) + { + result = String.Concat("_", result); + } + + return result; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/ConvertReferences.cs b/src/wix/WixToolset.BuildTasks/ConvertReferences.cs new file mode 100644 index 00000000..3fdc78d1 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/ConvertReferences.cs @@ -0,0 +1,89 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class ConvertReferences : Task + { + private string projectOutputGroups; + private ITaskItem[] projectReferences; + private ITaskItem[] harvestItems; + + /// + /// The total list of cabs in this database + /// + [Output] + public ITaskItem[] HarvestItems + { + get { return this.harvestItems; } + } + + /// + /// The project output groups to harvest. + /// + [Required] + public string ProjectOutputGroups + { + get { return this.projectOutputGroups; } + set { this.projectOutputGroups = value; } + } + + /// + /// All the project references in the project. + /// + [Required] + public ITaskItem[] ProjectReferences + { + get { return this.projectReferences; } + set { this.projectReferences = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + List newItems = new List(); + + foreach(ITaskItem item in this.ProjectReferences) + { + Dictionary newItemMetadeta = new Dictionary(); + + if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) + { + continue; + } + + string refTargetDir = item.GetMetadata("RefTargetDir"); + if (!String.IsNullOrEmpty(refTargetDir)) + { + newItemMetadeta.Add("DirectoryIds", refTargetDir); + } + + string refName = item.GetMetadata("Name"); + if (!String.IsNullOrEmpty(refName)) + { + newItemMetadeta.Add("ProjectName", refName); + } + + newItemMetadeta.Add("ProjectOutputGroups", this.ProjectOutputGroups); + + ITaskItem newItem = new TaskItem(item.ItemSpec, newItemMetadeta); + newItems.Add(newItem); + } + + this.harvestItems = newItems.ToArray(); + + return true; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/CreateItemAvoidingInference.cs b/src/wix/WixToolset.BuildTasks/CreateItemAvoidingInference.cs new file mode 100644 index 00000000..3441bd85 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/CreateItemAvoidingInference.cs @@ -0,0 +1,46 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class CreateItemAvoidingInference : Task + { + /// + /// The properties to converty to items. + /// + [Required] + public string InputProperties { get; set; } + + /// + /// The output items. + /// + [Output] + public ITaskItem[] OuputItems { get; private set; } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + var newItems = new List(); + + foreach (var property in this.InputProperties.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) + { + newItems.Add(new TaskItem(property)); + } + + this.OuputItems = newItems.ToArray(); + + return true; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs b/src/wix/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs new file mode 100644 index 00000000..7cda6b01 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/CreateProjectReferenceDefineConstants.cs @@ -0,0 +1,271 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// An MSBuild task to create a list of preprocessor defines to be passed to candle from the + /// list of referenced projects. + /// + public sealed class CreateProjectReferenceDefineConstants : Task + { + private ITaskItem[] defineConstants; + private ITaskItem[] projectConfigurations; + private ITaskItem[] projectReferencePaths; + + [Output] + public ITaskItem[] DefineConstants + { + get { return this.defineConstants; } + } + + [Required] + public ITaskItem[] ProjectReferencePaths + { + get { return this.projectReferencePaths; } + set { this.projectReferencePaths = value; } + } + + public ITaskItem[] ProjectConfigurations + { + get { return this.projectConfigurations; } + set { this.projectConfigurations = value; } + } + + public override bool Execute() + { + List outputItems = new List(); + Dictionary defineConstants = new Dictionary(); + + for (int i = 0; i < this.ProjectReferencePaths.Length; i++) + { + ITaskItem item = this.ProjectReferencePaths[i]; + + string configuration = item.GetMetadata("Configuration"); + string fullConfiguration = item.GetMetadata("FullConfiguration"); + string platform = item.GetMetadata("Platform"); + + string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); + string projectDir = Path.GetDirectoryName(projectPath) + Path.DirectorySeparatorChar; + string projectExt = Path.GetExtension(projectPath); + string projectFileName = Path.GetFileName(projectPath); + string projectName = Path.GetFileNameWithoutExtension(projectPath); + + string referenceName = CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName); + + string targetPath = item.GetMetadata("FullPath"); + string targetDir = Path.GetDirectoryName(targetPath) + Path.DirectorySeparatorChar; + string targetExt = Path.GetExtension(targetPath); + string targetFileName = Path.GetFileName(targetPath); + string targetName = Path.GetFileNameWithoutExtension(targetPath); + + // If there is no configuration metadata on the project reference task item, + // check for any additional configuration data provided in the optional task property. + if (String.IsNullOrEmpty(fullConfiguration)) + { + fullConfiguration = this.FindProjectConfiguration(projectName); + if (!String.IsNullOrEmpty(fullConfiguration)) + { + string[] typeAndPlatform = fullConfiguration.Split('|'); + configuration = typeAndPlatform[0]; + platform = (typeAndPlatform.Length > 1 ? typeAndPlatform[1] : String.Empty); + } + } + + // write out the platform/configuration defines + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.Configuration", referenceName)] = configuration; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.FullConfiguration", referenceName)] = fullConfiguration; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.Platform", referenceName)] = platform; + + // write out the ProjectX defines + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectDir", referenceName)] = projectDir; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectExt", referenceName)] = projectExt; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectFileName", referenceName)] = projectFileName; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectName", referenceName)] = projectName; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.ProjectPath", referenceName)] = projectPath; + + // write out the TargetX defines + string targetDirDefine = String.Format(CultureInfo.InvariantCulture, "{0}.TargetDir", referenceName); + if (defineConstants.ContainsKey(targetDirDefine)) + { + //if target dir was already defined, redefine it as the common root shared by multiple references from the same project + string commonDir = FindCommonRoot(targetDir, defineConstants[targetDirDefine]); + if (!String.IsNullOrEmpty(commonDir)) + { + targetDir = commonDir; + } + } + defineConstants[targetDirDefine] = CreateProjectReferenceDefineConstants.EnsureEndsWithBackslash(targetDir); + + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetExt", referenceName)] = targetExt; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetFileName", referenceName)] = targetFileName; + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.TargetName", referenceName)] = targetName; + + //if target path was already defined, append to it creating a list of multiple references from the same project + string targetPathDefine = String.Format(CultureInfo.InvariantCulture, "{0}.TargetPath", referenceName); + if (defineConstants.ContainsKey(targetPathDefine)) + { + string oldTargetPath = defineConstants[targetPathDefine]; + if (!targetPath.Equals(oldTargetPath, StringComparison.OrdinalIgnoreCase)) + { + defineConstants[targetPathDefine] += ";" + targetPath; + } + + //If there was only one targetpath we need to create its culture specific define + if (!oldTargetPath.Contains(";")) + { + string oldSubFolder = FindSubfolder(oldTargetPath, targetDir, targetFileName); + if (!String.IsNullOrEmpty(oldSubFolder)) + { + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.{1}.TargetPath", referenceName, oldSubFolder.Replace('\\', '_'))] = oldTargetPath; + } + } + + // Create a culture specific define + string subFolder = FindSubfolder(targetPath, targetDir, targetFileName); + if (!String.IsNullOrEmpty(subFolder)) + { + defineConstants[String.Format(CultureInfo.InvariantCulture, "{0}.{1}.TargetPath", referenceName, subFolder.Replace('\\', '_'))] = targetPath; + } + + } + else + { + defineConstants[targetPathDefine] = targetPath; + } + } + + foreach (KeyValuePair define in defineConstants) + { + outputItems.Add(new TaskItem(String.Format(CultureInfo.InvariantCulture, "{0}={1}", define.Key, define.Value))); + } + + this.defineConstants = outputItems.ToArray(); + + return true; + } + + public static string GetProjectPath(ITaskItem[] projectReferencePaths, int i) + { + return projectReferencePaths[i].GetMetadata("MSBuildSourceProjectFile"); + } + + public static string GetReferenceName(ITaskItem item, string projectName) + { + string referenceName = item.GetMetadata("Name"); + if (String.IsNullOrEmpty(referenceName)) + { + referenceName = projectName; + } + + // We cannot have an equals sign in the variable name because it + // messes with the preprocessor definitions on the command line. + referenceName = referenceName.Replace('=', '_'); + + // We cannot have a double quote on the command line because it + // there is no way to escape it on the command line. + referenceName = referenceName.Replace('\"', '_'); + + // We cannot have parens in the variable name because the WiX + // preprocessor will not be able to parse it. + referenceName = referenceName.Replace('(', '_'); + referenceName = referenceName.Replace(')', '_'); + + return referenceName; + } + + /// + /// Look through the configuration data in the ProjectConfigurations property + /// to find the configuration for a project, if available. + /// + /// Name of the project that is being searched for. + /// Full configuration spec, for example "Release|Win32". + private string FindProjectConfiguration(string projectName) + { + string configuration = String.Empty; + + if (this.ProjectConfigurations != null) + { + foreach (ITaskItem configItem in this.ProjectConfigurations) + { + string configProject = configItem.ItemSpec; + if (configProject.Length > projectName.Length && + configProject.StartsWith(projectName) && + configProject[projectName.Length] == '=') + { + configuration = configProject.Substring(projectName.Length + 1); + break; + } + } + } + + return configuration; + } + + /// + /// Finds the common root between two paths + /// + /// + /// + /// common root on success, empty string on failure + private static string FindCommonRoot(string path1, string path2) + { + path1 = path1.TrimEnd(Path.DirectorySeparatorChar); + path2 = path2.TrimEnd(Path.DirectorySeparatorChar); + + while (!String.IsNullOrEmpty(path1)) + { + for (string searchPath = path2; !String.IsNullOrEmpty(searchPath); searchPath = Path.GetDirectoryName(searchPath)) + { + if (path1.Equals(searchPath, StringComparison.OrdinalIgnoreCase)) + { + return searchPath; + } + } + + path1 = Path.GetDirectoryName(path1); + } + + return path1; + } + + /// + /// Finds the subfolder of a path, excluding a root and filename. + /// + /// Path to examine + /// Root that must be present + /// + /// + private static string FindSubfolder(string path, string rootPath, string fileName) + { + if (Path.GetFileName(path).Equals(fileName, StringComparison.OrdinalIgnoreCase)) + { + path = Path.GetDirectoryName(path); + } + + if (path.StartsWith(rootPath, StringComparison.OrdinalIgnoreCase)) + { + // cut out the root and return the subpath + return path.Substring(rootPath.Length).Trim(Path.DirectorySeparatorChar); + } + + return String.Empty; + } + + private static string EnsureEndsWithBackslash(string dir) + { + if (dir[dir.Length - 1] != Path.DirectorySeparatorChar) + { + dir += Path.DirectorySeparatorChar; + } + + return dir; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/FileSearchHelperMethods.cs b/src/wix/WixToolset.BuildTasks/FileSearchHelperMethods.cs new file mode 100644 index 00000000..397c9d7c --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/FileSearchHelperMethods.cs @@ -0,0 +1,56 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.IO; + + /// + /// Contains helper methods on searching for files + /// + public static class FileSearchHelperMethods + { + /// + /// Searches for the existence of a file in multiple directories. + /// Search is satisfied if default file path is valid and exists. If not, + /// file name is extracted from default path and combined with each of the directories + /// looking to see if it exists. If not found, input default path is returned. + /// + /// Array of directories to look in, without filenames in them + /// Default path - to use if not found + /// File path if file found. Empty string if not found + public static string SearchFilePaths(string[] directories, string defaultFullPath) + { + if (String.IsNullOrEmpty(defaultFullPath)) + { + return String.Empty; + } + + if (File.Exists(defaultFullPath)) + { + return defaultFullPath; + } + + if (directories == null) + { + return string.Empty; + } + + string fileName = Path.GetFileName(defaultFullPath); + foreach (string currentPath in directories) + { + if (String.IsNullOrEmpty(currentPath) || String.IsNullOrEmpty(currentPath.Trim())) + { + continue; + } + + if (File.Exists(Path.Combine(currentPath, fileName))) + { + return Path.Combine(currentPath, fileName); + } + } + + return String.Empty; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs b/src/wix/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs new file mode 100644 index 00000000..a5f76618 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/GenerateCompileWithObjectPath.cs @@ -0,0 +1,145 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.IO; + using System.Security.Cryptography; + using System.Text; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task generates metadata on the for compile output objects. + /// + public class GenerateCompileWithObjectPath : Task + { + /// + /// The list of files to generate outputs for. + /// + [Required] + public ITaskItem[] Compile + { + get; + set; + } + + /// + /// The list of files with ObjectPath metadata. + /// + [Output] + public ITaskItem[] CompileWithObjectPath + { + get; + private set; + } + + /// + /// The folder under which all ObjectPaths should reside. + /// + [Required] + public string IntermediateOutputPath + { + get; + set; + } + + /// + /// Generate an identifier by hashing data from the row. + /// + /// Three letter or less prefix for generated row identifier. + /// Information to hash. + /// The generated identifier. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + public static string GenerateIdentifier(string prefix, params string[] args) + { + string stringData = String.Join("|", args); + byte[] data = Encoding.Unicode.GetBytes(stringData); + + // hash the data + byte[] hash; + + using (SHA1 sha1 = new SHA1CryptoServiceProvider()) + { + hash = sha1.ComputeHash(data); + } + + // build up the identifier + StringBuilder identifier = new StringBuilder(35, 35); + identifier.Append(prefix); + + // hard coded to 16 as that is the most bytes that can be used to meet the length requirements. SHA1 is 20 bytes. + for (int i = 0; i < 16; i++) + { + identifier.Append(hash[i].ToString("X2", CultureInfo.InvariantCulture.NumberFormat)); + } + + return identifier.ToString(); + } + + /// + /// Gets the full path of the directory in which the file is found. + /// + /// The file from which to extract the directory. + /// The generated identifier. + private static string GetDirectory(ITaskItem file) + { + return file.GetMetadata("RootDir") + file.GetMetadata("Directory"); + } + + /// + /// Sets the object path to use for the file. + /// + /// The file on which to set the ObjectPath metadata. + /// + /// For the same input path it will return the same ObjectPath. Case is not ignored, however that isn't a problem. + /// + private void SetObjectPath(ITaskItem file) + { + // If the source file is in the project directory or in the intermediate directory, use the intermediate directory. + if (string.IsNullOrEmpty(file.GetMetadata("RelativeDir")) || string.Compare(file.GetMetadata("RelativeDir"), this.IntermediateOutputPath, StringComparison.OrdinalIgnoreCase) == 0) + { + file.SetMetadata("ObjectPath", this.IntermediateOutputPath); + } + // Otherwise use a subdirectory of the intermediate directory. The subfolder's name is based on the full path of the folder containing the source file. + else + { + file.SetMetadata("ObjectPath", Path.Combine(this.IntermediateOutputPath, GenerateIdentifier("pth", GetDirectory(file))) + Path.DirectorySeparatorChar); + } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + if (string.IsNullOrEmpty(this.IntermediateOutputPath)) + { + this.Log.LogError("IntermediateOutputPath parameter is required and cannot be empty"); + return false; + } + + if (this.Compile == null || this.Compile.Length == 0) + { + return true; + } + + this.CompileWithObjectPath = new ITaskItem[this.Compile.Length]; + for (int i = 0; i < this.Compile.Length; ++i) + { + this.CompileWithObjectPath[i] = new TaskItem(this.Compile[i].ItemSpec, this.Compile[i].CloneCustomMetadata()); + + // Do not overwrite the ObjectPath metadata if it already was set. + if (string.IsNullOrEmpty(this.CompileWithObjectPath[i].GetMetadata("ObjectPath"))) + { + this.SetObjectPath(this.CompileWithObjectPath[i]); + } + } + + return true; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/GetCabList.cs b/src/wix/WixToolset.BuildTasks/GetCabList.cs new file mode 100644 index 00000000..33fa5b37 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/GetCabList.cs @@ -0,0 +1,81 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.IO; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Dtf.WindowsInstaller; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class GetCabList : Task + { + private ITaskItem database; + private ITaskItem[] cabList; + + /// + /// The list of database files to find cabs in + /// + [Required] + public ITaskItem Database + { + get { return this.database; } + set { this.database = value; } + } + + /// + /// The total list of cabs in this database + /// + [Output] + public ITaskItem[] CabList + { + get { return this.cabList; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + string databaseFile = this.database.ItemSpec; + Object []args = { }; + System.Collections.Generic.List cabNames = new System.Collections.Generic.List(); + + // If the file doesn't exist, no cabs to return, so exit now + if (!File.Exists(databaseFile)) + { + return true; + } + + using (Database database = new Database(databaseFile)) + { + // If the media table doesn't exist, no cabs to return, so exit now + if (null == database.Tables["Media"]) + { + return true; + } + + System.Collections.IList records = database.ExecuteQuery("SELECT `Cabinet` FROM `Media`", args); + + foreach (string cabName in records) + { + if (String.IsNullOrEmpty(cabName) || cabName.StartsWith("#", StringComparison.Ordinal)) + { + continue; + } + + cabNames.Add(new TaskItem(Path.Combine(Path.GetDirectoryName(databaseFile), cabName))); + } + } + + this.cabList = cabNames.ToArray(); + + return true; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/GetLooseFileList.cs b/src/wix/WixToolset.BuildTasks/GetLooseFileList.cs new file mode 100644 index 00000000..d1eb62c1 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/GetLooseFileList.cs @@ -0,0 +1,225 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.IO; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Dtf.WindowsInstaller; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class GetLooseFileList : Task + { + private ITaskItem database; + private ITaskItem[] looseFileList; + + internal const int MsidbFileAttributesNoncompressed = 8192; + internal const int MsidbFileAttributesCompressed = 16384; + + /// + /// The list of database files to find Loose Files in + /// + [Required] + public ITaskItem Database + { + get { return this.database; } + set { this.database = value; } + } + + /// + /// The total list of Loose Files in this database + /// + [Output] + public ITaskItem[] LooseFileList + { + get { return this.looseFileList; } + } + + /// + /// Takes the "defaultDir" column + /// + /// Returns the corresponding sourceDir. + public string SourceDirFromDefaultDir(string defaultDir) + { + string sourceDir; + + string[] splitted = defaultDir.Split(':'); + + if (1 == splitted.Length) + { + sourceDir = splitted[0]; + } + else + { + sourceDir = splitted[1]; + } + + splitted = sourceDir.Split('|'); + + if (1 == splitted.Length) + { + sourceDir = splitted[0]; + } + else + { + sourceDir = splitted[1]; + } + + return sourceDir; + } + + /// + /// Takes the "FileName" column + /// + /// Returns the corresponding source file name. + public string SourceFileFromFileName(string fileName) + { + string sourceFile; + + string[] splitted = fileName.Split('|'); + + if (1 == splitted.Length) + { + sourceFile = splitted[0]; + } + else + { + sourceFile = splitted[1]; + } + + return sourceFile; + } + + /// + /// Gets a complete list of external Loose Files referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + string databaseFile = this.database.ItemSpec; + Object []emptyArgs = { }; + System.Collections.Generic.List looseFileNames = new System.Collections.Generic.List(); + Dictionary ComponentFullDirectory = new Dictionary(); + Dictionary DirectoryIdDefaultDir = new Dictionary(); + Dictionary DirectoryIdParent = new Dictionary(); + Dictionary DirectoryIdFullSource = new Dictionary(); + int i; + string databaseDir = Path.GetDirectoryName(databaseFile); + + // If the file doesn't exist, no Loose Files to return, so exit now + if (!File.Exists(databaseFile)) + { + return true; + } + + using (Database database = new Database(databaseFile)) + { + bool compressed = false; + if (2 == (database.SummaryInfo.WordCount & 2)) + { + compressed = true; + } + + // If the media table doesn't exist, no Loose Files to return, so exit now + if (null == database.Tables["File"]) + { + return true; + } + + // Only setup all these helpful indexes if the database is marked as uncompressed. If it's marked as compressed, files are stored at the root, + // so none of these indexes will be used + if (!compressed) + { + if (null == database.Tables["Directory"] || null == database.Tables["Component"]) + { + return true; + } + + System.Collections.IList directoryRecords = database.ExecuteQuery("SELECT `Directory`,`Directory_Parent`,`DefaultDir` FROM `Directory`", emptyArgs); + + // First setup a simple index from DirectoryId to DefaultDir + for (i = 0; i < directoryRecords.Count; i += 3) + { + string directoryId = (string)(directoryRecords[i]); + string directoryParent = (string)(directoryRecords[i + 1]); + string defaultDir = (string)(directoryRecords[i + 2]); + + string sourceDir = this.SourceDirFromDefaultDir(defaultDir); + + DirectoryIdDefaultDir[directoryId] = sourceDir; + DirectoryIdParent[directoryId] = directoryParent; + } + + // Setup an index from directory Id to the full source path + for (i = 0; i < directoryRecords.Count; i += 3) + { + string directoryId = (string)(directoryRecords[i]); + string directoryParent = (string)(directoryRecords[i + 1]); + string defaultDir = (string)(directoryRecords[i + 2]); + + string sourceDir = DirectoryIdDefaultDir[directoryId]; + + // The TARGETDIR case + if (String.IsNullOrEmpty(directoryParent)) + { + DirectoryIdFullSource[directoryId] = databaseDir; + } + else + { + string tempDirectoryParent = directoryParent; + + while (!String.IsNullOrEmpty(tempDirectoryParent) && !String.IsNullOrEmpty(DirectoryIdParent[tempDirectoryParent])) + { + sourceDir = Path.Combine(DirectoryIdDefaultDir[tempDirectoryParent], sourceDir); + + tempDirectoryParent = DirectoryIdParent[tempDirectoryParent]; + } + + DirectoryIdFullSource[directoryId] = Path.Combine(databaseDir, sourceDir); + } + } + + // Setup an index from component Id to full directory path + System.Collections.IList componentRecords = database.ExecuteQuery("SELECT `Component`,`Directory_` FROM `Component`", emptyArgs); + + for (i = 0; i < componentRecords.Count; i += 2) + { + string componentId = (string)(componentRecords[i]); + string componentDir = (string)(componentRecords[i + 1]); + + ComponentFullDirectory[componentId] = DirectoryIdFullSource[componentDir]; + } + } + + System.Collections.IList fileRecords = database.ExecuteQuery("SELECT `Component_`,`FileName`,`Attributes` FROM `File`", emptyArgs); + + for (i = 0; i < fileRecords.Count; i += 3) + { + string componentId = (string)(fileRecords[i]); + string fileName = this.SourceFileFromFileName((string)(fileRecords[i + 1])); + int attributes = (int)(fileRecords[i + 2]); + + // If the whole database is marked uncompressed, use the directory layout made above + if ((!compressed && MsidbFileAttributesCompressed != (attributes & MsidbFileAttributesCompressed))) + { + looseFileNames.Add(new TaskItem(Path.GetFullPath(Path.Combine(ComponentFullDirectory[componentId], fileName)))); + } + // If the database is marked as compressed, put files at the root + else if (compressed && (MsidbFileAttributesNoncompressed == (attributes & MsidbFileAttributesNoncompressed))) + { + looseFileNames.Add(new TaskItem(Path.GetFullPath(Path.Combine(databaseDir, fileName)))); + } + } + } + + this.looseFileList = looseFileNames.ToArray(); + + return true; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/HeatDirectory.cs b/src/wix/WixToolset.BuildTasks/HeatDirectory.cs new file mode 100644 index 00000000..79da303a --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/HeatDirectory.cs @@ -0,0 +1,96 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Framework; + + public sealed class HeatDirectory : HeatTask + { + private string directory; + private bool keepEmptyDirectories; + private bool suppressCom; + private bool suppressRootDirectory; + private bool suppressRegistry; + private string template; + private string componentGroupName; + private string directoryRefId; + private string preprocessorVariable; + + public string ComponentGroupName + { + get { return this.componentGroupName; } + set { this.componentGroupName = value; } + } + + [Required] + public string Directory + { + get { return this.directory; } + set { this.directory = value; } + } + + public string DirectoryRefId + { + get { return this.directoryRefId; } + set { this.directoryRefId = value; } + } + + public bool KeepEmptyDirectories + { + get { return this.keepEmptyDirectories; } + set { this.keepEmptyDirectories = value; } + } + + public string PreprocessorVariable + { + get { return this.preprocessorVariable; } + set { this.preprocessorVariable = value; } + } + + public bool SuppressCom + { + get { return this.suppressCom; } + set { this.suppressCom = value; } + } + + public bool SuppressRootDirectory + { + get { return this.suppressRootDirectory; } + set { this.suppressRootDirectory = value; } + } + + public bool SuppressRegistry + { + get { return this.suppressRegistry; } + set { this.suppressRegistry = value; } + } + + public string Template + { + get { return this.template; } + set { this.template = value; } + } + + protected override string OperationName + { + get { return "dir"; } + } + + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendSwitch(this.OperationName); + commandLineBuilder.AppendFileNameIfNotNull(this.Directory); + + commandLineBuilder.AppendSwitchIfNotNull("-cg ", this.ComponentGroupName); + commandLineBuilder.AppendSwitchIfNotNull("-dr ", this.DirectoryRefId); + commandLineBuilder.AppendIfTrue("-ke", this.KeepEmptyDirectories); + commandLineBuilder.AppendIfTrue("-scom", this.SuppressCom); + commandLineBuilder.AppendIfTrue("-sreg", this.SuppressRegistry); + commandLineBuilder.AppendIfTrue("-srd", this.SuppressRootDirectory); + commandLineBuilder.AppendSwitchIfNotNull("-template ", this.Template); + commandLineBuilder.AppendSwitchIfNotNull("-var ", this.PreprocessorVariable); + + base.BuildCommandLine(commandLineBuilder); + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/HeatFile.cs b/src/wix/WixToolset.BuildTasks/HeatFile.cs new file mode 100644 index 00000000..57fe579d --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/HeatFile.cs @@ -0,0 +1,88 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Framework; + + public sealed class HeatFile : HeatTask + { + private string file; + private bool suppressCom; + private bool suppressRegistry; + private bool suppressRootDirectory; + private string template; + private string componentGroupName; + private string directoryRefId; + private string preprocessorVariable; + + public string ComponentGroupName + { + get { return this.componentGroupName; } + set { this.componentGroupName = value; } + } + + public string DirectoryRefId + { + get { return this.directoryRefId; } + set { this.directoryRefId = value; } + } + + [Required] + public string File + { + get { return this.file; } + set { this.file = value; } + } + + public string PreprocessorVariable + { + get { return this.preprocessorVariable; } + set { this.preprocessorVariable = value; } + } + + public bool SuppressCom + { + get { return this.suppressCom; } + set { this.suppressCom = value; } + } + + public bool SuppressRegistry + { + get { return this.suppressRegistry; } + set { this.suppressRegistry = value; } + } + + public bool SuppressRootDirectory + { + get { return this.suppressRootDirectory; } + set { this.suppressRootDirectory = value; } + } + + public string Template + { + get { return this.template; } + set { this.template = value; } + } + + protected override string OperationName + { + get { return "file"; } + } + + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendSwitch(this.OperationName); + commandLineBuilder.AppendFileNameIfNotNull(this.File); + + commandLineBuilder.AppendSwitchIfNotNull("-cg ", this.ComponentGroupName); + commandLineBuilder.AppendSwitchIfNotNull("-dr ", this.DirectoryRefId); + commandLineBuilder.AppendIfTrue("-scom", this.SuppressCom); + commandLineBuilder.AppendIfTrue("-srd", this.SuppressRootDirectory); + commandLineBuilder.AppendIfTrue("-sreg", this.SuppressRegistry); + commandLineBuilder.AppendSwitchIfNotNull("-template ", this.Template); + commandLineBuilder.AppendSwitchIfNotNull("-var ", this.PreprocessorVariable); + + base.BuildCommandLine(commandLineBuilder); + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/HeatProject.cs b/src/wix/WixToolset.BuildTasks/HeatProject.cs new file mode 100644 index 00000000..3833a754 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/HeatProject.cs @@ -0,0 +1,110 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Framework; + + public sealed class HeatProject : HeatTask + { + private string configuration; + private string directoryIds; + private string generateType; + private bool generateWixVariables; + private string platform; + private string project; + private string projectName; + private string[] projectOutputGroups; + + public string Configuration + { + get { return this.configuration; } + set { this.configuration = value; } + } + + public string DirectoryIds + { + get { return this.directoryIds; } + set { this.directoryIds = value; } + } + + public bool GenerateWixVariables + { + get { return this.generateWixVariables; } + set { this.generateWixVariables = value; } + } + + public string GenerateType + { + get { return this.generateType; } + set { this.generateType = value; } + } + + public string MsbuildBinPath { get; set; } + + public string Platform + { + get { return this.platform; } + set { this.platform = value; } + } + + [Required] + public string Project + { + get { return this.project; } + set { this.project = value; } + } + + public string ProjectName + { + get { return this.projectName; } + set { this.projectName = value; } + } + + public string[] ProjectOutputGroups + { + get + { + return this.projectOutputGroups; + } + set + { + this.projectOutputGroups = value; + + // If it's just one string and it contains semicolons, let's + // split it into separate items. + if (this.projectOutputGroups.Length == 1) + { + this.projectOutputGroups = this.projectOutputGroups[0].Split(new char[] { ';' }); + } + } + } + + public bool UseToolsVersion { get; set; } + + protected override string OperationName + { + get { return "project"; } + } + + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendSwitch(this.OperationName); + commandLineBuilder.AppendFileNameIfNotNull(this.Project); + + commandLineBuilder.AppendSwitchIfNotNull("-configuration ", this.Configuration); + commandLineBuilder.AppendSwitchIfNotNull("-directoryid ", this.DirectoryIds); + commandLineBuilder.AppendSwitchIfNotNull("-generate ", this.GenerateType); + commandLineBuilder.AppendSwitchIfNotNull("-msbuildbinpath ", this.MsbuildBinPath); + commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.Platform); + commandLineBuilder.AppendArrayIfNotNull("-pog ", this.ProjectOutputGroups); + commandLineBuilder.AppendSwitchIfNotNull("-projectname ", this.ProjectName); + commandLineBuilder.AppendIfTrue("-wixvar", this.GenerateWixVariables); + +#if !NETCOREAPP + commandLineBuilder.AppendIfTrue("-usetoolsversion", this.UseToolsVersion); +#endif + + base.BuildCommandLine(commandLineBuilder); + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/HeatTask.cs b/src/wix/WixToolset.BuildTasks/HeatTask.cs new file mode 100644 index 00000000..18c08342 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/HeatTask.cs @@ -0,0 +1,91 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using Microsoft.Build.Framework; + + /// + /// A base MSBuild task to run the WiX harvester. + /// Specific harvester tasks should extend this class. + /// + public abstract partial class HeatTask : ToolsetTask + { + private bool autogenerageGuids; + private bool generateGuidsNow; + private ITaskItem outputFile; + private bool suppressFragments; + private bool suppressUniqueIds; + private string[] transforms; + + public HeatTask() + { + this.RunAsSeparateProcess = true; + } + + public bool AutogenerateGuids + { + get { return this.autogenerageGuids; } + set { this.autogenerageGuids = value; } + } + + public bool GenerateGuidsNow + { + get { return this.generateGuidsNow; } + set { this.generateGuidsNow = value; } + } + + [Required] + [Output] + public ITaskItem OutputFile + { + get { return this.outputFile; } + set { this.outputFile = value; } + } + + public bool SuppressFragments + { + get { return this.suppressFragments; } + set { this.suppressFragments = value; } + } + + public bool SuppressUniqueIds + { + get { return this.suppressUniqueIds; } + set { this.suppressUniqueIds = value; } + } + + public string[] Transforms + { + get { return this.transforms; } + set { this.transforms = value; } + } + + protected sealed override string ToolName => "heat.exe"; + + /// + /// Gets the name of the heat operation performed by the task. + /// + /// This is the first parameter passed on the heat.exe command-line. + /// The name of the heat operation performed by the task. + protected abstract string OperationName + { + get; + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendIfTrue("-ag", this.AutogenerateGuids); + commandLineBuilder.AppendIfTrue("-gg", this.GenerateGuidsNow); + commandLineBuilder.AppendIfTrue("-sfrag", this.SuppressFragments); + commandLineBuilder.AppendIfTrue("-suid", this.SuppressUniqueIds); + commandLineBuilder.AppendArrayIfNotNull("-t ", this.Transforms); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/HeatTask_InProc.cs b/src/wix/WixToolset.BuildTasks/HeatTask_InProc.cs new file mode 100644 index 00000000..48ee9e02 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/HeatTask_InProc.cs @@ -0,0 +1,20 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#if !NETCOREAPP +namespace WixToolset.BuildTasks +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Extensibility.Services; + + public partial class HeatTask + { + public override bool RunAsSeparateProcess { get => true; } + + protected sealed override string TaskShortName => "HEAT"; + + protected sealed override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken) => throw new NotImplementedException(); + } +} +#endif diff --git a/src/wix/WixToolset.BuildTasks/Insignia.cs b/src/wix/WixToolset.BuildTasks/Insignia.cs new file mode 100644 index 00000000..d89770db --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/Insignia.cs @@ -0,0 +1,120 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Text; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + +#if false + /// + /// An MSBuild task to run the WiX transform generator. + /// + public sealed class Insignia : WixToolTask + { + private const string InsigniaToolName = "insignia.exe"; + + /// + /// Gets or sets the path to the database to inscribe. + /// + public ITaskItem DatabaseFile { get; set; } + + /// + /// Gets or sets the path to the bundle to inscribe. + /// + public ITaskItem BundleFile { get; set; } + + /// + /// Gets or sets the path to the original bundle that contains the attached container. + /// + public ITaskItem OriginalBundleFile { get; set; } + + /// + /// Gets or sets the path to output the inscribed result. + /// + [Required] + public ITaskItem OutputFile { get; set; } + + /// + /// Gets or sets the output. Only set if insignia does work. + /// + [Output] + public ITaskItem Output { get; set; } + + /// + /// Get the name of the executable. + /// + /// The ToolName is used with the ToolPath to get the location of Insignia.exe. + /// The name of the executable. + protected override string ToolName + { + get { return InsigniaToolName; } + } + + /// + /// Get the path to the executable. + /// + /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). + /// The full path to the executable or simply Insignia.exe if it's expected to be in the system path. + protected override string GenerateFullPathToTool() + { + // If there's not a ToolPath specified, it has to be in the system path. + if (String.IsNullOrEmpty(this.ToolPath)) + { + return InsigniaToolName; + } + + return Path.Combine(Path.GetFullPath(this.ToolPath), InsigniaToolName); + } + + /// + /// Builds a command line from options in this task. + /// + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendSwitchIfNotNull("-im ", this.DatabaseFile); + if (null != this.OriginalBundleFile) + { + commandLineBuilder.AppendSwitchIfNotNull("-ab ", this.BundleFile); + commandLineBuilder.AppendFileNameIfNotNull(this.OriginalBundleFile); + } + else + { + commandLineBuilder.AppendSwitchIfNotNull("-ib ", this.BundleFile); + } + + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); + } + + /// + /// Executes a tool in-process by loading the tool assembly and invoking its entrypoint. + /// + /// Path to the tool to be executed; must be a managed executable. + /// Commands to be written to a response file. + /// Commands to be passed directly on the command-line. + /// The tool exit code. + protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) + { + int returnCode = base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); + if (0 == returnCode) // successfully did work. + { + this.Output = this.OutputFile; + } + else if (-1 == returnCode) // no work done. + { + returnCode = 0; + } + + return returnCode; + } + } +#endif +} diff --git a/src/wix/WixToolset.BuildTasks/MsbuildMessageListener.cs b/src/wix/WixToolset.BuildTasks/MsbuildMessageListener.cs new file mode 100644 index 00000000..f186d721 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/MsbuildMessageListener.cs @@ -0,0 +1,68 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#if !NETCOREAPP +namespace WixToolset.BuildTasks +{ + using System; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + public sealed class MsbuildMessageListener : IMessageListener + { + public MsbuildMessageListener(TaskLoggingHelper logger, string shortName, string longName) + { + this.Logger = logger; + this.ShortAppName = shortName; + this.LongAppName = longName; + } + + public string ShortAppName { get; } + + public string LongAppName { get; } + + private TaskLoggingHelper Logger { get; } + + public void Write(Message message) + { + var code = this.ShortAppName + message.Id.ToString(); + var file = message.SourceLineNumbers?.FileName ?? this.LongAppName; + var lineNumber = message.SourceLineNumbers?.LineNumber ?? 0; + switch (message.Level) + { + case MessageLevel.Error: + this.Logger.LogError(null, code, null, file, lineNumber, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); + break; + + case MessageLevel.Verbose: + this.Logger.LogMessage(null, code, null, file, lineNumber, 0, 0, 0, MessageImportance.Low, message.ResourceNameOrFormat, message.MessageArgs); + break; + + case MessageLevel.Warning: + this.Logger.LogWarning(null, code, null, file, lineNumber, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); + break; + + default: + if (message.Id > 0) + { + this.Logger.LogMessage(null, code, null, file, lineNumber, 0, 0, 0, MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs); + } + else + { + this.Logger.LogMessage(MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs); + } + break; + } + } + + public void Write(string message) + { + this.Logger.LogMessage(MessageImportance.Low, message); + } + + public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; + } +} +#endif diff --git a/src/wix/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs b/src/wix/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs new file mode 100644 index 00000000..7663e6df --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/RefreshBundleGeneratedFile.cs @@ -0,0 +1,128 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Globalization; + using System.IO; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task refreshes the generated file for bundle projects. + /// + public class RefreshBundleGeneratedFile : Task + { + private ITaskItem[] generatedFiles; + private ITaskItem[] projectReferencePaths; + + /// + /// The list of files to generate. + /// + [Required] + public ITaskItem[] GeneratedFiles + { + get { return this.generatedFiles; } + set { this.generatedFiles = value; } + } + + /// + /// All the project references in the project. + /// + [Required] + public ITaskItem[] ProjectReferencePaths + { + get { return this.projectReferencePaths; } + set { this.projectReferencePaths = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + ArrayList payloadGroupRefs = new ArrayList(); + ArrayList packageGroupRefs = new ArrayList(); + for (int i = 0; i < this.ProjectReferencePaths.Length; i++) + { + ITaskItem item = this.ProjectReferencePaths[i]; + + if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) + { + continue; + } + + string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); + string projectName = Path.GetFileNameWithoutExtension(projectPath); + string referenceName = ToolsCommon.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); + + string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); + foreach (string pog in pogs) + { + if (!String.IsNullOrEmpty(pog)) + { + // TODO: Add payload group references and package group references once heat is generating them + ////payloadGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); + packageGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); + } + } + } + + XmlDocument doc = new XmlDocument(); + + XmlProcessingInstruction head = doc.CreateProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); + doc.AppendChild(head); + + XmlElement rootElement = doc.CreateElement("Wix"); + rootElement.SetAttribute("xmlns", "http://wixtoolset.org/schemas/v4/wxs"); + doc.AppendChild(rootElement); + + XmlElement fragment = doc.CreateElement("Fragment"); + rootElement.AppendChild(fragment); + + XmlElement payloadGroup = doc.CreateElement("PayloadGroup"); + payloadGroup.SetAttribute("Id", "Bundle.Generated.Payloads"); + fragment.AppendChild(payloadGroup); + + XmlElement packageGroup = doc.CreateElement("PackageGroup"); + packageGroup.SetAttribute("Id", "Bundle.Generated.Packages"); + fragment.AppendChild(packageGroup); + + foreach (string payloadGroupRef in payloadGroupRefs) + { + XmlElement payloadGroupRefElement = doc.CreateElement("PayloadGroupRef"); + payloadGroupRefElement.SetAttribute("Id", payloadGroupRef); + payloadGroup.AppendChild(payloadGroupRefElement); + } + + foreach (string packageGroupRef in packageGroupRefs) + { + XmlElement packageGroupRefElement = doc.CreateElement("PackageGroupRef"); + packageGroupRefElement.SetAttribute("Id", packageGroupRef); + packageGroup.AppendChild(packageGroupRefElement); + } + + foreach (ITaskItem item in this.GeneratedFiles) + { + string fullPath = item.GetMetadata("FullPath"); + + payloadGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath) + ".Payloads"); + packageGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath) + ".Packages"); + try + { + doc.Save(fullPath); + } + catch (Exception e) + { + // e.Message will be something like: "Access to the path 'fullPath' is denied." + this.Log.LogMessage(MessageImportance.High, "Unable to save generated file to '{0}'. {1}", fullPath, e.Message); + } + } + + return true; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/RefreshGeneratedFile.cs b/src/wix/WixToolset.BuildTasks/RefreshGeneratedFile.cs new file mode 100644 index 00000000..c57e3f0f --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/RefreshGeneratedFile.cs @@ -0,0 +1,114 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections; + using System.Globalization; + using System.IO; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task refreshes the generated file that contains ComponentGroupRefs + /// to harvested output. + /// + public class RefreshGeneratedFile : Task + { + private ITaskItem[] generatedFiles; + private ITaskItem[] projectReferencePaths; + + /// + /// The list of files to generate. + /// + [Required] + public ITaskItem[] GeneratedFiles + { + get { return this.generatedFiles; } + set { this.generatedFiles = value; } + } + + /// + /// All the project references in the project. + /// + [Required] + public ITaskItem[] ProjectReferencePaths + { + get { return this.projectReferencePaths; } + set { this.projectReferencePaths = value; } + } + + /// + /// Gets a complete list of external cabs referenced by the given installer database file. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + ArrayList componentGroupRefs = new ArrayList(); + for (int i = 0; i < this.ProjectReferencePaths.Length; i++) + { + ITaskItem item = this.ProjectReferencePaths[i]; + + if (!String.IsNullOrEmpty(item.GetMetadata(ToolsCommon.DoNotHarvest))) + { + continue; + } + + string projectPath = CreateProjectReferenceDefineConstants.GetProjectPath(this.ProjectReferencePaths, i); + string projectName = Path.GetFileNameWithoutExtension(projectPath); + string referenceName = ToolsCommon.GetIdentifierFromName(CreateProjectReferenceDefineConstants.GetReferenceName(item, projectName)); + + string[] pogs = item.GetMetadata("RefProjectOutputGroups").Split(';'); + foreach (string pog in pogs) + { + if (!String.IsNullOrEmpty(pog)) + { + componentGroupRefs.Add(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", referenceName, pog)); + } + } + } + + XmlDocument doc = new XmlDocument(); + + XmlProcessingInstruction head = doc.CreateProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); + doc.AppendChild(head); + + XmlElement rootElement = doc.CreateElement("Wix"); + rootElement.SetAttribute("xmlns", "http://wixtoolset.org/schemas/v4/wxs"); + doc.AppendChild(rootElement); + + XmlElement fragment = doc.CreateElement("Fragment"); + rootElement.AppendChild(fragment); + + XmlElement componentGroup = doc.CreateElement("ComponentGroup"); + componentGroup.SetAttribute("Id", "Product.Generated"); + fragment.AppendChild(componentGroup); + + foreach (string componentGroupRef in componentGroupRefs) + { + XmlElement componentGroupRefElement = doc.CreateElement("ComponentGroupRef"); + componentGroupRefElement.SetAttribute("Id", componentGroupRef); + componentGroup.AppendChild(componentGroupRefElement); + } + + foreach (ITaskItem item in this.GeneratedFiles) + { + string fullPath = item.GetMetadata("FullPath"); + + componentGroup.SetAttribute("Id", Path.GetFileNameWithoutExtension(fullPath)); + try + { + doc.Save(fullPath); + } + catch (Exception e) + { + // e.Message will be something like: "Access to the path 'fullPath' is denied." + this.Log.LogMessage(MessageImportance.High, "Unable to save generated file to '{0}'. {1}", fullPath, e.Message); + } + } + + return true; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/ResolveWixReferences.cs b/src/wix/WixToolset.BuildTasks/ResolveWixReferences.cs new file mode 100644 index 00000000..9b8cfe6f --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/ResolveWixReferences.cs @@ -0,0 +1,212 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using Microsoft.Build.Utilities; + using Microsoft.Build.Framework; + using System.IO; + + /// + /// This task searches for paths to references using the order specified in SearchPaths. + /// + public class ResolveWixReferences : Task + { + /// + /// Token value used in SearchPaths to indicate that the item's HintPath metadata should + /// be searched as a full file path to resolve the reference. + /// Must match wix.targets, case sensitive. + /// + private const string HintPathToken = "{HintPathFromItem}"; + + /// + /// Token value used in SearchPaths to indicate that the item's Identity should + /// be searched as a full file path to resolve the reference. + /// Must match wix.targets, case sensitive. + /// + private const string RawFileNameToken = "{RawFileName}"; + + /// + /// The list of references to resolve. + /// + [Required] + public ITaskItem[] WixReferences + { + get; + set; + } + + /// + /// The directories or special locations that are searched to find the files + /// on disk that represent the references. The order in which the search paths are listed + /// is important. For each reference, the list of paths is searched from left to right. + /// When a file that represents the reference is found, that search stops and the search + /// for the next reference starts. + /// + /// This parameter accepts the following types of values: + /// A directory path. + /// {HintPathFromItem}: Specifies that the task will examine the HintPath metadata + /// of the base item. + /// TODO : {CandidateAssemblyFiles}: Specifies that the task will examine the files + /// passed in through the CandidateAssemblyFiles parameter. + /// TODO : {Registry:_AssemblyFoldersBase_, _RuntimeVersion_, _AssemblyFoldersSuffix_}: + /// TODO : {AssemblyFolders}: Specifies the task will use the Visual Studio.NET 2003 + /// finding-assemblies-from-registry scheme. + /// TODO : {GAC}: Specifies the task will search in the GAC. + /// {RawFileName}: Specifies the task will consider the Include value of the item to be + /// an exact path and file name. + /// + public string[] SearchPaths + { + get; + set; + } + + /// + /// The filename extension(s) to be checked when searching. + /// + public string[] SearchFilenameExtensions + { + get; + set; + } + + /// + /// Output items that contain the same metadata as input references and have been resolved to full paths. + /// + [Output] + public ITaskItem[] ResolvedWixReferences + { + get; + private set; + } + + /// + /// Resolves reference paths by searching for referenced items using the specified SearchPaths. + /// + /// True on success, or throws an exception on failure. + public override bool Execute() + { + List resolvedReferences = new List(); + + foreach (ITaskItem reference in this.WixReferences) + { + ITaskItem resolvedReference = ResolveWixReferences.ResolveReference(reference, this.SearchPaths, this.SearchFilenameExtensions, this.Log); + + this.Log.LogMessage(MessageImportance.Low, "Resolved path {0}", resolvedReference.ItemSpec); + resolvedReferences.Add(resolvedReference); + } + + this.ResolvedWixReferences = resolvedReferences.ToArray(); + return true; + } + + /// + /// Resolves a single reference item by searcheing for referenced items using the specified SearchPaths. + /// This method is made public so the resolution logic can be reused by other tasks. + /// + /// The referenced item. + /// The paths to search. + /// Filename extensions to check. + /// Logging helper. + /// The resolved reference item, or the original reference if it could not be resolved. + public static ITaskItem ResolveReference(ITaskItem reference, string[] searchPaths, string[] searchFilenameExtensions, TaskLoggingHelper log) + { + if (reference == null) + { + throw new ArgumentNullException("reference"); + } + + if (searchPaths == null) + { + // Nothing to search, so just return the original reference item. + return reference; + } + + if (searchFilenameExtensions == null) + { + searchFilenameExtensions = new string[] { }; + } + + // Copy all the metadata from the source + TaskItem resolvedReference = new TaskItem(reference); + log.LogMessage(MessageImportance.Low, "WixReference: {0}", reference.ItemSpec); + + // Now find the resolved path based on our order of precedence + foreach (string searchPath in searchPaths) + { + log.LogMessage(MessageImportance.Low, "Trying {0}", searchPath); + if (searchPath.Equals(HintPathToken, StringComparison.Ordinal)) + { + string path = reference.GetMetadata("HintPath"); + log.LogMessage(MessageImportance.Low, "Trying path {0}", path); + if (File.Exists(path)) + { + resolvedReference.ItemSpec = path; + break; + } + } + else if (searchPath.Equals(RawFileNameToken, StringComparison.Ordinal)) + { + log.LogMessage(MessageImportance.Low, "Trying path {0}", resolvedReference.ItemSpec); + if (File.Exists(resolvedReference.ItemSpec)) + { + break; + } + + if (ResolveWixReferences.ResolveFilenameExtensions(resolvedReference, + resolvedReference.ItemSpec, searchFilenameExtensions, log)) + { + break; + } + } + else + { + string path = Path.Combine(searchPath, Path.GetFileName(reference.ItemSpec)); + log.LogMessage(MessageImportance.Low, "Trying path {0}", path); + if (File.Exists(path)) + { + resolvedReference.ItemSpec = path; + break; + } + + if (ResolveWixReferences.ResolveFilenameExtensions(resolvedReference, + path, searchFilenameExtensions, log)) + { + break; + } + } + } + + // Normalize the item path + resolvedReference.ItemSpec = resolvedReference.GetMetadata("FullPath"); + + return resolvedReference; + } + + /// + /// Helper method for checking filename extensions when resolving references. + /// + /// The reference being resolved. + /// Full filename path without extension. + /// Filename extensions to check. + /// Logging helper. + /// True if the item was resolved, else false. + private static bool ResolveFilenameExtensions(ITaskItem reference, string basePath, string[] filenameExtensions, TaskLoggingHelper log) + { + foreach (string filenameExtension in filenameExtensions) + { + string path = basePath + filenameExtension; + log.LogMessage(MessageImportance.Low, "Trying path {0}", path); + if (File.Exists(path)) + { + reference.ItemSpec = path; + return true; + } + } + + return false; + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/ToolsetTask.cs b/src/wix/WixToolset.BuildTasks/ToolsetTask.cs new file mode 100644 index 00000000..d48f2a20 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/ToolsetTask.cs @@ -0,0 +1,153 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.IO; + using System.Runtime.InteropServices; + using Microsoft.Build.Utilities; + + public abstract partial class ToolsetTask : ToolTask + { + private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; + + /// + /// Gets or sets additional options that are appended the the tool command-line. + /// + /// + /// This allows the task to support extended options in the tool which are not + /// explicitly implemented as properties on the task. + /// + public string AdditionalOptions { get; set; } + + /// + /// Gets or sets whether to display the logo. + /// + public bool NoLogo { get; set; } + + /// + /// Gets or sets a flag indicating whether the task + /// should be run as separate process or in-proc. + /// + public virtual bool RunAsSeparateProcess { get; set; } + + /// + /// Gets or sets whether all warnings should be suppressed. + /// + public bool SuppressAllWarnings { get; set; } + + /// + /// Gets or sets a list of specific warnings to be suppressed. + /// + public string[] SuppressSpecificWarnings { get; set; } + + /// + /// Gets or sets whether all warnings should be treated as errors. + /// + public bool TreatWarningsAsErrors { get; set; } + + /// + /// Gets or sets a list of specific warnings to treat as errors. + /// + public string[] TreatSpecificWarningsAsErrors { get; set; } + + /// + /// Gets or sets whether to display verbose output. + /// + public bool VerboseOutput { get; set; } + + private string DefaultToolFullPath => Path.Combine(Path.GetDirectoryName(ThisDllPath), this.ToolExe); + + private string ToolFullPath + { + get + { + if (String.IsNullOrEmpty(this.ToolPath)) + { + return this.DefaultToolFullPath; + } + return Path.Combine(this.ToolPath, this.ToolExe); + } + } + + /// + /// Get the path to the executable. + /// + /// + /// ToolTask only calls GenerateFullPathToTool when the ToolPath property is not set. + /// WiX never sets the ToolPath property, but the user can through $(WixToolDir). + /// If we return only a file name, ToolTask will search the system paths for it. + /// + protected sealed override string GenerateFullPathToTool() + { +#if !NETCOREAPP + if (!this.RunAsSeparateProcess) + { + // We need to return a path that exists, so if we're not actually going to run the tool then just return this dll path. + return ThisDllPath; + } + return this.DefaultToolFullPath; +#else + if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath)) + { + return toolFullPath; + } + return DotnetFullPath; +#endif + } + + protected sealed override string GenerateResponseFileCommands() + { + var commandLineBuilder = new WixCommandLineBuilder(); + this.BuildCommandLine(commandLineBuilder); + return commandLineBuilder.ToString(); + } + + /// + /// Builds a command line from options in this and derivative tasks. + /// + /// + /// Derivative classes should call BuildCommandLine() on the base class to ensure that common command line options are added to the command. + /// + protected virtual void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendIfTrue("-nologo", this.NoLogo); + commandLineBuilder.AppendArrayIfNotNull("-sw", this.SuppressSpecificWarnings); + commandLineBuilder.AppendIfTrue("-sw", this.SuppressAllWarnings); + commandLineBuilder.AppendIfTrue("-v", this.VerboseOutput); + commandLineBuilder.AppendArrayIfNotNull("-wx", this.TreatSpecificWarningsAsErrors); + commandLineBuilder.AppendIfTrue("-wx", this.TreatWarningsAsErrors); + } + +#if NETCOREAPP + private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet"; + + protected override string GenerateCommandLineCommands() + { + if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath)) + { + return null; + } + else + { + return $"exec \"{toolFullPath}\""; + } + } + + private static bool IsSelfExecutable(string proposedToolFullPath, out string toolFullPath) + { + var toolFullPathWithoutExtension = Path.Combine(Path.GetDirectoryName(proposedToolFullPath), Path.GetFileNameWithoutExtension(proposedToolFullPath)); + var exeExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : String.Empty; + var exeToolFullPath = $"{toolFullPathWithoutExtension}{exeExtension}"; + if (File.Exists(exeToolFullPath)) + { + toolFullPath = exeToolFullPath; + return true; + } + + toolFullPath = $"{toolFullPathWithoutExtension}.dll"; + return false; + } +#endif + } +} diff --git a/src/wix/WixToolset.BuildTasks/ToolsetTask_InProc.cs b/src/wix/WixToolset.BuildTasks/ToolsetTask_InProc.cs new file mode 100644 index 00000000..fcf4aea9 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/ToolsetTask_InProc.cs @@ -0,0 +1,79 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#if !NETCOREAPP +namespace WixToolset.BuildTasks +{ + using System; + using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Build.Framework; + using WixToolset.Core; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + public partial class ToolsetTask + { + protected sealed override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) + { + if (this.RunAsSeparateProcess) + { + return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); + } + + return this.ExecuteInProc($"{commandLineCommands} {responseFileCommands}"); + } + + private int ExecuteInProc(string commandLineString) + { + this.Log.LogMessage(MessageImportance.Normal, $"({this.ToolName}){commandLineString}"); + + var listener = new MsbuildMessageListener(this.Log, this.TaskShortName, this.BuildEngine.ProjectFileOfTaskNode); + var exitCode = -1; + + try + { + var coreProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + + var messaging = coreProvider.GetService(); + messaging.SetListener(listener); + + exitCode = this.ExecuteCoreAsync(coreProvider, commandLineString, CancellationToken.None).GetAwaiter().GetResult(); + } + catch (WixException e) + { + listener.Write(e.Error); + } + catch (Exception e) + { + this.Log.LogErrorFromException(e, showStackTrace: true, showDetail: true, null); + + if (e is NullReferenceException || e is SEHException) + { + throw; + } + } + + if (exitCode == 0 && this.Log.HasLoggedErrors) + { + exitCode = -1; + } + return exitCode; + } + + protected sealed override void LogToolCommand(string message) + { + // Only log this if we're actually going to do it. + if (this.RunAsSeparateProcess) + { + base.LogToolCommand(message); + } + } + + protected abstract Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken); + + protected abstract string TaskShortName { get; } + } +} +#endif diff --git a/src/wix/WixToolset.BuildTasks/WixAssignCulture.cs b/src/wix/WixToolset.BuildTasks/WixAssignCulture.cs new file mode 100644 index 00000000..a8baa62f --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/WixAssignCulture.cs @@ -0,0 +1,229 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.IO; + using System.Xml; + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// This task assigns Culture metadata to files based on the value of the Culture attribute on the + /// WixLocalization element inside the file. + /// + public class WixAssignCulture : Task + { + private const string CultureAttributeName = "Culture"; + private const string OutputFolderMetadataName = "OutputFolder"; + private const string InvariantCultureIdentifier = "neutral"; + private const string NullCultureIdentifier = "null"; + + /// + /// The list of cultures to build. Cultures are specified in the following form: + /// primary culture,first fallback culture, second fallback culture;... + /// Culture groups are seperated by semi-colons + /// Culture precedence within a culture group is evaluated from left to right where fallback cultures are + /// separated with commas. + /// The first (primary) culture in a culture group will be used as the output sub-folder. + /// + public string Cultures { get; set; } + + /// + /// The list of files to apply culture information to. + /// + [Required] + public ITaskItem[] Files + { + get; + set; + } + + /// + /// The files that had culture information applied + /// + [Output] + public ITaskItem[] CultureGroups + { + get; + private set; + } + + /// + /// Applies culture information to the files specified by the Files property. + /// This task intentionally does not validate that strings are valid Cultures so that we can support + /// psuedo-loc. + /// + /// True upon completion of the task execution. + public override bool Execute() + { + // First, process the culture group list the user specified in the cultures property + List cultureGroups = new List(); + + if (!String.IsNullOrEmpty(this.Cultures)) + { + // Get rid of extra quotes + this.Cultures = this.Cultures.Trim('\"'); + + foreach (string cultureGroupString in this.Cultures.Split(';')) + { + if (0 == cultureGroupString.Length) + { + // MSBuild v2.0.50727 cannnot handle "" items + // for the invariant culture we require the neutral keyword + continue; + } + CultureGroup cultureGroup = new CultureGroup(cultureGroupString); + cultureGroups.Add(cultureGroup); + } + } + else + { + // Only process the EmbeddedResource items if cultures was unspecified + foreach (ITaskItem file in this.Files) + { + // Ignore non-wxls + if (!String.Equals(file.GetMetadata("Extension"), ".wxl", StringComparison.OrdinalIgnoreCase)) + { + Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}. The file type is not supported.", file.ItemSpec); + return false; + } + XmlDocument wxlFile = new XmlDocument(); + + try + { + wxlFile.Load(file.ItemSpec); + } + catch (FileNotFoundException) + { + Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}. The file was not found.", file.ItemSpec); + return false; + } + catch (Exception e) + { + Log.LogError("Unable to retrieve the culture for EmbeddedResource {0}: {1}", file.ItemSpec, e.Message); + return false; + } + + // Take the culture value and try using it to create a culture. + XmlAttribute cultureAttr = wxlFile.DocumentElement.Attributes[WixAssignCulture.CultureAttributeName]; + string wxlCulture = null == cultureAttr ? String.Empty : cultureAttr.Value; + if (0 == wxlCulture.Length) + { + // We use a keyword for the invariant culture because MSBuild v2.0.50727 cannnot handle "" items + wxlCulture = InvariantCultureIdentifier; + } + + // We found the culture for the WXL, we now need to determine if it maps to a culture group specified + // in the Cultures property or if we need to create a new one. + Log.LogMessage(MessageImportance.Low, "Culture \"{0}\" from EmbeddedResource {1}.", wxlCulture, file.ItemSpec); + + bool cultureGroupExists = false; + foreach (CultureGroup cultureGroup in cultureGroups) + { + foreach (string culture in cultureGroup.Cultures) + { + if (String.Equals(wxlCulture, culture, StringComparison.OrdinalIgnoreCase)) + { + cultureGroupExists = true; + break; + } + } + } + + // The WXL didn't match a culture group we already have so create a new one. + if (!cultureGroupExists) + { + cultureGroups.Add(new CultureGroup(wxlCulture)); + } + } + } + + // If we didn't create any culture groups the culture was unspecificed and no WXLs were included + // Build an unlocalized target in the output folder + if (cultureGroups.Count == 0) + { + cultureGroups.Add(new CultureGroup()); + } + + List cultureGroupItems = new List(); + + if (1 == cultureGroups.Count && 0 == this.Files.Length) + { + // Maintain old behavior, if only one culturegroup is specified and no WXL, output to the default folder + TaskItem cultureGroupItem = new TaskItem(cultureGroups[0].ToString()); + cultureGroupItem.SetMetadata(OutputFolderMetadataName, CultureGroup.DefaultFolder); + cultureGroupItems.Add(cultureGroupItem); + } + else + { + foreach (CultureGroup cultureGroup in cultureGroups) + { + TaskItem cultureGroupItem = new TaskItem(cultureGroup.ToString()); + cultureGroupItem.SetMetadata(OutputFolderMetadataName, cultureGroup.OutputFolder); + cultureGroupItems.Add(cultureGroupItem); + Log.LogMessage("Culture: {0}", cultureGroup.ToString()); + } + } + + this.CultureGroups = cultureGroupItems.ToArray(); + return true; + } + + private class CultureGroup + { + /// + /// TargetPath already has a '\', do not double it! + /// + public const string DefaultFolder = ""; + + /// + /// Initialize a null culture group + /// + public CultureGroup() + { + } + + public CultureGroup(string cultureGroupString) + { + Debug.Assert(!String.IsNullOrEmpty(cultureGroupString)); + foreach (string cultureString in cultureGroupString.Split(',')) + { + this.Cultures.Add(cultureString); + } + } + + public List Cultures { get; } = new List(); + + public string OutputFolder + { + get + { + string result = DefaultFolder; + if (this.Cultures.Count > 0 && + !this.Cultures[0].Equals(InvariantCultureIdentifier, StringComparison.OrdinalIgnoreCase)) + { + result = this.Cultures[0] + "\\"; + } + + return result; + } + } + + public override string ToString() + { + if (this.Cultures.Count > 0) + { + return String.Join(";", this.Cultures); + } + + // We use a keyword for a null culture because MSBuild cannnot handle "" items + // Null is different from neutral. For neutral we still want to do WXL + // filtering in Light. + return NullCultureIdentifier; + } + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/WixBuild.cs b/src/wix/WixToolset.BuildTasks/WixBuild.cs new file mode 100644 index 00000000..dbff7e81 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/WixBuild.cs @@ -0,0 +1,135 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using Microsoft.Build.Framework; + + /// + /// An MSBuild task to run the WiX compiler. + /// + public sealed partial class WixBuild : ToolsetTask + { + public string[] Cultures { get; set; } + + public string[] DefineConstants { get; set; } + + public ITaskItem[] Extensions { get; set; } + + public string ExtensionDirectory { get; set; } + + public string[] IncludeSearchPaths { get; set; } + + public string InstallerPlatform { get; set; } + + [Required] + public ITaskItem IntermediateDirectory { get; set; } + + public ITaskItem[] LocalizationFiles { get; set; } + + public ITaskItem[] LibraryFiles { get; set; } + + [Output] + [Required] + public ITaskItem OutputFile { get; set; } + + public string OutputType { get; set; } + + public ITaskItem PdbFile { get; set; } + + public string PdbType { get; set; } + + public bool Pedantic { get; set; } + + [Required] + public ITaskItem[] SourceFiles { get; set; } + + public string[] ReferencePaths { get; set; } + + + public ITaskItem[] BindInputPaths { get; set; } + + public bool BindFiles { get; set; } + + public ITaskItem BindContentsFile { get; set; } + + public ITaskItem BindOutputsFile { get; set; } + + public ITaskItem BindBuiltOutputsFile { get; set; } + + public string CabinetCachePath { get; set; } + + public int CabinetCreationThreadCount { get; set; } + + public string DefaultCompressionLevel { get; set; } + + [Output] + public ITaskItem UnreferencedSymbolsFile { get; set; } + + public ITaskItem WixProjectFile { get; set; } + public string[] WixVariables { get; set; } + + public bool SuppressValidation { get; set; } + + public string[] SuppressIces { get; set; } + + public string AdditionalCub { get; set; } + + protected override string ToolName => "wix.exe"; + + protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) + { + commandLineBuilder.AppendTextUnquoted("build"); + + commandLineBuilder.AppendSwitchIfNotNull("-platform ", this.InstallerPlatform); + commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); + commandLineBuilder.AppendSwitchIfNotNull("-outputType ", this.OutputType); + commandLineBuilder.AppendSwitchIfNotNull("-pdb ", this.PdbFile); + commandLineBuilder.AppendSwitchIfNotNull("-pdbType ", this.PdbType); + commandLineBuilder.AppendArrayIfNotNull("-culture ", this.Cultures); + commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); + commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); + commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); + commandLineBuilder.AppendIfTrue("-sval", this.SuppressValidation); + commandLineBuilder.AppendArrayIfNotNull("-sice ", this.SuppressIces); + commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); + commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); + commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); + commandLineBuilder.AppendSwitchIfNotNull("-contentsfile ", this.BindContentsFile); + commandLineBuilder.AppendSwitchIfNotNull("-outputsfile ", this.BindOutputsFile); + commandLineBuilder.AppendSwitchIfNotNull("-builtoutputsfile ", this.BindBuiltOutputsFile); + commandLineBuilder.AppendSwitchIfNotNull("-defaultcompressionlevel ", this.DefaultCompressionLevel); + + base.BuildCommandLine(commandLineBuilder); + + commandLineBuilder.AppendIfTrue("-bindFiles", this.BindFiles); + commandLineBuilder.AppendArrayIfNotNull("-bindPath ", this.CalculateBindPathStrings()); + commandLineBuilder.AppendArrayIfNotNull("-loc ", this.LocalizationFiles); + commandLineBuilder.AppendArrayIfNotNull("-lib ", this.LibraryFiles); + commandLineBuilder.AppendTextIfNotWhitespace(this.AdditionalOptions); + commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); + } + + private IEnumerable CalculateBindPathStrings() + { + if (null != this.BindInputPaths) + { + foreach (var item in this.BindInputPaths) + { + var path = item.GetMetadata("FullPath"); + + var bindName = item.GetMetadata("BindName"); + if (!String.IsNullOrEmpty(bindName)) + { + yield return String.Concat(bindName, "=", path); + } + else + { + yield return path; + } + } + } + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/WixBuild_InProc.cs b/src/wix/WixToolset.BuildTasks/WixBuild_InProc.cs new file mode 100644 index 00000000..9cba0f62 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/WixBuild_InProc.cs @@ -0,0 +1,28 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +#if !NETCOREAPP +namespace WixToolset.BuildTasks +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Core.Burn; + using WixToolset.Core.WindowsInstaller; + using WixToolset.Extensibility.Services; + + public partial class WixBuild + { + protected override string TaskShortName => "WIX"; + + protected override Task ExecuteCoreAsync(IWixToolsetCoreServiceProvider coreProvider, string commandLineString, CancellationToken cancellationToken) + { + coreProvider.AddWindowsInstallerBackend() + .AddBundleBackend(); + + var commandLine = coreProvider.GetService(); + var command = commandLine.CreateCommand(commandLineString); + return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); + } + } +} +#endif diff --git a/src/wix/WixToolset.BuildTasks/WixCommandLineBuilder.cs b/src/wix/WixToolset.BuildTasks/WixCommandLineBuilder.cs new file mode 100644 index 00000000..a979dbb0 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/WixCommandLineBuilder.cs @@ -0,0 +1,177 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.BuildTasks +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + + using Microsoft.Build.Framework; + using Microsoft.Build.Utilities; + + /// + /// Helper class for appending the command line arguments. + /// + public class WixCommandLineBuilder : CommandLineBuilder + { + internal const int Unspecified = -1; + + /// + /// Append a switch to the command line if the value has been specified. + /// + /// Switch to append. + /// Value specified by the user. + public void AppendIfSpecified(string switchName, int value) + { + if (value != Unspecified) + { + this.AppendSwitchIfNotNull(switchName, value.ToString(CultureInfo.InvariantCulture)); + } + } + + /// + /// Append a switch to the command line if the condition is true. + /// + /// Switch to append. + /// Condition specified by the user. + public void AppendIfTrue(string switchName, bool condition) + { + if (condition) + { + this.AppendSwitch(switchName); + } + } + + /// + /// Append a switch to the command line if any values in the array have been specified. + /// + /// Switch to append. + /// Values specified by the user. + public void AppendArrayIfNotNull(string switchName, IEnumerable values) + { + if (values != null) + { + foreach (ITaskItem value in values) + { + this.AppendSwitchIfNotNull(switchName, value); + } + } + } + + /// + /// Append a switch to the command line if any values in the array have been specified. + /// + /// Switch to append. + /// Values specified by the user. + public void AppendArrayIfNotNull(string switchName, IEnumerable values) + { + if (values != null) + { + foreach (string value in values) + { + this.AppendSwitchIfNotNull(switchName, value); + } + } + } + + /// + /// Build the extensions argument. Each extension is searched in the current folder, user defined search + /// directories (ReferencePath), HintPath, and under Wix Extension Directory in that order. + /// The order of precedence is based off of that described in Microsoft.Common.Targets's SearchPaths + /// property for the ResolveAssemblyReferences task. + /// + /// The list of extensions to include. + /// Evaluated default folder for Wix Extensions + /// User defined reference directories to search in + public void AppendExtensions(ITaskItem[] extensions, string wixExtensionDirectory, string [] referencePaths) + { + if (extensions == null) + { + return; + } + + foreach (ITaskItem extension in extensions) + { + string className = extension.GetMetadata("Class"); + + string fileName = Path.GetFileName(extension.ItemSpec); + + if (String.IsNullOrEmpty(Path.GetExtension(fileName))) + { + fileName += ".dll"; + } + + // First try reference paths + var resolvedPath = FileSearchHelperMethods.SearchFilePaths(referencePaths, fileName); + + if (String.IsNullOrEmpty(resolvedPath)) + { + // Now try HintPath + resolvedPath = extension.GetMetadata("HintPath"); + + if (!File.Exists(resolvedPath)) + { + // Now try the item itself + resolvedPath = extension.ItemSpec; + + if (String.IsNullOrEmpty(Path.GetExtension(resolvedPath))) + { + resolvedPath += ".dll"; + } + + if (!File.Exists(resolvedPath)) + { + if (!String.IsNullOrEmpty(wixExtensionDirectory)) + { + // Now try the extension directory + resolvedPath = Path.Combine(wixExtensionDirectory, Path.GetFileName(resolvedPath)); + } + + if (!File.Exists(resolvedPath)) + { + // Extension wasn't found, just set it to the extension name passed in + resolvedPath = extension.ItemSpec; + } + } + } + } + + if (String.IsNullOrEmpty(className)) + { + this.AppendSwitchIfNotNull("-ext ", resolvedPath); + } + else + { + this.AppendSwitchIfNotNull("-ext ", className + ", " + resolvedPath); + } + } + } + + /// + /// Append arbitrary text to the command-line if specified. + /// + /// Text to append. + public void AppendTextIfNotNull(string textToAppend) + { + if (!String.IsNullOrEmpty(textToAppend)) + { + this.AppendSpaceIfNotEmpty(); + this.AppendTextUnquoted(textToAppend); + } + } + + /// + /// Append arbitrary text to the command-line if specified. + /// + /// Text to append. + public void AppendTextIfNotWhitespace(string textToAppend) + { + if (!String.IsNullOrWhiteSpace(textToAppend)) + { + this.AppendSpaceIfNotEmpty(); + this.AppendTextUnquoted(textToAppend); + } + } + } +} diff --git a/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj new file mode 100644 index 00000000..3a1c7f4c --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.csproj @@ -0,0 +1,39 @@ + + + + + + netcoreapp3.1;net461 + + WiX Toolset MSBuild Tasks + embedded + true + win-x86 + + AnyCPU + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.net461.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/WixToolset.BuildTasks/WixToolset.BuildTasks.netcoreapp2.1.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/WixToolset.Sdk/Sdk/Sdk.props b/src/wix/WixToolset.Sdk/Sdk/Sdk.props new file mode 100644 index 00000000..c517a1cf --- /dev/null +++ b/src/wix/WixToolset.Sdk/Sdk/Sdk.props @@ -0,0 +1,23 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) + + + + .NETFramework,Version=v4.8 + true + true + true + + + + + + + diff --git a/src/wix/WixToolset.Sdk/Sdk/Sdk.targets b/src/wix/WixToolset.Sdk/Sdk/Sdk.targets new file mode 100644 index 00000000..e21cf5c6 --- /dev/null +++ b/src/wix/WixToolset.Sdk/Sdk/Sdk.targets @@ -0,0 +1,15 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + $(DefaultItemExcludes);$(BaseOutputPath)** + $(DefaultItemExcludes);$(BaseIntermediateOutputPath)** + $(DefaultItemExcludesInProjectFolder);**/.*/** + + diff --git a/src/wix/WixToolset.Sdk/WixToolset.Sdk.csproj b/src/wix/WixToolset.Sdk/WixToolset.Sdk.csproj new file mode 100644 index 00000000..2374bf86 --- /dev/null +++ b/src/wix/WixToolset.Sdk/WixToolset.Sdk.csproj @@ -0,0 +1,38 @@ + + + + + + netcoreapp3.1 + false + WiX Toolset MSBuild integration + $(MSBuildThisFileName).nuspec + $(OutputPath)publish\WixToolset.Sdk\ + Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) + + + + + + + + + + + + + + + + + + $(GenerateNuspecDependsOn);SetNuspecVersion + + + + + + $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) + + + diff --git a/src/wix/WixToolset.Sdk/WixToolset.Sdk.nuspec b/src/wix/WixToolset.Sdk/WixToolset.Sdk.nuspec new file mode 100644 index 00000000..591b63a6 --- /dev/null +++ b/src/wix/WixToolset.Sdk/WixToolset.Sdk.nuspec @@ -0,0 +1,18 @@ + + + + $id$ + $version$ + $authors$ + $authors$ + false + $description$ + $copyright$ + + + + + + + + diff --git a/src/wix/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject b/src/wix/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/WixToolset.Sdk/WixToolset.Sdk.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/WixToolset.Sdk/build/WixToolset.Sdk.props b/src/wix/WixToolset.Sdk/build/WixToolset.Sdk.props new file mode 100644 index 00000000..b453361b --- /dev/null +++ b/src/wix/WixToolset.Sdk/build/WixToolset.Sdk.props @@ -0,0 +1,8 @@ + + + + + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\wix.targets')) + + diff --git a/src/wix/WixToolset.Sdk/tools/wix.ca.targets b/src/wix/WixToolset.Sdk/tools/wix.ca.targets new file mode 100644 index 00000000..4578c2d8 --- /dev/null +++ b/src/wix/WixToolset.Sdk/tools/wix.ca.targets @@ -0,0 +1,123 @@ + + + + + + + + + + true + + $(TargetName).CA$(TargetExt) + + $(MSBuildThisFileDirectory) + $(WixSdkPath)x86\ + $(WixSdkPath)x64\ + + $(WixSdkPath)MakeSfxCA.exe + $(WixSdkX64Path)SfxCA.dll + $(WixSdkX86Path)SfxCA.dll + + + + + + + + + + + + + + + + + + + @(CustomActionReferenceContents);@(Content->'%(FullPath)');$(CustomActionContents) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/WixToolset.Sdk/tools/wix.harvest.targets b/src/wix/WixToolset.Sdk/tools/wix.harvest.targets new file mode 100644 index 00000000..f3ec760b --- /dev/null +++ b/src/wix/WixToolset.Sdk/tools/wix.harvest.targets @@ -0,0 +1,515 @@ + + + + + + + + $(WixToolDir) + + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + true + false + true + false + + + + + + false + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + $(IntermediateOutputPath)Product.Generated.wxs + $(IntermediateOutputPath)Bundle.Generated.wxs + $(MSBuildBinPath) + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + $(HarvestNoLogo) + $(HarvestSuppressAllWarnings) + $(HarvestSuppressSpecificWarnings) + $(HarvestTreatWarningsAsErrors) + $(HarvestTreatSpecificWarningsAsErrors) + $(HarvestVerboseOutput) + $(HarvestAutogenerateGuids) + $(HarvestGenerateGuidsNow) + $(HarvestSuppressFragments) + $(HarvestSuppressUniqueIds) + $(HarvestTransforms) + + + + + + ConvertReferences; + ConvertBundleReferences; + HarvestProjects; + HarvestDirectory; + HarvestFile; + GenerateCode; + + + + + + + + RefreshGeneratedFile; + RefreshBundleGeneratedFile + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + %(_MSBuildProjectReferenceExistent.RefTargetDir) + Binaries;Symbols;Sources;Content;Satellites;Documents + %(_MSBuildProjectReferenceExistent.Name) + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + <_HeatProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition=" '%(_MSBuildProjectReferenceExistent.DoNotHarvest)' == '' "> + Binaries;Symbols;Sources;Content;Satellites;Documents + payloadgroup + $(IntermediateOutputPath)_%(_MSBuildProjectReferenceExistent.Filename).wxs + + + + + + + + + + <_GeneratedFiles Include="$(HarvestProjectsGeneratedFile)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + $(HarvestProjectsTransforms) + $(HarvestProjectsProjectOutputGroups) + $(HarvestProjectsDirectoryIds) + + + + + CombineHarvestProjects + + + + + + + + + + + + + + + + + $(HarvestDirectoryTransforms) + $(HarvestDirectoryComponentGroupName) + $(HarvestDirectoryDirectoryRefId) + $(HarvestDirectoryKeepEmptyDirectories) + $(HarvestDirectoryPreprocessorVariable) + $(HarvestDirectorySuppressCom) + $(HarvestDirectorySuppressRootDirectory) + $(HarvestDirectorySuppressRegistry) + + + + + + GetHarvestDirectoryContent + + + + + + + + + + + + + + + + + + + + + + + + + + $(HarvestFileTransforms) + $(HarvestFileComponentGroupName) + $(HarvestFileDirectoryRefId) + $(HarvestFilePreprocessorVariable) + $(HarvestFileSuppressCom) + $(HarvestFileSuppressRegistry) + $(HarvestFileSuppressRootDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/WixToolset.Sdk/tools/wix.signing.targets b/src/wix/WixToolset.Sdk/tools/wix.signing.targets new file mode 100644 index 00000000..7c25175f --- /dev/null +++ b/src/wix/WixToolset.Sdk/tools/wix.signing.targets @@ -0,0 +1,370 @@ + + + + + + $(MSBuildProjectFile).Signed.txt + $(IntermediateOutputPath)$(SignedFileName) + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + GetMsmsToSign; + InternalSignMsm; + + + GetCabsToSign; + GetMsiToSign; + InternalSignCabs; + InscribeMsi; + InternalSignMsi; + + + GetContainersToSign; + InternalSignContainers; + InscribeBundleEngine; + InternalSignBundleEngine; + InscribeBundle; + InternalSignBundle; + + + + WixBuild; + CalculateSignTargetFiles; + BeforeSigning; + $(InternalSignDependsOn); + AfterSigning + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/WixToolset.Sdk/tools/wix.targets b/src/wix/WixToolset.Sdk/tools/wix.targets new file mode 100644 index 00000000..5044bf5e --- /dev/null +++ b/src/wix/WixToolset.Sdk/tools/wix.targets @@ -0,0 +1,1083 @@ + + + + + + true + + + + + + + + + + $(MSBuildThisFileDirectory)netcoreapp3.1\ + $(MSBuildThisFileDirectory)net461\x86\ + $(MSBuildThisFileDirectory)net461\x64\ + $(WixBinDir)WixToolset.BuildTasks.dll + $(WixBinDir64)WixToolset.BuildTasks.dll + + + + $(MSBuildThisFileDirectory)wix.harvest.targets + $(MSBuildThisFileDirectory)wix.signing.targets + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildAllProjects);$(WixHarvestTargetsPath) + $(MSBuildAllProjects);$(WixSigningTargetsPath) + $(MSBuildAllProjects);$(CustomBeforeWixTargets) + $(MSBuildAllProjects);$(CustomAfterWixTargets) + + + + + + .wxs + wix + wix + + + $(MSBuildProjectName) + $(OutputName) + + + Package + + + full + + + + + .msi + .msm + .pcp + .wixlib + .exe + .wixipl + + + + + + + $(TargetDir) + $(PdbOutputDir)\ + + + $([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputDir)`))`)) + + + $(TargetName).wixpdb + + + $(TargetPdbDir)$(TargetPdbFileName) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildProjectFile).BindContentsFileList.txt + $(MSBuildProjectFile).BindOutputsFileList.txt + $(MSBuildProjectFile).BindBuiltOutputsFileList.txt + + + + $(IntermediateOutputPath)cabcache\ + + + + $(WixBinDir) + + + + + + + + + + + + $(NoLogo) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + $(Platform) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + $(NoLogo) + $(BindFiles) + $(Pedantic) + $(SuppressAllWarnings) + $(SuppressSpecificWarnings) + $(SuppressSchemaValidation) + $(SuppressIntermediateFileVersionMatching) + $(TreatWarningsAsErrors) + $(TreatSpecificWarningsAsErrors) + $(VerboseOutput) + + + + + + + + + + + + + + + + + + <_PleaseSetThisInProjectFile>Please set this in the project file before the <Import> of the wix.targets file. + <_OutputTypeDescription>Possible values are: 'Package', 'Module', 'Library', 'Bundle', 'IntermediatePostLink'. $(_PleaseSetThisInProjectFile) + + + + + + + + + + + + + + + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + + WixBuild; + Signing; + + GetTargetPath; + PrepareForRun; + IncrementalClean; + PostBuildEvent + + + + + + + + + + BeforeResolveReferences; + AssignProjectConfiguration; + ResolveProjectReferences; + ResolveWixLibraryReferences; + ResolveWixExtensionReferences; + AfterResolveReferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AssignTargetPaths + + + + + + + + + ResolveReferences; + BeforeCompile; + _TimeStampBeforeCompile; + + CalculateDefineConstants; + Harvest; + + GenerateCompileWithObjectPath; + + AssignTargetPaths; + ReadPreviousBindInputsAndBuiltOutputs; + + CoreWixBuild; + + UpdateLinkFileWrites; + _TimeStampAfterCompile; + AfterCompile + + + + + + + + + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetFileName))) + + $(IntermediateOutputPath)%(CultureGroup.OutputFolder)$(TargetPdbFileName) + + + + + + + + + + + ResolveReferences + + + + + + Configuration=$(ConfigurationName); + OutDir=$(OutDir); + Platform=$(PlatformName); + ProjectDir=$(ProjectDir); + ProjectExt=$(ProjectExt); + ProjectFileName=$(ProjectFileName); + ProjectName=$(ProjectName); + ProjectPath=$(ProjectPath); + TargetDir=$(TargetDir); + TargetExt=$(TargetExt); + TargetFileName=$(TargetFileName); + TargetName=$(TargetName); + TargetPath=$(TargetPath); + + + + + $(SolutionDefineConstants);DevEnvDir=$(DevEnvDir) + $(SolutionDefineConstants);SolutionDir=$(SolutionDir) + $(SolutionDefineConstants);SolutionExt=$(SolutionExt) + $(SolutionDefineConstants);SolutionFileName=$(SolutionFileName) + $(SolutionDefineConstants);SolutionName=$(SolutionName) + $(SolutionDefineConstants);SolutionPath=$(SolutionPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_CulturedTargetPath Include="$(TargetDir)%(CultureGroup.OutputFolder)$(TargetFileName)" /> + <_CulturedTargetPdbPath Include="$(TargetPdbDir)%(CultureGroup.OutputFolder)$(TargetPdbFileName)" /> + + + + @(_CulturedTargetPath) + @(_CulturedTargetPdbPath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(TargetPath) + $(TargetFileName) + + + + + + PrepareForBuild;AssignTargetPaths + + + + + + + + + + + + + <_BuiltProjectOutputGroupOutputIntermediate Include="$(TargetPath)" /> + + + + + + + %(_BuiltProjectOutputGroupOutputIntermediate.FullPath) + + + + + + + AssignTargetPaths + + + + + + + + + + + + + + + + true + + + + true + true + $([System.IO.Path]::GetFullPath($(IntermediateOutputPath))) + + + + + + + + + <_FullPathToCopy Include="$(OutputFile)" Condition=" '@(_FullPathToCopy)'=='' " /> + <_RelativePath Include="$([MSBuild]::MakeRelative($(FullIntermediateOutputPath), %(_FullPathToCopy.Identity)))" /> + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/app.config b/src/wix/app.config deleted file mode 100644 index 081fea2c..00000000 --- a/src/wix/app.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/wix/appveyor-Tools.cmd b/src/wix/appveyor-Tools.cmd new file mode 100644 index 00000000..504b2e9d --- /dev/null +++ b/src/wix/appveyor-Tools.cmd @@ -0,0 +1,52 @@ +@setlocal +@pushd %~dp0 +@set _C=Release +@if /i "%1"=="debug" set _C=Debug +@set _P=%~dp0build\%_C%\publish +@set _RCO=/S /R:1 /W:1 /NP /XO /NS /NC /NFL /NDL /NJH /NJS + +:: Restore +nuget restore || exit /b + +:: Build +msbuild -p:Configuration=%_C% || exit /b + +:: Test +dotnet test -c %_C% --no-build src\test\WixToolsetTest.BuildTasks || exit /b + +dotnet publish -c %_C% -o %_P%\dotnet-wix\ -f netcoreapp3.1 src\wix || exit /b + +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks\ -f net461 -r win-x86 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\heat\ -f net461 -r win-x86 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x86\wix\ -f net461 -r win-x86 src\wix || exit /b +robocopy %_P%\WixToolset.Sdk\separate\net461\x86\buildtasks %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% /XF Microsoft.Build.*.dll +robocopy %_P%\WixToolset.Sdk\separate\net461\x86\heat %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% +robocopy %_P%\WixToolset.Sdk\separate\net461\x86\wix %_P%\WixToolset.Sdk\tools\net461\x86 %_RCO% + +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\buildtasks\ -f net461 -r win-x64 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\heat\ -f net461 -r win-x64 src\heat || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\separate\net461\x64\wix\ -f net461 -r win-x64 src\wix || exit /b +robocopy %_P%\WixToolset.Sdk\separate\net461\x64\buildtasks %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% /XF Microsoft.Build.*.dll +robocopy %_P%\WixToolset.Sdk\separate\net461\x64\heat %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% +robocopy %_P%\WixToolset.Sdk\separate\net461\x64\wix %_P%\WixToolset.Sdk\tools\net461\x64 %_RCO% + +dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\buildtasks\ -f netcoreapp3.1 src\WixToolset.BuildTasks || exit /b +dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\heat\ -f netcoreapp3.1 src\heat || exit /b +dotnet publish -c %_C% -p:UseAppHost=false -o %_P%\WixToolset.Sdk\separate\netcoreapp3.1\wix\ -f netcoreapp3.1 src\wix || exit /b +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\buildtasks %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% /XF Microsoft.Build.*.dll +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\heat %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% +robocopy %_P%\WixToolset.Sdk\separate\netcoreapp3.1\wix %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO% + +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\ src\WixToolset.Sdk || exit /b +dotnet publish -c %_C% -o %_P%\WixToolset.Sdk\broken\net461\ -f net461 -r linux-x64 src\wix || exit /b + +dotnet test -c %_C% src\test\WixToolsetTest.Sdk || exit /b + +:: Pack +dotnet pack -c %_C% src\dotnet-wix || exit /b +dotnet pack -c %_C% src\WixToolset.Sdk || exit /b + +msbuild -p:Configuration=%_C% .\src\ThmViewerPackage\ThmViewerPackage.wixproj || exit /b + +@popd +@endlocal diff --git a/src/wix/appveyor-Tools.yml b/src/wix/appveyor-Tools.yml new file mode 100644 index 00000000..8fea070e --- /dev/null +++ b/src/wix/appveyor-Tools.yml @@ -0,0 +1,46 @@ +# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml +# then update all of the repos. + +branches: + only: + - master + - develop + +image: Visual Studio 2019 + +version: 0.0.0.{build} +configuration: Release + +environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + NUGET_XMLDOC_MODE: skip + +build_script: + - appveyor.cmd + +test: off + +pull_requests: + do_not_increment_build_number: true + +nuget: + disable_publish_on_pr: true + +skip_branch_with_pr: true +skip_tags: true + +artifacts: +- path: build\Release\**\*.msi + name: msi +- path: build\Release\**\*.nupkg + name: nuget +- path: build\Release\**\*.snupkg + name: snupkg + +notifications: +- provider: Slack + incoming_webhook: + secure: p5xuu+4x2JHfwGDMDe5KcG1k7gZxqYc4jWVwvyNZv5cvkubPD2waJs5yXMAXZNN7Z63/3PWHb7q4KoY/99AjauYa1nZ4c5qYqRPFRBKTHfA= diff --git a/src/wix/dotnet-wix/DotnetToolSettings.xml b/src/wix/dotnet-wix/DotnetToolSettings.xml new file mode 100644 index 00000000..a7a87fb2 --- /dev/null +++ b/src/wix/dotnet-wix/DotnetToolSettings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/wix/dotnet-wix/dotnet-wix.csproj b/src/wix/dotnet-wix/dotnet-wix.csproj new file mode 100644 index 00000000..710ab5cd --- /dev/null +++ b/src/wix/dotnet-wix/dotnet-wix.csproj @@ -0,0 +1,28 @@ + + + + + + netcoreapp3.1 + false + WiX Toolset Command-line interface + $(MSBuildThisFileName).nuspec + $(OutputPath)publish\dotnet-wix\ + Id=$(MSBuildThisFileName);Authors=$(Authors);Copyright=$(Copyright);Description=$(Description) + + + + + + + + $(GenerateNuspecDependsOn);SetNuspecVersion + + + + + + $(NuspecProperties);Version=$(Version);ProjectFolder=$(MSBuildThisFileDirectory) + + + diff --git a/src/wix/dotnet-wix/dotnet-wix.nuspec b/src/wix/dotnet-wix/dotnet-wix.nuspec new file mode 100644 index 00000000..66d42c75 --- /dev/null +++ b/src/wix/dotnet-wix/dotnet-wix.nuspec @@ -0,0 +1,20 @@ + + + + $id$ + $version$ + $authors$ + $authors$ + false + $description$ + $copyright$ + + + + + + + + + + diff --git a/src/wix/dotnet-wix/dotnet-wix.v3.ncrunchproject b/src/wix/dotnet-wix/dotnet-wix.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/dotnet-wix/dotnet-wix.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/heat/AssemblyHarvester.cs b/src/wix/heat/AssemblyHarvester.cs new file mode 100644 index 00000000..be61f275 --- /dev/null +++ b/src/wix/heat/AssemblyHarvester.cs @@ -0,0 +1,41 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Reflection; + using System.Runtime.InteropServices; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from an assembly file. + /// + internal class AssemblyHarvester + { + /// + /// Harvest the registry values written by RegisterAssembly. + /// + /// The file to harvest registry values from. + /// The harvested registry values. + public Wix.RegistryValue[] HarvestRegistryValues(string path) + { +#if NETCOREAPP + throw new PlatformNotSupportedException(); +#else + RegistrationServices regSvcs = new RegistrationServices(); + Assembly assembly = Assembly.LoadFrom(path); + + // must call this before overriding registry hives to prevent binding failures + // on exported types during RegisterAssembly + assembly.GetExportedTypes(); + + using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) + { + regSvcs.RegisterAssembly(assembly, AssemblyRegistrationFlags.SetCodeBase); + + return registryHarvester.HarvestRegistry(); + } +#endif + } + } +} diff --git a/src/wix/heat/Data/HarvesterErrors.cs b/src/wix/heat/Data/HarvesterErrors.cs new file mode 100644 index 00000000..a8a3055a --- /dev/null +++ b/src/wix/heat/Data/HarvesterErrors.cs @@ -0,0 +1,205 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using System; + using System.Resources; + using WixToolset.Data; + +#pragma warning disable 1591 // TODO: add documentation + public static class HarvesterErrors + { + public static Message ArgumentRequiresValue(string argument) + { + return Message(null, Ids.ArgumentRequiresValue, "The argument '{0}' does not have a value specified and it is required.", argument); + } + + public static Message BuildErrorDuringHarvesting(string buildError) + { + return Message(null, Ids.BuildErrorDuringHarvesting, "Build error during harvesting: {0}", buildError); + } + + public static Message BuildFailed() + { + return Message(null, Ids.BuildFailed, "Build failed."); + } + + public static Message CannotBuildProject(string projectFile, string innerExceptionMessage) + { + return Message(null, Ids.CannotBuildProject, "Failed to build project {0}: {1}", projectFile, innerExceptionMessage); + } + + public static Message CannotHarvestWebSite() + { + return Message(null, Ids.CannotHarvestWebSite, "Cannot harvest website. On Windows Vista, you must install IIS 6 Management Compatibility."); + } + + public static Message CannotLoadMSBuildAssembly(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildAssembly, "Failed to load MSBuild assembly: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildEngine(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildEngine, "Failed to load MSBuild engine: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildWrapperAssembly(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildWrapperAssembly, "Failed to load MSBuild wrapper assembly: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildWrapperObject(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildWrapperObject, "Failed to load MSBuild wrapper object: {0}", innerExceptionMessage); + } + + public static Message CannotLoadMSBuildWrapperType(string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadMSBuildWrapperType, "Failed to load MSBuild wrapper type: {0}", innerExceptionMessage); + } + + public static Message CannotLoadProject(string projectFile, string innerExceptionMessage) + { + return Message(null, Ids.CannotLoadProject, "Failed to load project {0}: {1}", projectFile, innerExceptionMessage); + } + + public static Message DirectoryAttributeAccessorBadType(string attributeName) + { + return Message(null, Ids.DirectoryAttributeAccessorBadType, "DirectoryAttributeAccessor tried to access an invalid element type for attribute '{0'}.", attributeName); + } + + public static Message DirectoryNotFound(string directory) + { + return Message(null, Ids.DirectoryNotFound, "The directory '{0}' could not be found.", directory); + } + + public static Message EmptyDirectory(string directory) + { + return Message(null, Ids.EmptyDirectory, "The directory '{0}' did not contain any files or sub-directories and since empty directories are not being kept, there was nothing to harvest.", directory); + } + + public static Message ErrorTransformingHarvestedWiX(string transform, string message) + { + return Message(null, Ids.ErrorTransformingHarvestedWiX, "Error applying transform {0} to harvested WiX: {1}", transform, message); + } + + public static Message FileNotFound(string file) + { + return Message(null, Ids.FileNotFound, "The file '{0}' cannot be found.", file); + } + + public static Message InsufficientPermissionHarvestWebSite() + { + return Message(null, Ids.InsufficientPermissionHarvestWebSite, "Not enough permissions to harvest website. On Windows Vista, you must run Heat elevated."); + } + + public static Message InvalidDirectoryId(string generateType) + { + return Message(null, Ids.InvalidDirectoryId, "Invalid directory ID: {0}. Check that it doesn't start with a hyphen or slash.", generateType); + } + + public static Message InvalidDirectoryOutputType(string generateType) + { + return Message(null, Ids.InvalidOutputType, "Invalid generated type: {0}. Must be one of: components, payloadgroup.", generateType); + } + + public static Message InvalidOutputGroup(string outputGroup) + { + return Message(null, Ids.InvalidOutputGroup, "Invalid project output group: {0}.", outputGroup); + } + + public static Message InvalidProjectOutputType(string generateType) + { + return Message(null, Ids.InvalidOutputType, "Invalid generated type: {0}. Must be one of: components, container, payloadgroup, packagegroup.", generateType); + } + + public static Message InvalidProjectName(string generateType) + { + return Message(null, Ids.InvalidProjectName, "Invalid project name: {0}. Check that it doesn't start with a hyphen or slash.", generateType); + } + + public static Message MissingProjectOutputGroup(string projectFile, string outputGroup) + { + return Message(null, Ids.MissingProjectOutputGroup, "Missing project output group '{1}' in project {0}.", projectFile, outputGroup); + } + + public static Message MsbuildBinPathRequired(string version) + { + return Message(null, Ids.MsbuildBinPathRequired, "MSBuildBinPath required for ToolsVersion '{0}'", version); + } + + public static Message NoOutputGroupSpecified() + { + return Message(null, Ids.NoOutputGroupSpecified, "No project output group specified."); + } + + public static Message PerformanceCategoryNotFound(string key) + { + return Message(null, Ids.PerformanceCategoryNotFound, "Performance category '{0}' not found.", key); + } + + public static Message SpacesNotAllowedInArgumentValue(string arg, string value) + { + return Message(null, Ids.SpacesNotAllowedInArgumentValue, "The switch '{0}' does not allow the spaces from the value. Please remove the spaces in from the value: {1}", arg, value); + } + + public static Message UnableToOpenRegistryKey(string key) + { + return Message(null, Ids.UnableToOpenRegistryKey, "Unable to open registry key '{0}'.", key); + } + + public static Message UnsupportedPerformanceCounterType(string key) + { + return Message(null, Ids.UnsupportedPerformanceCounterType, "Unsupported performance counter type '{0}'.", key); + } + + public static Message WebSiteNotFound(string webSiteDescription) + { + return Message(null, Ids.WebSiteNotFound, "The web site '{0}' could not be found. Please check that the web site exists, and that it is spelled correctly (please note, you must use the correct case).", webSiteDescription); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + DirectoryNotFound = 5052, + EmptyDirectory = 5053, + ErrorTransformingHarvestedWiX = 5055, + UnableToOpenRegistryKey = 5056, + SpacesNotAllowedInArgumentValue = 5057, + ArgumentRequiresValue = 5058, + FileNotFound = 5059, + PerformanceCategoryNotFound = 5060, + UnsupportedPerformanceCounterType = 5061, + WebSiteNotFound = 5158, + InsufficientPermissionHarvestWebSite = 5159, + CannotHarvestWebSite = 5160, + InvalidOutputGroup = 5301, + NoOutputGroupSpecified = 5302, + CannotLoadMSBuildAssembly = 5303, + CannotLoadMSBuildEngine = 5304, + CannotLoadProject = 5305, + CannotBuildProject = 5306, + BuildFailed = 5307, + MissingProjectOutputGroup = 5308, + DirectoryAttributeAccessorBadType = 5309, + InvalidOutputType = 5310, + InvalidDirectoryId = 5311, + InvalidProjectName = 5312, + BuildErrorDuringHarvesting = 5313, + CannotLoadMSBuildWrapperAssembly = 5314, + CannotLoadMSBuildWrapperType = 5315, + CannotLoadMSBuildWrapperObject = 5316, + MsbuildBinPathRequired = 5317, + } + } +} diff --git a/src/wix/heat/Data/HarvesterVerboses.cs b/src/wix/heat/Data/HarvesterVerboses.cs new file mode 100644 index 00000000..72de2351 --- /dev/null +++ b/src/wix/heat/Data/HarvesterVerboses.cs @@ -0,0 +1,62 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using System; + using System.Resources; + using WixToolset.Data; + +#pragma warning disable 1591 // TODO: add documentation + public static class HarvesterVerboses + { + public static Message FoundToolsVersion(string toolsVersion) + { + return Message(null, Ids.FoundToolsVersion, "Found ToolsVersion {0} inside project file.", toolsVersion); + } + + public static Message HarvestingAssembly(string fileName) + { + return Message(null, Ids.HarvestingAssembly, "Trying to harvest {0} as an assembly.", fileName); + } + + public static Message HarvestingSelfReg(string fileName) + { + return Message(null, Ids.HarvestingSelfReg, "Trying to harvest self-registration information from native DLL {0}.", fileName); + } + + public static Message HarvestingTypeLib(string fileName) + { + return Message(null, Ids.HarvestingTypeLib, "Trying to harvest type-library information from native DLL {0}.", fileName); + } + + public static Message LoadingProjectWithBinPath(string msbuildBinPath) + { + return Message(null, Ids.LoadingProjectWithBinPath, "Loading project using MSBuild bin path {0}.", msbuildBinPath); + } + + public static Message LoadingProjectWithVersion(string msbuildVersion) + { + return Message(null, Ids.LoadingProjectWithVersion, "Loading project using MSBuild version {0}.", msbuildVersion); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Verbose, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Verbose, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + HarvestingAssembly = 5100, + HarvestingSelfReg = 5101, + HarvestingTypeLib = 5102, + LoadingProjectWithVersion = 5378, + FoundToolsVersion = 5379, + LoadingProjectWithBinPath = 5380, + } + } +} diff --git a/src/wix/heat/Data/HarvesterWarnings.cs b/src/wix/heat/Data/HarvesterWarnings.cs new file mode 100644 index 00000000..80ee5c31 --- /dev/null +++ b/src/wix/heat/Data/HarvesterWarnings.cs @@ -0,0 +1,79 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using System; + using System.Resources; + using WixToolset.Data; + +#pragma warning disable 1591 // TODO: add documentation + public static class HarvesterWarnings + { + public static Message AssemblyHarvestFailed(string file, string message) + { + return Message(null, Ids.AssemblyHarvestFailed, "Could not harvest data from a file that was expected to be an assembly: {0}. If this file is not an assembly you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); + } + + public static Message DuplicateDllRegistryEntry(string registryKey, string componentId) + { + return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{1}'.", registryKey, componentId); + } + + public static Message DuplicateDllRegistryEntry(string registryKey, string registryKeyValue, string componentId) + { + return Message(null, Ids.DuplicateDllRegistryEntry, "Ignoring the registry key '{0}', it has already been added to the component '{2}'. The registry key value '{1}' will not be harvested.", registryKey, registryKeyValue, componentId); + } + + public static Message EncounteredNullDirectoryForWebSite(string directory) + { + return Message(null, Ids.EncounteredNullDirectoryForWebSite, "Could not harvest website directory: {0}. Please update the output with the appropriate directory ID before using.", directory); + } + + public static Message NoLogger(string exceptionMessage) + { + return Message(null, Ids.NoLogger, "Failed to set loggers: {0}", exceptionMessage); + } + + public static Message NoProjectConfiguration(string exceptionMessage) + { + return Message(null, Ids.NoProjectConfiguration, "Failed to set project configuration and platform: {0}", exceptionMessage); + } + + public static Message SelfRegHarvestFailed(string file, string message) + { + return Message(null, Ids.SelfRegHarvestFailed, "Could not harvest data from a file that was expected to be a SelfReg DLL: {0}. If this file does not support SelfReg you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: {1}", file, message); + } + + public static Message TypeLibLoadFailed(string file, string message) + { + return Message(null, Ids.TypeLibLoadFailed, "Could not load file that was expected to be a type library based off of file extension: {0}. If this file is not a type library you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the load failure: {1}", file, message); + } + + public static Message UnsupportedRegistryType(string registryValue, int regFileLineNumber, string unsupportedType) + { + return Message(null, Ids.UnsupportedRegistryType, "Ignoring the registry value '{0}' found on line {1}, because it is of a type unsupported by Windows Installer ({2}).", registryValue, regFileLineNumber, unsupportedType); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); + } + + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) + { + return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args); + } + + public enum Ids + { + SelfRegHarvestFailed = 5150, + AssemblyHarvestFailed = 5151, + TypeLibLoadFailed = 5152, + DuplicateDllRegistryEntry = 5156, + UnsupportedRegistryType = 5157, + NoProjectConfiguration = 5398, + NoLogger = 5399, + EncounteredNullDirectoryForWebSite = 5400, + } + } +} diff --git a/src/wix/heat/Data/HeatCommandLineOption.cs b/src/wix/heat/Data/HeatCommandLineOption.cs new file mode 100644 index 00000000..5815abf0 --- /dev/null +++ b/src/wix/heat/Data/HeatCommandLineOption.cs @@ -0,0 +1,31 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + /// + /// A command line option. + /// + public struct HeatCommandLineOption + { + /// + /// The option name used on the command line. + /// + public string Option; + + /// + /// Description shown in Help command. + /// + public string Description; + + /// + /// Instantiates a new CommandLineOption. + /// + /// The option name. + /// The description of the option. + public HeatCommandLineOption(string option, string description) + { + this.Option = option; + this.Description = description; + } + } +} diff --git a/src/wix/heat/Data/IHeatCommandLine.cs b/src/wix/heat/Data/IHeatCommandLine.cs new file mode 100644 index 00000000..9198468d --- /dev/null +++ b/src/wix/heat/Data/IHeatCommandLine.cs @@ -0,0 +1,12 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Data +{ + using WixToolset.Extensibility.Data; + +#pragma warning disable 1591 // TODO: add documentation + public interface IHeatCommandLine + { + ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments); + } +} diff --git a/src/wix/heat/DirectoryHarvester.cs b/src/wix/heat/DirectoryHarvester.cs new file mode 100644 index 00000000..090d67ab --- /dev/null +++ b/src/wix/heat/DirectoryHarvester.cs @@ -0,0 +1,308 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a directory from the file system. + /// + internal class DirectoryHarvester : BaseHarvesterExtension + { + private FileHarvester fileHarvester; + + private const string ComponentPrefix = "cmp"; + private const string DirectoryPrefix = "dir"; + private const string FilePrefix = "fil"; + + /// + /// Instantiate a new DirectoryHarvester. + /// + public DirectoryHarvester() + { + this.fileHarvester = new FileHarvester(); + this.SetUniqueIdentifiers = true; + } + + /// + /// Gets or sets what type of elements are to be generated. + /// + /// The type of elements being generated. + public GenerateType GenerateType { get; set; } + + /// + /// Gets or sets the option to keep empty directories. + /// + /// The option to keep empty directories. + public bool KeepEmptyDirectories { get; set; } + + /// + /// Gets or sets the rooted DirectoryRef Id if the user has supplied it. + /// + /// The DirectoryRef Id to use as the root. + public string RootedDirectoryRef { get; set; } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers { get; set; } + + /// + /// Gets or sets the option to suppress including the root directory as an element. + /// + /// The option to suppress including the root directory as an element. + public bool SuppressRootDirectory { get; set; } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The harvested directory. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + Wix.IParentElement harvestParent = this.HarvestDirectory(argument, true, this.GenerateType); + Wix.ISchemaElement harvestElement; + + if (this.GenerateType == GenerateType.PayloadGroup) + { + Wix.PayloadGroup payloadGroup = (Wix.PayloadGroup)harvestParent; + payloadGroup.Id = this.RootedDirectoryRef; + harvestElement = payloadGroup; + } + else + { + Wix.Directory directory = (Wix.Directory)harvestParent; + + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = this.RootedDirectoryRef; + + if (this.SuppressRootDirectory) + { + foreach (Wix.ISchemaElement element in directory.Children) + { + directoryRef.AddChild(element); + } + } + else + { + directoryRef.AddChild(directory); + } + harvestElement = directoryRef; + } + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(harvestElement); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The option to harvest child directories and files. + /// The harvested directory. + public Wix.Directory HarvestDirectory(string path, bool harvestChildren) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + return (Wix.Directory)this.HarvestDirectory(path, harvestChildren, GenerateType.Components); + } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The option to harvest child directories and files. + /// The type to generate. + /// The harvested directory. + private Wix.IParentElement HarvestDirectory(string path, bool harvestChildren, GenerateType generateType) + { + if (File.Exists(path)) + { + throw new WixException(ErrorMessages.ExpectedDirectoryGotFile("dir", path)); + } + + if (null == this.RootedDirectoryRef) + { + this.RootedDirectoryRef = "TARGETDIR"; + } + + // use absolute paths + path = Path.GetFullPath(path); + + // Remove any trailing separator to ensure Path.GetFileName() will return the directory name. + path = path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + + Wix.IParentElement harvestParent; + if (generateType == GenerateType.PayloadGroup) + { + harvestParent = new Wix.PayloadGroup(); + } + else + { + Wix.Directory directory = new Wix.Directory(); + directory.Name = Path.GetFileName(path); + directory.FileSource = path; + + if (this.SetUniqueIdentifiers) + { + if (this.SuppressRootDirectory) + { + directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, this.RootedDirectoryRef); + } + else + { + directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, this.RootedDirectoryRef, directory.Name); + } + } + harvestParent = directory; + } + + if (harvestChildren) + { + try + { + int fileCount = this.HarvestDirectory(path, "SourceDir\\", harvestParent, generateType); + + if (generateType != GenerateType.PayloadGroup) + { + // its an error to not harvest anything with the option to keep empty directories off + if (0 == fileCount && !this.KeepEmptyDirectories) + { + throw new WixException(HarvesterErrors.EmptyDirectory(path)); + } + } + } + catch (DirectoryNotFoundException) + { + throw new WixException(HarvesterErrors.DirectoryNotFound(path)); + } + } + + return harvestParent; + } + + /// + /// Harvest a directory. + /// + /// The path of the directory. + /// The relative path that will be used when harvesting. + /// The directory for this path. + /// + /// The number of files harvested. + private int HarvestDirectory(string path, string relativePath, Wix.IParentElement harvestParent, GenerateType generateType) + { + int fileCount = 0; + Wix.Directory directory = generateType != GenerateType.PayloadGroup ? (Wix.Directory)harvestParent : null; + + // harvest the child directories + foreach (string childDirectoryPath in Directory.GetDirectories(path)) + { + var childDirectoryName = Path.GetFileName(childDirectoryPath); + Wix.IParentElement newParent; + Wix.Directory childDirectory = null; + + if (generateType == GenerateType.PayloadGroup) + { + newParent = harvestParent; + } + else + { + childDirectory = new Wix.Directory(); + newParent = childDirectory; + + childDirectory.Name = childDirectoryName; + childDirectory.FileSource = childDirectoryPath; + + if (this.SetUniqueIdentifiers) + { + childDirectory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, directory.Id, childDirectory.Name); + } + } + + int childFileCount = this.HarvestDirectory(childDirectoryPath, String.Concat(relativePath, childDirectoryName, "\\"), newParent, generateType); + + if (generateType != GenerateType.PayloadGroup) + { + // keep the directory if it contained any files (or empty directories are being kept) + if (0 < childFileCount || this.KeepEmptyDirectories) + { + directory.AddChild(childDirectory); + } + } + + fileCount += childFileCount; + } + + // harvest the files + string[] files = Directory.GetFiles(path); + if (0 < files.Length) + { + foreach (string filePath in Directory.GetFiles(path)) + { + string fileName = Path.GetFileName(filePath); + string source = String.Concat(relativePath, fileName); + + Wix.ISchemaElement newChild; + if (generateType == GenerateType.PayloadGroup) + { + Wix.Payload payload = new Wix.Payload(); + newChild = payload; + + payload.SourceFile = source; + } + else + { + Wix.Component component = new Wix.Component(); + newChild = component; + + Wix.File file = this.fileHarvester.HarvestFile(filePath); + file.Source = source; + + if (this.SetUniqueIdentifiers) + { + file.Id = this.Core.GenerateIdentifier(FilePrefix, directory.Id, fileName); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, directory.Id, file.Id); + } + + component.AddChild(file); + } + + harvestParent.AddChild(newChild); + } + } + else if (generateType != GenerateType.PayloadGroup && 0 == fileCount && this.KeepEmptyDirectories) + { + Wix.Component component = new Wix.Component(); + component.KeyPath = Wix.YesNoType.yes; + + if (this.SetUniqueIdentifiers) + { + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, directory.Id); + } + + Wix.CreateFolder createFolder = new Wix.CreateFolder(); + component.AddChild(createFolder); + + directory.AddChild(component); + } + + return fileCount + files.Length; + } + } +} diff --git a/src/wix/heat/DllHarvester.cs b/src/wix/heat/DllHarvester.cs new file mode 100644 index 00000000..723e44ee --- /dev/null +++ b/src/wix/heat/DllHarvester.cs @@ -0,0 +1,106 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Reflection; + using System.Reflection.Emit; + using System.Runtime.InteropServices; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from a native DLL file. + /// + internal class DllHarvester + { + /// + /// Harvest the registry values written by calling DllRegisterServer on the specified file. + /// + /// The file to harvest registry values from. + /// The harvested registry values. + public Wix.RegistryValue[] HarvestRegistryValues(string file) + { + // load the DLL + NativeMethods.LoadLibrary(file); + + using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) + { + try + { + DynamicPInvoke(file, "DllRegisterServer", typeof(int), null, null); + + return registryHarvester.HarvestRegistry(); + } + catch (TargetInvocationException e) + { + e.Data["file"] = file; + throw; + } + } + } + + /// + /// Dynamically PInvokes into a DLL. + /// + /// Dynamic link library containing the entry point. + /// Entry point into dynamic link library. + /// Return type of entry point. + /// Type of parameters to entry point. + /// Value of parameters to entry point. + /// Value from invoked code. + private static object DynamicPInvoke(string dll, string entryPoint, Type returnType, Type[] parameterTypes, object[] parameterValues) + { +#if NETCOREAPP + throw new PlatformNotSupportedException(); +#else + AssemblyName assemblyName = new AssemblyName(); + assemblyName.Name = "wixTempAssembly"; + + AssemblyBuilder dynamicAssembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); + ModuleBuilder dynamicModule = dynamicAssembly.DefineDynamicModule("wixTempModule"); + + MethodBuilder dynamicMethod = dynamicModule.DefinePInvokeMethod(entryPoint, dll, MethodAttributes.Static | MethodAttributes.Public | MethodAttributes.PinvokeImpl, CallingConventions.Standard, returnType, parameterTypes, CallingConvention.Winapi, CharSet.Ansi); + dynamicModule.CreateGlobalFunctions(); + + MethodInfo methodInfo = dynamicModule.GetMethod(entryPoint); + return methodInfo.Invoke(null, parameterValues); +#endif + } + + /// + /// Native methods for loading libraries. + /// + private sealed class NativeMethods + { + private const UInt32 LOAD_WITH_ALTERED_SEARCH_PATH = 0x00000008; + + /// + /// Load a DLL library. + /// + /// The file name of the executable module. + /// If the function succeeds, the return value is a handle to the mapped executable module. + internal static IntPtr LoadLibrary(string file) + { + IntPtr dllHandle = LoadLibraryEx(file, IntPtr.Zero, NativeMethods.LOAD_WITH_ALTERED_SEARCH_PATH); + + if (IntPtr.Zero == dllHandle) + { + int lastError = Marshal.GetLastWin32Error(); + throw new Exception(String.Format("Unable to load file: {0}, error: {1}", file, lastError)); + } + + return dllHandle; + } + + /// + /// Maps the specified executable module into the address space of the calling process. + /// + /// The file name of the executable module. + /// This parameter is reserved for future use. It must be NULL. + /// Action to take when loading the module. + /// If the function succeeds, the return value is a handle to the mapped executable module. + [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)] + private static extern IntPtr LoadLibraryEx(string file, IntPtr fileHandle, UInt32 flags); + } + } +} diff --git a/src/wix/heat/Extensibility/BaseHarvesterExtension.cs b/src/wix/heat/Extensibility/BaseHarvesterExtension.cs new file mode 100644 index 00000000..02696d5b --- /dev/null +++ b/src/wix/heat/Extensibility/BaseHarvesterExtension.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The base harvester extension. Any of these methods can be overridden to change + /// the behavior of the harvester. + /// + public abstract class BaseHarvesterExtension : IHarvesterExtension + { + /// + /// Gets or sets the harvester core for the extension. + /// + /// The harvester core for the extension. + public IHarvesterCore Core { get; set; } + + /// + /// Harvest a WiX document. + /// + /// The argument for harvesting. + /// The harvested Fragments. + public abstract Wix.Fragment[] Harvest(string argument); + } +} diff --git a/src/wix/heat/Extensibility/BaseHeatExtension.cs b/src/wix/heat/Extensibility/BaseHeatExtension.cs new file mode 100644 index 00000000..b76aaf62 --- /dev/null +++ b/src/wix/heat/Extensibility/BaseHeatExtension.cs @@ -0,0 +1,55 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using System; + using WixToolset.Harvesters.Data; + + /// + /// An extension for the WiX Toolset Harvester application. + /// + public abstract class BaseHeatExtension : IHeatExtension + { + /// + /// Gets or sets the heat core for the extension. + /// + /// The heat core for the extension. + public IHeatCore Core { get; set; } + + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public virtual HeatCommandLineOption[] CommandLineTypes + { + get { return null; } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public virtual void ParseOptions(string type, string[] args) + { + } + + /// + /// Determines if the index refers to an argument. + /// + /// + /// + /// + public static bool IsValidArg(string[] args, int index) + { + if (args.Length <= index || String.IsNullOrEmpty(args[index]) || '/' == args[index][0] || '-' == args[index][0]) + { + return false; + } + else + { + return true; + } + } + } +} diff --git a/src/wix/heat/Extensibility/BaseMutatorExtension.cs b/src/wix/heat/Extensibility/BaseMutatorExtension.cs new file mode 100644 index 00000000..c36a8ed1 --- /dev/null +++ b/src/wix/heat/Extensibility/BaseMutatorExtension.cs @@ -0,0 +1,202 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using System; + using System.Collections.Generic; + using System.Text; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The base mutator extension. Any of these methods can be overridden to change + /// the behavior of the mutator. + /// + public abstract class BaseMutatorExtension : IMutatorExtension + { + /// + /// Gets or sets the mutator core for the extension. + /// + /// The mutator core for the extension. + public IHarvesterCore Core { get; set; } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public abstract int Sequence { get; } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public virtual void Mutate(Wix.Wix wix) + { + } + + /// + /// Mutate a WiX document as a string. + /// + /// The Wix document element as a string. + /// The mutated Wix document as a string. + public virtual string Mutate(string wixString) + { + return wixString; + } + + /// + /// Generate unique MSI identifiers. + /// + protected class IdentifierGenerator + { + /// + /// + /// + public const int MaxProductIdentifierLength = 72; + + /// + /// + /// + public const int MaxModuleIdentifierLength = 35; + + private string baseName; + private int maxLength; + private Dictionary existingIdentifiers; + private Dictionary possibleIdentifiers; + private IHarvesterCore harvesterCore; + + /// + /// Instantiate a new IdentifierGenerator. + /// + /// The base resource name to use if a resource name contains no usable characters. + /// + public IdentifierGenerator(string baseName, IHarvesterCore harvesterCore) + { + this.baseName = baseName; + this.maxLength = IdentifierGenerator.MaxProductIdentifierLength; + this.existingIdentifiers = new Dictionary(StringComparer.OrdinalIgnoreCase); + this.possibleIdentifiers = new Dictionary(StringComparer.OrdinalIgnoreCase); + this.harvesterCore = harvesterCore; + } + + /// + /// Gets or sets the maximum length for generated identifiers. + /// + /// Maximum length for generated identifiers. (Default is 72.) + public int MaxIdentifierLength + { + get { return this.maxLength; } + set { this.maxLength = value; } + } + + /// + /// Index an existing identifier for collision detection. + /// + /// The identifier. + public void IndexExistingIdentifier(string identifier) + { + if (null == identifier) + { + throw new ArgumentNullException("identifier"); + } + + this.existingIdentifiers[identifier] = null; + } + + /// + /// Index a resource name for collision detection. + /// + /// The resource name. + public void IndexName(string name) + { + if (null == name) + { + throw new ArgumentNullException("name"); + } + + string identifier = this.CreateIdentifier(name, 0); + + if (this.possibleIdentifiers.ContainsKey(identifier)) + { + this.possibleIdentifiers[identifier] = String.Empty; + } + else + { + this.possibleIdentifiers.Add(identifier, null); + } + } + + /// + /// Get the identifier for the given resource name. + /// + /// The resource name. + /// A legal MSI identifier. + public string GetIdentifier(string name) + { + if (null == name) + { + throw new ArgumentNullException("name"); + } + + for (int i = 0; i <= Int32.MaxValue; i++) + { + string identifier = this.CreateIdentifier(name, i); + + if (this.existingIdentifiers.ContainsKey(identifier) || // already used + (0 == i && 0 != this.possibleIdentifiers.Count && null != this.possibleIdentifiers[identifier]) || // needs an index because its duplicated + (0 != i && this.possibleIdentifiers.ContainsKey(identifier))) // collides with another possible identifier + { + continue; + } + else // use this identifier + { + this.existingIdentifiers.Add(identifier, null); + + return identifier; + } + } + + throw new InvalidOperationException("Could not find a unique identifier for the given resource name."); + } + + /// + /// Create a legal MSI identifier from a resource name and an index. + /// + /// The name of the resource for which an identifier should be created. + /// An index to append to the end of the identifier to make it unique. + /// A legal MSI identifier. + public string CreateIdentifier(string name, int index) + { + if (null == name) + { + throw new ArgumentNullException("name"); + } + + StringBuilder identifier = new StringBuilder(); + + // Convert the name to a standard MSI identifier + identifier.Append(this.harvesterCore.CreateIdentifierFromFilename(name)); + + // no legal identifier characters were found, use the base id instead + if (0 == identifier.Length) + { + identifier.Append(this.baseName); + } + + // truncate the identifier if it's too long (reserve 3 characters for up to 99 collisions) + int adjustedMaxLength = this.MaxIdentifierLength - (index != 0 ? 3 : 0); + if (adjustedMaxLength < identifier.Length) + { + identifier.Length = adjustedMaxLength; + } + + // if the index is not zero, then append it to the identifier name + if (0 != index) + { + identifier.AppendFormat("_{0}", index); + } + + return identifier.ToString(); + } + } + } +} diff --git a/src/wix/heat/Extensibility/IHarvester.cs b/src/wix/heat/Extensibility/IHarvester.cs new file mode 100644 index 00000000..6d363b50 --- /dev/null +++ b/src/wix/heat/Extensibility/IHarvester.cs @@ -0,0 +1,31 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Interface for the harvester. + /// + public interface IHarvester + { + /// + /// Gets or sets the harvester core for the extension. + /// + /// The harvester core for the extension. + IHarvesterCore Core { get; } + + /// + /// Gets or sets the extension. + /// + /// The extension. + IHarvesterExtension Extension { get; set; } + + /// + /// Harvest wix authoring. + /// + /// The argument for harvesting. + /// The harvested wix authoring. + Wix.Wix Harvest(string argument); + } +} diff --git a/src/wix/heat/Extensibility/IHarvesterCore.cs b/src/wix/heat/Extensibility/IHarvesterCore.cs new file mode 100644 index 00000000..3c34b8a1 --- /dev/null +++ b/src/wix/heat/Extensibility/IHarvesterCore.cs @@ -0,0 +1,51 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using WixToolset.Extensibility.Services; + + /// + /// The WiX Toolset harvester core. + /// + public interface IHarvesterCore + { + /// + /// + /// + IMessaging Messaging { get; set; } + + /// + /// Gets or sets the value of the extension argument passed to heat. + /// + /// The extension argument. + string ExtensionArgument { get; set; } + + /// + /// Gets or sets the value of the root directory that is being harvested. + /// + /// The root directory being harvested. + string RootDirectory { get; set; } + + /// + /// Create an identifier based on passed file name + /// + /// File name to generate identifer from + /// + string CreateIdentifierFromFilename(string filename); + + /// + /// Generate an identifier by hashing data from the row. + /// + /// Three letter or less prefix for generated row identifier. + /// Information to hash. + /// The generated identifier. + string GenerateIdentifier(string prefix, params string[] args); + + /// + /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". + /// + /// The Wix.File.Source value with "SourceDir\". + /// The full path of the file. + string ResolveFilePath(string fileSource); + } +} diff --git a/src/wix/heat/Extensibility/IHarvesterExtension.cs b/src/wix/heat/Extensibility/IHarvesterExtension.cs new file mode 100644 index 00000000..5125ea32 --- /dev/null +++ b/src/wix/heat/Extensibility/IHarvesterExtension.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + +#pragma warning disable 1591 // TODO: add documentation + public interface IHarvesterExtension + { + IHarvesterCore Core { get; set; } + + Wix.Fragment[] Harvest(string argument); + } +} diff --git a/src/wix/heat/Extensibility/IHeatCore.cs b/src/wix/heat/Extensibility/IHeatCore.cs new file mode 100644 index 00000000..0aa01b62 --- /dev/null +++ b/src/wix/heat/Extensibility/IHeatCore.cs @@ -0,0 +1,29 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using WixToolset.Extensibility.Services; + + /// + /// The WiX Toolset Harvester application core. + /// + public interface IHeatCore + { + /// + /// Gets the harvester. + /// + /// The harvester. + IHarvester Harvester { get; } + + /// + /// + /// + IMessaging Messaging { get; } + + /// + /// Gets the mutator. + /// + /// The mutator. + IMutator Mutator { get; } + } +} diff --git a/src/wix/heat/Extensibility/IHeatExtension.cs b/src/wix/heat/Extensibility/IHeatExtension.cs new file mode 100644 index 00000000..8a00da37 --- /dev/null +++ b/src/wix/heat/Extensibility/IHeatExtension.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using WixToolset.Harvesters.Data; + +#pragma warning disable 1591 // TODO: add documentation + public interface IHeatExtension + { + IHeatCore Core { get; set; } + + HeatCommandLineOption[] CommandLineTypes { get; } + + void ParseOptions(string type, string[] args); + } +} diff --git a/src/wix/heat/Extensibility/IMutator.cs b/src/wix/heat/Extensibility/IMutator.cs new file mode 100644 index 00000000..c936339e --- /dev/null +++ b/src/wix/heat/Extensibility/IMutator.cs @@ -0,0 +1,44 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Interface for a mutator. + /// + public interface IMutator + { + /// + /// Gets or sets the harvester core for the extension. + /// + /// The harvester core for the extension. + IHarvesterCore Core { get; } + + /// + /// Gets or sets the value of the extension argument passed to heat. + /// + /// The extension argument. + string ExtensionArgument { get; } + + /// + /// Adds a mutator extension. + /// + /// The mutator extension to add. + void AddExtension(IMutatorExtension mutatorExtension); + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + /// true if mutation was successful + bool Mutate(Wix.Wix wix); + + /// + /// Mutate a WiX document. + /// + /// The Wix document as a string. + /// The mutated Wix document as a string if mutation was successful, else null. + string Mutate(string wixString); + } +} diff --git a/src/wix/heat/Extensibility/IMutatorExtension.cs b/src/wix/heat/Extensibility/IMutatorExtension.cs new file mode 100644 index 00000000..b81f586e --- /dev/null +++ b/src/wix/heat/Extensibility/IMutatorExtension.cs @@ -0,0 +1,18 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Extensibility +{ + using Wix = WixToolset.Harvesters.Serialize; + +#pragma warning disable 1591 // TODO: add documentation + public interface IMutatorExtension + { + IHarvesterCore Core { get; set; } + + int Sequence { get; } + + void Mutate(Wix.Wix wix); + + string Mutate(string wixString); + } +} diff --git a/src/wix/heat/FileHarvester.cs b/src/wix/heat/FileHarvester.cs new file mode 100644 index 00000000..8bb1a155 --- /dev/null +++ b/src/wix/heat/FileHarvester.cs @@ -0,0 +1,156 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a file from the file system. + /// + internal class FileHarvester : BaseHarvesterExtension + { + private string rootedDirectoryRef; + private bool setUniqueIdentifiers; + private bool suppressRootDirectory; + + private static readonly string ComponentPrefix = "cmp"; + private static readonly string DirectoryPrefix = "dir"; + private static readonly string FilePrefix = "fil"; + + /// + /// Instantiate a new FileHarvester. + /// + public FileHarvester() + { + this.setUniqueIdentifiers = true; + this.suppressRootDirectory = false; + } + + /// + /// Gets or sets the rooted DirectoryRef Id if the user has supplied it. + /// + /// The DirectoryRef Id to use as the root. + public string RootedDirectoryRef + { + get { return this.rootedDirectoryRef; } + set { this.rootedDirectoryRef = value; } + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Gets or sets the option to suppress including the root directory as an element. + /// + /// The option to suppress including the root directory as an element. + public bool SuppressRootDirectory + { + get { return this.suppressRootDirectory; } + set { this.suppressRootDirectory = value; } + } + + /// + /// Harvest a file. + /// + /// The path of the file. + /// A harvested file. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + if (null == this.rootedDirectoryRef) + { + this.rootedDirectoryRef = "TARGETDIR"; + } + + string fullPath = Path.GetFullPath(argument); + + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = this.rootedDirectoryRef; + + Wix.File file = this.HarvestFile(fullPath); + + if (!this.suppressRootDirectory) + { + file.Source = String.Concat("SourceDir\\", Path.GetFileName(Path.GetDirectoryName(fullPath)), "\\", Path.GetFileName(fullPath)); + } + + Wix.Component component = new Wix.Component(); + component.AddChild(file); + + Wix.Directory directory = new Wix.Directory(); + + if (this.suppressRootDirectory) + { + directoryRef.AddChild(component); + } + else + { + string directoryPath = Path.GetDirectoryName(Path.GetFullPath(argument)); + directory.Name = Path.GetFileName(directoryPath); + + if (this.setUniqueIdentifiers) + { + directory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, directoryRef.Id, directory.Name); + } + directory.AddChild(component); + directoryRef.AddChild(directory); + } + + if (this.setUniqueIdentifiers) + { + file.Id = this.Core.GenerateIdentifier(FilePrefix, (this.suppressRootDirectory) ? directoryRef.Id : directory.Id, Path.GetFileName(file.Source)); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, (this.suppressRootDirectory) ? directoryRef.Id : directory.Id, file.Id); + } + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directoryRef); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a file. + /// + /// The path of the file. + /// A harvested file. + public Wix.File HarvestFile(string path) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + if (!File.Exists(path)) + { + throw new WixException(HarvesterErrors.FileNotFound(path)); + } + + Wix.File file = new Wix.File(); + + // use absolute paths + path = Path.GetFullPath(path); + + file.KeyPath = Wix.YesNoType.yes; + + file.Source = String.Concat("SourceDir\\", Path.GetFileName(path)); + + return file; + } + } +} diff --git a/src/wix/heat/Harvester.cs b/src/wix/heat/Harvester.cs new file mode 100644 index 00000000..791c1cb2 --- /dev/null +++ b/src/wix/heat/Harvester.cs @@ -0,0 +1,65 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using WixToolset.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The WiX Toolset harvester. + /// + internal class Harvester : IHarvester + { + private IHarvesterExtension harvesterExtension; + + public IHarvesterCore Core { get; set; } + + public IHarvesterExtension Extension + { + get + { + return this.harvesterExtension; + } + set + { + if (null != this.harvesterExtension) + { + throw new InvalidOperationException("Multiple harvester extensions specified."); + } + + this.harvesterExtension = value; + } + } + + public Wix.Wix Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + if (null == this.harvesterExtension) + { + throw new WixException(ErrorMessages.HarvestTypeNotFound()); + } + + this.harvesterExtension.Core = this.Core; + + Wix.Fragment[] fragments = this.harvesterExtension.Harvest(argument); + if (null == fragments || 0 == fragments.Length) + { + return null; + } + + Wix.Wix wix = new Wix.Wix(); + foreach (Wix.Fragment fragment in fragments) + { + wix.AddChild(fragment); + } + + return wix; + } + } +} diff --git a/src/wix/heat/HarvesterCore.cs b/src/wix/heat/HarvesterCore.cs new file mode 100644 index 00000000..92b34ab0 --- /dev/null +++ b/src/wix/heat/HarvesterCore.cs @@ -0,0 +1,76 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Extensibility; + + /// + /// The WiX Toolset harvester core. + /// + internal class HarvesterCore : IHarvesterCore + { + public IMessaging Messaging { get; set; } + + public IParseHelper ParseHelper { get; set; } + + /// + /// Gets or sets the value of the extension argument passed to heat. + /// + /// The extension argument. + public string ExtensionArgument { get; set; } + + /// + /// Gets or sets the value of the root directory that is being harvested. + /// + /// The root directory being harvested. + public string RootDirectory { get; set; } + + /// + /// Create an identifier based on passed file name + /// + /// File name to generate identifer from + /// + public string CreateIdentifierFromFilename(string filename) + { + return this.ParseHelper.CreateIdentifierFromFilename(filename).Id; + } + + /// + /// Generate an identifier by hashing data from the row. + /// + /// Three letter or less prefix for generated row identifier. + /// Information to hash. + /// The generated identifier. + public string GenerateIdentifier(string prefix, params string[] args) + { + return this.ParseHelper.CreateIdentifier(prefix, args).Id; + } + + /// + /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". + /// + /// The Wix.File.Source value with "SourceDir\". + /// The full path of the file. + public string ResolveFilePath(string fileSource) + { + if (fileSource.StartsWith("SourceDir\\", StringComparison.Ordinal)) + { + string file = Path.GetFullPath(this.RootDirectory); + if (File.Exists(file)) + { + return file; + } + else + { + fileSource = fileSource.Substring(10); + fileSource = Path.Combine(Path.GetFullPath(this.RootDirectory), fileSource); + } + } + + return fileSource; + } + } +} diff --git a/src/wix/heat/HeatCommand.cs b/src/wix/heat/HeatCommand.cs new file mode 100644 index 00000000..99f27521 --- /dev/null +++ b/src/wix/heat/HeatCommand.cs @@ -0,0 +1,275 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; + using System.Xml; + using WixToolset.Data; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + internal class HeatCommand : ICommandLineCommand + { + public HeatCommand(string harvestType, IList extensions, IServiceProvider serviceProvider) + { + this.Extensions = extensions; + this.Messaging = serviceProvider.GetService(); + this.ServiceProvider = serviceProvider; + + this.ExtensionType = harvestType; + this.ExtensionOptions.Add(harvestType); + } + + private string ExtensionArgument { get; set; } + + private List ExtensionOptions { get; } = new List(); + + private string ExtensionType { get; } + + private IList Extensions { get; } + + private int Indent { get; set; } = 4; + + private IMessaging Messaging { get; } + + private string OutputFile { get; set; } + + private IServiceProvider ServiceProvider { get; } + + public bool ShowLogo { get; private set; } + + public bool StopParsing { get; private set; } + + public Task ExecuteAsync(CancellationToken cancellationToken) + { + var exitCode = this.Harvest(); + return Task.FromResult(exitCode); + } + + public bool TryParseArgument(ICommandLineParser parser, string arg) + { + if (this.ExtensionArgument == null) + { + this.ExtensionArgument = arg; + } + else if ('-' == arg[0] || '/' == arg[0]) + { + string parameter = arg.Substring(1); + if ("nologo" == parameter) + { + this.ShowLogo = false; + } + else if ("o" == parameter || "out" == parameter) + { + this.OutputFile = parser.GetNextArgumentAsFilePathOrError(arg); + + if (String.IsNullOrEmpty(this.OutputFile)) + { + return false; + } + } + else if ("swall" == parameter) + { + this.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("swall", "sw")); + this.Messaging.SuppressAllWarnings = true; + } + else if (parameter.StartsWith("sw")) + { + string paramArg = parameter.Substring(2); + try + { + if (0 == paramArg.Length) + { + this.Messaging.SuppressAllWarnings = true; + } + else + { + int suppressWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat); + if (0 >= suppressWarning) + { + this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); + } + + this.Messaging.SuppressWarningMessage(suppressWarning); + } + } + catch (FormatException) + { + this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); + } + catch (OverflowException) + { + this.Messaging.Write(ErrorMessages.IllegalSuppressWarningId(paramArg)); + } + } + else if ("wxall" == parameter) + { + this.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("wxall", "wx")); + this.Messaging.WarningsAsError = true; + } + else if (parameter.StartsWith("wx")) + { + string paramArg = parameter.Substring(2); + try + { + if (0 == paramArg.Length) + { + this.Messaging.WarningsAsError = true; + } + else + { + int elevateWarning = Convert.ToInt32(paramArg, CultureInfo.InvariantCulture.NumberFormat); + if (0 >= elevateWarning) + { + this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); + } + + this.Messaging.ElevateWarningMessage(elevateWarning); + } + } + catch (FormatException) + { + this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); + } + catch (OverflowException) + { + this.Messaging.Write(ErrorMessages.IllegalWarningIdAsError(paramArg)); + } + } + else if ("v" == parameter) + { + this.Messaging.ShowVerboseMessages = true; + } + else if ("indent" == parameter) + { + try + { + this.Indent = Int32.Parse(parser.GetNextArgumentOrError(arg), CultureInfo.InvariantCulture); + } + catch + { + throw new ArgumentException("Invalid numeric argument.", parameter); + } + } + } + + this.ExtensionOptions.Add(arg); + return true; + } + + private int Harvest() + { + try + { + if (String.IsNullOrEmpty(this.ExtensionArgument)) + { + this.Messaging.Write(ErrorMessages.HarvestSourceNotSpecified()); + } + else if (String.IsNullOrEmpty(this.OutputFile)) + { + this.Messaging.Write(ErrorMessages.OutputTargetNotSpecified()); + } + + // exit if there was an error parsing the core command line + if (this.Messaging.EncounteredError) + { + return this.Messaging.LastErrorNumber; + } + + if (this.ShowLogo) + { + HelpCommand.DisplayToolHeader(); + } + + var heatCore = new HeatCore(this.ServiceProvider, this.ExtensionArgument); + + // parse the extension's command line arguments + var extensionOptionsArray = this.ExtensionOptions.ToArray(); + foreach (var heatExtension in this.Extensions) + { + heatExtension.Core = heatCore; + heatExtension.ParseOptions(this.ExtensionType, extensionOptionsArray); + } + + // exit if there was an error parsing the command line (otherwise the logo appears after error messages) + if (this.Messaging.EncounteredError) + { + return this.Messaging.LastErrorNumber; + } + + // harvest the output + Wix.Wix wix = heatCore.Harvester.Harvest(this.ExtensionArgument); + if (null == wix) + { + return this.Messaging.LastErrorNumber; + } + + // mutate the output + if (!heatCore.Mutator.Mutate(wix)) + { + return this.Messaging.LastErrorNumber; + } + + XmlWriterSettings xmlSettings = new XmlWriterSettings(); + xmlSettings.Indent = true; + xmlSettings.IndentChars = new string(' ', this.Indent); + xmlSettings.OmitXmlDeclaration = true; + + string wixString; + using (StringWriter stringWriter = new StringWriter()) + { + using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + wix.OutputXml(xmlWriter); + } + + wixString = stringWriter.ToString(); + } + + string mutatedWixString = heatCore.Mutator.Mutate(wixString); + if (String.IsNullOrEmpty(mutatedWixString)) + { + return this.Messaging.LastErrorNumber; + } + + Directory.CreateDirectory(Path.GetDirectoryName(this.OutputFile)); + + using (StreamWriter streamWriter = new StreamWriter(this.OutputFile, false, System.Text.Encoding.UTF8)) + { + xmlSettings.OmitXmlDeclaration = false; + xmlSettings.Encoding = System.Text.Encoding.UTF8; + using (XmlWriter xmlWriter = XmlWriter.Create(streamWriter, xmlSettings)) + { + xmlWriter.WriteStartDocument(); + xmlWriter.Flush(); + } + + streamWriter.WriteLine(); + streamWriter.Write(mutatedWixString); + } + } + catch (WixException we) + { + this.Messaging.Write(we.Error); + } + catch (Exception e) + { + this.Messaging.Write(ErrorMessages.UnexpectedException(e)); + if (e is NullReferenceException || e is SEHException) + { + throw; + } + } + + return this.Messaging.LastErrorNumber; + } + } +} diff --git a/src/wix/heat/HeatCommandLine.cs b/src/wix/heat/HeatCommandLine.cs new file mode 100644 index 00000000..b11dda4e --- /dev/null +++ b/src/wix/heat/HeatCommandLine.cs @@ -0,0 +1,91 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using System.Linq; + using WixToolset.Data; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + internal class HeatCommandLine : IHeatCommandLine + { + private readonly List extensions; + private readonly IMessaging messaging; + private readonly IServiceProvider serviceProvider; + + public HeatCommandLine(IServiceProvider serviceProvider, IEnumerable heatExtensions) + { + this.extensions = new List { new IIsHeatExtension(), new UtilHeatExtension(serviceProvider), new VSHeatExtension() }; + if (heatExtensions != null) + { + this.extensions.AddRange(heatExtensions); + } + this.messaging = serviceProvider.GetService(); + this.serviceProvider = serviceProvider; + } + + public ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments) + { + ICommandLineCommand command = null; + var parser = arguments.Parse(); + + while (command?.StopParsing != true && + String.IsNullOrEmpty(parser.ErrorArgument) && + parser.TryGetNextSwitchOrArgument(out var arg)) + { + if (String.IsNullOrWhiteSpace(arg)) // skip blank arguments. + { + continue; + } + + // First argument must be the command or global switch (that creates a command). + if (command == null) + { + if (!this.TryParseUnknownCommandArg(arg, parser, out command)) + { + parser.ReportErrorArgument(arg, ErrorMessages.HarvestTypeNotFound(arg)); + } + } + else if (!command.TryParseArgument(parser, arg)) + { + parser.ReportErrorArgument(arg); + } + } + + return command ?? new HelpCommand(this.extensions); + } + + public bool TryParseUnknownCommandArg(string arg, ICommandLineParser parser, out ICommandLineCommand command) + { + command = null; + + if (parser.IsSwitch(arg)) + { + var parameter = arg.Substring(1); + switch (parameter.ToLowerInvariant()) + { + case "?": + case "h": + case "help": + command = new HelpCommand(this.extensions); + return true; + } + } + + foreach (var heatExtension in this.extensions) + { + if (heatExtension.CommandLineTypes.Any(o => o.Option == arg)) + { + command = new HeatCommand(arg, this.extensions, this.serviceProvider); + return true; + } + } + + return false; + } + } +} diff --git a/src/wix/heat/HeatCommandLineFactory.cs b/src/wix/heat/HeatCommandLineFactory.cs new file mode 100644 index 00000000..44291e48 --- /dev/null +++ b/src/wix/heat/HeatCommandLineFactory.cs @@ -0,0 +1,27 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// Extension methods to use Harvesters services. + /// + public class HeatCommandLineFactory + { + /// + /// Creates service. + /// + /// + /// + /// + public static IHeatCommandLine CreateCommandLine(IServiceProvider serviceProvider, IEnumerable heatExtensions = null) + { + return new HeatCommandLine(serviceProvider, heatExtensions); + } + } +} diff --git a/src/wix/heat/HeatCore.cs b/src/wix/heat/HeatCore.cs new file mode 100644 index 00000000..578c4aab --- /dev/null +++ b/src/wix/heat/HeatCore.cs @@ -0,0 +1,45 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Extensibility; + + /// + /// The WiX Toolset Harvester application core. + /// + internal class HeatCore : IHeatCore + { + /// + /// Instantiates a new HeatCore. + /// + /// The service provider. + /// The extension argument. + public HeatCore(IServiceProvider serviceProvider, string extensionArgument) + { + this.Messaging = serviceProvider.GetService(); + var harvesterCore = new HarvesterCore + { + ExtensionArgument = extensionArgument, + Messaging = this.Messaging, + ParseHelper = serviceProvider.GetService(), + }; + + this.Harvester = new Harvester + { + Core = harvesterCore, + }; + this.Mutator = new Mutator + { + Core = harvesterCore, + }; + } + + public IHarvester Harvester { get; } + + public IMessaging Messaging { get; } + + public IMutator Mutator { get; } + } +} diff --git a/src/wix/heat/HelpCommand.cs b/src/wix/heat/HelpCommand.cs new file mode 100644 index 00000000..bd2bcc24 --- /dev/null +++ b/src/wix/heat/HelpCommand.cs @@ -0,0 +1,97 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Diagnostics; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + internal class HelpCommand : ICommandLineCommand + { + const string HelpMessageOptionFormat = " {0,-7} {1}"; + + public HelpCommand(IList extensions) + { + this.Extensions = extensions; + } + + private IList Extensions { get; } + + public bool ShowLogo => false; + + public bool StopParsing => true; + + public Task ExecuteAsync(CancellationToken cancellationToken) + { + var exitCode = this.DisplayHelp(); + return Task.FromResult(exitCode); + } + + public static void DisplayToolHeader() + { + var wixcopAssembly = typeof(HelpCommand).Assembly; + var fv = FileVersionInfo.GetVersionInfo(wixcopAssembly.Location); + + Console.WriteLine("WiX Toolset Harvester version {0}", fv.FileVersion); + Console.WriteLine("Copyright (C) .NET Foundation and contributors. All rights reserved."); + Console.WriteLine(); + } + + public bool TryParseArgument(ICommandLineParser parser, string argument) => true; + + private int DisplayHelp() + { + DisplayToolHeader(); + + // output the harvest types alphabetically + SortedList harvestOptions = new SortedList(); + foreach (var heatExtension in this.Extensions) + { + foreach (HeatCommandLineOption commandLineOption in heatExtension.CommandLineTypes) + { + harvestOptions.Add(commandLineOption.Option, commandLineOption); + } + } + + harvestOptions.Add("-nologo", new HeatCommandLineOption("-nologo", "skip printing heat logo information")); + harvestOptions.Add("-indent ", new HeatCommandLineOption("-indent ", "indentation multiple (overrides default of 4)")); + harvestOptions.Add("-o[ut]", new HeatCommandLineOption("-out", "specify output file (default: write to current directory)")); + harvestOptions.Add("-sw", new HeatCommandLineOption("-sw", "suppress all warnings or a specific message ID\r\n (example: -sw1011 -sw1012)")); + harvestOptions.Add("-swall", new HeatCommandLineOption("-swall", "suppress all warnings (deprecated)")); + harvestOptions.Add("-v", new HeatCommandLineOption("-v", "verbose output")); + harvestOptions.Add("-wx[N]", new HeatCommandLineOption("-wx[N]", "treat all warnings or a specific message ID as an error\r\n (example: -wx1011 -wx1012)")); + harvestOptions.Add("-wxall", new HeatCommandLineOption("-wxall", "treat all warnings as errors (deprecated)")); + + foreach (HeatCommandLineOption commandLineOption in harvestOptions.Values) + { + if (!commandLineOption.Option.StartsWith("-")) + { + Console.WriteLine(HelpMessageOptionFormat, commandLineOption.Option, commandLineOption.Description); + } + } + + Console.WriteLine(); + Console.WriteLine("Options:"); + + foreach (HeatCommandLineOption commandLineOption in harvestOptions.Values) + { + if (commandLineOption.Option.StartsWith("-")) + { + Console.WriteLine(HelpMessageOptionFormat, commandLineOption.Option, commandLineOption.Description); + } + } + + Console.WriteLine(HelpMessageOptionFormat, "-? | -help", "this help information"); + Console.WriteLine("For more information see: https://wixtoolset.org/"); + + return 0; + } + } +} diff --git a/src/wix/heat/IIsFinalizeHarvesterMutator.cs b/src/wix/heat/IIsFinalizeHarvesterMutator.cs new file mode 100644 index 00000000..17d3bef4 --- /dev/null +++ b/src/wix/heat/IIsFinalizeHarvesterMutator.cs @@ -0,0 +1,160 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Specialized; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + using IIs = Serialize.IIs; + + /// + /// The finalize harvester mutator for the WiX Toolset Internet Information Services Extension. + /// + internal class IIsFinalizeHarvesterMutator : BaseMutatorExtension + { + private Hashtable directoryPaths; + private Hashtable filePaths; + private ArrayList webFilters; + private ArrayList webSites; + private ArrayList webVirtualDirs; + + /// + /// Instantiate a new IIsFinalizeHarvesterMutator. + /// + public IIsFinalizeHarvesterMutator() + { + this.directoryPaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); + this.filePaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); + this.webFilters = new ArrayList(); + this.webSites = new ArrayList(); + this.webVirtualDirs = new ArrayList(); + } + + /// + /// Gets the sequence of this mutator extension. + /// + /// The sequence of this mutator extension. + public override int Sequence + { + get { return 1900; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.directoryPaths.Clear(); + this.filePaths.Clear(); + this.webFilters.Clear(); + this.webSites.Clear(); + this.webVirtualDirs.Clear(); + + this.IndexElement(wix); + + this.MutateWebFilters(); + this.MutateWebSites(); + this.MutateWebVirtualDirs(); + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is IIs.WebFilter) + { + this.webFilters.Add(element); + } + else if (element is IIs.WebSite) + { + this.webSites.Add(element); + } + else if (element is IIs.WebVirtualDir) + { + this.webVirtualDirs.Add(element); + } + else if (element is Wix.Directory) + { + Wix.Directory directory = (Wix.Directory)element; + + if (null != directory.Id && null != directory.FileSource) + { + this.directoryPaths.Add(directory.FileSource, directory.Id); + } + } + else if (element is Wix.File) + { + Wix.File file = (Wix.File)element; + + if (null != file.Id && null != file.Source) + { + this.filePaths[file.Source] = String.Concat("[#", file.Id, "]"); + } + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the WebFilters. + /// + private void MutateWebFilters() + { + foreach (IIs.WebFilter webFilter in this.webFilters) + { + webFilter.Path = (string)this.filePaths[webFilter.Path]; + } + } + + /// + /// Mutate the WebSites. + /// + private void MutateWebSites() + { + foreach (IIs.WebSite webSite in this.webSites) + { + string path = (string)this.directoryPaths[webSite.Directory]; + if (null == path) + { + this.Core.Messaging.Write(HarvesterWarnings.EncounteredNullDirectoryForWebSite(path)); + } + else + { + webSite.Directory = path; + } + } + } + + /// + /// Mutate the WebVirtualDirs. + /// + private void MutateWebVirtualDirs() + { + foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) + { + string path = (string)this.directoryPaths[webVirtualDir.Directory]; + if (null == path) + { + this.Core.Messaging.Write(HarvesterWarnings.EncounteredNullDirectoryForWebSite(path)); + } + else + { + webVirtualDir.Directory = path; + } + } + } + } +} diff --git a/src/wix/heat/IIsHarvesterMutator.cs b/src/wix/heat/IIsHarvesterMutator.cs new file mode 100644 index 00000000..76d94b6a --- /dev/null +++ b/src/wix/heat/IIsHarvesterMutator.cs @@ -0,0 +1,429 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Specialized; + using System.IO; + using WixToolset.Harvesters.Extensibility; + using IIs = Serialize.IIs; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The harvester mutator for the WiX Toolset Internet Information Services Extension. + /// + internal class IIsHarvesterMutator : BaseMutatorExtension + { + private ArrayList components; + private DirectoryHarvester directoryHarvester; + private Hashtable directoryPaths; + private FileHarvester fileHarvester; + private Wix.IParentElement rootElement; + private bool setUniqueIdentifiers; + private ArrayList webAddresses; + private ArrayList webDirs; + private ArrayList webDirProperties; + private ArrayList webFilters; + private ArrayList webSites; + private ArrayList webVirtualDirs; + + /// + /// Instantiate a new IIsHarvesterMutator. + /// + public IIsHarvesterMutator() + { + this.components = new ArrayList(); + this.directoryHarvester = new DirectoryHarvester(); + this.directoryPaths = CollectionsUtil.CreateCaseInsensitiveHashtable(); + this.fileHarvester = new FileHarvester(); + this.webAddresses = new ArrayList(); + this.webDirs = new ArrayList(); + this.webDirProperties = new ArrayList(); + this.webFilters = new ArrayList(); + this.webSites = new ArrayList(); + this.webVirtualDirs = new ArrayList(); + } + + /// + /// Gets the sequence of this mutator extension. + /// + /// The sequence of this mutator extension. + public override int Sequence + { + get { return 100; } + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.components.Clear(); + this.directoryPaths.Clear(); + this.webAddresses.Clear(); + this.webDirs.Clear(); + this.webDirProperties.Clear(); + this.webFilters.Clear(); + this.webSites.Clear(); + this.webVirtualDirs.Clear(); + this.rootElement = null; + + this.IndexElement(wix); + + this.MutateWebAddresses(); + + this.MutateWebDirs(); + + this.MutateWebDirProperties(); + + this.MutateWebSites(); + + this.MutateWebVirtualDirs(); + + // this must come after the web virtual dirs in case they harvest a directory containing a web filter file + this.MutateWebFilters(); + + // this must come after the web site identifiers are created + this.MutateComponents(); + } + + /// + /// Harvest a new directory or return one that was previously harvested. + /// + /// The path of the directory. + /// The option to harvest the children of the directory. + /// The harvested directory. + private Wix.Directory HarvestUniqueDirectory(string path, bool harvestChildren) + { + if (this.directoryPaths.Contains(path)) + { + return (Wix.Directory)this.directoryPaths[path]; + } + else + { + Wix.Directory directory = this.directoryHarvester.HarvestDirectory(path, harvestChildren); + + this.rootElement.AddChild(directory); + + // index this new directory and all of its children + this.IndexElement(directory); + + return directory; + } + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is IIs.WebAddress) + { + this.webAddresses.Add(element); + } + else if (element is IIs.WebDir) + { + this.webDirs.Add(element); + } + else if (element is IIs.WebDirProperties) + { + this.webDirProperties.Add(element); + } + else if (element is IIs.WebFilter) + { + this.webFilters.Add(element); + } + else if (element is IIs.WebSite) + { + this.webSites.Add(element); + } + else if (element is IIs.WebVirtualDir) + { + this.webVirtualDirs.Add(element); + } + else if (element is Wix.Component) + { + this.components.Add(element); + } + else if (element is Wix.Directory) + { + Wix.Directory directory = (Wix.Directory)element; + + if (null != directory.FileSource) + { + this.directoryPaths.Add(directory.FileSource, directory); + } + } + else if (element is Wix.Fragment || element is Wix.Module || element is Wix.PatchCreation || element is Wix.Package) + { + this.rootElement = (Wix.IParentElement)element; + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the Component elements. + /// + private void MutateComponents() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("Component", this.Core); + + // index all the existing identifiers + foreach (Wix.Component component in this.components) + { + if (null != component.Id) + { + identifierGenerator.IndexExistingIdentifier(component.Id); + } + } + + // index all the web site identifiers + foreach (IIs.WebSite webSite in this.webSites) + { + if (webSite.ParentElement is Wix.Component) + { + identifierGenerator.IndexName(webSite.Id); + } + } + + // create an identifier for each component based on its child web site identifier + foreach (IIs.WebSite webSite in this.webSites) + { + Wix.Component component = webSite.ParentElement as Wix.Component; + + if (null != component) + { + component.Id = identifierGenerator.GetIdentifier(webSite.Id); + } + } + } + } + + /// + /// Mutate the WebAddress elements. + /// + private void MutateWebAddresses() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebAddress", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebAddress webAddress in this.webAddresses) + { + if (null != webAddress.Id) + { + identifierGenerator.IndexExistingIdentifier(webAddress.Id); + } + else + { + identifierGenerator.IndexName(String.Concat(webAddress.IP, "_", webAddress.Port)); + } + } + + foreach (IIs.WebAddress webAddress in this.webAddresses) + { + if (null == webAddress.Id) + { + webAddress.Id = identifierGenerator.GetIdentifier(String.Concat(webAddress.IP, "_", webAddress.Port)); + } + } + } + } + + /// + /// Mutate the WebDir elements. + /// + private void MutateWebDirs() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebDir", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebDir webDir in this.webDirs) + { + if (null != webDir.Id) + { + identifierGenerator.IndexExistingIdentifier(webDir.Id); + } + else + { + identifierGenerator.IndexName(webDir.Path); + } + } + + foreach (IIs.WebDir webDir in this.webDirs) + { + if (null == webDir.Id) + { + webDir.Id = identifierGenerator.GetIdentifier(webDir.Path); + } + } + } + } + + /// + /// Mutate the WebDirProperties elements. + /// + private void MutateWebDirProperties() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebDirProperties", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebDirProperties webDirProperties in this.webDirProperties) + { + if (null != webDirProperties.Id) + { + identifierGenerator.IndexExistingIdentifier(webDirProperties.Id); + } + } + + foreach (IIs.WebDirProperties webDirProperties in this.webDirProperties) + { + if (null == webDirProperties.Id) + { + webDirProperties.Id = identifierGenerator.GetIdentifier(String.Empty); + } + } + } + } + + /// + /// Mutate the WebFilter elements. + /// + private void MutateWebFilters() + { + IdentifierGenerator identifierGenerator = null; + + if (this.setUniqueIdentifiers) + { + identifierGenerator = new IdentifierGenerator("WebFilter", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebFilter webFilter in this.webFilters) + { + if (null != webFilter.Id) + { + identifierGenerator.IndexExistingIdentifier(webFilter.Id); + } + else + { + identifierGenerator.IndexName(webFilter.Name); + } + } + } + + foreach (IIs.WebFilter webFilter in this.webFilters) + { + if (this.setUniqueIdentifiers && null == webFilter.Id) + { + webFilter.Id = identifierGenerator.GetIdentifier(webFilter.Name); + } + + // harvest the file for this WebFilter + Wix.Directory directory = this.HarvestUniqueDirectory(Path.GetDirectoryName(webFilter.Path), false); + + Wix.Component component = new Wix.Component(); + directory.AddChild(component); + + Wix.File file = this.fileHarvester.HarvestFile(webFilter.Path); + component.AddChild(file); + } + } + + /// + /// Mutate the WebSite elements. + /// + private void MutateWebSites() + { + if (this.setUniqueIdentifiers) + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("WebSite", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebSite webSite in this.webSites) + { + if (null != webSite.Id) + { + identifierGenerator.IndexExistingIdentifier(webSite.Id); + } + else + { + identifierGenerator.IndexName(webSite.Description); + } + } + + foreach (IIs.WebSite webSite in this.webSites) + { + if (null == webSite.Id) + { + webSite.Id = identifierGenerator.GetIdentifier(webSite.Description); + } + } + } + } + + /// + /// Mutate the WebVirtualDir elements. + /// + private void MutateWebVirtualDirs() + { + IdentifierGenerator identifierGenerator = null; + + if (this.setUniqueIdentifiers) + { + identifierGenerator = new IdentifierGenerator("WebVirtualDir", this.Core); + + // index all the existing identifiers and names + foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) + { + if (null != webVirtualDir.Id) + { + identifierGenerator.IndexExistingIdentifier(webVirtualDir.Id); + } + else + { + identifierGenerator.IndexName(webVirtualDir.Alias); + } + } + } + + foreach (IIs.WebVirtualDir webVirtualDir in this.webVirtualDirs) + { + if (this.setUniqueIdentifiers && null == webVirtualDir.Id) + { + webVirtualDir.Id = identifierGenerator.GetIdentifier(webVirtualDir.Alias); + } + + // harvest the directory for this WebVirtualDir + this.HarvestUniqueDirectory(webVirtualDir.Directory, true); + } + } + } +} diff --git a/src/wix/heat/IIsHeatExtension.cs b/src/wix/heat/IIsHeatExtension.cs new file mode 100644 index 00000000..94e11a68 --- /dev/null +++ b/src/wix/heat/IIsHeatExtension.cs @@ -0,0 +1,80 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// An IIS harvesting extension for the WiX Toolset Harvester application. + /// + internal class IIsHeatExtension : BaseHeatExtension + { + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public override HeatCommandLineOption[] CommandLineTypes + { + get + { + return new HeatCommandLineOption[] + { + new HeatCommandLineOption("website", "harvest an IIS web site"), + }; + } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public override void ParseOptions(string type, string[] args) + { + bool active = false; + IHarvesterExtension harvesterExtension = null; + IIsHarvesterMutator iisHarvesterMutator = new IIsHarvesterMutator(); + + // select the harvester + switch (type) + { + case "website": + harvesterExtension = new IIsWebSiteHarvester(); + active = true; + break; + } + + // set default settings + iisHarvesterMutator.SetUniqueIdentifiers = true; + + // parse the options + foreach (string arg in args) + { + if (null == arg || 0 == arg.Length) // skip blank arguments + { + continue; + } + + if ('-' == arg[0] || '/' == arg[0]) + { + string parameter = arg.Substring(1); + + if ("suid" == parameter) + { + iisHarvesterMutator.SetUniqueIdentifiers = false; + } + } + } + + // set the appropriate harvester extension + if (active) + { + this.Core.Harvester.Extension = harvesterExtension; + this.Core.Mutator.AddExtension(iisHarvesterMutator); + this.Core.Mutator.AddExtension(new IIsFinalizeHarvesterMutator()); + this.Core.Mutator.AddExtension(new UtilFinalizeHarvesterMutator()); + } + } + } +} diff --git a/src/wix/heat/IIsWebSiteHarvester.cs b/src/wix/heat/IIsWebSiteHarvester.cs new file mode 100644 index 00000000..86861b16 --- /dev/null +++ b/src/wix/heat/IIsWebSiteHarvester.cs @@ -0,0 +1,439 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.DirectoryServices; + using System.Globalization; + using System.Runtime.InteropServices; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using IIs = WixToolset.Harvesters.Serialize.IIs; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The web site harvester for the WiX Toolset Internet Information Services Extension. + /// + internal class IIsWebSiteHarvester : BaseHarvesterExtension + { + /// + /// Harvest a WiX document. + /// + /// The argument for harvesting. + /// The harvested Fragment. + public override Wix.Fragment[] Harvest(string argument) + { + DirectoryHarvester directoryHarvester = new DirectoryHarvester(); + directoryHarvester.Core = this.Core; + directoryHarvester.KeepEmptyDirectories = true; + + IIsWebSiteHarvester iisWebSiteHarvester = new IIsWebSiteHarvester(); + iisWebSiteHarvester.Core = this.Core; + + IIs.WebSite webSite = iisWebSiteHarvester.HarvestWebSite(argument); + + Wix.Component component = new Wix.Component(); + component.AddChild(new Wix.CreateFolder()); + component.AddChild(webSite); + + this.Core.RootDirectory = webSite.Directory; + Wix.Directory directory = directoryHarvester.HarvestDirectory(webSite.Directory, true); + directory.AddChild(component); + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directory); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a web site. + /// + /// The name of the web site. + /// The harvested web site. + public IIs.WebSite HarvestWebSite(string name) + { + try + { + DirectoryEntry directoryEntry = new DirectoryEntry("IIS://localhost/W3SVC"); + + foreach (DirectoryEntry childEntry in directoryEntry.Children) + { + if ("IIsWebServer" == childEntry.SchemaClassName) + { + if (String.Equals((string)childEntry.Properties["ServerComment"].Value, name, StringComparison.OrdinalIgnoreCase)) + { + return this.HarvestWebSite(childEntry); + } + } + } + } + catch (COMException ce) + { + // 0x8007005 - access denied + // If we don't have permission to harvest a website, it's likely because we're on + // Vista or higher and aren't an Admin. + if ((0x80070005 == unchecked((uint)ce.ErrorCode))) + { + throw new WixException(HarvesterErrors.InsufficientPermissionHarvestWebSite()); + } + // 0x80005000 - unknown error + else if ((0x80005000 == unchecked((uint)ce.ErrorCode))) + { + throw new WixException(HarvesterErrors.CannotHarvestWebSite()); + } + } + + throw new WixException(HarvesterErrors.WebSiteNotFound(name)); + } + + /// + /// Harvest a web site. + /// + /// The web site directory entry. + /// The harvested web site. + private IIs.WebSite HarvestWebSite(DirectoryEntry webSiteEntry) + { + IIs.WebSite webSite = new IIs.WebSite(); + + foreach (string propertyName in webSiteEntry.Properties.PropertyNames) + { + PropertyValueCollection property = webSiteEntry.Properties[propertyName]; + PropertyValueCollection parentProperty = webSiteEntry.Parent.Properties[propertyName]; + + if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) + { + switch (propertyName) + { + case "SecureBindings": + IIs.WebAddress secureWebAddress = this.HarvestBindings(propertyName, property); + if (null != secureWebAddress) + { + webSite.AddChild(secureWebAddress); + } + break; + case "ServerBindings": + IIs.WebAddress webAddress = this.HarvestBindings(propertyName, property); + if (null != webAddress) + { + webSite.AddChild(webAddress); + } + break; + case "ServerComment": + webSite.Description = (string)property.Value; + break; + } + } + } + + foreach (DirectoryEntry childEntry in webSiteEntry.Children) + { + switch (childEntry.SchemaClassName) + { + case "IIsFilters": + string loadOrder = (string)childEntry.Properties["FilterLoadOrder"].Value; + if (loadOrder.Length > 0) + { + string[] filterNames = loadOrder.Split(",".ToCharArray()); + + for (int i = 0; i < filterNames.Length; i++) + { + using (DirectoryEntry webFilterEntry = new DirectoryEntry(String.Concat(childEntry.Path, '/', filterNames[i]))) + { + IIs.WebFilter webFilter = this.HarvestWebFilter(webFilterEntry); + + webFilter.LoadOrder = (i + 1).ToString(CultureInfo.InvariantCulture); + + webSite.AddChild(webFilter); + } + } + } + break; + case "IIsWebDirectory": + this.HarvestWebDirectory(childEntry, webSite); + break; + case "IIsWebVirtualDir": + foreach (string propertyName in childEntry.Properties.PropertyNames) + { + PropertyValueCollection property = childEntry.Properties[propertyName]; + + switch (propertyName) + { + case "Path": + webSite.Directory = (string)property.Value; + break; + } + } + + IIs.WebDirProperties webDirProps = this.HarvestWebDirProperties(childEntry); + if (null != webDirProps) + { + webSite.AddChild(webDirProps); + } + + foreach (DirectoryEntry child2Entry in childEntry.Children) + { + switch (child2Entry.SchemaClassName) + { + case "IIsWebDirectory": + this.HarvestWebDirectory(child2Entry, webSite); + break; + case "IIsWebVirtualDir": + this.HarvestWebVirtualDir(child2Entry, webSite); + break; + } + } + break; + } + } + + return webSite; + } + + /// + /// Harvest bindings. + /// + /// The property name of the bindings property. + /// The bindings property. + /// The harvested bindings. + private IIs.WebAddress HarvestBindings(string propertyName, PropertyValueCollection bindingsProperty) + { + if (1 == bindingsProperty.Count) + { + IIs.WebAddress webAddress = new IIs.WebAddress(); + + string[] bindings = ((string)bindingsProperty[0]).Split(":".ToCharArray()); + + if (0 < bindings[0].Length) + { + webAddress.IP = bindings[0]; + } + + if (0 < bindings[1].Length) + { + webAddress.Port = bindings[1]; + } + + if (0 < bindings[2].Length) + { + webAddress.Header = bindings[2]; + } + + if ("SecureBindings" == propertyName) + { + webAddress.Secure = IIs.YesNoType.yes; + } + + return webAddress; + } + + return null; + } + + /// + /// Harvest a web directory. + /// + /// The web directory directory entry. + /// The parent web site. + private void HarvestWebDirectory(DirectoryEntry webDirectoryEntry, IIs.WebSite webSite) + { + foreach (DirectoryEntry childEntry in webDirectoryEntry.Children) + { + switch (childEntry.SchemaClassName) + { + case "IIsWebDirectory": + this.HarvestWebDirectory(childEntry, webSite); + break; + case "IIsWebVirtualDir": + this.HarvestWebVirtualDir(childEntry, webSite); + break; + } + } + + IIs.WebDirProperties webDirProperties = this.HarvestWebDirProperties(webDirectoryEntry); + + if (null != webDirProperties) + { + IIs.WebDir webDir = new IIs.WebDir(); + + int indexOfRoot = webDirectoryEntry.Path.IndexOf("ROOT/", StringComparison.OrdinalIgnoreCase); + webDir.Path = webDirectoryEntry.Path.Substring(indexOfRoot + 5); + + webDir.AddChild(webDirProperties); + + webSite.AddChild(webDir); + } + } + + /// + /// Harvest a web filter. + /// + /// The web filter directory entry. + /// The harvested web filter. + private IIs.WebFilter HarvestWebFilter(DirectoryEntry webFilterEntry) + { + IIs.WebFilter webFilter = new IIs.WebFilter(); + + webFilter.Name = webFilterEntry.Name; + + foreach (string propertyName in webFilterEntry.Properties.PropertyNames) + { + PropertyValueCollection property = webFilterEntry.Properties[propertyName]; + + switch (propertyName) + { + case "FilterDescription": + webFilter.Description = (string)property.Value; + break; + case "FilterFlags": + webFilter.Flags = (int)property.Value; + break; + case "FilterPath": + webFilter.Path = (string)property.Value; + break; + } + } + + return webFilter; + } + + /// + /// Harvest a web directory's properties. + /// + /// The web directory directory entry. + /// The harvested web directory's properties. + private IIs.WebDirProperties HarvestWebDirProperties(DirectoryEntry directoryEntry) + { + bool foundProperties = false; + IIs.WebDirProperties webDirProperties = new IIs.WebDirProperties(); + + // Cannot read properties for "iisadmin" site. + if (String.Equals("iisadmin", directoryEntry.Name, StringComparison.OrdinalIgnoreCase) && + String.Equals("ROOT", directoryEntry.Parent.Name, StringComparison.OrdinalIgnoreCase)) + { + return null; + } + + foreach (string propertyName in directoryEntry.Properties.PropertyNames) + { + PropertyValueCollection property = directoryEntry.Properties[propertyName]; + PropertyValueCollection parentProperty = directoryEntry.Parent.Properties[propertyName]; + + if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) + { + switch (propertyName) + { + case "AccessFlags": + int access = (int)property.Value; + + if (0x1 == (access & 0x1)) + { + webDirProperties.Read = IIs.YesNoType.yes; + } + + if (0x2 == (access & 0x2)) + { + webDirProperties.Write = IIs.YesNoType.yes; + } + + if (0x4 == (access & 0x4)) + { + webDirProperties.Execute = IIs.YesNoType.yes; + } + + if (0x200 == (access & 0x200)) + { + webDirProperties.Script = IIs.YesNoType.yes; + } + + foundProperties = true; + break; + case "AuthFlags": + int authorization = (int)property.Value; + + if (0x1 == (authorization & 0x1)) + { + webDirProperties.AnonymousAccess = IIs.YesNoType.yes; + } + + if (0x2 == (authorization & 0x2)) + { + webDirProperties.BasicAuthentication = IIs.YesNoType.yes; + } + + if (0x4 == (authorization & 0x4)) + { + webDirProperties.WindowsAuthentication = IIs.YesNoType.yes; + } + + if (0x10 == (authorization & 0x10)) + { + webDirProperties.DigestAuthentication = IIs.YesNoType.yes; + } + + if (0x40 == (authorization & 0x40)) + { + webDirProperties.PassportAuthentication = IIs.YesNoType.yes; + } + + foundProperties = true; + break; + } + } + } + + return foundProperties ? webDirProperties : null; + } + + /// + /// Harvest a web virtual directory. + /// + /// The web virtual directory directory entry. + /// The parent web site. + private void HarvestWebVirtualDir(DirectoryEntry webVirtualDirEntry, IIs.WebSite webSite) + { + IIs.WebVirtualDir webVirtualDir = new IIs.WebVirtualDir(); + + foreach (string propertyName in webVirtualDirEntry.Properties.PropertyNames) + { + PropertyValueCollection property = webVirtualDirEntry.Properties[propertyName]; + PropertyValueCollection parentProperty = webVirtualDirEntry.Parent.Properties[propertyName]; + + if (null == parentProperty.Value || parentProperty.Value.ToString() != property.Value.ToString()) + { + switch (propertyName) + { + case "Path": + webVirtualDir.Directory = (string)property.Value; + break; + } + } + } + + int indexOfRoot = webVirtualDirEntry.Path.IndexOf("ROOT/", StringComparison.OrdinalIgnoreCase); + webVirtualDir.Alias = webVirtualDirEntry.Path.Substring(indexOfRoot + 5); + + IIs.WebDirProperties webDirProps = this.HarvestWebDirProperties(webVirtualDirEntry); + if (webDirProps != null) + { + webVirtualDir.AddChild(webDirProps); + } + + foreach (DirectoryEntry childEntry in webVirtualDirEntry.Children) + { + switch (childEntry.SchemaClassName) + { + case "IIsWebDirectory": + this.HarvestWebDirectory(childEntry, webSite); + break; + case "IIsWebVirtualDir": + this.HarvestWebVirtualDir(childEntry, webSite); + break; + } + } + + webSite.AddChild(webVirtualDir); + } + } +} diff --git a/src/wix/heat/Mutator.cs b/src/wix/heat/Mutator.cs new file mode 100644 index 00000000..8c63882d --- /dev/null +++ b/src/wix/heat/Mutator.cs @@ -0,0 +1,93 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The WiX Toolset mutator. + /// + internal class Mutator : IMutator + { + private SortedList extensions; + private string extensionArgument; + + /// + /// Instantiate a new mutator. + /// + public Mutator() + { + this.extensions = new SortedList(); + } + + public IHarvesterCore Core { get; set; } + + public string ExtensionArgument + { + get { return this.extensionArgument; } + set { this.extensionArgument = value; } + } + + public void AddExtension(IMutatorExtension mutatorExtension) + { + this.extensions.Add(mutatorExtension.Sequence, mutatorExtension); + } + + public bool Mutate(Wix.Wix wix) + { + bool encounteredError = false; + + try + { + foreach (IMutatorExtension mutatorExtension in this.extensions.Values) + { + if (null == mutatorExtension.Core) + { + mutatorExtension.Core = this.Core; + } + + mutatorExtension.Mutate(wix); + } + } + finally + { + encounteredError = this.Core.Messaging.EncounteredError; + } + + // return the Wix document element only if mutation completed successfully + return !encounteredError; + } + + public string Mutate(string wixString) + { + bool encounteredError = false; + + try + { + foreach (IMutatorExtension mutatorExtension in this.extensions.Values) + { + if (null == mutatorExtension.Core) + { + mutatorExtension.Core = this.Core; + } + + wixString = mutatorExtension.Mutate(wixString); + + if (String.IsNullOrEmpty(wixString) || this.Core.Messaging.EncounteredError) + { + break; + } + } + } + finally + { + encounteredError = this.Core.Messaging.EncounteredError; + } + + return encounteredError ? null : wixString; + } + } +} diff --git a/src/wix/heat/PayloadHarvester.cs b/src/wix/heat/PayloadHarvester.cs new file mode 100644 index 00000000..4bf625d1 --- /dev/null +++ b/src/wix/heat/PayloadHarvester.cs @@ -0,0 +1,129 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using WixToolset.Core.Burn.Interfaces; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a payload from the file system. + /// + internal class PayloadHarvester : BaseHarvesterExtension + { + private bool setUniqueIdentifiers; + private WixBundlePackageType packageType; + + private IPayloadHarvester payloadHarvester; + + /// + /// Instantiate a new PayloadHarvester. + /// + public PayloadHarvester(IPayloadHarvester payloadHarvester, WixBundlePackageType packageType) + { + this.payloadHarvester = payloadHarvester; + + this.packageType = packageType; + this.setUniqueIdentifiers = true; + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Harvest a payload. + /// + /// The path of the payload. + /// A harvested payload. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + string fullPath = Path.GetFullPath(argument); + + var remotePayload = this.HarvestRemotePayload(fullPath); + + var fragment = new Wix.Fragment(); + fragment.AddChild(remotePayload); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a payload. + /// + /// The path of the payload. + /// A harvested payload. + public Wix.RemotePayload HarvestRemotePayload(string path) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + if (!File.Exists(path)) + { + throw new WixException(HarvesterErrors.FileNotFound(path)); + } + + Wix.RemotePayload remotePayload; + + switch (this.packageType) + { + case WixBundlePackageType.Exe: + remotePayload = new Wix.ExePackagePayload(); + break; + case WixBundlePackageType.Msu: + remotePayload = new Wix.MsuPackagePayload(); + break; + default: + throw new NotImplementedException(); + } + + var payloadSymbol = new WixBundlePayloadSymbol + { + SourceFile = new IntermediateFieldPathValue { Path = path }, + }; + + this.payloadHarvester.HarvestStandardInformation(payloadSymbol); + + if (payloadSymbol.FileSize.HasValue) + { + remotePayload.Size = payloadSymbol.FileSize.Value; + } + remotePayload.Hash = payloadSymbol.Hash; + + if (!String.IsNullOrEmpty(payloadSymbol.Version)) + { + remotePayload.Version = payloadSymbol.Version; + } + + if (!String.IsNullOrEmpty(payloadSymbol.Description)) + { + remotePayload.Description = payloadSymbol.Description; + } + + if (!String.IsNullOrEmpty(payloadSymbol.DisplayName)) + { + remotePayload.ProductName = payloadSymbol.DisplayName; + } + + return remotePayload; + } + } +} diff --git a/src/wix/heat/PerformanceCategoryHarvester.cs b/src/wix/heat/PerformanceCategoryHarvester.cs new file mode 100644 index 00000000..d9c46001 --- /dev/null +++ b/src/wix/heat/PerformanceCategoryHarvester.cs @@ -0,0 +1,207 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Linq; + using System.Diagnostics; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Util = WixToolset.Harvesters.Serialize.Util; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a file from the file system. + /// + internal class PerformanceCategoryHarvester : BaseHarvesterExtension + { + /// + /// Harvest a performance category. + /// + /// The name of the performance category. + /// A harvested performance category. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + Util.PerformanceCategory perf = this.HarvestPerformanceCategory(argument); + + Wix.Component component = new Wix.Component(); + component.Id = this.Core.CreateIdentifierFromFilename(argument); + component.KeyPath = Wix.YesNoType.yes; + component.AddChild(perf); + + Wix.Directory directory = new Wix.Directory(); + directory.Id = "TARGETDIR"; + //directory.Name = directory.Id; + directory.AddChild(component); + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directory); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a performance category. + /// + /// The name of the performance category. + /// A harvested file. + public Util.PerformanceCategory HarvestPerformanceCategory(string category) + { + if (null == category) + { + throw new ArgumentNullException("category"); + } + + if (PerformanceCounterCategory.Exists(category)) + { + Util.PerformanceCategory perfCategory = new Util.PerformanceCategory(); + + // Get the performance counter category and set the appropriate WiX attributes + PerformanceCounterCategory pcc = PerformanceCounterCategory.GetCategories().Single(c => string.Equals(c.CategoryName, category)); + perfCategory.Id = this.Core.CreateIdentifierFromFilename(pcc.CategoryName); + perfCategory.Name = pcc.CategoryName; + perfCategory.Help = pcc.CategoryHelp; + if (PerformanceCounterCategoryType.MultiInstance == pcc.CategoryType) + { + perfCategory.MultiInstance = Util.YesNoType.yes; + } + + // If it's multi-instance, check if there are any instances and get counters from there; else we get + // the counters straight up. For multi-instance, GetCounters() fails if there are any instances. If there + // are no instances, then GetCounters(instance) can't be called since there is no instance. Instances + // will exist for each counter even if only one of the counters was "intialized." + string[] instances = pcc.GetInstanceNames(); + bool hasInstances = instances.Length > 0; + PerformanceCounter[] counters = hasInstances + ? pcc.GetCounters(instances.First()) + : pcc.GetCounters(); + + foreach (PerformanceCounter counter in counters) + { + Util.PerformanceCounter perfCounter = new Util.PerformanceCounter(); + + // Get the performance counter and set the appropriate WiX attributes + perfCounter.Name = counter.CounterName; + perfCounter.Type = this.CounterTypeToWix(counter.CounterType); + perfCounter.Help = counter.CounterHelp; + + perfCategory.AddChild(perfCounter); + } + + return perfCategory; + } + else + { + throw new WixException(HarvesterErrors.PerformanceCategoryNotFound(category)); + } + } + + /// + /// Get the WiX performance counter type. + /// + /// The performance counter value to get. + /// The WiX performance counter type. + private Util.PerformanceCounterTypesType CounterTypeToWix(PerformanceCounterType pct) + { + Util.PerformanceCounterTypesType type; + + switch (pct) + { + case PerformanceCounterType.AverageBase: + type = Util.PerformanceCounterTypesType.averageBase; + break; + case PerformanceCounterType.AverageCount64: + type = Util.PerformanceCounterTypesType.averageCount64; + break; + case PerformanceCounterType.AverageTimer32: + type = Util.PerformanceCounterTypesType.averageTimer32; + break; + case PerformanceCounterType.CounterDelta32: + type = Util.PerformanceCounterTypesType.counterDelta32; + break; + case PerformanceCounterType.CounterTimerInverse: + type = Util.PerformanceCounterTypesType.counterTimerInverse; + break; + case PerformanceCounterType.SampleFraction: + type = Util.PerformanceCounterTypesType.sampleFraction; + break; + case PerformanceCounterType.Timer100Ns: + type = Util.PerformanceCounterTypesType.timer100Ns; + break; + case PerformanceCounterType.CounterTimer: + type = Util.PerformanceCounterTypesType.counterTimer; + break; + case PerformanceCounterType.RawFraction: + type = Util.PerformanceCounterTypesType.rawFraction; + break; + case PerformanceCounterType.Timer100NsInverse: + type = Util.PerformanceCounterTypesType.timer100NsInverse; + break; + case PerformanceCounterType.CounterMultiTimer: + type = Util.PerformanceCounterTypesType.counterMultiTimer; + break; + case PerformanceCounterType.CounterMultiTimer100Ns: + type = Util.PerformanceCounterTypesType.counterMultiTimer100Ns; + break; + case PerformanceCounterType.CounterMultiTimerInverse: + type = Util.PerformanceCounterTypesType.counterMultiTimerInverse; + break; + case PerformanceCounterType.CounterMultiTimer100NsInverse: + type = Util.PerformanceCounterTypesType.counterMultiTimer100NsInverse; + break; + case PerformanceCounterType.ElapsedTime: + type = Util.PerformanceCounterTypesType.elapsedTime; + break; + case PerformanceCounterType.SampleBase: + type = Util.PerformanceCounterTypesType.sampleBase; + break; + case PerformanceCounterType.RawBase: + type = Util.PerformanceCounterTypesType.rawBase; + break; + case PerformanceCounterType.CounterMultiBase: + type = Util.PerformanceCounterTypesType.counterMultiBase; + break; + case PerformanceCounterType.RateOfCountsPerSecond64: + type = Util.PerformanceCounterTypesType.rateOfCountsPerSecond64; + break; + case PerformanceCounterType.RateOfCountsPerSecond32: + type = Util.PerformanceCounterTypesType.rateOfCountsPerSecond32; + break; + case PerformanceCounterType.CountPerTimeInterval64: + type = Util.PerformanceCounterTypesType.countPerTimeInterval64; + break; + case PerformanceCounterType.CountPerTimeInterval32: + type = Util.PerformanceCounterTypesType.countPerTimeInterval32; + break; + case PerformanceCounterType.SampleCounter: + type = Util.PerformanceCounterTypesType.sampleCounter; + break; + case PerformanceCounterType.CounterDelta64: + type = Util.PerformanceCounterTypesType.counterDelta64; + break; + case PerformanceCounterType.NumberOfItems64: + type = Util.PerformanceCounterTypesType.numberOfItems64; + break; + case PerformanceCounterType.NumberOfItems32: + type = Util.PerformanceCounterTypesType.numberOfItems32; + break; + case PerformanceCounterType.NumberOfItemsHEX64: + type = Util.PerformanceCounterTypesType.numberOfItemsHEX64; + break; + case PerformanceCounterType.NumberOfItemsHEX32: + type = Util.PerformanceCounterTypesType.numberOfItemsHEX32; + break; + default: + throw new WixException(HarvesterErrors.UnsupportedPerformanceCounterType(pct.ToString())); + } + + return type; + } + } +} diff --git a/src/wix/heat/Program.cs b/src/wix/heat/Program.cs new file mode 100644 index 00000000..d0bcf19f --- /dev/null +++ b/src/wix/heat/Program.cs @@ -0,0 +1,78 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools.Heat +{ + using System; + using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Core; + using WixToolset.Core.Burn; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters; + using WixToolset.Tools.Core; + + /// + /// Wix Toolset Harvester. + /// + public sealed class Program + { + /// + /// The main entry point for the application. + /// + /// Commandline arguments for the application. + /// Returns the application error code. + [MTAThread] + public static async Task Main(string[] args) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() + .AddBundleBackend(); + var listener = new ConsoleMessageListener("HEAT", "heat.exe"); + + try + { + var program = new Program(); + return await program.Run(serviceProvider, listener, args); + } + catch (WixException e) + { + listener.Write(e.Error); + + return e.Error.Id; + } + catch (Exception e) + { + listener.Write(ErrorMessages.UnexpectedException(e)); + + if (e is NullReferenceException || e is SEHException) + { + throw; + } + + return e.HResult; + } + } + + /// + /// Run the application with the given arguments. + /// + /// Service provider to use throughout this execution. + /// The commandline arguments. + /// Returns the application error code. + public Task Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args) + { + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var arguments = serviceProvider.GetService(); + arguments.Populate(args); + + var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider); + var command = commandLine.ParseStandardCommandLine(arguments); + return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); + } + } +} diff --git a/src/wix/heat/RegFileHarvester.cs b/src/wix/heat/RegFileHarvester.cs new file mode 100644 index 00000000..a3d181f2 --- /dev/null +++ b/src/wix/heat/RegFileHarvester.cs @@ -0,0 +1,438 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Globalization; + using System.IO; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for a reg file. + /// + internal class RegFileHarvester : BaseHarvesterExtension + { + private static readonly string ComponentPrefix = "cmp"; + + /// + /// Current line in the reg file being processed. + /// + private int currentLineNumber = 0; + + /// + /// Flag indicating whether this is a unicode registry file. + /// + private bool unicodeRegistry; + + /// + /// Harvest a file. + /// + /// The path of the file. + /// A harvested file. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + // Harvest the keys from the registry file + Wix.Fragment fragment = this.HarvestRegFile(argument); + + return new Wix.Fragment[] { fragment }; + } + + /// + /// Harvest a reg file. + /// + /// The path of the file. + /// A harvested registy file. + public Wix.Fragment HarvestRegFile(string path) + { + if (null == path) + { + throw new ArgumentNullException("path"); + } + + if (!File.Exists(path)) + { + throw new WixException(HarvesterErrors.FileNotFound(path)); + } + + Wix.Directory directory = new Wix.Directory(); + directory.Id = "TARGETDIR"; + + // Use absolute paths + path = Path.GetFullPath(path); + FileInfo file = new FileInfo(path); + + using (StreamReader sr = file.OpenText()) + { + string line; + this.currentLineNumber = 0; + + while (null != (line = this.GetNextLine(sr))) + { + if (line.StartsWith(@"Windows Registry Editor Version 5.00")) + { + this.unicodeRegistry = true; + } + else if (line.StartsWith(@"REGEDIT4")) + { + this.unicodeRegistry = false; + } + else if (line.StartsWith(@"[HKEY_CLASSES_ROOT\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKCR, line.Substring(19, line.Length - 20)); + } + else if (line.StartsWith(@"[HKEY_CURRENT_USER\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKCU, line.Substring(19, line.Length - 20)); + } + else if (line.StartsWith(@"[HKEY_LOCAL_MACHINE\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKLM, line.Substring(20, line.Length - 21)); + } + else if (line.StartsWith(@"[HKEY_USERS\")) + { + this.ConvertKey(sr, ref directory, Wix.RegistryRootType.HKU, line.Substring(12, line.Length - 13)); + } + } + } + + Console.WriteLine("Processing complete"); + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(directory); + + return fragment; + } + + /// + /// Converts the registry key to a WiX component element. + /// + /// The registry file stream. + /// A WiX directory reference. + /// The root key. + /// The current line. + private void ConvertKey(StreamReader sr, ref Wix.Directory directory, Wix.RegistryRootType root, string line) + { + Wix.Component component = new Wix.Component(); + + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, line); + component.KeyPath = Wix.YesNoType.yes; + + this.ConvertValues(sr, ref component, root, line); + directory.AddChild(component); + } + + /// + /// Converts the registry values to WiX regisry key element. + /// + /// The registry file stream. + /// A WiX component reference. + /// The root key. + /// The current line. + private void ConvertValues(StreamReader sr, ref Wix.Component component, Wix.RegistryRootType root, string line) + { + string name = null; + string value = null; + Wix.RegistryValue.TypeType type; + Wix.RegistryKey registryKey = new Wix.RegistryKey(); + + registryKey.Root = root; + registryKey.Key = line; + + while (this.GetValue(sr, ref name, ref value, out type)) + { + Wix.RegistryValue registryValue = new Wix.RegistryValue(); + ArrayList charArray; + + // Don't specifiy name for default attribute + if (!string.IsNullOrEmpty(name)) + { + registryValue.Name = name; + } + + registryValue.Type = type; + + switch (type) + { + case Wix.RegistryValue.TypeType.binary: + registryValue.Value = value.Replace(",", string.Empty).ToUpper(); + break; + + case Wix.RegistryValue.TypeType.integer: + registryValue.Value = Int32.Parse(value, NumberStyles.HexNumber).ToString(); + break; + + case Wix.RegistryValue.TypeType.expandable: + charArray = this.ConvertCharList(value); + value = string.Empty; + + // create the string, remove the terminating null + for (int i = 0; i < charArray.Count; i++) + { + if ('\0' != (char)charArray[i]) + { + value += charArray[i]; + } + } + + registryValue.Value = value; + break; + + case Wix.RegistryValue.TypeType.multiString: + charArray = this.ConvertCharList(value); + value = string.Empty; + + // Convert the character array to a string so we can simply split it at the nulls, ignore the final null null. + for (int i = 0; i < (charArray.Count - 2); i++) + { + value += charArray[i]; + } + + // Although the value can use [~] the preffered way is to use MultiStringValue + string[] parts = value.Split("\0".ToCharArray()); + foreach (string part in parts) + { + Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); + multiStringValue.Content = part; + registryValue.AddChild(multiStringValue); + } + + break; + + case Wix.RegistryValue.TypeType.@string: + // Remove \\ and \" + value = value.ToString().Replace("\\\"", "\""); + value = value.ToString().Replace(@"\\", @"\"); + // Escape [ and ] + value = value.ToString().Replace(@"[", @"[\[]"); + value = value.ToString().Replace(@"]", @"[\]]"); + // This undoes the duplicate escaping caused by the second replace + value = value.ToString().Replace(@"[\[[\]]", @"[\[]"); + // Escape $ + value = value.ToString().Replace(@"$", @"$$"); + + registryValue.Value = value; + break; + + default: + throw new ApplicationException(String.Format("Did not recognize the type of reg value on line {0}", this.currentLineNumber)); + } + + registryKey.AddChild(registryValue); + } + + // Make sure empty keys are created + if (null == value) + { + registryKey.ForceCreateOnInstall = Wix.YesNoType.yes; + } + + component.AddChild(registryKey); + } + + /// + /// Parse a value from a line. + /// + /// Reader for the reg file. + /// Name of the value. + /// Value of the value. + /// Type of the value. + /// true if the value can be parsed, false otherwise. + private bool GetValue(StreamReader sr, ref string name, ref string value, out Wix.RegistryValue.TypeType type) + { + string line = this.GetNextLine(sr); + + if (null == line || 0 == line.Length) + { + type = 0; + return false; + } + + string[] parts; + + if (line.StartsWith("@")) + { + // Special case for default value + parts = line.Trim().Split("=".ToCharArray(), 2); + + name = null; + } + else + { + parts = line.Trim().Split("=".ToCharArray()); + + // It is valid to have an '=' in the name or the data. This is probably a string so the separator will be '"="'. + if (2 != parts.Length) + { + string[] stringSeparator = new string[] { "\"=\"" }; + parts = line.Trim().Split(stringSeparator, StringSplitOptions.None); + + if (2 != parts.Length) + { + // Line still no parsed correctly + throw new ApplicationException(String.Format("Cannot parse value: {0} at line {1}.", line, this.currentLineNumber)); + } + + // Put back quotes stripped by Split() + parts[0] += "\""; + parts[1] = "\"" + parts[1]; + } + + name = parts[0].Substring(1, parts[0].Length - 2); + } + + if (parts[1].StartsWith("hex:")) + { + // binary + value = parts[1].Substring(4); + type = Wix.RegistryValue.TypeType.binary; + } + else if (parts[1].StartsWith("dword:")) + { + // dword + value = parts[1].Substring(6); + type = Wix.RegistryValue.TypeType.integer; + } + else if (parts[1].StartsWith("hex(2):")) + { + // expandable string + value = parts[1].Substring(7); + type = Wix.RegistryValue.TypeType.expandable; + } + else if (parts[1].StartsWith("hex(7):")) + { + // multi-string + value = parts[1].Substring(7); + type = Wix.RegistryValue.TypeType.multiString; + } + else if (parts[1].StartsWith("hex(")) + { + // Give a better error when we find something that isn't supported + // by specifying the type that isn't supported. + string unsupportedType = ""; + + if (parts[1].StartsWith("hex(0")) { unsupportedType = "REG_NONE"; } + else if (parts[1].StartsWith("hex(6")) { unsupportedType = "REG_LINK"; } + else if (parts[1].StartsWith("hex(8")) { unsupportedType = "REG_RESOURCE_LIST"; } + else if (parts[1].StartsWith("hex(9")) { unsupportedType = "REG_FULL_RESOURCE_DESCRIPTOR"; } + else if (parts[1].StartsWith("hex(a")) { unsupportedType = "REG_RESOURCE_REQUIREMENTS_LIST"; } + else if (parts[1].StartsWith("hex(b")) { unsupportedType = "REG_QWORD"; } + + // REG_NONE(0), REG_LINK(6), REG_RESOURCE_LIST(8), REG_FULL_RESOURCE_DESCRIPTOR(9), REG_RESOURCE_REQUIREMENTS_LIST(a), REG_QWORD(b) + this.Core.Messaging.Write(HarvesterWarnings.UnsupportedRegistryType(parts[0], this.currentLineNumber, unsupportedType)); + + type = 0; + return false; + } + else if (parts[1].StartsWith("\"")) + { + // string + value = parts[1].Substring(1, parts[1].Length - 2); + type = Wix.RegistryValue.TypeType.@string; + } + else + { + // unsupported value + throw new ApplicationException(String.Format("Unsupported registry value {0} at line {1}.", line, this.currentLineNumber)); + } + + return true; + } + + /// + /// Get the next line from the reg file input stream. + /// + /// Reader for the reg file. + /// The next line. + private string GetNextLine(StreamReader sr) + { + string line; + string totalLine = null; + + while (null != (line = sr.ReadLine())) + { + bool stop = true; + + this.currentLineNumber++; + line = line.Trim(); + Console.Write("Processing line: {0}\r", this.currentLineNumber); + + if (line.EndsWith("\\")) + { + stop = false; + line = line.Substring(0, line.Length - 1); + } + + if (null == totalLine) + { + // first line + totalLine = line; + } + else + { + // other lines + totalLine += line; + } + + // break if there is no more info for this line + if (stop) + { + break; + } + } + + return totalLine; + } + + /// + /// Convert a character list into the proper WiX format for either unicode or ansi lists. + /// + /// List of characters. + /// Array of characters. + private ArrayList ConvertCharList(string charList) + { + if (string.IsNullOrEmpty(charList)) + { + return new ArrayList(); + } + + string[] strChars = charList.Split(",".ToCharArray()); + + ArrayList charArray = new ArrayList(); + + if (this.unicodeRegistry) + { + if (0 != strChars.Length % 2) + { + throw new ApplicationException(String.Format("Problem parsing Expandable string data at line {0}, its probably not Unicode.", this.currentLineNumber)); + } + + for (int i = 0; i < strChars.Length; i += 2) + { + string chars = strChars[i + 1] + strChars[i]; + int unicodeInt = Int32.Parse(chars, NumberStyles.HexNumber); + char unicodeChar = (char)unicodeInt; + charArray.Add(unicodeChar); + } + } + else + { + for (int i = 0; i < strChars.Length; i++) + { + char charValue = (char)Int32.Parse(strChars[i], NumberStyles.HexNumber); + charArray.Add(charValue); + } + } + + return charArray; + } + } +} diff --git a/src/wix/heat/RegistryHarvester.cs b/src/wix/heat/RegistryHarvester.cs new file mode 100644 index 00000000..d416236c --- /dev/null +++ b/src/wix/heat/RegistryHarvester.cs @@ -0,0 +1,477 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Diagnostics; + using System.Globalization; + using System.Runtime.InteropServices; + using System.Text; + using Microsoft.Win32; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from the registry. + /// + internal class RegistryHarvester : IDisposable + { + private const string HKCRPathInHKLM = @"Software\Classes"; + private string remappedPath; + private static readonly int majorOSVersion = Environment.OSVersion.Version.Major; + private RegistryKey regKeyToOverride = Registry.LocalMachine; + private IntPtr regRootToOverride = NativeMethods.HkeyLocalMachine; + + /// + /// Instantiate a new RegistryHarvester. + /// + /// Set to true to remap the entire registry to a private location for this process. + public RegistryHarvester(bool remap) + { + // Detect OS major version and set the hive to use when + // redirecting registry writes. We want to redirect registry + // writes to HKCU on Windows Vista and higher to avoid UAC + // problems, and to HKLM on downlevel OS's. + if (majorOSVersion >= 6) + { + this.regKeyToOverride = Registry.CurrentUser; + this.regRootToOverride = NativeMethods.HkeyCurrentUser; + } + + // create a path in the registry for redirected keys which is process-specific + if (remap) + { + this.remappedPath = String.Concat(@"SOFTWARE\WiX\heat\", Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture)); + + // remove the previous remapped key if it exists + this.RemoveRemappedKey(); + + // remap the registry roots supported by MSI + // note - order is important here - the hive being used to redirect + // to must be overridden last to avoid creating the other override + // hives in the wrong location in the registry. For example, if HKLM is + // the redirect destination, overriding it first will cause other hives + // to be overridden under HKLM\Software\WiX\heat\HKLM\Software\WiX\HKCR + // instead of under HKLM\Software\WiX\heat\HKCR + if (majorOSVersion < 6) + { + this.RemapRegistryKey(NativeMethods.HkeyClassesRoot, String.Concat(this.remappedPath, @"\\HKEY_CLASSES_ROOT")); + this.RemapRegistryKey(NativeMethods.HkeyCurrentUser, String.Concat(this.remappedPath, @"\\HKEY_CURRENT_USER")); + this.RemapRegistryKey(NativeMethods.HkeyUsers, String.Concat(this.remappedPath, @"\\HKEY_USERS")); + this.RemapRegistryKey(NativeMethods.HkeyLocalMachine, String.Concat(this.remappedPath, @"\\HKEY_LOCAL_MACHINE")); + } + else + { + this.RemapRegistryKey(NativeMethods.HkeyClassesRoot, String.Concat(this.remappedPath, @"\\HKEY_CLASSES_ROOT")); + this.RemapRegistryKey(NativeMethods.HkeyLocalMachine, String.Concat(this.remappedPath, @"\\HKEY_LOCAL_MACHINE")); + this.RemapRegistryKey(NativeMethods.HkeyUsers, String.Concat(this.remappedPath, @"\\HKEY_USERS")); + this.RemapRegistryKey(NativeMethods.HkeyCurrentUser, String.Concat(this.remappedPath, @"\\HKEY_CURRENT_USER")); + + // Typelib registration on Windows Vista requires that the key + // HKLM\Software\Classes exist, so add it to the remapped root + Registry.LocalMachine.CreateSubKey(HKCRPathInHKLM); + } + } + } + + /// + /// Close the RegistryHarvester and remove any remapped registry keys. + /// + public void Close() + { + // note - order is important here - we must quit overriding the hive + // being used to redirect first + if (majorOSVersion < 6) + { + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyLocalMachine, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyClassesRoot, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyCurrentUser, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyUsers, IntPtr.Zero); + } + else + { + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyCurrentUser, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyClassesRoot, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyLocalMachine, IntPtr.Zero); + NativeMethods.OverrideRegistryKey(NativeMethods.HkeyUsers, IntPtr.Zero); + } + + this.RemoveRemappedKey(); + } + + /// + /// Dispose the RegistryHarvester. + /// + public void Dispose() + { + this.Close(); + } + + /// + /// Harvest all registry roots supported by Windows Installer. + /// + /// The registry keys and values in the registry. + public Wix.RegistryValue[] HarvestRegistry() + { + ArrayList registryValues = new ArrayList(); + + this.HarvestRegistryKey(Registry.ClassesRoot, registryValues); + this.HarvestRegistryKey(Registry.CurrentUser, registryValues); + this.HarvestRegistryKey(Registry.LocalMachine, registryValues); + this.HarvestRegistryKey(Registry.Users, registryValues); + + return (Wix.RegistryValue[])registryValues.ToArray(typeof(Wix.RegistryValue)); + } + + /// + /// Harvest a registry key. + /// + /// The path of the registry key to harvest. + /// The registry keys and values under the key. + public Wix.RegistryValue[] HarvestRegistryKey(string path) + { + RegistryKey registryKey = null; + ArrayList registryValues = new ArrayList(); + + string[] parts = GetPathParts(path); + + try + { + switch (parts[0]) + { + case "HKEY_CLASSES_ROOT": + registryKey = Registry.ClassesRoot; + break; + case "HKEY_CURRENT_USER": + registryKey = Registry.CurrentUser; + break; + case "HKEY_LOCAL_MACHINE": + registryKey = Registry.LocalMachine; + break; + case "HKEY_USERS": + registryKey = Registry.Users; + break; + default: + // TODO: put a better exception here + throw new Exception(); + } + + if (1 < parts.Length) + { + registryKey = registryKey.OpenSubKey(parts[1]); + + if (null == registryKey) + { + throw new WixException(HarvesterErrors.UnableToOpenRegistryKey(parts[1])); + } + } + + this.HarvestRegistryKey(registryKey, registryValues); + } + finally + { + if (null != registryKey) + { + registryKey.Close(); + } + } + + return (Wix.RegistryValue[])registryValues.ToArray(typeof(Wix.RegistryValue)); + } + + /// + /// Gets the parts of a registry key's path. + /// + /// The registry key path. + /// The root and key parts of the registry key path. + private static string[] GetPathParts(string path) + { + return path.Split(@"\".ToCharArray(), 2); + } + + /// + /// Harvest a registry key. + /// + /// The registry key to harvest. + /// The collected registry values. + private void HarvestRegistryKey(RegistryKey registryKey, ArrayList registryValues) + { + // harvest the sub-keys + foreach (string subKeyName in registryKey.GetSubKeyNames()) + { + using (RegistryKey subKey = registryKey.OpenSubKey(subKeyName)) + { + this.HarvestRegistryKey(subKey, registryValues); + } + } + + string[] parts = GetPathParts(registryKey.Name); + + Wix.RegistryRootType root; + switch (parts[0]) + { + case "HKEY_CLASSES_ROOT": + root = Wix.RegistryRootType.HKCR; + break; + case "HKEY_CURRENT_USER": + root = Wix.RegistryRootType.HKCU; + break; + case "HKEY_LOCAL_MACHINE": + // HKLM\Software\Classes is equivalent to HKCR + if (1 < parts.Length && parts[1].StartsWith(HKCRPathInHKLM, StringComparison.OrdinalIgnoreCase)) + { + root = Wix.RegistryRootType.HKCR; + parts[1] = parts[1].Remove(0, HKCRPathInHKLM.Length); + + if (0 < parts[1].Length) + { + parts[1] = parts[1].TrimStart('\\'); + } + + if (String.IsNullOrEmpty(parts[1])) + { + parts = new [] { parts[0] }; + } + } + else + { + root = Wix.RegistryRootType.HKLM; + } + break; + case "HKEY_USERS": + root = Wix.RegistryRootType.HKU; + break; + default: + // TODO: put a better exception here + throw new Exception(); + } + + // harvest the values + foreach (string valueName in registryKey.GetValueNames()) + { + Wix.RegistryValue registryValue = new Wix.RegistryValue(); + + registryValue.Action = Wix.RegistryValue.ActionType.write; + + registryValue.Root = root; + + if (1 < parts.Length) + { + registryValue.Key = parts[1]; + } + + if (null != valueName && 0 < valueName.Length) + { + registryValue.Name = valueName; + } + + object value = registryKey.GetValue(valueName); + + if (value is byte[]) // binary + { + StringBuilder hexadecimalValue = new StringBuilder(); + + // convert the byte array to hexadecimal + foreach (byte byteValue in (byte[])value) + { + hexadecimalValue.Append(byteValue.ToString("X2", CultureInfo.InvariantCulture.NumberFormat)); + } + + registryValue.Type = Wix.RegistryValue.TypeType.binary; + registryValue.Value = hexadecimalValue.ToString(); + } + else if (value is int) // integer + { + registryValue.Type = Wix.RegistryValue.TypeType.integer; + registryValue.Value = ((int)value).ToString(CultureInfo.InvariantCulture); + } + else if (value is string[]) // multi-string + { + registryValue.Type = Wix.RegistryValue.TypeType.multiString; + + if (0 == ((string[])value).Length) + { + Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); + + multiStringValue.Content = String.Empty; + + registryValue.AddChild(multiStringValue); + } + else + { + foreach (string multiStringValueContent in (string[])value) + { + Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); + + multiStringValue.Content = multiStringValueContent; + + registryValue.AddChild(multiStringValue); + } + } + } + else if (value is string) // string, expandable (there is no way to differentiate a string and expandable value in .NET 1.1) + { + registryValue.Type = Wix.RegistryValue.TypeType.@string; + registryValue.Value = (string)value; + } + else + { + // TODO: put a better exception here + throw new Exception(); + } + + registryValues.Add(registryValue); + } + + // If there were no subkeys and no values, we still need an element for this empty registry key. + // But specifically avoid SOFTWARE\Classes because it shouldn't be harvested as an empty key. + if (parts.Length > 1 && registryKey.SubKeyCount == 0 && registryKey.ValueCount == 0 && + !String.Equals(parts[1], HKCRPathInHKLM, StringComparison.OrdinalIgnoreCase)) + { + Wix.RegistryValue emptyRegistryKey = new Wix.RegistryValue(); + emptyRegistryKey.Root = root; + emptyRegistryKey.Key = parts[1]; + emptyRegistryKey.Type = Wix.RegistryValue.TypeType.@string; + emptyRegistryKey.Value = String.Empty; + emptyRegistryKey.Action = Wix.RegistryValue.ActionType.write; + registryValues.Add(emptyRegistryKey); + } + } + + /// + /// Remap a registry key to an alternative location. + /// + /// The registry key to remap. + /// The path to remap the registry key to under HKLM. + private void RemapRegistryKey(IntPtr registryKey, string remappedPath) + { + IntPtr remappedKey = IntPtr.Zero; + + try + { + remappedKey = NativeMethods.OpenRegistryKey(this.regRootToOverride, remappedPath); + + NativeMethods.OverrideRegistryKey(registryKey, remappedKey); + } + finally + { + if (IntPtr.Zero != remappedKey) + { + NativeMethods.CloseRegistryKey(remappedKey); + } + } + } + + /// + /// Remove the remapped registry key. + /// + private void RemoveRemappedKey() + { + try + { + this.regKeyToOverride.DeleteSubKeyTree(this.remappedPath); + } + catch (ArgumentException) + { + // ignore the error where the key does not exist + } + } + + /// + /// The native methods for re-mapping registry keys. + /// + private sealed class NativeMethods + { + internal static readonly IntPtr HkeyClassesRoot = (IntPtr)unchecked((Int32)0x80000000); + internal static readonly IntPtr HkeyCurrentUser = (IntPtr)unchecked((Int32)0x80000001); + internal static readonly IntPtr HkeyLocalMachine = (IntPtr)unchecked((Int32)0x80000002); + internal static readonly IntPtr HkeyUsers = (IntPtr)unchecked((Int32)0x80000003); + + private const uint GenericRead = 0x80000000; + private const uint GenericWrite = 0x40000000; + private const uint GenericExecute = 0x20000000; + private const uint GenericAll = 0x10000000; + private const uint StandardRightsAll = 0x001F0000; + + /// + /// Opens a registry key. + /// + /// Base key to open. + /// Path to subkey to open. + /// Handle to new key. + internal static IntPtr OpenRegistryKey(IntPtr key, string path) + { + IntPtr newKey = IntPtr.Zero; + uint disposition = 0; + uint sam = StandardRightsAll | GenericRead | GenericWrite | GenericExecute | GenericAll; + + if (0 != RegCreateKeyEx(key, path, 0, null, 0, sam, 0, out newKey, out disposition)) + { + throw new Exception(); + } + + return newKey; + } + + /// + /// Closes a previously open registry key. + /// + /// Handle to key to close. + internal static void CloseRegistryKey(IntPtr key) + { + if (0 != RegCloseKey(key)) + { + throw new Exception(); + } + } + + /// + /// Override a registry key. + /// + /// Handle of the key to override. + /// Handle to override key. + internal static void OverrideRegistryKey(IntPtr key, IntPtr newKey) + { + if (0 != RegOverridePredefKey(key, newKey)) + { + throw new Exception(); + } + } + + /// + /// Interop to RegCreateKeyW. + /// + /// Handle to base key. + /// Subkey to create. + /// Always 0 + /// Just pass null. + /// Just pass 0. + /// Rights to registry key. + /// Just pass null. + /// Opened key. + /// Whether key was opened or created. + /// Handle to registry key. + [DllImport("advapi32.dll", EntryPoint = "RegCreateKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static extern int RegCreateKeyEx(IntPtr key, string subkey, uint reserved, string className, uint options, uint desiredSam, uint securityAttributes, out IntPtr openedKey, out uint disposition); + + /// + /// Interop to RegCloseKey. + /// + /// Handle to key to close. + /// 0 if success. + [DllImport("advapi32.dll", EntryPoint = "RegCloseKey", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static extern int RegCloseKey(IntPtr key); + + /// + /// Interop to RegOverridePredefKey. + /// + /// Handle to key to override. + /// Handle to override key. + /// 0 if success. + [DllImport("advapi32.dll", EntryPoint = "RegOverridePredefKey", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static extern int RegOverridePredefKey(IntPtr key, IntPtr newKey); + } + } +} diff --git a/src/wix/heat/Serialize/CodeDomInterfaces.cs b/src/wix/heat/Serialize/CodeDomInterfaces.cs new file mode 100644 index 00000000..bd674db6 --- /dev/null +++ b/src/wix/heat/Serialize/CodeDomInterfaces.cs @@ -0,0 +1,96 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.Collections; + using System.Xml; + + /// + /// Interface for generated schema elements. + /// + public interface ISchemaElement + { + /// + /// Gets and sets the parent of this element. May be null. + /// + /// An ISchemaElement that has this element as a child. + ISchemaElement ParentElement + { + get; + set; + } + + /// + /// Outputs xml representing this element, including the associated attributes + /// and any nested elements. + /// + /// XmlWriter to be used when outputting the element. + void OutputXml(XmlWriter writer); + } + + /// + /// Interface for generated schema elements. Implemented by elements that have child + /// elements. + /// + public interface IParentElement + { + /// + /// Gets an enumerable collection of the children of this element. + /// + /// An enumerable collection of the children of this element. + IEnumerable Children + { + get; + } + + /// + /// Gets an enumerable collection of the children of this element, filtered + /// by the passed in type. + /// + /// The type of children to retrieve. + IEnumerable this[Type childType] + { + get; + } + + /// + /// Adds a child to this element. + /// + /// Child to add. + void AddChild(ISchemaElement child); + + /// + /// Removes a child from this element. + /// + /// Child to remove. + void RemoveChild(ISchemaElement child); + } + + /// + /// Interface for generated schema elements. Implemented by classes with attributes. + /// + public interface ISetAttributes + { + /// + /// Sets the attribute with the given name to the given value. The value here is + /// a string, and is converted to the strongly-typed version inside this method. + /// + /// The name of the attribute to set. + /// The value to assign to the attribute. + void SetAttribute(string name, string value); + } + + /// + /// Interface for generated schema elements. Implemented by classes with children. + /// + public interface ICreateChildren + { + /// + /// Creates an instance of the child with the passed in name. + /// + /// String matching the element name of the child when represented in XML. + /// An instance of that child. + ISchemaElement CreateChild(string childName); + } +} diff --git a/src/wix/heat/Serialize/CodeDomReader.cs b/src/wix/heat/Serialize/CodeDomReader.cs new file mode 100644 index 00000000..0741bf68 --- /dev/null +++ b/src/wix/heat/Serialize/CodeDomReader.cs @@ -0,0 +1,162 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Reflection; + using System.Xml; + using WixToolset.Harvesters.Extensibility.Serialize; + + /// + /// Class used for reading XML files in to the CodeDom. + /// + public class CodeDomReader + { + private Assembly[] assemblies; + + /// + /// Creates a new CodeDomReader, using the current assembly. + /// + public CodeDomReader() + { + this.assemblies = new Assembly[] { Assembly.GetExecutingAssembly() }; + } + + /// + /// Creates a new CodeDomReader, and takes in a list of assemblies in which to + /// look for elements. + /// + /// Assemblies in which to look for types that correspond + /// to elements. + public CodeDomReader(Assembly[] assemblies) + { + this.assemblies = assemblies; + } + + /// + /// Loads an XML file into a strongly-typed code dom. + /// + /// File to load into the code dom. + /// The strongly-typed object at the root of the tree. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + public ISchemaElement Load(string filePath) + { + XmlDocument document = new XmlDocument(); + document.Load(filePath); + ISchemaElement schemaElement = null; + + foreach (XmlNode node in document.ChildNodes) + { + XmlElement element = node as XmlElement; + if (element != null) + { + if (schemaElement != null) + { + throw new InvalidOperationException(WixHarvesterStrings.EXP_MultipleRootElementsFoundInFile); + } + + schemaElement = this.CreateObjectFromElement(element); + this.ParseObjectFromElement(schemaElement, element); + } + } + return schemaElement; + } + + /// + /// Sets an attribute on an ISchemaElement. + /// + /// Schema element to set attribute on. + /// Name of the attribute to set. + /// Value to set on the attribute. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + private static void SetAttributeOnObject(ISchemaElement schemaElement, string name, string value) + { + ISetAttributes setAttributes = schemaElement as ISetAttributes; + if (setAttributes == null) + { + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_ISchemaElementDoesnotImplementISetAttribute, schemaElement.GetType().FullName)); + } + else + { + setAttributes.SetAttribute(name, value); + } + } + + /// + /// Parses an ISchemaElement from the XmlElement. + /// + /// ISchemaElement to fill in. + /// XmlElement to parse from. + [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")] + private void ParseObjectFromElement(ISchemaElement schemaElement, XmlElement element) + { + foreach (XmlAttribute attribute in element.Attributes) + { + SetAttributeOnObject(schemaElement, attribute.LocalName, attribute.Value); + } + + foreach (XmlNode node in element.ChildNodes) + { + XmlElement childElement = node as XmlElement; + if (childElement != null) + { + ISchemaElement childSchemaElement = null; + ICreateChildren createChildren = schemaElement as ICreateChildren; + if (createChildren == null) + { + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_ISchemaElementDoesnotImplementICreateChildren, element.LocalName)); + } + else + { + childSchemaElement = createChildren.CreateChild(childElement.LocalName); + } + + if (childSchemaElement == null) + { + childSchemaElement = this.CreateObjectFromElement(childElement); + if (childSchemaElement == null) + { + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixHarvesterStrings.EXP_XmlElementDoesnotHaveISchemaElement, childElement.LocalName)); + } + } + + this.ParseObjectFromElement(childSchemaElement, childElement); + IParentElement parentElement = (IParentElement)schemaElement; + parentElement.AddChild(childSchemaElement); + } + else + { + XmlText childText = node as XmlText; + if (childText != null) + { + SetAttributeOnObject(schemaElement, "Content", childText.Value); + } + } + } + } + + /// + /// Creates an object from an XML element by digging through the assembly list. + /// + /// XML Element to create an ISchemaElement from. + /// A constructed ISchemaElement. + private ISchemaElement CreateObjectFromElement(XmlElement element) + { + ISchemaElement schemaElement = null; + foreach (Assembly assembly in this.assemblies) + { + foreach (Type type in assembly.GetTypes()) + { + if (type.FullName.EndsWith(element.LocalName, StringComparison.Ordinal) + && typeof(ISchemaElement).IsAssignableFrom(type)) + { + schemaElement = (ISchemaElement)Activator.CreateInstance(type); + } + } + } + return schemaElement; + } + } +} diff --git a/src/wix/heat/Serialize/ElementCollection.cs b/src/wix/heat/Serialize/ElementCollection.cs new file mode 100644 index 00000000..bacbafbd --- /dev/null +++ b/src/wix/heat/Serialize/ElementCollection.cs @@ -0,0 +1,618 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.Collections; + using System.Globalization; + using WixToolset.Harvesters.Extensibility.Serialize; + + /// + /// Collection used in the CodeDOM for the children of a given element. Provides type-checking + /// on the allowed children to ensure that only allowed types are added. + /// + public class ElementCollection : ICollection, IEnumerable + { + private CollectionType collectionType; + private int totalContainedItems; + private int containersUsed; + private ArrayList items; + + /// + /// Creates a new element collection. + /// + /// Type of the collection to create. + public ElementCollection(CollectionType collectionType) + { + this.collectionType = collectionType; + this.items = new ArrayList(); + } + + /// + /// Enum representing types of XML collections. + /// + public enum CollectionType + { + /// + /// A choice type, corresponding to the XSD choice element. + /// + Choice, + + /// + /// A sequence type, corresponding to the XSD sequence element. + /// + Sequence + } + + /// + /// Gets the type of collection. + /// + /// The type of collection. + public CollectionType Type + { + get { return this.collectionType; } + } + + /// + /// Gets the count of child elements in this collection (counts ISchemaElements, not nested collections). + /// + /// The count of child elements in this collection (counts ISchemaElements, not nested collections). + public int Count + { + get { return this.totalContainedItems; } + } + + /// + /// Gets the flag specifying whether this collection is synchronized. Always returns false. + /// + /// The flag specifying whether this collection is synchronized. Always returns false. + public bool IsSynchronized + { + get { return false; } + } + + /// + /// Gets an object external callers can synchronize on. + /// + /// An object external callers can synchronize on. + public object SyncRoot + { + get { return this; } + } + + /// + /// Adds a child element to this collection. + /// + /// The element to add. + /// Thrown if the child is not of an allowed type. + public void AddElement(ISchemaElement element) + { + foreach (object obj in this.items) + { + bool containerUsed; + + CollectionItem collectionItem = obj as CollectionItem; + if (collectionItem != null) + { + containerUsed = collectionItem.Elements.Count != 0; + if (collectionItem.ElementType.IsAssignableFrom(element.GetType())) + { + collectionItem.AddElement(element); + + if (!containerUsed) + { + this.containersUsed++; + } + + this.totalContainedItems++; + return; + } + + continue; + } + + ElementCollection collection = obj as ElementCollection; + if (collection != null) + { + containerUsed = collection.Count != 0; + + try + { + collection.AddElement(element); + + if (!containerUsed) + { + this.containersUsed++; + } + + this.totalContainedItems++; + return; + } + catch (ArgumentException) + { + // Eat the exception and keep looking. We'll throw our own if we can't find its home. + } + + continue; + } + } + + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementOfTypeIsNotValidForThisCollection, + element.GetType().Name)); + } + + /// + /// Removes a child element from this collection. + /// + /// The element to remove. + /// Thrown if the element is not of an allowed type. + public void RemoveElement(ISchemaElement element) + { + foreach (object obj in this.items) + { + CollectionItem collectionItem = obj as CollectionItem; + if (collectionItem != null) + { + if (collectionItem.ElementType.IsAssignableFrom(element.GetType())) + { + if (collectionItem.Elements.Count == 0) + { + return; + } + + collectionItem.RemoveElement(element); + + if (collectionItem.Elements.Count == 0) + { + this.containersUsed--; + } + + this.totalContainedItems--; + return; + } + + continue; + } + + ElementCollection collection = obj as ElementCollection; + if (collection != null) + { + if (collection.Count == 0) + { + continue; + } + + try + { + collection.RemoveElement(element); + + if (collection.Count == 0) + { + this.containersUsed--; + } + + this.totalContainedItems--; + return; + } + catch (ArgumentException) + { + // Eat the exception and keep looking. We'll throw our own if we can't find its home. + } + + continue; + } + } + + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementOfTypeIsNotValidForThisCollection, + element.GetType().Name)); + } + + /// + /// Copies this collection to an array. + /// + /// Array to copy to. + /// Offset into the array. + public void CopyTo(Array array, int index) + { + int item = 0; + foreach (ISchemaElement element in this) + { + array.SetValue(element, (long)(item + index)); + item++; + } + } + + /// + /// Creates an enumerator for walking the elements in this collection. + /// + /// A newly created enumerator. + public IEnumerator GetEnumerator() + { + return new ElementCollectionEnumerator(this); + } + + /// + /// Gets an enumerable collection of children of a given type. + /// + /// Type of children to get. + /// A collection of children. + /// Thrown if the type isn't a valid child type. + public IEnumerable Filter(Type childType) + { + foreach (object container in this.items) + { + CollectionItem collectionItem = container as CollectionItem; + if (collectionItem != null) + { + if (collectionItem.ElementType.IsAssignableFrom(childType)) + { + return collectionItem.Elements; + } + + continue; + } + + ElementCollection elementCollection = container as ElementCollection; + if (elementCollection != null) + { + IEnumerable nestedFilter = elementCollection.Filter(childType); + if (nestedFilter != null) + { + return nestedFilter; + } + + continue; + } + } + + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_TypeIsNotValidForThisCollection, + childType.Name)); + } + + /// + /// Adds a type to this collection. + /// + /// CollectionItem representing the type to add. + public void AddItem(CollectionItem collectionItem) + { + this.items.Add(collectionItem); + } + + /// + /// Adds a nested collection to this collection. + /// + /// ElementCollection to add. + public void AddCollection(ElementCollection collection) + { + this.items.Add(collection); + } + + /// + /// Class used to represent a given type in the child collection of an element. Abstract, + /// has subclasses for choice and sequence (which can do cardinality checks). + /// + public abstract class CollectionItem + { + private Type elementType; + private ArrayList elements; + + /// + /// Creates a new CollectionItem for the given element type. + /// + /// Type of the element for this collection item. + protected CollectionItem(Type elementType) + { + this.elementType = elementType; + this.elements = new ArrayList(); + } + + /// + /// Gets the type of this collection's items. + /// + /// The type of this collection's items. + public Type ElementType + { + get { return this.elementType; } + } + + /// + /// Gets the elements of this collection. + /// + /// The elements of this collection. + public ArrayList Elements + { + get { return this.elements; } + } + + /// + /// Adds an element to this collection. Must be of an assignable type to the collection's + /// type. + /// + /// The element to add. + /// Thrown if the type isn't assignable to the collection's type. + public void AddElement(ISchemaElement element) + { + if (!this.elementType.IsAssignableFrom(element.GetType())) + { + throw new ArgumentException( + String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementIsSubclassOfDifferentType, + this.elementType.Name, + element.GetType().Name), + "element"); + } + + this.elements.Add(element); + } + + /// + /// Removes an element from this collection. + /// + /// The element to remove. + /// Thrown if the element's type isn't assignable to the collection's type. + public void RemoveElement(ISchemaElement element) + { + if (!this.elementType.IsAssignableFrom(element.GetType())) + { + throw new ArgumentException( + String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementIsSubclassOfDifferentType, + this.elementType.Name, + element.GetType().Name), + "element"); + } + + this.elements.Remove(element); + } + } + + /// + /// Class representing a choice item. Doesn't do cardinality checks. + /// + public class ChoiceItem : CollectionItem + { + /// + /// Creates a new choice item. + /// + /// Type of the created item. + public ChoiceItem(Type elementType) + : base(elementType) + { + } + } + + /// + /// Class representing a sequence item. Can do cardinality checks, if required. + /// + public class SequenceItem : CollectionItem + { + /// + /// Creates a new sequence item. + /// + /// Type of the created item. + public SequenceItem(Type elementType) + : base(elementType) + { + } + } + + /// + /// Enumerator for the ElementCollection. + /// + private class ElementCollectionEnumerator : IEnumerator + { + private ElementCollection collection; + private Stack collectionStack; + + /// + /// Creates a new ElementCollectionEnumerator. + /// + /// The collection to create an enumerator for. + public ElementCollectionEnumerator(ElementCollection collection) + { + this.collection = collection; + } + + /// + /// Gets the current object from the enumerator. + /// + public object Current + { + get + { + if (this.collectionStack != null && this.collectionStack.Count > 0) + { + CollectionSymbol symbol = (CollectionSymbol)this.collectionStack.Peek(); + object container = symbol.Collection.items[symbol.ContainerIndex]; + + CollectionItem collectionItem = container as CollectionItem; + if (collectionItem != null) + { + return collectionItem.Elements[symbol.ItemIndex]; + } + + throw new InvalidOperationException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_ElementMustBeChoiceItemOrSequenceItem, + container.GetType().Name)); + } + + return null; + } + } + + /// + /// Resets the enumerator to the beginning. + /// + public void Reset() + { + if (this.collectionStack != null) + { + this.collectionStack.Clear(); + this.collectionStack = null; + } + } + + /// + /// Moves the enumerator to the next item. + /// + /// True if there is a next item, false otherwise. + public bool MoveNext() + { + if (this.collectionStack == null) + { + if (this.collection.Count == 0) + { + return false; + } + + this.collectionStack = new Stack(); + this.collectionStack.Push(new CollectionSymbol(this.collection)); + } + + CollectionSymbol symbol = (CollectionSymbol)this.collectionStack.Peek(); + + if (this.FindNext(symbol)) + { + return true; + } + + this.collectionStack.Pop(); + if (this.collectionStack.Count == 0) + { + return false; + } + + return this.MoveNext(); + } + + /// + /// Pushes a collection onto the stack. + /// + /// The collection to push. + private void PushCollection(ElementCollection elementCollection) + { + if (elementCollection.Count <= 0) + { + throw new ArgumentException(String.Format( + CultureInfo.InvariantCulture, + WixHarvesterStrings.EXP_CollectionMustHaveAtLeastOneElement, + elementCollection.Count)); + } + + CollectionSymbol symbol = new CollectionSymbol(elementCollection); + this.collectionStack.Push(symbol); + this.FindNext(symbol); + } + + /// + /// Finds the next item from a given symbol. + /// + /// The symbol to start looking from. + /// True if a next element is found, false otherwise. + private bool FindNext(CollectionSymbol symbol) + { + object container = symbol.Collection.items[symbol.ContainerIndex]; + + CollectionItem collectionItem = container as CollectionItem; + if (collectionItem != null) + { + if (symbol.ItemIndex + 1 < collectionItem.Elements.Count) + { + symbol.ItemIndex++; + return true; + } + } + + ElementCollection elementCollection = container as ElementCollection; + if (elementCollection != null && elementCollection.Count > 0 && symbol.ItemIndex == -1) + { + symbol.ItemIndex++; + this.PushCollection(elementCollection); + return true; + } + + symbol.ItemIndex = 0; + + for (int i = symbol.ContainerIndex + 1; i < symbol.Collection.items.Count; ++i) + { + object nestedContainer = symbol.Collection.items[i]; + + CollectionItem nestedCollectionItem = nestedContainer as CollectionItem; + if (nestedCollectionItem != null) + { + if (nestedCollectionItem.Elements.Count > 0) + { + symbol.ContainerIndex = i; + return true; + } + } + + ElementCollection nestedElementCollection = nestedContainer as ElementCollection; + if (nestedElementCollection != null && nestedElementCollection.Count > 0) + { + symbol.ContainerIndex = i; + this.PushCollection(nestedElementCollection); + return true; + } + } + + return false; + } + + /// + /// Class representing a single point in the collection. Consists of an ElementCollection, + /// a container index, and an index into the container. + /// + private class CollectionSymbol + { + private ElementCollection collection; + private int containerIndex; + private int itemIndex = -1; + + /// + /// Creates a new CollectionSymbol. + /// + /// The collection for the symbol. + public CollectionSymbol(ElementCollection collection) + { + this.collection = collection; + } + + /// + /// Gets the collection for the symbol. + /// + public ElementCollection Collection + { + get { return this.collection; } + } + + /// + /// Gets and sets the index of the container in the collection. + /// + public int ContainerIndex + { + get { return this.containerIndex; } + set { this.containerIndex = value; } + } + + /// + /// Gets and sets the index of the item in the container. + /// + public int ItemIndex + { + get { return this.itemIndex; } + set { this.itemIndex = value; } + } + } + } + } +} diff --git a/src/wix/heat/Serialize/WixHarvesterStrings.Designer.cs b/src/wix/heat/Serialize/WixHarvesterStrings.Designer.cs new file mode 100644 index 00000000..6504a67b --- /dev/null +++ b/src/wix/heat/Serialize/WixHarvesterStrings.Designer.cs @@ -0,0 +1,153 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WixToolset.Harvesters.Extensibility.Serialize { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class WixHarvesterStrings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal WixHarvesterStrings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WixToolset.Harvesters.Extensibility.Serialize.WixHarvesterStrings", typeof(WixHarvesterStrings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Collection has {0} elements. Must have at least one.. + /// + internal static string EXP_CollectionMustHaveAtLeastOneElement { + get { + return ResourceManager.GetString("EXP_CollectionMustHaveAtLeastOneElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element must be a subclass of {0}, but was of type {1}.. + /// + internal static string EXP_ElementIsSubclassOfDifferentType { + get { + return ResourceManager.GetString("EXP_ElementIsSubclassOfDifferentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element of type {0} found in enumerator. Must be ChoiceItem or SequenceItem.. + /// + internal static string EXP_ElementMustBeChoiceItemOrSequenceItem { + get { + return ResourceManager.GetString("EXP_ElementMustBeChoiceItemOrSequenceItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element of type {0} is not valid for this collection.. + /// + internal static string EXP_ElementOfTypeIsNotValidForThisCollection { + get { + return ResourceManager.GetString("EXP_ElementOfTypeIsNotValidForThisCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ISchemaElement with name {0} does not implement ICreateChildren.. + /// + internal static string EXP_ISchemaElementDoesnotImplementICreateChildren { + get { + return ResourceManager.GetString("EXP_ISchemaElementDoesnotImplementICreateChildren", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ISchemaElement with name {0} does not implement ISetAttributes.. + /// + internal static string EXP_ISchemaElementDoesnotImplementISetAttribute { + get { + return ResourceManager.GetString("EXP_ISchemaElementDoesnotImplementISetAttribute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A Merge table FileCompression column contains an invalid value '{0}'.. + /// + internal static string EXP_MergeTableFileCompressionColumnContainsInvalidValue { + get { + return ResourceManager.GetString("EXP_MergeTableFileCompressionColumnContainsInvalidValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple root elements found in file.. + /// + internal static string EXP_MultipleRootElementsFoundInFile { + get { + return ResourceManager.GetString("EXP_MultipleRootElementsFoundInFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type {0} is not valid for this collection.. + /// + internal static string EXP_TypeIsNotValidForThisCollection { + get { + return ResourceManager.GetString("EXP_TypeIsNotValidForThisCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to XmlElement with name {0} does not have a corresponding ISchemaElement.. + /// + internal static string EXP_XmlElementDoesnotHaveISchemaElement { + get { + return ResourceManager.GetString("EXP_XmlElementDoesnotHaveISchemaElement", resourceCulture); + } + } + } +} diff --git a/src/wix/heat/Serialize/WixHarvesterStrings.resx b/src/wix/heat/Serialize/WixHarvesterStrings.resx new file mode 100644 index 00000000..5894a190 --- /dev/null +++ b/src/wix/heat/Serialize/WixHarvesterStrings.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + A Merge table FileCompression column contains an invalid value '{0}'. + + + Multiple root elements found in file. + + + ISchemaElement with name {0} does not implement ICreateChildren. + + + ISchemaElement with name {0} does not implement ISetAttributes. + + + XmlElement with name {0} does not have a corresponding ISchemaElement. + + + Element of type {0} is not valid for this collection. + + + Type {0} is not valid for this collection. + + + Collection has {0} elements. Must have at least one. + + + Element must be a subclass of {0}, but was of type {1}. + + + Element of type {0} found in enumerator. Must be ChoiceItem or SequenceItem. + + \ No newline at end of file diff --git a/src/wix/heat/Serialize/iis.cs b/src/wix/heat/Serialize/iis.cs new file mode 100644 index 00000000..3f2943f8 --- /dev/null +++ b/src/wix/heat/Serialize/iis.cs @@ -0,0 +1,5915 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 +namespace WixToolset.Harvesters.Serialize.IIs +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + using WixToolset.Harvesters.Serialize; + + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a YesNoDefaultType from a string. + /// + public static YesNoDefaultType ParseYesNoDefaultType(string value) + { + YesNoDefaultType parsedValue; + Enums.TryParseYesNoDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoDefaultType from a string. + /// + public static bool TryParseYesNoDefaultType(string value, out YesNoDefaultType parsedValue) + { + parsedValue = YesNoDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("default" == value)) + { + parsedValue = YesNoDefaultType.@default; + } + else + { + if (("no" == value)) + { + parsedValue = YesNoDefaultType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoDefaultType.yes; + } + else + { + parsedValue = YesNoDefaultType.IllegalValue; + return false; + } + } + } + return true; + } + } + + /// + /// Values of this type will either be "default", "yes", or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + @default, + + no, + + yes, + } + + /// + /// WebDirProperties used by one or more WebSites. Lists properties common to IIS web sites and vroots. Corresponding properties can be viewed through the IIS Manager snap-in. One property entry can be reused by multiple sites or vroots using the Id field as a reference, using WebVirtualDir.DirProperties, WebSite.DirProperties, or WebDir.DirProperties. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebDirProperties : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType writeField; + + private bool writeFieldSet; + + private YesNoType scriptField; + + private bool scriptFieldSet; + + private YesNoType executeField; + + private bool executeFieldSet; + + private YesNoType anonymousAccessField; + + private bool anonymousAccessFieldSet; + + private string anonymousUserField; + + private bool anonymousUserFieldSet; + + private YesNoType iIsControlledPasswordField; + + private bool iIsControlledPasswordFieldSet; + + private YesNoType windowsAuthenticationField; + + private bool windowsAuthenticationFieldSet; + + private YesNoType digestAuthenticationField; + + private bool digestAuthenticationFieldSet; + + private YesNoType basicAuthenticationField; + + private bool basicAuthenticationFieldSet; + + private YesNoType passportAuthenticationField; + + private bool passportAuthenticationFieldSet; + + private YesNoType logVisitsField; + + private bool logVisitsFieldSet; + + private YesNoType indexField; + + private bool indexFieldSet; + + private string defaultDocumentsField; + + private bool defaultDocumentsFieldSet; + + private YesNoType aspDetailedErrorField; + + private bool aspDetailedErrorFieldSet; + + private string httpExpiresField; + + private bool httpExpiresFieldSet; + + private long cacheControlMaxAgeField; + + private bool cacheControlMaxAgeFieldSet; + + private string cacheControlCustomField; + + private bool cacheControlCustomFieldSet; + + private YesNoType clearCustomErrorField; + + private bool clearCustomErrorFieldSet; + + private YesNoType accessSSLField; + + private bool accessSSLFieldSet; + + private YesNoType accessSSL128Field; + + private bool accessSSL128FieldSet; + + private YesNoType accessSSLMapCertField; + + private bool accessSSLMapCertFieldSet; + + private YesNoType accessSSLNegotiateCertField; + + private bool accessSSLNegotiateCertFieldSet; + + private YesNoType accessSSLRequireCertField; + + private bool accessSSLRequireCertFieldSet; + + private string authenticationProvidersField; + + private bool authenticationProvidersFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Write + { + get + { + return this.writeField; + } + set + { + this.writeFieldSet = true; + this.writeField = value; + } + } + + public YesNoType Script + { + get + { + return this.scriptField; + } + set + { + this.scriptFieldSet = true; + this.scriptField = value; + } + } + + public YesNoType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + /// + /// Sets the Enable Anonymous Access checkbox, which maps anonymous users to a Windows user account. When setting this to 'yes' you should also provide the user account using the AnonymousUser attribute, and determine what setting to use for the IIsControlledPassword attribute. Defaults to 'no.' + /// + public YesNoType AnonymousAccess + { + get + { + return this.anonymousAccessField; + } + set + { + this.anonymousAccessFieldSet = true; + this.anonymousAccessField = value; + } + } + + /// + /// Reference to the Id attribute on the User element to be used as the anonymous user for the directory. See the User element for more information. + /// + public string AnonymousUser + { + get + { + return this.anonymousUserField; + } + set + { + this.anonymousUserFieldSet = true; + this.anonymousUserField = value; + } + } + + /// + /// Sets whether IIS should control the password used for the Windows account specified in the AnonymousUser attribute. Defaults to 'no.' + /// + public YesNoType IIsControlledPassword + { + get + { + return this.iIsControlledPasswordField; + } + set + { + this.iIsControlledPasswordFieldSet = true; + this.iIsControlledPasswordField = value; + } + } + + /// + /// Sets the Windows Authentication option, which enables integrated Windows authentication to be used on the site. Defaults to 'no.' + /// + public YesNoType WindowsAuthentication + { + get + { + return this.windowsAuthenticationField; + } + set + { + this.windowsAuthenticationFieldSet = true; + this.windowsAuthenticationField = value; + } + } + + /// + /// Sets the Digest Authentication option, which allows using digest authentication with domain user accounts. Defaults to 'no.' + /// + public YesNoType DigestAuthentication + { + get + { + return this.digestAuthenticationField; + } + set + { + this.digestAuthenticationFieldSet = true; + this.digestAuthenticationField = value; + } + } + + /// + /// Sets the Basic Authentication option, which allows clients to provide credentials in plaintext over the wire. Defaults to 'no.' + /// + public YesNoType BasicAuthentication + { + get + { + return this.basicAuthenticationField; + } + set + { + this.basicAuthenticationFieldSet = true; + this.basicAuthenticationField = value; + } + } + + /// + /// Sets the Passport Authentication option, which allows clients to provide credentials via a .Net Passport account. Defaults to 'no.' + /// + public YesNoType PassportAuthentication + { + get + { + return this.passportAuthenticationField; + } + set + { + this.passportAuthenticationFieldSet = true; + this.passportAuthenticationField = value; + } + } + + /// + /// Sets whether visits to this site should be logged. Defaults to 'no.' + /// + public YesNoType LogVisits + { + get + { + return this.logVisitsField; + } + set + { + this.logVisitsFieldSet = true; + this.logVisitsField = value; + } + } + + /// + /// Sets the Index Resource option, which specifies whether this web directory should be indexed. Defaults to 'no.' + /// + public YesNoType Index + { + get + { + return this.indexField; + } + set + { + this.indexFieldSet = true; + this.indexField = value; + } + } + + /// + /// The list of default documents to set for this web directory, in comma-delimited format. + /// + public string DefaultDocuments + { + get + { + return this.defaultDocumentsField; + } + set + { + this.defaultDocumentsFieldSet = true; + this.defaultDocumentsField = value; + } + } + + /// + /// Sets the option for whether to send detailed ASP errors back to the client on script error. Default is 'no.' + /// + public YesNoType AspDetailedError + { + get + { + return this.aspDetailedErrorField; + } + set + { + this.aspDetailedErrorFieldSet = true; + this.aspDetailedErrorField = value; + } + } + + /// + /// Value to set the HttpExpires attribute to for a Web Dir in the metabase. + /// + public string HttpExpires + { + get + { + return this.httpExpiresField; + } + set + { + this.httpExpiresFieldSet = true; + this.httpExpiresField = value; + } + } + + /// + /// Integer value specifying the cache control maximum age value. + /// + public long CacheControlMaxAge + { + get + { + return this.cacheControlMaxAgeField; + } + set + { + this.cacheControlMaxAgeFieldSet = true; + this.cacheControlMaxAgeField = value; + } + } + + /// + /// Custom HTTP 1.1 cache control directives. + /// + public string CacheControlCustom + { + get + { + return this.cacheControlCustomField; + } + set + { + this.cacheControlCustomFieldSet = true; + this.cacheControlCustomField = value; + } + } + + /// + /// Specifies whether IIs will return custom errors for this directory. + /// + public YesNoType ClearCustomError + { + get + { + return this.clearCustomErrorField; + } + set + { + this.clearCustomErrorFieldSet = true; + this.clearCustomErrorField = value; + } + } + + /// + /// A value of true indicates that file access requires SSL file permission processing, with or without a client certificate. This corresponds to AccessSSL flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSL + { + get + { + return this.accessSSLField; + } + set + { + this.accessSSLFieldSet = true; + this.accessSSLField = value; + } + } + + /// + /// A value of true indicates that file access requires SSL file permission processing with a minimum key size of 128 bits, with or without a client certificate. This corresponds to AccessSSL128 flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSL128 + { + get + { + return this.accessSSL128Field; + } + set + { + this.accessSSL128FieldSet = true; + this.accessSSL128Field = value; + } + } + + /// + /// This corresponds to AccessSSLMapCert flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSLMapCert + { + get + { + return this.accessSSLMapCertField; + } + set + { + this.accessSSLMapCertFieldSet = true; + this.accessSSLMapCertField = value; + } + } + + /// + /// This corresponds to AccessSSLNegotiateCert flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSLNegotiateCert + { + get + { + return this.accessSSLNegotiateCertField; + } + set + { + this.accessSSLNegotiateCertFieldSet = true; + this.accessSSLNegotiateCertField = value; + } + } + + /// + /// This corresponds to AccessSSLRequireCert flag for AccessSSLFlags IIS metabase property. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType AccessSSLRequireCert + { + get + { + return this.accessSSLRequireCertField; + } + set + { + this.accessSSLRequireCertFieldSet = true; + this.accessSSLRequireCertField = value; + } + } + + /// + /// Comma delimited list, in order of precedence, of Windows authentication providers that IIS will attempt to use: NTLM, Kerberos, Negotiate, and others. + /// + public string AuthenticationProviders + { + get + { + return this.authenticationProvidersField; + } + set + { + this.authenticationProvidersFieldSet = true; + this.authenticationProvidersField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebDirProperties", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.writeFieldSet) + { + if ((this.writeField == YesNoType.no)) + { + writer.WriteAttributeString("Write", "no"); + } + if ((this.writeField == YesNoType.yes)) + { + writer.WriteAttributeString("Write", "yes"); + } + } + if (this.scriptFieldSet) + { + if ((this.scriptField == YesNoType.no)) + { + writer.WriteAttributeString("Script", "no"); + } + if ((this.scriptField == YesNoType.yes)) + { + writer.WriteAttributeString("Script", "yes"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == YesNoType.no)) + { + writer.WriteAttributeString("Execute", "no"); + } + if ((this.executeField == YesNoType.yes)) + { + writer.WriteAttributeString("Execute", "yes"); + } + } + if (this.anonymousAccessFieldSet) + { + if ((this.anonymousAccessField == YesNoType.no)) + { + writer.WriteAttributeString("AnonymousAccess", "no"); + } + if ((this.anonymousAccessField == YesNoType.yes)) + { + writer.WriteAttributeString("AnonymousAccess", "yes"); + } + } + if (this.anonymousUserFieldSet) + { + writer.WriteAttributeString("AnonymousUser", this.anonymousUserField); + } + if (this.iIsControlledPasswordFieldSet) + { + if ((this.iIsControlledPasswordField == YesNoType.no)) + { + writer.WriteAttributeString("IIsControlledPassword", "no"); + } + if ((this.iIsControlledPasswordField == YesNoType.yes)) + { + writer.WriteAttributeString("IIsControlledPassword", "yes"); + } + } + if (this.windowsAuthenticationFieldSet) + { + if ((this.windowsAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("WindowsAuthentication", "no"); + } + if ((this.windowsAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("WindowsAuthentication", "yes"); + } + } + if (this.digestAuthenticationFieldSet) + { + if ((this.digestAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("DigestAuthentication", "no"); + } + if ((this.digestAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("DigestAuthentication", "yes"); + } + } + if (this.basicAuthenticationFieldSet) + { + if ((this.basicAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("BasicAuthentication", "no"); + } + if ((this.basicAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("BasicAuthentication", "yes"); + } + } + if (this.passportAuthenticationFieldSet) + { + if ((this.passportAuthenticationField == YesNoType.no)) + { + writer.WriteAttributeString("PassportAuthentication", "no"); + } + if ((this.passportAuthenticationField == YesNoType.yes)) + { + writer.WriteAttributeString("PassportAuthentication", "yes"); + } + } + if (this.logVisitsFieldSet) + { + if ((this.logVisitsField == YesNoType.no)) + { + writer.WriteAttributeString("LogVisits", "no"); + } + if ((this.logVisitsField == YesNoType.yes)) + { + writer.WriteAttributeString("LogVisits", "yes"); + } + } + if (this.indexFieldSet) + { + if ((this.indexField == YesNoType.no)) + { + writer.WriteAttributeString("Index", "no"); + } + if ((this.indexField == YesNoType.yes)) + { + writer.WriteAttributeString("Index", "yes"); + } + } + if (this.defaultDocumentsFieldSet) + { + writer.WriteAttributeString("DefaultDocuments", this.defaultDocumentsField); + } + if (this.aspDetailedErrorFieldSet) + { + if ((this.aspDetailedErrorField == YesNoType.no)) + { + writer.WriteAttributeString("AspDetailedError", "no"); + } + if ((this.aspDetailedErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("AspDetailedError", "yes"); + } + } + if (this.httpExpiresFieldSet) + { + writer.WriteAttributeString("HttpExpires", this.httpExpiresField); + } + if (this.cacheControlMaxAgeFieldSet) + { + writer.WriteAttributeString("CacheControlMaxAge", this.cacheControlMaxAgeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.cacheControlCustomFieldSet) + { + writer.WriteAttributeString("CacheControlCustom", this.cacheControlCustomField); + } + if (this.clearCustomErrorFieldSet) + { + if ((this.clearCustomErrorField == YesNoType.no)) + { + writer.WriteAttributeString("ClearCustomError", "no"); + } + if ((this.clearCustomErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("ClearCustomError", "yes"); + } + } + if (this.accessSSLFieldSet) + { + if ((this.accessSSLField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSL", "no"); + } + if ((this.accessSSLField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSL", "yes"); + } + } + if (this.accessSSL128FieldSet) + { + if ((this.accessSSL128Field == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSL128", "no"); + } + if ((this.accessSSL128Field == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSL128", "yes"); + } + } + if (this.accessSSLMapCertFieldSet) + { + if ((this.accessSSLMapCertField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSLMapCert", "no"); + } + if ((this.accessSSLMapCertField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSLMapCert", "yes"); + } + } + if (this.accessSSLNegotiateCertFieldSet) + { + if ((this.accessSSLNegotiateCertField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSLNegotiateCert", "no"); + } + if ((this.accessSSLNegotiateCertField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSLNegotiateCert", "yes"); + } + } + if (this.accessSSLRequireCertFieldSet) + { + if ((this.accessSSLRequireCertField == YesNoType.no)) + { + writer.WriteAttributeString("AccessSSLRequireCert", "no"); + } + if ((this.accessSSLRequireCertField == YesNoType.yes)) + { + writer.WriteAttributeString("AccessSSLRequireCert", "yes"); + } + } + if (this.authenticationProvidersFieldSet) + { + writer.WriteAttributeString("AuthenticationProviders", this.authenticationProvidersField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Write" == name)) + { + this.writeField = Enums.ParseYesNoType(value); + this.writeFieldSet = true; + } + if (("Script" == name)) + { + this.scriptField = Enums.ParseYesNoType(value); + this.scriptFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = Enums.ParseYesNoType(value); + this.executeFieldSet = true; + } + if (("AnonymousAccess" == name)) + { + this.anonymousAccessField = Enums.ParseYesNoType(value); + this.anonymousAccessFieldSet = true; + } + if (("AnonymousUser" == name)) + { + this.anonymousUserField = value; + this.anonymousUserFieldSet = true; + } + if (("IIsControlledPassword" == name)) + { + this.iIsControlledPasswordField = Enums.ParseYesNoType(value); + this.iIsControlledPasswordFieldSet = true; + } + if (("WindowsAuthentication" == name)) + { + this.windowsAuthenticationField = Enums.ParseYesNoType(value); + this.windowsAuthenticationFieldSet = true; + } + if (("DigestAuthentication" == name)) + { + this.digestAuthenticationField = Enums.ParseYesNoType(value); + this.digestAuthenticationFieldSet = true; + } + if (("BasicAuthentication" == name)) + { + this.basicAuthenticationField = Enums.ParseYesNoType(value); + this.basicAuthenticationFieldSet = true; + } + if (("PassportAuthentication" == name)) + { + this.passportAuthenticationField = Enums.ParseYesNoType(value); + this.passportAuthenticationFieldSet = true; + } + if (("LogVisits" == name)) + { + this.logVisitsField = Enums.ParseYesNoType(value); + this.logVisitsFieldSet = true; + } + if (("Index" == name)) + { + this.indexField = Enums.ParseYesNoType(value); + this.indexFieldSet = true; + } + if (("DefaultDocuments" == name)) + { + this.defaultDocumentsField = value; + this.defaultDocumentsFieldSet = true; + } + if (("AspDetailedError" == name)) + { + this.aspDetailedErrorField = Enums.ParseYesNoType(value); + this.aspDetailedErrorFieldSet = true; + } + if (("HttpExpires" == name)) + { + this.httpExpiresField = value; + this.httpExpiresFieldSet = true; + } + if (("CacheControlMaxAge" == name)) + { + this.cacheControlMaxAgeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.cacheControlMaxAgeFieldSet = true; + } + if (("CacheControlCustom" == name)) + { + this.cacheControlCustomField = value; + this.cacheControlCustomFieldSet = true; + } + if (("ClearCustomError" == name)) + { + this.clearCustomErrorField = Enums.ParseYesNoType(value); + this.clearCustomErrorFieldSet = true; + } + if (("AccessSSL" == name)) + { + this.accessSSLField = Enums.ParseYesNoType(value); + this.accessSSLFieldSet = true; + } + if (("AccessSSL128" == name)) + { + this.accessSSL128Field = Enums.ParseYesNoType(value); + this.accessSSL128FieldSet = true; + } + if (("AccessSSLMapCert" == name)) + { + this.accessSSLMapCertField = Enums.ParseYesNoType(value); + this.accessSSLMapCertFieldSet = true; + } + if (("AccessSSLNegotiateCert" == name)) + { + this.accessSSLNegotiateCertField = Enums.ParseYesNoType(value); + this.accessSSLNegotiateCertFieldSet = true; + } + if (("AccessSSLRequireCert" == name)) + { + this.accessSSLRequireCertField = Enums.ParseYesNoType(value); + this.accessSSLRequireCertFieldSet = true; + } + if (("AuthenticationProviders" == name)) + { + this.authenticationProvidersField = value; + this.authenticationProvidersFieldSet = true; + } + } + } + + /// + /// Custom Web Errors used by WebSites and Virtual Directories. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebError : ISchemaElement, ISetAttributes + { + + private int errorCodeField; + + private bool errorCodeFieldSet; + + private int subCodeField; + + private bool subCodeFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string uRLField; + + private bool uRLFieldSet; + + private ISchemaElement parentElement; + + /// + /// HTTP 1.1 error code. + /// + public int ErrorCode + { + get + { + return this.errorCodeField; + } + set + { + this.errorCodeFieldSet = true; + this.errorCodeField = value; + } + } + + /// + /// Error sub code. Set to 0 to get the wild card "*". + /// + public int SubCode + { + get + { + return this.subCodeField; + } + set + { + this.subCodeFieldSet = true; + this.subCodeField = value; + } + } + + /// + /// File to be sent to the client for this error code and sub code. This can be formatted. For example: [#FileId]. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// URL to be sent to the client for this error code and sub code. This can be formatted. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string URL + { + get + { + return this.uRLField; + } + set + { + this.uRLFieldSet = true; + this.uRLField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebError", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.errorCodeFieldSet) + { + writer.WriteAttributeString("ErrorCode", this.errorCodeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.subCodeFieldSet) + { + writer.WriteAttributeString("SubCode", this.subCodeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.uRLFieldSet) + { + writer.WriteAttributeString("URL", this.uRLField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ErrorCode" == name)) + { + this.errorCodeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.errorCodeFieldSet = true; + } + if (("SubCode" == name)) + { + this.subCodeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.subCodeFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("URL" == name)) + { + this.uRLField = value; + this.uRLFieldSet = true; + } + } + } + + /// + /// Custom HTTP Header definition for IIS resources such as WebSite and WebVirtualDir. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HttpHeader : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key for custom HTTP Header entry. This will default to the Name attribute. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the custom HTTP Header. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Value for the custom HTTP Header. This attribute can contain a formatted string that is processed at install time to insert the values of properties using [PropertyName] syntax. Also supported are environment variables, file installation paths, and component installation directories; see + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HttpHeader", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// MimeMap definition for IIS resources. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class MimeMap : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string typeField; + + private bool typeFieldSet; + + private string extensionField; + + private bool extensionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id for the MimeMap. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Mime-type covered by the MimeMap. + /// + public string Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Extension covered by the MimeMap. Must begin with a dot. + /// + public string Extension + { + get + { + return this.extensionField; + } + set + { + this.extensionFieldSet = true; + this.extensionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MimeMap", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.typeFieldSet) + { + writer.WriteAttributeString("Type", this.typeField); + } + if (this.extensionFieldSet) + { + writer.WriteAttributeString("Extension", this.extensionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = value; + this.typeFieldSet = true; + } + if (("Extension" == name)) + { + this.extensionField = value; + this.extensionFieldSet = true; + } + } + } + + /// + /// IIs Filter for a Component + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebFilter : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private string webSiteField; + + private bool webSiteFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private int flagsField; + + private bool flagsFieldSet; + + private string loadOrderField; + + private bool loadOrderFieldSet; + + private ISchemaElement parentElement; + + /// + /// The unique Id for the web filter. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The name of the filter to be used in IIS. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The path of the filter executable file. + /// This should usually be a value like '[!FileId]', where 'FileId' is the file identifier + /// of the filter executable file. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Specifies the parent website for this filter (if there is one). + /// If this is a global filter, then this attribute should not be specified. + /// + public string WebSite + { + get + { + return this.webSiteField; + } + set + { + this.webSiteFieldSet = true; + this.webSiteField = value; + } + } + + /// + /// Description of the filter. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Sets the MD_FILTER_FLAGS metabase key for the filter. This must be an integer. See MSDN 'FilterFlags' documentation for more details. + /// + public int Flags + { + get + { + return this.flagsField; + } + set + { + this.flagsFieldSet = true; + this.flagsField = value; + } + } + + /// + /// The legal values are "first", "last", or a number. + /// If a number is specified, it must be greater than 0. + /// + public string LoadOrder + { + get + { + return this.loadOrderField; + } + set + { + this.loadOrderFieldSet = true; + this.loadOrderField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebFilter", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.webSiteFieldSet) + { + writer.WriteAttributeString("WebSite", this.webSiteField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.flagsFieldSet) + { + writer.WriteAttributeString("Flags", this.flagsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.loadOrderFieldSet) + { + writer.WriteAttributeString("LoadOrder", this.loadOrderField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("WebSite" == name)) + { + this.webSiteField = value; + this.webSiteFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Flags" == name)) + { + this.flagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.flagsFieldSet = true; + } + if (("LoadOrder" == name)) + { + this.loadOrderField = value; + this.loadOrderFieldSet = true; + } + } + } + + /// + /// Extension for WebApplication + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebApplicationExtension : ISchemaElement, ISetAttributes + { + + private string executableField; + + private bool executableFieldSet; + + private string extensionField; + + private bool extensionFieldSet; + + private string verbsField; + + private bool verbsFieldSet; + + private YesNoType scriptField; + + private bool scriptFieldSet; + + private YesNoType checkPathField; + + private bool checkPathFieldSet; + + private ISchemaElement parentElement; + + /// + /// usually a Property that resolves to short file name path + /// + public string Executable + { + get + { + return this.executableField; + } + set + { + this.executableFieldSet = true; + this.executableField = value; + } + } + + /// + /// Extension being registered. Do not prefix with a '.' (e.g. you should use "html", not ".html"). To register for all extensions, use Extension="*". To register a wildcard application map (which handles all requests, even those for directories or files with no extension) omit the Extension attribute completely. + /// + public string Extension + { + get + { + return this.extensionField; + } + set + { + this.extensionFieldSet = true; + this.extensionField = value; + } + } + + public string Verbs + { + get + { + return this.verbsField; + } + set + { + this.verbsFieldSet = true; + this.verbsField = value; + } + } + + public YesNoType Script + { + get + { + return this.scriptField; + } + set + { + this.scriptFieldSet = true; + this.scriptField = value; + } + } + + public YesNoType CheckPath + { + get + { + return this.checkPathField; + } + set + { + this.checkPathFieldSet = true; + this.checkPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebApplicationExtension", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.executableFieldSet) + { + writer.WriteAttributeString("Executable", this.executableField); + } + if (this.extensionFieldSet) + { + writer.WriteAttributeString("Extension", this.extensionField); + } + if (this.verbsFieldSet) + { + writer.WriteAttributeString("Verbs", this.verbsField); + } + if (this.scriptFieldSet) + { + if ((this.scriptField == YesNoType.no)) + { + writer.WriteAttributeString("Script", "no"); + } + if ((this.scriptField == YesNoType.yes)) + { + writer.WriteAttributeString("Script", "yes"); + } + } + if (this.checkPathFieldSet) + { + if ((this.checkPathField == YesNoType.no)) + { + writer.WriteAttributeString("CheckPath", "no"); + } + if ((this.checkPathField == YesNoType.yes)) + { + writer.WriteAttributeString("CheckPath", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Executable" == name)) + { + this.executableField = value; + this.executableFieldSet = true; + } + if (("Extension" == name)) + { + this.extensionField = value; + this.extensionFieldSet = true; + } + if (("Verbs" == name)) + { + this.verbsField = value; + this.verbsFieldSet = true; + } + if (("Script" == name)) + { + this.scriptField = Enums.ParseYesNoType(value); + this.scriptFieldSet = true; + } + if (("CheckPath" == name)) + { + this.checkPathField = Enums.ParseYesNoType(value); + this.checkPathFieldSet = true; + } + } + } + + /// + /// IIS6 Application Pool + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebAppPool : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string userField; + + private bool userFieldSet; + + private int recycleMinutesField; + + private bool recycleMinutesFieldSet; + + private int recycleRequestsField; + + private bool recycleRequestsFieldSet; + + private int virtualMemoryField; + + private bool virtualMemoryFieldSet; + + private int privateMemoryField; + + private bool privateMemoryFieldSet; + + private int idleTimeoutField; + + private bool idleTimeoutFieldSet; + + private int queueLimitField; + + private bool queueLimitFieldSet; + + private long maxCpuUsageField; + + private bool maxCpuUsageFieldSet; + + private int refreshCpuField; + + private bool refreshCpuFieldSet; + + private CpuActionType cpuActionField; + + private bool cpuActionFieldSet; + + private int maxWorkerProcessesField; + + private bool maxWorkerProcessesFieldSet; + + private IdentityType identityField; + + private bool identityFieldSet; + + private string managedPipelineModeField; + + private bool managedPipelineModeFieldSet; + + private string managedRuntimeVersionField; + + private bool managedRuntimeVersionFieldSet; + + private ISchemaElement parentElement; + + public WebAppPool() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RecycleTime))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Id of the AppPool. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the AppPool to be shown in IIs. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// User account to run the AppPool as. To use this, you must set the Identity attribute to 'other'. + /// + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + /// + /// How often, in minutes, you want the AppPool to be recycled. + /// + public int RecycleMinutes + { + get + { + return this.recycleMinutesField; + } + set + { + this.recycleMinutesFieldSet = true; + this.recycleMinutesField = value; + } + } + + /// + /// How often, in requests, you want the AppPool to be recycled. + /// + public int RecycleRequests + { + get + { + return this.recycleRequestsField; + } + set + { + this.recycleRequestsFieldSet = true; + this.recycleRequestsField = value; + } + } + + /// + /// Specifies the amount of virtual memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this attribute is 4,294,967 KB. + /// + public int VirtualMemory + { + get + { + return this.virtualMemoryField; + } + set + { + this.virtualMemoryFieldSet = true; + this.virtualMemoryField = value; + } + } + + /// + /// Specifies the amount of private memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this attribute is 4,294,967 KB. + /// + public int PrivateMemory + { + get + { + return this.privateMemoryField; + } + set + { + this.privateMemoryFieldSet = true; + this.privateMemoryField = value; + } + } + + /// + /// Shutdown worker process after being idle for (time in minutes). + /// + public int IdleTimeout + { + get + { + return this.idleTimeoutField; + } + set + { + this.idleTimeoutFieldSet = true; + this.idleTimeoutField = value; + } + } + + /// + /// Limit the kernel request queue (number of requests). + /// + public int QueueLimit + { + get + { + return this.queueLimitField; + } + set + { + this.queueLimitFieldSet = true; + this.queueLimitField = value; + } + } + + /// + /// Maximum CPU usage (percent). + /// + public long MaxCpuUsage + { + get + { + return this.maxCpuUsageField; + } + set + { + this.maxCpuUsageFieldSet = true; + this.maxCpuUsageField = value; + } + } + + /// + /// Refresh CPU usage numbers (in minutes). + /// + public int RefreshCpu + { + get + { + return this.refreshCpuField; + } + set + { + this.refreshCpuFieldSet = true; + this.refreshCpuField = value; + } + } + + /// + /// Action taken when CPU exceeds maximum CPU use (as defined with MaxCpuUsage and RefreshCpu). + /// + public CpuActionType CpuAction + { + get + { + return this.cpuActionField; + } + set + { + this.cpuActionFieldSet = true; + this.cpuActionField = value; + } + } + + /// + /// Maximum number of worker processes. + /// + public int MaxWorkerProcesses + { + get + { + return this.maxWorkerProcessesField; + } + set + { + this.maxWorkerProcessesFieldSet = true; + this.maxWorkerProcessesField = value; + } + } + + /// + /// Identity you want the AppPool to run under (applicationPoolIdentity is only available on IIS7). Use the 'other' value in conjunction with the User attribute to specify non-standard user. + /// + public IdentityType Identity + { + get + { + return this.identityField; + } + set + { + this.identityFieldSet = true; + this.identityField = value; + } + } + + /// + /// Specifies the request-processing mode that is used to process requests for managed content. Only available on IIS7, ignored on IIS6. + /// See + /// + public string ManagedPipelineMode + { + get + { + return this.managedPipelineModeField; + } + set + { + this.managedPipelineModeFieldSet = true; + this.managedPipelineModeField = value; + } + } + + /// + /// Specifies the .NET Framework version to be used by the application pool. Only available on IIS7, ignored on IIS6. + /// See + /// + public string ManagedRuntimeVersion + { + get + { + return this.managedRuntimeVersionField; + } + set + { + this.managedRuntimeVersionFieldSet = true; + this.managedRuntimeVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RecycleTime" == childName)) + { + childValue = new RecycleTime(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a CpuActionType from a string. + /// + public static CpuActionType ParseCpuActionType(string value) + { + CpuActionType parsedValue; + WebAppPool.TryParseCpuActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CpuActionType from a string. + /// + public static bool TryParseCpuActionType(string value, out CpuActionType parsedValue) + { + parsedValue = CpuActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = CpuActionType.none; + } + else + { + if (("shutdown" == value)) + { + parsedValue = CpuActionType.shutdown; + } + else + { + parsedValue = CpuActionType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a IdentityType from a string. + /// + public static IdentityType ParseIdentityType(string value) + { + IdentityType parsedValue; + WebAppPool.TryParseIdentityType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IdentityType from a string. + /// + public static bool TryParseIdentityType(string value, out IdentityType parsedValue) + { + parsedValue = IdentityType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("networkService" == value)) + { + parsedValue = IdentityType.networkService; + } + else + { + if (("localService" == value)) + { + parsedValue = IdentityType.localService; + } + else + { + if (("localSystem" == value)) + { + parsedValue = IdentityType.localSystem; + } + else + { + if (("other" == value)) + { + parsedValue = IdentityType.other; + } + else + { + if (("applicationPoolIdentity" == value)) + { + parsedValue = IdentityType.applicationPoolIdentity; + } + else + { + parsedValue = IdentityType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebAppPool", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.recycleMinutesFieldSet) + { + writer.WriteAttributeString("RecycleMinutes", this.recycleMinutesField.ToString(CultureInfo.InvariantCulture)); + } + if (this.recycleRequestsFieldSet) + { + writer.WriteAttributeString("RecycleRequests", this.recycleRequestsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.virtualMemoryFieldSet) + { + writer.WriteAttributeString("VirtualMemory", this.virtualMemoryField.ToString(CultureInfo.InvariantCulture)); + } + if (this.privateMemoryFieldSet) + { + writer.WriteAttributeString("PrivateMemory", this.privateMemoryField.ToString(CultureInfo.InvariantCulture)); + } + if (this.idleTimeoutFieldSet) + { + writer.WriteAttributeString("IdleTimeout", this.idleTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.queueLimitFieldSet) + { + writer.WriteAttributeString("QueueLimit", this.queueLimitField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maxCpuUsageFieldSet) + { + writer.WriteAttributeString("MaxCpuUsage", this.maxCpuUsageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.refreshCpuFieldSet) + { + writer.WriteAttributeString("RefreshCpu", this.refreshCpuField.ToString(CultureInfo.InvariantCulture)); + } + if (this.cpuActionFieldSet) + { + if ((this.cpuActionField == CpuActionType.none)) + { + writer.WriteAttributeString("CpuAction", "none"); + } + if ((this.cpuActionField == CpuActionType.shutdown)) + { + writer.WriteAttributeString("CpuAction", "shutdown"); + } + } + if (this.maxWorkerProcessesFieldSet) + { + writer.WriteAttributeString("MaxWorkerProcesses", this.maxWorkerProcessesField.ToString(CultureInfo.InvariantCulture)); + } + if (this.identityFieldSet) + { + if ((this.identityField == IdentityType.networkService)) + { + writer.WriteAttributeString("Identity", "networkService"); + } + if ((this.identityField == IdentityType.localService)) + { + writer.WriteAttributeString("Identity", "localService"); + } + if ((this.identityField == IdentityType.localSystem)) + { + writer.WriteAttributeString("Identity", "localSystem"); + } + if ((this.identityField == IdentityType.other)) + { + writer.WriteAttributeString("Identity", "other"); + } + if ((this.identityField == IdentityType.applicationPoolIdentity)) + { + writer.WriteAttributeString("Identity", "applicationPoolIdentity"); + } + } + if (this.managedPipelineModeFieldSet) + { + writer.WriteAttributeString("ManagedPipelineMode", this.managedPipelineModeField); + } + if (this.managedRuntimeVersionFieldSet) + { + writer.WriteAttributeString("ManagedRuntimeVersion", this.managedRuntimeVersionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("RecycleMinutes" == name)) + { + this.recycleMinutesField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.recycleMinutesFieldSet = true; + } + if (("RecycleRequests" == name)) + { + this.recycleRequestsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.recycleRequestsFieldSet = true; + } + if (("VirtualMemory" == name)) + { + this.virtualMemoryField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.virtualMemoryFieldSet = true; + } + if (("PrivateMemory" == name)) + { + this.privateMemoryField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.privateMemoryFieldSet = true; + } + if (("IdleTimeout" == name)) + { + this.idleTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.idleTimeoutFieldSet = true; + } + if (("QueueLimit" == name)) + { + this.queueLimitField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.queueLimitFieldSet = true; + } + if (("MaxCpuUsage" == name)) + { + this.maxCpuUsageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxCpuUsageFieldSet = true; + } + if (("RefreshCpu" == name)) + { + this.refreshCpuField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.refreshCpuFieldSet = true; + } + if (("CpuAction" == name)) + { + this.cpuActionField = WebAppPool.ParseCpuActionType(value); + this.cpuActionFieldSet = true; + } + if (("MaxWorkerProcesses" == name)) + { + this.maxWorkerProcessesField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxWorkerProcessesFieldSet = true; + } + if (("Identity" == name)) + { + this.identityField = WebAppPool.ParseIdentityType(value); + this.identityFieldSet = true; + } + if (("ManagedPipelineMode" == name)) + { + this.managedPipelineModeField = value; + this.managedPipelineModeFieldSet = true; + } + if (("ManagedRuntimeVersion" == name)) + { + this.managedRuntimeVersionField = value; + this.managedRuntimeVersionFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum CpuActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + shutdown, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum IdentityType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + networkService, + + localService, + + localSystem, + + other, + + applicationPoolIdentity, + } + } + + /// + /// IIS6 Application Pool Recycle Times on 24 hour clock. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RecycleTime : ISchemaElement, ISetAttributes + { + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RecycleTime", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Used to install and uninstall certificates. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Certificate : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private StoreNameType storeNameField; + + private bool storeNameFieldSet; + + private StoreLocationType storeLocationField; + + private bool storeLocationFieldSet; + + private YesNoType overwriteField; + + private bool overwriteFieldSet; + + private YesNoType requestField; + + private bool requestFieldSet; + + private string binaryKeyField; + + private bool binaryKeyFieldSet; + + private string certificatePathField; + + private bool certificatePathFieldSet; + + private string pFXPasswordField; + + private bool pFXPasswordFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for this certificate in the installation package. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the certificate that will be installed or uninstalled in the specified store. + /// This attribute may be set via a formatted Property (e.g. [MyProperty]). + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public StoreNameType StoreName + { + get + { + return this.storeNameField; + } + set + { + this.storeNameFieldSet = true; + this.storeNameField = value; + } + } + + public StoreLocationType StoreLocation + { + get + { + return this.storeLocationField; + } + set + { + this.storeLocationFieldSet = true; + this.storeLocationField = value; + } + } + + public YesNoType Overwrite + { + get + { + return this.overwriteField; + } + set + { + this.overwriteFieldSet = true; + this.overwriteField = value; + } + } + + /// + /// This attribute controls whether the CertificatePath attribute is a path to a certificate file (Request='no') or the + /// certificate authority to request the certificate from (Request='yes'). + /// + public YesNoType Request + { + get + { + return this.requestField; + } + set + { + this.requestFieldSet = true; + this.requestField = value; + } + } + + /// + /// Reference to a Binary element that will store the certificate as a stream inside the package. This attribute cannot be specified with + /// the CertificatePath attribute. + /// + public string BinaryKey + { + get + { + return this.binaryKeyField; + } + set + { + this.binaryKeyFieldSet = true; + this.binaryKeyField = value; + } + } + + /// + /// If the Request attribute is "no" then this attribute is the path to the certificate file outside of the package. + /// If the Request attribute is "yes" then this atribute is the certificate authority to request the certificate from. + /// This attribute may be set via a formatted Property (e.g. [MyProperty]). + /// + public string CertificatePath + { + get + { + return this.certificatePathField; + } + set + { + this.certificatePathFieldSet = true; + this.certificatePathField = value; + } + } + + /// + /// If the Binary stream or path to the file outside of the package is a password protected PFX file, the password for that + /// PFX must be specified here. This attribute may be set via a formatted Property (e.g. [MyProperty]). + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string PFXPassword + { + get + { + return this.pFXPasswordField; + } + set + { + this.pFXPasswordFieldSet = true; + this.pFXPasswordField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a StoreNameType from a string. + /// + public static StoreNameType ParseStoreNameType(string value) + { + StoreNameType parsedValue; + Certificate.TryParseStoreNameType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a StoreNameType from a string. + /// + public static bool TryParseStoreNameType(string value, out StoreNameType parsedValue) + { + parsedValue = StoreNameType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ca" == value)) + { + parsedValue = StoreNameType.ca; + } + else + { + if (("my" == value)) + { + parsedValue = StoreNameType.my; + } + else + { + if (("personal" == value)) + { + parsedValue = StoreNameType.personal; + } + else + { + if (("request" == value)) + { + parsedValue = StoreNameType.request; + } + else + { + if (("root" == value)) + { + parsedValue = StoreNameType.root; + } + else + { + if (("otherPeople" == value)) + { + parsedValue = StoreNameType.otherPeople; + } + else + { + if (("trustedPeople" == value)) + { + parsedValue = StoreNameType.trustedPeople; + } + else + { + if (("trustedPublisher" == value)) + { + parsedValue = StoreNameType.trustedPublisher; + } + else + { + parsedValue = StoreNameType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a StoreLocationType from a string. + /// + public static StoreLocationType ParseStoreLocationType(string value) + { + StoreLocationType parsedValue; + Certificate.TryParseStoreLocationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a StoreLocationType from a string. + /// + public static bool TryParseStoreLocationType(string value, out StoreLocationType parsedValue) + { + parsedValue = StoreLocationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("currentUser" == value)) + { + parsedValue = StoreLocationType.currentUser; + } + else + { + if (("localMachine" == value)) + { + parsedValue = StoreLocationType.localMachine; + } + else + { + parsedValue = StoreLocationType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Certificate", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.storeNameFieldSet) + { + if ((this.storeNameField == StoreNameType.ca)) + { + writer.WriteAttributeString("StoreName", "ca"); + } + if ((this.storeNameField == StoreNameType.my)) + { + writer.WriteAttributeString("StoreName", "my"); + } + if ((this.storeNameField == StoreNameType.personal)) + { + writer.WriteAttributeString("StoreName", "personal"); + } + if ((this.storeNameField == StoreNameType.request)) + { + writer.WriteAttributeString("StoreName", "request"); + } + if ((this.storeNameField == StoreNameType.root)) + { + writer.WriteAttributeString("StoreName", "root"); + } + if ((this.storeNameField == StoreNameType.otherPeople)) + { + writer.WriteAttributeString("StoreName", "otherPeople"); + } + if ((this.storeNameField == StoreNameType.trustedPeople)) + { + writer.WriteAttributeString("StoreName", "trustedPeople"); + } + if ((this.storeNameField == StoreNameType.trustedPublisher)) + { + writer.WriteAttributeString("StoreName", "trustedPublisher"); + } + } + if (this.storeLocationFieldSet) + { + if ((this.storeLocationField == StoreLocationType.currentUser)) + { + writer.WriteAttributeString("StoreLocation", "currentUser"); + } + if ((this.storeLocationField == StoreLocationType.localMachine)) + { + writer.WriteAttributeString("StoreLocation", "localMachine"); + } + } + if (this.overwriteFieldSet) + { + if ((this.overwriteField == YesNoType.no)) + { + writer.WriteAttributeString("Overwrite", "no"); + } + if ((this.overwriteField == YesNoType.yes)) + { + writer.WriteAttributeString("Overwrite", "yes"); + } + } + if (this.requestFieldSet) + { + if ((this.requestField == YesNoType.no)) + { + writer.WriteAttributeString("Request", "no"); + } + if ((this.requestField == YesNoType.yes)) + { + writer.WriteAttributeString("Request", "yes"); + } + } + if (this.binaryKeyFieldSet) + { + writer.WriteAttributeString("BinaryKey", this.binaryKeyField); + } + if (this.certificatePathFieldSet) + { + writer.WriteAttributeString("CertificatePath", this.certificatePathField); + } + if (this.pFXPasswordFieldSet) + { + writer.WriteAttributeString("PFXPassword", this.pFXPasswordField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("StoreName" == name)) + { + this.storeNameField = Certificate.ParseStoreNameType(value); + this.storeNameFieldSet = true; + } + if (("StoreLocation" == name)) + { + this.storeLocationField = Certificate.ParseStoreLocationType(value); + this.storeLocationFieldSet = true; + } + if (("Overwrite" == name)) + { + this.overwriteField = Enums.ParseYesNoType(value); + this.overwriteFieldSet = true; + } + if (("Request" == name)) + { + this.requestField = Enums.ParseYesNoType(value); + this.requestFieldSet = true; + } + if (("BinaryKey" == name)) + { + this.binaryKeyField = value; + this.binaryKeyFieldSet = true; + } + if (("CertificatePath" == name)) + { + this.certificatePathField = value; + this.certificatePathFieldSet = true; + } + if (("PFXPassword" == name)) + { + this.pFXPasswordField = value; + this.pFXPasswordFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum StoreNameType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Contains the certificates of certificate authorities that the user trusts to issue certificates to others. Certificates in these stores are normally supplied with the operating system or by the user's network administrator. + /// + ca, + + /// + /// Use the "personal" value instead. + /// + my, + + /// + /// Contains personal certificates. These certificates will usually have an associated private key. This store is often + /// referred to as the "MY" certificate store. + /// + personal, + + request, + + /// + /// Contains the certificates of certificate authorities that the user trusts to issue certificates to others. Certificates in these stores are normally supplied with the operating system or by the user's network administrator. Certificates in this store are typically self-signed. + /// + root, + + /// + /// Contains the certificates of those that the user normally sends enveloped messages to or receives signed messages from. + /// See + /// + otherPeople, + + /// + /// Contains the certificates of those directly trusted people and resources. + /// See + /// + trustedPeople, + + /// + /// Contains the certificates of those publishers who are trusted. + /// See + /// + trustedPublisher, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum StoreLocationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + currentUser, + + localMachine, + } + } + + /// + /// Associates a certificate with the parent WebSite. The Certificate element should be + /// in the same Component as the parent WebSite. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class CertificateRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the referenced Certificate. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CertificateRef", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// IIS Properties + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebProperty : ISchemaElement, ISetAttributes + { + + private IdType idField; + + private bool idFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + public IdType Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The value to be used for the WebProperty specified in the Id attribute. See + /// the remarks section for information on acceptable values for each Id. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a IdType from a string. + /// + public static IdType ParseIdType(string value) + { + IdType parsedValue; + WebProperty.TryParseIdType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IdType from a string. + /// + public static bool TryParseIdType(string value, out IdType parsedValue) + { + parsedValue = IdType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ETagChangeNumber" == value)) + { + parsedValue = IdType.ETagChangeNumber; + } + else + { + if (("IIs5IsolationMode" == value)) + { + parsedValue = IdType.IIs5IsolationMode; + } + else + { + if (("MaxGlobalBandwidth" == value)) + { + parsedValue = IdType.MaxGlobalBandwidth; + } + else + { + if (("LogInUTF8" == value)) + { + parsedValue = IdType.LogInUTF8; + } + else + { + parsedValue = IdType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebProperty", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + if ((this.idField == IdType.ETagChangeNumber)) + { + writer.WriteAttributeString("Id", "ETagChangeNumber"); + } + if ((this.idField == IdType.IIs5IsolationMode)) + { + writer.WriteAttributeString("Id", "IIs5IsolationMode"); + } + if ((this.idField == IdType.MaxGlobalBandwidth)) + { + writer.WriteAttributeString("Id", "MaxGlobalBandwidth"); + } + if ((this.idField == IdType.LogInUTF8)) + { + writer.WriteAttributeString("Id", "LogInUTF8"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = WebProperty.ParseIdType(value); + this.idFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum IdType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + ETagChangeNumber, + + IIs5IsolationMode, + + MaxGlobalBandwidth, + + LogInUTF8, + } + } + + /// + /// Defines properties for a web application. These properties can be used for more than one application defined in a web site or vroot, by defining this element in a common location and referring to it by setting the WebApplication attribute of the WebSite and WebVirtualDir elements. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebApplication : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private IsolationType isolationField; + + private bool isolationFieldSet; + + private YesNoDefaultType allowSessionsField; + + private bool allowSessionsFieldSet; + + private int sessionTimeoutField; + + private bool sessionTimeoutFieldSet; + + private YesNoDefaultType bufferField; + + private bool bufferFieldSet; + + private YesNoDefaultType parentPathsField; + + private bool parentPathsFieldSet; + + private DefaultScriptType defaultScriptField; + + private bool defaultScriptFieldSet; + + private int scriptTimeoutField; + + private bool scriptTimeoutFieldSet; + + private YesNoDefaultType serverDebuggingField; + + private bool serverDebuggingFieldSet; + + private YesNoDefaultType clientDebuggingField; + + private bool clientDebuggingFieldSet; + + private string webAppPoolField; + + private bool webAppPoolFieldSet; + + private ISchemaElement parentElement; + + public WebApplication() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(WebApplicationExtension))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets the name of this application. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Sets the application isolation level for this application for pre-IIS 6 applications. + /// + public IsolationType Isolation + { + get + { + return this.isolationField; + } + set + { + this.isolationFieldSet = true; + this.isolationField = value; + } + } + + /// + /// Sets the Enable Session State option. When enabled, you can set the session timeout using the SessionTimeout attribute. + /// + public YesNoDefaultType AllowSessions + { + get + { + return this.allowSessionsField; + } + set + { + this.allowSessionsFieldSet = true; + this.allowSessionsField = value; + } + } + + /// + /// Sets the timeout value for sessions in minutes. + /// + public int SessionTimeout + { + get + { + return this.sessionTimeoutField; + } + set + { + this.sessionTimeoutFieldSet = true; + this.sessionTimeoutField = value; + } + } + + /// + /// Sets the option that enables response buffering in the application, which allows ASP script to set response headers anywhere in the script. + /// + public YesNoDefaultType Buffer + { + get + { + return this.bufferField; + } + set + { + this.bufferFieldSet = true; + this.bufferField = value; + } + } + + /// + /// Sets the parent paths option, which allows a client to use relative paths to reach parent directories from this application. + /// + public YesNoDefaultType ParentPaths + { + get + { + return this.parentPathsField; + } + set + { + this.parentPathsFieldSet = true; + this.parentPathsField = value; + } + } + + /// + /// Sets the default script language for the site. + /// + public DefaultScriptType DefaultScript + { + get + { + return this.defaultScriptField; + } + set + { + this.defaultScriptFieldSet = true; + this.defaultScriptField = value; + } + } + + /// + /// Sets the timeout value in seconds for executing ASP scripts. + /// + public int ScriptTimeout + { + get + { + return this.scriptTimeoutField; + } + set + { + this.scriptTimeoutFieldSet = true; + this.scriptTimeoutField = value; + } + } + + /// + /// Enable ASP server-side script debugging. + /// + public YesNoDefaultType ServerDebugging + { + get + { + return this.serverDebuggingField; + } + set + { + this.serverDebuggingFieldSet = true; + this.serverDebuggingField = value; + } + } + + /// + /// Enable ASP client-side script debugging. + /// + public YesNoDefaultType ClientDebugging + { + get + { + return this.clientDebuggingField; + } + set + { + this.clientDebuggingFieldSet = true; + this.clientDebuggingField = value; + } + } + + /// + /// References the Id attribute of a WebAppPool element to use as the application pool for this application in IIS 6 applications. + /// + public string WebAppPool + { + get + { + return this.webAppPoolField; + } + set + { + this.webAppPoolFieldSet = true; + this.webAppPoolField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebApplicationExtension" == childName)) + { + childValue = new WebApplicationExtension(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a IsolationType from a string. + /// + public static IsolationType ParseIsolationType(string value) + { + IsolationType parsedValue; + WebApplication.TryParseIsolationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IsolationType from a string. + /// + public static bool TryParseIsolationType(string value, out IsolationType parsedValue) + { + parsedValue = IsolationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("low" == value)) + { + parsedValue = IsolationType.low; + } + else + { + if (("medium" == value)) + { + parsedValue = IsolationType.medium; + } + else + { + if (("high" == value)) + { + parsedValue = IsolationType.high; + } + else + { + parsedValue = IsolationType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a DefaultScriptType from a string. + /// + public static DefaultScriptType ParseDefaultScriptType(string value) + { + DefaultScriptType parsedValue; + WebApplication.TryParseDefaultScriptType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a DefaultScriptType from a string. + /// + public static bool TryParseDefaultScriptType(string value, out DefaultScriptType parsedValue) + { + parsedValue = DefaultScriptType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("VBScript" == value)) + { + parsedValue = DefaultScriptType.VBScript; + } + else + { + if (("JScript" == value)) + { + parsedValue = DefaultScriptType.JScript; + } + else + { + parsedValue = DefaultScriptType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebApplication", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.isolationFieldSet) + { + if ((this.isolationField == IsolationType.low)) + { + writer.WriteAttributeString("Isolation", "low"); + } + if ((this.isolationField == IsolationType.medium)) + { + writer.WriteAttributeString("Isolation", "medium"); + } + if ((this.isolationField == IsolationType.high)) + { + writer.WriteAttributeString("Isolation", "high"); + } + } + if (this.allowSessionsFieldSet) + { + if ((this.allowSessionsField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("AllowSessions", "default"); + } + if ((this.allowSessionsField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("AllowSessions", "no"); + } + if ((this.allowSessionsField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("AllowSessions", "yes"); + } + } + if (this.sessionTimeoutFieldSet) + { + writer.WriteAttributeString("SessionTimeout", this.sessionTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.bufferFieldSet) + { + if ((this.bufferField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Buffer", "default"); + } + if ((this.bufferField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Buffer", "no"); + } + if ((this.bufferField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Buffer", "yes"); + } + } + if (this.parentPathsFieldSet) + { + if ((this.parentPathsField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ParentPaths", "default"); + } + if ((this.parentPathsField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ParentPaths", "no"); + } + if ((this.parentPathsField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ParentPaths", "yes"); + } + } + if (this.defaultScriptFieldSet) + { + if ((this.defaultScriptField == DefaultScriptType.VBScript)) + { + writer.WriteAttributeString("DefaultScript", "VBScript"); + } + if ((this.defaultScriptField == DefaultScriptType.JScript)) + { + writer.WriteAttributeString("DefaultScript", "JScript"); + } + } + if (this.scriptTimeoutFieldSet) + { + writer.WriteAttributeString("ScriptTimeout", this.scriptTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.serverDebuggingFieldSet) + { + if ((this.serverDebuggingField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ServerDebugging", "default"); + } + if ((this.serverDebuggingField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ServerDebugging", "no"); + } + if ((this.serverDebuggingField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ServerDebugging", "yes"); + } + } + if (this.clientDebuggingFieldSet) + { + if ((this.clientDebuggingField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ClientDebugging", "default"); + } + if ((this.clientDebuggingField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ClientDebugging", "no"); + } + if ((this.clientDebuggingField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ClientDebugging", "yes"); + } + } + if (this.webAppPoolFieldSet) + { + writer.WriteAttributeString("WebAppPool", this.webAppPoolField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Isolation" == name)) + { + this.isolationField = WebApplication.ParseIsolationType(value); + this.isolationFieldSet = true; + } + if (("AllowSessions" == name)) + { + this.allowSessionsField = Enums.ParseYesNoDefaultType(value); + this.allowSessionsFieldSet = true; + } + if (("SessionTimeout" == name)) + { + this.sessionTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sessionTimeoutFieldSet = true; + } + if (("Buffer" == name)) + { + this.bufferField = Enums.ParseYesNoDefaultType(value); + this.bufferFieldSet = true; + } + if (("ParentPaths" == name)) + { + this.parentPathsField = Enums.ParseYesNoDefaultType(value); + this.parentPathsFieldSet = true; + } + if (("DefaultScript" == name)) + { + this.defaultScriptField = WebApplication.ParseDefaultScriptType(value); + this.defaultScriptFieldSet = true; + } + if (("ScriptTimeout" == name)) + { + this.scriptTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.scriptTimeoutFieldSet = true; + } + if (("ServerDebugging" == name)) + { + this.serverDebuggingField = Enums.ParseYesNoDefaultType(value); + this.serverDebuggingFieldSet = true; + } + if (("ClientDebugging" == name)) + { + this.clientDebuggingField = Enums.ParseYesNoDefaultType(value); + this.clientDebuggingFieldSet = true; + } + if (("WebAppPool" == name)) + { + this.webAppPoolField = value; + this.webAppPoolFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum IsolationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Means the application executes within the IIS process. + /// + low, + + /// + /// Executes pooled in a separate process. + /// + medium, + + /// + /// Means execution alone in a separate process. + /// + high, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum DefaultScriptType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + VBScript, + + JScript, + } + } + + /// + /// WebAddress for WebSite + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebAddress : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string iPField; + + private bool iPFieldSet; + + private string portField; + + private bool portFieldSet; + + private string headerField; + + private bool headerFieldSet; + + private YesNoType secureField; + + private bool secureFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The IP address to locate an existing WebSite or create a new WebSite. When the WebAddress is part of a WebSite element + /// used to locate an existing web site the following rules are used: + /// + public string IP + { + get + { + return this.iPField; + } + set + { + this.iPFieldSet = true; + this.iPField = value; + } + } + + public string Port + { + get + { + return this.portField; + } + set + { + this.portFieldSet = true; + this.portField = value; + } + } + + public string Header + { + get + { + return this.headerField; + } + set + { + this.headerFieldSet = true; + this.headerField = value; + } + } + + /// + /// Determines if this address represents a secure binding. The default is 'no'. + /// + public YesNoType Secure + { + get + { + return this.secureField; + } + set + { + this.secureFieldSet = true; + this.secureField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebAddress", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.iPFieldSet) + { + writer.WriteAttributeString("IP", this.iPField); + } + if (this.portFieldSet) + { + writer.WriteAttributeString("Port", this.portField); + } + if (this.headerFieldSet) + { + writer.WriteAttributeString("Header", this.headerField); + } + if (this.secureFieldSet) + { + if ((this.secureField == YesNoType.no)) + { + writer.WriteAttributeString("Secure", "no"); + } + if ((this.secureField == YesNoType.yes)) + { + writer.WriteAttributeString("Secure", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IP" == name)) + { + this.iPField = value; + this.iPFieldSet = true; + } + if (("Port" == name)) + { + this.portField = value; + this.portFieldSet = true; + } + if (("Header" == name)) + { + this.headerField = value; + this.headerFieldSet = true; + } + if (("Secure" == name)) + { + this.secureField = Enums.ParseYesNoType(value); + this.secureFieldSet = true; + } + } + } + + /// + /// Defines an IIS virtual directory. When this element is a child of WebSite element, the virtual directory is defined within that web site. Otherwise this virtual directory must reference a WebSite element via the WebSite attribute + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebVirtualDir : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string webSiteField; + + private bool webSiteFieldSet; + + private string aliasField; + + private bool aliasFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string dirPropertiesField; + + private bool dirPropertiesFieldSet; + + private string webApplicationField; + + private bool webApplicationFieldSet; + + private ISchemaElement parentElement; + + public WebVirtualDir() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebError))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebVirtualDir))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HttpHeader))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MimeMap))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// References the Id attribute for a WebSite in which this virtual directory belongs. Required when this element is not a child of WebSite element. + /// + public string WebSite + { + get + { + return this.webSiteField; + } + set + { + this.webSiteFieldSet = true; + this.webSiteField = value; + } + } + + /// + /// Sets the application name, which is the URL relative path used to access this virtual directory + /// + public string Alias + { + get + { + return this.aliasField; + } + set + { + this.aliasFieldSet = true; + this.aliasField = value; + } + } + + /// + /// References the Id attribute for a Directory element that points to the content for this virtual directory. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this virtual directory. + /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. + /// + public string DirProperties + { + get + { + return this.dirPropertiesField; + } + set + { + this.dirPropertiesFieldSet = true; + this.dirPropertiesField = value; + } + } + + /// + /// References the Id attribute for a WebApplication element that specifies web application settings for this virtual directory. If a WebApplication child is not specified, the virtual directory does not host web applications. + /// + public string WebApplication + { + get + { + return this.webApplicationField; + } + set + { + this.webApplicationFieldSet = true; + this.webApplicationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebApplication" == childName)) + { + childValue = new WebApplication(); + } + if (("WebDirProperties" == childName)) + { + childValue = new WebDirProperties(); + } + if (("WebError" == childName)) + { + childValue = new WebError(); + } + if (("WebVirtualDir" == childName)) + { + childValue = new WebVirtualDir(); + } + if (("HttpHeader" == childName)) + { + childValue = new HttpHeader(); + } + if (("MimeMap" == childName)) + { + childValue = new MimeMap(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebVirtualDir", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.webSiteFieldSet) + { + writer.WriteAttributeString("WebSite", this.webSiteField); + } + if (this.aliasFieldSet) + { + writer.WriteAttributeString("Alias", this.aliasField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.dirPropertiesFieldSet) + { + writer.WriteAttributeString("DirProperties", this.dirPropertiesField); + } + if (this.webApplicationFieldSet) + { + writer.WriteAttributeString("WebApplication", this.webApplicationField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("WebSite" == name)) + { + this.webSiteField = value; + this.webSiteFieldSet = true; + } + if (("Alias" == name)) + { + this.aliasField = value; + this.aliasFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DirProperties" == name)) + { + this.dirPropertiesField = value; + this.dirPropertiesFieldSet = true; + } + if (("WebApplication" == name)) + { + this.webApplicationField = value; + this.webApplicationFieldSet = true; + } + } + } + + /// + /// Defines a subdirectory within an IIS web site. When this element is a child of WebSite, the web directory is defined within that web site. Otherwise the web directory must reference a WebSite element via the WebSite attribute. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebDir : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string webSiteField; + + private bool webSiteFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private string dirPropertiesField; + + private bool dirPropertiesFieldSet; + + private ISchemaElement parentElement; + + public WebDir() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// References the Id attribute for a WebSite element in which this directory belongs. Required when this element is not a child of a WebSite element. + /// + public string WebSite + { + get + { + return this.webSiteField; + } + set + { + this.webSiteFieldSet = true; + this.webSiteField = value; + } + } + + /// + /// Specifies the name of this web directory. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this web directory. + /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. + /// + public string DirProperties + { + get + { + return this.dirPropertiesField; + } + set + { + this.dirPropertiesFieldSet = true; + this.dirPropertiesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebApplication" == childName)) + { + childValue = new WebApplication(); + } + if (("WebDirProperties" == childName)) + { + childValue = new WebDirProperties(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebDir", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.webSiteFieldSet) + { + writer.WriteAttributeString("WebSite", this.webSiteField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.dirPropertiesFieldSet) + { + writer.WriteAttributeString("DirProperties", this.dirPropertiesField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("WebSite" == name)) + { + this.webSiteField = value; + this.webSiteFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("DirProperties" == name)) + { + this.dirPropertiesField = value; + this.dirPropertiesFieldSet = true; + } + } + } + + /// + /// IIs Web Site + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebSite : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType autoStartField; + + private bool autoStartFieldSet; + + private YesNoType configureIfExistsField; + + private bool configureIfExistsFieldSet; + + private long connectionTimeoutField; + + private bool connectionTimeoutFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string dirPropertiesField; + + private bool dirPropertiesFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string siteIdField; + + private bool siteIdFieldSet; + + private YesNoType startOnInstallField; + + private bool startOnInstallFieldSet; + + private string webApplicationField; + + private bool webApplicationFieldSet; + + private string webLogField; + + private bool webLogFieldSet; + + private ISchemaElement parentElement; + + public WebSite() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebAddress))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDirProperties))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MimeMap))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CertificateRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HttpHeader))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebDir))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebError))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebFilter))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WebVirtualDir))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the WebSite. Used within the MSI package only. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies whether to automatically start the web site. + /// + public YesNoType AutoStart + { + get + { + return this.autoStartField; + } + set + { + this.autoStartFieldSet = true; + this.autoStartField = value; + } + } + + /// + /// Specifies whether to configure the web site if it already exists. Note: This will not affect uninstall behavior. If the web site exists on uninstall, it will be removed. + /// + public YesNoType ConfigureIfExists + { + get + { + return this.configureIfExistsField; + } + set + { + this.configureIfExistsFieldSet = true; + this.configureIfExistsField = value; + } + } + + /// + /// Sets the timeout value for connections in seconds. + /// + public long ConnectionTimeout + { + get + { + return this.connectionTimeoutField; + } + set + { + this.connectionTimeoutFieldSet = true; + this.connectionTimeoutField = value; + } + } + + /// + /// This is the name of the web site that will show up in the IIS management console. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Root directory of the web site. Resolved to a directory in the Directory table at install time by the server custom actions. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// References the Id attribute for a WebDirProperties element that specifies the security and access properties for this website root directory. + /// This attribute may not be specified if a WebDirProperties element is directly nested in this element. + /// + public string DirProperties + { + get + { + return this.dirPropertiesField; + } + set + { + this.dirPropertiesFieldSet = true; + this.dirPropertiesField = value; + } + } + + /// + /// Sequence that the web site is to be created in. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Optional attribute to directly specify the site id of the WebSite. Use this to ensure all web + /// sites in a web garden get the same site id. If a number is provided, the site id must be unique + /// on all target machines. If "*" is used, the Description attribute will be hashed to create a unique + /// value for the site id. This value must be a positive number or a "*" or a formatted value that resolves + /// to "-1" (for the same behavior as "*") or a positive number or blank. If this attribute is absent then + /// the web site will be located using the WebAddress element associated with the web site. + /// + public string SiteId + { + get + { + return this.siteIdField; + } + set + { + this.siteIdFieldSet = true; + this.siteIdField = value; + } + } + + /// + /// Specifies whether to start the web site on install. + /// + public YesNoType StartOnInstall + { + get + { + return this.startOnInstallField; + } + set + { + this.startOnInstallFieldSet = true; + this.startOnInstallField = value; + } + } + + /// + /// Reference to a WebApplication that is to be installed as part of this web site. + /// + public string WebApplication + { + get + { + return this.webApplicationField; + } + set + { + this.webApplicationFieldSet = true; + this.webApplicationField = value; + } + } + + /// + /// Reference to WebLog definition. + /// + public string WebLog + { + get + { + return this.webLogField; + } + set + { + this.webLogFieldSet = true; + this.webLogField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("WebAddress" == childName)) + { + childValue = new WebAddress(); + } + if (("WebApplication" == childName)) + { + childValue = new WebApplication(); + } + if (("WebDirProperties" == childName)) + { + childValue = new WebDirProperties(); + } + if (("MimeMap" == childName)) + { + childValue = new MimeMap(); + } + if (("CertificateRef" == childName)) + { + childValue = new CertificateRef(); + } + if (("HttpHeader" == childName)) + { + childValue = new HttpHeader(); + } + if (("WebDir" == childName)) + { + childValue = new WebDir(); + } + if (("WebError" == childName)) + { + childValue = new WebError(); + } + if (("WebFilter" == childName)) + { + childValue = new WebFilter(); + } + if (("WebVirtualDir" == childName)) + { + childValue = new WebVirtualDir(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebSite", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.autoStartFieldSet) + { + if ((this.autoStartField == YesNoType.no)) + { + writer.WriteAttributeString("AutoStart", "no"); + } + if ((this.autoStartField == YesNoType.yes)) + { + writer.WriteAttributeString("AutoStart", "yes"); + } + } + if (this.configureIfExistsFieldSet) + { + if ((this.configureIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("ConfigureIfExists", "no"); + } + if ((this.configureIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("ConfigureIfExists", "yes"); + } + } + if (this.connectionTimeoutFieldSet) + { + writer.WriteAttributeString("ConnectionTimeout", this.connectionTimeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.dirPropertiesFieldSet) + { + writer.WriteAttributeString("DirProperties", this.dirPropertiesField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.siteIdFieldSet) + { + writer.WriteAttributeString("SiteId", this.siteIdField); + } + if (this.startOnInstallFieldSet) + { + if ((this.startOnInstallField == YesNoType.no)) + { + writer.WriteAttributeString("StartOnInstall", "no"); + } + if ((this.startOnInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("StartOnInstall", "yes"); + } + } + if (this.webApplicationFieldSet) + { + writer.WriteAttributeString("WebApplication", this.webApplicationField); + } + if (this.webLogFieldSet) + { + writer.WriteAttributeString("WebLog", this.webLogField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AutoStart" == name)) + { + this.autoStartField = Enums.ParseYesNoType(value); + this.autoStartFieldSet = true; + } + if (("ConfigureIfExists" == name)) + { + this.configureIfExistsField = Enums.ParseYesNoType(value); + this.configureIfExistsFieldSet = true; + } + if (("ConnectionTimeout" == name)) + { + this.connectionTimeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.connectionTimeoutFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DirProperties" == name)) + { + this.dirPropertiesField = value; + this.dirPropertiesFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("SiteId" == name)) + { + this.siteIdField = value; + this.siteIdFieldSet = true; + } + if (("StartOnInstall" == name)) + { + this.startOnInstallField = Enums.ParseYesNoType(value); + this.startOnInstallFieldSet = true; + } + if (("WebApplication" == name)) + { + this.webApplicationField = value; + this.webApplicationFieldSet = true; + } + if (("WebLog" == name)) + { + this.webLogField = value; + this.webLogFieldSet = true; + } + } + } + + /// + /// WebLog definition. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebLog : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the WebLog. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + WebLog.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("IIS" == value)) + { + parsedValue = TypeType.IIS; + } + else + { + if (("NCSA" == value)) + { + parsedValue = TypeType.NCSA; + } + else + { + if (("none" == value)) + { + parsedValue = TypeType.none; + } + else + { + if (("ODBC" == value)) + { + parsedValue = TypeType.ODBC; + } + else + { + if (("W3C" == value)) + { + parsedValue = TypeType.W3C; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebLog", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.IIS)) + { + writer.WriteAttributeString("Type", "IIS"); + } + if ((this.typeField == TypeType.NCSA)) + { + writer.WriteAttributeString("Type", "NCSA"); + } + if ((this.typeField == TypeType.none)) + { + writer.WriteAttributeString("Type", "none"); + } + if ((this.typeField == TypeType.ODBC)) + { + writer.WriteAttributeString("Type", "ODBC"); + } + if ((this.typeField == TypeType.W3C)) + { + writer.WriteAttributeString("Type", "W3C"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = WebLog.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Microsoft IIS Log File Format + /// + IIS, + + /// + /// NCSA Common Log File Format + /// + NCSA, + + /// + /// Disables logging. + /// + none, + + /// + /// ODBC Logging + /// + ODBC, + + /// + /// W3C Extended Log File Format + /// + W3C, + } + } + + /// + /// The WebServiceExtension property is used by the Web server to determine whether a Web service extension is permitted to run. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class WebServiceExtension : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string groupField; + + private bool groupFieldSet; + + private YesNoType allowField; + + private bool allowFieldSet; + + private YesNoType uIDeletableField; + + private bool uIDeletableFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Usually a Property that resolves to short file name path + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Description of the extension. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// String used to identify groups of extensions. + /// + public string Group + { + get + { + return this.groupField; + } + set + { + this.groupFieldSet = true; + this.groupField = value; + } + } + + /// + /// Indicates if the extension is allowed or denied. + /// + public YesNoType Allow + { + get + { + return this.allowField; + } + set + { + this.allowFieldSet = true; + this.allowField = value; + } + } + + /// + /// Indicates if the UI is allowed to delete the extension from the list of not. Default: Not deletable. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType UIDeletable + { + get + { + return this.uIDeletableField; + } + set + { + this.uIDeletableFieldSet = true; + this.uIDeletableField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WebServiceExtension", "http://wixtoolset.org/schemas/v4/wxs/iis"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.groupFieldSet) + { + writer.WriteAttributeString("Group", this.groupField); + } + if (this.allowFieldSet) + { + if ((this.allowField == YesNoType.no)) + { + writer.WriteAttributeString("Allow", "no"); + } + if ((this.allowField == YesNoType.yes)) + { + writer.WriteAttributeString("Allow", "yes"); + } + } + if (this.uIDeletableFieldSet) + { + if ((this.uIDeletableField == YesNoType.no)) + { + writer.WriteAttributeString("UIDeletable", "no"); + } + if ((this.uIDeletableField == YesNoType.yes)) + { + writer.WriteAttributeString("UIDeletable", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Group" == name)) + { + this.groupField = value; + this.groupFieldSet = true; + } + if (("Allow" == name)) + { + this.allowField = Enums.ParseYesNoType(value); + this.allowFieldSet = true; + } + if (("UIDeletable" == name)) + { + this.uIDeletableField = Enums.ParseYesNoType(value); + this.uIDeletableFieldSet = true; + } + } + } +} diff --git a/src/wix/heat/Serialize/util.cs b/src/wix/heat/Serialize/util.cs new file mode 100644 index 00000000..84f56eb0 --- /dev/null +++ b/src/wix/heat/Serialize/util.cs @@ -0,0 +1,11462 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 +namespace WixToolset.Harvesters.Serialize.Util +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + using WixToolset.Harvesters.Serialize; + + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a PerformanceCounterLanguageType from a string. + /// + public static PerformanceCounterLanguageType ParsePerformanceCounterLanguageType(string value) + { + PerformanceCounterLanguageType parsedValue; + Enums.TryParsePerformanceCounterLanguageType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PerformanceCounterLanguageType from a string. + /// + public static bool TryParsePerformanceCounterLanguageType(string value, out PerformanceCounterLanguageType parsedValue) + { + parsedValue = PerformanceCounterLanguageType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("afrikaans" == value)) + { + parsedValue = PerformanceCounterLanguageType.afrikaans; + } + else + { + if (("albanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.albanian; + } + else + { + if (("arabic" == value)) + { + parsedValue = PerformanceCounterLanguageType.arabic; + } + else + { + if (("armenian" == value)) + { + parsedValue = PerformanceCounterLanguageType.armenian; + } + else + { + if (("assamese" == value)) + { + parsedValue = PerformanceCounterLanguageType.assamese; + } + else + { + if (("azeri" == value)) + { + parsedValue = PerformanceCounterLanguageType.azeri; + } + else + { + if (("basque" == value)) + { + parsedValue = PerformanceCounterLanguageType.basque; + } + else + { + if (("belarusian" == value)) + { + parsedValue = PerformanceCounterLanguageType.belarusian; + } + else + { + if (("bengali" == value)) + { + parsedValue = PerformanceCounterLanguageType.bengali; + } + else + { + if (("bulgarian" == value)) + { + parsedValue = PerformanceCounterLanguageType.bulgarian; + } + else + { + if (("catalan" == value)) + { + parsedValue = PerformanceCounterLanguageType.catalan; + } + else + { + if (("chinese" == value)) + { + parsedValue = PerformanceCounterLanguageType.chinese; + } + else + { + if (("croatian" == value)) + { + parsedValue = PerformanceCounterLanguageType.croatian; + } + else + { + if (("czech" == value)) + { + parsedValue = PerformanceCounterLanguageType.czech; + } + else + { + if (("danish" == value)) + { + parsedValue = PerformanceCounterLanguageType.danish; + } + else + { + if (("divehi" == value)) + { + parsedValue = PerformanceCounterLanguageType.divehi; + } + else + { + if (("dutch" == value)) + { + parsedValue = PerformanceCounterLanguageType.dutch; + } + else + { + if (("english" == value)) + { + parsedValue = PerformanceCounterLanguageType.english; + } + else + { + if (("estonian" == value)) + { + parsedValue = PerformanceCounterLanguageType.estonian; + } + else + { + if (("faeroese" == value)) + { + parsedValue = PerformanceCounterLanguageType.faeroese; + } + else + { + if (("farsi" == value)) + { + parsedValue = PerformanceCounterLanguageType.farsi; + } + else + { + if (("finnish" == value)) + { + parsedValue = PerformanceCounterLanguageType.finnish; + } + else + { + if (("french" == value)) + { + parsedValue = PerformanceCounterLanguageType.french; + } + else + { + if (("galician" == value)) + { + parsedValue = PerformanceCounterLanguageType.galician; + } + else + { + if (("georgian" == value)) + { + parsedValue = PerformanceCounterLanguageType.georgian; + } + else + { + if (("german" == value)) + { + parsedValue = PerformanceCounterLanguageType.german; + } + else + { + if (("greek" == value)) + { + parsedValue = PerformanceCounterLanguageType.greek; + } + else + { + if (("gujarati" == value)) + { + parsedValue = PerformanceCounterLanguageType.gujarati; + } + else + { + if (("hebrew" == value)) + { + parsedValue = PerformanceCounterLanguageType.hebrew; + } + else + { + if (("hindi" == value)) + { + parsedValue = PerformanceCounterLanguageType.hindi; + } + else + { + if (("hungarian" == value)) + { + parsedValue = PerformanceCounterLanguageType.hungarian; + } + else + { + if (("icelandic" == value)) + { + parsedValue = PerformanceCounterLanguageType.icelandic; + } + else + { + if (("indonesian" == value)) + { + parsedValue = PerformanceCounterLanguageType.indonesian; + } + else + { + if (("italian" == value)) + { + parsedValue = PerformanceCounterLanguageType.italian; + } + else + { + if (("japanese" == value)) + { + parsedValue = PerformanceCounterLanguageType.japanese; + } + else + { + if (("kannada" == value)) + { + parsedValue = PerformanceCounterLanguageType.kannada; + } + else + { + if (("kashmiri" == value)) + { + parsedValue = PerformanceCounterLanguageType.kashmiri; + } + else + { + if (("kazak" == value)) + { + parsedValue = PerformanceCounterLanguageType.kazak; + } + else + { + if (("konkani" == value)) + { + parsedValue = PerformanceCounterLanguageType.konkani; + } + else + { + if (("korean" == value)) + { + parsedValue = PerformanceCounterLanguageType.korean; + } + else + { + if (("kyrgyz" == value)) + { + parsedValue = PerformanceCounterLanguageType.kyrgyz; + } + else + { + if (("latvian" == value)) + { + parsedValue = PerformanceCounterLanguageType.latvian; + } + else + { + if (("lithuanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.lithuanian; + } + else + { + if (("macedonian" == value)) + { + parsedValue = PerformanceCounterLanguageType.macedonian; + } + else + { + if (("malay" == value)) + { + parsedValue = PerformanceCounterLanguageType.malay; + } + else + { + if (("malayalam" == value)) + { + parsedValue = PerformanceCounterLanguageType.malayalam; + } + else + { + if (("manipuri" == value)) + { + parsedValue = PerformanceCounterLanguageType.manipuri; + } + else + { + if (("marathi" == value)) + { + parsedValue = PerformanceCounterLanguageType.marathi; + } + else + { + if (("mongolian" == value)) + { + parsedValue = PerformanceCounterLanguageType.mongolian; + } + else + { + if (("nepali" == value)) + { + parsedValue = PerformanceCounterLanguageType.nepali; + } + else + { + if (("norwegian" == value)) + { + parsedValue = PerformanceCounterLanguageType.norwegian; + } + else + { + if (("oriya" == value)) + { + parsedValue = PerformanceCounterLanguageType.oriya; + } + else + { + if (("polish" == value)) + { + parsedValue = PerformanceCounterLanguageType.polish; + } + else + { + if (("portuguese" == value)) + { + parsedValue = PerformanceCounterLanguageType.portuguese; + } + else + { + if (("punjabi" == value)) + { + parsedValue = PerformanceCounterLanguageType.punjabi; + } + else + { + if (("romanian" == value)) + { + parsedValue = PerformanceCounterLanguageType.romanian; + } + else + { + if (("russian" == value)) + { + parsedValue = PerformanceCounterLanguageType.russian; + } + else + { + if (("sanskrit" == value)) + { + parsedValue = PerformanceCounterLanguageType.sanskrit; + } + else + { + if (("serbian" == value)) + { + parsedValue = PerformanceCounterLanguageType.serbian; + } + else + { + if (("sindhi" == value)) + { + parsedValue = PerformanceCounterLanguageType.sindhi; + } + else + { + if (("slovak" == value)) + { + parsedValue = PerformanceCounterLanguageType.slovak; + } + else + { + if (("slovenian" == value)) + { + parsedValue = PerformanceCounterLanguageType.slovenian; + } + else + { + if (("spanish" == value)) + { + parsedValue = PerformanceCounterLanguageType.spanish; + } + else + { + if (("swahili" == value)) + { + parsedValue = PerformanceCounterLanguageType.swahili; + } + else + { + if (("swedish" == value)) + { + parsedValue = PerformanceCounterLanguageType.swedish; + } + else + { + if (("syriac" == value)) + { + parsedValue = PerformanceCounterLanguageType.syriac; + } + else + { + if (("tamil" == value)) + { + parsedValue = PerformanceCounterLanguageType.tamil; + } + else + { + if (("tatar" == value)) + { + parsedValue = PerformanceCounterLanguageType.tatar; + } + else + { + if (("telugu" == value)) + { + parsedValue = PerformanceCounterLanguageType.telugu; + } + else + { + if (("thai" == value)) + { + parsedValue = PerformanceCounterLanguageType.thai; + } + else + { + if (("turkish" == value)) + { + parsedValue = PerformanceCounterLanguageType.turkish; + } + else + { + if (("ukrainian" == value)) + { + parsedValue = PerformanceCounterLanguageType.ukrainian; + } + else + { + if (("urdu" == value)) + { + parsedValue = PerformanceCounterLanguageType.urdu; + } + else + { + if (("uzbek" == value)) + { + parsedValue = PerformanceCounterLanguageType.uzbek; + } + else + { + if (("vietnamese" == value)) + { + parsedValue = PerformanceCounterLanguageType.vietnamese; + } + else + { + parsedValue = PerformanceCounterLanguageType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a PerformanceCounterTypesType from a string. + /// + public static PerformanceCounterTypesType ParsePerformanceCounterTypesType(string value) + { + PerformanceCounterTypesType parsedValue; + Enums.TryParsePerformanceCounterTypesType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PerformanceCounterTypesType from a string. + /// + public static bool TryParsePerformanceCounterTypesType(string value, out PerformanceCounterTypesType parsedValue) + { + parsedValue = PerformanceCounterTypesType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("averageBase" == value)) + { + parsedValue = PerformanceCounterTypesType.averageBase; + } + else + { + if (("averageCount64" == value)) + { + parsedValue = PerformanceCounterTypesType.averageCount64; + } + else + { + if (("averageTimer32" == value)) + { + parsedValue = PerformanceCounterTypesType.averageTimer32; + } + else + { + if (("counterDelta32" == value)) + { + parsedValue = PerformanceCounterTypesType.counterDelta32; + } + else + { + if (("counterTimerInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterTimerInverse; + } + else + { + if (("sampleFraction" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleFraction; + } + else + { + if (("timer100Ns" == value)) + { + parsedValue = PerformanceCounterTypesType.timer100Ns; + } + else + { + if (("counterTimer" == value)) + { + parsedValue = PerformanceCounterTypesType.counterTimer; + } + else + { + if (("rawFraction" == value)) + { + parsedValue = PerformanceCounterTypesType.rawFraction; + } + else + { + if (("timer100NsInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.timer100NsInverse; + } + else + { + if (("counterMultiTimer" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer; + } + else + { + if (("counterMultiTimer100Ns" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer100Ns; + } + else + { + if (("counterMultiTimerInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimerInverse; + } + else + { + if (("counterMultiTimer100NsInverse" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiTimer100NsInverse; + } + else + { + if (("elapsedTime" == value)) + { + parsedValue = PerformanceCounterTypesType.elapsedTime; + } + else + { + if (("sampleBase" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleBase; + } + else + { + if (("rawBase" == value)) + { + parsedValue = PerformanceCounterTypesType.rawBase; + } + else + { + if (("counterMultiBase" == value)) + { + parsedValue = PerformanceCounterTypesType.counterMultiBase; + } + else + { + if (("rateOfCountsPerSecond64" == value)) + { + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond64; + } + else + { + if (("rateOfCountsPerSecond32" == value)) + { + parsedValue = PerformanceCounterTypesType.rateOfCountsPerSecond32; + } + else + { + if (("countPerTimeInterval64" == value)) + { + parsedValue = PerformanceCounterTypesType.countPerTimeInterval64; + } + else + { + if (("countPerTimeInterval32" == value)) + { + parsedValue = PerformanceCounterTypesType.countPerTimeInterval32; + } + else + { + if (("sampleCounter" == value)) + { + parsedValue = PerformanceCounterTypesType.sampleCounter; + } + else + { + if (("counterDelta64" == value)) + { + parsedValue = PerformanceCounterTypesType.counterDelta64; + } + else + { + if (("numberOfItems64" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItems64; + } + else + { + if (("numberOfItems32" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItems32; + } + else + { + if (("numberOfItemsHEX64" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX64; + } + else + { + if (("numberOfItemsHEX32" == value)) + { + parsedValue = PerformanceCounterTypesType.numberOfItemsHEX32; + } + else + { + parsedValue = PerformanceCounterTypesType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + } + + /// + /// Enumeration of valid languages for performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum PerformanceCounterLanguageType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + afrikaans, + + albanian, + + arabic, + + armenian, + + assamese, + + azeri, + + basque, + + belarusian, + + bengali, + + bulgarian, + + catalan, + + chinese, + + croatian, + + czech, + + danish, + + divehi, + + dutch, + + english, + + estonian, + + faeroese, + + farsi, + + finnish, + + french, + + galician, + + georgian, + + german, + + greek, + + gujarati, + + hebrew, + + hindi, + + hungarian, + + icelandic, + + indonesian, + + italian, + + japanese, + + kannada, + + kashmiri, + + kazak, + + konkani, + + korean, + + kyrgyz, + + latvian, + + lithuanian, + + macedonian, + + malay, + + malayalam, + + manipuri, + + marathi, + + mongolian, + + nepali, + + norwegian, + + oriya, + + polish, + + portuguese, + + punjabi, + + romanian, + + russian, + + sanskrit, + + serbian, + + sindhi, + + slovak, + + slovenian, + + spanish, + + swahili, + + swedish, + + syriac, + + tamil, + + tatar, + + telugu, + + thai, + + turkish, + + ukrainian, + + urdu, + + uzbek, + + vietnamese, + } + + /// + /// Enumeration of valid types for performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum PerformanceCounterTypesType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + averageBase, + + averageCount64, + + averageTimer32, + + counterDelta32, + + counterTimerInverse, + + sampleFraction, + + timer100Ns, + + counterTimer, + + rawFraction, + + timer100NsInverse, + + counterMultiTimer, + + counterMultiTimer100Ns, + + counterMultiTimerInverse, + + counterMultiTimer100NsInverse, + + elapsedTime, + + sampleBase, + + rawBase, + + counterMultiBase, + + rateOfCountsPerSecond64, + + rateOfCountsPerSecond32, + + countPerTimeInterval64, + + countPerTimeInterval32, + + sampleCounter, + + counterDelta64, + + numberOfItems64, + + numberOfItems32, + + numberOfItemsHEX64, + + numberOfItemsHEX32, + } + + /// + /// Closes applications or schedules a reboot if application cannot be closed. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class CloseApplication : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private YesNoType closeMessageField; + + private bool closeMessageFieldSet; + + private YesNoType endSessionMessageField; + + private bool endSessionMessageFieldSet; + + private YesNoType elevatedCloseMessageField; + + private bool elevatedCloseMessageFieldSet; + + private YesNoType elevatedEndSessionMessageField; + + private bool elevatedEndSessionMessageFieldSet; + + private YesNoType rebootPromptField; + + private bool rebootPromptFieldSet; + + private YesNoType promptToContinueField; + + private bool promptToContinueFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private int terminateProcessField; + + private bool terminateProcessFieldSet; + + private int timeoutField; + + private bool timeoutFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the close application (primary key). If the Id is not specified, one will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the exectuable to be closed. This should only be the file name. + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Description to show if application is running and needs to be closed. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Optionally orders the applications to be closed. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Optionally sends a close message to the application. Default is no. + /// + public YesNoType CloseMessage + { + get + { + return this.closeMessageField; + } + set + { + this.closeMessageFieldSet = true; + this.closeMessageField = value; + } + } + + /// + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application. Default is "no". + /// + public YesNoType EndSessionMessage + { + get + { + return this.endSessionMessageField; + } + set + { + this.endSessionMessageFieldSet = true; + this.endSessionMessageField = value; + } + } + + /// + /// Optionally sends a close message to the application from deffered action without impersonation. Default is no. + /// + public YesNoType ElevatedCloseMessage + { + get + { + return this.elevatedCloseMessageField; + } + set + { + this.elevatedCloseMessageFieldSet = true; + this.elevatedCloseMessageField = value; + } + } + + /// + /// Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application from a deffered action without impersonation. Default is "no". + /// + public YesNoType ElevatedEndSessionMessage + { + get + { + return this.elevatedEndSessionMessageField; + } + set + { + this.elevatedEndSessionMessageFieldSet = true; + this.elevatedEndSessionMessageField = value; + } + } + + /// + /// Optionally prompts for reboot if application is still running. The default is "yes". The TerminateProcess attribute must be "no" or not specified if this attribute is "yes". + /// + public YesNoType RebootPrompt + { + get + { + return this.rebootPromptField; + } + set + { + this.rebootPromptFieldSet = true; + this.rebootPromptField = value; + } + } + + /// + /// When this attribute is set to "yes", the user will be prompted when the application is still running. The Description attribute must contain the message to + /// display in the prompt. The prompt occurs before executing any of the other options and gives the options to "Abort", "Retry", or "Ignore". Abort will cancel + /// the install. Retry will attempt the check again and if the application is still running, prompt again. "Ignore" will continue and execute any other options + /// set on the CloseApplication element. The default is "no". + /// + public YesNoType PromptToContinue + { + get + { + return this.promptToContinueField; + } + set + { + this.promptToContinueFieldSet = true; + this.promptToContinueField = value; + } + } + + /// + /// Property to be set if application is still running. Useful for launch conditions or to conditionalize custom UI to ask user to shut down apps. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// Attempts to terminates process and return the specified exit code if application is still running after sending any requested close and/or end session messages. + /// If this attribute is specified, the RebootPrompt attribute must be "no". The default is "no". + /// + public int TerminateProcess + { + get + { + return this.terminateProcessField; + } + set + { + this.terminateProcessFieldSet = true; + this.terminateProcessField = value; + } + } + + /// + /// Optional time in seconds to wait for the application to exit after the close and/or end session messages. If the application is still running after the timeout then + /// the RebootPrompt or TerminateProcess attributes will be considered. The default value is "5" seconds. + /// + public int Timeout + { + get + { + return this.timeoutField; + } + set + { + this.timeoutFieldSet = true; + this.timeoutField = value; + } + } + + /// + /// Condition that determines if the application should be closed. Must be blank or evaluate to true + /// for the application to be scheduled for closing. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CloseApplication", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.closeMessageFieldSet) + { + if ((this.closeMessageField == YesNoType.no)) + { + writer.WriteAttributeString("CloseMessage", "no"); + } + if ((this.closeMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("CloseMessage", "yes"); + } + } + if (this.endSessionMessageFieldSet) + { + if ((this.endSessionMessageField == YesNoType.no)) + { + writer.WriteAttributeString("EndSessionMessage", "no"); + } + if ((this.endSessionMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("EndSessionMessage", "yes"); + } + } + if (this.elevatedCloseMessageFieldSet) + { + if ((this.elevatedCloseMessageField == YesNoType.no)) + { + writer.WriteAttributeString("ElevatedCloseMessage", "no"); + } + if ((this.elevatedCloseMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevatedCloseMessage", "yes"); + } + } + if (this.elevatedEndSessionMessageFieldSet) + { + if ((this.elevatedEndSessionMessageField == YesNoType.no)) + { + writer.WriteAttributeString("ElevatedEndSessionMessage", "no"); + } + if ((this.elevatedEndSessionMessageField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevatedEndSessionMessage", "yes"); + } + } + if (this.rebootPromptFieldSet) + { + if ((this.rebootPromptField == YesNoType.no)) + { + writer.WriteAttributeString("RebootPrompt", "no"); + } + if ((this.rebootPromptField == YesNoType.yes)) + { + writer.WriteAttributeString("RebootPrompt", "yes"); + } + } + if (this.promptToContinueFieldSet) + { + if ((this.promptToContinueField == YesNoType.no)) + { + writer.WriteAttributeString("PromptToContinue", "no"); + } + if ((this.promptToContinueField == YesNoType.yes)) + { + writer.WriteAttributeString("PromptToContinue", "yes"); + } + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.terminateProcessFieldSet) + { + writer.WriteAttributeString("TerminateProcess", this.terminateProcessField.ToString(CultureInfo.InvariantCulture)); + } + if (this.timeoutFieldSet) + { + writer.WriteAttributeString("Timeout", this.timeoutField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("CloseMessage" == name)) + { + this.closeMessageField = Enums.ParseYesNoType(value); + this.closeMessageFieldSet = true; + } + if (("EndSessionMessage" == name)) + { + this.endSessionMessageField = Enums.ParseYesNoType(value); + this.endSessionMessageFieldSet = true; + } + if (("ElevatedCloseMessage" == name)) + { + this.elevatedCloseMessageField = Enums.ParseYesNoType(value); + this.elevatedCloseMessageFieldSet = true; + } + if (("ElevatedEndSessionMessage" == name)) + { + this.elevatedEndSessionMessageField = Enums.ParseYesNoType(value); + this.elevatedEndSessionMessageFieldSet = true; + } + if (("RebootPrompt" == name)) + { + this.rebootPromptField = Enums.ParseYesNoType(value); + this.rebootPromptFieldSet = true; + } + if (("PromptToContinue" == name)) + { + this.promptToContinueField = Enums.ParseYesNoType(value); + this.promptToContinueFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("TerminateProcess" == name)) + { + this.terminateProcessField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.terminateProcessFieldSet = true; + } + if (("Timeout" == name)) + { + this.timeoutField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.timeoutFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Describes a component search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ComponentSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Component to search for. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// Optional ProductCode to determine if the component is installed. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// Rather than saving the matching key path into the variable, a ComponentSearch can save an attribute of the component instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + ComponentSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = ResultType.directory; + } + else + { + if (("state" == value)) + { + parsedValue = ResultType.state; + } + else + { + if (("keyPath" == value)) + { + parsedValue = ResultType.keyPath; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.directory)) + { + writer.WriteAttributeString("Result", "directory"); + } + if ((this.resultField == ResultType.state)) + { + writer.WriteAttributeString("Result", "state"); + } + if ((this.resultField == ResultType.keyPath)) + { + writer.WriteAttributeString("Result", "keyPath"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = ComponentSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves the parent directory for the component's file key path; other types of key path are returned unmodified. + /// + directory, + + /// + /// Saves the state of the component: absent (2), locally installed (3), will run from source (4), or installed in default location (either local or from source) (5) + /// + state, + + /// + /// Saves the key path of the component if installed. This is the default. + /// + keyPath, + } + } + + /// + /// References a ComponentSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ComponentSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Describes a directory search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class DirectorySearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Directory path to search for. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Rather than saving the matching directory path into the variable, a DirectorySearch can save an + /// attribute of the matching directory instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + DirectorySearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = DirectorySearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching directory is found; false otherwise. + /// + exists, + } + } + + /// + /// References a DirectorySearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class DirectorySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates an event source. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class EventSource : ISchemaElement, ISetAttributes + { + + private int categoryCountField; + + private bool categoryCountFieldSet; + + private string categoryMessageFileField; + + private bool categoryMessageFileFieldSet; + + private string eventMessageFileField; + + private bool eventMessageFileFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private string logField; + + private bool logFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string parameterMessageFileField; + + private bool parameterMessageFileFieldSet; + + private YesNoType supportsErrorsField; + + private bool supportsErrorsFieldSet; + + private YesNoType supportsFailureAuditsField; + + private bool supportsFailureAuditsFieldSet; + + private YesNoType supportsInformationalsField; + + private bool supportsInformationalsFieldSet; + + private YesNoType supportsSuccessAuditsField; + + private bool supportsSuccessAuditsFieldSet; + + private YesNoType supportsWarningsField; + + private bool supportsWarningsFieldSet; + + private ISchemaElement parentElement; + + /// + /// The number of categories in CategoryMessageFile. CategoryMessageFile + /// must be specified too. + /// + public int CategoryCount + { + get + { + return this.categoryCountField; + } + set + { + this.categoryCountFieldSet = true; + this.categoryCountField = value; + } + } + + /// + /// Name of the category message file. CategoryCount must be specified too. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string CategoryMessageFile + { + get + { + return this.categoryMessageFileField; + } + set + { + this.categoryMessageFileFieldSet = true; + this.categoryMessageFileField = value; + } + } + + /// + /// Name of the event message file. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string EventMessageFile + { + get + { + return this.eventMessageFileField; + } + set + { + this.eventMessageFileFieldSet = true; + this.eventMessageFileField = value; + } + } + + /// + /// Marks the EventSource registry as the key path of the component it belongs to. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// Name of the event source's log. + /// + public string Log + { + get + { + return this.logField; + } + set + { + this.logFieldSet = true; + this.logField = value; + } + } + + /// + /// Name of the event source. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Name of the parameter message file. + /// Note that this is a formatted field, so you can use [#fileId] syntax to + /// refer to a file being installed. It is also written as a REG_EXPAND_SZ + /// string, so you can use %environment_variable% syntax to refer to a file + /// already present on the user's machine. + /// + public string ParameterMessageFile + { + get + { + return this.parameterMessageFileField; + } + set + { + this.parameterMessageFileFieldSet = true; + this.parameterMessageFileField = value; + } + } + + /// + /// Equivalent to EVENTLOG_ERROR_TYPE. + /// + public YesNoType SupportsErrors + { + get + { + return this.supportsErrorsField; + } + set + { + this.supportsErrorsFieldSet = true; + this.supportsErrorsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_AUDIT_FAILURE. + /// + public YesNoType SupportsFailureAudits + { + get + { + return this.supportsFailureAuditsField; + } + set + { + this.supportsFailureAuditsFieldSet = true; + this.supportsFailureAuditsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_INFORMATION_TYPE. + /// + public YesNoType SupportsInformationals + { + get + { + return this.supportsInformationalsField; + } + set + { + this.supportsInformationalsFieldSet = true; + this.supportsInformationalsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_AUDIT_SUCCESS. + /// + public YesNoType SupportsSuccessAudits + { + get + { + return this.supportsSuccessAuditsField; + } + set + { + this.supportsSuccessAuditsFieldSet = true; + this.supportsSuccessAuditsField = value; + } + } + + /// + /// Equivalent to EVENTLOG_WARNING_TYPE. + /// + public YesNoType SupportsWarnings + { + get + { + return this.supportsWarningsField; + } + set + { + this.supportsWarningsFieldSet = true; + this.supportsWarningsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EventSource", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.categoryCountFieldSet) + { + writer.WriteAttributeString("CategoryCount", this.categoryCountField.ToString(CultureInfo.InvariantCulture)); + } + if (this.categoryMessageFileFieldSet) + { + writer.WriteAttributeString("CategoryMessageFile", this.categoryMessageFileField); + } + if (this.eventMessageFileFieldSet) + { + writer.WriteAttributeString("EventMessageFile", this.eventMessageFileField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.logFieldSet) + { + writer.WriteAttributeString("Log", this.logField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.parameterMessageFileFieldSet) + { + writer.WriteAttributeString("ParameterMessageFile", this.parameterMessageFileField); + } + if (this.supportsErrorsFieldSet) + { + if ((this.supportsErrorsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsErrors", "no"); + } + if ((this.supportsErrorsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsErrors", "yes"); + } + } + if (this.supportsFailureAuditsFieldSet) + { + if ((this.supportsFailureAuditsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsFailureAudits", "no"); + } + if ((this.supportsFailureAuditsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsFailureAudits", "yes"); + } + } + if (this.supportsInformationalsFieldSet) + { + if ((this.supportsInformationalsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsInformationals", "no"); + } + if ((this.supportsInformationalsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsInformationals", "yes"); + } + } + if (this.supportsSuccessAuditsFieldSet) + { + if ((this.supportsSuccessAuditsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsSuccessAudits", "no"); + } + if ((this.supportsSuccessAuditsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsSuccessAudits", "yes"); + } + } + if (this.supportsWarningsFieldSet) + { + if ((this.supportsWarningsField == YesNoType.no)) + { + writer.WriteAttributeString("SupportsWarnings", "no"); + } + if ((this.supportsWarningsField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportsWarnings", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("CategoryCount" == name)) + { + this.categoryCountField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.categoryCountFieldSet = true; + } + if (("CategoryMessageFile" == name)) + { + this.categoryMessageFileField = value; + this.categoryMessageFileFieldSet = true; + } + if (("EventMessageFile" == name)) + { + this.eventMessageFileField = value; + this.eventMessageFileFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("Log" == name)) + { + this.logField = value; + this.logFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ParameterMessageFile" == name)) + { + this.parameterMessageFileField = value; + this.parameterMessageFileFieldSet = true; + } + if (("SupportsErrors" == name)) + { + this.supportsErrorsField = Enums.ParseYesNoType(value); + this.supportsErrorsFieldSet = true; + } + if (("SupportsFailureAudits" == name)) + { + this.supportsFailureAuditsField = Enums.ParseYesNoType(value); + this.supportsFailureAuditsFieldSet = true; + } + if (("SupportsInformationals" == name)) + { + this.supportsInformationalsField = Enums.ParseYesNoType(value); + this.supportsInformationalsFieldSet = true; + } + if (("SupportsSuccessAudits" == name)) + { + this.supportsSuccessAuditsField = Enums.ParseYesNoType(value); + this.supportsSuccessAuditsFieldSet = true; + } + if (("SupportsWarnings" == name)) + { + this.supportsWarningsField = Enums.ParseYesNoType(value); + this.supportsWarningsFieldSet = true; + } + } + } + + /// + /// Describes a file search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// File path to search for. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Rather than saving the matching file path into the variable, a FileSearch can save an attribute of the matching file instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + FileSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + if (("version" == value)) + { + parsedValue = ResultType.version; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + if ((this.resultField == ResultType.version)) + { + writer.WriteAttributeString("Result", "version"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = FileSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching file is found; false otherwise. + /// + exists, + + /// + /// Saves the version information for files that have it (.exe, .dll); zero-version (0.0.0.0) otherwise. + /// + version, + } + } + + /// + /// References a FileSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates a file share out of the component's directory. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileShare : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private ISchemaElement parentElement; + + public FileShare() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(FileSharePermission))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the file share (primary key). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the file share. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Description of the file share. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("FileSharePermission" == childName)) + { + childValue = new FileSharePermission(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileShare", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + } + } + + /// + /// Sets ACLs on a FileShare. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FileSharePermission : ISchemaElement, ISetAttributes + { + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private ISchemaElement parentElement; + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSharePermission", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + } + } + + /// + /// Formats a file's contents at install time. The contents are formatted according to the rules of the + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class FormatFile : ISchemaElement, ISetAttributes + { + + private string binaryKeyField; + + private bool binaryKeyFieldSet; + + private ISchemaElement parentElement; + + /// + /// The id of a Binary row that contains a copy of the file. The file in the Binary table overwrites whatever + /// file is installed by the parent component. + /// + public string BinaryKey + { + get + { + return this.binaryKeyField; + } + set + { + this.binaryKeyFieldSet = true; + this.binaryKeyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FormatFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.binaryKeyFieldSet) + { + writer.WriteAttributeString("BinaryKey", this.binaryKeyField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("BinaryKey" == name)) + { + this.binaryKeyField = value; + this.binaryKeyFieldSet = true; + } + } + } + + /// + /// Finds user groups on the local machine or specified Active Directory domain. The local machine will be + /// searched for the group first then fallback to looking in Active Directory. This element is not capable + /// of creating new groups but can be used to add new or existing users to an existing group. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Group : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string domainField; + + private bool domainFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier in your installation package for this group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// An optional + /// + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Group", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + } + } + + /// + /// Used to join a user to a group + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class GroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("GroupRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Creates a shortcut to a URL. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class InternetShortcut : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private string iconFileField; + + private bool iconFileFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier in your installation package for this Internet shortcut. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Identifier reference to Directory element where shortcut is to be created. This attribute's value defaults to the parent Component directory. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// The name of the shortcut file, which is visible to the user. (The .lnk + /// extension is added automatically and by default, is not shown to the user.) + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// URL that should be opened when the user selects the shortcut. Windows + /// opens the URL in the appropriate handler for the protocol specified + /// in the URL. Note that this is a formatted field, so you can use + /// [#fileId] syntax to refer to a file being installed (using the file: + /// protocol). + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Which type of shortcut should be created. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Icon file that should be displayed. Note that this is a formatted field, so you can use + /// [#fileId] syntax to refer to a file being installed (using the file: + /// protocol). + /// + public string IconFile + { + get + { + return this.iconFileField; + } + set + { + this.iconFileFieldSet = true; + this.iconFileField = value; + } + } + + /// + /// Index of the icon being referenced + /// + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + InternetShortcut.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("url" == value)) + { + parsedValue = TypeType.url; + } + else + { + if (("link" == value)) + { + parsedValue = TypeType.link; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InternetShortcut", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.url)) + { + writer.WriteAttributeString("Type", "url"); + } + if ((this.typeField == TypeType.link)) + { + writer.WriteAttributeString("Type", "link"); + } + } + if (this.iconFileFieldSet) + { + writer.WriteAttributeString("IconFile", this.iconFileField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = InternetShortcut.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("IconFile" == name)) + { + this.iconFileField = value; + this.iconFileFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates .url files using IUniformResourceLocatorW. + /// + url, + + /// + /// Creates .lnk files using IShellLinkW (default). + /// + link, + } + } + + /// + /// Used to create performance categories and configure performance counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerformanceCategory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private YesNoType multiInstanceField; + + private bool multiInstanceFieldSet; + + private string libraryField; + + private bool libraryFieldSet; + + private string openField; + + private bool openFieldSet; + + private string closeField; + + private bool closeFieldSet; + + private string collectField; + + private bool collectFieldSet; + + private PerformanceCounterLanguageType defaultLanguageField; + + private bool defaultLanguageFieldSet; + + private ISchemaElement parentElement; + + public PerformanceCategory() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PerformanceCounter))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier in your installation package for this performance counter category. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the performance counter category. If this attribute is not provided the Id attribute is used as the name of the performance counter category. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Optional help text for the performance counter category. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// Flag that specifies whether the performance counter category is multi or single instanced. Default is single instance. + /// + public YesNoType MultiInstance + { + get + { + return this.multiInstanceField; + } + set + { + this.multiInstanceFieldSet = true; + this.multiInstanceField = value; + } + } + + /// + /// DLL that contains the performance counter. The default is "netfxperf.dll" which should be used for all managed code performance counters. + /// + public string Library + { + get + { + return this.libraryField; + } + set + { + this.libraryFieldSet = true; + this.libraryField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when opening the performance counter. The default is "OpenPerformanceData" which should be used for all managed code performance counters. + /// + public string Open + { + get + { + return this.openField; + } + set + { + this.openFieldSet = true; + this.openField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when closing the performance counter. The default is "ClosePerformanceData" which should be used for all managed code performance counters. + /// + public string Close + { + get + { + return this.closeField; + } + set + { + this.closeFieldSet = true; + this.closeField = value; + } + } + + /// + /// Function entry point in to the Library DLL called when collecting data from the performance counter. The default is "CollectPerformanceData" which should be used for all managed code performance counters. + /// + public string Collect + { + get + { + return this.collectField; + } + set + { + this.collectFieldSet = true; + this.collectField = value; + } + } + + /// + /// Default language for the performance category and contained counters' names and help text. + /// + public PerformanceCounterLanguageType DefaultLanguage + { + get + { + return this.defaultLanguageField; + } + set + { + this.defaultLanguageFieldSet = true; + this.defaultLanguageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PerformanceCounter" == childName)) + { + childValue = new PerformanceCounter(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerformanceCategory", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.multiInstanceFieldSet) + { + if ((this.multiInstanceField == YesNoType.no)) + { + writer.WriteAttributeString("MultiInstance", "no"); + } + if ((this.multiInstanceField == YesNoType.yes)) + { + writer.WriteAttributeString("MultiInstance", "yes"); + } + } + if (this.libraryFieldSet) + { + writer.WriteAttributeString("Library", this.libraryField); + } + if (this.openFieldSet) + { + writer.WriteAttributeString("Open", this.openField); + } + if (this.closeFieldSet) + { + writer.WriteAttributeString("Close", this.closeField); + } + if (this.collectFieldSet) + { + writer.WriteAttributeString("Collect", this.collectField); + } + if (this.defaultLanguageFieldSet) + { + if ((this.defaultLanguageField == PerformanceCounterLanguageType.afrikaans)) + { + writer.WriteAttributeString("DefaultLanguage", "afrikaans"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.albanian)) + { + writer.WriteAttributeString("DefaultLanguage", "albanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.arabic)) + { + writer.WriteAttributeString("DefaultLanguage", "arabic"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.armenian)) + { + writer.WriteAttributeString("DefaultLanguage", "armenian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.assamese)) + { + writer.WriteAttributeString("DefaultLanguage", "assamese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.azeri)) + { + writer.WriteAttributeString("DefaultLanguage", "azeri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.basque)) + { + writer.WriteAttributeString("DefaultLanguage", "basque"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.belarusian)) + { + writer.WriteAttributeString("DefaultLanguage", "belarusian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bengali)) + { + writer.WriteAttributeString("DefaultLanguage", "bengali"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.bulgarian)) + { + writer.WriteAttributeString("DefaultLanguage", "bulgarian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.catalan)) + { + writer.WriteAttributeString("DefaultLanguage", "catalan"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.chinese)) + { + writer.WriteAttributeString("DefaultLanguage", "chinese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.croatian)) + { + writer.WriteAttributeString("DefaultLanguage", "croatian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.czech)) + { + writer.WriteAttributeString("DefaultLanguage", "czech"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.danish)) + { + writer.WriteAttributeString("DefaultLanguage", "danish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.divehi)) + { + writer.WriteAttributeString("DefaultLanguage", "divehi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.dutch)) + { + writer.WriteAttributeString("DefaultLanguage", "dutch"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.english)) + { + writer.WriteAttributeString("DefaultLanguage", "english"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.estonian)) + { + writer.WriteAttributeString("DefaultLanguage", "estonian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.faeroese)) + { + writer.WriteAttributeString("DefaultLanguage", "faeroese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.farsi)) + { + writer.WriteAttributeString("DefaultLanguage", "farsi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.finnish)) + { + writer.WriteAttributeString("DefaultLanguage", "finnish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.french)) + { + writer.WriteAttributeString("DefaultLanguage", "french"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.galician)) + { + writer.WriteAttributeString("DefaultLanguage", "galician"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.georgian)) + { + writer.WriteAttributeString("DefaultLanguage", "georgian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.german)) + { + writer.WriteAttributeString("DefaultLanguage", "german"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.greek)) + { + writer.WriteAttributeString("DefaultLanguage", "greek"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.gujarati)) + { + writer.WriteAttributeString("DefaultLanguage", "gujarati"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hebrew)) + { + writer.WriteAttributeString("DefaultLanguage", "hebrew"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hindi)) + { + writer.WriteAttributeString("DefaultLanguage", "hindi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.hungarian)) + { + writer.WriteAttributeString("DefaultLanguage", "hungarian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.icelandic)) + { + writer.WriteAttributeString("DefaultLanguage", "icelandic"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.indonesian)) + { + writer.WriteAttributeString("DefaultLanguage", "indonesian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.italian)) + { + writer.WriteAttributeString("DefaultLanguage", "italian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.japanese)) + { + writer.WriteAttributeString("DefaultLanguage", "japanese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kannada)) + { + writer.WriteAttributeString("DefaultLanguage", "kannada"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kashmiri)) + { + writer.WriteAttributeString("DefaultLanguage", "kashmiri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kazak)) + { + writer.WriteAttributeString("DefaultLanguage", "kazak"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.konkani)) + { + writer.WriteAttributeString("DefaultLanguage", "konkani"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.korean)) + { + writer.WriteAttributeString("DefaultLanguage", "korean"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.kyrgyz)) + { + writer.WriteAttributeString("DefaultLanguage", "kyrgyz"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.latvian)) + { + writer.WriteAttributeString("DefaultLanguage", "latvian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.lithuanian)) + { + writer.WriteAttributeString("DefaultLanguage", "lithuanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.macedonian)) + { + writer.WriteAttributeString("DefaultLanguage", "macedonian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.malay)) + { + writer.WriteAttributeString("DefaultLanguage", "malay"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.malayalam)) + { + writer.WriteAttributeString("DefaultLanguage", "malayalam"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.manipuri)) + { + writer.WriteAttributeString("DefaultLanguage", "manipuri"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.marathi)) + { + writer.WriteAttributeString("DefaultLanguage", "marathi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.mongolian)) + { + writer.WriteAttributeString("DefaultLanguage", "mongolian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.nepali)) + { + writer.WriteAttributeString("DefaultLanguage", "nepali"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.norwegian)) + { + writer.WriteAttributeString("DefaultLanguage", "norwegian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.oriya)) + { + writer.WriteAttributeString("DefaultLanguage", "oriya"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.polish)) + { + writer.WriteAttributeString("DefaultLanguage", "polish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.portuguese)) + { + writer.WriteAttributeString("DefaultLanguage", "portuguese"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.punjabi)) + { + writer.WriteAttributeString("DefaultLanguage", "punjabi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.romanian)) + { + writer.WriteAttributeString("DefaultLanguage", "romanian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.russian)) + { + writer.WriteAttributeString("DefaultLanguage", "russian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.sanskrit)) + { + writer.WriteAttributeString("DefaultLanguage", "sanskrit"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.serbian)) + { + writer.WriteAttributeString("DefaultLanguage", "serbian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.sindhi)) + { + writer.WriteAttributeString("DefaultLanguage", "sindhi"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovak)) + { + writer.WriteAttributeString("DefaultLanguage", "slovak"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.slovenian)) + { + writer.WriteAttributeString("DefaultLanguage", "slovenian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.spanish)) + { + writer.WriteAttributeString("DefaultLanguage", "spanish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.swahili)) + { + writer.WriteAttributeString("DefaultLanguage", "swahili"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.swedish)) + { + writer.WriteAttributeString("DefaultLanguage", "swedish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.syriac)) + { + writer.WriteAttributeString("DefaultLanguage", "syriac"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.tamil)) + { + writer.WriteAttributeString("DefaultLanguage", "tamil"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.tatar)) + { + writer.WriteAttributeString("DefaultLanguage", "tatar"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.telugu)) + { + writer.WriteAttributeString("DefaultLanguage", "telugu"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.thai)) + { + writer.WriteAttributeString("DefaultLanguage", "thai"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.turkish)) + { + writer.WriteAttributeString("DefaultLanguage", "turkish"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.ukrainian)) + { + writer.WriteAttributeString("DefaultLanguage", "ukrainian"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.urdu)) + { + writer.WriteAttributeString("DefaultLanguage", "urdu"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.uzbek)) + { + writer.WriteAttributeString("DefaultLanguage", "uzbek"); + } + if ((this.defaultLanguageField == PerformanceCounterLanguageType.vietnamese)) + { + writer.WriteAttributeString("DefaultLanguage", "vietnamese"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("MultiInstance" == name)) + { + this.multiInstanceField = Enums.ParseYesNoType(value); + this.multiInstanceFieldSet = true; + } + if (("Library" == name)) + { + this.libraryField = value; + this.libraryFieldSet = true; + } + if (("Open" == name)) + { + this.openField = value; + this.openFieldSet = true; + } + if (("Close" == name)) + { + this.closeField = value; + this.closeFieldSet = true; + } + if (("Collect" == name)) + { + this.collectField = value; + this.collectFieldSet = true; + } + if (("DefaultLanguage" == name)) + { + this.defaultLanguageField = Enums.ParsePerformanceCounterLanguageType(value); + this.defaultLanguageFieldSet = true; + } + } + } + + /// + /// Creates a performance counter in a performance category. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerformanceCounter : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private PerformanceCounterTypesType typeField; + + private bool typeFieldSet; + + private PerformanceCounterLanguageType languageField; + + private bool languageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name for the performance counter. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Optional help text for the performance counter. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// Type of the performance counter. + /// + public PerformanceCounterTypesType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Language for the peformance counter name and help. The default is to use the parent PerformanceCategory element's DefaultLanguage attribute. + /// + public PerformanceCounterLanguageType Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerformanceCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.typeFieldSet) + { + if ((this.typeField == PerformanceCounterTypesType.averageBase)) + { + writer.WriteAttributeString("Type", "averageBase"); + } + if ((this.typeField == PerformanceCounterTypesType.averageCount64)) + { + writer.WriteAttributeString("Type", "averageCount64"); + } + if ((this.typeField == PerformanceCounterTypesType.averageTimer32)) + { + writer.WriteAttributeString("Type", "averageTimer32"); + } + if ((this.typeField == PerformanceCounterTypesType.counterDelta32)) + { + writer.WriteAttributeString("Type", "counterDelta32"); + } + if ((this.typeField == PerformanceCounterTypesType.counterTimerInverse)) + { + writer.WriteAttributeString("Type", "counterTimerInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleFraction)) + { + writer.WriteAttributeString("Type", "sampleFraction"); + } + if ((this.typeField == PerformanceCounterTypesType.timer100Ns)) + { + writer.WriteAttributeString("Type", "timer100Ns"); + } + if ((this.typeField == PerformanceCounterTypesType.counterTimer)) + { + writer.WriteAttributeString("Type", "counterTimer"); + } + if ((this.typeField == PerformanceCounterTypesType.rawFraction)) + { + writer.WriteAttributeString("Type", "rawFraction"); + } + if ((this.typeField == PerformanceCounterTypesType.timer100NsInverse)) + { + writer.WriteAttributeString("Type", "timer100NsInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer)) + { + writer.WriteAttributeString("Type", "counterMultiTimer"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100Ns)) + { + writer.WriteAttributeString("Type", "counterMultiTimer100Ns"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimerInverse)) + { + writer.WriteAttributeString("Type", "counterMultiTimerInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiTimer100NsInverse)) + { + writer.WriteAttributeString("Type", "counterMultiTimer100NsInverse"); + } + if ((this.typeField == PerformanceCounterTypesType.elapsedTime)) + { + writer.WriteAttributeString("Type", "elapsedTime"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleBase)) + { + writer.WriteAttributeString("Type", "sampleBase"); + } + if ((this.typeField == PerformanceCounterTypesType.rawBase)) + { + writer.WriteAttributeString("Type", "rawBase"); + } + if ((this.typeField == PerformanceCounterTypesType.counterMultiBase)) + { + writer.WriteAttributeString("Type", "counterMultiBase"); + } + if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond64)) + { + writer.WriteAttributeString("Type", "rateOfCountsPerSecond64"); + } + if ((this.typeField == PerformanceCounterTypesType.rateOfCountsPerSecond32)) + { + writer.WriteAttributeString("Type", "rateOfCountsPerSecond32"); + } + if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval64)) + { + writer.WriteAttributeString("Type", "countPerTimeInterval64"); + } + if ((this.typeField == PerformanceCounterTypesType.countPerTimeInterval32)) + { + writer.WriteAttributeString("Type", "countPerTimeInterval32"); + } + if ((this.typeField == PerformanceCounterTypesType.sampleCounter)) + { + writer.WriteAttributeString("Type", "sampleCounter"); + } + if ((this.typeField == PerformanceCounterTypesType.counterDelta64)) + { + writer.WriteAttributeString("Type", "counterDelta64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItems64)) + { + writer.WriteAttributeString("Type", "numberOfItems64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItems32)) + { + writer.WriteAttributeString("Type", "numberOfItems32"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX64)) + { + writer.WriteAttributeString("Type", "numberOfItemsHEX64"); + } + if ((this.typeField == PerformanceCounterTypesType.numberOfItemsHEX32)) + { + writer.WriteAttributeString("Type", "numberOfItemsHEX32"); + } + } + if (this.languageFieldSet) + { + if ((this.languageField == PerformanceCounterLanguageType.afrikaans)) + { + writer.WriteAttributeString("Language", "afrikaans"); + } + if ((this.languageField == PerformanceCounterLanguageType.albanian)) + { + writer.WriteAttributeString("Language", "albanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.arabic)) + { + writer.WriteAttributeString("Language", "arabic"); + } + if ((this.languageField == PerformanceCounterLanguageType.armenian)) + { + writer.WriteAttributeString("Language", "armenian"); + } + if ((this.languageField == PerformanceCounterLanguageType.assamese)) + { + writer.WriteAttributeString("Language", "assamese"); + } + if ((this.languageField == PerformanceCounterLanguageType.azeri)) + { + writer.WriteAttributeString("Language", "azeri"); + } + if ((this.languageField == PerformanceCounterLanguageType.basque)) + { + writer.WriteAttributeString("Language", "basque"); + } + if ((this.languageField == PerformanceCounterLanguageType.belarusian)) + { + writer.WriteAttributeString("Language", "belarusian"); + } + if ((this.languageField == PerformanceCounterLanguageType.bengali)) + { + writer.WriteAttributeString("Language", "bengali"); + } + if ((this.languageField == PerformanceCounterLanguageType.bulgarian)) + { + writer.WriteAttributeString("Language", "bulgarian"); + } + if ((this.languageField == PerformanceCounterLanguageType.catalan)) + { + writer.WriteAttributeString("Language", "catalan"); + } + if ((this.languageField == PerformanceCounterLanguageType.chinese)) + { + writer.WriteAttributeString("Language", "chinese"); + } + if ((this.languageField == PerformanceCounterLanguageType.croatian)) + { + writer.WriteAttributeString("Language", "croatian"); + } + if ((this.languageField == PerformanceCounterLanguageType.czech)) + { + writer.WriteAttributeString("Language", "czech"); + } + if ((this.languageField == PerformanceCounterLanguageType.danish)) + { + writer.WriteAttributeString("Language", "danish"); + } + if ((this.languageField == PerformanceCounterLanguageType.divehi)) + { + writer.WriteAttributeString("Language", "divehi"); + } + if ((this.languageField == PerformanceCounterLanguageType.dutch)) + { + writer.WriteAttributeString("Language", "dutch"); + } + if ((this.languageField == PerformanceCounterLanguageType.english)) + { + writer.WriteAttributeString("Language", "english"); + } + if ((this.languageField == PerformanceCounterLanguageType.estonian)) + { + writer.WriteAttributeString("Language", "estonian"); + } + if ((this.languageField == PerformanceCounterLanguageType.faeroese)) + { + writer.WriteAttributeString("Language", "faeroese"); + } + if ((this.languageField == PerformanceCounterLanguageType.farsi)) + { + writer.WriteAttributeString("Language", "farsi"); + } + if ((this.languageField == PerformanceCounterLanguageType.finnish)) + { + writer.WriteAttributeString("Language", "finnish"); + } + if ((this.languageField == PerformanceCounterLanguageType.french)) + { + writer.WriteAttributeString("Language", "french"); + } + if ((this.languageField == PerformanceCounterLanguageType.galician)) + { + writer.WriteAttributeString("Language", "galician"); + } + if ((this.languageField == PerformanceCounterLanguageType.georgian)) + { + writer.WriteAttributeString("Language", "georgian"); + } + if ((this.languageField == PerformanceCounterLanguageType.german)) + { + writer.WriteAttributeString("Language", "german"); + } + if ((this.languageField == PerformanceCounterLanguageType.greek)) + { + writer.WriteAttributeString("Language", "greek"); + } + if ((this.languageField == PerformanceCounterLanguageType.gujarati)) + { + writer.WriteAttributeString("Language", "gujarati"); + } + if ((this.languageField == PerformanceCounterLanguageType.hebrew)) + { + writer.WriteAttributeString("Language", "hebrew"); + } + if ((this.languageField == PerformanceCounterLanguageType.hindi)) + { + writer.WriteAttributeString("Language", "hindi"); + } + if ((this.languageField == PerformanceCounterLanguageType.hungarian)) + { + writer.WriteAttributeString("Language", "hungarian"); + } + if ((this.languageField == PerformanceCounterLanguageType.icelandic)) + { + writer.WriteAttributeString("Language", "icelandic"); + } + if ((this.languageField == PerformanceCounterLanguageType.indonesian)) + { + writer.WriteAttributeString("Language", "indonesian"); + } + if ((this.languageField == PerformanceCounterLanguageType.italian)) + { + writer.WriteAttributeString("Language", "italian"); + } + if ((this.languageField == PerformanceCounterLanguageType.japanese)) + { + writer.WriteAttributeString("Language", "japanese"); + } + if ((this.languageField == PerformanceCounterLanguageType.kannada)) + { + writer.WriteAttributeString("Language", "kannada"); + } + if ((this.languageField == PerformanceCounterLanguageType.kashmiri)) + { + writer.WriteAttributeString("Language", "kashmiri"); + } + if ((this.languageField == PerformanceCounterLanguageType.kazak)) + { + writer.WriteAttributeString("Language", "kazak"); + } + if ((this.languageField == PerformanceCounterLanguageType.konkani)) + { + writer.WriteAttributeString("Language", "konkani"); + } + if ((this.languageField == PerformanceCounterLanguageType.korean)) + { + writer.WriteAttributeString("Language", "korean"); + } + if ((this.languageField == PerformanceCounterLanguageType.kyrgyz)) + { + writer.WriteAttributeString("Language", "kyrgyz"); + } + if ((this.languageField == PerformanceCounterLanguageType.latvian)) + { + writer.WriteAttributeString("Language", "latvian"); + } + if ((this.languageField == PerformanceCounterLanguageType.lithuanian)) + { + writer.WriteAttributeString("Language", "lithuanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.macedonian)) + { + writer.WriteAttributeString("Language", "macedonian"); + } + if ((this.languageField == PerformanceCounterLanguageType.malay)) + { + writer.WriteAttributeString("Language", "malay"); + } + if ((this.languageField == PerformanceCounterLanguageType.malayalam)) + { + writer.WriteAttributeString("Language", "malayalam"); + } + if ((this.languageField == PerformanceCounterLanguageType.manipuri)) + { + writer.WriteAttributeString("Language", "manipuri"); + } + if ((this.languageField == PerformanceCounterLanguageType.marathi)) + { + writer.WriteAttributeString("Language", "marathi"); + } + if ((this.languageField == PerformanceCounterLanguageType.mongolian)) + { + writer.WriteAttributeString("Language", "mongolian"); + } + if ((this.languageField == PerformanceCounterLanguageType.nepali)) + { + writer.WriteAttributeString("Language", "nepali"); + } + if ((this.languageField == PerformanceCounterLanguageType.norwegian)) + { + writer.WriteAttributeString("Language", "norwegian"); + } + if ((this.languageField == PerformanceCounterLanguageType.oriya)) + { + writer.WriteAttributeString("Language", "oriya"); + } + if ((this.languageField == PerformanceCounterLanguageType.polish)) + { + writer.WriteAttributeString("Language", "polish"); + } + if ((this.languageField == PerformanceCounterLanguageType.portuguese)) + { + writer.WriteAttributeString("Language", "portuguese"); + } + if ((this.languageField == PerformanceCounterLanguageType.punjabi)) + { + writer.WriteAttributeString("Language", "punjabi"); + } + if ((this.languageField == PerformanceCounterLanguageType.romanian)) + { + writer.WriteAttributeString("Language", "romanian"); + } + if ((this.languageField == PerformanceCounterLanguageType.russian)) + { + writer.WriteAttributeString("Language", "russian"); + } + if ((this.languageField == PerformanceCounterLanguageType.sanskrit)) + { + writer.WriteAttributeString("Language", "sanskrit"); + } + if ((this.languageField == PerformanceCounterLanguageType.serbian)) + { + writer.WriteAttributeString("Language", "serbian"); + } + if ((this.languageField == PerformanceCounterLanguageType.sindhi)) + { + writer.WriteAttributeString("Language", "sindhi"); + } + if ((this.languageField == PerformanceCounterLanguageType.slovak)) + { + writer.WriteAttributeString("Language", "slovak"); + } + if ((this.languageField == PerformanceCounterLanguageType.slovenian)) + { + writer.WriteAttributeString("Language", "slovenian"); + } + if ((this.languageField == PerformanceCounterLanguageType.spanish)) + { + writer.WriteAttributeString("Language", "spanish"); + } + if ((this.languageField == PerformanceCounterLanguageType.swahili)) + { + writer.WriteAttributeString("Language", "swahili"); + } + if ((this.languageField == PerformanceCounterLanguageType.swedish)) + { + writer.WriteAttributeString("Language", "swedish"); + } + if ((this.languageField == PerformanceCounterLanguageType.syriac)) + { + writer.WriteAttributeString("Language", "syriac"); + } + if ((this.languageField == PerformanceCounterLanguageType.tamil)) + { + writer.WriteAttributeString("Language", "tamil"); + } + if ((this.languageField == PerformanceCounterLanguageType.tatar)) + { + writer.WriteAttributeString("Language", "tatar"); + } + if ((this.languageField == PerformanceCounterLanguageType.telugu)) + { + writer.WriteAttributeString("Language", "telugu"); + } + if ((this.languageField == PerformanceCounterLanguageType.thai)) + { + writer.WriteAttributeString("Language", "thai"); + } + if ((this.languageField == PerformanceCounterLanguageType.turkish)) + { + writer.WriteAttributeString("Language", "turkish"); + } + if ((this.languageField == PerformanceCounterLanguageType.ukrainian)) + { + writer.WriteAttributeString("Language", "ukrainian"); + } + if ((this.languageField == PerformanceCounterLanguageType.urdu)) + { + writer.WriteAttributeString("Language", "urdu"); + } + if ((this.languageField == PerformanceCounterLanguageType.uzbek)) + { + writer.WriteAttributeString("Language", "uzbek"); + } + if ((this.languageField == PerformanceCounterLanguageType.vietnamese)) + { + writer.WriteAttributeString("Language", "vietnamese"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Enums.ParsePerformanceCounterTypesType(value); + this.typeFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = Enums.ParsePerformanceCounterLanguageType(value); + this.languageFieldSet = true; + } + } + } + + /// + /// Used to install Perfmon counters. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerfCounter : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private ISchemaElement parentElement; + + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerfCounter", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + } + } + + /// + /// Used to install Perfmon Counter Manifests. + /// Note that this functionality cannot be used with major upgrades that are scheduled after the InstallExecute, + /// InstallExecuteAgain, or InstallFinalize actions. For more information on major upgrade scheduling, see + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PerfCounterManifest : ISchemaElement, ISetAttributes + { + + private string resourceFileDirectoryField; + + private bool resourceFileDirectoryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The directory that holds the resource file of the providers in the perfmon counter manifest. Often the resource file path cannot be determined until setup time. Put the directory here and during perfmon manifest registrtion the path will be updated in the registry. If not specified, Perfmon will look for the resource file in the same directory of the perfmon counter manifest file. + /// + public string ResourceFileDirectory + { + get + { + return this.resourceFileDirectoryField; + } + set + { + this.resourceFileDirectoryFieldSet = true; + this.resourceFileDirectoryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PerfCounterManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.resourceFileDirectoryFieldSet) + { + writer.WriteAttributeString("ResourceFileDirectory", this.resourceFileDirectoryField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ResourceFileDirectory" == name)) + { + this.resourceFileDirectoryField = value; + this.resourceFileDirectoryFieldSet = true; + } + } + } + + /// + /// Used to install Event Manifests. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class EventManifest : ISchemaElement, ISetAttributes + { + + private string messageFileField; + + private bool messageFileFieldSet; + + private string parameterFileField; + + private bool parameterFileFieldSet; + + private string resourceFileField; + + private bool resourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// The message file (including path) of all the providers in the event manifest. Often the message file path cannot be determined until setup time. Put your MessageFile here and the messageFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string MessageFile + { + get + { + return this.messageFileField; + } + set + { + this.messageFileFieldSet = true; + this.messageFileField = value; + } + } + + /// + /// The parameter file (including path) of all the providers in the event manifest. Often the parameter file path cannot be determined until setup time. Put your ParameterFile here and the parameterFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string ParameterFile + { + get + { + return this.parameterFileField; + } + set + { + this.parameterFileFieldSet = true; + this.parameterFileField = value; + } + } + + /// + /// The resource file (including path) of all the providers in the event manifest. Often the resource file path cannot be determined until setup time. Put your ResourceFile here and the resourceFileName attribute of the all the providers in the manifest will be updated with the path before it is registered. + /// + public string ResourceFile + { + get + { + return this.resourceFileField; + } + set + { + this.resourceFileFieldSet = true; + this.resourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EventManifest", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.messageFileFieldSet) + { + writer.WriteAttributeString("MessageFile", this.messageFileField); + } + if (this.parameterFileFieldSet) + { + writer.WriteAttributeString("ParameterFile", this.parameterFileField); + } + if (this.resourceFileFieldSet) + { + writer.WriteAttributeString("ResourceFile", this.resourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("MessageFile" == name)) + { + this.messageFileField = value; + this.messageFileFieldSet = true; + } + if (("ParameterFile" == name)) + { + this.parameterFileField = value; + this.parameterFileFieldSet = true; + } + if (("ResourceFile" == name)) + { + this.resourceFileField = value; + this.resourceFileFieldSet = true; + } + } + } + + /// + /// Sets ACLs on File, Registry, CreateFolder, or ServiceInstall. When under a Registry element, this cannot be used + /// if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PermissionEx : ISchemaElement, ISetAttributes + { + + private string domainField; + + private bool domainFieldSet; + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType appendField; + + private bool appendFieldSet; + + private YesNoType executeField; + + private bool executeFieldSet; + + private YesNoType writeField; + + private bool writeFieldSet; + + private YesNoType createSubkeysField; + + private bool createSubkeysFieldSet; + + private YesNoType enumerateSubkeysField; + + private bool enumerateSubkeysFieldSet; + + private YesNoType notifyField; + + private bool notifyFieldSet; + + private YesNoType createLinkField; + + private bool createLinkFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private YesNoType serviceQueryConfigField; + + private bool serviceQueryConfigFieldSet; + + private YesNoType serviceChangeConfigField; + + private bool serviceChangeConfigFieldSet; + + private YesNoType serviceQueryStatusField; + + private bool serviceQueryStatusFieldSet; + + private YesNoType serviceEnumerateDependentsField; + + private bool serviceEnumerateDependentsFieldSet; + + private YesNoType serviceStartField; + + private bool serviceStartFieldSet; + + private YesNoType serviceStopField; + + private bool serviceStopFieldSet; + + private YesNoType servicePauseContinueField; + + private bool servicePauseContinueFieldSet; + + private YesNoType serviceInterrogateField; + + private bool serviceInterrogateFieldSet; + + private YesNoType serviceUserDefinedControlField; + + private bool serviceUserDefinedControlFieldSet; + + private ISchemaElement parentElement; + + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType Append + { + get + { + return this.appendField; + } + set + { + this.appendFieldSet = true; + this.appendField = value; + } + } + + public YesNoType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + public YesNoType Write + { + get + { + return this.writeField; + } + set + { + this.writeFieldSet = true; + this.writeField = value; + } + } + + public YesNoType CreateSubkeys + { + get + { + return this.createSubkeysField; + } + set + { + this.createSubkeysFieldSet = true; + this.createSubkeysField = value; + } + } + + public YesNoType EnumerateSubkeys + { + get + { + return this.enumerateSubkeysField; + } + set + { + this.enumerateSubkeysFieldSet = true; + this.enumerateSubkeysField = value; + } + } + + public YesNoType Notify + { + get + { + return this.notifyField; + } + set + { + this.notifyFieldSet = true; + this.notifyField = value; + } + } + + public YesNoType CreateLink + { + get + { + return this.createLinkField; + } + set + { + this.createLinkFieldSet = true; + this.createLinkField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + /// + /// Required to call the QueryServiceConfig and QueryServiceConfig2 functions to query the service configuration. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceQueryConfig + { + get + { + return this.serviceQueryConfigField; + } + set + { + this.serviceQueryConfigFieldSet = true; + this.serviceQueryConfigField = value; + } + } + + /// + /// Required to call the ChangeServiceConfig or ChangeServiceConfig2 function to change the service configuration. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceChangeConfig + { + get + { + return this.serviceChangeConfigField; + } + set + { + this.serviceChangeConfigFieldSet = true; + this.serviceChangeConfigField = value; + } + } + + /// + /// Required to call the QueryServiceStatus function to ask the service control manager about the status of the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceQueryStatus + { + get + { + return this.serviceQueryStatusField; + } + set + { + this.serviceQueryStatusFieldSet = true; + this.serviceQueryStatusField = value; + } + } + + /// + /// Required to call the EnumDependentServices function to enumerate all the services dependent on the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceEnumerateDependents + { + get + { + return this.serviceEnumerateDependentsField; + } + set + { + this.serviceEnumerateDependentsFieldSet = true; + this.serviceEnumerateDependentsField = value; + } + } + + /// + /// Required to call the StartService function to start the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceStart + { + get + { + return this.serviceStartField; + } + set + { + this.serviceStartFieldSet = true; + this.serviceStartField = value; + } + } + + /// + /// Required to call the ControlService function to stop the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceStop + { + get + { + return this.serviceStopField; + } + set + { + this.serviceStopFieldSet = true; + this.serviceStopField = value; + } + } + + /// + /// Required to call the ControlService function to pause or continue the service. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServicePauseContinue + { + get + { + return this.servicePauseContinueField; + } + set + { + this.servicePauseContinueFieldSet = true; + this.servicePauseContinueField = value; + } + } + + /// + /// Required to call the ControlService function to ask the service to report its status immediately. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceInterrogate + { + get + { + return this.serviceInterrogateField; + } + set + { + this.serviceInterrogateFieldSet = true; + this.serviceInterrogateField = value; + } + } + + /// + /// Required to call the ControlService function to specify a user-defined control code. Only valid under a 'ServiceInstall' parent. + /// + public YesNoType ServiceUserDefinedControl + { + get + { + return this.serviceUserDefinedControlField; + } + set + { + this.serviceUserDefinedControlFieldSet = true; + this.serviceUserDefinedControlField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PermissionEx", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.appendFieldSet) + { + if ((this.appendField == YesNoType.no)) + { + writer.WriteAttributeString("Append", "no"); + } + if ((this.appendField == YesNoType.yes)) + { + writer.WriteAttributeString("Append", "yes"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == YesNoType.no)) + { + writer.WriteAttributeString("Execute", "no"); + } + if ((this.executeField == YesNoType.yes)) + { + writer.WriteAttributeString("Execute", "yes"); + } + } + if (this.writeFieldSet) + { + if ((this.writeField == YesNoType.no)) + { + writer.WriteAttributeString("Write", "no"); + } + if ((this.writeField == YesNoType.yes)) + { + writer.WriteAttributeString("Write", "yes"); + } + } + if (this.createSubkeysFieldSet) + { + if ((this.createSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("CreateSubkeys", "no"); + } + if ((this.createSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateSubkeys", "yes"); + } + } + if (this.enumerateSubkeysFieldSet) + { + if ((this.enumerateSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("EnumerateSubkeys", "no"); + } + if ((this.enumerateSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("EnumerateSubkeys", "yes"); + } + } + if (this.notifyFieldSet) + { + if ((this.notifyField == YesNoType.no)) + { + writer.WriteAttributeString("Notify", "no"); + } + if ((this.notifyField == YesNoType.yes)) + { + writer.WriteAttributeString("Notify", "yes"); + } + } + if (this.createLinkFieldSet) + { + if ((this.createLinkField == YesNoType.no)) + { + writer.WriteAttributeString("CreateLink", "no"); + } + if ((this.createLinkField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateLink", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + if (this.serviceQueryConfigFieldSet) + { + if ((this.serviceQueryConfigField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceQueryConfig", "no"); + } + if ((this.serviceQueryConfigField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceQueryConfig", "yes"); + } + } + if (this.serviceChangeConfigFieldSet) + { + if ((this.serviceChangeConfigField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceChangeConfig", "no"); + } + if ((this.serviceChangeConfigField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceChangeConfig", "yes"); + } + } + if (this.serviceQueryStatusFieldSet) + { + if ((this.serviceQueryStatusField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceQueryStatus", "no"); + } + if ((this.serviceQueryStatusField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceQueryStatus", "yes"); + } + } + if (this.serviceEnumerateDependentsFieldSet) + { + if ((this.serviceEnumerateDependentsField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceEnumerateDependents", "no"); + } + if ((this.serviceEnumerateDependentsField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceEnumerateDependents", "yes"); + } + } + if (this.serviceStartFieldSet) + { + if ((this.serviceStartField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceStart", "no"); + } + if ((this.serviceStartField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceStart", "yes"); + } + } + if (this.serviceStopFieldSet) + { + if ((this.serviceStopField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceStop", "no"); + } + if ((this.serviceStopField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceStop", "yes"); + } + } + if (this.servicePauseContinueFieldSet) + { + if ((this.servicePauseContinueField == YesNoType.no)) + { + writer.WriteAttributeString("ServicePauseContinue", "no"); + } + if ((this.servicePauseContinueField == YesNoType.yes)) + { + writer.WriteAttributeString("ServicePauseContinue", "yes"); + } + } + if (this.serviceInterrogateFieldSet) + { + if ((this.serviceInterrogateField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceInterrogate", "no"); + } + if ((this.serviceInterrogateField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceInterrogate", "yes"); + } + } + if (this.serviceUserDefinedControlFieldSet) + { + if ((this.serviceUserDefinedControlField == YesNoType.no)) + { + writer.WriteAttributeString("ServiceUserDefinedControl", "no"); + } + if ((this.serviceUserDefinedControlField == YesNoType.yes)) + { + writer.WriteAttributeString("ServiceUserDefinedControl", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("Append" == name)) + { + this.appendField = Enums.ParseYesNoType(value); + this.appendFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = Enums.ParseYesNoType(value); + this.executeFieldSet = true; + } + if (("Write" == name)) + { + this.writeField = Enums.ParseYesNoType(value); + this.writeFieldSet = true; + } + if (("CreateSubkeys" == name)) + { + this.createSubkeysField = Enums.ParseYesNoType(value); + this.createSubkeysFieldSet = true; + } + if (("EnumerateSubkeys" == name)) + { + this.enumerateSubkeysField = Enums.ParseYesNoType(value); + this.enumerateSubkeysFieldSet = true; + } + if (("Notify" == name)) + { + this.notifyField = Enums.ParseYesNoType(value); + this.notifyFieldSet = true; + } + if (("CreateLink" == name)) + { + this.createLinkField = Enums.ParseYesNoType(value); + this.createLinkFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + if (("ServiceQueryConfig" == name)) + { + this.serviceQueryConfigField = Enums.ParseYesNoType(value); + this.serviceQueryConfigFieldSet = true; + } + if (("ServiceChangeConfig" == name)) + { + this.serviceChangeConfigField = Enums.ParseYesNoType(value); + this.serviceChangeConfigFieldSet = true; + } + if (("ServiceQueryStatus" == name)) + { + this.serviceQueryStatusField = Enums.ParseYesNoType(value); + this.serviceQueryStatusFieldSet = true; + } + if (("ServiceEnumerateDependents" == name)) + { + this.serviceEnumerateDependentsField = Enums.ParseYesNoType(value); + this.serviceEnumerateDependentsFieldSet = true; + } + if (("ServiceStart" == name)) + { + this.serviceStartField = Enums.ParseYesNoType(value); + this.serviceStartFieldSet = true; + } + if (("ServiceStop" == name)) + { + this.serviceStopField = Enums.ParseYesNoType(value); + this.serviceStopFieldSet = true; + } + if (("ServicePauseContinue" == name)) + { + this.servicePauseContinueField = Enums.ParseYesNoType(value); + this.servicePauseContinueFieldSet = true; + } + if (("ServiceInterrogate" == name)) + { + this.serviceInterrogateField = Enums.ParseYesNoType(value); + this.serviceInterrogateFieldSet = true; + } + if (("ServiceUserDefinedControl" == name)) + { + this.serviceUserDefinedControlField = Enums.ParseYesNoType(value); + this.serviceUserDefinedControlFieldSet = true; + } + } + } + + /// + /// Describes a product search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ProductSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The Guid attribute has been deprecated; use the ProductCode or UpgradeCode attribute instead. If this attribute is used, it is assumed to be a ProductCode. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// The ProductCode to use for the search. This attribute must be omitted if UpgradeCode is specified. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// The UpgradeCode to use for the search. This attribute must be omitted if ProductCode is specified. Note that if multiple products are found, the highest versioned product will be used for the result. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// Rather than saving the product version into the variable, a ProductSearch can save another attribute of the matching product instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + ProductSearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("version" == value)) + { + parsedValue = ResultType.version; + } + else + { + if (("language" == value)) + { + parsedValue = ResultType.language; + } + else + { + if (("state" == value)) + { + parsedValue = ResultType.state; + } + else + { + if (("assignment" == value)) + { + parsedValue = ResultType.assignment; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.version)) + { + writer.WriteAttributeString("Result", "version"); + } + if ((this.resultField == ResultType.language)) + { + writer.WriteAttributeString("Result", "language"); + } + if ((this.resultField == ResultType.state)) + { + writer.WriteAttributeString("Result", "state"); + } + if ((this.resultField == ResultType.assignment)) + { + writer.WriteAttributeString("Result", "assignment"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = ProductSearch.ParseResultType(value); + this.resultFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves the version of a matching product if found; 0.0.0.0 otherwise. This is the default. + /// + version, + + /// + /// Saves the language of a matching product if found; empty otherwise. + /// + language, + + /// + /// Saves the state of the product: advertised (1), absent (2), or locally installed (5). + /// + state, + + /// + /// Saves the assignment type of the product: per-user (0), or per-machine (1). + /// + assignment, + } + } + + /// + /// References a ProductSearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ProductSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Remove a folder and all contained files and folders if the parent component is selected for installation or removal. + /// The folder must be specified in the Property attribute as the name of a property that will have a value that resolves + /// to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. + /// For more details, see the Remarks. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RemoveFolderEx : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private OnType onField; + + private bool onFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. If this is not specified, a stable identifier + /// will be generated at compile time based on the other attributes. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The id of a property that resolves to the full path of the source directory. The property does not have + /// to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. The property value can contain environment variables surrounded by + /// percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before + /// being evaluated for a full path. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This value determines when the folder may be removed. + /// + public OnType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a OnType from a string. + /// + public static OnType ParseOnType(string value) + { + OnType parsedValue; + RemoveFolderEx.TryParseOnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a OnType from a string. + /// + public static bool TryParseOnType(string value, out OnType parsedValue) + { + parsedValue = OnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = OnType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = OnType.uninstall; + } + else + { + if (("both" == value)) + { + parsedValue = OnType.both; + } + else + { + parsedValue = OnType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFolderEx", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.onFieldSet) + { + if ((this.onField == OnType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == OnType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + if ((this.onField == OnType.both)) + { + writer.WriteAttributeString("On", "both"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("On" == name)) + { + this.onField = RemoveFolderEx.ParseOnType(value); + this.onFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum OnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Removes the folder only when the parent component is being installed (msiInstallStateLocal or msiInstallStateSource). + /// + install, + + /// + /// Default: Removes the folder only when the parent component is being removed (msiInstallStateAbsent). + /// + uninstall, + + /// + /// Removes the folder when the parent component is being installed or removed. + /// + both, + } + } + + /// + /// Registers a resource with the Restart Manager. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RestartResource : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private string processNameField; + + private bool processNameFieldSet; + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private ISchemaElement parentElement; + + /// + /// The unique identifier for this resource. A unique identifier will + /// be generated automatically if not specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The full path to the process module to register with the Restart Manager. + /// This can be a formatted value that resolves to a full path. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// The name of a process to register with the Restart Manager. + /// This can be a formatted value that resolves to a process name. + /// + public string ProcessName + { + get + { + return this.processNameField; + } + set + { + this.processNameFieldSet = true; + this.processNameField = value; + } + } + + /// + /// The name of a Windows service to register with the Restart Manager. + /// This can be a formatted value that resolves to a service name. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RestartResource", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.processNameFieldSet) + { + writer.WriteAttributeString("ProcessName", this.processNameField); + } + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("ProcessName" == name)) + { + this.processNameField = value; + this.processNameFieldSet = true; + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + } + } + + /// + /// Describes a registry search. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RegistrySearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string variableField; + + private bool variableFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private RootType rootField; + + private bool rootFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private FormatType formatField; + + private bool formatFieldSet; + + private YesNoType expandEnvironmentVariablesField; + + private bool expandEnvironmentVariablesFieldSet; + + private ResultType resultField; + + private bool resultFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + /// + /// Id of the search for ordering and dependency. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the variable in which to place the result of the search. + /// + public string Variable + { + get + { + return this.variableField; + } + set + { + this.variableFieldSet = true; + this.variableField = value; + } + } + + /// + /// Condition for evaluating the search. If this evaluates to false, the search is not executed at all. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + /// + /// Id of the search that this one should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// Registry root hive to search under. + /// + public RootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// Key to search for. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// Optional value to search for under the given Key. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// What format to return the value in. + /// + public FormatType Format + { + get + { + return this.formatField; + } + set + { + this.formatFieldSet = true; + this.formatField = value; + } + } + + /// + /// Whether to expand any environment variables in REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ values. + /// + public YesNoType ExpandEnvironmentVariables + { + get + { + return this.expandEnvironmentVariablesField; + } + set + { + this.expandEnvironmentVariablesFieldSet = true; + this.expandEnvironmentVariablesField = value; + } + } + + /// + /// Rather than saving the matching registry value into the variable, a RegistrySearch can save an attribute of the matching entry instead. + /// + public ResultType Result + { + get + { + return this.resultField; + } + set + { + this.resultFieldSet = true; + this.resultField = value; + } + } + + /// + /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. The default value is 'no'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a RootType from a string. + /// + public static RootType ParseRootType(string value) + { + RootType parsedValue; + RegistrySearch.TryParseRootType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RootType from a string. + /// + public static bool TryParseRootType(string value, out RootType parsedValue) + { + parsedValue = RootType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("HKLM" == value)) + { + parsedValue = RootType.HKLM; + } + else + { + if (("HKCU" == value)) + { + parsedValue = RootType.HKCU; + } + else + { + if (("HKCR" == value)) + { + parsedValue = RootType.HKCR; + } + else + { + if (("HKU" == value)) + { + parsedValue = RootType.HKU; + } + else + { + parsedValue = RootType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a FormatType from a string. + /// + public static FormatType ParseFormatType(string value) + { + FormatType parsedValue; + RegistrySearch.TryParseFormatType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FormatType from a string. + /// + public static bool TryParseFormatType(string value, out FormatType parsedValue) + { + parsedValue = FormatType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("raw" == value)) + { + parsedValue = FormatType.raw; + } + else + { + if (("compatible" == value)) + { + parsedValue = FormatType.compatible; + } + else + { + parsedValue = FormatType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a ResultType from a string. + /// + public static ResultType ParseResultType(string value) + { + ResultType parsedValue; + RegistrySearch.TryParseResultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ResultType from a string. + /// + public static bool TryParseResultType(string value, out ResultType parsedValue) + { + parsedValue = ResultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("exists" == value)) + { + parsedValue = ResultType.exists; + } + else + { + if (("value" == value)) + { + parsedValue = ResultType.value; + } + else + { + parsedValue = ResultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearch", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.variableFieldSet) + { + writer.WriteAttributeString("Variable", this.variableField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.formatFieldSet) + { + if ((this.formatField == FormatType.raw)) + { + writer.WriteAttributeString("Format", "raw"); + } + if ((this.formatField == FormatType.compatible)) + { + writer.WriteAttributeString("Format", "compatible"); + } + } + if (this.expandEnvironmentVariablesFieldSet) + { + if ((this.expandEnvironmentVariablesField == YesNoType.no)) + { + writer.WriteAttributeString("ExpandEnvironmentVariables", "no"); + } + if ((this.expandEnvironmentVariablesField == YesNoType.yes)) + { + writer.WriteAttributeString("ExpandEnvironmentVariables", "yes"); + } + } + if (this.resultFieldSet) + { + if ((this.resultField == ResultType.exists)) + { + writer.WriteAttributeString("Result", "exists"); + } + if ((this.resultField == ResultType.value)) + { + writer.WriteAttributeString("Result", "value"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Variable" == name)) + { + this.variableField = value; + this.variableFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = RegistrySearch.ParseRootType(value); + this.rootFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Format" == name)) + { + this.formatField = RegistrySearch.ParseFormatType(value); + this.formatFieldSet = true; + } + if (("ExpandEnvironmentVariables" == name)) + { + this.expandEnvironmentVariablesField = Enums.ParseYesNoType(value); + this.expandEnvironmentVariablesFieldSet = true; + } + if (("Result" == name)) + { + this.resultField = RegistrySearch.ParseResultType(value); + this.resultFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum RootType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// HKEY_LOCAL_MACHINE + /// + HKLM, + + /// + /// HKEY_CURRENT_USER + /// + HKCU, + + /// + /// HKEY_CLASSES_ROOT + /// + HKCR, + + /// + /// HKEY_USERS + /// + HKU, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum FormatType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Returns the unformatted value directly from the registry. For example, a REG_DWORD value of '1' is returned as '1', not '#1'. + /// + raw, + + /// + /// Returns the value formatted as Windows Installer would. For example, a REG_DWORD value of '1' is returned as '#1', not '1'. + /// + compatible, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ResultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Saves true if a matching registry entry is found; false otherwise. + /// + exists, + + /// + /// Saves the value of the registry key in the variable. This is the default. + /// + value, + } + } + + /// + /// References a RegistrySearch. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class RegistrySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearchRef", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Service configuration information for failure actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class ServiceConfig : ISchemaElement, ISetAttributes + { + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private FirstFailureActionTypeType firstFailureActionTypeField; + + private bool firstFailureActionTypeFieldSet; + + private SecondFailureActionTypeType secondFailureActionTypeField; + + private bool secondFailureActionTypeFieldSet; + + private ThirdFailureActionTypeType thirdFailureActionTypeField; + + private bool thirdFailureActionTypeFieldSet; + + private int resetPeriodInDaysField; + + private bool resetPeriodInDaysFieldSet; + + private int restartServiceDelayInSecondsField; + + private bool restartServiceDelayInSecondsFieldSet; + + private string programCommandLineField; + + private bool programCommandLineFieldSet; + + private string rebootMessageField; + + private bool rebootMessageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Required if not under a ServiceInstall element. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + /// + /// Action to take on the first failure of the service. + /// + public FirstFailureActionTypeType FirstFailureActionType + { + get + { + return this.firstFailureActionTypeField; + } + set + { + this.firstFailureActionTypeFieldSet = true; + this.firstFailureActionTypeField = value; + } + } + + /// + /// Action to take on the second failure of the service. + /// + public SecondFailureActionTypeType SecondFailureActionType + { + get + { + return this.secondFailureActionTypeField; + } + set + { + this.secondFailureActionTypeFieldSet = true; + this.secondFailureActionTypeField = value; + } + } + + /// + /// Action to take on the third failure of the service. + /// + public ThirdFailureActionTypeType ThirdFailureActionType + { + get + { + return this.thirdFailureActionTypeField; + } + set + { + this.thirdFailureActionTypeFieldSet = true; + this.thirdFailureActionTypeField = value; + } + } + + /// + /// Number of days after which to reset the failure count to zero if there are no failures. + /// + public int ResetPeriodInDays + { + get + { + return this.resetPeriodInDaysField; + } + set + { + this.resetPeriodInDaysFieldSet = true; + this.resetPeriodInDaysField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "restart", this specifies the number of seconds to wait before doing so. + /// + public int RestartServiceDelayInSeconds + { + get + { + return this.restartServiceDelayInSecondsField; + } + set + { + this.restartServiceDelayInSecondsFieldSet = true; + this.restartServiceDelayInSecondsField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "runCommand", this specifies the command to run when doing so. This value is formatted. + /// + public string ProgramCommandLine + { + get + { + return this.programCommandLineField; + } + set + { + this.programCommandLineFieldSet = true; + this.programCommandLineField = value; + } + } + + /// + /// If any of the three *ActionType attributes is "reboot", this specifies the message to broadcast to server users before doing so. + /// + public string RebootMessage + { + get + { + return this.rebootMessageField; + } + set + { + this.rebootMessageFieldSet = true; + this.rebootMessageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a FirstFailureActionTypeType from a string. + /// + public static FirstFailureActionTypeType ParseFirstFailureActionTypeType(string value) + { + FirstFailureActionTypeType parsedValue; + ServiceConfig.TryParseFirstFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FirstFailureActionTypeType from a string. + /// + public static bool TryParseFirstFailureActionTypeType(string value, out FirstFailureActionTypeType parsedValue) + { + parsedValue = FirstFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = FirstFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = FirstFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = FirstFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = FirstFailureActionTypeType.runCommand; + } + else + { + parsedValue = FirstFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a SecondFailureActionTypeType from a string. + /// + public static SecondFailureActionTypeType ParseSecondFailureActionTypeType(string value) + { + SecondFailureActionTypeType parsedValue; + ServiceConfig.TryParseSecondFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SecondFailureActionTypeType from a string. + /// + public static bool TryParseSecondFailureActionTypeType(string value, out SecondFailureActionTypeType parsedValue) + { + parsedValue = SecondFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = SecondFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = SecondFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = SecondFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = SecondFailureActionTypeType.runCommand; + } + else + { + parsedValue = SecondFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a ThirdFailureActionTypeType from a string. + /// + public static ThirdFailureActionTypeType ParseThirdFailureActionTypeType(string value) + { + ThirdFailureActionTypeType parsedValue; + ServiceConfig.TryParseThirdFailureActionTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ThirdFailureActionTypeType from a string. + /// + public static bool TryParseThirdFailureActionTypeType(string value, out ThirdFailureActionTypeType parsedValue) + { + parsedValue = ThirdFailureActionTypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = ThirdFailureActionTypeType.none; + } + else + { + if (("reboot" == value)) + { + parsedValue = ThirdFailureActionTypeType.reboot; + } + else + { + if (("restart" == value)) + { + parsedValue = ThirdFailureActionTypeType.restart; + } + else + { + if (("runCommand" == value)) + { + parsedValue = ThirdFailureActionTypeType.runCommand; + } + else + { + parsedValue = ThirdFailureActionTypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + if (this.firstFailureActionTypeFieldSet) + { + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.none)) + { + writer.WriteAttributeString("FirstFailureActionType", "none"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("FirstFailureActionType", "reboot"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.restart)) + { + writer.WriteAttributeString("FirstFailureActionType", "restart"); + } + if ((this.firstFailureActionTypeField == FirstFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("FirstFailureActionType", "runCommand"); + } + } + if (this.secondFailureActionTypeFieldSet) + { + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.none)) + { + writer.WriteAttributeString("SecondFailureActionType", "none"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("SecondFailureActionType", "reboot"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.restart)) + { + writer.WriteAttributeString("SecondFailureActionType", "restart"); + } + if ((this.secondFailureActionTypeField == SecondFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("SecondFailureActionType", "runCommand"); + } + } + if (this.thirdFailureActionTypeFieldSet) + { + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.none)) + { + writer.WriteAttributeString("ThirdFailureActionType", "none"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.reboot)) + { + writer.WriteAttributeString("ThirdFailureActionType", "reboot"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.restart)) + { + writer.WriteAttributeString("ThirdFailureActionType", "restart"); + } + if ((this.thirdFailureActionTypeField == ThirdFailureActionTypeType.runCommand)) + { + writer.WriteAttributeString("ThirdFailureActionType", "runCommand"); + } + } + if (this.resetPeriodInDaysFieldSet) + { + writer.WriteAttributeString("ResetPeriodInDays", this.resetPeriodInDaysField.ToString(CultureInfo.InvariantCulture)); + } + if (this.restartServiceDelayInSecondsFieldSet) + { + writer.WriteAttributeString("RestartServiceDelayInSeconds", this.restartServiceDelayInSecondsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.programCommandLineFieldSet) + { + writer.WriteAttributeString("ProgramCommandLine", this.programCommandLineField); + } + if (this.rebootMessageFieldSet) + { + writer.WriteAttributeString("RebootMessage", this.rebootMessageField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + if (("FirstFailureActionType" == name)) + { + this.firstFailureActionTypeField = ServiceConfig.ParseFirstFailureActionTypeType(value); + this.firstFailureActionTypeFieldSet = true; + } + if (("SecondFailureActionType" == name)) + { + this.secondFailureActionTypeField = ServiceConfig.ParseSecondFailureActionTypeType(value); + this.secondFailureActionTypeFieldSet = true; + } + if (("ThirdFailureActionType" == name)) + { + this.thirdFailureActionTypeField = ServiceConfig.ParseThirdFailureActionTypeType(value); + this.thirdFailureActionTypeFieldSet = true; + } + if (("ResetPeriodInDays" == name)) + { + this.resetPeriodInDaysField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.resetPeriodInDaysFieldSet = true; + } + if (("RestartServiceDelayInSeconds" == name)) + { + this.restartServiceDelayInSecondsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.restartServiceDelayInSecondsFieldSet = true; + } + if (("ProgramCommandLine" == name)) + { + this.programCommandLineField = value; + this.programCommandLineFieldSet = true; + } + if (("RebootMessage" == name)) + { + this.rebootMessageField = value; + this.rebootMessageFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum FirstFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum SecondFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ThirdFailureActionTypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + none, + + reboot, + + restart, + + runCommand, + } + } + + /// + /// Updates the last modified date/time of a file. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class TouchFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private YesNoType onInstallField; + + private bool onInstallFieldSet; + + private YesNoType onReinstallField; + + private bool onReinstallFieldSet; + + private YesNoType onUninstallField; + + private bool onUninstallFieldSet; + + private YesNoType nonvitalField; + + private bool nonvitalFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the touch file operation. If the identifier is not specified it will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path of the file to update. This value is formatted. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on install. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + /// + public YesNoType OnInstall + { + get + { + return this.onInstallField; + } + set + { + this.onInstallFieldSet = true; + this.onInstallField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on reinstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'yes'. + /// + public YesNoType OnReinstall + { + get + { + return this.onReinstallField; + } + set + { + this.onReinstallFieldSet = true; + this.onReinstallField = value; + } + } + + /// + /// Specifies whether or not the modified time of the file should be updated on uninstall. If the OnInstall, OnReinstall and OnUninstall attributes are all absent the default is 'no'. + /// + public YesNoType OnUninstall + { + get + { + return this.onUninstallField; + } + set + { + this.onUninstallFieldSet = true; + this.onUninstallField = value; + } + } + + /// + /// Indicates the installation will succeed even if the modified time of the file cannot be updated. The default is 'no'. + /// + public YesNoType Nonvital + { + get + { + return this.nonvitalField; + } + set + { + this.nonvitalFieldSet = true; + this.nonvitalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TouchFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.onInstallFieldSet) + { + if ((this.onInstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnInstall", "no"); + } + if ((this.onInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnInstall", "yes"); + } + } + if (this.onReinstallFieldSet) + { + if ((this.onReinstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnReinstall", "no"); + } + if ((this.onReinstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnReinstall", "yes"); + } + } + if (this.onUninstallFieldSet) + { + if ((this.onUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnUninstall", "no"); + } + if ((this.onUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnUninstall", "yes"); + } + } + if (this.nonvitalFieldSet) + { + if ((this.nonvitalField == YesNoType.no)) + { + writer.WriteAttributeString("Nonvital", "no"); + } + if ((this.nonvitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Nonvital", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("OnInstall" == name)) + { + this.onInstallField = Enums.ParseYesNoType(value); + this.onInstallFieldSet = true; + } + if (("OnReinstall" == name)) + { + this.onReinstallField = Enums.ParseYesNoType(value); + this.onReinstallFieldSet = true; + } + if (("OnUninstall" == name)) + { + this.onUninstallField = Enums.ParseYesNoType(value); + this.onUninstallFieldSet = true; + } + if (("Nonvital" == name)) + { + this.nonvitalField = Enums.ParseYesNoType(value); + this.nonvitalFieldSet = true; + } + } + } + + /// + /// User for all kinds of things. When it is not nested under a component it is included in the MSI so it can be referenced by other elements such as the User attribute in the AppPool element. When it is nested under a Component element, the User will be created on install and can also be used for reference. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class User : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string domainField; + + private bool domainFieldSet; + + private string passwordField; + + private bool passwordFieldSet; + + private YesNoType passwordNeverExpiresField; + + private bool passwordNeverExpiresFieldSet; + + private YesNoType canNotChangePasswordField; + + private bool canNotChangePasswordFieldSet; + + private YesNoType removeOnUninstallField; + + private bool removeOnUninstallFieldSet; + + private YesNoType failIfExistsField; + + private bool failIfExistsFieldSet; + + private YesNoType logonAsServiceField; + + private bool logonAsServiceFieldSet; + + private YesNoType logonAsBatchJobField; + + private bool logonAsBatchJobFieldSet; + + private YesNoType updateIfExistsField; + + private bool updateIfExistsFieldSet; + + private YesNoType passwordExpiredField; + + private bool passwordExpiredFieldSet; + + private YesNoType disabledField; + + private bool disabledFieldSet; + + private YesNoType createUserField; + + private bool createUserFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private ISchemaElement parentElement; + + public User() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(GroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// A + /// + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + /// + /// Usually a Property that is passed in on the command-line to keep it more secure. + /// + public string Password + { + get + { + return this.passwordField; + } + set + { + this.passwordFieldSet = true; + this.passwordField = value; + } + } + + /// + /// The account's password never expires. Equivalent to UF_DONT_EXPIRE_PASSWD. + /// + public YesNoType PasswordNeverExpires + { + get + { + return this.passwordNeverExpiresField; + } + set + { + this.passwordNeverExpiresFieldSet = true; + this.passwordNeverExpiresField = value; + } + } + + /// + /// The user cannot change the account's password. Equivalent to UF_PASSWD_CANT_CHANGE. + /// + public YesNoType CanNotChangePassword + { + get + { + return this.canNotChangePasswordField; + } + set + { + this.canNotChangePasswordFieldSet = true; + this.canNotChangePasswordField = value; + } + } + + /// + /// Indicates whether the user account should be removed or left behind on uninstall. + /// + public YesNoType RemoveOnUninstall + { + get + { + return this.removeOnUninstallField; + } + set + { + this.removeOnUninstallFieldSet = true; + this.removeOnUninstallField = value; + } + } + + /// + /// Indicates if the install should fail if the user already exists. + /// + public YesNoType FailIfExists + { + get + { + return this.failIfExistsField; + } + set + { + this.failIfExistsFieldSet = true; + this.failIfExistsField = value; + } + } + + /// + /// Indicates whether or not the user can logon as a serivce. User creation can be skipped if all that is desired is to set this access right on the user. + /// + public YesNoType LogonAsService + { + get + { + return this.logonAsServiceField; + } + set + { + this.logonAsServiceFieldSet = true; + this.logonAsServiceField = value; + } + } + + /// + /// Indicates whether or not the user can logon as a batch job. User creation can be skipped if all that is desired is to set this access right on the user. + /// + public YesNoType LogonAsBatchJob + { + get + { + return this.logonAsBatchJobField; + } + set + { + this.logonAsBatchJobFieldSet = true; + this.logonAsBatchJobField = value; + } + } + + /// + /// Indicates if the user account properties should be updated if the user already exists. + /// + public YesNoType UpdateIfExists + { + get + { + return this.updateIfExistsField; + } + set + { + this.updateIfExistsFieldSet = true; + this.updateIfExistsField = value; + } + } + + /// + /// Indicates whether the user must change their password on their first login. + /// + public YesNoType PasswordExpired + { + get + { + return this.passwordExpiredField; + } + set + { + this.passwordExpiredFieldSet = true; + this.passwordExpiredField = value; + } + } + + /// + /// The account is disabled. Equivalent to UF_ACCOUNTDISABLE. + /// + public YesNoType Disabled + { + get + { + return this.disabledField; + } + set + { + this.disabledFieldSet = true; + this.disabledField = value; + } + } + + /// + /// Indicates whether or not to create the user. User creation can be skipped if all that is desired is to join a user to groups. + /// + public YesNoType CreateUser + { + get + { + return this.createUserField; + } + set + { + this.createUserFieldSet = true; + this.createUserField = value; + } + } + + /// + /// Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes". + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("GroupRef" == childName)) + { + childValue = new GroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("User", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.passwordFieldSet) + { + writer.WriteAttributeString("Password", this.passwordField); + } + if (this.passwordNeverExpiresFieldSet) + { + if ((this.passwordNeverExpiresField == YesNoType.no)) + { + writer.WriteAttributeString("PasswordNeverExpires", "no"); + } + if ((this.passwordNeverExpiresField == YesNoType.yes)) + { + writer.WriteAttributeString("PasswordNeverExpires", "yes"); + } + } + if (this.canNotChangePasswordFieldSet) + { + if ((this.canNotChangePasswordField == YesNoType.no)) + { + writer.WriteAttributeString("CanNotChangePassword", "no"); + } + if ((this.canNotChangePasswordField == YesNoType.yes)) + { + writer.WriteAttributeString("CanNotChangePassword", "yes"); + } + } + if (this.removeOnUninstallFieldSet) + { + if ((this.removeOnUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("RemoveOnUninstall", "no"); + } + if ((this.removeOnUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("RemoveOnUninstall", "yes"); + } + } + if (this.failIfExistsFieldSet) + { + if ((this.failIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("FailIfExists", "no"); + } + if ((this.failIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("FailIfExists", "yes"); + } + } + if (this.logonAsServiceFieldSet) + { + if ((this.logonAsServiceField == YesNoType.no)) + { + writer.WriteAttributeString("LogonAsService", "no"); + } + if ((this.logonAsServiceField == YesNoType.yes)) + { + writer.WriteAttributeString("LogonAsService", "yes"); + } + } + if (this.logonAsBatchJobFieldSet) + { + if ((this.logonAsBatchJobField == YesNoType.no)) + { + writer.WriteAttributeString("LogonAsBatchJob", "no"); + } + if ((this.logonAsBatchJobField == YesNoType.yes)) + { + writer.WriteAttributeString("LogonAsBatchJob", "yes"); + } + } + if (this.updateIfExistsFieldSet) + { + if ((this.updateIfExistsField == YesNoType.no)) + { + writer.WriteAttributeString("UpdateIfExists", "no"); + } + if ((this.updateIfExistsField == YesNoType.yes)) + { + writer.WriteAttributeString("UpdateIfExists", "yes"); + } + } + if (this.passwordExpiredFieldSet) + { + if ((this.passwordExpiredField == YesNoType.no)) + { + writer.WriteAttributeString("PasswordExpired", "no"); + } + if ((this.passwordExpiredField == YesNoType.yes)) + { + writer.WriteAttributeString("PasswordExpired", "yes"); + } + } + if (this.disabledFieldSet) + { + if ((this.disabledField == YesNoType.no)) + { + writer.WriteAttributeString("Disabled", "no"); + } + if ((this.disabledField == YesNoType.yes)) + { + writer.WriteAttributeString("Disabled", "yes"); + } + } + if (this.createUserFieldSet) + { + if ((this.createUserField == YesNoType.no)) + { + writer.WriteAttributeString("CreateUser", "no"); + } + if ((this.createUserField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateUser", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("Password" == name)) + { + this.passwordField = value; + this.passwordFieldSet = true; + } + if (("PasswordNeverExpires" == name)) + { + this.passwordNeverExpiresField = Enums.ParseYesNoType(value); + this.passwordNeverExpiresFieldSet = true; + } + if (("CanNotChangePassword" == name)) + { + this.canNotChangePasswordField = Enums.ParseYesNoType(value); + this.canNotChangePasswordFieldSet = true; + } + if (("RemoveOnUninstall" == name)) + { + this.removeOnUninstallField = Enums.ParseYesNoType(value); + this.removeOnUninstallFieldSet = true; + } + if (("FailIfExists" == name)) + { + this.failIfExistsField = Enums.ParseYesNoType(value); + this.failIfExistsFieldSet = true; + } + if (("LogonAsService" == name)) + { + this.logonAsServiceField = Enums.ParseYesNoType(value); + this.logonAsServiceFieldSet = true; + } + if (("LogonAsBatchJob" == name)) + { + this.logonAsBatchJobField = Enums.ParseYesNoType(value); + this.logonAsBatchJobFieldSet = true; + } + if (("UpdateIfExists" == name)) + { + this.updateIfExistsField = Enums.ParseYesNoType(value); + this.updateIfExistsFieldSet = true; + } + if (("PasswordExpired" == name)) + { + this.passwordExpiredField = Enums.ParseYesNoType(value); + this.passwordExpiredFieldSet = true; + } + if (("Disabled" == name)) + { + this.disabledField = Enums.ParseYesNoType(value); + this.disabledFieldSet = true; + } + if (("CreateUser" == name)) + { + this.createUserField = Enums.ParseYesNoType(value); + this.createUserFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + } + } + + /// + /// Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class XmlFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string elementPathField; + + private bool elementPathFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType preserveModifiedDateField; + + private bool preserveModifiedDateFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private SelectionLanguageType selectionLanguageField; + + private bool selectionLanguageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for xml file modification. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string ElementPath + { + get + { + return this.elementPathField; + } + set + { + this.elementPathFieldSet = true; + this.elementPathField = value; + } + } + + /// + /// Path of the .xml file to configure. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value to be written. See the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The type of modification to be made to the XML file when the component is installed. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Specifies whether or not the modification should be removed on uninstall. This has no effect on uninstall if the action was deleteValue. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + /// + public YesNoType PreserveModifiedDate + { + get + { + return this.preserveModifiedDateField; + } + set + { + this.preserveModifiedDateFieldSet = true; + this.preserveModifiedDateField = value; + } + } + + /// + /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. + /// + public SelectionLanguageType SelectionLanguage + { + get + { + return this.selectionLanguageField; + } + set + { + this.selectionLanguageFieldSet = true; + this.selectionLanguageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + XmlFile.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("createElement" == value)) + { + parsedValue = ActionType.createElement; + } + else + { + if (("deleteValue" == value)) + { + parsedValue = ActionType.deleteValue; + } + else + { + if (("setValue" == value)) + { + parsedValue = ActionType.setValue; + } + else + { + if (("bulkSetValue" == value)) + { + parsedValue = ActionType.bulkSetValue; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a SelectionLanguageType from a string. + /// + public static SelectionLanguageType ParseSelectionLanguageType(string value) + { + SelectionLanguageType parsedValue; + XmlFile.TryParseSelectionLanguageType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SelectionLanguageType from a string. + /// + public static bool TryParseSelectionLanguageType(string value, out SelectionLanguageType parsedValue) + { + parsedValue = SelectionLanguageType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("XPath" == value)) + { + parsedValue = SelectionLanguageType.XPath; + } + else + { + if (("XSLPattern" == value)) + { + parsedValue = SelectionLanguageType.XSLPattern; + } + else + { + parsedValue = SelectionLanguageType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("XmlFile", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.elementPathFieldSet) + { + writer.WriteAttributeString("ElementPath", this.elementPathField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.createElement)) + { + writer.WriteAttributeString("Action", "createElement"); + } + if ((this.actionField == ActionType.deleteValue)) + { + writer.WriteAttributeString("Action", "deleteValue"); + } + if ((this.actionField == ActionType.setValue)) + { + writer.WriteAttributeString("Action", "setValue"); + } + if ((this.actionField == ActionType.bulkSetValue)) + { + writer.WriteAttributeString("Action", "bulkSetValue"); + } + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.preserveModifiedDateFieldSet) + { + if ((this.preserveModifiedDateField == YesNoType.no)) + { + writer.WriteAttributeString("PreserveModifiedDate", "no"); + } + if ((this.preserveModifiedDateField == YesNoType.yes)) + { + writer.WriteAttributeString("PreserveModifiedDate", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.selectionLanguageFieldSet) + { + if ((this.selectionLanguageField == SelectionLanguageType.XPath)) + { + writer.WriteAttributeString("SelectionLanguage", "XPath"); + } + if ((this.selectionLanguageField == SelectionLanguageType.XSLPattern)) + { + writer.WriteAttributeString("SelectionLanguage", "XSLPattern"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ElementPath" == name)) + { + this.elementPathField = value; + this.elementPathFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = XmlFile.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("PreserveModifiedDate" == name)) + { + this.preserveModifiedDateField = Enums.ParseYesNoType(value); + this.preserveModifiedDateFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("SelectionLanguage" == name)) + { + this.selectionLanguageField = XmlFile.ParseSelectionLanguageType(value); + this.selectionLanguageFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates a new element under the element specified in ElementPath. The Name attribute is required in this case and specifies the name of the new element. The Value attribute is not necessary when createElement is specified as the action. If the Value attribute is set, it will cause the new element's text value to be set. + /// + createElement, + + /// + /// Deletes a value from the element specified in the ElementPath. If Name is specified, the attribute with that name is deleted. If Name is not specified, the text value of the element specified in the ElementPath is deleted. The Value attribute is ignored if deleteValue is the action specified. + /// + deleteValue, + + /// + /// Sets a value in the element specified in the ElementPath. If Name is specified, and attribute with that name is set to the value specified in Value. If Name is not specified, the text value of the element is set. Value is a required attribute if setValue is the action specified. + /// + setValue, + + /// + /// Sets all the values in the elements that match the ElementPath. If Name is specified, attributes with that name are set to the same value specified in Value. If Name is not specified, the text values of the elements are set. Value is a required attribute if setBulkValue is the action specified. + /// + bulkSetValue, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum SelectionLanguageType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + XPath, + + XSLPattern, + } + } + + /// + /// Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class XmlConfig : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string elementIdField; + + private bool elementIdFieldSet; + + private string elementPathField; + + private bool elementPathFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private NodeType nodeField; + + private bool nodeFieldSet; + + private OnType onField; + + private bool onFieldSet; + + private YesNoType preserveModifiedDateField; + + private bool preserveModifiedDateFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string verifyPathField; + + private bool verifyPathFieldSet; + + private ISchemaElement parentElement; + + public XmlConfig() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(XmlConfig))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for xml file modification. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The Id of another XmlConfig to add attributes to. In this case, the 'ElementPath', 'Action', 'Node', and 'On' attributes must be omitted. + /// + public string ElementId + { + get + { + return this.elementIdField; + } + set + { + this.elementIdFieldSet = true; + this.elementIdField = value; + } + } + + /// + /// The XPath of the parent element being modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string ElementPath + { + get + { + return this.elementPathField; + } + set + { + this.elementPathFieldSet = true; + this.elementPathField = value; + } + } + + /// + /// Path of the .xml file to configure. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public NodeType Node + { + get + { + return this.nodeField; + } + set + { + this.nodeFieldSet = true; + this.nodeField = value; + } + } + + public OnType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + /// + /// Specifies wheter or not the modification should preserve the modified date. Preserving the modified date will allow the file to be patched if no other modifications have been made. + /// + public YesNoType PreserveModifiedDate + { + get + { + return this.preserveModifiedDateField; + } + set + { + this.preserveModifiedDateFieldSet = true; + this.preserveModifiedDateField = value; + } + } + + /// + /// Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// The value to be written. See the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The XPath to the element being modified. This is required for 'delete' actions. For 'create' actions, VerifyPath is used to decide if the element already exists. Note that this is a formatted field and therefore, square brackets in the XPath must be escaped. In addition, XPaths allow backslashes to be used to escape characters, so if you intend to include literal backslashes, you must escape them as well by doubling them in this attribute. The string is formatted by MSI first, and the result is consumed as the XPath. + /// + public string VerifyPath + { + get + { + return this.verifyPathField; + } + set + { + this.verifyPathFieldSet = true; + this.verifyPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("XmlConfig" == childName)) + { + childValue = new XmlConfig(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + XmlConfig.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("create" == value)) + { + parsedValue = ActionType.create; + } + else + { + if (("delete" == value)) + { + parsedValue = ActionType.delete; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a NodeType from a string. + /// + public static NodeType ParseNodeType(string value) + { + NodeType parsedValue; + XmlConfig.TryParseNodeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a NodeType from a string. + /// + public static bool TryParseNodeType(string value, out NodeType parsedValue) + { + parsedValue = NodeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("element" == value)) + { + parsedValue = NodeType.element; + } + else + { + if (("value" == value)) + { + parsedValue = NodeType.value; + } + else + { + if (("document" == value)) + { + parsedValue = NodeType.document; + } + else + { + parsedValue = NodeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a OnType from a string. + /// + public static OnType ParseOnType(string value) + { + OnType parsedValue; + XmlConfig.TryParseOnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a OnType from a string. + /// + public static bool TryParseOnType(string value, out OnType parsedValue) + { + parsedValue = OnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = OnType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = OnType.uninstall; + } + else + { + parsedValue = OnType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("XmlConfig", "http://wixtoolset.org/schemas/v4/wxs/util"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.create)) + { + writer.WriteAttributeString("Action", "create"); + } + if ((this.actionField == ActionType.delete)) + { + writer.WriteAttributeString("Action", "delete"); + } + } + if (this.elementIdFieldSet) + { + writer.WriteAttributeString("ElementId", this.elementIdField); + } + if (this.elementPathFieldSet) + { + writer.WriteAttributeString("ElementPath", this.elementPathField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.nodeFieldSet) + { + if ((this.nodeField == NodeType.element)) + { + writer.WriteAttributeString("Node", "element"); + } + if ((this.nodeField == NodeType.value)) + { + writer.WriteAttributeString("Node", "value"); + } + if ((this.nodeField == NodeType.document)) + { + writer.WriteAttributeString("Node", "document"); + } + } + if (this.onFieldSet) + { + if ((this.onField == OnType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == OnType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + } + if (this.preserveModifiedDateFieldSet) + { + if ((this.preserveModifiedDateField == YesNoType.no)) + { + writer.WriteAttributeString("PreserveModifiedDate", "no"); + } + if ((this.preserveModifiedDateField == YesNoType.yes)) + { + writer.WriteAttributeString("PreserveModifiedDate", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.verifyPathFieldSet) + { + writer.WriteAttributeString("VerifyPath", this.verifyPathField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = XmlConfig.ParseActionType(value); + this.actionFieldSet = true; + } + if (("ElementId" == name)) + { + this.elementIdField = value; + this.elementIdFieldSet = true; + } + if (("ElementPath" == name)) + { + this.elementPathField = value; + this.elementPathFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Node" == name)) + { + this.nodeField = XmlConfig.ParseNodeType(value); + this.nodeFieldSet = true; + } + if (("On" == name)) + { + this.onField = XmlConfig.ParseOnType(value); + this.onFieldSet = true; + } + if (("PreserveModifiedDate" == name)) + { + this.preserveModifiedDateField = Enums.ParseYesNoType(value); + this.preserveModifiedDateFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("VerifyPath" == name)) + { + this.verifyPathField = value; + this.verifyPathFieldSet = true; + } + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + create, + + delete, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum NodeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + element, + + value, + + document, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum OnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + install, + + uninstall, + } + } +} diff --git a/src/wix/heat/Serialize/vs.cs b/src/wix/heat/Serialize/vs.cs new file mode 100644 index 00000000..8f926efc --- /dev/null +++ b/src/wix/heat/Serialize/vs.cs @@ -0,0 +1,1574 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 +namespace WixToolset.Harvesters.Serialize.VS +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + using WixToolset.Harvesters.Serialize; + + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + [GeneratedCode("XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + } + + /// + /// Help Namespace for a help collection. The parent file is the key for the HxC (Collection) file. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpCollection : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType suppressCustomActionsField; + + private bool suppressCustomActionsFieldSet; + + private ISchemaElement parentElement; + + public HelpCollection() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFileRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFilterRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PlugCollectionInto))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary Key for HelpNamespace. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Friendly name for Namespace. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Internal Microsoft Help ID for this Namespace. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressCustomActions + { + get + { + return this.suppressCustomActionsField; + } + set + { + this.suppressCustomActionsFieldSet = true; + this.suppressCustomActionsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("HelpFileRef" == childName)) + { + childValue = new HelpFileRef(); + } + if (("HelpFilterRef" == childName)) + { + childValue = new HelpFilterRef(); + } + if (("PlugCollectionInto" == childName)) + { + childValue = new PlugCollectionInto(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpCollection", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.suppressCustomActionsFieldSet) + { + if ((this.suppressCustomActionsField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressCustomActions", "no"); + } + if ((this.suppressCustomActionsField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressCustomActions", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SuppressCustomActions" == name)) + { + this.suppressCustomActionsField = Enums.ParseYesNoType(value); + this.suppressCustomActionsFieldSet = true; + } + } + } + + /// + /// Filter for Help Namespace. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFilter : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string filterDefinitionField; + + private bool filterDefinitionFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType suppressCustomActionsField; + + private bool suppressCustomActionsFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFilter. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Query String for Help Filter. + /// + public string FilterDefinition + { + get + { + return this.filterDefinitionField; + } + set + { + this.filterDefinitionFieldSet = true; + this.filterDefinitionField = value; + } + } + + /// + /// Friendly name for Filter. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressCustomActions + { + get + { + return this.suppressCustomActionsField; + } + set + { + this.suppressCustomActionsFieldSet = true; + this.suppressCustomActionsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFilter", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.filterDefinitionFieldSet) + { + writer.WriteAttributeString("FilterDefinition", this.filterDefinitionField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.suppressCustomActionsFieldSet) + { + if ((this.suppressCustomActionsField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressCustomActions", "no"); + } + if ((this.suppressCustomActionsField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressCustomActions", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("FilterDefinition" == name)) + { + this.filterDefinitionField = value; + this.filterDefinitionFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SuppressCustomActions" == name)) + { + this.suppressCustomActionsField = Enums.ParseYesNoType(value); + this.suppressCustomActionsFieldSet = true; + } + } + } + + /// + /// File for Help Namespace. The parent file is the key for HxS (Title) file. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string attributeIndexField; + + private bool attributeIndexFieldSet; + + private string indexField; + + private bool indexFieldSet; + + private int languageField; + + private bool languageFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sampleLocationField; + + private bool sampleLocationFieldSet; + + private string searchField; + + private bool searchFieldSet; + + private YesNoType suppressCustomActionsField; + + private bool suppressCustomActionsFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFile Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Key for HxR (Attributes) file. + /// + public string AttributeIndex + { + get + { + return this.attributeIndexField; + } + set + { + this.attributeIndexFieldSet = true; + this.attributeIndexField = value; + } + } + + /// + /// Key for HxI (Index) file. + /// + public string Index + { + get + { + return this.indexField; + } + set + { + this.indexFieldSet = true; + this.indexField = value; + } + } + + /// + /// Language ID for content file. + /// + public int Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// Internal Microsoft Help ID for this HelpFile. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Key for a file that is in the "root" of the samples directory for this HelpFile. + /// + public string SampleLocation + { + get + { + return this.sampleLocationField; + } + set + { + this.sampleLocationFieldSet = true; + this.sampleLocationField = value; + } + } + + /// + /// Key for HxQ (Query) file. + /// + public string Search + { + get + { + return this.searchField; + } + set + { + this.searchFieldSet = true; + this.searchField = value; + } + } + + /// + /// Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressCustomActions + { + get + { + return this.suppressCustomActionsField; + } + set + { + this.suppressCustomActionsFieldSet = true; + this.suppressCustomActionsField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFile", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.attributeIndexFieldSet) + { + writer.WriteAttributeString("AttributeIndex", this.attributeIndexField); + } + if (this.indexFieldSet) + { + writer.WriteAttributeString("Index", this.indexField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sampleLocationFieldSet) + { + writer.WriteAttributeString("SampleLocation", this.sampleLocationField); + } + if (this.searchFieldSet) + { + writer.WriteAttributeString("Search", this.searchField); + } + if (this.suppressCustomActionsFieldSet) + { + if ((this.suppressCustomActionsField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressCustomActions", "no"); + } + if ((this.suppressCustomActionsField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressCustomActions", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AttributeIndex" == name)) + { + this.attributeIndexField = value; + this.attributeIndexFieldSet = true; + } + if (("Index" == name)) + { + this.indexField = value; + this.indexFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.languageFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SampleLocation" == name)) + { + this.sampleLocationField = value; + this.sampleLocationFieldSet = true; + } + if (("Search" == name)) + { + this.searchField = value; + this.searchFieldSet = true; + } + if (("SuppressCustomActions" == name)) + { + this.suppressCustomActionsField = Enums.ParseYesNoType(value); + this.suppressCustomActionsFieldSet = true; + } + } + } + + /// + /// Plugin for Help Namespace. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class PlugCollectionInto : ISchemaElement, ISetAttributes + { + + private string attributesField; + + private bool attributesFieldSet; + + private string tableOfContentsField; + + private bool tableOfContentsFieldSet; + + private string targetCollectionField; + + private bool targetCollectionFieldSet; + + private string targetTableOfContentsField; + + private bool targetTableOfContentsFieldSet; + + private string targetFeatureField; + + private bool targetFeatureFieldSet; + + private YesNoType suppressExternalNamespacesField; + + private bool suppressExternalNamespacesFieldSet; + + private ISchemaElement parentElement; + + /// + /// Key for HxA (Attributes) file of child namespace. + /// + public string Attributes + { + get + { + return this.attributesField; + } + set + { + this.attributesFieldSet = true; + this.attributesField = value; + } + } + + /// + /// Key for HxT file of child namespace. + /// + public string TableOfContents + { + get + { + return this.tableOfContentsField; + } + set + { + this.tableOfContentsFieldSet = true; + this.tableOfContentsField = value; + } + } + + /// + /// Foriegn Key into HelpNamespace table for the parent namespace into which the child will be inserted. + /// The following special keys can be used to plug into external namespaces defined outside of the installer. + /// MS_VSIPCC_v80 : Visual Studio 2005 + /// MS.VSIPCC.v90 : Visual Studio 2008 + /// + public string TargetCollection + { + get + { + return this.targetCollectionField; + } + set + { + this.targetCollectionFieldSet = true; + this.targetCollectionField = value; + } + } + + /// + /// Key for HxT file of parent namespace that now includes the new child namespace. + /// + public string TargetTableOfContents + { + get + { + return this.targetTableOfContentsField; + } + set + { + this.targetTableOfContentsFieldSet = true; + this.targetTableOfContentsField = value; + } + } + + /// + /// Key for the feature parent of this help collection. Required only when plugging into external namespaces. + /// + public string TargetFeature + { + get + { + return this.targetFeatureField; + } + set + { + this.targetFeatureFieldSet = true; + this.targetFeatureField = value; + } + } + + /// + /// Suppress linking Visual Studio Help namespaces. Help redistributable merge modules will be required. Use this when building a merge module. + /// + public YesNoType SuppressExternalNamespaces + { + get + { + return this.suppressExternalNamespacesField; + } + set + { + this.suppressExternalNamespacesFieldSet = true; + this.suppressExternalNamespacesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PlugCollectionInto", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.attributesFieldSet) + { + writer.WriteAttributeString("Attributes", this.attributesField); + } + if (this.tableOfContentsFieldSet) + { + writer.WriteAttributeString("TableOfContents", this.tableOfContentsField); + } + if (this.targetCollectionFieldSet) + { + writer.WriteAttributeString("TargetCollection", this.targetCollectionField); + } + if (this.targetTableOfContentsFieldSet) + { + writer.WriteAttributeString("TargetTableOfContents", this.targetTableOfContentsField); + } + if (this.targetFeatureFieldSet) + { + writer.WriteAttributeString("TargetFeature", this.targetFeatureField); + } + if (this.suppressExternalNamespacesFieldSet) + { + if ((this.suppressExternalNamespacesField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressExternalNamespaces", "no"); + } + if ((this.suppressExternalNamespacesField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressExternalNamespaces", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Attributes" == name)) + { + this.attributesField = value; + this.attributesFieldSet = true; + } + if (("TableOfContents" == name)) + { + this.tableOfContentsField = value; + this.tableOfContentsFieldSet = true; + } + if (("TargetCollection" == name)) + { + this.targetCollectionField = value; + this.targetCollectionFieldSet = true; + } + if (("TargetTableOfContents" == name)) + { + this.targetTableOfContentsField = value; + this.targetTableOfContentsFieldSet = true; + } + if (("TargetFeature" == name)) + { + this.targetFeatureField = value; + this.targetFeatureFieldSet = true; + } + if (("SuppressExternalNamespaces" == name)) + { + this.suppressExternalNamespacesField = Enums.ParseYesNoType(value); + this.suppressExternalNamespacesFieldSet = true; + } + } + } + + /// + /// Create a reference to a HelpFile element in another Fragment. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFileRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFile Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFileRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a HelpFile element in another Fragment. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpFilterRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key for HelpFilter. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpFilterRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a HelpCollection element in another Fragment. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class HelpCollectionRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public HelpCollectionRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(HelpFileRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary Key for HelpNamespace Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("HelpFileRef" == childName)) + { + childValue = new HelpFileRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("HelpCollectionRef", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// This element provides the metdata required to install/uninstall a file as + /// a VSIX Package. The VSIX package file will be installed as part of the MSI + /// then passed to the VSIX installer to install the VSIX package. To avoid the + /// duplication, simply use the MSI to install the VSIX package itself. + /// + [GeneratedCode("XsdGen", "4.0.0.0")] + public class VsixPackage : ISchemaElement, ISetAttributes + { + + private string fileField; + + private bool fileFieldSet; + + private string packageIdField; + + private bool packageIdFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string targetVersionField; + + private bool targetVersionFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private string vsixInstallerPathPropertyField; + + private bool vsixInstallerPathPropertyFieldSet; + + private ISchemaElement parentElement; + + /// + /// Reference to file identifer. This attribute is required when the element is not a + /// child of a File element and is invalid when the element is a child of the File element. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Identity of the VSIX package per its internal manifest. If this value is not correct + /// the VSIX package will not correctly uninstall. + /// + public string PackageId + { + get + { + return this.packageIdField; + } + set + { + this.packageIdFieldSet = true; + this.packageIdField = value; + } + } + + /// + /// Indicates whether the VSIX package is uninstalled when the parent Component is uninstalled. + /// The default is 'no'. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies the SKU of Visual Studio in which to register the extension. If no target + /// is specified the extension is registered with all installed SKUs. If the Target + /// attribute is specified the TargetVersion attribute must also be specified. The + /// following is a list of known Visual Studio targets: integratedShell, professional, + /// premium, ultimate, vbExpress, vcExpress, vcsExpress, vwdExpress + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Specifies the version of Visual Studio in which to register the extension. This attribute + /// is required if the Target attribute is specified. + /// + public string TargetVersion + { + get + { + return this.targetVersionField; + } + set + { + this.targetVersionFieldSet = true; + this.targetVersionField = value; + } + } + + /// + /// Indicates whether failure to install the VSIX package causes the installation to rollback. + /// The default is 'yes'. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Optional reference to a Property element that contains the path to the VsixInstaller.exe. + /// By default, the latest VsixInstaller.exe on the machine will be used to install the VSIX + /// package. It is highly recommended that this attribute is *not* used. + /// + public string VsixInstallerPathProperty + { + get + { + return this.vsixInstallerPathPropertyField; + } + set + { + this.vsixInstallerPathPropertyFieldSet = true; + this.vsixInstallerPathPropertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("VsixPackage", "http://wixtoolset.org/schemas/v4/wxs/vs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.packageIdFieldSet) + { + writer.WriteAttributeString("PackageId", this.packageIdField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.targetVersionFieldSet) + { + writer.WriteAttributeString("TargetVersion", this.targetVersionField); + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.vsixInstallerPathPropertyFieldSet) + { + writer.WriteAttributeString("VsixInstallerPathProperty", this.vsixInstallerPathPropertyField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("PackageId" == name)) + { + this.packageIdField = value; + this.packageIdFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("TargetVersion" == name)) + { + this.targetVersionField = value; + this.targetVersionFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("VsixInstallerPathProperty" == name)) + { + this.vsixInstallerPathPropertyField = value; + this.vsixInstallerPathPropertyFieldSet = true; + } + } + } +} diff --git a/src/wix/heat/Serialize/wix.cs b/src/wix/heat/Serialize/wix.cs new file mode 100644 index 00000000..e5a81cd0 --- /dev/null +++ b/src/wix/heat/Serialize/wix.cs @@ -0,0 +1,57740 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 // TODO: add documentation +namespace WixToolset.Harvesters.Serialize +{ + using System; + using System.CodeDom.Compiler; + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Globalization; + using System.Xml; + + /// + /// Values of this type will either be "attached" or "detached". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum BurnContainerType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + attached, + + detached, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Enums + { + + /// + /// Parses a BurnContainerType from a string. + /// + public static BurnContainerType ParseBurnContainerType(string value) + { + BurnContainerType parsedValue; + Enums.TryParseBurnContainerType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a BurnContainerType from a string. + /// + public static bool TryParseBurnContainerType(string value, out BurnContainerType parsedValue) + { + parsedValue = BurnContainerType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("attached" == value)) + { + parsedValue = BurnContainerType.attached; + } + else + { + if (("detached" == value)) + { + parsedValue = BurnContainerType.detached; + } + else + { + parsedValue = BurnContainerType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a BurnExeProtocolType from a string. + /// + public static BurnExeProtocolType ParseBurnExeProtocolType(string value) + { + BurnExeProtocolType parsedValue; + Enums.TryParseBurnExeProtocolType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a BurnExeProtocolType from a string. + /// + public static bool TryParseBurnExeProtocolType(string value, out BurnExeProtocolType parsedValue) + { + parsedValue = BurnExeProtocolType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("none" == value)) + { + parsedValue = BurnExeProtocolType.none; + } + else + { + if (("burn" == value)) + { + parsedValue = BurnExeProtocolType.burn; + } + else + { + if (("netfx4" == value)) + { + parsedValue = BurnExeProtocolType.netfx4; + } + else + { + parsedValue = BurnExeProtocolType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a YesNoType from a string. + /// + public static YesNoType ParseYesNoType(string value) + { + YesNoType parsedValue; + Enums.TryParseYesNoType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoType from a string. + /// + public static bool TryParseYesNoType(string value, out YesNoType parsedValue) + { + parsedValue = YesNoType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoType.yes; + } + else + { + parsedValue = YesNoType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a YesNoButtonType from a string. + /// + public static YesNoButtonType ParseYesNoButtonType(string value) + { + YesNoButtonType parsedValue; + Enums.TryParseYesNoButtonType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoButtonType from a string. + /// + public static bool TryParseYesNoButtonType(string value, out YesNoButtonType parsedValue) + { + parsedValue = YesNoButtonType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = YesNoButtonType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoButtonType.yes; + } + else + { + if (("button" == value)) + { + parsedValue = YesNoButtonType.button; + } + else + { + parsedValue = YesNoButtonType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a YesNoDefaultType from a string. + /// + public static YesNoDefaultType ParseYesNoDefaultType(string value) + { + YesNoDefaultType parsedValue; + Enums.TryParseYesNoDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoDefaultType from a string. + /// + public static bool TryParseYesNoDefaultType(string value, out YesNoDefaultType parsedValue) + { + parsedValue = YesNoDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("default" == value)) + { + parsedValue = YesNoDefaultType.@default; + } + else + { + if (("no" == value)) + { + parsedValue = YesNoDefaultType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoDefaultType.yes; + } + else + { + parsedValue = YesNoDefaultType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a YesNoAlwaysType from a string. + /// + public static YesNoAlwaysType ParseYesNoAlwaysType(string value) + { + YesNoAlwaysType parsedValue; + Enums.TryParseYesNoAlwaysType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a YesNoAlwaysType from a string. + /// + public static bool TryParseYesNoAlwaysType(string value, out YesNoAlwaysType parsedValue) + { + parsedValue = YesNoAlwaysType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("always" == value)) + { + parsedValue = YesNoAlwaysType.always; + } + else + { + if (("no" == value)) + { + parsedValue = YesNoAlwaysType.no; + } + else + { + if (("yes" == value)) + { + parsedValue = YesNoAlwaysType.yes; + } + else + { + parsedValue = YesNoAlwaysType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a RegistryRootType from a string. + /// + public static RegistryRootType ParseRegistryRootType(string value) + { + RegistryRootType parsedValue; + Enums.TryParseRegistryRootType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RegistryRootType from a string. + /// + public static bool TryParseRegistryRootType(string value, out RegistryRootType parsedValue) + { + parsedValue = RegistryRootType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("HKMU" == value)) + { + parsedValue = RegistryRootType.HKMU; + } + else + { + if (("HKCR" == value)) + { + parsedValue = RegistryRootType.HKCR; + } + else + { + if (("HKCU" == value)) + { + parsedValue = RegistryRootType.HKCU; + } + else + { + if (("HKLM" == value)) + { + parsedValue = RegistryRootType.HKLM; + } + else + { + if (("HKU" == value)) + { + parsedValue = RegistryRootType.HKU; + } + else + { + parsedValue = RegistryRootType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ExitType from a string. + /// + public static ExitType ParseExitType(string value) + { + ExitType parsedValue; + Enums.TryParseExitType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ExitType from a string. + /// + public static bool TryParseExitType(string value, out ExitType parsedValue) + { + parsedValue = ExitType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("success" == value)) + { + parsedValue = ExitType.success; + } + else + { + if (("cancel" == value)) + { + parsedValue = ExitType.cancel; + } + else + { + if (("error" == value)) + { + parsedValue = ExitType.error; + } + else + { + if (("suspend" == value)) + { + parsedValue = ExitType.suspend; + } + else + { + parsedValue = ExitType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a InstallUninstallType from a string. + /// + public static InstallUninstallType ParseInstallUninstallType(string value) + { + InstallUninstallType parsedValue; + Enums.TryParseInstallUninstallType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallUninstallType from a string. + /// + public static bool TryParseInstallUninstallType(string value, out InstallUninstallType parsedValue) + { + parsedValue = InstallUninstallType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("install" == value)) + { + parsedValue = InstallUninstallType.install; + } + else + { + if (("uninstall" == value)) + { + parsedValue = InstallUninstallType.uninstall; + } + else + { + if (("both" == value)) + { + parsedValue = InstallUninstallType.both; + } + else + { + parsedValue = InstallUninstallType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a SequenceType from a string. + /// + public static SequenceType ParseSequenceType(string value) + { + SequenceType parsedValue; + Enums.TryParseSequenceType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a SequenceType from a string. + /// + public static bool TryParseSequenceType(string value, out SequenceType parsedValue) + { + parsedValue = SequenceType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("both" == value)) + { + parsedValue = SequenceType.both; + } + else + { + if (("first" == value)) + { + parsedValue = SequenceType.first; + } + else + { + if (("execute" == value)) + { + parsedValue = SequenceType.execute; + } + else + { + if (("ui" == value)) + { + parsedValue = SequenceType.ui; + } + else + { + parsedValue = SequenceType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a CompressionLevelType from a string. + /// + public static CompressionLevelType ParseCompressionLevelType(string value) + { + CompressionLevelType parsedValue; + Enums.TryParseCompressionLevelType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CompressionLevelType from a string. + /// + public static bool TryParseCompressionLevelType(string value, out CompressionLevelType parsedValue) + { + parsedValue = CompressionLevelType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("high" == value)) + { + parsedValue = CompressionLevelType.high; + } + else + { + if (("low" == value)) + { + parsedValue = CompressionLevelType.low; + } + else + { + if (("medium" == value)) + { + parsedValue = CompressionLevelType.medium; + } + else + { + if (("mszip" == value)) + { + parsedValue = CompressionLevelType.mszip; + } + else + { + if (("none" == value)) + { + parsedValue = CompressionLevelType.none; + } + else + { + parsedValue = CompressionLevelType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + } + + /// + /// The list of communcation protocols with executable packages Burn supports. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum BurnExeProtocolType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The executable package does not support a communication protocol. + /// + none, + + /// + /// The executable package is another Burn bundle and supports the Burn communication protocol. + /// + burn, + + /// + /// The executable package implements the .NET Framework v4.0 communication protocol. + /// + netfx4, + } + + /// + /// Values of this type will either be "yes" or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + } + + /// + /// Values of this type will either be "button", "yes" or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoButtonType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + no, + + yes, + + button, + } + + /// + /// Values of this type will either be "default", "yes", or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + @default, + + no, + + yes, + } + + /// + /// Values of this type will either be "always", "yes", or "no". + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum YesNoAlwaysType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + always, + + no, + + yes, + } + + /// + /// Values of this type represent possible registry roots. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum RegistryRootType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// A per-user installation will make the operation occur under HKEY_CURRENT_USER. + /// A per-machine installation will make the operation occur under HKEY_LOCAL_MACHINE. + /// + HKMU, + + /// + /// Operation occurs under HKEY_CLASSES_ROOT. When using Windows 2000 or later, the installer writes or removes the value + /// from the HKCU\Software\Classes hive during per-user installations. When using Windows 2000 or later operating systems, + /// the installer writes or removes the value from the HKLM\Software\Classes hive during per-machine installations. + /// + HKCR, + + /// + /// Operation occurs under HKEY_CURRENT_USER. It is recommended to set the KeyPath='yes' attribute when setting this value for writing values + /// in order to ensure that the installer writes the necessary registry entries when there are multiple users on the same computer. + /// + HKCU, + + /// + /// Operation occurs under HKEY_LOCAL_MACHINE. + /// + HKLM, + + /// + /// Operation occurs under HKEY_USERS. + /// + HKU, + } + + /// + /// Value indicates that this action is executed if the installer returns the associated exit type. Each exit type can be used with no more than one action. + /// Multiple actions can have exit types assigned, but every action and exit type must be different. Exit types are typically used with dialog boxes. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ExitType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + success, + + cancel, + + error, + + suspend, + } + + /// + /// Specifies whether an action occur on install, uninstall or both. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallUninstallType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The action should happen during install (msiInstallStateLocal or msiInstallStateSource). + /// + install, + + /// + /// The action should happen during uninstall (msiInstallStateAbsent). + /// + uninstall, + + /// + /// The action should happen during both install and uninstall. + /// + both, + } + + /// + /// Controls which sequences the item assignment is sequenced in. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum SequenceType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Schedules the assignment in the InstallUISequence and the InstallExecuteSequence. + /// + both, + + /// + /// Schedules the assignment to run in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped. + /// + first, + + /// + /// Schedules the assignment only in the the InstallExecuteSequence. + /// + execute, + + /// + /// Schedules the assignment only in the the InstallUISequence. + /// + ui, + } + + /// + /// Indicates the compression level for a cabinet. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum CompressionLevelType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + high, + + low, + + medium, + + mszip, + + none, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public abstract class ActionModuleSequenceType : ISchemaElement, ISetAttributes + { + + private string afterField; + + private bool afterFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private YesNoType suppressField; + + private bool suppressFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of an action that this action should come after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The name of an action that this action should come before. + /// + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + /// + /// If "yes", the sequencing of this action may be overridden by sequencing elsewhere. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + /// + /// A value used to indicate the position of this action in a sequence. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// If yes, this action will not occur. + /// + public YesNoType Suppress + { + get + { + return this.suppressField; + } + set + { + this.suppressFieldSet = true; + this.suppressField = value; + } + } + + /// + /// Text node specifies the condition of the action. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.suppressFieldSet) + { + if ((this.suppressField == YesNoType.no)) + { + writer.WriteAttributeString("Suppress", "no"); + } + if ((this.suppressField == YesNoType.yes)) + { + writer.WriteAttributeString("Suppress", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Suppress" == name)) + { + this.suppressField = Enums.ParseYesNoType(value); + this.suppressFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public abstract class ActionSequenceType : ISchemaElement, ISetAttributes + { + + private int sequenceField; + + private bool sequenceFieldSet; + + private YesNoType suppressField; + + private bool suppressFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// A value used to indicate the position of this action in a sequence. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// If yes, this action will not occur. + /// + public YesNoType Suppress + { + get + { + return this.suppressField; + } + set + { + this.suppressFieldSet = true; + this.suppressField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.suppressFieldSet) + { + if ((this.suppressField == YesNoType.no)) + { + writer.WriteAttributeString("Suppress", "no"); + } + if ((this.suppressField == YesNoType.yes)) + { + writer.WriteAttributeString("Suppress", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Suppress" == name)) + { + this.suppressField = Enums.ParseYesNoType(value); + this.suppressFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// This is the top-level container element for every wxs file. Among the possible children, + /// the Bundle, Package, Module, Patch, and PatchCreation elements are analogous to the main function in a C program. + /// There can only be one of these present when linking occurs. Package compiles into an msi file, + /// Module compiles into an msm file, PatchCreation compiles into a pcp file. The Fragment element + /// is an atomic unit which ultimately links into either a Package, Module, or PatchCreation. The + /// Fragment can either be completely included or excluded during linking. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Wix : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string requiredVersionField; + + private bool requiredVersionFieldSet; + + private ISchemaElement parentElement; + + public Wix() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Bundle))); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Package))); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Module))); + childCollection2.AddItem(new ElementCollection.ChoiceItem(typeof(Patch))); + childCollection1.AddCollection(childCollection2); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(Fragment))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCreation))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Required version of the WiX toolset to compile this input file. + /// + public string RequiredVersion + { + get + { + return this.requiredVersionField; + } + set + { + this.requiredVersionFieldSet = true; + this.requiredVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Bundle" == childName)) + { + childValue = new Bundle(); + } + if (("Package" == childName)) + { + childValue = new Package(); + } + if (("Module" == childName)) + { + childValue = new Module(); + } + if (("Patch" == childName)) + { + childValue = new Patch(); + } + if (("Fragment" == childName)) + { + childValue = new Fragment(); + } + if (("PatchCreation" == childName)) + { + childValue = new PatchCreation(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Wix", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.requiredVersionFieldSet) + { + writer.WriteAttributeString("RequiredVersion", this.requiredVersionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("RequiredVersion" == name)) + { + this.requiredVersionField = value; + this.requiredVersionFieldSet = true; + } + } + } + + /// + /// This is the top-level container element for every wxi file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Include : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public Include() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Include", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// The root element for creating bundled packages. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Bundle : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string aboutUrlField; + + private bool aboutUrlFieldSet; + + private string copyrightField; + + private bool copyrightFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoButtonType disableModifyField; + + private bool disableModifyFieldSet; + + private YesNoType disableRemoveField; + + private bool disableRemoveFieldSet; + + private YesNoType disableRepairField; + + private bool disableRepairFieldSet; + + private string helpTelephoneField; + + private bool helpTelephoneFieldSet; + + private string helpUrlField; + + private bool helpUrlFieldSet; + + private string iconSourceFileField; + + private bool iconSourceFileFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string parentNameField; + + private bool parentNameFieldSet; + + private string splashScreenSourceFileField; + + private bool splashScreenSourceFileFieldSet; + + private string tagField; + + private bool tagFieldSet; + + private string updateUrlField; + + private bool updateUrlFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private ISchemaElement parentElement; + + public Bundle() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ApprovedExeForElevation))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Log))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Catalog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplicationRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(OptionalUpdateRegistration))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Chain))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Container))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ContainerRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RelatedBundle))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Update))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Variable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// A URL for more information about the bundle to display in Programs and Features (also + /// known as Add/Remove Programs). + /// + public string AboutUrl + { + get + { + return this.aboutUrlField; + } + set + { + this.aboutUrlFieldSet = true; + this.aboutUrlField = value; + } + } + + /// + /// The legal copyright found in the version resources of final bundle executable. If + /// this attribute is not provided the copyright will be set to "Copyright (c) [Bundle/@Manufacturer]. All rights reserved.". + /// + public string Copyright + { + get + { + return this.copyrightField; + } + set + { + this.copyrightFieldSet = true; + this.copyrightField = value; + } + } + + /// + /// Whether Packages and Payloads not assigned to a container should be added to the default attached container or if they should be external. The default is yes. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// Determines whether the bundle can be modified via the Programs and Features (also known as + /// Add/Remove Programs). If the value is "button" then Programs and Features will show a single + /// "Uninstall/Change" button. If the value is "yes" then Programs and Features will only show + /// the "Uninstall" button". If the value is "no", the default, then a "Change" button is shown. + /// See the DisableRemove attribute for information how to not display the bundle in Programs + /// and Features. + /// + public YesNoButtonType DisableModify + { + get + { + return this.disableModifyField; + } + set + { + this.disableModifyFieldSet = true; + this.disableModifyField = value; + } + } + + /// + /// Determines whether the bundle can be removed via the Programs and Features (also + /// known as Add/Remove Programs). If the value is "yes" then the "Uninstall" button will + /// not be displayed. The default is "no" which ensures there is an "Uninstall" button to + /// remove the bundle. If the "DisableModify" attribute is also "yes" or "button" then the + /// bundle will not be displayed in Progams and Features and another mechanism (such as + /// registering as a related bundle addon) must be used to ensure the bundle can be removed. + /// + public YesNoType DisableRemove + { + get + { + return this.disableRemoveField; + } + set + { + this.disableRemoveFieldSet = true; + this.disableRemoveField = value; + } + } + + public YesNoType DisableRepair + { + get + { + return this.disableRepairField; + } + set + { + this.disableRepairFieldSet = true; + this.disableRepairField = value; + } + } + + /// + /// A telephone number for help to display in Programs and Features (also known as + /// Add/Remove Programs). + /// + public string HelpTelephone + { + get + { + return this.helpTelephoneField; + } + set + { + this.helpTelephoneFieldSet = true; + this.helpTelephoneField = value; + } + } + + /// + /// A URL to the help for the bundle to display in Programs and Features (also known as + /// Add/Remove Programs). + /// + public string HelpUrl + { + get + { + return this.helpUrlField; + } + set + { + this.helpUrlFieldSet = true; + this.helpUrlField = value; + } + } + + /// + /// Path to an icon that will replace the default icon in the final Bundle executable. + /// This icon will also be displayed in Programs and Features (also known as Add/Remove + /// Programs). + /// + public string IconSourceFile + { + get + { + return this.iconSourceFileField; + } + set + { + this.iconSourceFileFieldSet = true; + this.iconSourceFileField = value; + } + } + + /// + /// The publisher of the bundle to display in Programs and Features (also known as + /// Add/Remove Programs). + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The name of the bundle to display in Programs and Features (also known as Add/Remove + /// Programs). This name can be accessed and overwritten by a BootstrapperApplication + /// using the WixBundleName bundle variable. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The name of the parent bundle to display in Installed Updates (also known as Add/Remove + /// Programs). This name is used to nest or group bundles that will appear as updates. + /// If the parent name does not actually exist, a virtual parent is created automatically. + /// + public string ParentName + { + get + { + return this.parentNameField; + } + set + { + this.parentNameFieldSet = true; + this.parentNameField = value; + } + } + + /// + /// Path to a bitmap that will be shown as the bootstrapper application is being loaded. If this attribute is not specified, no splash screen will be displayed. + /// + public string SplashScreenSourceFile + { + get + { + return this.splashScreenSourceFileField; + } + set + { + this.splashScreenSourceFileFieldSet = true; + this.splashScreenSourceFileField = value; + } + } + + /// + /// Set this string to uniquely identify this bundle to its own BA, and to related bundles. The value of this string only matters to the BA, and its value has no direct effect on engine functionality. + /// + public string Tag + { + get + { + return this.tagField; + } + set + { + this.tagFieldSet = true; + this.tagField = value; + } + } + + /// + /// A URL for updates of the bundle to display in Programs and Features (also + /// known as Add/Remove Programs). + /// + public string UpdateUrl + { + get + { + return this.updateUrlField; + } + set + { + this.updateUrlFieldSet = true; + this.updateUrlField = value; + } + } + + /// + /// Unique identifier for a family of bundles. If two bundles have the same UpgradeCode the + /// bundle with the highest version will be installed. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// The version of the bundle. Newer versions upgrade earlier versions of the bundles + /// with matching UpgradeCodes. If the bundle is registered in Programs and Features + /// then this attribute will be displayed in the Programs and Features user interface. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + /// + /// The condition of the bundle. If the condition is not met, the bundle will + /// refuse to run. Conditions are checked before the bootstrapper application is loaded + /// (before detect), and thus can only reference built-in variables such as + /// variables which indicate the version of the OS. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ApprovedExeForElevation" == childName)) + { + childValue = new ApprovedExeForElevation(); + } + if (("Log" == childName)) + { + childValue = new Log(); + } + if (("Catalog" == childName)) + { + childValue = new Catalog(); + } + if (("BootstrapperApplication" == childName)) + { + childValue = new BootstrapperApplication(); + } + if (("BootstrapperApplicationRef" == childName)) + { + childValue = new BootstrapperApplicationRef(); + } + if (("OptionalUpdateRegistration" == childName)) + { + childValue = new OptionalUpdateRegistration(); + } + if (("Chain" == childName)) + { + childValue = new Chain(); + } + if (("Container" == childName)) + { + childValue = new Container(); + } + if (("ContainerRef" == childName)) + { + childValue = new ContainerRef(); + } + if (("PayloadGroup" == childName)) + { + childValue = new PayloadGroup(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if (("RelatedBundle" == childName)) + { + childValue = new RelatedBundle(); + } + if (("Update" == childName)) + { + childValue = new Update(); + } + if (("Variable" == childName)) + { + childValue = new Variable(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Bundle", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.aboutUrlFieldSet) + { + writer.WriteAttributeString("AboutUrl", this.aboutUrlField); + } + if (this.copyrightFieldSet) + { + writer.WriteAttributeString("Copyright", this.copyrightField); + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.disableModifyFieldSet) + { + if ((this.disableModifyField == YesNoButtonType.no)) + { + writer.WriteAttributeString("DisableModify", "no"); + } + if ((this.disableModifyField == YesNoButtonType.yes)) + { + writer.WriteAttributeString("DisableModify", "yes"); + } + if ((this.disableModifyField == YesNoButtonType.button)) + { + writer.WriteAttributeString("DisableModify", "button"); + } + } + if (this.disableRemoveFieldSet) + { + if ((this.disableRemoveField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRemove", "no"); + } + if ((this.disableRemoveField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRemove", "yes"); + } + } + if (this.disableRepairFieldSet) + { + if ((this.disableRepairField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRepair", "no"); + } + if ((this.disableRepairField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRepair", "yes"); + } + } + if (this.helpTelephoneFieldSet) + { + writer.WriteAttributeString("HelpTelephone", this.helpTelephoneField); + } + if (this.helpUrlFieldSet) + { + writer.WriteAttributeString("HelpUrl", this.helpUrlField); + } + if (this.iconSourceFileFieldSet) + { + writer.WriteAttributeString("IconSourceFile", this.iconSourceFileField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.parentNameFieldSet) + { + writer.WriteAttributeString("ParentName", this.parentNameField); + } + if (this.splashScreenSourceFileFieldSet) + { + writer.WriteAttributeString("SplashScreenSourceFile", this.splashScreenSourceFileField); + } + if (this.tagFieldSet) + { + writer.WriteAttributeString("Tag", this.tagField); + } + if (this.updateUrlFieldSet) + { + writer.WriteAttributeString("UpdateUrl", this.updateUrlField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("AboutUrl" == name)) + { + this.aboutUrlField = value; + this.aboutUrlFieldSet = true; + } + if (("Copyright" == name)) + { + this.copyrightField = value; + this.copyrightFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("DisableModify" == name)) + { + this.disableModifyField = Enums.ParseYesNoButtonType(value); + this.disableModifyFieldSet = true; + } + if (("DisableRemove" == name)) + { + this.disableRemoveField = Enums.ParseYesNoType(value); + this.disableRemoveFieldSet = true; + } + if (("DisableRepair" == name)) + { + this.disableRepairField = Enums.ParseYesNoType(value); + this.disableRepairFieldSet = true; + } + if (("HelpTelephone" == name)) + { + this.helpTelephoneField = value; + this.helpTelephoneFieldSet = true; + } + if (("HelpUrl" == name)) + { + this.helpUrlField = value; + this.helpUrlFieldSet = true; + } + if (("IconSourceFile" == name)) + { + this.iconSourceFileField = value; + this.iconSourceFileFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ParentName" == name)) + { + this.parentNameField = value; + this.parentNameFieldSet = true; + } + if (("SplashScreenSourceFile" == name)) + { + this.splashScreenSourceFileField = value; + this.splashScreenSourceFileFieldSet = true; + } + if (("Tag" == name)) + { + this.tagField = value; + this.tagFieldSet = true; + } + if (("UpdateUrl" == name)) + { + this.updateUrlField = value; + this.updateUrlFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + } + } + + /// + /// Provides information about an .exe so that the BA can request the engine to run it elevated from any secure location. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ApprovedExeForElevation : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the ApprovedExeForElevation element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The key path. + /// For security purposes, the root key will be HKLM and Variables are not supported. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The value name. + /// For security purposes, Variables are not supported. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Instructs the search to look in the 64-bit registry when the value is 'yes'. + /// When the value is 'no', the search looks in the 32-bit registry. + /// The default value is 'no'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ApprovedExeForElevation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + } + + /// + /// Overrides the default log settings for a bundle. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Log : ISchemaElement, ISetAttributes + { + + private YesNoType disableField; + + private bool disableFieldSet; + + private string pathVariableField; + + private bool pathVariableFieldSet; + + private string prefixField; + + private bool prefixFieldSet; + + private string extensionField; + + private bool extensionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Disables the default logging in the Bundle. The end user can still generate a + /// log file by specifying the "-l" command-line argument when installing the + /// Bundle. + /// + public YesNoType Disable + { + get + { + return this.disableField; + } + set + { + this.disableFieldSet = true; + this.disableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value + /// will cause the variable to not be set. The default is "WixBundleLog". + /// + public string PathVariable + { + get + { + return this.pathVariableField; + } + set + { + this.pathVariableFieldSet = true; + this.pathVariableField = value; + } + } + + /// + /// File name and optionally a relative path to use as the prefix for the log file. The + /// default is to use the Bundle/@Name or, if Bundle/@Name is not specified, the value + /// "Setup". + /// + public string Prefix + { + get + { + return this.prefixField; + } + set + { + this.prefixFieldSet = true; + this.prefixField = value; + } + } + + /// + /// The extension to use for the log. The default is ".log". + /// + public string Extension + { + get + { + return this.extensionField; + } + set + { + this.extensionFieldSet = true; + this.extensionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Log", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.disableFieldSet) + { + if ((this.disableField == YesNoType.no)) + { + writer.WriteAttributeString("Disable", "no"); + } + if ((this.disableField == YesNoType.yes)) + { + writer.WriteAttributeString("Disable", "yes"); + } + } + if (this.pathVariableFieldSet) + { + writer.WriteAttributeString("PathVariable", this.pathVariableField); + } + if (this.prefixFieldSet) + { + writer.WriteAttributeString("Prefix", this.prefixField); + } + if (this.extensionFieldSet) + { + writer.WriteAttributeString("Extension", this.extensionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Disable" == name)) + { + this.disableField = Enums.ParseYesNoType(value); + this.disableFieldSet = true; + } + if (("PathVariable" == name)) + { + this.pathVariableField = value; + this.pathVariableFieldSet = true; + } + if (("Prefix" == name)) + { + this.prefixField = value; + this.prefixFieldSet = true; + } + if (("Extension" == name)) + { + this.extensionField = value; + this.extensionFieldSet = true; + } + } + } + + /// + /// Specify one or more catalog files that will be used to verify the contents of the bundle. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Catalog : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the catalog element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The catalog file + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Catalog", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Contains all the relevant information about the setup UI. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BootstrapperApplication : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private ISchemaElement parentElement; + + public BootstrapperApplication() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the BootstrapperApplication element. Only required if you want to reference this element using a BootstrapperApplicationRef element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The DLL with the bootstrapper application entry function. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The relative destination path and file name for the bootstrapper application DLL. The default is the source file name. Use this attribute to rename the bootstrapper application DLL or extract it into a subfolder. The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BootstrapperApplication", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + } + } + + /// + /// Used to reference a BootstrapperApplication element and optionally add additional payloads to the bootstrapper application. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BootstrapperApplicationRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public BootstrapperApplicationRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the BootstrapperApplication element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BootstrapperApplicationRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// This element has been deprecated. Use the BootstrapperApplication element instead. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UX : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string splashScreenSourceFileField; + + private bool splashScreenSourceFileFieldSet; + + private ISchemaElement parentElement; + + public UX() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// See the BootstrapperApplication instead. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// See the BootstrapperApplication instead. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// See the BootstrapperApplication instead. + /// + public string SplashScreenSourceFile + { + get + { + return this.splashScreenSourceFileField; + } + set + { + this.splashScreenSourceFileFieldSet = true; + this.splashScreenSourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UX", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.splashScreenSourceFileFieldSet) + { + writer.WriteAttributeString("SplashScreenSourceFile", this.splashScreenSourceFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SplashScreenSourceFile" == name)) + { + this.splashScreenSourceFileField = value; + this.splashScreenSourceFileFieldSet = true; + } + } + } + + /// + /// Writes additional information to the Windows registry that can be used to detect the bundle. + /// This registration is intended primarily for update to an existing product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class OptionalUpdateRegistration : ISchemaElement, ISetAttributes + { + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string departmentField; + + private bool departmentFieldSet; + + private string productFamilyField; + + private bool productFamilyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string classificationField; + + private bool classificationFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the manufacturer. The default is the Bundle/@Manufacturer attribute, + /// but may also be a short form, ex: Acme instead of Acme Corporation. + /// An error is generated at build time if neither attribute is specified. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The name of the department or division publishing the update bundle. + /// The PublishingGroup registry value is not written if this attribute is not specified. + /// + public string Department + { + get + { + return this.departmentField; + } + set + { + this.departmentFieldSet = true; + this.departmentField = value; + } + } + + /// + /// The name of the family of products being updated. The default is the Bundle/@ParentName attribute. + /// The corresponding registry key is not created if neither attribute is specified. + /// + public string ProductFamily + { + get + { + return this.productFamilyField; + } + set + { + this.productFamilyFieldSet = true; + this.productFamilyField = value; + } + } + + /// + /// The name of the bundle. The default is the Bundle/@Name attribute, + /// but may also be a short form, ex: KB12345 instead of Update to Product (KB12345). + /// An error is generated at build time if neither attribute is specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The release type of the update bundle, such as Update, Security Update, Service Pack, etc. + /// The default value is Update. + /// + public string Classification + { + get + { + return this.classificationField; + } + set + { + this.classificationFieldSet = true; + this.classificationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("OptionalUpdateRegistration", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.departmentFieldSet) + { + writer.WriteAttributeString("Department", this.departmentField); + } + if (this.productFamilyFieldSet) + { + writer.WriteAttributeString("ProductFamily", this.productFamilyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.classificationFieldSet) + { + writer.WriteAttributeString("Classification", this.classificationField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Department" == name)) + { + this.departmentField = value; + this.departmentFieldSet = true; + } + if (("ProductFamily" == name)) + { + this.productFamilyField = value; + this.productFamilyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Classification" == name)) + { + this.classificationField = value; + this.classificationFieldSet = true; + } + } + } + + /// + /// Contains the chain of packages to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Chain : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType disableRollbackField; + + private bool disableRollbackFieldSet; + + private YesNoType disableSystemRestoreField; + + private bool disableSystemRestoreFieldSet; + + private YesNoType parallelCacheField; + + private bool parallelCacheFieldSet; + + private ISchemaElement parentElement; + + public Chain() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MspPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RollbackBoundary))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Specifies whether the bundle will attempt to rollback packages + /// executed in the chain. If "yes" is specified then when a vital + /// package fails to install only that package will rollback and the + /// chain will stop with the error. The default is "no" which + /// indicates all packages executed during the chain will be + /// rolledback to their previous state when a vital package fails. + /// + public YesNoType DisableRollback + { + get + { + return this.disableRollbackField; + } + set + { + this.disableRollbackFieldSet = true; + this.disableRollbackField = value; + } + } + + /// + /// Specifies whether the bundle will attempt to create a system + /// restore point when executing the chain. If "yes" is specified then + /// a system restore point will not be created. The default is "no" which + /// indicates a system restore point will be created when the bundle is + /// installed, uninstalled, repaired, modified, etc. If the system restore + /// point cannot be created, the bundle will log the issue and continue. + /// + public YesNoType DisableSystemRestore + { + get + { + return this.disableSystemRestoreField; + } + set + { + this.disableSystemRestoreFieldSet = true; + this.disableSystemRestoreField = value; + } + } + + /// + /// Specifies whether the bundle will start installing packages + /// while other packages are still being cached. If "yes", + /// packages will start executing when a rollback boundary is + /// encountered. The default is "no" which dictates all packages + /// must be cached before any packages will start to be installed. + /// + public YesNoType ParallelCache + { + get + { + return this.parallelCacheField; + } + set + { + this.parallelCacheFieldSet = true; + this.parallelCacheField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiPackage" == childName)) + { + childValue = new MsiPackage(); + } + if (("MspPackage" == childName)) + { + childValue = new MspPackage(); + } + if (("MsuPackage" == childName)) + { + childValue = new MsuPackage(); + } + if (("ExePackage" == childName)) + { + childValue = new ExePackage(); + } + if (("RollbackBoundary" == childName)) + { + childValue = new RollbackBoundary(); + } + if (("PackageGroupRef" == childName)) + { + childValue = new PackageGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Chain", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.disableRollbackFieldSet) + { + if ((this.disableRollbackField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRollback", "no"); + } + if ((this.disableRollbackField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRollback", "yes"); + } + } + if (this.disableSystemRestoreFieldSet) + { + if ((this.disableSystemRestoreField == YesNoType.no)) + { + writer.WriteAttributeString("DisableSystemRestore", "no"); + } + if ((this.disableSystemRestoreField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableSystemRestore", "yes"); + } + } + if (this.parallelCacheFieldSet) + { + if ((this.parallelCacheField == YesNoType.no)) + { + writer.WriteAttributeString("ParallelCache", "no"); + } + if ((this.parallelCacheField == YesNoType.yes)) + { + writer.WriteAttributeString("ParallelCache", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("DisableRollback" == name)) + { + this.disableRollbackField = Enums.ParseYesNoType(value); + this.disableRollbackFieldSet = true; + } + if (("DisableSystemRestore" == name)) + { + this.disableSystemRestoreField = Enums.ParseYesNoType(value); + this.disableSystemRestoreFieldSet = true; + } + if (("ParallelCache" == name)) + { + this.parallelCacheField = Enums.ParseYesNoType(value); + this.parallelCacheFieldSet = true; + } + } + } + + /// + /// Describes a single msi package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private YesNoType enableFeatureSelectionField; + + private bool enableFeatureSelectionFieldSet; + + private YesNoType forcePerMachineField; + + private bool forcePerMachineFieldSet; + + private YesNoType suppressLooseFilePayloadGenerationField; + + private bool suppressLooseFilePayloadGenerationFieldSet; + + private YesNoType visibleField; + + private bool visibleFieldSet; + + private ISchemaElement parentElement; + + public MsiPackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiProperty))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SlipstreamMsp))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// Specifies whether the bundle will allow individual control over the installation state of Features inside + /// the msi package. Managing feature selection requires special care to ensure the install, modify, update and + /// uninstall behavior of the package is always correct. The default is "no". + /// + public YesNoType EnableFeatureSelection + { + get + { + return this.enableFeatureSelectionField; + } + set + { + this.enableFeatureSelectionFieldSet = true; + this.enableFeatureSelectionField = value; + } + } + + /// + /// Override the automatic per-machine detection of MSI packages and force the package to be per-machine. + /// The default is "no", which allows the tools to detect the expected value. + /// + public YesNoType ForcePerMachine + { + get + { + return this.forcePerMachineField; + } + set + { + this.forcePerMachineFieldSet = true; + this.forcePerMachineField = value; + } + } + + /// + /// This attribute has been deprecated. When the value is "yes", the Binder will not read the MSI package + /// to detect uncompressed files that would otherwise be automatically included in the Bundle as Payloads. + /// The resulting Bundle may not be able to install the MSI package correctly. The default is "no". + /// + public YesNoType SuppressLooseFilePayloadGeneration + { + get + { + return this.suppressLooseFilePayloadGenerationField; + } + set + { + this.suppressLooseFilePayloadGenerationFieldSet = true; + this.suppressLooseFilePayloadGenerationField = value; + } + } + + /// + /// Specifies whether the MSI will be displayed in Programs and Features (also known as Add/Remove Programs). If "yes" is + /// specified the MSI package information will be displayed in Programs and Features. The default "no" indicates the MSI + /// will not be displayed. + /// + public YesNoType Visible + { + get + { + return this.visibleField; + } + set + { + this.visibleFieldSet = true; + this.visibleField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiProperty" == childName)) + { + childValue = new MsiProperty(); + } + if (("SlipstreamMsp" == childName)) + { + childValue = new SlipstreamMsp(); + } + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiPackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.enableFeatureSelectionFieldSet) + { + if ((this.enableFeatureSelectionField == YesNoType.no)) + { + writer.WriteAttributeString("EnableFeatureSelection", "no"); + } + if ((this.enableFeatureSelectionField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableFeatureSelection", "yes"); + } + } + if (this.forcePerMachineFieldSet) + { + if ((this.forcePerMachineField == YesNoType.no)) + { + writer.WriteAttributeString("ForcePerMachine", "no"); + } + if ((this.forcePerMachineField == YesNoType.yes)) + { + writer.WriteAttributeString("ForcePerMachine", "yes"); + } + } + if (this.suppressLooseFilePayloadGenerationFieldSet) + { + if ((this.suppressLooseFilePayloadGenerationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressLooseFilePayloadGeneration", "no"); + } + if ((this.suppressLooseFilePayloadGenerationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressLooseFilePayloadGeneration", "yes"); + } + } + if (this.visibleFieldSet) + { + if ((this.visibleField == YesNoType.no)) + { + writer.WriteAttributeString("Visible", "no"); + } + if ((this.visibleField == YesNoType.yes)) + { + writer.WriteAttributeString("Visible", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("EnableFeatureSelection" == name)) + { + this.enableFeatureSelectionField = Enums.ParseYesNoType(value); + this.enableFeatureSelectionFieldSet = true; + } + if (("ForcePerMachine" == name)) + { + this.forcePerMachineField = Enums.ParseYesNoType(value); + this.forcePerMachineFieldSet = true; + } + if (("SuppressLooseFilePayloadGeneration" == name)) + { + this.suppressLooseFilePayloadGenerationField = Enums.ParseYesNoType(value); + this.suppressLooseFilePayloadGenerationFieldSet = true; + } + if (("Visible" == name)) + { + this.visibleField = Enums.ParseYesNoType(value); + this.visibleFieldSet = true; + } + } + } + + /// + /// Describes a single msp package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MspPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private YesNoDefaultType perMachineField; + + private bool perMachineFieldSet; + + private YesNoType slipstreamField; + + private bool slipstreamFieldSet; + + private ISchemaElement parentElement; + + public MspPackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiProperty))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// Indicates the package must be executed elevated. The default is "no". + /// + public YesNoDefaultType PerMachine + { + get + { + return this.perMachineField; + } + set + { + this.perMachineFieldSet = true; + this.perMachineField = value; + } + } + + /// + /// Specifies whether to automatically slipstream the patch for any target msi packages in the chain. The default is "no". + /// Even when the value is "no", you can still author the SlipstreamMsp element under MsiPackage elements as desired. + /// + public YesNoType Slipstream + { + get + { + return this.slipstreamField; + } + set + { + this.slipstreamFieldSet = true; + this.slipstreamField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiProperty" == childName)) + { + childValue = new MsiProperty(); + } + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MspPackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.perMachineFieldSet) + { + if ((this.perMachineField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("PerMachine", "default"); + } + if ((this.perMachineField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("PerMachine", "no"); + } + if ((this.perMachineField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("PerMachine", "yes"); + } + } + if (this.slipstreamFieldSet) + { + if ((this.slipstreamField == YesNoType.no)) + { + writer.WriteAttributeString("Slipstream", "no"); + } + if ((this.slipstreamField == YesNoType.yes)) + { + writer.WriteAttributeString("Slipstream", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("PerMachine" == name)) + { + this.perMachineField = Enums.ParseYesNoDefaultType(value); + this.perMachineFieldSet = true; + } + if (("Slipstream" == name)) + { + this.slipstreamField = Enums.ParseYesNoType(value); + this.slipstreamFieldSet = true; + } + } + } + + /// + /// Describes a single msu package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsuPackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private string detectConditionField; + + private bool detectConditionFieldSet; + + private string kBField; + + private bool kBFieldSet; + + private ISchemaElement parentElement; + + public MsuPackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackagePayload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// A condition that determines if the package is present on the target system. This condition can use built-in + /// variables and variables returned by searches. This condition is necessary because Windows doesn't provide a + /// method to detect the presence of an MsuPackage. Burn uses this condition to determine how to treat this + /// package during a bundle action; for example, if this condition is false or omitted and the bundle is being + /// installed, Burn will install this package. + /// + public string DetectCondition + { + get + { + return this.detectConditionField; + } + set + { + this.detectConditionFieldSet = true; + this.detectConditionField = value; + } + } + + /// + /// The knowledge base identifier for the MSU. The KB attribute must be specified to enable the MSU package to + /// be uninstalled. Even then MSU uninstallation is only supported on Windows 7 and later. When the KB attribute + /// is specified, the Permanent attribute will the control whether the package is uninstalled. + /// + public string KB + { + get + { + return this.kBField; + } + set + { + this.kBFieldSet = true; + this.kBField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if (("MsuPackagePayload" == childName)) + { + childValue = new MsuPackagePayload(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsuPackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.detectConditionFieldSet) + { + writer.WriteAttributeString("DetectCondition", this.detectConditionField); + } + if (this.kBFieldSet) + { + writer.WriteAttributeString("KB", this.kBField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("DetectCondition" == name)) + { + this.detectConditionField = value; + this.detectConditionFieldSet = true; + } + if (("KB" == name)) + { + this.kBField = value; + this.kBFieldSet = true; + } + } + } + + /// + /// Describes a single exe package to install. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExePackage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string installSizeField; + + private bool installSizeFieldSet; + + private string installConditionField; + + private bool installConditionFieldSet; + + private YesNoAlwaysType cacheField; + + private bool cacheFieldSet; + + private string cacheIdField; + + private bool cacheIdFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string logPathVariableField; + + private bool logPathVariableFieldSet; + + private string rollbackLogPathVariableField; + + private bool rollbackLogPathVariableFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private string detectConditionField; + + private bool detectConditionFieldSet; + + private string installCommandField; + + private bool installCommandFieldSet; + + private string repairCommandField; + + private bool repairCommandFieldSet; + + private string uninstallCommandField; + + private bool uninstallCommandFieldSet; + + private YesNoDefaultType perMachineField; + + private bool perMachineFieldSet; + + private BurnExeProtocolType protocolField; + + private bool protocolFieldSet; + + private ISchemaElement parentElement; + + public ExePackage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackagePayload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExitCode))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CommandLine))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Location of the package to add to the bundle. The default value is the Name attribute, if provided. + /// At a minimum, the SourceFile or Name attribute must be specified. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this chain payload. Use this attribute to rename the + /// chain entry point or extract it into a subfolder. The default value is the file name from the + /// SourceFile attribute, if provided. At a minimum, the Name or SourceFile attribute must be specified. + /// The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// Identifier for this package, for ordering and cross-referencing. The default is the Name attribute + /// modified to be suitable as an identifier (i.e. invalid characters are replaced with underscores). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of another package that this one should be installed after. By default the After + /// attribute is set to the previous sibling package in the Chain or PackageGroup element. If this + /// attribute is specified ensure that a cycle is not created explicitly or implicitly. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The size this package will take on disk in bytes after it is installed. By default, the binder will + /// calculate the install size by scanning the package (File table for MSIs, Payloads for EXEs) + /// and use the total for the install size of the package. + /// + public string InstallSize + { + get + { + return this.installSizeField; + } + set + { + this.installSizeFieldSet = true; + this.installSizeField = value; + } + } + + /// + /// A condition to evaluate before installing the package. The package will only be installed if the condition evaluates to true. If the condition evaluates to false and the bundle is being installed, repaired, or modified, the package will be uninstalled. + /// + public string InstallCondition + { + get + { + return this.installConditionField; + } + set + { + this.installConditionFieldSet = true; + this.installConditionField = value; + } + } + + /// + /// Whether to cache the package. The default is "yes". + /// + public YesNoAlwaysType Cache + { + get + { + return this.cacheField; + } + set + { + this.cacheFieldSet = true; + this.cacheField = value; + } + } + + /// + /// The identifier to use when caching the package. + /// + public string CacheId + { + get + { + return this.cacheIdField; + } + set + { + this.cacheIdFieldSet = true; + this.cacheIdField = value; + } + } + + /// + /// Specifies the display name to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the ProductName field from the version information, MsiPackages use the ProductName property, and MspPackages use + /// the DisplayName patch metadata property. Other package types must use this attribute to define a display name in the + /// bootstrapper application data manifest. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Specifies the description to place in the bootstrapper application data manifest for the package. By default, ExePackages + /// use the FileName field from the version information, MsiPackages use the ARPCOMMENTS property, and MspPackages use + /// the Description patch metadata property. Other package types must use this attribute to define a description in the + /// bootstrapper application data manifest. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file. An empty value will cause the variable to not + /// be set. The default is "WixBundleLog_[PackageId]" except for MSU packages which default to no logging. + /// + public string LogPathVariable + { + get + { + return this.logPathVariableField; + } + set + { + this.logPathVariableFieldSet = true; + this.logPathVariableField = value; + } + } + + /// + /// Name of a Variable that will hold the path to the log file used during rollback. An empty value will cause + /// the variable to not be set. The default is "WixBundleRollbackLog_[PackageId]" except for MSU packages which + /// default to no logging. + /// + public string RollbackLogPathVariable + { + get + { + return this.rollbackLogPathVariableField; + } + set + { + this.rollbackLogPathVariableFieldSet = true; + this.rollbackLogPathVariableField = value; + } + } + + /// + /// Specifies whether the package can be uninstalled. The default is "no". + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies whether the package must succeed for the chain to continue. The default "yes" + /// indicates that if the package fails then the chain will fail and rollback or stop. If + /// "no" is specified then the chain will continue even if the package reports failure. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Whether the package payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + /// + /// A condition that determines if the package is present on the target system. This condition can use built-in + /// variables and variables returned by searches. This condition is necessary because Windows doesn't provide a + /// method to detect the presence of an ExePackage. Burn uses this condition to determine how to treat this + /// package during a bundle action; for example, if this condition is false or omitted and the bundle is being + /// installed, Burn will install this package. + /// + public string DetectCondition + { + get + { + return this.detectConditionField; + } + set + { + this.detectConditionFieldSet = true; + this.detectConditionField = value; + } + } + + /// + /// The command-line arguments provided to the ExePackage during install. If this attribute is absent the executable will be launched with no command-line arguments. + /// + public string InstallCommand + { + get + { + return this.installCommandField; + } + set + { + this.installCommandFieldSet = true; + this.installCommandField = value; + } + } + + /// + /// The command-line arguments to specify to indicate a repair. If the executable package can be repaired but + /// does not require any special command-line arguments to do so then set the attribute's value to blank. To + /// indicate that the package does not support repair, omit this attribute. + /// + public string RepairCommand + { + get + { + return this.repairCommandField; + } + set + { + this.repairCommandFieldSet = true; + this.repairCommandField = value; + } + } + + /// + /// The command-line arguments provided to the ExePackage during uninstall. If this attribute is absent the executable will be launched with no command-line arguments. To prevent an ExePackage from being uninstalled set the Permanent attribute to "yes". + /// + public string UninstallCommand + { + get + { + return this.uninstallCommandField; + } + set + { + this.uninstallCommandFieldSet = true; + this.uninstallCommandField = value; + } + } + + /// + /// Indicates the package must be executed elevated. The default is "no". + /// + public YesNoDefaultType PerMachine + { + get + { + return this.perMachineField; + } + set + { + this.perMachineFieldSet = true; + this.perMachineField = value; + } + } + + /// + /// Indicates the communication protocol the package supports for extended progress and error reporting. The default is "none". + /// + public BurnExeProtocolType Protocol + { + get + { + return this.protocolField; + } + set + { + this.protocolFieldSet = true; + this.protocolField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if (("ExePackagePayload" == childName)) + { + childValue = new ExePackagePayload(); + } + if (("ExitCode" == childName)) + { + childValue = new ExitCode(); + } + if (("CommandLine" == childName)) + { + childValue = new CommandLine(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExePackage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.installSizeFieldSet) + { + writer.WriteAttributeString("InstallSize", this.installSizeField); + } + if (this.installConditionFieldSet) + { + writer.WriteAttributeString("InstallCondition", this.installConditionField); + } + if (this.cacheFieldSet) + { + if ((this.cacheField == YesNoAlwaysType.always)) + { + writer.WriteAttributeString("Cache", "always"); + } + if ((this.cacheField == YesNoAlwaysType.no)) + { + writer.WriteAttributeString("Cache", "no"); + } + if ((this.cacheField == YesNoAlwaysType.yes)) + { + writer.WriteAttributeString("Cache", "yes"); + } + } + if (this.cacheIdFieldSet) + { + writer.WriteAttributeString("CacheId", this.cacheIdField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.logPathVariableFieldSet) + { + writer.WriteAttributeString("LogPathVariable", this.logPathVariableField); + } + if (this.rollbackLogPathVariableFieldSet) + { + writer.WriteAttributeString("RollbackLogPathVariable", this.rollbackLogPathVariableField); + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + if (this.detectConditionFieldSet) + { + writer.WriteAttributeString("DetectCondition", this.detectConditionField); + } + if (this.installCommandFieldSet) + { + writer.WriteAttributeString("InstallCommand", this.installCommandField); + } + if (this.repairCommandFieldSet) + { + writer.WriteAttributeString("RepairCommand", this.repairCommandField); + } + if (this.uninstallCommandFieldSet) + { + writer.WriteAttributeString("UninstallCommand", this.uninstallCommandField); + } + if (this.perMachineFieldSet) + { + if ((this.perMachineField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("PerMachine", "default"); + } + if ((this.perMachineField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("PerMachine", "no"); + } + if ((this.perMachineField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("PerMachine", "yes"); + } + } + if (this.protocolFieldSet) + { + if ((this.protocolField == BurnExeProtocolType.none)) + { + writer.WriteAttributeString("Protocol", "none"); + } + if ((this.protocolField == BurnExeProtocolType.burn)) + { + writer.WriteAttributeString("Protocol", "burn"); + } + if ((this.protocolField == BurnExeProtocolType.netfx4)) + { + writer.WriteAttributeString("Protocol", "netfx4"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("InstallSize" == name)) + { + this.installSizeField = value; + this.installSizeFieldSet = true; + } + if (("InstallCondition" == name)) + { + this.installConditionField = value; + this.installConditionFieldSet = true; + } + if (("Cache" == name)) + { + this.cacheField = Enums.ParseYesNoAlwaysType(value); + this.cacheFieldSet = true; + } + if (("CacheId" == name)) + { + this.cacheIdField = value; + this.cacheIdFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("LogPathVariable" == name)) + { + this.logPathVariableField = value; + this.logPathVariableFieldSet = true; + } + if (("RollbackLogPathVariable" == name)) + { + this.rollbackLogPathVariableField = value; + this.rollbackLogPathVariableFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + if (("DetectCondition" == name)) + { + this.detectConditionField = value; + this.detectConditionFieldSet = true; + } + if (("InstallCommand" == name)) + { + this.installCommandField = value; + this.installCommandFieldSet = true; + } + if (("RepairCommand" == name)) + { + this.repairCommandField = value; + this.repairCommandFieldSet = true; + } + if (("UninstallCommand" == name)) + { + this.uninstallCommandField = value; + this.uninstallCommandFieldSet = true; + } + if (("PerMachine" == name)) + { + this.perMachineField = Enums.ParseYesNoDefaultType(value); + this.perMachineFieldSet = true; + } + if (("Protocol" == name)) + { + this.protocolField = Enums.ParseBurnExeProtocolType(value); + this.protocolFieldSet = true; + } + } + } + + /// + /// Describes a rollback boundary in the chain. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RollbackBoundary : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoType transactionField; + + private bool transactionFieldSet; + + private ISchemaElement parentElement; + + public RollbackBoundary() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for this rollback boundary, for ordering and cross-referencing. If this attribute is + /// not provided a stable identifier will be generated. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies whether the rollback boundary aborts the chain. The default "yes" indicates that if + /// the rollback boundary is encountered then the chain will fail and rollback or stop. If "no" + /// is specified then the chain should continue successfuly at the next rollback boundary. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// Specifies whether the rollback boundary is wrapped in an MSI transaction. The default is "no" + /// + public YesNoType Transaction + { + get + { + return this.transactionField; + } + set + { + this.transactionFieldSet = true; + this.transactionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RollbackBoundary", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.transactionFieldSet) + { + if ((this.transactionField == YesNoType.no)) + { + writer.WriteAttributeString("Transaction", "no"); + } + if ((this.transactionField == YesNoType.yes)) + { + writer.WriteAttributeString("Transaction", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Transaction" == name)) + { + this.transactionField = Enums.ParseYesNoType(value); + this.transactionFieldSet = true; + } + } + } + + /// + /// Describes a package group to a bootstrapper. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PackageGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PackageGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MspPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsuPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExePackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RollbackBoundary))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for package group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MsiPackage" == childName)) + { + childValue = new MsiPackage(); + } + if (("MspPackage" == childName)) + { + childValue = new MspPackage(); + } + if (("MsuPackage" == childName)) + { + childValue = new MsuPackage(); + } + if (("ExePackage" == childName)) + { + childValue = new ExePackage(); + } + if (("RollbackBoundary" == childName)) + { + childValue = new RollbackBoundary(); + } + if (("PackageGroupRef" == childName)) + { + childValue = new PackageGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PackageGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to PackageGroup element that exists inside a Bundle or Fragment element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PackageGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PackageGroup element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The identifier of a package that this group should be installed after. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PackageGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + } + } + + /// + /// Allows an MSI property to be set based on the value of a burn engine expression. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiProperty : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the MSI property to set. Burn controls the follow MSI properties so they cannot be set with MsiProperty: ACTION, ALLUSERS, REBOOT, REINSTALL, REINSTALLMODE + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value to set the property to. This string is evaluated by the burn engine and can be as simple as a burn engine variable reference or as complex as a full expression. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Specifies a patch included in the same bundle that is installed when the parent MSI package is installed. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SlipstreamMsp : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier for a MspPackage in the bundle. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SlipstreamMsp", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Describes a burn engine variable to define. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Variable : ISchemaElement, ISetAttributes + { + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType persistedField; + + private bool persistedFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + /// + /// Whether the value of the variable should be hidden. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// The name for the variable. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Whether the variable should be persisted. + /// + public YesNoType Persisted + { + get + { + return this.persistedField; + } + set + { + this.persistedFieldSet = true; + this.persistedField = value; + } + } + + /// + /// Starting value for the variable. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Type of the variable, inferred from the value if not specified. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + Variable.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + if (("numeric" == value)) + { + parsedValue = TypeType.numeric; + } + else + { + if (("version" == value)) + { + parsedValue = TypeType.version; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Variable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.persistedFieldSet) + { + if ((this.persistedField == YesNoType.no)) + { + writer.WriteAttributeString("Persisted", "no"); + } + if ((this.persistedField == YesNoType.yes)) + { + writer.WriteAttributeString("Persisted", "yes"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + if ((this.typeField == TypeType.numeric)) + { + writer.WriteAttributeString("Type", "numeric"); + } + if ((this.typeField == TypeType.version)) + { + writer.WriteAttributeString("Type", "version"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Persisted" == name)) + { + this.persistedField = Enums.ParseYesNoType(value); + this.persistedFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Variable.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + @string, + + numeric, + + version, + } + } + + /// + /// Representation of a file that contains one or more files. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Container : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private BurnContainerType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + public Container() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// The unique identifier for the container. If this attribute is not specified the Name attribute will be used. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The file name for this container. A relative path may be provided to place the container in a sub-folder of the bundle. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Indicates whether the container is "attached" to the bundle executable or placed external to the bundle extecutable as "detached". If + /// this attribute is not specified, the default is to create a detached container. + /// + public BurnContainerType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PackageGroupRef" == childName)) + { + childValue = new PackageGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Container", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == BurnContainerType.attached)) + { + writer.WriteAttributeString("Type", "attached"); + } + if ((this.typeField == BurnContainerType.detached)) + { + writer.WriteAttributeString("Type", "detached"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Enums.ParseBurnContainerType(value); + this.typeFieldSet = true; + } + } + } + + /// + /// Create a reference to an existing Container element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ContainerRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of Container element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ContainerRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Describes map of exit code returned from executable package to a bootstrapper behavior. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExitCode : ISchemaElement, ISetAttributes + { + + private int valueField; + + private bool valueFieldSet; + + private BehaviorType behaviorField; + + private bool behaviorFieldSet; + + private ISchemaElement parentElement; + + /// + /// Exit code returned from executable package. If no value is provided it means all values not explicitly set default to this behavior. + /// + public int Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Choose one of the supported behaviors error codes: success, error, scheduleReboot, forceReboot. + /// + public BehaviorType Behavior + { + get + { + return this.behaviorField; + } + set + { + this.behaviorFieldSet = true; + this.behaviorField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a BehaviorType from a string. + /// + public static BehaviorType ParseBehaviorType(string value) + { + BehaviorType parsedValue; + ExitCode.TryParseBehaviorType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a BehaviorType from a string. + /// + public static bool TryParseBehaviorType(string value, out BehaviorType parsedValue) + { + parsedValue = BehaviorType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("success" == value)) + { + parsedValue = BehaviorType.success; + } + else + { + if (("error" == value)) + { + parsedValue = BehaviorType.error; + } + else + { + if (("scheduleReboot" == value)) + { + parsedValue = BehaviorType.scheduleReboot; + } + else + { + if (("forceReboot" == value)) + { + parsedValue = BehaviorType.forceReboot; + } + else + { + parsedValue = BehaviorType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExitCode", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.behaviorFieldSet) + { + if ((this.behaviorField == BehaviorType.success)) + { + writer.WriteAttributeString("Behavior", "success"); + } + if ((this.behaviorField == BehaviorType.error)) + { + writer.WriteAttributeString("Behavior", "error"); + } + if ((this.behaviorField == BehaviorType.scheduleReboot)) + { + writer.WriteAttributeString("Behavior", "scheduleReboot"); + } + if ((this.behaviorField == BehaviorType.forceReboot)) + { + writer.WriteAttributeString("Behavior", "forceReboot"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Value" == name)) + { + this.valueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.valueFieldSet = true; + } + if (("Behavior" == name)) + { + this.behaviorField = ExitCode.ParseBehaviorType(value); + this.behaviorFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum BehaviorType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + success, + + error, + + scheduleReboot, + + forceReboot, + } + } + + /// + /// Describes additional, conditional command-line arguments for an ExePackage. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CommandLine : ISchemaElement, ISetAttributes + { + + private string installArgumentField; + + private bool installArgumentFieldSet; + + private string uninstallArgumentField; + + private bool uninstallArgumentFieldSet; + + private string repairArgumentField; + + private bool repairArgumentFieldSet; + + private string conditionField; + + private bool conditionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Additional command-line arguments to apply during package installation if Condition is true. + /// + public string InstallArgument + { + get + { + return this.installArgumentField; + } + set + { + this.installArgumentFieldSet = true; + this.installArgumentField = value; + } + } + + /// + /// Additional command-line arguments to apply during package uninstallation if Condition is true. + /// + public string UninstallArgument + { + get + { + return this.uninstallArgumentField; + } + set + { + this.uninstallArgumentFieldSet = true; + this.uninstallArgumentField = value; + } + } + + /// + /// Additional command-line arguments to apply during package repair if Condition is true. + /// + public string RepairArgument + { + get + { + return this.repairArgumentField; + } + set + { + this.repairArgumentFieldSet = true; + this.repairArgumentField = value; + } + } + + /// + /// The condition that controls whether the command-line arguments specified in the + /// InstallArgument, UninstallArgument, or RepairArgument attributes are appended to the + /// command line passed to the ExePackage. Which attribute is used depends on the + /// action being applied to the ExePackage. For example, when the ExePackage is + /// being installed, the InstallArgument attribute value is appended to the command + /// line when the ExePackage is executed. + /// + public string Condition + { + get + { + return this.conditionField; + } + set + { + this.conditionFieldSet = true; + this.conditionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CommandLine", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.installArgumentFieldSet) + { + writer.WriteAttributeString("InstallArgument", this.installArgumentField); + } + if (this.uninstallArgumentFieldSet) + { + writer.WriteAttributeString("UninstallArgument", this.uninstallArgumentField); + } + if (this.repairArgumentFieldSet) + { + writer.WriteAttributeString("RepairArgument", this.repairArgumentField); + } + if (this.conditionFieldSet) + { + writer.WriteAttributeString("Condition", this.conditionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("InstallArgument" == name)) + { + this.installArgumentField = value; + this.installArgumentFieldSet = true; + } + if (("UninstallArgument" == name)) + { + this.uninstallArgumentField = value; + this.uninstallArgumentFieldSet = true; + } + if (("RepairArgument" == name)) + { + this.repairArgumentField = value; + this.repairArgumentFieldSet = true; + } + if (("Condition" == name)) + { + this.conditionField = value; + this.conditionFieldSet = true; + } + } + } + + /// + /// Describes a payload to a bootstrapper. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Payload : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string downloadUrlField; + + private bool downloadUrlFieldSet; + + private YesNoType enableSignatureVerificationField; + + private bool enableSignatureVerificationFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of Payload element. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Whether the payload should be embedded in a container or left as an external payload. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// Location of the source file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// The destination path and file name for this payload. The default is the source file name. The use of '..' directories is not allowed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + public string DownloadUrl + { + get + { + return this.downloadUrlField; + } + set + { + this.downloadUrlFieldSet = true; + this.downloadUrlField = value; + } + } + + /// + /// By default, a Bundle will use the hash of a package to verify its contents. If this attribute is set to "yes" + /// and the package is signed with an Authenticode signature the Bundle will verify the contents of the package using the + /// signature instead. Beware that there are many real world issues with Windows verifying Authenticode signatures. + /// Since the Authenticode signatures are no more secure than hashing the packages directly, the default is "no". + /// + public YesNoType EnableSignatureVerification + { + get + { + return this.enableSignatureVerificationField; + } + set + { + this.enableSignatureVerificationFieldSet = true; + this.enableSignatureVerificationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Payload", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.downloadUrlFieldSet) + { + writer.WriteAttributeString("DownloadUrl", this.downloadUrlField); + } + if (this.enableSignatureVerificationFieldSet) + { + if ((this.enableSignatureVerificationField == YesNoType.no)) + { + writer.WriteAttributeString("EnableSignatureVerification", "no"); + } + if ((this.enableSignatureVerificationField == YesNoType.yes)) + { + writer.WriteAttributeString("EnableSignatureVerification", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DownloadUrl" == name)) + { + this.downloadUrlField = value; + this.downloadUrlFieldSet = true; + } + if (("EnableSignatureVerification" == name)) + { + this.enableSignatureVerificationField = Enums.ParseYesNoType(value); + this.enableSignatureVerificationFieldSet = true; + } + } + } + + /// + /// Describes a payload group to a bootstrapper. PayloadGroups referenced from within a Bundle are tied to the Bundle. + /// PayloadGroups referenced from a Fragment are tied to the context of whatever references them such as an ExePackage or MsiPackage. + /// It is possible to share a PayloadGroup between multiple Packages and/or a Bundle by creating multiple references to it. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PayloadGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PayloadGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Payload))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroupRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for payload group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Payload" == childName)) + { + childValue = new Payload(); + } + if (("PayloadGroupRef" == childName)) + { + childValue = new PayloadGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PayloadGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to PayloadGroup element that exists inside a Bundle or Fragment element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PayloadGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PayloadGroup element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PayloadGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + public class ExePackagePayload : RemotePayload + { + public ExePackagePayload() : base("ExePackagePayload") { } + } + + public class MsuPackagePayload : RemotePayload + { + public MsuPackagePayload() : base("MsuPackagePayload") { } + } + + /// + /// Describes information about a remote file payload that is not available at the time of building the bundle. + /// The parent must specify DownloadUrl and must not specify SourceFile when using this element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public abstract class RemotePayload : ISchemaElement, ISetAttributes + { + private string elementName; + + public RemotePayload(string elementName) + { + this.elementName = elementName; + } + + private string descriptionField; + + private bool descriptionFieldSet; + + private string hashField; + + private bool hashFieldSet; + + private string productNameField; + + private bool productNameFieldSet; + + private long sizeField; + + private bool sizeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Description of the file from version resources. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// SHA-1 hash of the RemotePayload. Include this attribute if the remote file is unsigned or SuppressSignatureVerification is set to Yes. + /// + public string Hash + { + get + { + return this.hashField; + } + set + { + this.hashFieldSet = true; + this.hashField = value; + } + } + + /// + /// Product name of the file from version resouces. + /// + public string ProductName + { + get + { + return this.productNameField; + } + set + { + this.productNameFieldSet = true; + this.productNameField = value; + } + } + + /// + /// Size of the remote file in bytes. + /// + public long Size + { + get + { + return this.sizeField; + } + set + { + this.sizeFieldSet = true; + this.sizeField = value; + } + } + + /// + /// Version of the remote file + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement(this.elementName, "http://wixtoolset.org/schemas/v4/wxs"); + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.hashFieldSet) + { + writer.WriteAttributeString("Hash", this.hashField); + } + if (this.productNameFieldSet) + { + writer.WriteAttributeString("ProductName", this.productNameField); + } + if (this.sizeFieldSet) + { + writer.WriteAttributeString("Size", this.sizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Hash" == name)) + { + this.hashField = value; + this.hashFieldSet = true; + } + if (("ProductName" == name)) + { + this.productNameField = value; + this.productNameFieldSet = true; + } + if (("Size" == name)) + { + this.sizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sizeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + } + } + + /// + /// Create a RelatedBundle element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RelatedBundle : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the RelatedBundle group. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The action to take on bundles related to this one. Detect is the default. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RelatedBundle.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Detect" == value)) + { + parsedValue = ActionType.Detect; + } + else + { + if (("Upgrade" == value)) + { + parsedValue = ActionType.Upgrade; + } + else + { + if (("Addon" == value)) + { + parsedValue = ActionType.Addon; + } + else + { + if (("Patch" == value)) + { + parsedValue = ActionType.Patch; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RelatedBundle", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.Detect)) + { + writer.WriteAttributeString("Action", "Detect"); + } + if ((this.actionField == ActionType.Upgrade)) + { + writer.WriteAttributeString("Action", "Upgrade"); + } + if ((this.actionField == ActionType.Addon)) + { + writer.WriteAttributeString("Action", "Addon"); + } + if ((this.actionField == ActionType.Patch)) + { + writer.WriteAttributeString("Action", "Patch"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RelatedBundle.ParseActionType(value); + this.actionFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Detect, + + Upgrade, + + Addon, + + Patch, + } + } + + /// + /// Defines the update for a Bundle. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Update : ISchemaElement, ISetAttributes + { + + private string locationField; + + private bool locationFieldSet; + + private ISchemaElement parentElement; + + /// + /// The absolute path or URL to check for an update bundle. Currently the engine provides this value + /// in the IBootstrapperApplication::OnDetectUpdateBegin() and otherwise ignores the value. In the + /// future the engine will be able to acquire an update bundle from the location and determine if it + /// is newer than the current executing bundle. + /// + public string Location + { + get + { + return this.locationField; + } + set + { + this.locationFieldSet = true; + this.locationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Update", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.locationFieldSet) + { + writer.WriteAttributeString("Location", this.locationField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Location" == name)) + { + this.locationField = value; + this.locationFieldSet = true; + } + } + } + + /// + /// The Package element is analogous to the main function in a C program. When linking, only one Package section + /// can be given to the linker to produce a successful result. Using this element creates an msi file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Package : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private ISchemaElement parentElement; + + public Package() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SummaryInformation))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComplianceCheck))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroup))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(InstanceTransforms))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(MajorUpgrade))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(MediaTemplate))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PackageCertificates))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCertificates))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Upgrade))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); + childCollection1.AddCollection(childCollection2); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The product code GUID for the product. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The code page integer value or web name for the resulting MSI. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// The decimal language ID (LCID) for the product. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The manufacturer of the product. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The descriptive name of the product. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The upgrade code GUID for the product. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// The product's version string. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SummaryInformation" == childName)) + { + childValue = new SummaryInformation(); + } + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("ComplianceCheck" == childName)) + { + childValue = new ComplianceCheck(); + } + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroup" == childName)) + { + childValue = new ComponentGroup(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("CustomAction" == childName)) + { + childValue = new CustomAction(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("CustomTable" == childName)) + { + childValue = new CustomTable(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("EmbeddedChainer" == childName)) + { + childValue = new EmbeddedChainer(); + } + if (("EmbeddedChainerRef" == childName)) + { + childValue = new EmbeddedChainerRef(); + } + if (("EnsureTable" == childName)) + { + childValue = new EnsureTable(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("InstanceTransforms" == childName)) + { + childValue = new InstanceTransforms(); + } + if (("MajorUpgrade" == childName)) + { + childValue = new MajorUpgrade(); + } + if (("Media" == childName)) + { + childValue = new Media(); + } + if (("MediaTemplate" == childName)) + { + childValue = new MediaTemplate(); + } + if (("PackageCertificates" == childName)) + { + childValue = new PackageCertificates(); + } + if (("PatchCertificates" == childName)) + { + childValue = new PatchCertificates(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("SetDirectory" == childName)) + { + childValue = new SetDirectory(); + } + if (("SetProperty" == childName)) + { + childValue = new SetProperty(); + } + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("UI" == childName)) + { + childValue = new UI(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if (("Upgrade" == childName)) + { + childValue = new Upgrade(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if (("InstallExecuteSequence" == childName)) + { + childValue = new InstallExecuteSequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("AdminExecuteSequence" == childName)) + { + childValue = new AdminExecuteSequence(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("AdvertiseExecuteSequence" == childName)) + { + childValue = new AdvertiseExecuteSequence(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Package", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + } + } + + /// + /// The Module element is analogous to the main function in a C program. When linking, only + /// one Module section can be given to the linker to produce a successful result. Using this + /// element creates an msm file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Module : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private ISchemaElement parentElement; + + public Module() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SummaryInformation))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Configuration))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Dependency))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Exclusion))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreModularization))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreTable))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Substitution))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + ElementCollection childCollection2 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection2.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); + childCollection1.AddCollection(childCollection2); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The name of the merge module (not the file name). + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The code page integer value or web name for the resulting MSM. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// The modularizaion Guid. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// The decimal language ID (LCID) of the merge module. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The major and minor versions of the merge module. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SummaryInformation" == childName)) + { + childValue = new SummaryInformation(); + } + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Configuration" == childName)) + { + childValue = new Configuration(); + } + if (("CustomAction" == childName)) + { + childValue = new CustomAction(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("CustomTable" == childName)) + { + childValue = new CustomTable(); + } + if (("Dependency" == childName)) + { + childValue = new Dependency(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("EmbeddedChainer" == childName)) + { + childValue = new EmbeddedChainer(); + } + if (("EmbeddedChainerRef" == childName)) + { + childValue = new EmbeddedChainerRef(); + } + if (("EnsureTable" == childName)) + { + childValue = new EnsureTable(); + } + if (("Exclusion" == childName)) + { + childValue = new Exclusion(); + } + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("IgnoreModularization" == childName)) + { + childValue = new IgnoreModularization(); + } + if (("IgnoreTable" == childName)) + { + childValue = new IgnoreTable(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("SetDirectory" == childName)) + { + childValue = new SetDirectory(); + } + if (("SetProperty" == childName)) + { + childValue = new SetProperty(); + } + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("Substitution" == childName)) + { + childValue = new Substitution(); + } + if (("UI" == childName)) + { + childValue = new UI(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if (("InstallExecuteSequence" == childName)) + { + childValue = new InstallExecuteSequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("AdminExecuteSequence" == childName)) + { + childValue = new AdminExecuteSequence(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("AdvertiseExecuteSequence" == childName)) + { + childValue = new AdvertiseExecuteSequence(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Module", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + } + } + + /// + /// Declares a dependency on another merge module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Dependency : ISchemaElement, ISetAttributes + { + + private string requiredIdField; + + private bool requiredIdFieldSet; + + private int requiredLanguageField; + + private bool requiredLanguageFieldSet; + + private string requiredVersionField; + + private bool requiredVersionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier of the merge module required by the merge module. + /// + public string RequiredId + { + get + { + return this.requiredIdField; + } + set + { + this.requiredIdFieldSet = true; + this.requiredIdField = value; + } + } + + /// + /// Numeric language ID of the merge module in RequiredID. + /// + public int RequiredLanguage + { + get + { + return this.requiredLanguageField; + } + set + { + this.requiredLanguageFieldSet = true; + this.requiredLanguageField = value; + } + } + + /// + /// Version of the merge module in RequiredID. + /// + public string RequiredVersion + { + get + { + return this.requiredVersionField; + } + set + { + this.requiredVersionFieldSet = true; + this.requiredVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Dependency", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.requiredIdFieldSet) + { + writer.WriteAttributeString("RequiredId", this.requiredIdField); + } + if (this.requiredLanguageFieldSet) + { + writer.WriteAttributeString("RequiredLanguage", this.requiredLanguageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.requiredVersionFieldSet) + { + writer.WriteAttributeString("RequiredVersion", this.requiredVersionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("RequiredId" == name)) + { + this.requiredIdField = value; + this.requiredIdFieldSet = true; + } + if (("RequiredLanguage" == name)) + { + this.requiredLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.requiredLanguageFieldSet = true; + } + if (("RequiredVersion" == name)) + { + this.requiredVersionField = value; + this.requiredVersionFieldSet = true; + } + } + } + + /// + /// Declares a merge module with which this merge module is incompatible. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Exclusion : ISchemaElement, ISetAttributes + { + + private string excludedIdField; + + private bool excludedIdFieldSet; + + private int excludeExceptLanguageField; + + private bool excludeExceptLanguageFieldSet; + + private int excludeLanguageField; + + private bool excludeLanguageFieldSet; + + private string excludedMinVersionField; + + private bool excludedMinVersionFieldSet; + + private string excludedMaxVersionField; + + private bool excludedMaxVersionFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier of the merge module that is incompatible. + /// + public string ExcludedId + { + get + { + return this.excludedIdField; + } + set + { + this.excludedIdFieldSet = true; + this.excludedIdField = value; + } + } + + /// + /// Numeric language ID of the merge module in ExcludedID. All except this language will be excluded. Only one of ExcludeExceptLanguage and ExcludeLanguage may be specified. + /// + public int ExcludeExceptLanguage + { + get + { + return this.excludeExceptLanguageField; + } + set + { + this.excludeExceptLanguageFieldSet = true; + this.excludeExceptLanguageField = value; + } + } + + /// + /// Numeric language ID of the merge module in ExcludedID. The specified language will be excluded. Only one of ExcludeExceptLanguage and ExcludeLanguage may be specified. + /// + public int ExcludeLanguage + { + get + { + return this.excludeLanguageField; + } + set + { + this.excludeLanguageFieldSet = true; + this.excludeLanguageField = value; + } + } + + /// + /// Minimum version excluded from a range. If not set, all versions before max are excluded. If neither max nor min, no exclusion based on version. + /// + public string ExcludedMinVersion + { + get + { + return this.excludedMinVersionField; + } + set + { + this.excludedMinVersionFieldSet = true; + this.excludedMinVersionField = value; + } + } + + /// + /// Maximum version excluded from a range. If not set, all versions after min are excluded. If neither max nor min, no exclusion based on version. + /// + public string ExcludedMaxVersion + { + get + { + return this.excludedMaxVersionField; + } + set + { + this.excludedMaxVersionFieldSet = true; + this.excludedMaxVersionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Exclusion", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.excludedIdFieldSet) + { + writer.WriteAttributeString("ExcludedId", this.excludedIdField); + } + if (this.excludeExceptLanguageFieldSet) + { + writer.WriteAttributeString("ExcludeExceptLanguage", this.excludeExceptLanguageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.excludeLanguageFieldSet) + { + writer.WriteAttributeString("ExcludeLanguage", this.excludeLanguageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.excludedMinVersionFieldSet) + { + writer.WriteAttributeString("ExcludedMinVersion", this.excludedMinVersionField); + } + if (this.excludedMaxVersionFieldSet) + { + writer.WriteAttributeString("ExcludedMaxVersion", this.excludedMaxVersionField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ExcludedId" == name)) + { + this.excludedIdField = value; + this.excludedIdFieldSet = true; + } + if (("ExcludeExceptLanguage" == name)) + { + this.excludeExceptLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.excludeExceptLanguageFieldSet = true; + } + if (("ExcludeLanguage" == name)) + { + this.excludeLanguageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.excludeLanguageFieldSet = true; + } + if (("ExcludedMinVersion" == name)) + { + this.excludedMinVersionField = value; + this.excludedMinVersionFieldSet = true; + } + if (("ExcludedMaxVersion" == name)) + { + this.excludedMaxVersionField = value; + this.excludedMaxVersionFieldSet = true; + } + } + } + + /// + /// Defines the configurable attributes of merge module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Configuration : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private FormatType formatField; + + private bool formatFieldSet; + + private string typeField; + + private bool typeFieldSet; + + private string contextDataField; + + private bool contextDataFieldSet; + + private string defaultValueField; + + private bool defaultValueFieldSet; + + private YesNoType keyNoOrphanField; + + private bool keyNoOrphanFieldSet; + + private YesNoType nonNullableField; + + private bool nonNullableFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string helpLocationField; + + private bool helpLocationFieldSet; + + private string helpKeywordField; + + private bool helpKeywordFieldSet; + + private ISchemaElement parentElement; + + /// + /// Defines the name of the configurable item. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Specifies the format of the data being changed. + /// + public FormatType Format + { + get + { + return this.formatField; + } + set + { + this.formatFieldSet = true; + this.formatField = value; + } + } + + /// + /// Specifies the type of the data being changed. + /// + public string Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Specifies a semantic context for the requested data. + /// + public string ContextData + { + get + { + return this.contextDataField; + } + set + { + this.contextDataFieldSet = true; + this.contextDataField = value; + } + } + + /// + /// Specifies a default value for the item in this record if the merge tool declines to provide a value. + /// + public string DefaultValue + { + get + { + return this.defaultValueField; + } + set + { + this.defaultValueFieldSet = true; + this.defaultValueField = value; + } + } + + /// + /// Does not merge rule according to rules in MSI SDK. + /// + public YesNoType KeyNoOrphan + { + get + { + return this.keyNoOrphanField; + } + set + { + this.keyNoOrphanFieldSet = true; + this.keyNoOrphanField = value; + } + } + + /// + /// If yes, null is not a valid entry. + /// + public YesNoType NonNullable + { + get + { + return this.nonNullableField; + } + set + { + this.nonNullableFieldSet = true; + this.nonNullableField = value; + } + } + + /// + /// Display name for authoring. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Description for authoring. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Location of chm file for authoring. + /// + public string HelpLocation + { + get + { + return this.helpLocationField; + } + set + { + this.helpLocationFieldSet = true; + this.helpLocationField = value; + } + } + + /// + /// Keyword into chm file for authoring. + /// + public string HelpKeyword + { + get + { + return this.helpKeywordField; + } + set + { + this.helpKeywordFieldSet = true; + this.helpKeywordField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a FormatType from a string. + /// + public static FormatType ParseFormatType(string value) + { + FormatType parsedValue; + Configuration.TryParseFormatType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a FormatType from a string. + /// + public static bool TryParseFormatType(string value, out FormatType parsedValue) + { + parsedValue = FormatType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Text" == value)) + { + parsedValue = FormatType.Text; + } + else + { + if (("Key" == value)) + { + parsedValue = FormatType.Key; + } + else + { + if (("Integer" == value)) + { + parsedValue = FormatType.Integer; + } + else + { + if (("Bitfield" == value)) + { + parsedValue = FormatType.Bitfield; + } + else + { + parsedValue = FormatType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Configuration", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.formatFieldSet) + { + if ((this.formatField == FormatType.Text)) + { + writer.WriteAttributeString("Format", "Text"); + } + if ((this.formatField == FormatType.Key)) + { + writer.WriteAttributeString("Format", "Key"); + } + if ((this.formatField == FormatType.Integer)) + { + writer.WriteAttributeString("Format", "Integer"); + } + if ((this.formatField == FormatType.Bitfield)) + { + writer.WriteAttributeString("Format", "Bitfield"); + } + } + if (this.typeFieldSet) + { + writer.WriteAttributeString("Type", this.typeField); + } + if (this.contextDataFieldSet) + { + writer.WriteAttributeString("ContextData", this.contextDataField); + } + if (this.defaultValueFieldSet) + { + writer.WriteAttributeString("DefaultValue", this.defaultValueField); + } + if (this.keyNoOrphanFieldSet) + { + if ((this.keyNoOrphanField == YesNoType.no)) + { + writer.WriteAttributeString("KeyNoOrphan", "no"); + } + if ((this.keyNoOrphanField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyNoOrphan", "yes"); + } + } + if (this.nonNullableFieldSet) + { + if ((this.nonNullableField == YesNoType.no)) + { + writer.WriteAttributeString("NonNullable", "no"); + } + if ((this.nonNullableField == YesNoType.yes)) + { + writer.WriteAttributeString("NonNullable", "yes"); + } + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.helpLocationFieldSet) + { + writer.WriteAttributeString("HelpLocation", this.helpLocationField); + } + if (this.helpKeywordFieldSet) + { + writer.WriteAttributeString("HelpKeyword", this.helpKeywordField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Format" == name)) + { + this.formatField = Configuration.ParseFormatType(value); + this.formatFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = value; + this.typeFieldSet = true; + } + if (("ContextData" == name)) + { + this.contextDataField = value; + this.contextDataFieldSet = true; + } + if (("DefaultValue" == name)) + { + this.defaultValueField = value; + this.defaultValueFieldSet = true; + } + if (("KeyNoOrphan" == name)) + { + this.keyNoOrphanField = Enums.ParseYesNoType(value); + this.keyNoOrphanFieldSet = true; + } + if (("NonNullable" == name)) + { + this.nonNullableField = Enums.ParseYesNoType(value); + this.nonNullableFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("HelpLocation" == name)) + { + this.helpLocationField = value; + this.helpLocationFieldSet = true; + } + if (("HelpKeyword" == name)) + { + this.helpKeywordField = value; + this.helpKeywordFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum FormatType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Text, + + Key, + + Integer, + + Bitfield, + } + } + + /// + /// Specifies the configurable fields of a module database and provides a template for the configuration of each field. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Substitution : ISchemaElement, ISetAttributes + { + + private string tableField; + + private bool tableFieldSet; + + private string rowField; + + private bool rowFieldSet; + + private string columnField; + + private bool columnFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the name of the table being modified in the module database. + /// + public string Table + { + get + { + return this.tableField; + } + set + { + this.tableFieldSet = true; + this.tableField = value; + } + } + + /// + /// Specifies the primary keys of the target row in the table named in the Table column. If multiple keys, separated by semicolons. + /// + public string Row + { + get + { + return this.rowField; + } + set + { + this.rowFieldSet = true; + this.rowField = value; + } + } + + /// + /// Specifies the target column in the row named in the Row column. + /// + public string Column + { + get + { + return this.columnField; + } + set + { + this.columnFieldSet = true; + this.columnField = value; + } + } + + /// + /// Provides a formatting template for the data being substituted into the target field specified by Table, Row, and Column. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Substitution", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.tableFieldSet) + { + writer.WriteAttributeString("Table", this.tableField); + } + if (this.rowFieldSet) + { + writer.WriteAttributeString("Row", this.rowField); + } + if (this.columnFieldSet) + { + writer.WriteAttributeString("Column", this.columnField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Table" == name)) + { + this.tableField = value; + this.tableFieldSet = true; + } + if (("Row" == name)) + { + this.rowField = value; + this.rowFieldSet = true; + } + if (("Column" == name)) + { + this.columnField = value; + this.columnFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Specifies a table from the merge module that is not merged into an .msi file. + /// If the table already exists in an .msi file, it is not modified by the merge. + /// The specified table can therefore contain data that is unneeded after the merge. + /// To minimize the size of the .msm file, it is recommended that developers remove + /// unused tables from modules intended for redistribution rather than creating + /// IgnoreTable elements for those tables. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IgnoreTable : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the table in the merge module that is not to be merged into the .msi file. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IgnoreTable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The Fragment element is the building block of creating an installer database in WiX. Once defined, + /// the Fragment becomes an immutable, atomic unit which can either be completely included or excluded + /// from a product. The contents of a Fragment element can be linked into a product by utilizing one + /// of the many *Ref elements. When linking in a Fragment, it will be necessary to link in all of its + /// individual units. For instance, if a given Fragment contains two Component elements, you must link + /// both under features using ComponentRef for each linked Component. Otherwise, you will get a linker + /// warning and have a floating Component that does not appear under any Feature. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Fragment : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public Fragment() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplication))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BootstrapperApplicationRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComplianceCheck))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Container))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomAction))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CustomTable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainer))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedChainerRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EnsureTable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreModularization))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MediaTemplate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PackageCertificates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchCertificates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PayloadGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RelatedBundle))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetDirectory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetProperty))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UI))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Upgrade))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Variable))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WixVariable))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallExecuteSequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminExecuteSequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdvertiseExecuteSequence))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Optional identifier for a Fragment. Should only be set by advanced users to tag sections. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("BootstrapperApplication" == childName)) + { + childValue = new BootstrapperApplication(); + } + if (("BootstrapperApplicationRef" == childName)) + { + childValue = new BootstrapperApplicationRef(); + } + if (("ComplianceCheck" == childName)) + { + childValue = new ComplianceCheck(); + } + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroup" == childName)) + { + childValue = new ComponentGroup(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("Container" == childName)) + { + childValue = new Container(); + } + if (("CustomAction" == childName)) + { + childValue = new CustomAction(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("CustomTable" == childName)) + { + childValue = new CustomTable(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("EmbeddedChainer" == childName)) + { + childValue = new EmbeddedChainer(); + } + if (("EmbeddedChainerRef" == childName)) + { + childValue = new EmbeddedChainerRef(); + } + if (("EnsureTable" == childName)) + { + childValue = new EnsureTable(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureGroup" == childName)) + { + childValue = new FeatureGroup(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("IgnoreModularization" == childName)) + { + childValue = new IgnoreModularization(); + } + if (("Media" == childName)) + { + childValue = new Media(); + } + if (("MediaTemplate" == childName)) + { + childValue = new MediaTemplate(); + } + if (("PackageGroup" == childName)) + { + childValue = new PackageGroup(); + } + if (("PackageCertificates" == childName)) + { + childValue = new PackageCertificates(); + } + if (("PatchCertificates" == childName)) + { + childValue = new PatchCertificates(); + } + if (("PatchFamily" == childName)) + { + childValue = new PatchFamily(); + } + if (("PatchFamilyGroup" == childName)) + { + childValue = new PatchFamilyGroup(); + } + if (("PayloadGroup" == childName)) + { + childValue = new PayloadGroup(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("RelatedBundle" == childName)) + { + childValue = new RelatedBundle(); + } + if (("SetDirectory" == childName)) + { + childValue = new SetDirectory(); + } + if (("SetProperty" == childName)) + { + childValue = new SetProperty(); + } + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("UI" == childName)) + { + childValue = new UI(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if (("Upgrade" == childName)) + { + childValue = new Upgrade(); + } + if (("Variable" == childName)) + { + childValue = new Variable(); + } + if (("WixVariable" == childName)) + { + childValue = new WixVariable(); + } + if (("InstallExecuteSequence" == childName)) + { + childValue = new InstallExecuteSequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("AdminExecuteSequence" == childName)) + { + childValue = new AdminExecuteSequence(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("AdvertiseExecuteSequence" == childName)) + { + childValue = new AdvertiseExecuteSequence(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Fragment", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The Patch element is analogous to the main function in a C program. When linking, only one Patch section + /// can be given to the linker to produce a successful result. Using this element creates an MSP file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Patch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private YesNoType allowRemovalField; + + private bool allowRemovalFieldSet; + + private string classificationField; + + private bool classificationFieldSet; + + private string clientPatchIdField; + + private bool clientPatchIdFieldSet; + + private YesNoType apiPatchingSymbolNoImagehlpFlagField; + + private bool apiPatchingSymbolNoImagehlpFlagFieldSet; + + private YesNoType apiPatchingSymbolNoFailuresFlagField; + + private bool apiPatchingSymbolNoFailuresFlagFieldSet; + + private YesNoType apiPatchingSymbolUndecoratedTooFlagField; + + private bool apiPatchingSymbolUndecoratedTooFlagFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string commentsField; + + private bool commentsFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private YesNoType minorUpdateTargetRTMField; + + private bool minorUpdateTargetRTMFieldSet; + + private string moreInfoURLField; + + private bool moreInfoURLFieldSet; + + private YesNoType optimizedInstallModeField; + + private bool optimizedInstallModeFieldSet; + + private string targetProductNameField; + + private bool targetProductNameFieldSet; + + private YesNoType optimizePatchSizeForLargeFilesField; + + private bool optimizePatchSizeForLargeFilesFieldSet; + + private ISchemaElement parentElement; + + public Patch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchInformation))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Media))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(OptimizeCustomActions))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroup))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroupRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCodes))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Patch code for this patch. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The code page integer value or web name for the resulting MSP. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// Whether this is an uninstallable patch. + /// + public YesNoType AllowRemoval + { + get + { + return this.allowRemovalField; + } + set + { + this.allowRemovalFieldSet = true; + this.allowRemovalField = value; + } + } + + /// + /// Category of updates. Recommended values are Critical Update, Hotfix, Security Rollup, Security Update, Service Pack, Update, Update Rollup. + /// + public string Classification + { + get + { + return this.classificationField; + } + set + { + this.classificationFieldSet = true; + this.classificationField = value; + } + } + + /// + /// An easily referenced identity unique to a patch that can be used in product authoring. See remarks for more information. + /// + public string ClientPatchId + { + get + { + return this.clientPatchIdField; + } + set + { + this.clientPatchIdFieldSet = true; + this.clientPatchIdField = value; + } + } + + /// + /// Flag used when creating a binary file patch. Default is "no". Don't use imagehlp.dll. + /// + public YesNoType ApiPatchingSymbolNoImagehlpFlag + { + get + { + return this.apiPatchingSymbolNoImagehlpFlagField; + } + set + { + this.apiPatchingSymbolNoImagehlpFlagFieldSet = true; + this.apiPatchingSymbolNoImagehlpFlagField = value; + } + } + + /// + /// Flag used when creating a binary file patch. Default is "no". Don't fail patch due to imagehlp failures. + /// + public YesNoType ApiPatchingSymbolNoFailuresFlag + { + get + { + return this.apiPatchingSymbolNoFailuresFlagField; + } + set + { + this.apiPatchingSymbolNoFailuresFlagFieldSet = true; + this.apiPatchingSymbolNoFailuresFlagField = value; + } + } + + /// + /// Flag used when creating a binary file patch. Default is "no". After matching decorated symbols, try to match remaining by undecorated names. + /// + public YesNoType ApiPatchingSymbolUndecoratedTooFlag + { + get + { + return this.apiPatchingSymbolUndecoratedTooFlagField; + } + set + { + this.apiPatchingSymbolUndecoratedTooFlagFieldSet = true; + this.apiPatchingSymbolUndecoratedTooFlagField = value; + } + } + + /// + /// Description of the patch. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// A title for the patch that is suitable for public display. In Add/Remove Programs from XP SP2 on. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Optional comments for browsing. + /// + public string Comments + { + get + { + return this.commentsField; + } + set + { + this.commentsFieldSet = true; + this.commentsField = value; + } + } + + /// + /// Vendor releasing the package + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// Indicates that the patch targets the RTM version of the product or the most recent major + /// upgrade patch. Author this optional property in minor update patches that contain sequencing + /// information to indicate that the patch removes all patches up to the RTM version of the + /// product, or up to the most recent major upgrade patch. This property is available beginning + /// with Windows Installer 3.1. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType MinorUpdateTargetRTM + { + get + { + return this.minorUpdateTargetRTMField; + } + set + { + this.minorUpdateTargetRTMFieldSet = true; + this.minorUpdateTargetRTMField = value; + } + } + + /// + /// A URL that provides information specific to this patch. In Add/Remove Programs from XP SP2 on. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string MoreInfoURL + { + get + { + return this.moreInfoURLField; + } + set + { + this.moreInfoURLFieldSet = true; + this.moreInfoURLField = value; + } + } + + /// + /// If this attribute is set to 'yes' in all the patches to be applied in a transaction, the + /// application of the patch is optimized if possible. Available beginning with Windows Installer 3.1. + /// + public YesNoType OptimizedInstallMode + { + get + { + return this.optimizedInstallModeField; + } + set + { + this.optimizedInstallModeFieldSet = true; + this.optimizedInstallModeField = value; + } + } + + /// + /// Name of the application or target product suite. + /// + public string TargetProductName + { + get + { + return this.targetProductNameField; + } + set + { + this.targetProductNameFieldSet = true; + this.targetProductNameField = value; + } + } + + /// + /// When this attribute is set, patches for files greater than approximately 4 MB in size may be made smaller. + /// + public YesNoType OptimizePatchSizeForLargeFiles + { + get + { + return this.optimizePatchSizeForLargeFilesField; + } + set + { + this.optimizePatchSizeForLargeFilesFieldSet = true; + this.optimizePatchSizeForLargeFilesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PatchInformation" == childName)) + { + childValue = new PatchInformation(); + } + if (("Media" == childName)) + { + childValue = new Media(); + } + if (("OptimizeCustomActions" == childName)) + { + childValue = new OptimizeCustomActions(); + } + if (("PatchFamily" == childName)) + { + childValue = new PatchFamily(); + } + if (("PatchFamilyRef" == childName)) + { + childValue = new PatchFamilyRef(); + } + if (("PatchFamilyGroup" == childName)) + { + childValue = new PatchFamilyGroup(); + } + if (("PatchFamilyGroupRef" == childName)) + { + childValue = new PatchFamilyGroupRef(); + } + if (("PatchProperty" == childName)) + { + childValue = new PatchProperty(); + } + if (("TargetProductCodes" == childName)) + { + childValue = new TargetProductCodes(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Patch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.allowRemovalFieldSet) + { + if ((this.allowRemovalField == YesNoType.no)) + { + writer.WriteAttributeString("AllowRemoval", "no"); + } + if ((this.allowRemovalField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowRemoval", "yes"); + } + } + if (this.classificationFieldSet) + { + writer.WriteAttributeString("Classification", this.classificationField); + } + if (this.clientPatchIdFieldSet) + { + writer.WriteAttributeString("ClientPatchId", this.clientPatchIdField); + } + if (this.apiPatchingSymbolNoImagehlpFlagFieldSet) + { + if ((this.apiPatchingSymbolNoImagehlpFlagField == YesNoType.no)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoImagehlpFlag", "no"); + } + if ((this.apiPatchingSymbolNoImagehlpFlagField == YesNoType.yes)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoImagehlpFlag", "yes"); + } + } + if (this.apiPatchingSymbolNoFailuresFlagFieldSet) + { + if ((this.apiPatchingSymbolNoFailuresFlagField == YesNoType.no)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoFailuresFlag", "no"); + } + if ((this.apiPatchingSymbolNoFailuresFlagField == YesNoType.yes)) + { + writer.WriteAttributeString("ApiPatchingSymbolNoFailuresFlag", "yes"); + } + } + if (this.apiPatchingSymbolUndecoratedTooFlagFieldSet) + { + if ((this.apiPatchingSymbolUndecoratedTooFlagField == YesNoType.no)) + { + writer.WriteAttributeString("ApiPatchingSymbolUndecoratedTooFlag", "no"); + } + if ((this.apiPatchingSymbolUndecoratedTooFlagField == YesNoType.yes)) + { + writer.WriteAttributeString("ApiPatchingSymbolUndecoratedTooFlag", "yes"); + } + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.commentsFieldSet) + { + writer.WriteAttributeString("Comments", this.commentsField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.minorUpdateTargetRTMFieldSet) + { + if ((this.minorUpdateTargetRTMField == YesNoType.no)) + { + writer.WriteAttributeString("MinorUpdateTargetRTM", "no"); + } + if ((this.minorUpdateTargetRTMField == YesNoType.yes)) + { + writer.WriteAttributeString("MinorUpdateTargetRTM", "yes"); + } + } + if (this.moreInfoURLFieldSet) + { + writer.WriteAttributeString("MoreInfoURL", this.moreInfoURLField); + } + if (this.optimizedInstallModeFieldSet) + { + if ((this.optimizedInstallModeField == YesNoType.no)) + { + writer.WriteAttributeString("OptimizedInstallMode", "no"); + } + if ((this.optimizedInstallModeField == YesNoType.yes)) + { + writer.WriteAttributeString("OptimizedInstallMode", "yes"); + } + } + if (this.targetProductNameFieldSet) + { + writer.WriteAttributeString("TargetProductName", this.targetProductNameField); + } + if (this.optimizePatchSizeForLargeFilesFieldSet) + { + if ((this.optimizePatchSizeForLargeFilesField == YesNoType.no)) + { + writer.WriteAttributeString("OptimizePatchSizeForLargeFiles", "no"); + } + if ((this.optimizePatchSizeForLargeFilesField == YesNoType.yes)) + { + writer.WriteAttributeString("OptimizePatchSizeForLargeFiles", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("AllowRemoval" == name)) + { + this.allowRemovalField = Enums.ParseYesNoType(value); + this.allowRemovalFieldSet = true; + } + if (("Classification" == name)) + { + this.classificationField = value; + this.classificationFieldSet = true; + } + if (("ClientPatchId" == name)) + { + this.clientPatchIdField = value; + this.clientPatchIdFieldSet = true; + } + if (("ApiPatchingSymbolNoImagehlpFlag" == name)) + { + this.apiPatchingSymbolNoImagehlpFlagField = Enums.ParseYesNoType(value); + this.apiPatchingSymbolNoImagehlpFlagFieldSet = true; + } + if (("ApiPatchingSymbolNoFailuresFlag" == name)) + { + this.apiPatchingSymbolNoFailuresFlagField = Enums.ParseYesNoType(value); + this.apiPatchingSymbolNoFailuresFlagFieldSet = true; + } + if (("ApiPatchingSymbolUndecoratedTooFlag" == name)) + { + this.apiPatchingSymbolUndecoratedTooFlagField = Enums.ParseYesNoType(value); + this.apiPatchingSymbolUndecoratedTooFlagFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Comments" == name)) + { + this.commentsField = value; + this.commentsFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("MinorUpdateTargetRTM" == name)) + { + this.minorUpdateTargetRTMField = Enums.ParseYesNoType(value); + this.minorUpdateTargetRTMFieldSet = true; + } + if (("MoreInfoURL" == name)) + { + this.moreInfoURLField = value; + this.moreInfoURLFieldSet = true; + } + if (("OptimizedInstallMode" == name)) + { + this.optimizedInstallModeField = Enums.ParseYesNoType(value); + this.optimizedInstallModeFieldSet = true; + } + if (("TargetProductName" == name)) + { + this.targetProductNameField = value; + this.targetProductNameFieldSet = true; + } + if (("OptimizePatchSizeForLargeFiles" == name)) + { + this.optimizePatchSizeForLargeFilesField = Enums.ParseYesNoType(value); + this.optimizePatchSizeForLargeFilesFieldSet = true; + } + } + } + + /// + /// Sets information in the patch transform that determines if the transform applies to an installed product and what errors should be ignored when applying the patch transform. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Validate : ISchemaElement, ISetAttributes + { + + private YesNoType productIdField; + + private bool productIdFieldSet; + + private YesNoType productLanguageField; + + private bool productLanguageFieldSet; + + private ProductVersionType productVersionField; + + private bool productVersionFieldSet; + + private ProductVersionOperatorType productVersionOperatorField; + + private bool productVersionOperatorFieldSet; + + private YesNoType upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private YesNoType ignoreAddExistingRowField; + + private bool ignoreAddExistingRowFieldSet; + + private YesNoType ignoreAddExistingTableField; + + private bool ignoreAddExistingTableFieldSet; + + private YesNoType ignoreDeleteMissingRowField; + + private bool ignoreDeleteMissingRowFieldSet; + + private YesNoType ignoreDeleteMissingTableField; + + private bool ignoreDeleteMissingTableFieldSet; + + private YesNoType ignoreUpdateMissingRowField; + + private bool ignoreUpdateMissingRowFieldSet; + + private YesNoType ignoreChangingCodePageField; + + private bool ignoreChangingCodePageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Requires that the installed ProductCode match the target ProductCode used to create the transform. The default is 'yes'. + /// + public YesNoType ProductId + { + get + { + return this.productIdField; + } + set + { + this.productIdFieldSet = true; + this.productIdField = value; + } + } + + /// + /// Requires that the installed ProductLanguage match the target ProductLanguage used to create the transform. The default is 'no'. + /// + public YesNoType ProductLanguage + { + get + { + return this.productLanguageField; + } + set + { + this.productLanguageFieldSet = true; + this.productLanguageField = value; + } + } + + /// + /// Determines how many fields of the installed ProductVersion to compare. See remarks for more information. The default is 'Update'. + /// + public ProductVersionType ProductVersion + { + get + { + return this.productVersionField; + } + set + { + this.productVersionFieldSet = true; + this.productVersionField = value; + } + } + + /// + /// Determines how the installed ProductVersion is compared to the target ProductVersion used to create the transform. See remarks for more information. The default is 'Equal'. + /// + public ProductVersionOperatorType ProductVersionOperator + { + get + { + return this.productVersionOperatorField; + } + set + { + this.productVersionOperatorFieldSet = true; + this.productVersionOperatorField = value; + } + } + + /// + /// Requires that the installed UpgradeCode match the target UpgradeCode used to create the transform. The default is 'yes'. + /// + public YesNoType UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + /// + /// Ignore errors when adding existing rows. The default is 'yes'. + /// + public YesNoType IgnoreAddExistingRow + { + get + { + return this.ignoreAddExistingRowField; + } + set + { + this.ignoreAddExistingRowFieldSet = true; + this.ignoreAddExistingRowField = value; + } + } + + /// + /// Ignore errors when adding existing tables. The default is 'yes'. + /// + public YesNoType IgnoreAddExistingTable + { + get + { + return this.ignoreAddExistingTableField; + } + set + { + this.ignoreAddExistingTableFieldSet = true; + this.ignoreAddExistingTableField = value; + } + } + + /// + /// Ignore errors when deleting missing rows. The default is 'yes'. + /// + public YesNoType IgnoreDeleteMissingRow + { + get + { + return this.ignoreDeleteMissingRowField; + } + set + { + this.ignoreDeleteMissingRowFieldSet = true; + this.ignoreDeleteMissingRowField = value; + } + } + + /// + /// Ignore errors when deleting missing tables. The default is 'yes'. + /// + public YesNoType IgnoreDeleteMissingTable + { + get + { + return this.ignoreDeleteMissingTableField; + } + set + { + this.ignoreDeleteMissingTableFieldSet = true; + this.ignoreDeleteMissingTableField = value; + } + } + + /// + /// Ignore errors when updating missing rows. The default is 'yes'. + /// + public YesNoType IgnoreUpdateMissingRow + { + get + { + return this.ignoreUpdateMissingRowField; + } + set + { + this.ignoreUpdateMissingRowFieldSet = true; + this.ignoreUpdateMissingRowField = value; + } + } + + /// + /// Ignore errors when changing the database code page. The default is 'no'. + /// + public YesNoType IgnoreChangingCodePage + { + get + { + return this.ignoreChangingCodePageField; + } + set + { + this.ignoreChangingCodePageFieldSet = true; + this.ignoreChangingCodePageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ProductVersionType from a string. + /// + public static ProductVersionType ParseProductVersionType(string value) + { + ProductVersionType parsedValue; + Validate.TryParseProductVersionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ProductVersionType from a string. + /// + public static bool TryParseProductVersionType(string value, out ProductVersionType parsedValue) + { + parsedValue = ProductVersionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Major" == value)) + { + parsedValue = ProductVersionType.Major; + } + else + { + if (("Minor" == value)) + { + parsedValue = ProductVersionType.Minor; + } + else + { + if (("Update" == value)) + { + parsedValue = ProductVersionType.Update; + } + else + { + parsedValue = ProductVersionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a ProductVersionOperatorType from a string. + /// + public static ProductVersionOperatorType ParseProductVersionOperatorType(string value) + { + ProductVersionOperatorType parsedValue; + Validate.TryParseProductVersionOperatorType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ProductVersionOperatorType from a string. + /// + public static bool TryParseProductVersionOperatorType(string value, out ProductVersionOperatorType parsedValue) + { + parsedValue = ProductVersionOperatorType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Lesser" == value)) + { + parsedValue = ProductVersionOperatorType.Lesser; + } + else + { + if (("LesserOrEqual" == value)) + { + parsedValue = ProductVersionOperatorType.LesserOrEqual; + } + else + { + if (("Equal" == value)) + { + parsedValue = ProductVersionOperatorType.Equal; + } + else + { + if (("GreaterOrEqual" == value)) + { + parsedValue = ProductVersionOperatorType.GreaterOrEqual; + } + else + { + if (("Greater" == value)) + { + parsedValue = ProductVersionOperatorType.Greater; + } + else + { + parsedValue = ProductVersionOperatorType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Validate", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.productIdFieldSet) + { + if ((this.productIdField == YesNoType.no)) + { + writer.WriteAttributeString("ProductId", "no"); + } + if ((this.productIdField == YesNoType.yes)) + { + writer.WriteAttributeString("ProductId", "yes"); + } + } + if (this.productLanguageFieldSet) + { + if ((this.productLanguageField == YesNoType.no)) + { + writer.WriteAttributeString("ProductLanguage", "no"); + } + if ((this.productLanguageField == YesNoType.yes)) + { + writer.WriteAttributeString("ProductLanguage", "yes"); + } + } + if (this.productVersionFieldSet) + { + if ((this.productVersionField == ProductVersionType.Major)) + { + writer.WriteAttributeString("ProductVersion", "Major"); + } + if ((this.productVersionField == ProductVersionType.Minor)) + { + writer.WriteAttributeString("ProductVersion", "Minor"); + } + if ((this.productVersionField == ProductVersionType.Update)) + { + writer.WriteAttributeString("ProductVersion", "Update"); + } + } + if (this.productVersionOperatorFieldSet) + { + if ((this.productVersionOperatorField == ProductVersionOperatorType.Lesser)) + { + writer.WriteAttributeString("ProductVersionOperator", "Lesser"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.LesserOrEqual)) + { + writer.WriteAttributeString("ProductVersionOperator", "LesserOrEqual"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.Equal)) + { + writer.WriteAttributeString("ProductVersionOperator", "Equal"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.GreaterOrEqual)) + { + writer.WriteAttributeString("ProductVersionOperator", "GreaterOrEqual"); + } + if ((this.productVersionOperatorField == ProductVersionOperatorType.Greater)) + { + writer.WriteAttributeString("ProductVersionOperator", "Greater"); + } + } + if (this.upgradeCodeFieldSet) + { + if ((this.upgradeCodeField == YesNoType.no)) + { + writer.WriteAttributeString("UpgradeCode", "no"); + } + if ((this.upgradeCodeField == YesNoType.yes)) + { + writer.WriteAttributeString("UpgradeCode", "yes"); + } + } + if (this.ignoreAddExistingRowFieldSet) + { + if ((this.ignoreAddExistingRowField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreAddExistingRow", "no"); + } + if ((this.ignoreAddExistingRowField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreAddExistingRow", "yes"); + } + } + if (this.ignoreAddExistingTableFieldSet) + { + if ((this.ignoreAddExistingTableField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreAddExistingTable", "no"); + } + if ((this.ignoreAddExistingTableField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreAddExistingTable", "yes"); + } + } + if (this.ignoreDeleteMissingRowFieldSet) + { + if ((this.ignoreDeleteMissingRowField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreDeleteMissingRow", "no"); + } + if ((this.ignoreDeleteMissingRowField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreDeleteMissingRow", "yes"); + } + } + if (this.ignoreDeleteMissingTableFieldSet) + { + if ((this.ignoreDeleteMissingTableField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreDeleteMissingTable", "no"); + } + if ((this.ignoreDeleteMissingTableField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreDeleteMissingTable", "yes"); + } + } + if (this.ignoreUpdateMissingRowFieldSet) + { + if ((this.ignoreUpdateMissingRowField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreUpdateMissingRow", "no"); + } + if ((this.ignoreUpdateMissingRowField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreUpdateMissingRow", "yes"); + } + } + if (this.ignoreChangingCodePageFieldSet) + { + if ((this.ignoreChangingCodePageField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreChangingCodePage", "no"); + } + if ((this.ignoreChangingCodePageField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreChangingCodePage", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ProductId" == name)) + { + this.productIdField = Enums.ParseYesNoType(value); + this.productIdFieldSet = true; + } + if (("ProductLanguage" == name)) + { + this.productLanguageField = Enums.ParseYesNoType(value); + this.productLanguageFieldSet = true; + } + if (("ProductVersion" == name)) + { + this.productVersionField = Validate.ParseProductVersionType(value); + this.productVersionFieldSet = true; + } + if (("ProductVersionOperator" == name)) + { + this.productVersionOperatorField = Validate.ParseProductVersionOperatorType(value); + this.productVersionOperatorFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = Enums.ParseYesNoType(value); + this.upgradeCodeFieldSet = true; + } + if (("IgnoreAddExistingRow" == name)) + { + this.ignoreAddExistingRowField = Enums.ParseYesNoType(value); + this.ignoreAddExistingRowFieldSet = true; + } + if (("IgnoreAddExistingTable" == name)) + { + this.ignoreAddExistingTableField = Enums.ParseYesNoType(value); + this.ignoreAddExistingTableFieldSet = true; + } + if (("IgnoreDeleteMissingRow" == name)) + { + this.ignoreDeleteMissingRowField = Enums.ParseYesNoType(value); + this.ignoreDeleteMissingRowFieldSet = true; + } + if (("IgnoreDeleteMissingTable" == name)) + { + this.ignoreDeleteMissingTableField = Enums.ParseYesNoType(value); + this.ignoreDeleteMissingTableFieldSet = true; + } + if (("IgnoreUpdateMissingRow" == name)) + { + this.ignoreUpdateMissingRowField = Enums.ParseYesNoType(value); + this.ignoreUpdateMissingRowFieldSet = true; + } + if (("IgnoreChangingCodePage" == name)) + { + this.ignoreChangingCodePageField = Enums.ParseYesNoType(value); + this.ignoreChangingCodePageFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ProductVersionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Checks the major version. + /// + Major, + + /// + /// Checks the major and minor versions. + /// + Minor, + + /// + /// Checks the major, minor, and update versions. + /// + Update, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ProductVersionOperatorType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Installed ProductVersion < target ProductVersion. + /// + Lesser, + + /// + /// Installed ProductVersion <= target ProductVersion. + /// + LesserOrEqual, + + /// + /// Installed ProductVersion = target ProductVersion. + /// + Equal, + + /// + /// Installed ProductVersion >= target ProductVersion. + /// + GreaterOrEqual, + + /// + /// Installed ProductVersion > target ProductVersion. + /// + Greater, + } + } + + /// + /// Indicates whether custom actions can be skipped when applying the patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class OptimizeCustomActions : ISchemaElement, ISetAttributes + { + + private YesNoType skipAssignmentField; + + private bool skipAssignmentFieldSet; + + private YesNoType skipImmediateField; + + private bool skipImmediateFieldSet; + + private YesNoType skipDeferredField; + + private bool skipDeferredFieldSet; + + private ISchemaElement parentElement; + + /// + /// Skip property (type 51) and directory (type 35) assignment custom actions. + /// + public YesNoType SkipAssignment + { + get + { + return this.skipAssignmentField; + } + set + { + this.skipAssignmentFieldSet = true; + this.skipAssignmentField = value; + } + } + + /// + /// Skip immediate custom actions that are not property or directory assignment custom actions. + /// + public YesNoType SkipImmediate + { + get + { + return this.skipImmediateField; + } + set + { + this.skipImmediateFieldSet = true; + this.skipImmediateField = value; + } + } + + /// + /// Skip custom actions that run within the script. + /// + public YesNoType SkipDeferred + { + get + { + return this.skipDeferredField; + } + set + { + this.skipDeferredFieldSet = true; + this.skipDeferredField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("OptimizeCustomActions", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.skipAssignmentFieldSet) + { + if ((this.skipAssignmentField == YesNoType.no)) + { + writer.WriteAttributeString("SkipAssignment", "no"); + } + if ((this.skipAssignmentField == YesNoType.yes)) + { + writer.WriteAttributeString("SkipAssignment", "yes"); + } + } + if (this.skipImmediateFieldSet) + { + if ((this.skipImmediateField == YesNoType.no)) + { + writer.WriteAttributeString("SkipImmediate", "no"); + } + if ((this.skipImmediateField == YesNoType.yes)) + { + writer.WriteAttributeString("SkipImmediate", "yes"); + } + } + if (this.skipDeferredFieldSet) + { + if ((this.skipDeferredField == YesNoType.no)) + { + writer.WriteAttributeString("SkipDeferred", "no"); + } + if ((this.skipDeferredField == YesNoType.yes)) + { + writer.WriteAttributeString("SkipDeferred", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SkipAssignment" == name)) + { + this.skipAssignmentField = Enums.ParseYesNoType(value); + this.skipAssignmentFieldSet = true; + } + if (("SkipImmediate" == name)) + { + this.skipImmediateField = Enums.ParseYesNoType(value); + this.skipImmediateFieldSet = true; + } + if (("SkipDeferred" == name)) + { + this.skipDeferredField = Enums.ParseYesNoType(value); + this.skipDeferredFieldSet = true; + } + } + } + + /// + /// Identifies a set of product versions. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchBaseline : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PatchBaseline() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Validate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for a set of product versions. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Validate" == childName)) + { + childValue = new Validate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchBaseline", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Collection of items that should be kept from the differences between two products. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamily : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private YesNoType supersedeField; + + private bool supersedeFieldSet; + + private ISchemaElement parentElement; + + public PatchFamily() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(All))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(BinaryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomActionRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificateRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DirectoryRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IconRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier which indicates a sequence family to which this patch belongs. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies the ProductCode of the product that this family applies to. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// Used to populate the sequence column of the MsiPatchSequence table in the final MSP file. Specified in x.x.x.x format. See documentation for Sequence column of MsiPatchSequence table in MSI SDK. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + /// + /// Set this value to 'yes' to indicate that this patch will supersede all previous patches in this patch family. + /// The default value is 'no'. + /// + public YesNoType Supersede + { + get + { + return this.supersedeField; + } + set + { + this.supersedeFieldSet = true; + this.supersedeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("All" == childName)) + { + childValue = new All(); + } + if (("BinaryRef" == childName)) + { + childValue = new BinaryRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("CustomActionRef" == childName)) + { + childValue = new CustomActionRef(); + } + if (("DigitalCertificateRef" == childName)) + { + childValue = new DigitalCertificateRef(); + } + if (("DirectoryRef" == childName)) + { + childValue = new DirectoryRef(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("IconRef" == childName)) + { + childValue = new IconRef(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamily", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + if (this.supersedeFieldSet) + { + if ((this.supersedeField == YesNoType.no)) + { + writer.WriteAttributeString("Supersede", "no"); + } + if ((this.supersedeField == YesNoType.yes)) + { + writer.WriteAttributeString("Supersede", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + if (("Supersede" == name)) + { + this.supersedeField = Enums.ParseYesNoType(value); + this.supersedeFieldSet = true; + } + } + } + + /// + /// Groups together multiple patch families to be used in other locations. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamilyGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public PatchFamilyGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamily))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFamilyGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the PatchFamilyGroup. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PatchFamily" == childName)) + { + childValue = new PatchFamily(); + } + if (("PatchFamilyRef" == childName)) + { + childValue = new PatchFamilyRef(); + } + if (("PatchFamilyGroupRef" == childName)) + { + childValue = new PatchFamilyGroupRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamilyGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a PatchFamilyGroup in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamilyGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PatchFamilyGroup to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamilyGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The PatchCreation element is analogous to the main function in a C program. When linking, only one PatchCreation section + /// can be given to the linker to produce a successful result. Using this element creates a pcp file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchCreation : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType allowMajorVersionMismatchesField; + + private bool allowMajorVersionMismatchesFieldSet; + + private YesNoType allowProductCodeMismatchesField; + + private bool allowProductCodeMismatchesFieldSet; + + private YesNoType cleanWorkingFolderField; + + private bool cleanWorkingFolderFieldSet; + + private string codepageField; + + private bool codepageFieldSet; + + private string outputPathField; + + private bool outputPathFieldSet; + + private string sourceListField; + + private bool sourceListFieldSet; + + private int symbolFlagsField; + + private bool symbolFlagsFieldSet; + + private YesNoType wholeFilesOnlyField; + + private bool wholeFilesOnlyFieldSet; + + private ISchemaElement parentElement; + + public PatchCreation() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PatchInformation))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(PatchMetadata))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Family))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchSequence))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ReplacePatch))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCode))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// PatchCreation identifier; this is the primary key for identifying patches. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Use this to set whether the major versions between the upgrade and target images match. See + /// + public YesNoType AllowMajorVersionMismatches + { + get + { + return this.allowMajorVersionMismatchesField; + } + set + { + this.allowMajorVersionMismatchesFieldSet = true; + this.allowMajorVersionMismatchesField = value; + } + } + + /// + /// Use this to set whether the product code between the upgrade and target images match. See + /// + public YesNoType AllowProductCodeMismatches + { + get + { + return this.allowProductCodeMismatchesField; + } + set + { + this.allowProductCodeMismatchesFieldSet = true; + this.allowProductCodeMismatchesField = value; + } + } + + /// + /// Use this to set whether Patchwiz should clean the temp folder when finished. See + /// + public YesNoType CleanWorkingFolder + { + get + { + return this.cleanWorkingFolderField; + } + set + { + this.cleanWorkingFolderFieldSet = true; + this.cleanWorkingFolderField = value; + } + } + + /// + /// The code page integer value or web name for the resulting PCP. See remarks for more information. + /// + public string Codepage + { + get + { + return this.codepageField; + } + set + { + this.codepageFieldSet = true; + this.codepageField = value; + } + } + + /// + /// The full path, including file name, of the patch package file that is to be generated. See + /// + public string OutputPath + { + get + { + return this.outputPathField; + } + set + { + this.outputPathFieldSet = true; + this.outputPathField = value; + } + } + + /// + /// Used to locate the .msp file for the patch if the cached copy is unavailable. See + /// + public string SourceList + { + get + { + return this.sourceListField; + } + set + { + this.sourceListFieldSet = true; + this.sourceListField = value; + } + } + + /// + /// An 8-digit hex integer representing the combination of patch symbol usage flags to use when creating a binary file patch. See + /// + public int SymbolFlags + { + get + { + return this.symbolFlagsField; + } + set + { + this.symbolFlagsFieldSet = true; + this.symbolFlagsField = value; + } + } + + /// + /// Use this to set whether changing files should be included in their entirety. See + /// + public YesNoType WholeFilesOnly + { + get + { + return this.wholeFilesOnlyField; + } + set + { + this.wholeFilesOnlyFieldSet = true; + this.wholeFilesOnlyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PatchInformation" == childName)) + { + childValue = new PatchInformation(); + } + if (("PatchMetadata" == childName)) + { + childValue = new PatchMetadata(); + } + if (("Family" == childName)) + { + childValue = new Family(); + } + if (("PatchProperty" == childName)) + { + childValue = new PatchProperty(); + } + if (("PatchSequence" == childName)) + { + childValue = new PatchSequence(); + } + if (("ReplacePatch" == childName)) + { + childValue = new ReplacePatch(); + } + if (("TargetProductCode" == childName)) + { + childValue = new TargetProductCode(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchCreation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.allowMajorVersionMismatchesFieldSet) + { + if ((this.allowMajorVersionMismatchesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowMajorVersionMismatches", "no"); + } + if ((this.allowMajorVersionMismatchesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowMajorVersionMismatches", "yes"); + } + } + if (this.allowProductCodeMismatchesFieldSet) + { + if ((this.allowProductCodeMismatchesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowProductCodeMismatches", "no"); + } + if ((this.allowProductCodeMismatchesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowProductCodeMismatches", "yes"); + } + } + if (this.cleanWorkingFolderFieldSet) + { + if ((this.cleanWorkingFolderField == YesNoType.no)) + { + writer.WriteAttributeString("CleanWorkingFolder", "no"); + } + if ((this.cleanWorkingFolderField == YesNoType.yes)) + { + writer.WriteAttributeString("CleanWorkingFolder", "yes"); + } + } + if (this.codepageFieldSet) + { + writer.WriteAttributeString("Codepage", this.codepageField); + } + if (this.outputPathFieldSet) + { + writer.WriteAttributeString("OutputPath", this.outputPathField); + } + if (this.sourceListFieldSet) + { + writer.WriteAttributeString("SourceList", this.sourceListField); + } + if (this.symbolFlagsFieldSet) + { + writer.WriteAttributeString("SymbolFlags", this.symbolFlagsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.wholeFilesOnlyFieldSet) + { + if ((this.wholeFilesOnlyField == YesNoType.no)) + { + writer.WriteAttributeString("WholeFilesOnly", "no"); + } + if ((this.wholeFilesOnlyField == YesNoType.yes)) + { + writer.WriteAttributeString("WholeFilesOnly", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AllowMajorVersionMismatches" == name)) + { + this.allowMajorVersionMismatchesField = Enums.ParseYesNoType(value); + this.allowMajorVersionMismatchesFieldSet = true; + } + if (("AllowProductCodeMismatches" == name)) + { + this.allowProductCodeMismatchesField = Enums.ParseYesNoType(value); + this.allowProductCodeMismatchesFieldSet = true; + } + if (("CleanWorkingFolder" == name)) + { + this.cleanWorkingFolderField = Enums.ParseYesNoType(value); + this.cleanWorkingFolderFieldSet = true; + } + if (("Codepage" == name)) + { + this.codepageField = value; + this.codepageFieldSet = true; + } + if (("OutputPath" == name)) + { + this.outputPathField = value; + this.outputPathFieldSet = true; + } + if (("SourceList" == name)) + { + this.sourceListField = value; + this.sourceListFieldSet = true; + } + if (("SymbolFlags" == name)) + { + this.symbolFlagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.symbolFlagsFieldSet = true; + } + if (("WholeFilesOnly" == name)) + { + this.wholeFilesOnlyField = Enums.ParseYesNoType(value); + this.wholeFilesOnlyFieldSet = true; + } + } + } + + /// + /// Properties about the patch to be placed in the Summary Information Stream. These are visible from COM through the IStream interface, and these properties can be seen on the package in Explorer. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchInformation : ISchemaElement, ISetAttributes + { + + private string descriptionField; + + private bool descriptionFieldSet; + + private string platformsField; + + private bool platformsFieldSet; + + private string languagesField; + + private bool languagesFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string keywordsField; + + private bool keywordsFieldSet; + + private string commentsField; + + private bool commentsFieldSet; + + private YesNoDefaultType readOnlyField; + + private bool readOnlyFieldSet; + + private string summaryCodepageField; + + private bool summaryCodepageFieldSet; + + private YesNoType shortNamesField; + + private bool shortNamesFieldSet; + + private YesNoType compressedField; + + private bool compressedFieldSet; + + private YesNoType adminImageField; + + private bool adminImageFieldSet; + + private ISchemaElement parentElement; + + /// + /// A short description of the patch that includes the name of the product. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + public string Platforms + { + get + { + return this.platformsField; + } + set + { + this.platformsFieldSet = true; + this.platformsField = value; + } + } + + public string Languages + { + get + { + return this.languagesField; + } + set + { + this.languagesFieldSet = true; + this.languagesField = value; + } + } + + /// + /// The name of the manufacturer of the patch package. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// A semicolon-delimited list of network or URL locations for alternate sources of the patch. The default is "Installer,Patching,PCP,Database". + /// + public string Keywords + { + get + { + return this.keywordsField; + } + set + { + this.keywordsFieldSet = true; + this.keywordsField = value; + } + } + + /// + /// General purpose of the patch package. For example, "This patch contains the logic and data required to install + /// + public string Comments + { + get + { + return this.commentsField; + } + set + { + this.commentsFieldSet = true; + this.commentsField = value; + } + } + + /// + /// The value of this attribute conveys whether the package should be opened as read-only. + /// A database editing tool should not modify a read-only enforced database and should + /// issue a warning at attempts to modify a read-only recommended database. + /// + public YesNoDefaultType ReadOnly + { + get + { + return this.readOnlyField; + } + set + { + this.readOnlyFieldSet = true; + this.readOnlyField = value; + } + } + + /// + /// The code page integer value or web name for summary info strings only. The default is 1252. See remarks for more information. + /// + public string SummaryCodepage + { + get + { + return this.summaryCodepageField; + } + set + { + this.summaryCodepageFieldSet = true; + this.summaryCodepageField = value; + } + } + + public YesNoType ShortNames + { + get + { + return this.shortNamesField; + } + set + { + this.shortNamesFieldSet = true; + this.shortNamesField = value; + } + } + + public YesNoType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + public YesNoType AdminImage + { + get + { + return this.adminImageField; + } + set + { + this.adminImageFieldSet = true; + this.adminImageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchInformation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.platformsFieldSet) + { + writer.WriteAttributeString("Platforms", this.platformsField); + } + if (this.languagesFieldSet) + { + writer.WriteAttributeString("Languages", this.languagesField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.keywordsFieldSet) + { + writer.WriteAttributeString("Keywords", this.keywordsField); + } + if (this.commentsFieldSet) + { + writer.WriteAttributeString("Comments", this.commentsField); + } + if (this.readOnlyFieldSet) + { + if ((this.readOnlyField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ReadOnly", "default"); + } + if ((this.readOnlyField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ReadOnly", "no"); + } + if ((this.readOnlyField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ReadOnly", "yes"); + } + } + if (this.summaryCodepageFieldSet) + { + writer.WriteAttributeString("SummaryCodepage", this.summaryCodepageField); + } + if (this.shortNamesFieldSet) + { + if ((this.shortNamesField == YesNoType.no)) + { + writer.WriteAttributeString("ShortNames", "no"); + } + if ((this.shortNamesField == YesNoType.yes)) + { + writer.WriteAttributeString("ShortNames", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.adminImageFieldSet) + { + if ((this.adminImageField == YesNoType.no)) + { + writer.WriteAttributeString("AdminImage", "no"); + } + if ((this.adminImageField == YesNoType.yes)) + { + writer.WriteAttributeString("AdminImage", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Platforms" == name)) + { + this.platformsField = value; + this.platformsFieldSet = true; + } + if (("Languages" == name)) + { + this.languagesField = value; + this.languagesFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Keywords" == name)) + { + this.keywordsField = value; + this.keywordsFieldSet = true; + } + if (("Comments" == name)) + { + this.commentsField = value; + this.commentsFieldSet = true; + } + if (("ReadOnly" == name)) + { + this.readOnlyField = Enums.ParseYesNoDefaultType(value); + this.readOnlyFieldSet = true; + } + if (("SummaryCodepage" == name)) + { + this.summaryCodepageField = value; + this.summaryCodepageFieldSet = true; + } + if (("ShortNames" == name)) + { + this.shortNamesField = Enums.ParseYesNoType(value); + this.shortNamesFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoType(value); + this.compressedFieldSet = true; + } + if (("AdminImage" == name)) + { + this.adminImageField = Enums.ParseYesNoType(value); + this.adminImageFieldSet = true; + } + } + } + + /// + /// Properties about the patch to be placed in the PatchMetadata table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchMetadata : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType allowRemovalField; + + private bool allowRemovalFieldSet; + + private string classificationField; + + private bool classificationFieldSet; + + private string creationTimeUTCField; + + private bool creationTimeUTCFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private string manufacturerNameField; + + private bool manufacturerNameFieldSet; + + private string minorUpdateTargetRTMField; + + private bool minorUpdateTargetRTMFieldSet; + + private string moreInfoURLField; + + private bool moreInfoURLFieldSet; + + private YesNoType optimizedInstallModeField; + + private bool optimizedInstallModeFieldSet; + + private string targetProductNameField; + + private bool targetProductNameFieldSet; + + private ISchemaElement parentElement; + + public PatchMetadata() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(CustomProperty))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(OptimizeCustomActions))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Whether this is an uninstallable patch. + /// + public YesNoType AllowRemoval + { + get + { + return this.allowRemovalField; + } + set + { + this.allowRemovalFieldSet = true; + this.allowRemovalField = value; + } + } + + /// + /// Category of updates. Recommended values are Critical Update, Hotfix, Security Rollup, Security Update, Service Pack, Update, Update Rollup. + /// + public string Classification + { + get + { + return this.classificationField; + } + set + { + this.classificationFieldSet = true; + this.classificationField = value; + } + } + + /// + /// Creation time of the .msp file in the form mm-dd-yy HH:MM (month-day-year hour:minute). + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string CreationTimeUTC + { + get + { + return this.creationTimeUTCField; + } + set + { + this.creationTimeUTCFieldSet = true; + this.creationTimeUTCField = value; + } + } + + /// + /// Description of the patch. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// A title for the patch that is suitable for public display. In Add/Remove Programs from XP SP2 on. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// Name of the manufacturer. + /// + public string ManufacturerName + { + get + { + return this.manufacturerNameField; + } + set + { + this.manufacturerNameFieldSet = true; + this.manufacturerNameField = value; + } + } + + /// + /// Indicates that the patch targets the RTM version of the product or the most recent major + /// upgrade patch. Author this optional property in minor update patches that contain sequencing + /// information to indicate that the patch removes all patches up to the RTM version of the + /// product, or up to the most recent major upgrade patch. This property is available beginning + /// with Windows Installer 3.1. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string MinorUpdateTargetRTM + { + get + { + return this.minorUpdateTargetRTMField; + } + set + { + this.minorUpdateTargetRTMFieldSet = true; + this.minorUpdateTargetRTMField = value; + } + } + + /// + /// A URL that provides information specific to this patch. In Add/Remove Programs from XP SP2 on. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string MoreInfoURL + { + get + { + return this.moreInfoURLField; + } + set + { + this.moreInfoURLFieldSet = true; + this.moreInfoURLField = value; + } + } + + /// + /// If this attribute is set to 'yes' in all the patches to be applied in a transaction, the + /// application of the patch is optimized if possible. Available beginning with Windows Installer 3.1. + /// + public YesNoType OptimizedInstallMode + { + get + { + return this.optimizedInstallModeField; + } + set + { + this.optimizedInstallModeFieldSet = true; + this.optimizedInstallModeField = value; + } + } + + /// + /// Name of the application or target product suite. + /// + public string TargetProductName + { + get + { + return this.targetProductNameField; + } + set + { + this.targetProductNameFieldSet = true; + this.targetProductNameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("CustomProperty" == childName)) + { + childValue = new CustomProperty(); + } + if (("OptimizeCustomActions" == childName)) + { + childValue = new OptimizeCustomActions(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchMetadata", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.allowRemovalFieldSet) + { + if ((this.allowRemovalField == YesNoType.no)) + { + writer.WriteAttributeString("AllowRemoval", "no"); + } + if ((this.allowRemovalField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowRemoval", "yes"); + } + } + if (this.classificationFieldSet) + { + writer.WriteAttributeString("Classification", this.classificationField); + } + if (this.creationTimeUTCFieldSet) + { + writer.WriteAttributeString("CreationTimeUTC", this.creationTimeUTCField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.manufacturerNameFieldSet) + { + writer.WriteAttributeString("ManufacturerName", this.manufacturerNameField); + } + if (this.minorUpdateTargetRTMFieldSet) + { + writer.WriteAttributeString("MinorUpdateTargetRTM", this.minorUpdateTargetRTMField); + } + if (this.moreInfoURLFieldSet) + { + writer.WriteAttributeString("MoreInfoURL", this.moreInfoURLField); + } + if (this.optimizedInstallModeFieldSet) + { + if ((this.optimizedInstallModeField == YesNoType.no)) + { + writer.WriteAttributeString("OptimizedInstallMode", "no"); + } + if ((this.optimizedInstallModeField == YesNoType.yes)) + { + writer.WriteAttributeString("OptimizedInstallMode", "yes"); + } + } + if (this.targetProductNameFieldSet) + { + writer.WriteAttributeString("TargetProductName", this.targetProductNameField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("AllowRemoval" == name)) + { + this.allowRemovalField = Enums.ParseYesNoType(value); + this.allowRemovalFieldSet = true; + } + if (("Classification" == name)) + { + this.classificationField = value; + this.classificationFieldSet = true; + } + if (("CreationTimeUTC" == name)) + { + this.creationTimeUTCField = value; + this.creationTimeUTCFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("ManufacturerName" == name)) + { + this.manufacturerNameField = value; + this.manufacturerNameFieldSet = true; + } + if (("MinorUpdateTargetRTM" == name)) + { + this.minorUpdateTargetRTMField = value; + this.minorUpdateTargetRTMFieldSet = true; + } + if (("MoreInfoURL" == name)) + { + this.moreInfoURLField = value; + this.moreInfoURLFieldSet = true; + } + if (("OptimizedInstallMode" == name)) + { + this.optimizedInstallModeField = Enums.ParseYesNoType(value); + this.optimizedInstallModeFieldSet = true; + } + if (("TargetProductName" == name)) + { + this.targetProductNameField = value; + this.targetProductNameFieldSet = true; + } + } + } + + /// + /// A custom property for the PatchMetadata table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomProperty : ISchemaElement, ISetAttributes + { + + private string companyField; + + private bool companyFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the company. + /// + public string Company + { + get + { + return this.companyField; + } + set + { + this.companyFieldSet = true; + this.companyField = value; + } + } + + /// + /// The name of the metadata property. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// Value of the metadata property. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.companyFieldSet) + { + writer.WriteAttributeString("Company", this.companyField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Company" == name)) + { + this.companyField = value; + this.companyFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// A patch that is deprecated by this patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ReplacePatch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Patch GUID to be unregistered if it exists on the machine targeted by this patch. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ReplacePatch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// The product codes for products that can accept the patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetProductCodes : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType replaceField; + + private bool replaceFieldSet; + + private ISchemaElement parentElement; + + public TargetProductCodes() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TargetProductCode))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Whether to replace the product codes that can accept the patch from the target packages with the child elements. + /// + public YesNoType Replace + { + get + { + return this.replaceField; + } + set + { + this.replaceFieldSet = true; + this.replaceField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("TargetProductCode" == childName)) + { + childValue = new TargetProductCode(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetProductCodes", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.replaceFieldSet) + { + if ((this.replaceField == YesNoType.no)) + { + writer.WriteAttributeString("Replace", "no"); + } + if ((this.replaceField == YesNoType.yes)) + { + writer.WriteAttributeString("Replace", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Replace" == name)) + { + this.replaceField = Enums.ParseYesNoType(value); + this.replaceFieldSet = true; + } + } + } + + /// + /// A product code for a product that can accept the patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetProductCode : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The product code for a product that can accept the patch. This can be '*'. See remarks for more information. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetProductCode", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// A property for this patch database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchProperty : ISchemaElement, ISetAttributes + { + + private string companyField; + + private bool companyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name of the company for a custom metadata property. + /// + public string Company + { + get + { + return this.companyField; + } + set + { + this.companyFieldSet = true; + this.companyField = value; + } + } + + /// + /// Name of the patch property. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Value of the patch property. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.companyFieldSet) + { + writer.WriteAttributeString("Company", this.companyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Company" == name)) + { + this.companyField = value; + this.companyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Sequence information for this patch database. Sequence information is generated automatically in most cases, and rarely needs to be set explicitly. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchSequence : ISchemaElement, ISetAttributes + { + + private string patchFamilyField; + + private bool patchFamilyFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string sequenceField; + + private bool sequenceFieldSet; + + private YesNoType supersedeField; + + private bool supersedeFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string targetImageField; + + private bool targetImageFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier which indicates a sequence family to which this patch belongs. + /// + public string PatchFamily + { + get + { + return this.patchFamilyField; + } + set + { + this.patchFamilyFieldSet = true; + this.patchFamilyField = value; + } + } + + /// + /// Specifies the ProductCode of the product that this family applies to. + /// This attribute cannot the specified if the TargetImage attribute is specified. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// Used to populate the sequence column of the MsiPatchSequence table in the final MSP file. Specified in x.x.x.x format. See documentation for Sequence column of MsiPatchSequence table in MSI SDK. + /// + public string Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Set this value to 'yes' to indicate that this patch will supersede all previous patches in this patch family. + /// The default value is 'no'. + /// + public YesNoType Supersede + { + get + { + return this.supersedeField; + } + set + { + this.supersedeFieldSet = true; + this.supersedeField = value; + } + } + + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Specifies the TargetImage that this family applies to. + /// This attribute cannot the specified if the ProductCode attribute is specified. + /// + public string TargetImage + { + get + { + return this.targetImageField; + } + set + { + this.targetImageFieldSet = true; + this.targetImageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchSequence", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.patchFamilyFieldSet) + { + writer.WriteAttributeString("PatchFamily", this.patchFamilyField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField); + } + if (this.supersedeFieldSet) + { + if ((this.supersedeField == YesNoType.no)) + { + writer.WriteAttributeString("Supersede", "no"); + } + if ((this.supersedeField == YesNoType.yes)) + { + writer.WriteAttributeString("Supersede", "yes"); + } + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.targetImageFieldSet) + { + writer.WriteAttributeString("TargetImage", this.targetImageField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("PatchFamily" == name)) + { + this.patchFamilyField = value; + this.patchFamilyFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = value; + this.sequenceFieldSet = true; + } + if (("Supersede" == name)) + { + this.supersedeField = Enums.ParseYesNoType(value); + this.supersedeFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("TargetImage" == name)) + { + this.targetImageField = value; + this.targetImageFieldSet = true; + } + } + } + + /// + /// Group of one or more upgraded images of a product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Family : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string diskPromptField; + + private bool diskPromptFieldSet; + + private string mediaSrcPropField; + + private bool mediaSrcPropFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private int sequenceStartField; + + private bool sequenceStartFieldSet; + + private string volumeLabelField; + + private bool volumeLabelFieldSet; + + private ISchemaElement parentElement; + + public Family() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(UpgradeImage))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ExternalFile))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectFile))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Entered into the DiskId field of the new Media table record. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Value to display in the "[1]" of the DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. + /// + public string DiskPrompt + { + get + { + return this.diskPromptField; + } + set + { + this.diskPromptFieldSet = true; + this.diskPromptField = value; + } + } + + /// + /// Entered into the Source field of the new Media table entry of the upgraded image. + /// + public string MediaSrcProp + { + get + { + return this.mediaSrcPropField; + } + set + { + this.mediaSrcPropFieldSet = true; + this.mediaSrcPropField = value; + } + } + + /// + /// Identifier for the family. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Sequence number for the starting file. + /// + public int SequenceStart + { + get + { + return this.sequenceStartField; + } + set + { + this.sequenceStartFieldSet = true; + this.sequenceStartField = value; + } + } + + /// + /// Entered into the VolumeLabel field of the new Media table record. + /// + public string VolumeLabel + { + get + { + return this.volumeLabelField; + } + set + { + this.volumeLabelFieldSet = true; + this.volumeLabelField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("UpgradeImage" == childName)) + { + childValue = new UpgradeImage(); + } + if (("ExternalFile" == childName)) + { + childValue = new ExternalFile(); + } + if (("ProtectFile" == childName)) + { + childValue = new ProtectFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Family", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.diskPromptFieldSet) + { + writer.WriteAttributeString("DiskPrompt", this.diskPromptField); + } + if (this.mediaSrcPropFieldSet) + { + writer.WriteAttributeString("MediaSrcProp", this.mediaSrcPropField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sequenceStartFieldSet) + { + writer.WriteAttributeString("SequenceStart", this.sequenceStartField.ToString(CultureInfo.InvariantCulture)); + } + if (this.volumeLabelFieldSet) + { + writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("DiskPrompt" == name)) + { + this.diskPromptField = value; + this.diskPromptFieldSet = true; + } + if (("MediaSrcProp" == name)) + { + this.mediaSrcPropField = value; + this.mediaSrcPropFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SequenceStart" == name)) + { + this.sequenceStartField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceStartFieldSet = true; + } + if (("VolumeLabel" == name)) + { + this.volumeLabelField = value; + this.volumeLabelFieldSet = true; + } + } + } + + /// + /// Contains information about the upgraded images of the product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UpgradeImage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private string sourcePatchField; + + private bool sourcePatchFieldSet; + + private string srcPatchField; + + private bool srcPatchFieldSet; + + private ISchemaElement parentElement; + + public UpgradeImage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(TargetImage))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(UpgradeFile))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier to connect target images with upgraded image. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Full path to location of msi file for upgraded image. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Modified copy of the upgraded installation database that contains additional authoring specific to patching. + /// + public string SourcePatch + { + get + { + return this.sourcePatchField; + } + set + { + this.sourcePatchFieldSet = true; + this.sourcePatchField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string srcPatch + { + get + { + return this.srcPatchField; + } + set + { + this.srcPatchFieldSet = true; + this.srcPatchField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("TargetImage" == childName)) + { + childValue = new TargetImage(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("UpgradeFile" == childName)) + { + childValue = new UpgradeFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UpgradeImage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.sourcePatchFieldSet) + { + writer.WriteAttributeString("SourcePatch", this.sourcePatchField); + } + if (this.srcPatchFieldSet) + { + writer.WriteAttributeString("srcPatch", this.srcPatchField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("SourcePatch" == name)) + { + this.sourcePatchField = value; + this.sourcePatchFieldSet = true; + } + if (("srcPatch" == name)) + { + this.srcPatchField = value; + this.srcPatchFieldSet = true; + } + } + } + + /// + /// Contains information about the target images of the product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetImage : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private int orderField; + + private bool orderFieldSet; + + private string validationField; + + private bool validationFieldSet; + + private YesNoType ignoreMissingFilesField; + + private bool ignoreMissingFilesFieldSet; + + private ISchemaElement parentElement; + + public TargetImage() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TargetFile))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the target image. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Full path to the location of the msi file for the target image. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Relative order of the target image. + /// + public int Order + { + get + { + return this.orderField; + } + set + { + this.orderFieldSet = true; + this.orderField = value; + } + } + + /// + /// Product checking to avoid applying irrelevant transforms. + /// + public string Validation + { + get + { + return this.validationField; + } + set + { + this.validationFieldSet = true; + this.validationField = value; + } + } + + /// + /// Files missing from the target image are ignored by the installer. + /// + public YesNoType IgnoreMissingFiles + { + get + { + return this.ignoreMissingFilesField; + } + set + { + this.ignoreMissingFilesFieldSet = true; + this.ignoreMissingFilesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("TargetFile" == childName)) + { + childValue = new TargetFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetImage", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.orderFieldSet) + { + writer.WriteAttributeString("Order", this.orderField.ToString(CultureInfo.InvariantCulture)); + } + if (this.validationFieldSet) + { + writer.WriteAttributeString("Validation", this.validationField); + } + if (this.ignoreMissingFilesFieldSet) + { + if ((this.ignoreMissingFilesField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreMissingFiles", "no"); + } + if ((this.ignoreMissingFilesField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreMissingFiles", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("Order" == name)) + { + this.orderField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.orderFieldSet = true; + } + if (("Validation" == name)) + { + this.validationField = value; + this.validationFieldSet = true; + } + if (("IgnoreMissingFiles" == name)) + { + this.ignoreMissingFilesField = Enums.ParseYesNoType(value); + this.ignoreMissingFilesFieldSet = true; + } + } + } + + /// + /// Information about specific files in a target image. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TargetFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public TargetFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SymbolPath))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreRange))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectRange))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("IgnoreRange" == childName)) + { + childValue = new IgnoreRange(); + } + if (("ProtectRange" == childName)) + { + childValue = new ProtectRange(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TargetFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Specifies part of a file that is to be ignored during patching. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IgnoreRange : ISchemaElement, ISetAttributes + { + + private int offsetField; + + private bool offsetFieldSet; + + private int lengthField; + + private bool lengthFieldSet; + + private ISchemaElement parentElement; + + /// + /// Offset of the start of the range. + /// + public int Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetFieldSet = true; + this.offsetField = value; + } + } + + /// + /// Length of the range. + /// + public int Length + { + get + { + return this.lengthField; + } + set + { + this.lengthFieldSet = true; + this.lengthField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IgnoreRange", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.offsetFieldSet) + { + writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); + } + if (this.lengthFieldSet) + { + writer.WriteAttributeString("Length", this.lengthField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Offset" == name)) + { + this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.offsetFieldSet = true; + } + if (("Length" == name)) + { + this.lengthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.lengthFieldSet = true; + } + } + } + + /// + /// Specifies part of a file that cannot be overwritten during patching. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProtectRange : ISchemaElement, ISetAttributes + { + + private int offsetField; + + private bool offsetFieldSet; + + private int lengthField; + + private bool lengthFieldSet; + + private ISchemaElement parentElement; + + /// + /// Offset of the start of the range. + /// + public int Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetFieldSet = true; + this.offsetField = value; + } + } + + /// + /// Length of the range. + /// + public int Length + { + get + { + return this.lengthField; + } + set + { + this.lengthFieldSet = true; + this.lengthField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProtectRange", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.offsetFieldSet) + { + writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); + } + if (this.lengthFieldSet) + { + writer.WriteAttributeString("Length", this.lengthField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Offset" == name)) + { + this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.offsetFieldSet = true; + } + if (("Length" == name)) + { + this.lengthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.lengthFieldSet = true; + } + } + } + + /// + /// Specifies a file to be protected. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProtectFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string fileField; + + private bool fileFieldSet; + + private ISchemaElement parentElement; + + public ProtectFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProtectRange))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProtectRange" == childName)) + { + childValue = new ProtectRange(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProtectFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + } + } + + /// + /// Contains information about specific files that are not part of a regular target image. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExternalFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string fileField; + + private bool fileFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private int orderField; + + private bool orderFieldSet; + + private ISchemaElement parentElement; + + public ExternalFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ProtectRange))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(SymbolPath))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(IgnoreRange))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Full path of the external file. + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Specifies the order of the external files to use when creating the patch. + /// + public int Order + { + get + { + return this.orderField; + } + set + { + this.orderFieldSet = true; + this.orderField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProtectRange" == childName)) + { + childValue = new ProtectRange(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("IgnoreRange" == childName)) + { + childValue = new IgnoreRange(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExternalFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.orderFieldSet) + { + writer.WriteAttributeString("Order", this.orderField.ToString(CultureInfo.InvariantCulture)); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("Order" == name)) + { + this.orderField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.orderFieldSet = true; + } + } + } + + /// + /// Specifies files to either ignore or to specify optional data about a file. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UpgradeFile : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string fileField; + + private bool fileFieldSet; + + private YesNoType ignoreField; + + private bool ignoreFieldSet; + + private YesNoType allowIgnoreOnErrorField; + + private bool allowIgnoreOnErrorFieldSet; + + private YesNoType wholeFileField; + + private bool wholeFileFieldSet; + + private ISchemaElement parentElement; + + public UpgradeFile() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Foreign key into the File table. + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// If yes, the file is ignored during patching, and the next two attributes are ignored. + /// + public YesNoType Ignore + { + get + { + return this.ignoreField; + } + set + { + this.ignoreFieldSet = true; + this.ignoreField = value; + } + } + + /// + /// Specifies whether patching this file is vital. + /// + public YesNoType AllowIgnoreOnError + { + get + { + return this.allowIgnoreOnErrorField; + } + set + { + this.allowIgnoreOnErrorFieldSet = true; + this.allowIgnoreOnErrorField = value; + } + } + + /// + /// Whether the whole file should be installed, rather than creating a binary patch. + /// + public YesNoType WholeFile + { + get + { + return this.wholeFileField; + } + set + { + this.wholeFileFieldSet = true; + this.wholeFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UpgradeFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.ignoreFieldSet) + { + if ((this.ignoreField == YesNoType.no)) + { + writer.WriteAttributeString("Ignore", "no"); + } + if ((this.ignoreField == YesNoType.yes)) + { + writer.WriteAttributeString("Ignore", "yes"); + } + } + if (this.allowIgnoreOnErrorFieldSet) + { + if ((this.allowIgnoreOnErrorField == YesNoType.no)) + { + writer.WriteAttributeString("AllowIgnoreOnError", "no"); + } + if ((this.allowIgnoreOnErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowIgnoreOnError", "yes"); + } + } + if (this.wholeFileFieldSet) + { + if ((this.wholeFileField == YesNoType.no)) + { + writer.WriteAttributeString("WholeFile", "no"); + } + if ((this.wholeFileField == YesNoType.yes)) + { + writer.WriteAttributeString("WholeFile", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("Ignore" == name)) + { + this.ignoreField = Enums.ParseYesNoType(value); + this.ignoreFieldSet = true; + } + if (("AllowIgnoreOnError" == name)) + { + this.allowIgnoreOnErrorField = Enums.ParseYesNoType(value); + this.allowIgnoreOnErrorFieldSet = true; + } + if (("WholeFile" == name)) + { + this.wholeFileField = Enums.ParseYesNoType(value); + this.wholeFileFieldSet = true; + } + } + } + + /// + /// A path to symbols. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SymbolPath : ISchemaElement, ISetAttributes + { + + private string pathField; + + private bool pathFieldSet; + + private ISchemaElement parentElement; + + /// + /// The path. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SymbolPath", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + } + } + + /// + /// Properties about the package to be placed in the Summary Information Stream. These are + /// visible from COM through the IStream interface, and these properties can be seen on the package in Explorer. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SummaryInformation : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType adminImageField; + + private bool adminImageFieldSet; + + private string commentsField; + + private bool commentsFieldSet; + + private YesNoType compressedField; + + private bool compressedFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private InstallPrivilegesType installPrivilegesField; + + private bool installPrivilegesFieldSet; + + private InstallScopeType installScopeField; + + private bool installScopeFieldSet; + + private int installerVersionField; + + private bool installerVersionFieldSet; + + private string keywordsField; + + private bool keywordsFieldSet; + + private string languagesField; + + private bool languagesFieldSet; + + private string manufacturerField; + + private bool manufacturerFieldSet; + + private string platformsField; + + private bool platformsFieldSet; + + private PlatformType platformField; + + private bool platformFieldSet; + + private YesNoDefaultType readOnlyField; + + private bool readOnlyFieldSet; + + private YesNoType shortNamesField; + + private bool shortNamesFieldSet; + + private string summaryCodepageField; + + private bool summaryCodepageFieldSet; + + private ISchemaElement parentElement; + + /// + /// The package code GUID for a product or merge module. + /// When compiling a product, this attribute should not be set in order to allow the package + /// code to be generated for each build. + /// When compiling a merge module, this attribute must be set to the modularization guid. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set to 'yes' if the source is an admin image. + /// + public YesNoType AdminImage + { + get + { + return this.adminImageField; + } + set + { + this.adminImageFieldSet = true; + this.adminImageField = value; + } + } + + /// + /// Optional comments for browsing. + /// + public string Comments + { + get + { + return this.commentsField; + } + set + { + this.commentsFieldSet = true; + this.commentsField = value; + } + } + + /// + /// Set to 'yes' to have compressed files in the source. + /// This attribute cannot be set for merge modules. + /// + public YesNoType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// The product full name or description. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Use this attribute to specify the priviliges required to install the package on Windows Vista and above. + /// + public InstallPrivilegesType InstallPrivileges + { + get + { + return this.installPrivilegesField; + } + set + { + this.installPrivilegesFieldSet = true; + this.installPrivilegesField = value; + } + } + + /// + /// Use this attribute to specify the installation scope of this package: per-machine or per-user. + /// + public InstallScopeType InstallScope + { + get + { + return this.installScopeField; + } + set + { + this.installScopeFieldSet = true; + this.installScopeField = value; + } + } + + /// + /// The minimum version of the Windows Installer required to install this package. Take the major version of the required Windows Installer + /// and multiply by a 100 then add the minor version of the Windows Installer. For example, "200" would represent Windows Installer 2.0 and + /// "405" would represent Windows Installer 4.5. For 64-bit Windows Installer packages, this property is set to 200 by default as + /// Windows Installer 2.0 was the first version to support 64-bit packages. + /// + public int InstallerVersion + { + get + { + return this.installerVersionField; + } + set + { + this.installerVersionFieldSet = true; + this.installerVersionField = value; + } + } + + /// + /// Optional keywords for browsing. + /// + public string Keywords + { + get + { + return this.keywordsField; + } + set + { + this.keywordsFieldSet = true; + this.keywordsField = value; + } + } + + /// + /// The list of language IDs (LCIDs) supported in the package. + /// + public string Languages + { + get + { + return this.languagesField; + } + set + { + this.languagesFieldSet = true; + this.languagesField = value; + } + } + + /// + /// The vendor releasing the package. + /// + public string Manufacturer + { + get + { + return this.manufacturerField; + } + set + { + this.manufacturerFieldSet = true; + this.manufacturerField = value; + } + } + + /// + /// The list of platforms supported by the package. This attribute has been deprecated. + /// Specify the -arch switch at the candle.exe command line or the InstallerPlatform + /// property in a .wixproj MSBuild project. + /// + public string Platforms + { + get + { + return this.platformsField; + } + set + { + this.platformsFieldSet = true; + this.platformsField = value; + } + } + + /// + /// The platform supported by the package. Use of this attribute is discouraged; instead, + /// specify the -arch switch at the candle.exe command line or the InstallerPlatform + /// property in a .wixproj MSBuild project. + /// + public PlatformType Platform + { + get + { + return this.platformField; + } + set + { + this.platformFieldSet = true; + this.platformField = value; + } + } + + /// + /// The value of this attribute conveys whether the package should be opened as read-only. + /// A database editing tool should not modify a read-only enforced database and should + /// issue a warning at attempts to modify a read-only recommended database. + /// + public YesNoDefaultType ReadOnly + { + get + { + return this.readOnlyField; + } + set + { + this.readOnlyFieldSet = true; + this.readOnlyField = value; + } + } + + /// + /// Set to 'yes' to have short filenames in the source. + /// + public YesNoType ShortNames + { + get + { + return this.shortNamesField; + } + set + { + this.shortNamesFieldSet = true; + this.shortNamesField = value; + } + } + + /// + /// The code page integer value or web name for summary info strings only. See remarks for more information. + /// + public string SummaryCodepage + { + get + { + return this.summaryCodepageField; + } + set + { + this.summaryCodepageFieldSet = true; + this.summaryCodepageField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a InstallPrivilegesType from a string. + /// + public static InstallPrivilegesType ParseInstallPrivilegesType(string value) + { + InstallPrivilegesType parsedValue; + SummaryInformation.TryParseInstallPrivilegesType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallPrivilegesType from a string. + /// + public static bool TryParseInstallPrivilegesType(string value, out InstallPrivilegesType parsedValue) + { + parsedValue = InstallPrivilegesType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("limited" == value)) + { + parsedValue = InstallPrivilegesType.limited; + } + else + { + if (("elevated" == value)) + { + parsedValue = InstallPrivilegesType.elevated; + } + else + { + parsedValue = InstallPrivilegesType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a InstallScopeType from a string. + /// + public static InstallScopeType ParseInstallScopeType(string value) + { + InstallScopeType parsedValue; + SummaryInformation.TryParseInstallScopeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallScopeType from a string. + /// + public static bool TryParseInstallScopeType(string value, out InstallScopeType parsedValue) + { + parsedValue = InstallScopeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("perMachine" == value)) + { + parsedValue = InstallScopeType.perMachine; + } + else + { + if (("perUser" == value)) + { + parsedValue = InstallScopeType.perUser; + } + else + { + parsedValue = InstallScopeType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a PlatformType from a string. + /// + public static PlatformType ParsePlatformType(string value) + { + PlatformType parsedValue; + SummaryInformation.TryParsePlatformType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PlatformType from a string. + /// + public static bool TryParsePlatformType(string value, out PlatformType parsedValue) + { + parsedValue = PlatformType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("x86" == value)) + { + parsedValue = PlatformType.x86; + } + else + { + if (("ia64" == value)) + { + parsedValue = PlatformType.ia64; + } + else + { + if (("x64" == value)) + { + parsedValue = PlatformType.x64; + } + else + { + if (("arm" == value)) + { + parsedValue = PlatformType.arm; + } + else + { + if (("intel" == value)) + { + parsedValue = PlatformType.intel; + } + else + { + if (("intel64" == value)) + { + parsedValue = PlatformType.intel64; + } + else + { + parsedValue = PlatformType.IllegalValue; + return false; + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SummaryInformation", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.adminImageFieldSet) + { + if ((this.adminImageField == YesNoType.no)) + { + writer.WriteAttributeString("AdminImage", "no"); + } + if ((this.adminImageField == YesNoType.yes)) + { + writer.WriteAttributeString("AdminImage", "yes"); + } + } + if (this.commentsFieldSet) + { + writer.WriteAttributeString("Comments", this.commentsField); + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.installPrivilegesFieldSet) + { + if ((this.installPrivilegesField == InstallPrivilegesType.limited)) + { + writer.WriteAttributeString("InstallPrivileges", "limited"); + } + if ((this.installPrivilegesField == InstallPrivilegesType.elevated)) + { + writer.WriteAttributeString("InstallPrivileges", "elevated"); + } + } + if (this.installScopeFieldSet) + { + if ((this.installScopeField == InstallScopeType.perMachine)) + { + writer.WriteAttributeString("InstallScope", "perMachine"); + } + if ((this.installScopeField == InstallScopeType.perUser)) + { + writer.WriteAttributeString("InstallScope", "perUser"); + } + } + if (this.installerVersionFieldSet) + { + writer.WriteAttributeString("InstallerVersion", this.installerVersionField.ToString(CultureInfo.InvariantCulture)); + } + if (this.keywordsFieldSet) + { + writer.WriteAttributeString("Keywords", this.keywordsField); + } + if (this.languagesFieldSet) + { + writer.WriteAttributeString("Languages", this.languagesField); + } + if (this.manufacturerFieldSet) + { + writer.WriteAttributeString("Manufacturer", this.manufacturerField); + } + if (this.platformsFieldSet) + { + writer.WriteAttributeString("Platforms", this.platformsField); + } + if (this.platformFieldSet) + { + if ((this.platformField == PlatformType.x86)) + { + writer.WriteAttributeString("Platform", "x86"); + } + if ((this.platformField == PlatformType.ia64)) + { + writer.WriteAttributeString("Platform", "ia64"); + } + if ((this.platformField == PlatformType.x64)) + { + writer.WriteAttributeString("Platform", "x64"); + } + if ((this.platformField == PlatformType.arm)) + { + writer.WriteAttributeString("Platform", "arm"); + } + if ((this.platformField == PlatformType.intel)) + { + writer.WriteAttributeString("Platform", "intel"); + } + if ((this.platformField == PlatformType.intel64)) + { + writer.WriteAttributeString("Platform", "intel64"); + } + } + if (this.readOnlyFieldSet) + { + if ((this.readOnlyField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("ReadOnly", "default"); + } + if ((this.readOnlyField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("ReadOnly", "no"); + } + if ((this.readOnlyField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("ReadOnly", "yes"); + } + } + if (this.shortNamesFieldSet) + { + if ((this.shortNamesField == YesNoType.no)) + { + writer.WriteAttributeString("ShortNames", "no"); + } + if ((this.shortNamesField == YesNoType.yes)) + { + writer.WriteAttributeString("ShortNames", "yes"); + } + } + if (this.summaryCodepageFieldSet) + { + writer.WriteAttributeString("SummaryCodepage", this.summaryCodepageField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("AdminImage" == name)) + { + this.adminImageField = Enums.ParseYesNoType(value); + this.adminImageFieldSet = true; + } + if (("Comments" == name)) + { + this.commentsField = value; + this.commentsFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoType(value); + this.compressedFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("InstallPrivileges" == name)) + { + this.installPrivilegesField = SummaryInformation.ParseInstallPrivilegesType(value); + this.installPrivilegesFieldSet = true; + } + if (("InstallScope" == name)) + { + this.installScopeField = SummaryInformation.ParseInstallScopeType(value); + this.installScopeFieldSet = true; + } + if (("InstallerVersion" == name)) + { + this.installerVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.installerVersionFieldSet = true; + } + if (("Keywords" == name)) + { + this.keywordsField = value; + this.keywordsFieldSet = true; + } + if (("Languages" == name)) + { + this.languagesField = value; + this.languagesFieldSet = true; + } + if (("Manufacturer" == name)) + { + this.manufacturerField = value; + this.manufacturerFieldSet = true; + } + if (("Platforms" == name)) + { + this.platformsField = value; + this.platformsFieldSet = true; + } + if (("Platform" == name)) + { + this.platformField = SummaryInformation.ParsePlatformType(value); + this.platformFieldSet = true; + } + if (("ReadOnly" == name)) + { + this.readOnlyField = Enums.ParseYesNoDefaultType(value); + this.readOnlyFieldSet = true; + } + if (("ShortNames" == name)) + { + this.shortNamesField = Enums.ParseYesNoType(value); + this.shortNamesFieldSet = true; + } + if (("SummaryCodepage" == name)) + { + this.summaryCodepageField = value; + this.summaryCodepageFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallPrivilegesType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set this value to declare that the package does not require elevated privileges to install. + /// + limited, + + /// + /// Set this value to declare that the package requires elevated privileges to install. + /// This is the default value. + /// + elevated, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallScopeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set this value to declare that the package is a per-machine installation and requires elevated privileges to install. + /// Sets the ALLUSERS property to 1. + /// + perMachine, + + /// + /// Set this value to declare that the package is a per-user installation and does not require elevated privileges to install. + /// Sets the package's InstallPrivileges attribute to "limited." + /// + perUser, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum PlatformType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set this value to declare that the package is an x86 package. + /// + x86, + + /// + /// Set this value to declare that the package is an ia64 package. + /// This value requires that the InstallerVersion property be set to 200 or greater. + /// + ia64, + + /// + /// Set this value to declare that the package is an x64 package. + /// This value requires that the InstallerVersion property be set to 200 or greater. + /// + x64, + + /// + /// Set this value to declare that the package is an arm package. + /// This value requires that the InstallerVersion property be set to 500 or greater. + /// + arm, + + /// + /// This value has been deprecated. Use "x86" instead. + /// + intel, + + /// + /// This value has been deprecated. Use "ia64" instead. + /// + intel64, + } + } + + /// + /// The MsiAssemblyName table specifies the schema for the elements of a strong assembly cache name for a .NET Framework or Win32 assembly. + /// Consider using the Assembly attribute on File element to have the toolset populate these entries automatically. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AssemblyName : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name of the attribute associated with the value specified in the Value column. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Value associated with the name specified in the Name column. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AssemblyName", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Identifies the possible signer certificates used to digitally sign patches. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchCertificates : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public PatchCertificates() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalCertificate" == childName)) + { + childValue = new DigitalCertificate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchCertificates", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Digital signatures that identify installation packages in a multi-product transaction. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PackageCertificates : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public PackageCertificates() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalCertificate" == childName)) + { + childValue = new DigitalCertificate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PackageCertificates", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Adds a digital certificate. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DigitalCertificate : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for a certificate file. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The path to the certificate file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DigitalCertificate", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Reference to a DigitalCertificate element. This will force the entire referenced Fragment's contents + /// to be included in the installer database. This is only used for references when patching. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DigitalCertificateRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DigitalCertificateRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Adds a digital signature. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DigitalSignature : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + public DigitalSignature() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalCertificate))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The path to signature's optional hash file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalCertificate" == childName)) + { + childValue = new DigitalCertificate(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DigitalSignature", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Adds a system file protection update catalog file + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SFPCatalog : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string nameField; + + private bool nameFieldSet; + + private string dependencyField; + + private bool dependencyFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + public SFPCatalog() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPCatalog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SFPFile))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Filename for catalog file when installed. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Used to define dependency outside of the package. + /// + public string Dependency + { + get + { + return this.dependencyField; + } + set + { + this.dependencyFieldSet = true; + this.dependencyField = value; + } + } + + /// + /// Path to catalog file in binary. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("SFPCatalog" == childName)) + { + childValue = new SFPCatalog(); + } + if (("SFPFile" == childName)) + { + childValue = new SFPFile(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SFPCatalog", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.dependencyFieldSet) + { + writer.WriteAttributeString("Dependency", this.dependencyField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Dependency" == name)) + { + this.dependencyField = value; + this.dependencyFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + /// + /// Provides a many-to-many mapping from the SFPCatalog table to the File table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SFPFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary Key to File Table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SFPFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Adds or removes .ini file entries. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IniFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sectionField; + + private bool sectionFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for ini file. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The type of modification to be made. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Name of a property, the value of which is the full path of the folder containing the .ini file. Can be name of a directory in the Directory table, a property set by the AppSearch table, or any other property representing a full path. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// The localizable .ini file key within the section. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short name. + /// This attribute's value may now be either a short or long name. + /// If a short name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short name. + /// However, if this name collides with another file or you wish to manually specify + /// the short name, then the ShortName attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The localizable .ini file section. + /// + public string Section + { + get + { + return this.sectionField; + } + set + { + this.sectionFieldSet = true; + this.sectionField = value; + } + } + + /// + /// The short name of the in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short names + /// or the user wants to manually specify the short name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// The localizable value to be written or deleted. This attribute must be set if + /// the Action attribute's value is "addLine", "addTag", or "createLine". + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + IniFile.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("addLine" == value)) + { + parsedValue = ActionType.addLine; + } + else + { + if (("addTag" == value)) + { + parsedValue = ActionType.addTag; + } + else + { + if (("createLine" == value)) + { + parsedValue = ActionType.createLine; + } + else + { + if (("removeLine" == value)) + { + parsedValue = ActionType.removeLine; + } + else + { + if (("removeTag" == value)) + { + parsedValue = ActionType.removeTag; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IniFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.addLine)) + { + writer.WriteAttributeString("Action", "addLine"); + } + if ((this.actionField == ActionType.addTag)) + { + writer.WriteAttributeString("Action", "addTag"); + } + if ((this.actionField == ActionType.createLine)) + { + writer.WriteAttributeString("Action", "createLine"); + } + if ((this.actionField == ActionType.removeLine)) + { + writer.WriteAttributeString("Action", "removeLine"); + } + if ((this.actionField == ActionType.removeTag)) + { + writer.WriteAttributeString("Action", "removeTag"); + } + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sectionFieldSet) + { + writer.WriteAttributeString("Section", this.sectionField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = IniFile.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Section" == name)) + { + this.sectionField = value; + this.sectionFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates or updates an .ini entry. + /// + addLine, + + /// + /// Creates a new entry or appends a new comma-separated value to an existing entry. + /// + addTag, + + /// + /// Creates an .ini entry only if the entry does no already exist. + /// + createLine, + + /// + /// Removes an .ini entry. + /// + removeLine, + + /// + /// Removes a tag from an .ini entry. + /// + removeTag, + } + } + + /// + /// ODBCDataSource for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ODBCDataSource : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string driverNameField; + + private bool driverNameFieldSet; + + private RegistrationType registrationField; + + private bool registrationFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private ISchemaElement parentElement; + + public ODBCDataSource() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier of the data source. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the data source. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Required if not found as child of ODBCDriver element + /// + public string DriverName + { + get + { + return this.driverNameField; + } + set + { + this.driverNameFieldSet = true; + this.driverNameField = value; + } + } + + /// + /// Scope for which the data source should be registered. + /// + public RegistrationType Registration + { + get + { + return this.registrationField; + } + set + { + this.registrationFieldSet = true; + this.registrationField = value; + } + } + + /// + /// Set 'yes' to force this file to be key path for parent Component + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Property" == childName)) + { + childValue = new Property(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a RegistrationType from a string. + /// + public static RegistrationType ParseRegistrationType(string value) + { + RegistrationType parsedValue; + ODBCDataSource.TryParseRegistrationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RegistrationType from a string. + /// + public static bool TryParseRegistrationType(string value, out RegistrationType parsedValue) + { + parsedValue = RegistrationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("machine" == value)) + { + parsedValue = RegistrationType.machine; + } + else + { + if (("user" == value)) + { + parsedValue = RegistrationType.user; + } + else + { + parsedValue = RegistrationType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ODBCDataSource", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.driverNameFieldSet) + { + writer.WriteAttributeString("DriverName", this.driverNameField); + } + if (this.registrationFieldSet) + { + if ((this.registrationField == RegistrationType.machine)) + { + writer.WriteAttributeString("Registration", "machine"); + } + if ((this.registrationField == RegistrationType.user)) + { + writer.WriteAttributeString("Registration", "user"); + } + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DriverName" == name)) + { + this.driverNameField = value; + this.driverNameFieldSet = true; + } + if (("Registration" == name)) + { + this.registrationField = ODBCDataSource.ParseRegistrationType(value); + this.registrationFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum RegistrationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Data source is registered per machine. + /// + machine, + + /// + /// Data source is registered per user. + /// + user, + } + } + + /// + /// ODBCDriver for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ODBCDriver : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string setupFileField; + + private bool setupFileFieldSet; + + private ISchemaElement parentElement; + + public ODBCDriver() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ODBCDataSource))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the driver. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the driver. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Required if not found as child of File element + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Required if not found as child of File element or different from File attribute above + /// + public string SetupFile + { + get + { + return this.setupFileField; + } + set + { + this.setupFileFieldSet = true; + this.setupFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("ODBCDataSource" == childName)) + { + childValue = new ODBCDataSource(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ODBCDriver", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.setupFileFieldSet) + { + writer.WriteAttributeString("SetupFile", this.setupFileField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("SetupFile" == name)) + { + this.setupFileField = value; + this.setupFileFieldSet = true; + } + } + } + + /// + /// ODBCTranslator for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ODBCTranslator : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string fileField; + + private bool fileFieldSet; + + private string setupFileField; + + private bool setupFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the translator. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for the translator. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Required if not found as child of File element + /// + public string File + { + get + { + return this.fileField; + } + set + { + this.fileFieldSet = true; + this.fileField = value; + } + } + + /// + /// Required if not found as child of File element or different from File attribute above + /// + public string SetupFile + { + get + { + return this.setupFileField; + } + set + { + this.setupFileFieldSet = true; + this.setupFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ODBCTranslator", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.fileFieldSet) + { + writer.WriteAttributeString("File", this.fileField); + } + if (this.setupFileFieldSet) + { + writer.WriteAttributeString("SetupFile", this.setupFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("File" == name)) + { + this.fileField = value; + this.fileFieldSet = true; + } + if (("SetupFile" == name)) + { + this.setupFileField = value; + this.setupFileFieldSet = true; + } + } + } + + /// + /// Searches for file and assigns to fullpath value of parent Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileSearch : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private int minSizeField; + + private bool minSizeFieldSet; + + private int maxSizeField; + + private bool maxSizeFieldSet; + + private string minVersionField; + + private bool minVersionFieldSet; + + private string maxVersionField; + + private bool maxVersionFieldSet; + + private DateTime minDateField; + + private bool minDateFieldSet; + + private DateTime maxDateField; + + private bool maxDateFieldSet; + + private string languagesField; + + private bool languagesFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for the file search and external key into the Signature table. If this attribute value is not set then the parent element's @Id attribute is used. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// This attribute's value may now be either a short or long file name. + /// If a short file name is specified, the ShortName attribute may not be specified. + /// If you wish to manually specify the short file name, then the ShortName + /// attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// There is a Windows Installer bug which prevents the FileSearch functionality from working + /// if both a short and long file name are specified. Since the Name attribute allows either + /// a short or long name to be specified, it is the only attribute related to file names which + /// should be specified. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// The minimum size of the file. + /// + public int MinSize + { + get + { + return this.minSizeField; + } + set + { + this.minSizeFieldSet = true; + this.minSizeField = value; + } + } + + /// + /// The maximum size of the file. + /// + public int MaxSize + { + get + { + return this.maxSizeField; + } + set + { + this.maxSizeFieldSet = true; + this.maxSizeField = value; + } + } + + /// + /// The minimum version of the file. + /// + public string MinVersion + { + get + { + return this.minVersionField; + } + set + { + this.minVersionFieldSet = true; + this.minVersionField = value; + } + } + + /// + /// The maximum version of the file. + /// + public string MaxVersion + { + get + { + return this.maxVersionField; + } + set + { + this.maxVersionFieldSet = true; + this.maxVersionField = value; + } + } + + /// + /// The minimum modification date and time of the file. Formatted as YYYY-MM-DDTHH:mm:ss, where YYYY is the year, MM is month, DD is day, 'T' is literal, HH is hour, mm is minute and ss is second. + /// + public DateTime MinDate + { + get + { + return this.minDateField; + } + set + { + this.minDateFieldSet = true; + this.minDateField = value; + } + } + + /// + /// The maximum modification date and time of the file. Formatted as YYYY-MM-DDTHH:mm:ss, where YYYY is the year, MM is month, DD is day, 'T' is literal, HH is hour, mm is minute and ss is second. + /// + public DateTime MaxDate + { + get + { + return this.maxDateField; + } + set + { + this.maxDateFieldSet = true; + this.maxDateField = value; + } + } + + /// + /// The languages supported by the file. + /// + public string Languages + { + get + { + return this.languagesField; + } + set + { + this.languagesFieldSet = true; + this.languagesField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.minSizeFieldSet) + { + writer.WriteAttributeString("MinSize", this.minSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maxSizeFieldSet) + { + writer.WriteAttributeString("MaxSize", this.maxSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.minVersionFieldSet) + { + writer.WriteAttributeString("MinVersion", this.minVersionField); + } + if (this.maxVersionFieldSet) + { + writer.WriteAttributeString("MaxVersion", this.maxVersionField); + } + if (this.minDateFieldSet) + { + writer.WriteAttributeString("MinDate", this.minDateField.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture.DateTimeFormat)); + } + if (this.maxDateFieldSet) + { + writer.WriteAttributeString("MaxDate", this.maxDateField.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture.DateTimeFormat)); + } + if (this.languagesFieldSet) + { + writer.WriteAttributeString("Languages", this.languagesField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("MinSize" == name)) + { + this.minSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.minSizeFieldSet = true; + } + if (("MaxSize" == name)) + { + this.maxSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxSizeFieldSet = true; + } + if (("MinVersion" == name)) + { + this.minVersionField = value; + this.minVersionFieldSet = true; + } + if (("MaxVersion" == name)) + { + this.maxVersionField = value; + this.maxVersionFieldSet = true; + } + if (("MinDate" == name)) + { + this.minDateField = Convert.ToDateTime(value, CultureInfo.InvariantCulture); + this.minDateFieldSet = true; + } + if (("MaxDate" == name)) + { + this.maxDateField = Convert.ToDateTime(value, CultureInfo.InvariantCulture); + this.maxDateFieldSet = true; + } + if (("Languages" == name)) + { + this.languagesField = value; + this.languagesFieldSet = true; + } + } + } + + /// + /// References an existing FileSearch element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileSearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specify the Id to the FileSearch to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileSearchRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Searches for directory and assigns to value of parent Property. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DirectorySearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private int depthField; + + private bool depthFieldSet; + + private YesNoType assignToPropertyField; + + private bool assignToPropertyFieldSet; + + private ISchemaElement parentElement; + + public DirectorySearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the directory search. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path on the user's system. Either absolute, or relative to containing directories. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + /// + /// Depth below the path that the installer searches for the file or directory specified by the search. See remarks for more information. + /// + public int Depth + { + get + { + return this.depthField; + } + set + { + this.depthFieldSet = true; + this.depthField = value; + } + } + + /// + /// Set the value of the outer Property to the result of this search. See remarks for more information. + /// + public YesNoType AssignToProperty + { + get + { + return this.assignToPropertyField; + } + set + { + this.assignToPropertyFieldSet = true; + this.assignToPropertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + if (this.depthFieldSet) + { + writer.WriteAttributeString("Depth", this.depthField.ToString(CultureInfo.InvariantCulture)); + } + if (this.assignToPropertyFieldSet) + { + if ((this.assignToPropertyField == YesNoType.no)) + { + writer.WriteAttributeString("AssignToProperty", "no"); + } + if ((this.assignToPropertyField == YesNoType.yes)) + { + writer.WriteAttributeString("AssignToProperty", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + if (("Depth" == name)) + { + this.depthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.depthFieldSet = true; + } + if (("AssignToProperty" == name)) + { + this.assignToPropertyField = Enums.ParseYesNoType(value); + this.assignToPropertyFieldSet = true; + } + } + } + + /// + /// References an existing DirectorySearch element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DirectorySearchRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string parentField; + + private bool parentFieldSet; + + private string pathField; + + private bool pathFieldSet; + + private ISchemaElement parentElement; + + public DirectorySearchRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Id of the search being referred to. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute is the signature of the parent directory of the file or directory in the Signature_ column. If this field is null, and the Path column does not expand to a full path, then all the fixed drives of the user's system are searched by using the Path. This field is a key into one of the following tables: the RegLocator, the IniLocator, the CompLocator, or the DrLocator tables. + /// + public string Parent + { + get + { + return this.parentField; + } + set + { + this.parentFieldSet = true; + this.parentField = value; + } + } + + /// + /// Path on the user's system. Either absolute, or relative to containing directories. + /// + public string Path + { + get + { + return this.pathField; + } + set + { + this.pathFieldSet = true; + this.pathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectorySearchRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.parentFieldSet) + { + writer.WriteAttributeString("Parent", this.parentField); + } + if (this.pathFieldSet) + { + writer.WriteAttributeString("Path", this.pathField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Parent" == name)) + { + this.parentField = value; + this.parentFieldSet = true; + } + if (("Path" == name)) + { + this.pathField = value; + this.pathFieldSet = true; + } + } + } + + /// + /// Searches for file or directory and assigns to value of parent Property. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentSearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + public ComponentSearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The component ID of the component whose key path is to be used for the search. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// Must be file if last child is FileSearch element and must be directory if last child is DirectorySearch element. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + ComponentSearch.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = TypeType.directory; + } + else + { + if (("file" == value)) + { + parsedValue = TypeType.file; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.directory)) + { + writer.WriteAttributeString("Type", "directory"); + } + if ((this.typeField == TypeType.file)) + { + writer.WriteAttributeString("Type", "file"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = ComponentSearch.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The key path of the component is a directory. + /// + directory, + + /// + /// The key path of the component is a file. This is the default value. + /// + file, + } + } + + /// + /// Searches for file, directory or registry key and assigns to value of parent Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IniFileSearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private int fieldField; + + private bool fieldFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sectionField; + + private bool sectionFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + public IniFileSearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// External key into the Signature table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The field in the .ini line. If field is Null or 0, the entire line is read. + /// + public int Field + { + get + { + return this.fieldField; + } + set + { + this.fieldFieldSet = true; + this.fieldField = value; + } + } + + /// + /// The key value within the section. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short name. + /// This attribute's value may now be either a short or long name. + /// If a short name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short name. + /// However, if you wish to manually specify the short name, then the ShortName + /// attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The localizable .ini file section. + /// + public string Section + { + get + { + return this.sectionField; + } + set + { + this.sectionFieldSet = true; + this.sectionField = value; + } + } + + /// + /// The short name of the file in 8.3 format. + /// This attribute should only be set if the user wants to manually specify the short name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// Must be file if last child is FileSearch element and must be directory if last child is DirectorySearch element. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + IniFileSearch.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = TypeType.directory; + } + else + { + if (("file" == value)) + { + parsedValue = TypeType.file; + } + else + { + if (("raw" == value)) + { + parsedValue = TypeType.raw; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IniFileSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.fieldFieldSet) + { + writer.WriteAttributeString("Field", this.fieldField.ToString(CultureInfo.InvariantCulture)); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sectionFieldSet) + { + writer.WriteAttributeString("Section", this.sectionField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.directory)) + { + writer.WriteAttributeString("Type", "directory"); + } + if ((this.typeField == TypeType.file)) + { + writer.WriteAttributeString("Type", "file"); + } + if ((this.typeField == TypeType.raw)) + { + writer.WriteAttributeString("Type", "raw"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Field" == name)) + { + this.fieldField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.fieldFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Section" == name)) + { + this.sectionField = value; + this.sectionFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = IniFileSearch.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// A directory location. + /// + directory, + + /// + /// A file location. This is the default value. + /// + file, + + /// + /// A raw .ini value. + /// + raw, + } + } + + /// + /// Searches for file, directory or registry key and assigns to value of parent Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistrySearch : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private RootType rootField; + + private bool rootFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + public RegistrySearch() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileSearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Signature to be used for the file, directory or registry key being searched for. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Root key for the registry value. + /// + public RootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// Key for the registry value. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// Registry value name. If this value is null, then the value from the key's unnamed or default value, if any, is retrieved. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value must be 'file' if the child is a FileSearch element, and must be 'directory' if child is a DirectorySearch element. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Instructs the search to look in the 64-bit registry when the value is 'yes'. When the value is 'no', the search looks in the 32-bit registry. + /// The default value is based on the platform set by the -arch switch to candle.exe + /// or the InstallerPlatform property in a .wixproj MSBuild project: + /// For x86 and ARM, the default value is 'no'. + /// For x64 and IA64, the default value is 'yes'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("FileSearch" == childName)) + { + childValue = new FileSearch(); + } + if (("FileSearchRef" == childName)) + { + childValue = new FileSearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a RootType from a string. + /// + public static RootType ParseRootType(string value) + { + RootType parsedValue; + RegistrySearch.TryParseRootType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a RootType from a string. + /// + public static bool TryParseRootType(string value, out RootType parsedValue) + { + parsedValue = RootType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("HKCR" == value)) + { + parsedValue = RootType.HKCR; + } + else + { + if (("HKCU" == value)) + { + parsedValue = RootType.HKCU; + } + else + { + if (("HKLM" == value)) + { + parsedValue = RootType.HKLM; + } + else + { + if (("HKU" == value)) + { + parsedValue = RootType.HKU; + } + else + { + parsedValue = RootType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + RegistrySearch.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("directory" == value)) + { + parsedValue = TypeType.directory; + } + else + { + if (("file" == value)) + { + parsedValue = TypeType.file; + } + else + { + if (("raw" == value)) + { + parsedValue = TypeType.raw; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.directory)) + { + writer.WriteAttributeString("Type", "directory"); + } + if ((this.typeField == TypeType.file)) + { + writer.WriteAttributeString("Type", "file"); + } + if ((this.typeField == TypeType.raw)) + { + writer.WriteAttributeString("Type", "raw"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = RegistrySearch.ParseRootType(value); + this.rootFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = RegistrySearch.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum RootType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// HKEY_CLASSES_ROOT + /// + HKCR, + + /// + /// HKEY_CURRENT_USER + /// + HKCU, + + /// + /// HKEY_LOCAL_MACHINE + /// + HKLM, + + /// + /// HKEY_USERS + /// + HKU, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The registry value contains the path to a directory. + /// + directory, + + /// + /// The registry value contains the path to a file. To return the full file path you must add a FileSearch element as a child of this element; otherwise, the parent directory of the file path is returned. + /// + file, + + /// + /// Sets the raw value from the registry value. Please note that this value will contain a prefix as follows: + /// + raw, + } + } + + /// + /// References an existing RegistrySearch element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistrySearchRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specify the Id of the RegistrySearch to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistrySearchRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Sets the parent of a nested DirectorySearch element to CCP_DRIVE. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComplianceDrive : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public ComplianceDrive() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DirectorySearchRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComplianceDrive", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Adds a row to the CCPSearch table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComplianceCheck : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public ComplianceCheck() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComplianceDrive))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComponentSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(IniFileSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearch))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ComplianceDrive" == childName)) + { + childValue = new ComplianceDrive(); + } + if (("ComponentSearch" == childName)) + { + childValue = new ComponentSearch(); + } + if (("RegistrySearch" == childName)) + { + childValue = new RegistrySearch(); + } + if (("IniFileSearch" == childName)) + { + childValue = new IniFileSearch(); + } + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComplianceCheck", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Property value for a Package or Module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Property : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private YesNoType complianceCheckField; + + private bool complianceCheckFieldSet; + + private YesNoType adminField; + + private bool adminFieldSet; + + private YesNoType secureField; + + private bool secureFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType suppressModularizationField; + + private bool suppressModularizationFieldSet; + + private ISchemaElement parentElement; + + public Property() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComplianceDrive))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ComponentSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(RegistrySearchRef))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(IniFileSearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearch))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(DirectorySearchRef))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(ProductSearch))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for Property. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets a default value for the property. The value will be overwritten if the Property is used for a search. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Adds a row to the CCPSearch table. This attribute is only valid when this Property contains a search element. + /// + public YesNoType ComplianceCheck + { + get + { + return this.complianceCheckField; + } + set + { + this.complianceCheckFieldSet = true; + this.complianceCheckField = value; + } + } + + /// + /// Denotes that the Property is saved during + /// + public YesNoType Admin + { + get + { + return this.adminField; + } + set + { + this.adminFieldSet = true; + this.adminField = value; + } + } + + /// + /// Denotes that the Property can be passed to the server side when doing a managed installation with elevated privileges. See the + /// + public YesNoType Secure + { + get + { + return this.secureField; + } + set + { + this.secureFieldSet = true; + this.secureField = value; + } + } + + /// + /// Denotes that the Property is not logged during installation. See the + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Use to suppress modularization of this property identifier in merge modules. + /// Using this functionality is strongly discouraged; it should only be + /// necessary as a workaround of last resort in rare scenarios. + /// + public YesNoType SuppressModularization + { + get + { + return this.suppressModularizationField; + } + set + { + this.suppressModularizationFieldSet = true; + this.suppressModularizationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ComplianceDrive" == childName)) + { + childValue = new ComplianceDrive(); + } + if (("ComponentSearch" == childName)) + { + childValue = new ComponentSearch(); + } + if (("RegistrySearch" == childName)) + { + childValue = new RegistrySearch(); + } + if (("RegistrySearchRef" == childName)) + { + childValue = new RegistrySearchRef(); + } + if (("IniFileSearch" == childName)) + { + childValue = new IniFileSearch(); + } + if (("DirectorySearch" == childName)) + { + childValue = new DirectorySearch(); + } + if (("DirectorySearchRef" == childName)) + { + childValue = new DirectorySearchRef(); + } + if (("ProductSearch" == childName)) + { + childValue = new ProductSearch(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Property", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.complianceCheckFieldSet) + { + if ((this.complianceCheckField == YesNoType.no)) + { + writer.WriteAttributeString("ComplianceCheck", "no"); + } + if ((this.complianceCheckField == YesNoType.yes)) + { + writer.WriteAttributeString("ComplianceCheck", "yes"); + } + } + if (this.adminFieldSet) + { + if ((this.adminField == YesNoType.no)) + { + writer.WriteAttributeString("Admin", "no"); + } + if ((this.adminField == YesNoType.yes)) + { + writer.WriteAttributeString("Admin", "yes"); + } + } + if (this.secureFieldSet) + { + if ((this.secureField == YesNoType.no)) + { + writer.WriteAttributeString("Secure", "no"); + } + if ((this.secureField == YesNoType.yes)) + { + writer.WriteAttributeString("Secure", "yes"); + } + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.suppressModularizationFieldSet) + { + if ((this.suppressModularizationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressModularization", "no"); + } + if ((this.suppressModularizationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressModularization", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("ComplianceCheck" == name)) + { + this.complianceCheckField = Enums.ParseYesNoType(value); + this.complianceCheckFieldSet = true; + } + if (("Admin" == name)) + { + this.adminField = Enums.ParseYesNoType(value); + this.adminFieldSet = true; + } + if (("Secure" == name)) + { + this.secureField = Enums.ParseYesNoType(value); + this.secureFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("SuppressModularization" == name)) + { + this.suppressModularizationField = Enums.ParseYesNoType(value); + this.suppressModularizationFieldSet = true; + } + } + } + + /// + /// Reference to a Property value. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PropertyRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier of Property to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PropertyRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Shortcut, default target is parent File, CreateFolder, or Component's Directory + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Shortcut : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string argumentsField; + + private bool argumentsFieldSet; + + private int hotkeyField; + + private bool hotkeyFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private ShowType showField; + + private bool showFieldSet; + + private string workingDirectoryField; + + private bool workingDirectoryFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string displayResourceDllField; + + private bool displayResourceDllFieldSet; + + private int displayResourceIdField; + + private bool displayResourceIdFieldSet; + + private string descriptionResourceDllField; + + private bool descriptionResourceDllFieldSet; + + private int descriptionResourceIdField; + + private bool descriptionResourceIdFieldSet; + + private ISchemaElement parentElement; + + public Shortcut() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Icon))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ShortcutProperty))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the shortcut. This value will serve as the primary key for the row. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Identifier reference to Directory element where shortcut is to be created. When nested under a Component element, this attribute's value will default to the parent directory. Otherwise, this attribute is required. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short name. + /// This attribute's value may now be either a short or long name. + /// If a short name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short name. + /// However, if this name collides with another shortcut or you wish to manually specify + /// the short name, then the ShortName attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short name of the shortcut in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short names + /// or the user wants to manually specify the short name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// This attribute can only be set if this Shortcut element is nested under a Component element. + /// When nested under a Component element, this attribute's value will default to the parent directory. + /// This attribute's value is the target for a non-advertised shortcut. + /// This attribute is not valid for advertised shortcuts. + /// If you specify this value, its value should be a property identifier enclosed by square brackets ([ ]), that is expanded into the file or a folder pointed to by the shortcut. + /// + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// The localizable description for the shortcut. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// The command-line arguments for the shortcut. Note that the resolution of properties + /// in the Arguments field is limited. A property formatted as [Property] in this field can only be resolved if the + /// property already has the intended value when the component owning the shortcut is installed. For example, for the + /// argument "[#MyDoc.doc]" to resolve to the correct value, the same process must be installing the file MyDoc.doc and + /// the component that owns the shortcut. + /// + public string Arguments + { + get + { + return this.argumentsField; + } + set + { + this.argumentsFieldSet = true; + this.argumentsField = value; + } + } + + /// + /// The hotkey for the shortcut. The low-order byte contains the virtual-key code for + /// the key, and the high-order byte contains modifier flags. This must be a non-negative number. Authors of + /// installation packages are generally recommend not to set this option, because this can add duplicate hotkeys to a + /// users desktop. In addition, the practice of assigning hotkeys to shortcuts can be problematic for users using hotkeys + /// for accessibility. + /// + public int Hotkey + { + get + { + return this.hotkeyField; + } + set + { + this.hotkeyFieldSet = true; + this.hotkeyField = value; + } + } + + /// + /// Identifier reference to Icon element. The Icon identifier should have the same extension + /// as the file that it points at. For example, a shortcut to an executable (e.g. "my.exe") should reference an Icon with identifier + /// like "MyIcon.exe" + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// Identifier reference to Icon element. + /// + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + public ShowType Show + { + get + { + return this.showField; + } + set + { + this.showFieldSet = true; + this.showField = value; + } + } + + /// + /// Directory identifier (or Property identifier that resolves to a directory) that resolves + /// to the path of the working directory for the shortcut. + /// + public string WorkingDirectory + { + get + { + return this.workingDirectoryField; + } + set + { + this.workingDirectoryFieldSet = true; + this.workingDirectoryField = value; + } + } + + /// + /// Specifies if the shortcut should be advertised or not. Note that advertised shortcuts + /// always point at a particular application, identified by a ProductCode, and should not be shared between applications. + /// Advertised shortcuts only work for the most recently installed application, and are removed when that application is + /// removed. The default value is 'no'. + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// The Formatted string providing the full path to the language neutral file containing the MUI Manifest. Generally + /// authored using [#filekey] form. When this attribute is specified, the DisplayResourceId attribute must also + /// be provided. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not populated and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is populated and + /// the install is running on Vista and above, the value in the Name attribute is ignored. + /// + public string DisplayResourceDll + { + get + { + return this.displayResourceDllField; + } + set + { + this.displayResourceDllFieldSet = true; + this.displayResourceDllField = value; + } + } + + /// + /// The display name index for the shortcut. This must be a non-negative number. When this attribute is specified, the + /// DisplayResourceDll attribute must also be provided. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is specified and + /// the install is running on Vista and above, the value in the Name attribute is ignored. + /// + public int DisplayResourceId + { + get + { + return this.displayResourceIdField; + } + set + { + this.displayResourceIdFieldSet = true; + this.displayResourceIdField = value; + } + } + + /// + /// The Formatted string providing the full path to the language neutral file containing the MUI Manifest. Generally + /// authored using [#filekey] form. When this attribute is specified, the DescriptionResourceId attribute must also + /// be provided. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is provided and + /// the install is running on Vista and above, the value in the Name attribute is ignored. + /// + public string DescriptionResourceDll + { + get + { + return this.descriptionResourceDllField; + } + set + { + this.descriptionResourceDllFieldSet = true; + this.descriptionResourceDllField = value; + } + } + + /// + /// The description name index for the shortcut. This must be a non-negative number. When this attribute is specified, + /// the DescriptionResourceDll attribute must also be populated. + /// + /// This attribute is only used on Windows Vista and above. If this attribute is not specified and the install + /// is running on Vista and above, the value in the Name attribute is used. If this attribute is populated and the + /// install is running on Vista and above, the value in the Name attribute is ignored. + /// + public int DescriptionResourceId + { + get + { + return this.descriptionResourceIdField; + } + set + { + this.descriptionResourceIdFieldSet = true; + this.descriptionResourceIdField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Icon" == childName)) + { + childValue = new Icon(); + } + if (("ShortcutProperty" == childName)) + { + childValue = new ShortcutProperty(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ShowType from a string. + /// + public static ShowType ParseShowType(string value) + { + ShowType parsedValue; + Shortcut.TryParseShowType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ShowType from a string. + /// + public static bool TryParseShowType(string value, out ShowType parsedValue) + { + parsedValue = ShowType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("normal" == value)) + { + parsedValue = ShowType.normal; + } + else + { + if (("minimized" == value)) + { + parsedValue = ShowType.minimized; + } + else + { + if (("maximized" == value)) + { + parsedValue = ShowType.maximized; + } + else + { + parsedValue = ShowType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Shortcut", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.argumentsFieldSet) + { + writer.WriteAttributeString("Arguments", this.argumentsField); + } + if (this.hotkeyFieldSet) + { + writer.WriteAttributeString("Hotkey", this.hotkeyField.ToString(CultureInfo.InvariantCulture)); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + if (this.showFieldSet) + { + if ((this.showField == ShowType.normal)) + { + writer.WriteAttributeString("Show", "normal"); + } + if ((this.showField == ShowType.minimized)) + { + writer.WriteAttributeString("Show", "minimized"); + } + if ((this.showField == ShowType.maximized)) + { + writer.WriteAttributeString("Show", "maximized"); + } + } + if (this.workingDirectoryFieldSet) + { + writer.WriteAttributeString("WorkingDirectory", this.workingDirectoryField); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.displayResourceDllFieldSet) + { + writer.WriteAttributeString("DisplayResourceDll", this.displayResourceDllField); + } + if (this.displayResourceIdFieldSet) + { + writer.WriteAttributeString("DisplayResourceId", this.displayResourceIdField.ToString(CultureInfo.InvariantCulture)); + } + if (this.descriptionResourceDllFieldSet) + { + writer.WriteAttributeString("DescriptionResourceDll", this.descriptionResourceDllField); + } + if (this.descriptionResourceIdFieldSet) + { + writer.WriteAttributeString("DescriptionResourceId", this.descriptionResourceIdField.ToString(CultureInfo.InvariantCulture)); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Arguments" == name)) + { + this.argumentsField = value; + this.argumentsFieldSet = true; + } + if (("Hotkey" == name)) + { + this.hotkeyField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.hotkeyFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + if (("Show" == name)) + { + this.showField = Shortcut.ParseShowType(value); + this.showFieldSet = true; + } + if (("WorkingDirectory" == name)) + { + this.workingDirectoryField = value; + this.workingDirectoryFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("DisplayResourceDll" == name)) + { + this.displayResourceDllField = value; + this.displayResourceDllFieldSet = true; + } + if (("DisplayResourceId" == name)) + { + this.displayResourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.displayResourceIdFieldSet = true; + } + if (("DescriptionResourceDll" == name)) + { + this.descriptionResourceDllField = value; + this.descriptionResourceDllFieldSet = true; + } + if (("DescriptionResourceId" == name)) + { + this.descriptionResourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.descriptionResourceIdFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ShowType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The shortcut target will be displayed using the SW_SHOWNORMAL attribute. + /// + normal, + + /// + /// The shortcut target will be displayed using the SW_SHOWMINNOACTIVE attribute. + /// + minimized, + + /// + /// The shortcut target will be displayed using the SW_SHOWMAXIMIZED attribute. + /// + maximized, + } + } + + /// + /// Property values for a shortcut. This element's functionality is available starting with MSI 5.0. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ShortcutProperty : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for MsiShortcutProperty table. If omitted, a stable identifier will be generated from the parent shortcut identifier and Key value. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A formatted string identifying the property to be set. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// A formatted string supplying the value of the property. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ShortcutProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Sets ACLs on File, Registry, or CreateFolder. When under a Registry element, this cannot be used + /// if the Action attribute's value is remove or removeKeyOnInstall. This element has no Id attribute. + /// The table and key are taken from the parent element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Permission : ISchemaElement, ISetAttributes + { + + private string domainField; + + private bool domainFieldSet; + + private string userField; + + private bool userFieldSet; + + private YesNoType readField; + + private bool readFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private YesNoType readPermissionField; + + private bool readPermissionFieldSet; + + private YesNoType changePermissionField; + + private bool changePermissionFieldSet; + + private YesNoType takeOwnershipField; + + private bool takeOwnershipFieldSet; + + private YesNoType specificRightsAllField; + + private bool specificRightsAllFieldSet; + + private YesNoType readAttributesField; + + private bool readAttributesFieldSet; + + private YesNoType writeAttributesField; + + private bool writeAttributesFieldSet; + + private YesNoType readExtendedAttributesField; + + private bool readExtendedAttributesFieldSet; + + private YesNoType writeExtendedAttributesField; + + private bool writeExtendedAttributesFieldSet; + + private YesNoType synchronizeField; + + private bool synchronizeFieldSet; + + private YesNoType createFileField; + + private bool createFileFieldSet; + + private YesNoType createChildField; + + private bool createChildFieldSet; + + private YesNoType deleteChildField; + + private bool deleteChildFieldSet; + + private YesNoType traverseField; + + private bool traverseFieldSet; + + private YesNoType appendField; + + private bool appendFieldSet; + + private YesNoType executeField; + + private bool executeFieldSet; + + private YesNoType fileAllRightsField; + + private bool fileAllRightsFieldSet; + + private YesNoType writeField; + + private bool writeFieldSet; + + private YesNoType createSubkeysField; + + private bool createSubkeysFieldSet; + + private YesNoType enumerateSubkeysField; + + private bool enumerateSubkeysFieldSet; + + private YesNoType notifyField; + + private bool notifyFieldSet; + + private YesNoType createLinkField; + + private bool createLinkFieldSet; + + private YesNoType genericAllField; + + private bool genericAllFieldSet; + + private YesNoType genericExecuteField; + + private bool genericExecuteFieldSet; + + private YesNoType genericWriteField; + + private bool genericWriteFieldSet; + + private YesNoType genericReadField; + + private bool genericReadFieldSet; + + private ISchemaElement parentElement; + + public string Domain + { + get + { + return this.domainField; + } + set + { + this.domainFieldSet = true; + this.domainField = value; + } + } + + public string User + { + get + { + return this.userField; + } + set + { + this.userFieldSet = true; + this.userField = value; + } + } + + public YesNoType Read + { + get + { + return this.readField; + } + set + { + this.readFieldSet = true; + this.readField = value; + } + } + + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public YesNoType ReadPermission + { + get + { + return this.readPermissionField; + } + set + { + this.readPermissionFieldSet = true; + this.readPermissionField = value; + } + } + + public YesNoType ChangePermission + { + get + { + return this.changePermissionField; + } + set + { + this.changePermissionFieldSet = true; + this.changePermissionField = value; + } + } + + public YesNoType TakeOwnership + { + get + { + return this.takeOwnershipField; + } + set + { + this.takeOwnershipFieldSet = true; + this.takeOwnershipField = value; + } + } + + /// + /// Bit mask for SPECIFIC_RIGHTS_ALL from WinNT.h (0x0000FFFF). + /// + public YesNoType SpecificRightsAll + { + get + { + return this.specificRightsAllField; + } + set + { + this.specificRightsAllFieldSet = true; + this.specificRightsAllField = value; + } + } + + public YesNoType ReadAttributes + { + get + { + return this.readAttributesField; + } + set + { + this.readAttributesFieldSet = true; + this.readAttributesField = value; + } + } + + public YesNoType WriteAttributes + { + get + { + return this.writeAttributesField; + } + set + { + this.writeAttributesFieldSet = true; + this.writeAttributesField = value; + } + } + + public YesNoType ReadExtendedAttributes + { + get + { + return this.readExtendedAttributesField; + } + set + { + this.readExtendedAttributesFieldSet = true; + this.readExtendedAttributesField = value; + } + } + + public YesNoType WriteExtendedAttributes + { + get + { + return this.writeExtendedAttributesField; + } + set + { + this.writeExtendedAttributesFieldSet = true; + this.writeExtendedAttributesField = value; + } + } + + public YesNoType Synchronize + { + get + { + return this.synchronizeField; + } + set + { + this.synchronizeFieldSet = true; + this.synchronizeField = value; + } + } + + /// + /// For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateFile + { + get + { + return this.createFileField; + } + set + { + this.createFileFieldSet = true; + this.createFileField = value; + } + } + + /// + /// For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent. + /// + public YesNoType CreateChild + { + get + { + return this.createChildField; + } + set + { + this.createChildFieldSet = true; + this.createChildField = value; + } + } + + /// + /// For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent. + /// + public YesNoType DeleteChild + { + get + { + return this.deleteChildField; + } + set + { + this.deleteChildFieldSet = true; + this.deleteChildField = value; + } + } + + /// + /// For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent. + /// + public YesNoType Traverse + { + get + { + return this.traverseField; + } + set + { + this.traverseFieldSet = true; + this.traverseField = value; + } + } + + public YesNoType Append + { + get + { + return this.appendField; + } + set + { + this.appendFieldSet = true; + this.appendField = value; + } + } + + public YesNoType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + /// + /// Bit mask for FILE_ALL_ACCESS from WinNT.h (0x001F01FF). + /// + public YesNoType FileAllRights + { + get + { + return this.fileAllRightsField; + } + set + { + this.fileAllRightsFieldSet = true; + this.fileAllRightsField = value; + } + } + + public YesNoType Write + { + get + { + return this.writeField; + } + set + { + this.writeFieldSet = true; + this.writeField = value; + } + } + + public YesNoType CreateSubkeys + { + get + { + return this.createSubkeysField; + } + set + { + this.createSubkeysFieldSet = true; + this.createSubkeysField = value; + } + } + + public YesNoType EnumerateSubkeys + { + get + { + return this.enumerateSubkeysField; + } + set + { + this.enumerateSubkeysFieldSet = true; + this.enumerateSubkeysField = value; + } + } + + public YesNoType Notify + { + get + { + return this.notifyField; + } + set + { + this.notifyFieldSet = true; + this.notifyField = value; + } + } + + public YesNoType CreateLink + { + get + { + return this.createLinkField; + } + set + { + this.createLinkFieldSet = true; + this.createLinkField = value; + } + } + + public YesNoType GenericAll + { + get + { + return this.genericAllField; + } + set + { + this.genericAllFieldSet = true; + this.genericAllField = value; + } + } + + public YesNoType GenericExecute + { + get + { + return this.genericExecuteField; + } + set + { + this.genericExecuteFieldSet = true; + this.genericExecuteField = value; + } + } + + public YesNoType GenericWrite + { + get + { + return this.genericWriteField; + } + set + { + this.genericWriteFieldSet = true; + this.genericWriteField = value; + } + } + + /// + /// specifying this will fail to grant read access + /// + public YesNoType GenericRead + { + get + { + return this.genericReadField; + } + set + { + this.genericReadFieldSet = true; + this.genericReadField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Permission", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.domainFieldSet) + { + writer.WriteAttributeString("Domain", this.domainField); + } + if (this.userFieldSet) + { + writer.WriteAttributeString("User", this.userField); + } + if (this.readFieldSet) + { + if ((this.readField == YesNoType.no)) + { + writer.WriteAttributeString("Read", "no"); + } + if ((this.readField == YesNoType.yes)) + { + writer.WriteAttributeString("Read", "yes"); + } + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + if (this.readPermissionFieldSet) + { + if ((this.readPermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ReadPermission", "no"); + } + if ((this.readPermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadPermission", "yes"); + } + } + if (this.changePermissionFieldSet) + { + if ((this.changePermissionField == YesNoType.no)) + { + writer.WriteAttributeString("ChangePermission", "no"); + } + if ((this.changePermissionField == YesNoType.yes)) + { + writer.WriteAttributeString("ChangePermission", "yes"); + } + } + if (this.takeOwnershipFieldSet) + { + if ((this.takeOwnershipField == YesNoType.no)) + { + writer.WriteAttributeString("TakeOwnership", "no"); + } + if ((this.takeOwnershipField == YesNoType.yes)) + { + writer.WriteAttributeString("TakeOwnership", "yes"); + } + } + if (this.specificRightsAllFieldSet) + { + if ((this.specificRightsAllField == YesNoType.no)) + { + writer.WriteAttributeString("SpecificRightsAll", "no"); + } + if ((this.specificRightsAllField == YesNoType.yes)) + { + writer.WriteAttributeString("SpecificRightsAll", "yes"); + } + } + if (this.readAttributesFieldSet) + { + if ((this.readAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadAttributes", "no"); + } + if ((this.readAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadAttributes", "yes"); + } + } + if (this.writeAttributesFieldSet) + { + if ((this.writeAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteAttributes", "no"); + } + if ((this.writeAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteAttributes", "yes"); + } + } + if (this.readExtendedAttributesFieldSet) + { + if ((this.readExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "no"); + } + if ((this.readExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadExtendedAttributes", "yes"); + } + } + if (this.writeExtendedAttributesFieldSet) + { + if ((this.writeExtendedAttributesField == YesNoType.no)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "no"); + } + if ((this.writeExtendedAttributesField == YesNoType.yes)) + { + writer.WriteAttributeString("WriteExtendedAttributes", "yes"); + } + } + if (this.synchronizeFieldSet) + { + if ((this.synchronizeField == YesNoType.no)) + { + writer.WriteAttributeString("Synchronize", "no"); + } + if ((this.synchronizeField == YesNoType.yes)) + { + writer.WriteAttributeString("Synchronize", "yes"); + } + } + if (this.createFileFieldSet) + { + if ((this.createFileField == YesNoType.no)) + { + writer.WriteAttributeString("CreateFile", "no"); + } + if ((this.createFileField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateFile", "yes"); + } + } + if (this.createChildFieldSet) + { + if ((this.createChildField == YesNoType.no)) + { + writer.WriteAttributeString("CreateChild", "no"); + } + if ((this.createChildField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateChild", "yes"); + } + } + if (this.deleteChildFieldSet) + { + if ((this.deleteChildField == YesNoType.no)) + { + writer.WriteAttributeString("DeleteChild", "no"); + } + if ((this.deleteChildField == YesNoType.yes)) + { + writer.WriteAttributeString("DeleteChild", "yes"); + } + } + if (this.traverseFieldSet) + { + if ((this.traverseField == YesNoType.no)) + { + writer.WriteAttributeString("Traverse", "no"); + } + if ((this.traverseField == YesNoType.yes)) + { + writer.WriteAttributeString("Traverse", "yes"); + } + } + if (this.appendFieldSet) + { + if ((this.appendField == YesNoType.no)) + { + writer.WriteAttributeString("Append", "no"); + } + if ((this.appendField == YesNoType.yes)) + { + writer.WriteAttributeString("Append", "yes"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == YesNoType.no)) + { + writer.WriteAttributeString("Execute", "no"); + } + if ((this.executeField == YesNoType.yes)) + { + writer.WriteAttributeString("Execute", "yes"); + } + } + if (this.fileAllRightsFieldSet) + { + if ((this.fileAllRightsField == YesNoType.no)) + { + writer.WriteAttributeString("FileAllRights", "no"); + } + if ((this.fileAllRightsField == YesNoType.yes)) + { + writer.WriteAttributeString("FileAllRights", "yes"); + } + } + if (this.writeFieldSet) + { + if ((this.writeField == YesNoType.no)) + { + writer.WriteAttributeString("Write", "no"); + } + if ((this.writeField == YesNoType.yes)) + { + writer.WriteAttributeString("Write", "yes"); + } + } + if (this.createSubkeysFieldSet) + { + if ((this.createSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("CreateSubkeys", "no"); + } + if ((this.createSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateSubkeys", "yes"); + } + } + if (this.enumerateSubkeysFieldSet) + { + if ((this.enumerateSubkeysField == YesNoType.no)) + { + writer.WriteAttributeString("EnumerateSubkeys", "no"); + } + if ((this.enumerateSubkeysField == YesNoType.yes)) + { + writer.WriteAttributeString("EnumerateSubkeys", "yes"); + } + } + if (this.notifyFieldSet) + { + if ((this.notifyField == YesNoType.no)) + { + writer.WriteAttributeString("Notify", "no"); + } + if ((this.notifyField == YesNoType.yes)) + { + writer.WriteAttributeString("Notify", "yes"); + } + } + if (this.createLinkFieldSet) + { + if ((this.createLinkField == YesNoType.no)) + { + writer.WriteAttributeString("CreateLink", "no"); + } + if ((this.createLinkField == YesNoType.yes)) + { + writer.WriteAttributeString("CreateLink", "yes"); + } + } + if (this.genericAllFieldSet) + { + if ((this.genericAllField == YesNoType.no)) + { + writer.WriteAttributeString("GenericAll", "no"); + } + if ((this.genericAllField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericAll", "yes"); + } + } + if (this.genericExecuteFieldSet) + { + if ((this.genericExecuteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericExecute", "no"); + } + if ((this.genericExecuteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericExecute", "yes"); + } + } + if (this.genericWriteFieldSet) + { + if ((this.genericWriteField == YesNoType.no)) + { + writer.WriteAttributeString("GenericWrite", "no"); + } + if ((this.genericWriteField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericWrite", "yes"); + } + } + if (this.genericReadFieldSet) + { + if ((this.genericReadField == YesNoType.no)) + { + writer.WriteAttributeString("GenericRead", "no"); + } + if ((this.genericReadField == YesNoType.yes)) + { + writer.WriteAttributeString("GenericRead", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Domain" == name)) + { + this.domainField = value; + this.domainFieldSet = true; + } + if (("User" == name)) + { + this.userField = value; + this.userFieldSet = true; + } + if (("Read" == name)) + { + this.readField = Enums.ParseYesNoType(value); + this.readFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + if (("ReadPermission" == name)) + { + this.readPermissionField = Enums.ParseYesNoType(value); + this.readPermissionFieldSet = true; + } + if (("ChangePermission" == name)) + { + this.changePermissionField = Enums.ParseYesNoType(value); + this.changePermissionFieldSet = true; + } + if (("TakeOwnership" == name)) + { + this.takeOwnershipField = Enums.ParseYesNoType(value); + this.takeOwnershipFieldSet = true; + } + if (("SpecificRightsAll" == name)) + { + this.specificRightsAllField = Enums.ParseYesNoType(value); + this.specificRightsAllFieldSet = true; + } + if (("ReadAttributes" == name)) + { + this.readAttributesField = Enums.ParseYesNoType(value); + this.readAttributesFieldSet = true; + } + if (("WriteAttributes" == name)) + { + this.writeAttributesField = Enums.ParseYesNoType(value); + this.writeAttributesFieldSet = true; + } + if (("ReadExtendedAttributes" == name)) + { + this.readExtendedAttributesField = Enums.ParseYesNoType(value); + this.readExtendedAttributesFieldSet = true; + } + if (("WriteExtendedAttributes" == name)) + { + this.writeExtendedAttributesField = Enums.ParseYesNoType(value); + this.writeExtendedAttributesFieldSet = true; + } + if (("Synchronize" == name)) + { + this.synchronizeField = Enums.ParseYesNoType(value); + this.synchronizeFieldSet = true; + } + if (("CreateFile" == name)) + { + this.createFileField = Enums.ParseYesNoType(value); + this.createFileFieldSet = true; + } + if (("CreateChild" == name)) + { + this.createChildField = Enums.ParseYesNoType(value); + this.createChildFieldSet = true; + } + if (("DeleteChild" == name)) + { + this.deleteChildField = Enums.ParseYesNoType(value); + this.deleteChildFieldSet = true; + } + if (("Traverse" == name)) + { + this.traverseField = Enums.ParseYesNoType(value); + this.traverseFieldSet = true; + } + if (("Append" == name)) + { + this.appendField = Enums.ParseYesNoType(value); + this.appendFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = Enums.ParseYesNoType(value); + this.executeFieldSet = true; + } + if (("FileAllRights" == name)) + { + this.fileAllRightsField = Enums.ParseYesNoType(value); + this.fileAllRightsFieldSet = true; + } + if (("Write" == name)) + { + this.writeField = Enums.ParseYesNoType(value); + this.writeFieldSet = true; + } + if (("CreateSubkeys" == name)) + { + this.createSubkeysField = Enums.ParseYesNoType(value); + this.createSubkeysFieldSet = true; + } + if (("EnumerateSubkeys" == name)) + { + this.enumerateSubkeysField = Enums.ParseYesNoType(value); + this.enumerateSubkeysFieldSet = true; + } + if (("Notify" == name)) + { + this.notifyField = Enums.ParseYesNoType(value); + this.notifyFieldSet = true; + } + if (("CreateLink" == name)) + { + this.createLinkField = Enums.ParseYesNoType(value); + this.createLinkFieldSet = true; + } + if (("GenericAll" == name)) + { + this.genericAllField = Enums.ParseYesNoType(value); + this.genericAllFieldSet = true; + } + if (("GenericExecute" == name)) + { + this.genericExecuteField = Enums.ParseYesNoType(value); + this.genericExecuteFieldSet = true; + } + if (("GenericWrite" == name)) + { + this.genericWriteField = Enums.ParseYesNoType(value); + this.genericWriteFieldSet = true; + } + if (("GenericRead" == name)) + { + this.genericReadField = Enums.ParseYesNoType(value); + this.genericReadFieldSet = true; + } + } + } + + /// + /// Sets ACLs on File, Registry, or CreateFolder. When under a Registry element, this cannot be used + /// if the Action attribute's value is remove or removeKeyOnInstall. This element is only available + /// when installing with MSI 5.0. For downlevel support, see the PermissionEx element from the + /// WixUtilExtension. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PermissionEx : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sddlField; + + private bool sddlFieldSet; + + private ISchemaElement parentElement; + + public PermissionEx() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Condition))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this is not specified the parent element's Id attribute + /// will be used instead. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Security descriptor to apply to parent object. + /// + public string Sddl + { + get + { + return this.sddlField; + } + set + { + this.sddlFieldSet = true; + this.sddlField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PermissionEx", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sddlFieldSet) + { + writer.WriteAttributeString("Sddl", this.sddlField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Sddl" == name)) + { + this.sddlField = value; + this.sddlFieldSet = true; + } + } + } + + /// + /// Copy or move an existing file on the target machine, or copy a file that is being installed, to another destination. When + /// this element is nested under a File element, the parent file will be installed, then copied to the specified destination + /// if the parent component of the file is selected for installation or removal. When this element is nested under + /// a Component element and no FileId attribute is specified, the file to copy or move must already be on the target machine. + /// When this element is nested under a Component element and the FileId attribute is specified, the specified file is installed, + /// then copied to the specified destination if the parent component is selected for installation or removal (use + /// this option to control the copy of a file in a different component by the parent component's installation state). If the + /// specified destination directory is the same as the directory containing the original file and the name for the proposed source + /// file is the same as the original, then no action takes place. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CopyFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string fileIdField; + + private bool fileIdFieldSet; + + private string sourceDirectoryField; + + private bool sourceDirectoryFieldSet; + + private string sourcePropertyField; + + private bool sourcePropertyFieldSet; + + private string sourceNameField; + + private bool sourceNameFieldSet; + + private string destinationDirectoryField; + + private bool destinationDirectoryFieldSet; + + private string destinationPropertyField; + + private bool destinationPropertyFieldSet; + + private string destinationNameField; + + private bool destinationNameFieldSet; + + private string destinationShortNameField; + + private bool destinationShortNameFieldSet; + + private YesNoType deleteField; + + private bool deleteFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element. Set this attribute's value to the identifier + /// of a file from a different component to copy it based on the install state of the parent component. + /// + public string FileId + { + get + { + return this.fileIdField; + } + set + { + this.fileIdFieldSet = true; + this.fileIdField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set + /// this value to the source directory from which to copy or move an existing file on the target machine. This Directory must + /// exist in the installer database at creation time. This attribute cannot be specified in conjunction with SourceProperty. + /// + public string SourceDirectory + { + get + { + return this.sourceDirectoryField; + } + set + { + this.sourceDirectoryFieldSet = true; + this.sourceDirectoryField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set + /// this value to a property that will have a value that resolves to the full path of the source directory (or full path + /// including file name if SourceName is not specified). The property does not have to exist in the installer database at + /// creation time; it could be created at installation time by a custom action, on the command line, etc. This attribute + /// cannot be specified in conjunction with SourceDirectory. + /// + public string SourceProperty + { + get + { + return this.sourcePropertyField; + } + set + { + this.sourcePropertyFieldSet = true; + this.sourcePropertyField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. Set + /// this value to the localizable name of the file(s) to be copied or moved. All of the files that + /// match the wild card will be removed from the specified directory. The value is a filename that may also + /// contain the wild card characters "?" for any single character or "*" for zero or more occurrences of any character. If this + /// attribute is not specified (and this element is not nested under a File element or specify a FileId attribute) then the + /// SourceProperty attribute should be set to the name of a property that will resolve to the full path of the source filename. + /// If the value of this attribute contains a "*" wildcard and the DestinationName attribute is specified, all moved or copied + /// files retain the file names from their sources. + /// + public string SourceName + { + get + { + return this.sourceNameField; + } + set + { + this.sourceNameFieldSet = true; + this.sourceNameField = value; + } + } + + /// + /// Set this value to the destination directory where an existing file on the target machine should be moved or copied to. This + /// Directory must exist in the installer database at creation time. This attribute cannot be specified in conjunction with + /// DestinationProperty. + /// + public string DestinationDirectory + { + get + { + return this.destinationDirectoryField; + } + set + { + this.destinationDirectoryFieldSet = true; + this.destinationDirectoryField = value; + } + } + + /// + /// Set this value to a property that will have a value that resolves to the full path of the destination directory. The property + /// does not have to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. This attribute cannot be specified in conjunction with DestinationDirectory. + /// + public string DestinationProperty + { + get + { + return this.destinationPropertyField; + } + set + { + this.destinationPropertyFieldSet = true; + this.destinationPropertyField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// Now set this value to the localizable name to be given to the original file after it is moved or copied. + /// If this attribute is not specified, then the destination file is given the same name as the source file. + /// If a short file name is specified, the DestinationShortName attribute may not be specified. + /// Also, if this value is a long file name, the DestinationShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short file name. + /// However, if this name collides with another file or you wish to manually specify + /// the short file name, then the DestinationShortName attribute may be specified. + /// + public string DestinationName + { + get + { + return this.destinationNameField; + } + set + { + this.destinationNameFieldSet = true; + this.destinationNameField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short file names + /// or you wish to manually specify the short file name. + /// + public string DestinationShortName + { + get + { + return this.destinationShortNameField; + } + set + { + this.destinationShortNameFieldSet = true; + this.destinationShortNameField = value; + } + } + + /// + /// This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified. In other + /// cases, if the attribute is not specified, the default value is "no" and the file is copied, not moved. Set the value to "yes" + /// in order to move the file (thus deleting the source file) instead of copying it. + /// + public YesNoType Delete + { + get + { + return this.deleteField; + } + set + { + this.deleteFieldSet = true; + this.deleteField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CopyFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.fileIdFieldSet) + { + writer.WriteAttributeString("FileId", this.fileIdField); + } + if (this.sourceDirectoryFieldSet) + { + writer.WriteAttributeString("SourceDirectory", this.sourceDirectoryField); + } + if (this.sourcePropertyFieldSet) + { + writer.WriteAttributeString("SourceProperty", this.sourcePropertyField); + } + if (this.sourceNameFieldSet) + { + writer.WriteAttributeString("SourceName", this.sourceNameField); + } + if (this.destinationDirectoryFieldSet) + { + writer.WriteAttributeString("DestinationDirectory", this.destinationDirectoryField); + } + if (this.destinationPropertyFieldSet) + { + writer.WriteAttributeString("DestinationProperty", this.destinationPropertyField); + } + if (this.destinationNameFieldSet) + { + writer.WriteAttributeString("DestinationName", this.destinationNameField); + } + if (this.destinationShortNameFieldSet) + { + writer.WriteAttributeString("DestinationShortName", this.destinationShortNameField); + } + if (this.deleteFieldSet) + { + if ((this.deleteField == YesNoType.no)) + { + writer.WriteAttributeString("Delete", "no"); + } + if ((this.deleteField == YesNoType.yes)) + { + writer.WriteAttributeString("Delete", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("FileId" == name)) + { + this.fileIdField = value; + this.fileIdFieldSet = true; + } + if (("SourceDirectory" == name)) + { + this.sourceDirectoryField = value; + this.sourceDirectoryFieldSet = true; + } + if (("SourceProperty" == name)) + { + this.sourcePropertyField = value; + this.sourcePropertyFieldSet = true; + } + if (("SourceName" == name)) + { + this.sourceNameField = value; + this.sourceNameFieldSet = true; + } + if (("DestinationDirectory" == name)) + { + this.destinationDirectoryField = value; + this.destinationDirectoryFieldSet = true; + } + if (("DestinationProperty" == name)) + { + this.destinationPropertyField = value; + this.destinationPropertyFieldSet = true; + } + if (("DestinationName" == name)) + { + this.destinationNameField = value; + this.destinationNameFieldSet = true; + } + if (("DestinationShortName" == name)) + { + this.destinationShortNameField = value; + this.destinationShortNameFieldSet = true; + } + if (("Delete" == name)) + { + this.deleteField = Enums.ParseYesNoType(value); + this.deleteFieldSet = true; + } + } + } + + /// + /// File specification for File table, must be child node of Component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class File : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string companionFileField; + + private bool companionFileFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private YesNoType readOnlyField; + + private bool readOnlyFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType systemField; + + private bool systemFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private YesNoType checksumField; + + private bool checksumFieldSet; + + private YesNoDefaultType compressedField; + + private bool compressedFieldSet; + + private string bindPathField; + + private bool bindPathFieldSet; + + private int selfRegCostField; + + private bool selfRegCostFieldSet; + + private YesNoType trueTypeField; + + private bool trueTypeFieldSet; + + private string fontTitleField; + + private bool fontTitleFieldSet; + + private string defaultLanguageField; + + private bool defaultLanguageFieldSet; + + private int defaultSizeField; + + private bool defaultSizeFieldSet; + + private string defaultVersionField; + + private bool defaultVersionFieldSet; + + private AssemblyType assemblyField; + + private bool assemblyFieldSet; + + private string assemblyManifestField; + + private bool assemblyManifestFieldSet; + + private string assemblyApplicationField; + + private bool assemblyApplicationFieldSet; + + private ProcessorArchitectureType processorArchitectureField; + + private bool processorArchitectureFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private int patchGroupField; + + private bool patchGroupFieldSet; + + private YesNoType patchIgnoreField; + + private bool patchIgnoreFieldSet; + + private YesNoType patchAllowIgnoreOnErrorField; + + private bool patchAllowIgnoreOnErrorFieldSet; + + private YesNoType patchWholeFileField; + + private bool patchWholeFileFieldSet; + + private ISchemaElement parentElement; + + public File() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AssemblyName))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CopyFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDriver))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCTranslator))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TypeLib))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The unique identifier for this File element. If you omit Id, it defaults to the file name portion of the Source attribute, if specified. May be referenced as a Property by specifying [#value]. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to make this file a companion child of another file. The installation + /// state of a companion file depends not on its own file versioning information, but on the versioning of its + /// companion parent. A file that is the key path for its component can not be a companion file (that means + /// this attribute cannot be set if KeyPath="yes" for this file). The Version attribute cannot be set along + /// with this attribute since companion files are not installed based on their own version. + /// + public string CompanionFile + { + get + { + return this.companionFileField; + } + set + { + this.companionFileFieldSet = true; + this.companionFileField = value; + } + } + + /// + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// This attribute's value may now be either a short or long file name. + /// If a short file name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long file name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short file name. + /// However, if this name collides with another file or you wish to manually specify + /// the short file name, then the ShortName attribute may be specified. + /// Finally, if this attribute is omitted then its default value is the file name portion + /// of the Source attribute, if one is specified, or the value of the Id attribute, if + /// the Source attribute is omitted or doesn't contain a file name. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Set to yes in order to force this file to be the key path for the parent component. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short file names + /// or the user wants to manually specify the short file name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// Set to yes in order to have the file's read-only attribute set when it is installed on the target machine. + /// + public YesNoType ReadOnly + { + get + { + return this.readOnlyField; + } + set + { + this.readOnlyFieldSet = true; + this.readOnlyField = value; + } + } + + /// + /// Set to yes in order to have the file's hidden attribute set when it is installed on the target machine. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Set to yes in order to have the file's system attribute set when it is installed on the target machine. + /// + public YesNoType System + { + get + { + return this.systemField; + } + set + { + this.systemFieldSet = true; + this.systemField = value; + } + } + + /// + /// If a file is vital, then installation cannot proceed unless the file is successfully installed. The user will have no option to ignore an error installing this file. If an error occurs, they can merely retry to install the file or abort the installation. The default is "yes," unless the -sfdvital switch (candle.exe) or SuppressFileDefaultVital property (.wixproj) is used. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// This attribute should be set to "yes" for every executable file in the installation that has a valid checksum stored in the Portable Executable (PE) file header. Only those files that have this attribute set will be verified for valid checksum during a reinstall. + /// + public YesNoType Checksum + { + get + { + return this.checksumField; + } + set + { + this.checksumFieldSet = true; + this.checksumField = value; + } + } + + /// + /// Sets the file's source type compression. A setting of "yes" or "no" will override the setting in the Word Count Summary Property. + /// + public YesNoDefaultType Compressed + { + get + { + return this.compressedField; + } + set + { + this.compressedFieldSet = true; + this.compressedField = value; + } + } + + /// + /// A list of paths, separated by semicolons, that represent the paths to be searched to find the imported DLLs. The list is usually a list of properties, with each property enclosed inside square brackets. The value may be set to an empty string. Including this attribute will cause an entry to be generated for the file in the BindImage table. + /// + public string BindPath + { + get + { + return this.bindPathField; + } + set + { + this.bindPathFieldSet = true; + this.bindPathField = value; + } + } + + /// + /// The cost of registering the file in bytes. This must be a non-negative number. Including this attribute will cause an entry to be generated for the file in the SelfReg table. + /// + public int SelfRegCost + { + get + { + return this.selfRegCostField; + } + set + { + this.selfRegCostFieldSet = true; + this.selfRegCostField = value; + } + } + + /// + /// Causes an entry to be generated for the file in the Font table with no FontTitle specified. This attribute is intended to be used to register the file as a TrueType font. + /// + public YesNoType TrueType + { + get + { + return this.trueTypeField; + } + set + { + this.trueTypeFieldSet = true; + this.trueTypeField = value; + } + } + + /// + /// Causes an entry to be generated for the file in the Font table with the specified FontTitle. This attribute is intended to be used to register the file as a non-TrueType font. + /// + public string FontTitle + { + get + { + return this.fontTitleField; + } + set + { + this.fontTitleFieldSet = true; + this.fontTitleField = value; + } + } + + /// + /// This is the default language of this file. The linker will replace this value from the value in the file if the suppress files option is not used. + /// + public string DefaultLanguage + { + get + { + return this.defaultLanguageField; + } + set + { + this.defaultLanguageFieldSet = true; + this.defaultLanguageField = value; + } + } + + /// + /// This is the default size of this file. The linker will replace this value from the value in the file if the suppress files option is not used. + /// + public int DefaultSize + { + get + { + return this.defaultSizeField; + } + set + { + this.defaultSizeFieldSet = true; + this.defaultSizeField = value; + } + } + + /// + /// This is the default version of this file. The linker will replace this value from the value in the file if the suppress files option is not used. + /// + public string DefaultVersion + { + get + { + return this.defaultVersionField; + } + set + { + this.defaultVersionFieldSet = true; + this.defaultVersionField = value; + } + } + + /// + /// Specifies if this File is a Win32 Assembly or .NET Assembly that needs to be installed into the + /// Global Assembly Cache (GAC). If the value is '.net' or 'win32', this file must also be the key path of the Component. + /// + public AssemblyType Assembly + { + get + { + return this.assemblyField; + } + set + { + this.assemblyFieldSet = true; + this.assemblyField = value; + } + } + + /// + /// Specifies the file identifier of the manifest file that describes this assembly. + /// The manifest file should be in the same component as the assembly it describes. + /// This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'. + /// + public string AssemblyManifest + { + get + { + return this.assemblyManifestField; + } + set + { + this.assemblyManifestFieldSet = true; + this.assemblyManifestField = value; + } + } + + /// + /// Specifies the file identifier of the application file. This assembly will be isolated + /// to the same directory as the application file. + /// If this attribute is absent, the assembly will be installed to the Global Assembly Cache (GAC). + /// This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'. + /// + public string AssemblyApplication + { + get + { + return this.assemblyApplicationField; + } + set + { + this.assemblyApplicationFieldSet = true; + this.assemblyApplicationField = value; + } + } + + /// + /// Specifies the architecture for this assembly. This attribute should only be used on .NET Framework 2.0 or higher assemblies. + /// + public ProcessorArchitectureType ProcessorArchitecture + { + get + { + return this.processorArchitectureField; + } + set + { + this.processorArchitectureFieldSet = true; + this.processorArchitectureField = value; + } + } + + /// + /// The value of this attribute should correspond to the Id attribute of a Media + /// element authored elsewhere. By creating this connection between a file and + /// its media, you set the packaging options to the values specified in the Media + /// element (values such as compression level, cab embedding, etc...). Specifying + /// the DiskId attribute on the File element overrides the default DiskId attribute + /// from the parent Component element. If no DiskId attribute is specified, + /// the default is "1". This DiskId attribute is ignored when creating a merge module + /// because merge modules do not have media. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Specifies the path to the File in the build process. Overrides default source path set by parent directories and Name attribute. This attribute must be set if no source information can be gathered from parent directories. For more information, see + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// This attribute must be set for patch-added files. Each patch should be assigned a different patch group number. Patch groups + /// numbers must be greater 0 and should be assigned consecutively. For example, the first patch should use PatchGroup='1', the + /// second patch will have PatchGroup='2', etc... + /// + public int PatchGroup + { + get + { + return this.patchGroupField; + } + set + { + this.patchGroupFieldSet = true; + this.patchGroupField = value; + } + } + + /// + /// Prevents the updating of the file that is in fact changed in the upgraded image relative to the target images. + /// + public YesNoType PatchIgnore + { + get + { + return this.patchIgnoreField; + } + set + { + this.patchIgnoreFieldSet = true; + this.patchIgnoreField = value; + } + } + + /// + /// Set to indicate that the patch is non-vital. + /// + public YesNoType PatchAllowIgnoreOnError + { + get + { + return this.patchAllowIgnoreOnErrorField; + } + set + { + this.patchAllowIgnoreOnErrorFieldSet = true; + this.patchAllowIgnoreOnErrorField = value; + } + } + + /// + /// Set if the entire file should be installed rather than creating a binary patch. + /// + public YesNoType PatchWholeFile + { + get + { + return this.patchWholeFileField; + } + set + { + this.patchWholeFileFieldSet = true; + this.patchWholeFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AssemblyName" == childName)) + { + childValue = new AssemblyName(); + } + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("CopyFile" == childName)) + { + childValue = new CopyFile(); + } + if (("Shortcut" == childName)) + { + childValue = new Shortcut(); + } + if (("ODBCDriver" == childName)) + { + childValue = new ODBCDriver(); + } + if (("ODBCTranslator" == childName)) + { + childValue = new ODBCTranslator(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("Class" == childName)) + { + childValue = new Class(); + } + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("TypeLib" == childName)) + { + childValue = new TypeLib(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a AssemblyType from a string. + /// + public static AssemblyType ParseAssemblyType(string value) + { + AssemblyType parsedValue; + File.TryParseAssemblyType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a AssemblyType from a string. + /// + public static bool TryParseAssemblyType(string value, out AssemblyType parsedValue) + { + parsedValue = AssemblyType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if ((".net" == value)) + { + parsedValue = AssemblyType.net; + } + else + { + if (("no" == value)) + { + parsedValue = AssemblyType.no; + } + else + { + if (("win32" == value)) + { + parsedValue = AssemblyType.win32; + } + else + { + parsedValue = AssemblyType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a ProcessorArchitectureType from a string. + /// + public static ProcessorArchitectureType ParseProcessorArchitectureType(string value) + { + ProcessorArchitectureType parsedValue; + File.TryParseProcessorArchitectureType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ProcessorArchitectureType from a string. + /// + public static bool TryParseProcessorArchitectureType(string value, out ProcessorArchitectureType parsedValue) + { + parsedValue = ProcessorArchitectureType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("msil" == value)) + { + parsedValue = ProcessorArchitectureType.msil; + } + else + { + if (("x86" == value)) + { + parsedValue = ProcessorArchitectureType.x86; + } + else + { + if (("x64" == value)) + { + parsedValue = ProcessorArchitectureType.x64; + } + else + { + if (("ia64" == value)) + { + parsedValue = ProcessorArchitectureType.ia64; + } + else + { + parsedValue = ProcessorArchitectureType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("File", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.companionFileFieldSet) + { + writer.WriteAttributeString("CompanionFile", this.companionFileField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.readOnlyFieldSet) + { + if ((this.readOnlyField == YesNoType.no)) + { + writer.WriteAttributeString("ReadOnly", "no"); + } + if ((this.readOnlyField == YesNoType.yes)) + { + writer.WriteAttributeString("ReadOnly", "yes"); + } + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.systemFieldSet) + { + if ((this.systemField == YesNoType.no)) + { + writer.WriteAttributeString("System", "no"); + } + if ((this.systemField == YesNoType.yes)) + { + writer.WriteAttributeString("System", "yes"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.checksumFieldSet) + { + if ((this.checksumField == YesNoType.no)) + { + writer.WriteAttributeString("Checksum", "no"); + } + if ((this.checksumField == YesNoType.yes)) + { + writer.WriteAttributeString("Checksum", "yes"); + } + } + if (this.compressedFieldSet) + { + if ((this.compressedField == YesNoDefaultType.@default)) + { + writer.WriteAttributeString("Compressed", "default"); + } + if ((this.compressedField == YesNoDefaultType.no)) + { + writer.WriteAttributeString("Compressed", "no"); + } + if ((this.compressedField == YesNoDefaultType.yes)) + { + writer.WriteAttributeString("Compressed", "yes"); + } + } + if (this.bindPathFieldSet) + { + writer.WriteAttributeString("BindPath", this.bindPathField); + } + if (this.selfRegCostFieldSet) + { + writer.WriteAttributeString("SelfRegCost", this.selfRegCostField.ToString(CultureInfo.InvariantCulture)); + } + if (this.trueTypeFieldSet) + { + if ((this.trueTypeField == YesNoType.no)) + { + writer.WriteAttributeString("TrueType", "no"); + } + if ((this.trueTypeField == YesNoType.yes)) + { + writer.WriteAttributeString("TrueType", "yes"); + } + } + if (this.fontTitleFieldSet) + { + writer.WriteAttributeString("FontTitle", this.fontTitleField); + } + if (this.defaultLanguageFieldSet) + { + writer.WriteAttributeString("DefaultLanguage", this.defaultLanguageField); + } + if (this.defaultSizeFieldSet) + { + writer.WriteAttributeString("DefaultSize", this.defaultSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.defaultVersionFieldSet) + { + writer.WriteAttributeString("DefaultVersion", this.defaultVersionField); + } + if (this.assemblyFieldSet) + { + if ((this.assemblyField == AssemblyType.net)) + { + writer.WriteAttributeString("Assembly", ".net"); + } + if ((this.assemblyField == AssemblyType.no)) + { + writer.WriteAttributeString("Assembly", "no"); + } + if ((this.assemblyField == AssemblyType.win32)) + { + writer.WriteAttributeString("Assembly", "win32"); + } + } + if (this.assemblyManifestFieldSet) + { + writer.WriteAttributeString("AssemblyManifest", this.assemblyManifestField); + } + if (this.assemblyApplicationFieldSet) + { + writer.WriteAttributeString("AssemblyApplication", this.assemblyApplicationField); + } + if (this.processorArchitectureFieldSet) + { + if ((this.processorArchitectureField == ProcessorArchitectureType.msil)) + { + writer.WriteAttributeString("ProcessorArchitecture", "msil"); + } + if ((this.processorArchitectureField == ProcessorArchitectureType.x86)) + { + writer.WriteAttributeString("ProcessorArchitecture", "x86"); + } + if ((this.processorArchitectureField == ProcessorArchitectureType.x64)) + { + writer.WriteAttributeString("ProcessorArchitecture", "x64"); + } + if ((this.processorArchitectureField == ProcessorArchitectureType.ia64)) + { + writer.WriteAttributeString("ProcessorArchitecture", "ia64"); + } + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.patchGroupFieldSet) + { + writer.WriteAttributeString("PatchGroup", this.patchGroupField.ToString(CultureInfo.InvariantCulture)); + } + if (this.patchIgnoreFieldSet) + { + if ((this.patchIgnoreField == YesNoType.no)) + { + writer.WriteAttributeString("PatchIgnore", "no"); + } + if ((this.patchIgnoreField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchIgnore", "yes"); + } + } + if (this.patchAllowIgnoreOnErrorFieldSet) + { + if ((this.patchAllowIgnoreOnErrorField == YesNoType.no)) + { + writer.WriteAttributeString("PatchAllowIgnoreOnError", "no"); + } + if ((this.patchAllowIgnoreOnErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchAllowIgnoreOnError", "yes"); + } + } + if (this.patchWholeFileFieldSet) + { + if ((this.patchWholeFileField == YesNoType.no)) + { + writer.WriteAttributeString("PatchWholeFile", "no"); + } + if ((this.patchWholeFileField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchWholeFile", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("CompanionFile" == name)) + { + this.companionFileField = value; + this.companionFileFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("ReadOnly" == name)) + { + this.readOnlyField = Enums.ParseYesNoType(value); + this.readOnlyFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("System" == name)) + { + this.systemField = Enums.ParseYesNoType(value); + this.systemFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("Checksum" == name)) + { + this.checksumField = Enums.ParseYesNoType(value); + this.checksumFieldSet = true; + } + if (("Compressed" == name)) + { + this.compressedField = Enums.ParseYesNoDefaultType(value); + this.compressedFieldSet = true; + } + if (("BindPath" == name)) + { + this.bindPathField = value; + this.bindPathFieldSet = true; + } + if (("SelfRegCost" == name)) + { + this.selfRegCostField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.selfRegCostFieldSet = true; + } + if (("TrueType" == name)) + { + this.trueTypeField = Enums.ParseYesNoType(value); + this.trueTypeFieldSet = true; + } + if (("FontTitle" == name)) + { + this.fontTitleField = value; + this.fontTitleFieldSet = true; + } + if (("DefaultLanguage" == name)) + { + this.defaultLanguageField = value; + this.defaultLanguageFieldSet = true; + } + if (("DefaultSize" == name)) + { + this.defaultSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.defaultSizeFieldSet = true; + } + if (("DefaultVersion" == name)) + { + this.defaultVersionField = value; + this.defaultVersionFieldSet = true; + } + if (("Assembly" == name)) + { + this.assemblyField = File.ParseAssemblyType(value); + this.assemblyFieldSet = true; + } + if (("AssemblyManifest" == name)) + { + this.assemblyManifestField = value; + this.assemblyManifestFieldSet = true; + } + if (("AssemblyApplication" == name)) + { + this.assemblyApplicationField = value; + this.assemblyApplicationFieldSet = true; + } + if (("ProcessorArchitecture" == name)) + { + this.processorArchitectureField = File.ParseProcessorArchitectureType(value); + this.processorArchitectureFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("PatchGroup" == name)) + { + this.patchGroupField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.patchGroupFieldSet = true; + } + if (("PatchIgnore" == name)) + { + this.patchIgnoreField = Enums.ParseYesNoType(value); + this.patchIgnoreFieldSet = true; + } + if (("PatchAllowIgnoreOnError" == name)) + { + this.patchAllowIgnoreOnErrorField = Enums.ParseYesNoType(value); + this.patchAllowIgnoreOnErrorFieldSet = true; + } + if (("PatchWholeFile" == name)) + { + this.patchWholeFileField = Enums.ParseYesNoType(value); + this.patchWholeFileFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum AssemblyType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The file is a .NET Framework assembly. + /// + net, + + /// + /// The file is not a .NET Framework or Win32 assembly. This is the default value. + /// + no, + + /// + /// The file is a Win32 assembly. + /// + win32, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ProcessorArchitectureType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The file is a .NET Framework assembly that is processor-neutral. + /// + msil, + + /// + /// The file is a .NET Framework assembly for the x86 processor. + /// + x86, + + /// + /// The file is a .NET Framework assembly for the x64 processor. + /// + x64, + + /// + /// The file is a .NET Framework assembly for the ia64 processor. + /// + ia64, + } + } + + /// + /// Use several of these elements to specify each registry value in a multiString registry value. This element + /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The + /// values should go in the text area of the MultiStringValue element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MultiStringValue : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Use several of these elements to specify each registry value in a multiString registry value. This element + /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The + /// values should go in the text area of the MultiStringValue element. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MultiStringValue", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Used for organization of child RegistryValue elements or to create a registry key + /// (and optionally remove it during uninstallation). + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistryKey : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private YesNoType forceCreateOnInstallField; + + private bool forceCreateOnInstallFieldSet; + + private YesNoType forceDeleteOnUninstallField; + + private bool forceDeleteOnUninstallFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private ISchemaElement parentElement; + + public RegistryKey() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryKey))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The Action attribute has been deprecated. In most cases, you can simply omit @Action. If you need to force Windows Installer + /// to create an empty key or recursively delete the key, use the ForceCreateOnInstall or ForceDeleteOnUninstall attributes instead. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Set this attribute to 'yes' to create an empty key, if absent, when the parent component is installed. + /// This value is needed only to create an empty key with no subkeys or values. Windows Installer creates + /// keys as needed to store subkeys and values. The default is "no". + /// + public YesNoType ForceCreateOnInstall + { + get + { + return this.forceCreateOnInstallField; + } + set + { + this.forceCreateOnInstallFieldSet = true; + this.forceCreateOnInstallField = value; + } + } + + /// + /// Set this attribute to 'yes' to remove the key with all its values and subkeys when the parent component is uninstalled. + /// Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already + /// removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall. + /// The default is "no". + /// + public YesNoType ForceDeleteOnUninstall + { + get + { + return this.forceDeleteOnUninstallField; + } + set + { + this.forceDeleteOnUninstallFieldSet = true; + this.forceDeleteOnUninstallField = value; + } + } + + /// + /// The localizable key for the registry value. + /// If the parent element is a RegistryKey, this value may be omitted to use the + /// path of the parent, or if its specified it will be appended to the path of the parent. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RegistryKey" == childName)) + { + childValue = new RegistryKey(); + } + if (("RegistryValue" == childName)) + { + childValue = new RegistryValue(); + } + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RegistryKey.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("create" == value)) + { + parsedValue = ActionType.create; + } + else + { + if (("createAndRemoveOnUninstall" == value)) + { + parsedValue = ActionType.createAndRemoveOnUninstall; + } + else + { + if (("none" == value)) + { + parsedValue = ActionType.none; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistryKey", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.create)) + { + writer.WriteAttributeString("Action", "create"); + } + if ((this.actionField == ActionType.createAndRemoveOnUninstall)) + { + writer.WriteAttributeString("Action", "createAndRemoveOnUninstall"); + } + if ((this.actionField == ActionType.none)) + { + writer.WriteAttributeString("Action", "none"); + } + } + if (this.forceCreateOnInstallFieldSet) + { + if ((this.forceCreateOnInstallField == YesNoType.no)) + { + writer.WriteAttributeString("ForceCreateOnInstall", "no"); + } + if ((this.forceCreateOnInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("ForceCreateOnInstall", "yes"); + } + } + if (this.forceDeleteOnUninstallFieldSet) + { + if ((this.forceDeleteOnUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("ForceDeleteOnUninstall", "no"); + } + if ((this.forceDeleteOnUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("ForceDeleteOnUninstall", "yes"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RegistryKey.ParseActionType(value); + this.actionFieldSet = true; + } + if (("ForceCreateOnInstall" == name)) + { + this.forceCreateOnInstallField = Enums.ParseYesNoType(value); + this.forceCreateOnInstallFieldSet = true; + } + if (("ForceDeleteOnUninstall" == name)) + { + this.forceDeleteOnUninstallField = Enums.ParseYesNoType(value); + this.forceDeleteOnUninstallFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates the key, if absent, when the parent component is installed. + /// + create, + + /// + /// Creates the key, if absent, when the parent component is installed then remove the key with all its values and subkeys when the parent component is uninstalled. + /// Note that this value is useful only if your program creates additional values or subkeys under this key and you want an uninstall to remove them. MSI already + /// removes all values and subkeys that it creates, so this option just adds additional overhead to uninstall. + /// + createAndRemoveOnUninstall, + + /// + /// Does nothing; this element is used merely in WiX authoring for organization and does nothing to the final output. + /// This is the default value. + /// + none, + } + } + + /// + /// Used to create a registry value. For multi-string values, this can be used to prepend or append values. + /// + /// For legacy authoring: Use several of these elements to specify each registry value in a multiString registry value. This element + /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The + /// values should go in the text area of the RegistryValue element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegistryValue : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private ISchemaElement parentElement; + + public RegistryValue() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MultiStringValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// The localizable key for the registry value. + /// If the parent element is a RegistryKey, this value may be omitted to use the + /// path of the parent, or if its specified it will be appended to the path of the parent. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The localizable registry value name. If this attribute is not provided the default value for the registry key will + /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not + /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Set this attribute to the localizable registry value. This value is formatted. The Windows Installer allows + /// several special values to be set for this attribute. You should not use them in WiX. Instead use appropriate + /// values in the Type attribute to get the desired behavior. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Set this attribute to the type of the desired registry key. This attribute must be specified whenever the Value + /// attribute or a child RegistryValue element is specified. This attribute + /// should only be set when the value of the Action attribute does not include the word 'remove'. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// This is the action that will be taken for this registry value. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Set this attribute to 'yes' to make this registry key the KeyPath of the parent component. + /// Only one resource (registry, file, etc) can be the KeyPath of a component. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("MultiStringValue" == childName)) + { + childValue = new MultiStringValue(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + RegistryValue.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + if (("integer" == value)) + { + parsedValue = TypeType.integer; + } + else + { + if (("binary" == value)) + { + parsedValue = TypeType.binary; + } + else + { + if (("expandable" == value)) + { + parsedValue = TypeType.expandable; + } + else + { + if (("multiString" == value)) + { + parsedValue = TypeType.multiString; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RegistryValue.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("append" == value)) + { + parsedValue = ActionType.append; + } + else + { + if (("prepend" == value)) + { + parsedValue = ActionType.prepend; + } + else + { + if (("write" == value)) + { + parsedValue = ActionType.write; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegistryValue", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + if ((this.typeField == TypeType.integer)) + { + writer.WriteAttributeString("Type", "integer"); + } + if ((this.typeField == TypeType.binary)) + { + writer.WriteAttributeString("Type", "binary"); + } + if ((this.typeField == TypeType.expandable)) + { + writer.WriteAttributeString("Type", "expandable"); + } + if ((this.typeField == TypeType.multiString)) + { + writer.WriteAttributeString("Type", "multiString"); + } + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.append)) + { + writer.WriteAttributeString("Action", "append"); + } + if ((this.actionField == ActionType.prepend)) + { + writer.WriteAttributeString("Action", "prepend"); + } + if ((this.actionField == ActionType.write)) + { + writer.WriteAttributeString("Action", "write"); + } + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = RegistryValue.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RegistryValue.ParseActionType(value); + this.actionFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The value is interpreted and stored as a string (REG_SZ). + /// + @string, + + /// + /// The value is interpreted and stored as an integer (REG_DWORD). + /// + integer, + + /// + /// The value is interpreted and stored as a hexadecimal value (REG_BINARY). + /// + binary, + + /// + /// The value is interpreted and stored as an expandable string (REG_EXPAND_SZ). + /// + expandable, + + /// + /// The value is interpreted and stored as a multiple strings (REG_MULTI_SZ). + /// Please note that this value will only result in a multi-string value if there is more than one registry value + /// or the Action attribute's value is 'append' or 'prepend'. Otherwise a string value will be created. + /// + multiString, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Appends the specified value(s) to a multiString registry value. + /// + append, + + /// + /// Prepends the specified value(s) to a multiString registry value. + /// + prepend, + + /// + /// Writes a registry value. This is the default value. + /// + write, + } + } + + /// + /// Used for removing registry keys and all child keys either during install or uninstall. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveRegistryKey : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This is the action that will be taken for this registry value. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The localizable key for the registry value. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + RemoveRegistryKey.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("removeOnInstall" == value)) + { + parsedValue = ActionType.removeOnInstall; + } + else + { + if (("removeOnUninstall" == value)) + { + parsedValue = ActionType.removeOnUninstall; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveRegistryKey", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.removeOnInstall)) + { + writer.WriteAttributeString("Action", "removeOnInstall"); + } + if ((this.actionField == ActionType.removeOnUninstall)) + { + writer.WriteAttributeString("Action", "removeOnUninstall"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = RemoveRegistryKey.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Removes a key with all its values and subkeys when the parent component is installed. + /// + removeOnInstall, + + /// + /// Removes a key with all its values and subkeys when the parent component is uninstalled. + /// + removeOnUninstall, + } + } + + /// + /// Used to remove a registry value during installation. + /// There is no standard way to remove a single registry value during uninstall (but you can remove an entire key with RemoveRegistryKey). + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveRegistryValue : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The localizable key for the registry value. + /// If the parent element is a RegistryKey, this value may be omitted to use the + /// path of the parent, or if its specified it will be appended to the path of the parent. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// The localizable registry value name. If this attribute is not provided the default value for the registry key will + /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not + /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveRegistryValue", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Registry : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private string keyField; + + private bool keyFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private RegistryRootType rootField; + + private bool rootFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + public Registry() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Registry))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Primary key used to identify this particular entry. If this attribute is not specified, an identifier will be + /// generated by hashing the parent Component identifier, Root, Key, and Name. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This is the action that will be taken for this registry key. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The localizable key for the registry value. + /// + public string Key + { + get + { + return this.keyField; + } + set + { + this.keyFieldSet = true; + this.keyField = value; + } + } + + /// + /// Set this attribute to 'yes' to make this registry key the KeyPath of the parent component. Only one resource (registry, + /// file, etc) can be the KeyPath of a component. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// The localizable registry value name. If this attribute is not provided the default value for the registry key will + /// be set instead. The Windows Installer allows several special values to be set for this attribute. You should not + /// use them in WiX. Instead use appropriate values in the Action attribute to get the desired behavior. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The predefined root key for the registry value. + /// + public RegistryRootType Root + { + get + { + return this.rootField; + } + set + { + this.rootFieldSet = true; + this.rootField = value; + } + } + + /// + /// Set this attribute to the type of the desired registry key. This attribute must be specified whenever the Value + /// attribute or a child RegistryValue element is specified. This attribute + /// should only be set when the value of the Action attribute does not include the word 'remove'. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Set this attribute to the localizable registry value. This value is formatted. The Windows Installer allows + /// several special values to be set for this attribute. You should not use them in WiX. Instead use appropriate + /// values in the Type attribute to get the desired behavior. This attribute cannot be specified if the Action + /// attribute's value contains the word 'remove'. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("RegistryValue" == childName)) + { + childValue = new RegistryValue(); + } + if (("Registry" == childName)) + { + childValue = new Registry(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + Registry.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("append" == value)) + { + parsedValue = ActionType.append; + } + else + { + if (("createKey" == value)) + { + parsedValue = ActionType.createKey; + } + else + { + if (("createKeyAndRemoveKeyOnUninstall" == value)) + { + parsedValue = ActionType.createKeyAndRemoveKeyOnUninstall; + } + else + { + if (("prepend" == value)) + { + parsedValue = ActionType.prepend; + } + else + { + if (("remove" == value)) + { + parsedValue = ActionType.remove; + } + else + { + if (("removeKeyOnInstall" == value)) + { + parsedValue = ActionType.removeKeyOnInstall; + } + else + { + if (("removeKeyOnUninstall" == value)) + { + parsedValue = ActionType.removeKeyOnUninstall; + } + else + { + if (("write" == value)) + { + parsedValue = ActionType.write; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + Registry.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + if (("integer" == value)) + { + parsedValue = TypeType.integer; + } + else + { + if (("binary" == value)) + { + parsedValue = TypeType.binary; + } + else + { + if (("expandable" == value)) + { + parsedValue = TypeType.expandable; + } + else + { + if (("multiString" == value)) + { + parsedValue = TypeType.multiString; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Registry", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.append)) + { + writer.WriteAttributeString("Action", "append"); + } + if ((this.actionField == ActionType.createKey)) + { + writer.WriteAttributeString("Action", "createKey"); + } + if ((this.actionField == ActionType.createKeyAndRemoveKeyOnUninstall)) + { + writer.WriteAttributeString("Action", "createKeyAndRemoveKeyOnUninstall"); + } + if ((this.actionField == ActionType.prepend)) + { + writer.WriteAttributeString("Action", "prepend"); + } + if ((this.actionField == ActionType.remove)) + { + writer.WriteAttributeString("Action", "remove"); + } + if ((this.actionField == ActionType.removeKeyOnInstall)) + { + writer.WriteAttributeString("Action", "removeKeyOnInstall"); + } + if ((this.actionField == ActionType.removeKeyOnUninstall)) + { + writer.WriteAttributeString("Action", "removeKeyOnUninstall"); + } + if ((this.actionField == ActionType.write)) + { + writer.WriteAttributeString("Action", "write"); + } + } + if (this.keyFieldSet) + { + writer.WriteAttributeString("Key", this.keyField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.rootFieldSet) + { + if ((this.rootField == RegistryRootType.HKMU)) + { + writer.WriteAttributeString("Root", "HKMU"); + } + if ((this.rootField == RegistryRootType.HKCR)) + { + writer.WriteAttributeString("Root", "HKCR"); + } + if ((this.rootField == RegistryRootType.HKCU)) + { + writer.WriteAttributeString("Root", "HKCU"); + } + if ((this.rootField == RegistryRootType.HKLM)) + { + writer.WriteAttributeString("Root", "HKLM"); + } + if ((this.rootField == RegistryRootType.HKU)) + { + writer.WriteAttributeString("Root", "HKU"); + } + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + if ((this.typeField == TypeType.integer)) + { + writer.WriteAttributeString("Type", "integer"); + } + if ((this.typeField == TypeType.binary)) + { + writer.WriteAttributeString("Type", "binary"); + } + if ((this.typeField == TypeType.expandable)) + { + writer.WriteAttributeString("Type", "expandable"); + } + if ((this.typeField == TypeType.multiString)) + { + writer.WriteAttributeString("Type", "multiString"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = Registry.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Key" == name)) + { + this.keyField = value; + this.keyFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Root" == name)) + { + this.rootField = Enums.ParseRegistryRootType(value); + this.rootFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Registry.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Appends the specified value(s) to a multiString registry key. + /// + append, + + /// + /// Creates the key, if absent, when the parent component is installed. + /// + createKey, + + /// + /// Creates the key, if absent, when the parent component is installed then remove the key with all its values and subkeys when the parent component is uninstalled. + /// + createKeyAndRemoveKeyOnUninstall, + + /// + /// Prepends the specified value(s) to a multiString registry key. + /// + prepend, + + /// + /// Removes a registry name when the parent component is installed. + /// + remove, + + /// + /// Removes a key with all its values and subkeys when the parent component is installed. + /// + removeKeyOnInstall, + + /// + /// Removes a key with all its values and subkeys when the parent component is uninstalled. + /// + removeKeyOnUninstall, + + /// + /// Writes a registry value. + /// + write, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The value is interpreted and stored as a string (REG_SZ). + /// + @string, + + /// + /// The value is interpreted and stored as an integer (REG_DWORD). + /// + integer, + + /// + /// The value is interpreted and stored as a hexadecimal value (REG_BINARY). + /// + binary, + + /// + /// The value is interpreted and stored as an expandable string (REG_EXPAND_SZ). + /// + expandable, + + /// + /// The value is interpreted and stored as a multiple strings (REG_MULTI_SZ). + /// Please note that this value will only result in a multi-string value if there is more than one registry value + /// or the Action attribute's value is 'append' or 'prepend'. Otherwise a string value will be created. + /// + multiString, + } + } + + /// + /// Remove a file(s) if the parent component is selected for installation or removal. Multiple files can be removed + /// by specifying a wildcard for the value of the Name attribute. By default, the source + /// directory of the file is the directory of the parent component. This can be overridden by specifying the + /// Directory attribute with a value corresponding to the Id of the source directory, or by specifying the Property + /// attribute with a value corresponding to a property that will have a value that resolves to the full path + /// to the source directory. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFile : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private InstallUninstallType onField; + + private bool onFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Overrides the directory of the parent component with a specific Directory. This Directory must exist in the + /// installer database at creation time. This attribute cannot be specified in conjunction with the Property attribute. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// Overrides the directory of the parent component with the value of the specified property. The property + /// should have a value that resolves to the full path of the source directory. The property does not have + /// to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. This attribute cannot be specified in conjunction with the Directory attribute. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This value should be set to the localizable name of the file(s) to be removed. All of the files that + /// match the wild card will be removed from the specified directory. The value is a filename that may also + /// contain the wild card characters "?" for any single character or "*" for zero or more occurrences of any character. + /// In prior versions of the WiX toolset, this attribute specified the short file name. + /// This attribute's value may now be either a short or long file name. + /// If a short file name is specified, the ShortName attribute may not be specified. + /// Also, if this value is a long file name, the ShortName attribute may be omitted to + /// allow WiX to attempt to generate a unique short file name. + /// However, if you wish to manually specify the short file name, then the ShortName attribute may be specified. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short file name of the file in 8.3 format. + /// This attribute should only be set if you want to manually specify the short file name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// This value determines the time at which the file(s) may be removed. For 'install', the file will + /// be removed only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the file will be removed only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the file will be removed in both cases. + /// + public InstallUninstallType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFile", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.onFieldSet) + { + if ((this.onField == InstallUninstallType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + if ((this.onField == InstallUninstallType.both)) + { + writer.WriteAttributeString("On", "both"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("On" == name)) + { + this.onField = Enums.ParseInstallUninstallType(value); + this.onFieldSet = true; + } + } + } + + /// + /// Remove an empty folder if the parent component is selected for installation or removal. By default, the folder + /// is the directory of the parent component. This can be overridden by specifying the Directory attribute + /// with a value corresponding to the Id of the directory, or by specifying the Property attribute with a value + /// corresponding to a property that will have a value that resolves to the full path of the folder. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFolder : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private InstallUninstallType onField; + + private bool onFieldSet; + + private ISchemaElement parentElement; + + /// + /// Primary key used to identify this particular entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Overrides the directory of the parent component with a specific Directory. This Directory must exist in the + /// installer database at creation time. This attribute cannot be specified in conjunction with the Property attribute. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// Overrides the directory of the parent component with the value of the specified property. The property + /// should have a value that resolves to the full path of the source directory. The property does not have + /// to exist in the installer database at creation time; it could be created at installation time by a custom + /// action, on the command line, etc. This attribute cannot be specified in conjunction with the Directory attribute. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This value determines the time at which the folder may be removed, based on the install/uninstall of the parent component. + /// For 'install', the folder will be removed only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the folder will be removed only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the folder will be removed in both cases. + /// + public InstallUninstallType On + { + get + { + return this.onField; + } + set + { + this.onFieldSet = true; + this.onField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFolder", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.onFieldSet) + { + if ((this.onField == InstallUninstallType.install)) + { + writer.WriteAttributeString("On", "install"); + } + if ((this.onField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("On", "uninstall"); + } + if ((this.onField == InstallUninstallType.both)) + { + writer.WriteAttributeString("On", "both"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("On" == name)) + { + this.onField = Enums.ParseInstallUninstallType(value); + this.onFieldSet = true; + } + } + } + + /// + /// Create folder as part of parent Component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CreateFolder : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string directoryField; + + private bool directoryFieldSet; + + private ISchemaElement parentElement; + + public CreateFolder() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Permission))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier of Directory to create. Defaults to Directory of parent Component. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Shortcut" == childName)) + { + childValue = new Shortcut(); + } + if (("Permission" == childName)) + { + childValue = new Permission(); + } + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CreateFolder", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + } + } + + /// + /// Optional way for defining AppData, generally used for complex CDATA. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AppData : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Optional way for defining AppData, generally used for complex CDATA. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AppData", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Qualified published component for parent Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Category : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string qualifierField; + + private bool qualifierFieldSet; + + private string appDataField; + + private bool appDataFieldSet; + + private string featureField; + + private bool featureFieldSet; + + private ISchemaElement parentElement; + + public Category() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(AppData))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// A string GUID that represents the category of components being grouped together. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// A text string that qualifies the value in the Id attribute. A qualifier is used to distinguish multiple forms of the same Component, such as a Component that is implemented in multiple languages. + /// + public string Qualifier + { + get + { + return this.qualifierField; + } + set + { + this.qualifierFieldSet = true; + this.qualifierField = value; + } + } + + /// + /// An optional localizable text describing the category. The string is commonly parsed by the application and can be displayed to the user. It should describe the category. + /// + public string AppData + { + get + { + return this.appDataField; + } + set + { + this.appDataFieldSet = true; + this.appDataField = value; + } + } + + /// + /// Feature that controls the advertisement of the category. Defaults to the primary Feature for the parent Component . + /// + public string Feature + { + get + { + return this.featureField; + } + set + { + this.featureFieldSet = true; + this.featureField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppData" == childName)) + { + childValue = new AppData(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Category", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.qualifierFieldSet) + { + writer.WriteAttributeString("Qualifier", this.qualifierField); + } + if (this.appDataFieldSet) + { + writer.WriteAttributeString("AppData", this.appDataField); + } + if (this.featureFieldSet) + { + writer.WriteAttributeString("Feature", this.featureField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Qualifier" == name)) + { + this.qualifierField = value; + this.qualifierFieldSet = true; + } + if (("AppData" == name)) + { + this.appDataField = value; + this.appDataFieldSet = true; + } + if (("Feature" == name)) + { + this.featureField = value; + this.featureFieldSet = true; + } + } + } + + /// + /// MIME content-type for an Extension + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MIME : ISchemaElement, ISetAttributes + { + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string contentTypeField; + + private bool contentTypeFieldSet; + + private string classField; + + private bool classFieldSet; + + private YesNoType defaultField; + + private bool defaultFieldSet; + + private ISchemaElement parentElement; + + /// + /// Whether this MIME is to be advertised. The default is to match whatever the parent extension element uses. If the parent element is not advertised, then this element cannot be advertised either. + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// This is the identifier for the MIME content. It is commonly written in the form of type/format. + /// + public string ContentType + { + get + { + return this.contentTypeField; + } + set + { + this.contentTypeFieldSet = true; + this.contentTypeField = value; + } + } + + /// + /// Class ID for the COM server that is to be associated with the MIME content. + /// + public string Class + { + get + { + return this.classField; + } + set + { + this.classFieldSet = true; + this.classField = value; + } + } + + /// + /// If 'yes', become the content type for the parent Extension. The default value is 'no'. + /// + public YesNoType Default + { + get + { + return this.defaultField; + } + set + { + this.defaultFieldSet = true; + this.defaultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MIME", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.contentTypeFieldSet) + { + writer.WriteAttributeString("ContentType", this.contentTypeField); + } + if (this.classFieldSet) + { + writer.WriteAttributeString("Class", this.classField); + } + if (this.defaultFieldSet) + { + if ((this.defaultField == YesNoType.no)) + { + writer.WriteAttributeString("Default", "no"); + } + if ((this.defaultField == YesNoType.yes)) + { + writer.WriteAttributeString("Default", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("ContentType" == name)) + { + this.contentTypeField = value; + this.contentTypeFieldSet = true; + } + if (("Class" == name)) + { + this.classField = value; + this.classFieldSet = true; + } + if (("Default" == name)) + { + this.defaultField = Enums.ParseYesNoType(value); + this.defaultFieldSet = true; + } + } + } + + /// + /// Verb definition for an Extension. When advertised, this element creates a row in the + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Verb : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string commandField; + + private bool commandFieldSet; + + private string argumentField; + + private bool argumentFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string targetField; + + private bool targetFieldSet; + + private string targetFileField; + + private bool targetFileFieldSet; + + private string targetPropertyField; + + private bool targetPropertyFieldSet; + + private ISchemaElement parentElement; + + /// + /// The verb for the command. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The localized text displayed on the context menu. + /// + public string Command + { + get + { + return this.commandField; + } + set + { + this.commandFieldSet = true; + this.commandField = value; + } + } + + /// + /// Value for the command arguments. Note that the resolution of properties in the + /// Argument field is limited. A property formatted as [Property] in this field can only be resolved if the property + /// already has the intended value when the component owning the verb is installed. For example, for the argument + /// "[#MyDoc.doc]" to resolve to the correct value, the same process must be installing the file MyDoc.doc and the + /// component that owns the verb. + /// + public string Argument + { + get + { + return this.argumentField; + } + set + { + this.argumentFieldSet = true; + this.argumentField = value; + } + } + + /// + /// The sequence of the commands. Only verbs for which the Sequence is specified + /// are used to prepare an ordered list for the default value of the shell key. The Verb with the lowest value in this + /// column becomes the default verb. Used only for Advertised verbs. + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + public string Target + { + get + { + return this.targetField; + } + set + { + this.targetFieldSet = true; + this.targetField = value; + } + } + + /// + /// Either this attribute or the TargetProperty attribute must be specified for a non-advertised verb. + /// The value should be the identifier of the target file to be executed for the verb. + /// + public string TargetFile + { + get + { + return this.targetFileField; + } + set + { + this.targetFileFieldSet = true; + this.targetFileField = value; + } + } + + /// + /// Either this attribute or the TargetFile attribute must be specified for a non-advertised verb. + /// The value should be the identifier of the property which will resolve to the path to the target file to be executed for the verb. + /// + public string TargetProperty + { + get + { + return this.targetPropertyField; + } + set + { + this.targetPropertyFieldSet = true; + this.targetPropertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Verb", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.commandFieldSet) + { + writer.WriteAttributeString("Command", this.commandField); + } + if (this.argumentFieldSet) + { + writer.WriteAttributeString("Argument", this.argumentField); + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.targetFieldSet) + { + writer.WriteAttributeString("Target", this.targetField); + } + if (this.targetFileFieldSet) + { + writer.WriteAttributeString("TargetFile", this.targetFileField); + } + if (this.targetPropertyFieldSet) + { + writer.WriteAttributeString("TargetProperty", this.targetPropertyField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Command" == name)) + { + this.commandField = value; + this.commandFieldSet = true; + } + if (("Argument" == name)) + { + this.argumentField = value; + this.argumentFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Target" == name)) + { + this.targetField = value; + this.targetFieldSet = true; + } + if (("TargetFile" == name)) + { + this.targetFileField = value; + this.targetFileFieldSet = true; + } + if (("TargetProperty" == name)) + { + this.targetPropertyField = value; + this.targetPropertyFieldSet = true; + } + } + } + + /// + /// Extension for a Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Extension : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string contentTypeField; + + private bool contentTypeFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private ISchemaElement parentElement; + + public Extension() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MIME))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Verb))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// This is simply the file extension, like "doc" or "xml". Do not include the preceding period. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The MIME type that is to be written. + /// + public string ContentType + { + get + { + return this.contentTypeField; + } + set + { + this.contentTypeFieldSet = true; + this.contentTypeField = value; + } + } + + /// + /// Whether this extension is to be advertised. The default is "no". + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("MIME" == childName)) + { + childValue = new MIME(); + } + if (("Verb" == childName)) + { + childValue = new Verb(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Extension", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.contentTypeFieldSet) + { + writer.WriteAttributeString("ContentType", this.contentTypeField); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ContentType" == name)) + { + this.contentTypeField = value; + this.contentTypeFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + } + } + + /// + /// Register a type library (TypeLib). Please note that in order to properly use this + /// non-advertised, you will need use this element with Advertise='no' and also author the + /// appropriate child Interface elements by extracting them from the type library itself. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TypeLib : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private YesNoType controlField; + + private bool controlFieldSet; + + private int costField; + + private bool costFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private YesNoType hasDiskImageField; + + private bool hasDiskImageFieldSet; + + private string helpDirectoryField; + + private bool helpDirectoryFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private int languageField; + + private bool languageFieldSet; + + private int majorVersionField; + + private bool majorVersionFieldSet; + + private int minorVersionField; + + private bool minorVersionFieldSet; + + private int resourceIdField; + + private bool resourceIdFieldSet; + + private YesNoType restrictedField; + + private bool restrictedFieldSet; + + private ISchemaElement parentElement; + + public TypeLib() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The GUID that identifes the type library. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Value of 'yes' will create a row in the TypeLib table. + /// Value of 'no' will create rows in the Registry table. + /// The default value is 'no'. + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Value of 'yes' means the type library describes controls, and should not be displayed in type browsers intended for nonvisual objects. + /// This attribute can only be set if Advertise='no'. + /// + public YesNoType Control + { + get + { + return this.controlField; + } + set + { + this.controlFieldSet = true; + this.controlField = value; + } + } + + /// + /// The cost associated with the registration of the type library in bytes. This attribute cannot be set if Advertise='no'. + /// + public int Cost + { + get + { + return this.costField; + } + set + { + this.costFieldSet = true; + this.costField = value; + } + } + + /// + /// The localizable description of the type library. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Value of 'yes' means the type library exists in a persisted form on disk. This attribute can only be set if Advertise='no'. + /// + public YesNoType HasDiskImage + { + get + { + return this.hasDiskImageField; + } + set + { + this.hasDiskImageFieldSet = true; + this.hasDiskImageField = value; + } + } + + /// + /// The identifier of the Directory element for the help directory. + /// + public string HelpDirectory + { + get + { + return this.helpDirectoryField; + } + set + { + this.helpDirectoryFieldSet = true; + this.helpDirectoryField = value; + } + } + + /// + /// Value of 'yes' means the type library should not be displayed to users, although its use is not restricted. + /// Should be used by controls. Hosts should create a new type library that wraps the control with extended properties. + /// This attribute can only be set if Advertise='no'. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// The language of the type library. This must be a non-negative integer. + /// + public int Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The major version of the type library. The value should be an integer from 0 - 255. + /// + public int MajorVersion + { + get + { + return this.majorVersionField; + } + set + { + this.majorVersionFieldSet = true; + this.majorVersionField = value; + } + } + + /// + /// The minor version of the type library. The value should be an integer from 0 - 255. + /// + public int MinorVersion + { + get + { + return this.minorVersionField; + } + set + { + this.minorVersionFieldSet = true; + this.minorVersionField = value; + } + } + + /// + /// The resource id of a typelib. The value is appended to the end of the typelib path in the registry. + /// + public int ResourceId + { + get + { + return this.resourceIdField; + } + set + { + this.resourceIdFieldSet = true; + this.resourceIdField = value; + } + } + + /// + /// Value of 'yes' means the type library is restricted, and should not be displayed to users. This attribute can only be set if Advertise='no'. + /// + public YesNoType Restricted + { + get + { + return this.restrictedField; + } + set + { + this.restrictedFieldSet = true; + this.restrictedField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Class" == childName)) + { + childValue = new Class(); + } + if (("Interface" == childName)) + { + childValue = new Interface(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TypeLib", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.controlFieldSet) + { + if ((this.controlField == YesNoType.no)) + { + writer.WriteAttributeString("Control", "no"); + } + if ((this.controlField == YesNoType.yes)) + { + writer.WriteAttributeString("Control", "yes"); + } + } + if (this.costFieldSet) + { + writer.WriteAttributeString("Cost", this.costField.ToString(CultureInfo.InvariantCulture)); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.hasDiskImageFieldSet) + { + if ((this.hasDiskImageField == YesNoType.no)) + { + writer.WriteAttributeString("HasDiskImage", "no"); + } + if ((this.hasDiskImageField == YesNoType.yes)) + { + writer.WriteAttributeString("HasDiskImage", "yes"); + } + } + if (this.helpDirectoryFieldSet) + { + writer.WriteAttributeString("HelpDirectory", this.helpDirectoryField); + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField.ToString(CultureInfo.InvariantCulture)); + } + if (this.majorVersionFieldSet) + { + writer.WriteAttributeString("MajorVersion", this.majorVersionField.ToString(CultureInfo.InvariantCulture)); + } + if (this.minorVersionFieldSet) + { + writer.WriteAttributeString("MinorVersion", this.minorVersionField.ToString(CultureInfo.InvariantCulture)); + } + if (this.resourceIdFieldSet) + { + writer.WriteAttributeString("ResourceId", this.resourceIdField.ToString(CultureInfo.InvariantCulture)); + } + if (this.restrictedFieldSet) + { + if ((this.restrictedField == YesNoType.no)) + { + writer.WriteAttributeString("Restricted", "no"); + } + if ((this.restrictedField == YesNoType.yes)) + { + writer.WriteAttributeString("Restricted", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("Control" == name)) + { + this.controlField = Enums.ParseYesNoType(value); + this.controlFieldSet = true; + } + if (("Cost" == name)) + { + this.costField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.costFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("HasDiskImage" == name)) + { + this.hasDiskImageField = Enums.ParseYesNoType(value); + this.hasDiskImageFieldSet = true; + } + if (("HelpDirectory" == name)) + { + this.helpDirectoryField = value; + this.helpDirectoryFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.languageFieldSet = true; + } + if (("MajorVersion" == name)) + { + this.majorVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.majorVersionFieldSet = true; + } + if (("MinorVersion" == name)) + { + this.minorVersionField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.minorVersionFieldSet = true; + } + if (("ResourceId" == name)) + { + this.resourceIdField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.resourceIdFieldSet = true; + } + if (("Restricted" == name)) + { + this.restrictedField = Enums.ParseYesNoType(value); + this.restrictedFieldSet = true; + } + } + } + + /// + /// ProgId registration for parent Component. If ProgId has an associated Class, it must be a child of that element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProgId : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string noOpenField; + + private bool noOpenFieldSet; + + private ISchemaElement parentElement; + + public ProgId() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ProgId))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Extension))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// For an advertised ProgId, the Id of an Icon element. For a non-advertised ProgId, this is the Id of a file containing an icon resource. + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Specifies that the associated ProgId should not be opened by users. The value is presented as a warning to users. An empty string is also valid for this attribute. + /// + public string NoOpen + { + get + { + return this.noOpenField; + } + set + { + this.noOpenFieldSet = true; + this.noOpenField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProgId" == childName)) + { + childValue = new ProgId(); + } + if (("Extension" == childName)) + { + childValue = new Extension(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProgId", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.noOpenFieldSet) + { + writer.WriteAttributeString("NoOpen", this.noOpenField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("NoOpen" == name)) + { + this.noOpenField = value; + this.noOpenFieldSet = true; + } + } + } + + /// + /// Application ID containing DCOM information for the associated application GUID. + /// If this element is nested under a Fragment, Module, or Package element, it must be + /// advertised. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AppId : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private YesNoType activateAtStorageField; + + private bool activateAtStorageFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string dllSurrogateField; + + private bool dllSurrogateFieldSet; + + private string idField; + + private bool idFieldSet; + + private string localServiceField; + + private bool localServiceFieldSet; + + private string remoteServerNameField; + + private bool remoteServerNameFieldSet; + + private YesNoType runAsInteractiveUserField; + + private bool runAsInteractiveUserFieldSet; + + private string serviceParametersField; + + private bool serviceParametersFieldSet; + + private ISchemaElement parentElement; + + public AppId() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Set this value to 'yes' to configure the client to activate on the same system as persistent storage. + /// + public YesNoType ActivateAtStorage + { + get + { + return this.activateAtStorageField; + } + set + { + this.activateAtStorageFieldSet = true; + this.activateAtStorageField = value; + } + } + + /// + /// Set this value to 'yes' in order to create a normal AppId table row. Set this value to 'no' in order to + /// generate Registry rows that perform similar registration (without the often problematic Windows Installer + /// advertising behavior). + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Set this value to the description of the AppId. It can only be specified when the AppId is not being advertised. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Set this value to specify that the class is a DLL that is to be activated in a surrogate EXE + /// process, and the surrogate process to be used is the path of a surrogate EXE file specified by the value. + /// + public string DllSurrogate + { + get + { + return this.dllSurrogateField; + } + set + { + this.dllSurrogateFieldSet = true; + this.dllSurrogateField = value; + } + } + + /// + /// Set this value to the AppID GUID that corresponds to the named executable. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this value to the name of a service to allow the object to be installed as a Win32 service. + /// + public string LocalService + { + get + { + return this.localServiceField; + } + set + { + this.localServiceFieldSet = true; + this.localServiceField = value; + } + } + + /// + /// Set this value to the name of the remote server to configure the client to request the object + /// be run at a particular machine whenever an activation function is called for which a COSERVERINFO + /// structure is not specified. + /// + public string RemoteServerName + { + get + { + return this.remoteServerNameField; + } + set + { + this.remoteServerNameFieldSet = true; + this.remoteServerNameField = value; + } + } + + /// + /// Set this value to 'yes' to configure a class to run under the identity of the user currently + /// logged on and connected to the interactive desktop when activated by a remote client without + /// being written as a Win32 service. + /// + public YesNoType RunAsInteractiveUser + { + get + { + return this.runAsInteractiveUserField; + } + set + { + this.runAsInteractiveUserFieldSet = true; + this.runAsInteractiveUserField = value; + } + } + + /// + /// Set this value to the parameters to be passed to a LocalService on invocation. + /// + public string ServiceParameters + { + get + { + return this.serviceParametersField; + } + set + { + this.serviceParametersFieldSet = true; + this.serviceParametersField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Class" == childName)) + { + childValue = new Class(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AppId", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.activateAtStorageFieldSet) + { + if ((this.activateAtStorageField == YesNoType.no)) + { + writer.WriteAttributeString("ActivateAtStorage", "no"); + } + if ((this.activateAtStorageField == YesNoType.yes)) + { + writer.WriteAttributeString("ActivateAtStorage", "yes"); + } + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.dllSurrogateFieldSet) + { + writer.WriteAttributeString("DllSurrogate", this.dllSurrogateField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.localServiceFieldSet) + { + writer.WriteAttributeString("LocalService", this.localServiceField); + } + if (this.remoteServerNameFieldSet) + { + writer.WriteAttributeString("RemoteServerName", this.remoteServerNameField); + } + if (this.runAsInteractiveUserFieldSet) + { + if ((this.runAsInteractiveUserField == YesNoType.no)) + { + writer.WriteAttributeString("RunAsInteractiveUser", "no"); + } + if ((this.runAsInteractiveUserField == YesNoType.yes)) + { + writer.WriteAttributeString("RunAsInteractiveUser", "yes"); + } + } + if (this.serviceParametersFieldSet) + { + writer.WriteAttributeString("ServiceParameters", this.serviceParametersField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("ActivateAtStorage" == name)) + { + this.activateAtStorageField = Enums.ParseYesNoType(value); + this.activateAtStorageFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("DllSurrogate" == name)) + { + this.dllSurrogateField = value; + this.dllSurrogateFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("LocalService" == name)) + { + this.localServiceField = value; + this.localServiceFieldSet = true; + } + if (("RemoteServerName" == name)) + { + this.remoteServerNameField = value; + this.remoteServerNameFieldSet = true; + } + if (("RunAsInteractiveUser" == name)) + { + this.runAsInteractiveUserField = Enums.ParseYesNoType(value); + this.runAsInteractiveUserFieldSet = true; + } + if (("ServiceParameters" == name)) + { + this.serviceParametersField = value; + this.serviceParametersFieldSet = true; + } + } + } + + /// + /// COM Class registration for parent Component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Class : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ContextType contextField; + + private bool contextFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string appIdField; + + private bool appIdFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private int iconIndexField; + + private bool iconIndexFieldSet; + + private string handlerField; + + private bool handlerFieldSet; + + private string argumentField; + + private bool argumentFieldSet; + + private YesNoType relativePathField; + + private bool relativePathFieldSet; + + private YesNoType advertiseField; + + private bool advertiseFieldSet; + + private ThreadingModelType threadingModelField; + + private bool threadingModelFieldSet; + + private string versionField; + + private bool versionFieldSet; + + private YesNoType insertableField; + + private bool insertableFieldSet; + + private YesNoType programmableField; + + private bool programmableFieldSet; + + private string foreignServerField; + + private bool foreignServerFieldSet; + + private string serverField; + + private bool serverFieldSet; + + private YesNoType shortPathField; + + private bool shortPathFieldSet; + + private YesNoType safeForScriptingField; + + private bool safeForScriptingFieldSet; + + private YesNoType safeForInitializingField; + + private bool safeForInitializingFieldSet; + + private YesNoType controlField; + + private bool controlFieldSet; + + private ISchemaElement parentElement; + + public Class() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileTypeMask))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The Class identifier (CLSID) of a COM server. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The server context(s) for this COM server. This attribute is optional for VB6 libraries that are marked "PublicNotCreateable". + /// Class elements marked Advertised must specify at least one server context. It is most common for there to be a single value + /// for the Context attribute. + /// + public ContextType Context + { + get + { + return this.contextField; + } + set + { + this.contextFieldSet = true; + this.contextField = value; + } + } + + /// + /// Localized description associated with the Class ID and Program ID. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// This attribute is only allowed when a Class is advertised. Using this attribute will reference an Application ID + /// containing DCOM information for the associated application GUID. The value must correspond to an AppId/@Id of an + /// AppId element nested under a Fragment, Module, or Package element. To associate an AppId with a non-advertised + /// class, nest the class within a parent AppId element. + /// + public string AppId + { + get + { + return this.appIdField; + } + set + { + this.appIdFieldSet = true; + this.appIdField = value; + } + } + + /// + /// The file providing the icon associated with this CLSID. Reference to an Icon element + /// (should match the Id attribute of an Icon element). This is currently not supported if the + /// value of the Advertise attribute is "no". + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// Icon index into the icon file. + /// + public int IconIndex + { + get + { + return this.iconIndexField; + } + set + { + this.iconIndexFieldSet = true; + this.iconIndexField = value; + } + } + + /// + /// The default inproc handler. May be optionally provided only for Context = LocalServer or + /// LocalServer32. Value of "1" creates a 16-bit InprocHandler (appearing as the InprocHandler + /// value). Value of "2" creates a 32-bit InprocHandler (appearing as the InprocHandler32 value). + /// Value of "3" creates 16-bit as well as 32-bit InprocHandlers. A non-numeric value is treated + /// as a system file that serves as the 32-bit InprocHandler (appearing as the InprocHandler32 value). + /// + public string Handler + { + get + { + return this.handlerField; + } + set + { + this.handlerFieldSet = true; + this.handlerField = value; + } + } + + /// + /// This column is optional only when the Context column is set to "LocalServer" + /// or "LocalServer32" server context. The text is registered as the argument against + /// the OLE server and is used by OLE for invoking the server. Note that the resolution + /// of properties in the Argument field is limited. A property formatted as [Property] in + /// this field can only be resolved if the property already has the intended value when + /// the component owning the class is installed. For example, for the argument "[#MyDoc.doc]" + /// to resolve to the correct value, the same process must be installing the file MyDoc.doc and the + /// component that owns the class. + /// + public string Argument + { + get + { + return this.argumentField; + } + set + { + this.argumentFieldSet = true; + this.argumentField = value; + } + } + + /// + /// When the value is "yes", the bare file name can be used for COM servers. The installer + /// registers the file name only instead of the complete path. This enables the server in + /// the current directory to take precedence and allows multiple copies of the same component. + /// + public YesNoType RelativePath + { + get + { + return this.relativePathField; + } + set + { + this.relativePathFieldSet = true; + this.relativePathField = value; + } + } + + /// + /// Set this value to "yes" in order to create a normal Class table row. Set this value to + /// "no" in order to generate Registry rows that perform similar registration (without the + /// often problematic Windows Installer advertising behavior). + /// + public YesNoType Advertise + { + get + { + return this.advertiseField; + } + set + { + this.advertiseFieldSet = true; + this.advertiseField = value; + } + } + + /// + /// Threading model for the CLSID. + /// + public ThreadingModelType ThreadingModel + { + get + { + return this.threadingModelField; + } + set + { + this.threadingModelFieldSet = true; + this.threadingModelField = value; + } + } + + /// + /// Version for the CLSID. + /// + public string Version + { + get + { + return this.versionField; + } + set + { + this.versionFieldSet = true; + this.versionField = value; + } + } + + /// + /// Specifies the CLSID may be insertable. + /// + public YesNoType Insertable + { + get + { + return this.insertableField; + } + set + { + this.insertableFieldSet = true; + this.insertableField = value; + } + } + + /// + /// Specifies the CLSID may be programmable. + /// + public YesNoType Programmable + { + get + { + return this.programmableField; + } + set + { + this.programmableFieldSet = true; + this.programmableField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no" and Server has not been specified. In addition, it may only + /// be used when the Class element is directly under the Component element. The value can be + /// that of an registry type (REG_SZ). This attribute should be used to specify foreign servers, such as mscoree.dll if needed. + /// + public string ForeignServer + { + get + { + return this.foreignServerField; + } + set + { + this.foreignServerFieldSet = true; + this.foreignServerField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no" and the ForeignServer attribute is not specified. File Id of the + /// COM server file. If this element is nested under a File element, this value defaults to + /// the value of the parent File/@Id. + /// + public string Server + { + get + { + return this.serverField; + } + set + { + this.serverFieldSet = true; + this.serverField = value; + } + } + + /// + /// Specifies whether or not to use the short path for the COM server. This can only apply when Advertise is set to 'no'. The default is 'no' meaning that it will use the long file name for the COM server. + /// + public YesNoType ShortPath + { + get + { + return this.shortPathField; + } + set + { + this.shortPathFieldSet = true; + this.shortPathField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no". + /// + public YesNoType SafeForScripting + { + get + { + return this.safeForScriptingField; + } + set + { + this.safeForScriptingFieldSet = true; + this.safeForScriptingField = value; + } + } + + /// + /// May only be specified if the value of the Advertise attribute is "no". + /// + public YesNoType SafeForInitializing + { + get + { + return this.safeForInitializingField; + } + set + { + this.safeForInitializingFieldSet = true; + this.safeForInitializingField = value; + } + } + + /// + /// Set this attribute's value to 'yes' to identify an object as an ActiveX Control. The default value is 'no'. + /// + public YesNoType Control + { + get + { + return this.controlField; + } + set + { + this.controlFieldSet = true; + this.controlField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ProgId" == childName)) + { + childValue = new ProgId(); + } + if (("FileTypeMask" == childName)) + { + childValue = new FileTypeMask(); + } + if (("Interface" == childName)) + { + childValue = new Interface(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Tries to parse a ContextType from a string. + /// + public static bool TryParseContextType(string value, out ContextType parsedValue) + { + parsedValue = ContextType.None; + if (string.IsNullOrEmpty(value)) + { + return false; + } + string[] splitValue = value.Split(" \t\r\n".ToCharArray(), System.StringSplitOptions.RemoveEmptyEntries); + for (System.Collections.IEnumerator enumerator = splitValue.GetEnumerator(); enumerator.MoveNext(); + ) + { + string currentValue = ((string)(enumerator.Current)); + if (("LocalServer" == currentValue)) + { + parsedValue = (parsedValue | ContextType.LocalServer); + } + else + { + if (("LocalServer32" == currentValue)) + { + parsedValue = (parsedValue | ContextType.LocalServer32); + } + else + { + if (("InprocServer" == currentValue)) + { + parsedValue = (parsedValue | ContextType.InprocServer); + } + else + { + if (("InprocServer32" == currentValue)) + { + parsedValue = (parsedValue | ContextType.InprocServer32); + } + else + { + parsedValue = ContextType.None; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ThreadingModelType from a string. + /// + public static ThreadingModelType ParseThreadingModelType(string value) + { + ThreadingModelType parsedValue; + Class.TryParseThreadingModelType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ThreadingModelType from a string. + /// + public static bool TryParseThreadingModelType(string value, out ThreadingModelType parsedValue) + { + parsedValue = ThreadingModelType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("apartment" == value)) + { + parsedValue = ThreadingModelType.apartment; + } + else + { + if (("free" == value)) + { + parsedValue = ThreadingModelType.free; + } + else + { + if (("both" == value)) + { + parsedValue = ThreadingModelType.both; + } + else + { + if (("neutral" == value)) + { + parsedValue = ThreadingModelType.neutral; + } + else + { + if (("single" == value)) + { + parsedValue = ThreadingModelType.single; + } + else + { + if (("rental" == value)) + { + parsedValue = ThreadingModelType.rental; + } + else + { + parsedValue = ThreadingModelType.IllegalValue; + return false; + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Class", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.contextFieldSet) + { + string outputValue = ""; + if (((this.contextField & ContextType.LocalServer) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "LocalServer"); + } + if (((this.contextField & ContextType.LocalServer32) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "LocalServer32"); + } + if (((this.contextField & ContextType.InprocServer) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "InprocServer"); + } + if (((this.contextField & ContextType.InprocServer32) + != 0)) + { + if ((outputValue.Length != 0)) + { + outputValue = (outputValue + " "); + } + outputValue = (outputValue + "InprocServer32"); + } + writer.WriteAttributeString("Context", outputValue); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.appIdFieldSet) + { + writer.WriteAttributeString("AppId", this.appIdField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.iconIndexFieldSet) + { + writer.WriteAttributeString("IconIndex", this.iconIndexField.ToString(CultureInfo.InvariantCulture)); + } + if (this.handlerFieldSet) + { + writer.WriteAttributeString("Handler", this.handlerField); + } + if (this.argumentFieldSet) + { + writer.WriteAttributeString("Argument", this.argumentField); + } + if (this.relativePathFieldSet) + { + if ((this.relativePathField == YesNoType.no)) + { + writer.WriteAttributeString("RelativePath", "no"); + } + if ((this.relativePathField == YesNoType.yes)) + { + writer.WriteAttributeString("RelativePath", "yes"); + } + } + if (this.advertiseFieldSet) + { + if ((this.advertiseField == YesNoType.no)) + { + writer.WriteAttributeString("Advertise", "no"); + } + if ((this.advertiseField == YesNoType.yes)) + { + writer.WriteAttributeString("Advertise", "yes"); + } + } + if (this.threadingModelFieldSet) + { + if ((this.threadingModelField == ThreadingModelType.apartment)) + { + writer.WriteAttributeString("ThreadingModel", "apartment"); + } + if ((this.threadingModelField == ThreadingModelType.free)) + { + writer.WriteAttributeString("ThreadingModel", "free"); + } + if ((this.threadingModelField == ThreadingModelType.both)) + { + writer.WriteAttributeString("ThreadingModel", "both"); + } + if ((this.threadingModelField == ThreadingModelType.neutral)) + { + writer.WriteAttributeString("ThreadingModel", "neutral"); + } + if ((this.threadingModelField == ThreadingModelType.single)) + { + writer.WriteAttributeString("ThreadingModel", "single"); + } + if ((this.threadingModelField == ThreadingModelType.rental)) + { + writer.WriteAttributeString("ThreadingModel", "rental"); + } + } + if (this.versionFieldSet) + { + writer.WriteAttributeString("Version", this.versionField); + } + if (this.insertableFieldSet) + { + if ((this.insertableField == YesNoType.no)) + { + writer.WriteAttributeString("Insertable", "no"); + } + if ((this.insertableField == YesNoType.yes)) + { + writer.WriteAttributeString("Insertable", "yes"); + } + } + if (this.programmableFieldSet) + { + if ((this.programmableField == YesNoType.no)) + { + writer.WriteAttributeString("Programmable", "no"); + } + if ((this.programmableField == YesNoType.yes)) + { + writer.WriteAttributeString("Programmable", "yes"); + } + } + if (this.foreignServerFieldSet) + { + writer.WriteAttributeString("ForeignServer", this.foreignServerField); + } + if (this.serverFieldSet) + { + writer.WriteAttributeString("Server", this.serverField); + } + if (this.shortPathFieldSet) + { + if ((this.shortPathField == YesNoType.no)) + { + writer.WriteAttributeString("ShortPath", "no"); + } + if ((this.shortPathField == YesNoType.yes)) + { + writer.WriteAttributeString("ShortPath", "yes"); + } + } + if (this.safeForScriptingFieldSet) + { + if ((this.safeForScriptingField == YesNoType.no)) + { + writer.WriteAttributeString("SafeForScripting", "no"); + } + if ((this.safeForScriptingField == YesNoType.yes)) + { + writer.WriteAttributeString("SafeForScripting", "yes"); + } + } + if (this.safeForInitializingFieldSet) + { + if ((this.safeForInitializingField == YesNoType.no)) + { + writer.WriteAttributeString("SafeForInitializing", "no"); + } + if ((this.safeForInitializingField == YesNoType.yes)) + { + writer.WriteAttributeString("SafeForInitializing", "yes"); + } + } + if (this.controlFieldSet) + { + if ((this.controlField == YesNoType.no)) + { + writer.WriteAttributeString("Control", "no"); + } + if ((this.controlField == YesNoType.yes)) + { + writer.WriteAttributeString("Control", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Context" == name)) + { + Class.TryParseContextType(value, out this.contextField); + this.contextFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("AppId" == name)) + { + this.appIdField = value; + this.appIdFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("IconIndex" == name)) + { + this.iconIndexField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.iconIndexFieldSet = true; + } + if (("Handler" == name)) + { + this.handlerField = value; + this.handlerFieldSet = true; + } + if (("Argument" == name)) + { + this.argumentField = value; + this.argumentFieldSet = true; + } + if (("RelativePath" == name)) + { + this.relativePathField = Enums.ParseYesNoType(value); + this.relativePathFieldSet = true; + } + if (("Advertise" == name)) + { + this.advertiseField = Enums.ParseYesNoType(value); + this.advertiseFieldSet = true; + } + if (("ThreadingModel" == name)) + { + this.threadingModelField = Class.ParseThreadingModelType(value); + this.threadingModelFieldSet = true; + } + if (("Version" == name)) + { + this.versionField = value; + this.versionFieldSet = true; + } + if (("Insertable" == name)) + { + this.insertableField = Enums.ParseYesNoType(value); + this.insertableFieldSet = true; + } + if (("Programmable" == name)) + { + this.programmableField = Enums.ParseYesNoType(value); + this.programmableFieldSet = true; + } + if (("ForeignServer" == name)) + { + this.foreignServerField = value; + this.foreignServerFieldSet = true; + } + if (("Server" == name)) + { + this.serverField = value; + this.serverFieldSet = true; + } + if (("ShortPath" == name)) + { + this.shortPathField = Enums.ParseYesNoType(value); + this.shortPathFieldSet = true; + } + if (("SafeForScripting" == name)) + { + this.safeForScriptingField = Enums.ParseYesNoType(value); + this.safeForScriptingFieldSet = true; + } + if (("SafeForInitializing" == name)) + { + this.safeForInitializingField = Enums.ParseYesNoType(value); + this.safeForInitializingFieldSet = true; + } + if (("Control" == name)) + { + this.controlField = Enums.ParseYesNoType(value); + this.controlFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + [Flags()] + public enum ContextType + { + + None = 0, + + /// + /// A 16-bit local server application. + /// + LocalServer = 1, + + /// + /// A 32-bit local server application. + /// + LocalServer32 = 2, + + /// + /// A 16-bit in-process server DLL. + /// + InprocServer = 4, + + /// + /// A 32-bit in-process server DLL. + /// + InprocServer32 = 8, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ThreadingModelType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + apartment, + + free, + + both, + + neutral, + + single, + + rental, + } + } + + /// + /// COM Interface registration for parent TypeLib. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Interface : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string baseInterfaceField; + + private bool baseInterfaceFieldSet; + + private string proxyStubClassIdField; + + private bool proxyStubClassIdFieldSet; + + private string proxyStubClassId32Field; + + private bool proxyStubClassId32FieldSet; + + private int numMethodsField; + + private bool numMethodsFieldSet; + + private YesNoType versionedField; + + private bool versionedFieldSet; + + private ISchemaElement parentElement; + + /// + /// GUID identifier for COM Interface. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name for COM Interface. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Identifies the interface from which the current interface is derived. + /// + public string BaseInterface + { + get + { + return this.baseInterfaceField; + } + set + { + this.baseInterfaceFieldSet = true; + this.baseInterfaceField = value; + } + } + + /// + /// GUID CLSID for proxy stub to COM Interface. + /// + public string ProxyStubClassId + { + get + { + return this.proxyStubClassIdField; + } + set + { + this.proxyStubClassIdFieldSet = true; + this.proxyStubClassIdField = value; + } + } + + /// + /// GUID CLSID for 32-bit proxy stub to COM Interface. + /// + public string ProxyStubClassId32 + { + get + { + return this.proxyStubClassId32Field; + } + set + { + this.proxyStubClassId32FieldSet = true; + this.proxyStubClassId32Field = value; + } + } + + /// + /// Number of methods implemented on COM Interface. + /// + public int NumMethods + { + get + { + return this.numMethodsField; + } + set + { + this.numMethodsFieldSet = true; + this.numMethodsField = value; + } + } + + /// + /// Determines whether a Typelib version entry should be created with the other COM Interface registry keys. Default is 'yes'. + /// + public YesNoType Versioned + { + get + { + return this.versionedField; + } + set + { + this.versionedFieldSet = true; + this.versionedField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Interface", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.baseInterfaceFieldSet) + { + writer.WriteAttributeString("BaseInterface", this.baseInterfaceField); + } + if (this.proxyStubClassIdFieldSet) + { + writer.WriteAttributeString("ProxyStubClassId", this.proxyStubClassIdField); + } + if (this.proxyStubClassId32FieldSet) + { + writer.WriteAttributeString("ProxyStubClassId32", this.proxyStubClassId32Field); + } + if (this.numMethodsFieldSet) + { + writer.WriteAttributeString("NumMethods", this.numMethodsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.versionedFieldSet) + { + if ((this.versionedField == YesNoType.no)) + { + writer.WriteAttributeString("Versioned", "no"); + } + if ((this.versionedField == YesNoType.yes)) + { + writer.WriteAttributeString("Versioned", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("BaseInterface" == name)) + { + this.baseInterfaceField = value; + this.baseInterfaceFieldSet = true; + } + if (("ProxyStubClassId" == name)) + { + this.proxyStubClassIdField = value; + this.proxyStubClassIdFieldSet = true; + } + if (("ProxyStubClassId32" == name)) + { + this.proxyStubClassId32Field = value; + this.proxyStubClassId32FieldSet = true; + } + if (("NumMethods" == name)) + { + this.numMethodsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.numMethodsFieldSet = true; + } + if (("Versioned" == name)) + { + this.versionedField = Enums.ParseYesNoType(value); + this.versionedFieldSet = true; + } + } + } + + /// + /// FileType data for class Id registration. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileTypeMask : ISchemaElement, ISetAttributes + { + + private int offsetField; + + private bool offsetFieldSet; + + private string maskField; + + private bool maskFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Offset into file. If positive, offset is from the beginning; if negative, offset is from the end. + /// + public int Offset + { + get + { + return this.offsetField; + } + set + { + this.offsetFieldSet = true; + this.offsetField = value; + } + } + + /// + /// Hex value that is AND'd against the bytes in the file at Offset. + /// + public string Mask + { + get + { + return this.maskField; + } + set + { + this.maskFieldSet = true; + this.maskField = value; + } + } + + /// + /// If the result of the AND'ing of Mask with the bytes in the file is Value, the file is a match for this File Type. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileTypeMask", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.offsetFieldSet) + { + writer.WriteAttributeString("Offset", this.offsetField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maskFieldSet) + { + writer.WriteAttributeString("Mask", this.maskField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Offset" == name)) + { + this.offsetField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.offsetFieldSet = true; + } + if (("Mask" == name)) + { + this.maskField = value; + this.maskFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Service or group of services that must start before the parent service. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceDependency : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType groupField; + + private bool groupFieldSet; + + private ISchemaElement parentElement; + + /// + /// The value of this attribute should be one of the following: + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set to 'yes' to indicate that the value in the Id attribute is the name of a group of services. + /// + public YesNoType Group + { + get + { + return this.groupField; + } + set + { + this.groupFieldSet = true; + this.groupField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceDependency", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.groupFieldSet) + { + if ((this.groupField == YesNoType.no)) + { + writer.WriteAttributeString("Group", "no"); + } + if ((this.groupField == YesNoType.yes)) + { + writer.WriteAttributeString("Group", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Group" == name)) + { + this.groupField = Enums.ParseYesNoType(value); + this.groupFieldSet = true; + } + } + } + + /// + /// Adds services for parent Component. Use the ServiceControl element to remove services. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceInstall : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string displayNameField; + + private bool displayNameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private YesNoType interactiveField; + + private bool interactiveFieldSet; + + private StartType startField; + + private bool startFieldSet; + + private ErrorControlType errorControlField; + + private bool errorControlFieldSet; + + private YesNoType vitalField; + + private bool vitalFieldSet; + + private string loadOrderGroupField; + + private bool loadOrderGroupFieldSet; + + private string accountField; + + private bool accountFieldSet; + + private string passwordField; + + private bool passwordFieldSet; + + private string argumentsField; + + private bool argumentsFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private YesNoType eraseDescriptionField; + + private bool eraseDescriptionFieldSet; + + private ISchemaElement parentElement; + + public ServiceInstall() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PermissionEx))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceDependency))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfig))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfigFailureActions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for this service configuration. This value will default to the Name attribute if not + /// specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This column is the string that gives the service name to install. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// This column is the localizable string that user interface programs use to identify the service. + /// + public string DisplayName + { + get + { + return this.displayNameField; + } + set + { + this.displayNameFieldSet = true; + this.displayNameField = value; + } + } + + /// + /// The Windows Installer does not currently support kernelDriver or systemDriver. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Whether or not the service interacts with the desktop. + /// + public YesNoType Interactive + { + get + { + return this.interactiveField; + } + set + { + this.interactiveFieldSet = true; + this.interactiveField = value; + } + } + + /// + /// Determines when the service should be started. The Windows Installer does not support boot or system. + /// + public StartType Start + { + get + { + return this.startField; + } + set + { + this.startFieldSet = true; + this.startField = value; + } + } + + /// + /// Determines what action should be taken on an error. + /// + public ErrorControlType ErrorControl + { + get + { + return this.errorControlField; + } + set + { + this.errorControlFieldSet = true; + this.errorControlField = value; + } + } + + /// + /// The overall install should fail if this service fails to install. + /// + public YesNoType Vital + { + get + { + return this.vitalField; + } + set + { + this.vitalFieldSet = true; + this.vitalField = value; + } + } + + /// + /// The load ordering group that this service should be a part of. + /// + public string LoadOrderGroup + { + get + { + return this.loadOrderGroupField; + } + set + { + this.loadOrderGroupFieldSet = true; + this.loadOrderGroupField = value; + } + } + + /// + /// Fully qualified names must be used even for local accounts, e.g.: ".\LOCAL_ACCOUNT". Valid only when ServiceType is ownProcess. + /// + public string Account + { + get + { + return this.accountField; + } + set + { + this.accountFieldSet = true; + this.accountField = value; + } + } + + /// + /// The password for the account. Valid only when the account has a password. + /// + public string Password + { + get + { + return this.passwordField; + } + set + { + this.passwordFieldSet = true; + this.passwordField = value; + } + } + + /// + /// Contains any command line arguments or properties required to run the service. + /// + public string Arguments + { + get + { + return this.argumentsField; + } + set + { + this.argumentsFieldSet = true; + this.argumentsField = value; + } + } + + /// + /// Sets the description of the service. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Determines whether the existing service description will be ignored. If 'yes', the service description will be null, even if the Description attribute is set. + /// + public YesNoType EraseDescription + { + get + { + return this.eraseDescriptionField; + } + set + { + this.eraseDescriptionFieldSet = true; + this.eraseDescriptionField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("PermissionEx" == childName)) + { + childValue = new PermissionEx(); + } + if (("ServiceDependency" == childName)) + { + childValue = new ServiceDependency(); + } + if (("ServiceConfig" == childName)) + { + childValue = new ServiceConfig(); + } + if (("ServiceConfigFailureActions" == childName)) + { + childValue = new ServiceConfigFailureActions(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + ServiceInstall.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ownProcess" == value)) + { + parsedValue = TypeType.ownProcess; + } + else + { + if (("shareProcess" == value)) + { + parsedValue = TypeType.shareProcess; + } + else + { + if (("kernelDriver" == value)) + { + parsedValue = TypeType.kernelDriver; + } + else + { + if (("systemDriver" == value)) + { + parsedValue = TypeType.systemDriver; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a StartType from a string. + /// + public static StartType ParseStartType(string value) + { + StartType parsedValue; + ServiceInstall.TryParseStartType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a StartType from a string. + /// + public static bool TryParseStartType(string value, out StartType parsedValue) + { + parsedValue = StartType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("auto" == value)) + { + parsedValue = StartType.auto; + } + else + { + if (("demand" == value)) + { + parsedValue = StartType.demand; + } + else + { + if (("disabled" == value)) + { + parsedValue = StartType.disabled; + } + else + { + if (("boot" == value)) + { + parsedValue = StartType.boot; + } + else + { + if (("system" == value)) + { + parsedValue = StartType.system; + } + else + { + parsedValue = StartType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Parses a ErrorControlType from a string. + /// + public static ErrorControlType ParseErrorControlType(string value) + { + ErrorControlType parsedValue; + ServiceInstall.TryParseErrorControlType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ErrorControlType from a string. + /// + public static bool TryParseErrorControlType(string value, out ErrorControlType parsedValue) + { + parsedValue = ErrorControlType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("ignore" == value)) + { + parsedValue = ErrorControlType.ignore; + } + else + { + if (("normal" == value)) + { + parsedValue = ErrorControlType.normal; + } + else + { + if (("critical" == value)) + { + parsedValue = ErrorControlType.critical; + } + else + { + parsedValue = ErrorControlType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceInstall", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.displayNameFieldSet) + { + writer.WriteAttributeString("DisplayName", this.displayNameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.ownProcess)) + { + writer.WriteAttributeString("Type", "ownProcess"); + } + if ((this.typeField == TypeType.shareProcess)) + { + writer.WriteAttributeString("Type", "shareProcess"); + } + if ((this.typeField == TypeType.kernelDriver)) + { + writer.WriteAttributeString("Type", "kernelDriver"); + } + if ((this.typeField == TypeType.systemDriver)) + { + writer.WriteAttributeString("Type", "systemDriver"); + } + } + if (this.interactiveFieldSet) + { + if ((this.interactiveField == YesNoType.no)) + { + writer.WriteAttributeString("Interactive", "no"); + } + if ((this.interactiveField == YesNoType.yes)) + { + writer.WriteAttributeString("Interactive", "yes"); + } + } + if (this.startFieldSet) + { + if ((this.startField == StartType.auto)) + { + writer.WriteAttributeString("Start", "auto"); + } + if ((this.startField == StartType.demand)) + { + writer.WriteAttributeString("Start", "demand"); + } + if ((this.startField == StartType.disabled)) + { + writer.WriteAttributeString("Start", "disabled"); + } + if ((this.startField == StartType.boot)) + { + writer.WriteAttributeString("Start", "boot"); + } + if ((this.startField == StartType.system)) + { + writer.WriteAttributeString("Start", "system"); + } + } + if (this.errorControlFieldSet) + { + if ((this.errorControlField == ErrorControlType.ignore)) + { + writer.WriteAttributeString("ErrorControl", "ignore"); + } + if ((this.errorControlField == ErrorControlType.normal)) + { + writer.WriteAttributeString("ErrorControl", "normal"); + } + if ((this.errorControlField == ErrorControlType.critical)) + { + writer.WriteAttributeString("ErrorControl", "critical"); + } + } + if (this.vitalFieldSet) + { + if ((this.vitalField == YesNoType.no)) + { + writer.WriteAttributeString("Vital", "no"); + } + if ((this.vitalField == YesNoType.yes)) + { + writer.WriteAttributeString("Vital", "yes"); + } + } + if (this.loadOrderGroupFieldSet) + { + writer.WriteAttributeString("LoadOrderGroup", this.loadOrderGroupField); + } + if (this.accountFieldSet) + { + writer.WriteAttributeString("Account", this.accountField); + } + if (this.passwordFieldSet) + { + writer.WriteAttributeString("Password", this.passwordField); + } + if (this.argumentsFieldSet) + { + writer.WriteAttributeString("Arguments", this.argumentsField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.eraseDescriptionFieldSet) + { + if ((this.eraseDescriptionField == YesNoType.no)) + { + writer.WriteAttributeString("EraseDescription", "no"); + } + if ((this.eraseDescriptionField == YesNoType.yes)) + { + writer.WriteAttributeString("EraseDescription", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("DisplayName" == name)) + { + this.displayNameField = value; + this.displayNameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = ServiceInstall.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Interactive" == name)) + { + this.interactiveField = Enums.ParseYesNoType(value); + this.interactiveFieldSet = true; + } + if (("Start" == name)) + { + this.startField = ServiceInstall.ParseStartType(value); + this.startFieldSet = true; + } + if (("ErrorControl" == name)) + { + this.errorControlField = ServiceInstall.ParseErrorControlType(value); + this.errorControlFieldSet = true; + } + if (("Vital" == name)) + { + this.vitalField = Enums.ParseYesNoType(value); + this.vitalFieldSet = true; + } + if (("LoadOrderGroup" == name)) + { + this.loadOrderGroupField = value; + this.loadOrderGroupFieldSet = true; + } + if (("Account" == name)) + { + this.accountField = value; + this.accountFieldSet = true; + } + if (("Password" == name)) + { + this.passwordField = value; + this.passwordFieldSet = true; + } + if (("Arguments" == name)) + { + this.argumentsField = value; + this.argumentsFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("EraseDescription" == name)) + { + this.eraseDescriptionField = Enums.ParseYesNoType(value); + this.eraseDescriptionFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// A Win32 service that runs its own process. + /// + ownProcess, + + /// + /// A Win32 service that shares a process. + /// + shareProcess, + + /// + /// A kernel driver service. This value is not currently supported by the Windows Installer. + /// + kernelDriver, + + /// + /// A file system driver service. This value is not currently supported by the Windows Installer. + /// + systemDriver, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum StartType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// The service will start during startup of the system. + /// + auto, + + /// + /// The service will start when the service control manager calls the StartService function. + /// + demand, + + /// + /// The service can no longer be started. + /// + disabled, + + /// + /// The service is a device driver that will be started by the operating system boot loader. This value is not currently supported by the Windows Installer. + /// + boot, + + /// + /// The service is a device driver that will be started by the IoInitSystem function. This value is not currently supported by the Windows Installer. + /// + system, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ErrorControlType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Logs the error and continues with the startup operation. + /// + ignore, + + /// + /// Logs the error, displays a message box and continues the startup operation. + /// + normal, + + /// + /// Logs the error if it is possible and the system is restarted with the last configuration known to be good. If the last-known-good configuration is being started, the startup operation fails. + /// + critical, + } + } + + /// + /// Argument used in ServiceControl parent + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceArgument : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Argument used in ServiceControl parent + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceArgument", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Starts, stops, and removes services for parent Component. This element is used to control the state + /// of a service installed by the MSI or MSM file by using the start, stop and remove attributes. + /// For example, Start='install' Stop='both' Remove='uninstall' would mean: start the service on install, + /// remove the service when the product is uninstalled, and stop the service both on install and uninstall. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceControl : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private InstallUninstallType startField; + + private bool startFieldSet; + + private InstallUninstallType stopField; + + private bool stopFieldSet; + + private InstallUninstallType removeField; + + private bool removeFieldSet; + + private YesNoType waitField; + + private bool waitFieldSet; + + private ISchemaElement parentElement; + + public ServiceControl() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ServiceArgument))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the service. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Specifies whether the service should be started by the StartServices action on install, uninstall or both. + /// For 'install', the service will be started only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the service will be started only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the service will be started in both cases. + /// + public InstallUninstallType Start + { + get + { + return this.startField; + } + set + { + this.startFieldSet = true; + this.startField = value; + } + } + + /// + /// Specifies whether the service should be stopped by the StopServices action on install, uninstall or both. + /// For 'install', the service will be stopped only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the service will be stopped only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the service will be stopped in both cases. + /// + public InstallUninstallType Stop + { + get + { + return this.stopField; + } + set + { + this.stopFieldSet = true; + this.stopField = value; + } + } + + /// + /// Specifies whether the service should be removed by the DeleteServices action on install, uninstall or both. + /// For 'install', the service will be removed only when the parent component is being installed (msiInstallStateLocal or + /// msiInstallStateSource); for 'uninstall', the service will be removed only when the parent component + /// is being removed (msiInstallStateAbsent); for 'both', the service will be removed in both cases. + /// + public InstallUninstallType Remove + { + get + { + return this.removeField; + } + set + { + this.removeFieldSet = true; + this.removeField = value; + } + } + + /// + /// Specifies whether or not to wait for the service to complete before continuing. The default is 'yes'. + /// + public YesNoType Wait + { + get + { + return this.waitField; + } + set + { + this.waitFieldSet = true; + this.waitField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ServiceArgument" == childName)) + { + childValue = new ServiceArgument(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceControl", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.startFieldSet) + { + if ((this.startField == InstallUninstallType.install)) + { + writer.WriteAttributeString("Start", "install"); + } + if ((this.startField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("Start", "uninstall"); + } + if ((this.startField == InstallUninstallType.both)) + { + writer.WriteAttributeString("Start", "both"); + } + } + if (this.stopFieldSet) + { + if ((this.stopField == InstallUninstallType.install)) + { + writer.WriteAttributeString("Stop", "install"); + } + if ((this.stopField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("Stop", "uninstall"); + } + if ((this.stopField == InstallUninstallType.both)) + { + writer.WriteAttributeString("Stop", "both"); + } + } + if (this.removeFieldSet) + { + if ((this.removeField == InstallUninstallType.install)) + { + writer.WriteAttributeString("Remove", "install"); + } + if ((this.removeField == InstallUninstallType.uninstall)) + { + writer.WriteAttributeString("Remove", "uninstall"); + } + if ((this.removeField == InstallUninstallType.both)) + { + writer.WriteAttributeString("Remove", "both"); + } + } + if (this.waitFieldSet) + { + if ((this.waitField == YesNoType.no)) + { + writer.WriteAttributeString("Wait", "no"); + } + if ((this.waitField == YesNoType.yes)) + { + writer.WriteAttributeString("Wait", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Start" == name)) + { + this.startField = Enums.ParseInstallUninstallType(value); + this.startFieldSet = true; + } + if (("Stop" == name)) + { + this.stopField = Enums.ParseInstallUninstallType(value); + this.stopFieldSet = true; + } + if (("Remove" == name)) + { + this.removeField = Enums.ParseInstallUninstallType(value); + this.removeFieldSet = true; + } + if (("Wait" == name)) + { + this.waitField = Enums.ParseYesNoType(value); + this.waitFieldSet = true; + } + } + } + + /// + /// Privilege required by service configured by ServiceConfig parent. Valid values are a + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RequiredPrivilege : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Privilege required by service configured by ServiceConfig parent. Valid values are a + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RequiredPrivilege", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Configures a service being installed or one that already exists. This element's functionality is available starting with MSI 5.0. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceConfig : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string delayedAutoStartField; + + private bool delayedAutoStartFieldSet; + + private string failureActionsWhenField; + + private bool failureActionsWhenFieldSet; + + private string preShutdownDelayField; + + private bool preShutdownDelayFieldSet; + + private YesNoType onInstallField; + + private bool onInstallFieldSet; + + private YesNoType onReinstallField; + + private bool onReinstallFieldSet; + + private YesNoType onUninstallField; + + private bool onUninstallFieldSet; + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private string serviceSidField; + + private bool serviceSidFieldSet; + + private ISchemaElement parentElement; + + public ServiceConfig() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RequiredPrivilege))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for this service configuration. This value will default to the ServiceName attribute if not + /// specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute specifies whether an auto-start service should delay its start until after all other auto-start + /// services. This attribute only affects auto-start services. Allowed values are "yes", "no" or a Formatted property that + /// resolves to "1" (for "yes") or "0" (for "no"). If this attribute is not present the setting is not configured. + /// + public string DelayedAutoStart + { + get + { + return this.delayedAutoStartField; + } + set + { + this.delayedAutoStartFieldSet = true; + this.delayedAutoStartField = value; + } + } + + /// + /// This attribute specifies when failure actions should be applied. Allowed values are "failedToStop", "failedToStopOrReturnedError" + /// or a Formatted property that resolves to "1" (for "failedToStopOrReturnedError") or "0" (for "failedToStop"). If this attribute + /// is not present the setting is not configured. + /// + public string FailureActionsWhen + { + get + { + return this.failureActionsWhenField; + } + set + { + this.failureActionsWhenFieldSet = true; + this.failureActionsWhenField = value; + } + } + + /// + /// This attribute specifies time in milliseconds that the Service Control Manager (SCM) waits after notifying the service of a system + /// shutdown. If this attribute is not present the default value, 3 minutes, is used. + /// + public string PreShutdownDelay + { + get + { + return this.preShutdownDelayField; + } + set + { + this.preShutdownDelayFieldSet = true; + this.preShutdownDelayField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall + /// and OnUninstall. + /// + public YesNoType OnInstall + { + get + { + return this.onInstallField; + } + set + { + this.onInstallFieldSet = true; + this.onInstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall + /// and OnUninstall. + /// + public YesNoType OnReinstall + { + get + { + return this.onReinstallField; + } + set + { + this.onReinstallFieldSet = true; + this.onReinstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall + /// and OnReinstall. + /// + public YesNoType OnUninstall + { + get + { + return this.onUninstallField; + } + set + { + this.onUninstallFieldSet = true; + this.onUninstallField = value; + } + } + + /// + /// Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under + /// a ServiceInstall element. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + /// + /// Specifies the service SID to apply to the service. Valid values are "none", "restricted", "unrestricted" or a Formatted property + /// that resolves to "0" (for "none"), "3" (for "restricted") or "1" (for "unrestricted"). If this attribute is not present the + /// setting is not configured. + /// + public string ServiceSid + { + get + { + return this.serviceSidField; + } + set + { + this.serviceSidFieldSet = true; + this.serviceSidField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RequiredPrivilege" == childName)) + { + childValue = new RequiredPrivilege(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceConfig", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.delayedAutoStartFieldSet) + { + writer.WriteAttributeString("DelayedAutoStart", this.delayedAutoStartField); + } + if (this.failureActionsWhenFieldSet) + { + writer.WriteAttributeString("FailureActionsWhen", this.failureActionsWhenField); + } + if (this.preShutdownDelayFieldSet) + { + writer.WriteAttributeString("PreShutdownDelay", this.preShutdownDelayField); + } + if (this.onInstallFieldSet) + { + if ((this.onInstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnInstall", "no"); + } + if ((this.onInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnInstall", "yes"); + } + } + if (this.onReinstallFieldSet) + { + if ((this.onReinstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnReinstall", "no"); + } + if ((this.onReinstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnReinstall", "yes"); + } + } + if (this.onUninstallFieldSet) + { + if ((this.onUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnUninstall", "no"); + } + if ((this.onUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnUninstall", "yes"); + } + } + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + if (this.serviceSidFieldSet) + { + writer.WriteAttributeString("ServiceSid", this.serviceSidField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("DelayedAutoStart" == name)) + { + this.delayedAutoStartField = value; + this.delayedAutoStartFieldSet = true; + } + if (("FailureActionsWhen" == name)) + { + this.failureActionsWhenField = value; + this.failureActionsWhenFieldSet = true; + } + if (("PreShutdownDelay" == name)) + { + this.preShutdownDelayField = value; + this.preShutdownDelayFieldSet = true; + } + if (("OnInstall" == name)) + { + this.onInstallField = Enums.ParseYesNoType(value); + this.onInstallFieldSet = true; + } + if (("OnReinstall" == name)) + { + this.onReinstallField = Enums.ParseYesNoType(value); + this.onReinstallFieldSet = true; + } + if (("OnUninstall" == name)) + { + this.onUninstallField = Enums.ParseYesNoType(value); + this.onUninstallFieldSet = true; + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + if (("ServiceSid" == name)) + { + this.serviceSidField = value; + this.serviceSidFieldSet = true; + } + } + } + + /// + /// Failure action for a ServiceConfigFailureActions element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Failure : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string delayField; + + private bool delayFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the action to take when the service fails. Valid values are "none", "restartComputer", "restartService", "runCommand" or a Formatted property + /// that resolves to "0" (for "none"), "1" (for "restartService"), "2" (for "restartComputer") or "3" (for "runCommand"). + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Specifies the time in milliseconds to wait before performing the value from the Action attribute. + /// + public string Delay + { + get + { + return this.delayField; + } + set + { + this.delayFieldSet = true; + this.delayField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Failure", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.delayFieldSet) + { + writer.WriteAttributeString("Delay", this.delayField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("Delay" == name)) + { + this.delayField = value; + this.delayFieldSet = true; + } + } + } + + /// + /// Configures the failure actions for a service being installed or one that already exists. This element's functionality is available starting with MSI 5.0. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ServiceConfigFailureActions : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string commandField; + + private bool commandFieldSet; + + private YesNoType onInstallField; + + private bool onInstallFieldSet; + + private YesNoType onReinstallField; + + private bool onReinstallFieldSet; + + private YesNoType onUninstallField; + + private bool onUninstallFieldSet; + + private string rebootMessageField; + + private bool rebootMessageFieldSet; + + private string resetPeriodField; + + private bool resetPeriodFieldSet; + + private string serviceNameField; + + private bool serviceNameFieldSet; + + private ISchemaElement parentElement; + + public ServiceConfigFailureActions() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Failure))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for this service configuration. This value will default to the ServiceName attribute if not + /// specified. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute specifies command to execute when a "runCommand" failure action hit. If an empty string is provided it clears + /// the existing command. If this attribute is not present the setting is not changed. + /// + public string Command + { + get + { + return this.commandField; + } + set + { + this.commandFieldSet = true; + this.commandField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is installed. This attribute may be combined with OnReinstall + /// and OnUninstall. + /// + public YesNoType OnInstall + { + get + { + return this.onInstallField; + } + set + { + this.onInstallFieldSet = true; + this.onInstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is reinstalled. This attribute may be combined with OnInstall + /// and OnUninstall. + /// + public YesNoType OnReinstall + { + get + { + return this.onReinstallField; + } + set + { + this.onReinstallFieldSet = true; + this.onReinstallField = value; + } + } + + /// + /// Specifies whether to configure the service when the parent Component is uninstalled. This attribute may be combined with OnInstall + /// and OnReinstall. + /// + public YesNoType OnUninstall + { + get + { + return this.onUninstallField; + } + set + { + this.onUninstallFieldSet = true; + this.onUninstallField = value; + } + } + + /// + /// Specifies the message to show for a reboot failure action. If an empty string is provided it clears any existing reboot message. If this + /// attribute is not present the setting is not changed. + /// + public string RebootMessage + { + get + { + return this.rebootMessageField; + } + set + { + this.rebootMessageFieldSet = true; + this.rebootMessageField = value; + } + } + + /// + /// Specifies the time in seconds to reset the failure count. If this attribute is not present the failure count will not be reset. + /// + public string ResetPeriod + { + get + { + return this.resetPeriodField; + } + set + { + this.resetPeriodFieldSet = true; + this.resetPeriodField = value; + } + } + + /// + /// Specifies the name of the service to configure. This value will default to the ServiceInstall/@Name attribute when nested under + /// a ServiceInstall element. + /// + public string ServiceName + { + get + { + return this.serviceNameField; + } + set + { + this.serviceNameFieldSet = true; + this.serviceNameField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Failure" == childName)) + { + childValue = new Failure(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ServiceConfigFailureActions", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.commandFieldSet) + { + writer.WriteAttributeString("Command", this.commandField); + } + if (this.onInstallFieldSet) + { + if ((this.onInstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnInstall", "no"); + } + if ((this.onInstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnInstall", "yes"); + } + } + if (this.onReinstallFieldSet) + { + if ((this.onReinstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnReinstall", "no"); + } + if ((this.onReinstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnReinstall", "yes"); + } + } + if (this.onUninstallFieldSet) + { + if ((this.onUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("OnUninstall", "no"); + } + if ((this.onUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("OnUninstall", "yes"); + } + } + if (this.rebootMessageFieldSet) + { + writer.WriteAttributeString("RebootMessage", this.rebootMessageField); + } + if (this.resetPeriodFieldSet) + { + writer.WriteAttributeString("ResetPeriod", this.resetPeriodField); + } + if (this.serviceNameFieldSet) + { + writer.WriteAttributeString("ServiceName", this.serviceNameField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Command" == name)) + { + this.commandField = value; + this.commandFieldSet = true; + } + if (("OnInstall" == name)) + { + this.onInstallField = Enums.ParseYesNoType(value); + this.onInstallFieldSet = true; + } + if (("OnReinstall" == name)) + { + this.onReinstallField = Enums.ParseYesNoType(value); + this.onReinstallFieldSet = true; + } + if (("OnUninstall" == name)) + { + this.onUninstallField = Enums.ParseYesNoType(value); + this.onUninstallFieldSet = true; + } + if (("RebootMessage" == name)) + { + this.rebootMessageField = value; + this.rebootMessageFieldSet = true; + } + if (("ResetPeriod" == name)) + { + this.resetPeriodField = value; + this.resetPeriodFieldSet = true; + } + if (("ServiceName" == name)) + { + this.serviceNameField = value; + this.serviceNameFieldSet = true; + } + } + } + + /// + /// Environment variables added or removed for the parent component. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Environment : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string separatorField; + + private bool separatorFieldSet; + + private ActionType actionField; + + private bool actionFieldSet; + + private PartType partField; + + private bool partFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType systemField; + + private bool systemFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for environment entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Name of the environment variable. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The value to set into the environment variable. + /// If this attribute is not set, the environment variable is removed during installation if it exists on the machine. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// Optional attribute to change the separator used between values. By default a semicolon is used. + /// + public string Separator + { + get + { + return this.separatorField; + } + set + { + this.separatorFieldSet = true; + this.separatorField = value; + } + } + + /// + /// Specfies whether the environmental variable should be created, set or removed when the parent component is installed. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + public PartType Part + { + get + { + return this.partField; + } + set + { + this.partFieldSet = true; + this.partField = value; + } + } + + /// + /// Specifies that the environment variable should not be removed on uninstall. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// Specifies that the environment variable should be added to the system environment space. The default + /// is 'no' which indicates the environment variable is added to the user environment space. + /// + public YesNoType System + { + get + { + return this.systemField; + } + set + { + this.systemFieldSet = true; + this.systemField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + Environment.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("create" == value)) + { + parsedValue = ActionType.create; + } + else + { + if (("set" == value)) + { + parsedValue = ActionType.set; + } + else + { + if (("remove" == value)) + { + parsedValue = ActionType.remove; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a PartType from a string. + /// + public static PartType ParsePartType(string value) + { + PartType parsedValue; + Environment.TryParsePartType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a PartType from a string. + /// + public static bool TryParsePartType(string value, out PartType parsedValue) + { + parsedValue = PartType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("all" == value)) + { + parsedValue = PartType.all; + } + else + { + if (("first" == value)) + { + parsedValue = PartType.first; + } + else + { + if (("last" == value)) + { + parsedValue = PartType.last; + } + else + { + parsedValue = PartType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Environment", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.separatorFieldSet) + { + writer.WriteAttributeString("Separator", this.separatorField); + } + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.create)) + { + writer.WriteAttributeString("Action", "create"); + } + if ((this.actionField == ActionType.set)) + { + writer.WriteAttributeString("Action", "set"); + } + if ((this.actionField == ActionType.remove)) + { + writer.WriteAttributeString("Action", "remove"); + } + } + if (this.partFieldSet) + { + if ((this.partField == PartType.all)) + { + writer.WriteAttributeString("Part", "all"); + } + if ((this.partField == PartType.first)) + { + writer.WriteAttributeString("Part", "first"); + } + if ((this.partField == PartType.last)) + { + writer.WriteAttributeString("Part", "last"); + } + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.systemFieldSet) + { + if ((this.systemField == YesNoType.no)) + { + writer.WriteAttributeString("System", "no"); + } + if ((this.systemField == YesNoType.yes)) + { + writer.WriteAttributeString("System", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Separator" == name)) + { + this.separatorField = value; + this.separatorFieldSet = true; + } + if (("Action" == name)) + { + this.actionField = Environment.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Part" == name)) + { + this.partField = Environment.ParsePartType(value); + this.partFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("System" == name)) + { + this.systemField = Enums.ParseYesNoType(value); + this.systemFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Creates the environment variable if it does not exist, then set it during installation. This has no effect on the value of the environment variable if it already exists. + /// + create, + + /// + /// Creates the environment variable if it does not exist, and then set it during installation. If the environment variable exists, set it during the installation. + /// + set, + + /// + /// Removes the environment variable during an installation. + /// The installer only removes an environment variable during an installation if the name and value + /// of the variable match the entries in the Name and Value attributes. + /// If you want to remove an environment variable, regardless of its value, do not set the Value attribute. + /// + remove, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum PartType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// This value is the entire environmental variable. This is the default. + /// + all, + + /// + /// This value is prefixed. + /// + first, + + /// + /// This value is appended. + /// + last, + } + } + + /// + /// Conditions for components, controls, features, and products. The condition is specified in the inner text of the element. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Condition : ISchemaElement, ISetAttributes + { + + private ActionType actionField; + + private bool actionFieldSet; + + private int levelField; + + private bool levelFieldSet; + + private string messageField; + + private bool messageFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Used only under Control elements and is required. Allows specific actions to be applied to a control based + /// on the result of this condition. + /// + public ActionType Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Used only under Feature elements and is required. Allows modifying the level of a Feature based on the + /// result of this condition. + /// + public int Level + { + get + { + return this.levelField; + } + set + { + this.levelFieldSet = true; + this.levelField = value; + } + } + + /// + /// Used only under Fragment or Package elements and is required. Set the value to the text to display when the + /// condition fails and the installation must be terminated. + /// + public string Message + { + get + { + return this.messageField; + } + set + { + this.messageFieldSet = true; + this.messageField = value; + } + } + + /// + /// Under a Component element, the condition becomes the condition of the component. Under a Control element, + /// the condition becomes a ControlCondition entry. Under a Feature element, the condition becomes a Condition + /// entry. Under a Fragment or Package element, the condition becomes a LaunchCondition entry. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ActionType from a string. + /// + public static ActionType ParseActionType(string value) + { + ActionType parsedValue; + Condition.TryParseActionType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ActionType from a string. + /// + public static bool TryParseActionType(string value, out ActionType parsedValue) + { + parsedValue = ActionType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("default" == value)) + { + parsedValue = ActionType.@default; + } + else + { + if (("enable" == value)) + { + parsedValue = ActionType.enable; + } + else + { + if (("disable" == value)) + { + parsedValue = ActionType.disable; + } + else + { + if (("hide" == value)) + { + parsedValue = ActionType.hide; + } + else + { + if (("show" == value)) + { + parsedValue = ActionType.show; + } + else + { + parsedValue = ActionType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Condition", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + if ((this.actionField == ActionType.@default)) + { + writer.WriteAttributeString("Action", "default"); + } + if ((this.actionField == ActionType.enable)) + { + writer.WriteAttributeString("Action", "enable"); + } + if ((this.actionField == ActionType.disable)) + { + writer.WriteAttributeString("Action", "disable"); + } + if ((this.actionField == ActionType.hide)) + { + writer.WriteAttributeString("Action", "hide"); + } + if ((this.actionField == ActionType.show)) + { + writer.WriteAttributeString("Action", "show"); + } + } + if (this.levelFieldSet) + { + writer.WriteAttributeString("Level", this.levelField.ToString(CultureInfo.InvariantCulture)); + } + if (this.messageFieldSet) + { + writer.WriteAttributeString("Message", this.messageField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = Condition.ParseActionType(value); + this.actionFieldSet = true; + } + if (("Level" == name)) + { + this.levelField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.levelFieldSet = true; + } + if (("Message" == name)) + { + this.messageField = value; + this.messageFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ActionType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Set the Control as the default. Only used under Control elements. + /// + @default, + + /// + /// Enable the Control. Only used under Control elements. + /// + enable, + + /// + /// Disable the Control. Only used under Control elements. + /// + disable, + + /// + /// Hide the Control. Only used under Control elements. + /// + hide, + + /// + /// Display the Control. Only used under Control elements. + /// + show, + } + } + + /// + /// Shared Component to be privately replicated in folder of parent Component + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IsolateComponent : ISchemaElement, ISetAttributes + { + + private string sharedField; + + private bool sharedFieldSet; + + private ISchemaElement parentElement; + + /// + /// Shared Component for this application Component. + /// + public string Shared + { + get + { + return this.sharedField; + } + set + { + this.sharedFieldSet = true; + this.sharedField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IsolateComponent", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sharedFieldSet) + { + writer.WriteAttributeString("Shared", this.sharedField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Shared" == name)) + { + this.sharedField = value; + this.sharedFieldSet = true; + } + } + } + + /// + /// Disk cost to reserve in a folder for running locally and/or from source. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ReserveCost : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private int runFromSourceField; + + private bool runFromSourceFieldSet; + + private int runLocalField; + + private bool runLocalFieldSet; + + private ISchemaElement parentElement; + + /// + /// A primary key that uniquely identifies this ReserveCost entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Adds the amount of disk space specified in RunFromSource or RunLocal to the volume cost of the device containing the directory. + /// If this attribute is not set, it will default to the directory of parent component. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// The number of bytes of disk space to reserve if the component is installed to run from source. + /// + public int RunFromSource + { + get + { + return this.runFromSourceField; + } + set + { + this.runFromSourceFieldSet = true; + this.runFromSourceField = value; + } + } + + /// + /// The number of bytes of disk space to reserve if the component is installed to run locally. + /// + public int RunLocal + { + get + { + return this.runLocalField; + } + set + { + this.runLocalFieldSet = true; + this.runLocalField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ReserveCost", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.runFromSourceFieldSet) + { + writer.WriteAttributeString("RunFromSource", this.runFromSourceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.runLocalFieldSet) + { + writer.WriteAttributeString("RunLocal", this.runLocalField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("RunFromSource" == name)) + { + this.runFromSourceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.runFromSourceFieldSet = true; + } + if (("RunLocal" == name)) + { + this.runLocalField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.runLocalFieldSet = true; + } + } + } + + /// + /// Component for parent Directory + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Component : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private int comPlusFlagsField; + + private bool comPlusFlagsFieldSet; + + private YesNoType disableRegistryReflectionField; + + private bool disableRegistryReflectionFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string featureField; + + private bool featureFieldSet; + + private string guidField; + + private bool guidFieldSet; + + private YesNoType keyPathField; + + private bool keyPathFieldSet; + + private LocationType locationField; + + private bool locationFieldSet; + + private YesNoType multiInstanceField; + + private bool multiInstanceFieldSet; + + private YesNoType neverOverwriteField; + + private bool neverOverwriteFieldSet; + + private YesNoType permanentField; + + private bool permanentFieldSet; + + private YesNoType sharedField; + + private bool sharedFieldSet; + + private YesNoType sharedDllRefCountField; + + private bool sharedDllRefCountFieldSet; + + private YesNoType transitiveField; + + private bool transitiveFieldSet; + + private YesNoType uninstallWhenSupersededField; + + private bool uninstallWhenSupersededFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private ISchemaElement parentElement; + + public Component() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Category))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Class))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CopyFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateFolder))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Environment))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Extension))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(File))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IniFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Interface))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponent))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDataSource))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCDriver))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ODBCTranslator))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgId))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Registry))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryKey))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFile))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFolder))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryKey))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryValue))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ReserveCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceControl))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfig))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceConfigFailureActions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ServiceInstall))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Shortcut))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TypeLib))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Component identifier; this is the primary key for identifying components. If omitted, + /// the compiler defaults the identifier to the identifier of the resource that is the + /// explicit keypath of the component (for example, a child File element with KeyPath + /// attribute with value 'yes'. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to create a ComPlus entry. The value should be the export flags used + /// during the generation of the .msi file. For more information see the COM+ documentation + /// in the Platform SDK. + /// + public int ComPlusFlags + { + get + { + return this.comPlusFlagsField; + } + set + { + this.comPlusFlagsFieldSet = true; + this.comPlusFlagsField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to disable registry reflection on all existing and + /// new registry keys affected by this component. + /// When set to 'yes', the Windows Installer calls the RegDisableReflectionKey on each key + /// being accessed by the component. + /// This bit is available with Windows Installer version 4.0 and is ignored on 32-bit systems. + /// + public YesNoType DisableRegistryReflection + { + get + { + return this.disableRegistryReflectionField; + } + set + { + this.disableRegistryReflectionFieldSet = true; + this.disableRegistryReflectionField = value; + } + } + + /// + /// Sets the Directory of the Component. If this element is nested under a Directory element, + /// this value defaults to the value of the parent Directory/@Id. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// This attribute provides a default DiskId attribute for all child File elements. Specifying + /// the DiskId on a Component element will override any DiskId attributes set by parent Directory + /// or DirectoryRef elements. See the File element's DiskId attribute for more information about + /// the purpose of the DiskId. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Identifies a feature to which this component belongs, as a shorthand for a child + /// ComponentRef element of the Feature element. The value of this attribute should + /// correspond to the Id attribute of a Feature element authored elsewhere. Note that + /// a single component can belong to multiple features but this attribute allows you + /// to specify only a single feature. + /// + public string Feature + { + get + { + return this.featureField; + } + set + { + this.featureFieldSet = true; + this.featureField = value; + } + } + + /// + /// This value should be a guid that uniquely identifies this component's contents, language, platform, and version. + /// If omitted, the default value is '*' which indicates that the linker should generate a stable guid. + /// Generatable guids are supported only for components with a single file as the component's keypath + /// or no files and a registry value as the keypath. + /// It's also possible to set the value to an empty string to specify an unmanaged component. + /// Unmanaged components are a security vulnerability because the component cannot be removed or repaired + /// by Windows Installer (it is essentially an unpatchable, permanent component). Therefore, a guid should + /// always be specified for any component which contains resources that may need to be patched in the future. + /// + public string Guid + { + get + { + return this.guidField; + } + set + { + this.guidFieldSet = true; + this.guidField = value; + } + } + + /// + /// If this attribute's value is set to 'yes', then the Directory of this Component is used + /// as the KeyPath. To set a Registry value or File as the KeyPath of a component, set the + /// KeyPath attribute to 'yes' on one of those child elements. If KeyPath is not set to 'yes' for the + /// Component or for a child Registry value or File, WiX will look at the child elements under the + /// Component in sequential order and try to automatically select one of them as a key path. Allowing + /// WiX to automatically select a key path can be dangerous because adding or removing child elements + /// under the Component can inadvertantly cause the key path to change, which can lead to + /// installation problems. + /// + public YesNoType KeyPath + { + get + { + return this.keyPathField; + } + set + { + this.keyPathFieldSet = true; + this.keyPathField = value; + } + } + + /// + /// Optional value that specifies the location that the component can be run from. + /// + public LocationType Location + { + get + { + return this.locationField; + } + set + { + this.locationFieldSet = true; + this.locationField = value; + } + } + + /// + /// If this attribute is set to 'yes', a new Component/@Guid will be generated for each + /// instance transform. Ensure that all of the resources contained in a multi-instance + /// Component will be installed to different paths based on the instance Property; otherwise, + /// the Component Rules will be violated. + /// + public YesNoType MultiInstance + { + get + { + return this.multiInstanceField; + } + set + { + this.multiInstanceFieldSet = true; + this.multiInstanceField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer does not install or reinstall the + /// component if a key path file or a key path registry entry for the component already + /// exists. The application does register itself as a client of the component. Use this + /// flag only for components that are being registered by the Registry table. Do not use + /// this flag for components registered by the AppId, Class, Extension, ProgId, MIME, and + /// Verb tables. + /// + public YesNoType NeverOverwrite + { + get + { + return this.neverOverwriteField; + } + set + { + this.neverOverwriteFieldSet = true; + this.neverOverwriteField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer does not remove the component during + /// an uninstall. The installer registers an extra system client for the component in + /// the Windows Installer registry settings (which basically just means that at least one + /// product is always referencing this component). Note that this option differs from the + /// behavior of not setting a guid because although the component is permanent, it is still + /// patchable (because Windows Installer still tracks it), it's just not uninstallable. + /// + public YesNoType Permanent + { + get + { + return this.permanentField; + } + set + { + this.permanentFieldSet = true; + this.permanentField = value; + } + } + + /// + /// If this attribute's value is set to 'yes', enables advanced patching semantics for + /// Components that are shared across multiple Products. Specifically, the Windows Installer + /// will cache the shared files to improve patch uninstall. This functionality is available + /// in Windows Installer 4.5 and later. + /// + public YesNoType Shared + { + get + { + return this.sharedField; + } + set + { + this.sharedFieldSet = true; + this.sharedField = value; + } + } + + /// + /// If this attribute's value is set to 'yes', the installer increments the reference count + /// in the shared DLL registry of the component's key file. If this bit is not set, the + /// installer increments the reference count only if the reference count already exists. + /// + public YesNoType SharedDllRefCount + { + get + { + return this.sharedDllRefCountField; + } + set + { + this.sharedDllRefCountFieldSet = true; + this.sharedDllRefCountField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer reevaluates the value of the statement + /// in the Condition upon a reinstall. If the value was previously False and has changed to + /// True, the installer installs the component. If the value was previously True and has + /// changed to False, the installer removes the component even if the component has other + /// products as clients. + /// + public YesNoType Transitive + { + get + { + return this.transitiveField; + } + set + { + this.transitiveFieldSet = true; + this.transitiveField = value; + } + } + + /// + /// If this attribute is set to 'yes', the installer will uninstall the Component's files + /// and registry keys when it is superseded by a patch. This functionality is available in + /// Windows Installer 4.5 and later. + /// + public YesNoType UninstallWhenSuperseded + { + get + { + return this.uninstallWhenSupersededField; + } + set + { + this.uninstallWhenSupersededFieldSet = true; + this.uninstallWhenSupersededField = value; + } + } + + /// + /// Set this attribute to 'yes' to mark this as a 64-bit component. This attribute facilitates + /// the installation of packages that include both 32-bit and 64-bit components. If this is a 64-bit + /// component replacing a 32-bit component, set this attribute to 'yes' and assign a new GUID in the Guid attribute. + /// The default value is based on the platform set by the -arch switch to candle.exe + /// or the InstallerPlatform property in a .wixproj MSBuild project: + /// For x86 and ARM, the default value is 'no'. + /// For x64 and IA64, the default value is 'yes'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("AppId" == childName)) + { + childValue = new AppId(); + } + if (("Category" == childName)) + { + childValue = new Category(); + } + if (("Class" == childName)) + { + childValue = new Class(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("CopyFile" == childName)) + { + childValue = new CopyFile(); + } + if (("CreateFolder" == childName)) + { + childValue = new CreateFolder(); + } + if (("Environment" == childName)) + { + childValue = new Environment(); + } + if (("Extension" == childName)) + { + childValue = new Extension(); + } + if (("File" == childName)) + { + childValue = new File(); + } + if (("IniFile" == childName)) + { + childValue = new IniFile(); + } + if (("Interface" == childName)) + { + childValue = new Interface(); + } + if (("IsolateComponent" == childName)) + { + childValue = new IsolateComponent(); + } + if (("ODBCDataSource" == childName)) + { + childValue = new ODBCDataSource(); + } + if (("ODBCDriver" == childName)) + { + childValue = new ODBCDriver(); + } + if (("ODBCTranslator" == childName)) + { + childValue = new ODBCTranslator(); + } + if (("ProgId" == childName)) + { + childValue = new ProgId(); + } + if (("Registry" == childName)) + { + childValue = new Registry(); + } + if (("RegistryKey" == childName)) + { + childValue = new RegistryKey(); + } + if (("RegistryValue" == childName)) + { + childValue = new RegistryValue(); + } + if (("RemoveFile" == childName)) + { + childValue = new RemoveFile(); + } + if (("RemoveFolder" == childName)) + { + childValue = new RemoveFolder(); + } + if (("RemoveRegistryKey" == childName)) + { + childValue = new RemoveRegistryKey(); + } + if (("RemoveRegistryValue" == childName)) + { + childValue = new RemoveRegistryValue(); + } + if (("ReserveCost" == childName)) + { + childValue = new ReserveCost(); + } + if (("ServiceControl" == childName)) + { + childValue = new ServiceControl(); + } + if (("ServiceConfig" == childName)) + { + childValue = new ServiceConfig(); + } + if (("ServiceConfigFailureActions" == childName)) + { + childValue = new ServiceConfigFailureActions(); + } + if (("ServiceInstall" == childName)) + { + childValue = new ServiceInstall(); + } + if (("Shortcut" == childName)) + { + childValue = new Shortcut(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if (("TypeLib" == childName)) + { + childValue = new TypeLib(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a LocationType from a string. + /// + public static LocationType ParseLocationType(string value) + { + LocationType parsedValue; + Component.TryParseLocationType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a LocationType from a string. + /// + public static bool TryParseLocationType(string value, out LocationType parsedValue) + { + parsedValue = LocationType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("local" == value)) + { + parsedValue = LocationType.local; + } + else + { + if (("source" == value)) + { + parsedValue = LocationType.source; + } + else + { + if (("either" == value)) + { + parsedValue = LocationType.either; + } + else + { + parsedValue = LocationType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Component", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.comPlusFlagsFieldSet) + { + writer.WriteAttributeString("ComPlusFlags", this.comPlusFlagsField.ToString(CultureInfo.InvariantCulture)); + } + if (this.disableRegistryReflectionFieldSet) + { + if ((this.disableRegistryReflectionField == YesNoType.no)) + { + writer.WriteAttributeString("DisableRegistryReflection", "no"); + } + if ((this.disableRegistryReflectionField == YesNoType.yes)) + { + writer.WriteAttributeString("DisableRegistryReflection", "yes"); + } + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.featureFieldSet) + { + writer.WriteAttributeString("Feature", this.featureField); + } + if (this.guidFieldSet) + { + writer.WriteAttributeString("Guid", this.guidField); + } + if (this.keyPathFieldSet) + { + if ((this.keyPathField == YesNoType.no)) + { + writer.WriteAttributeString("KeyPath", "no"); + } + if ((this.keyPathField == YesNoType.yes)) + { + writer.WriteAttributeString("KeyPath", "yes"); + } + } + if (this.locationFieldSet) + { + if ((this.locationField == LocationType.local)) + { + writer.WriteAttributeString("Location", "local"); + } + if ((this.locationField == LocationType.source)) + { + writer.WriteAttributeString("Location", "source"); + } + if ((this.locationField == LocationType.either)) + { + writer.WriteAttributeString("Location", "either"); + } + } + if (this.multiInstanceFieldSet) + { + if ((this.multiInstanceField == YesNoType.no)) + { + writer.WriteAttributeString("MultiInstance", "no"); + } + if ((this.multiInstanceField == YesNoType.yes)) + { + writer.WriteAttributeString("MultiInstance", "yes"); + } + } + if (this.neverOverwriteFieldSet) + { + if ((this.neverOverwriteField == YesNoType.no)) + { + writer.WriteAttributeString("NeverOverwrite", "no"); + } + if ((this.neverOverwriteField == YesNoType.yes)) + { + writer.WriteAttributeString("NeverOverwrite", "yes"); + } + } + if (this.permanentFieldSet) + { + if ((this.permanentField == YesNoType.no)) + { + writer.WriteAttributeString("Permanent", "no"); + } + if ((this.permanentField == YesNoType.yes)) + { + writer.WriteAttributeString("Permanent", "yes"); + } + } + if (this.sharedFieldSet) + { + if ((this.sharedField == YesNoType.no)) + { + writer.WriteAttributeString("Shared", "no"); + } + if ((this.sharedField == YesNoType.yes)) + { + writer.WriteAttributeString("Shared", "yes"); + } + } + if (this.sharedDllRefCountFieldSet) + { + if ((this.sharedDllRefCountField == YesNoType.no)) + { + writer.WriteAttributeString("SharedDllRefCount", "no"); + } + if ((this.sharedDllRefCountField == YesNoType.yes)) + { + writer.WriteAttributeString("SharedDllRefCount", "yes"); + } + } + if (this.transitiveFieldSet) + { + if ((this.transitiveField == YesNoType.no)) + { + writer.WriteAttributeString("Transitive", "no"); + } + if ((this.transitiveField == YesNoType.yes)) + { + writer.WriteAttributeString("Transitive", "yes"); + } + } + if (this.uninstallWhenSupersededFieldSet) + { + if ((this.uninstallWhenSupersededField == YesNoType.no)) + { + writer.WriteAttributeString("UninstallWhenSuperseded", "no"); + } + if ((this.uninstallWhenSupersededField == YesNoType.yes)) + { + writer.WriteAttributeString("UninstallWhenSuperseded", "yes"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ComPlusFlags" == name)) + { + this.comPlusFlagsField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.comPlusFlagsFieldSet = true; + } + if (("DisableRegistryReflection" == name)) + { + this.disableRegistryReflectionField = Enums.ParseYesNoType(value); + this.disableRegistryReflectionFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("Feature" == name)) + { + this.featureField = value; + this.featureFieldSet = true; + } + if (("Guid" == name)) + { + this.guidField = value; + this.guidFieldSet = true; + } + if (("KeyPath" == name)) + { + this.keyPathField = Enums.ParseYesNoType(value); + this.keyPathFieldSet = true; + } + if (("Location" == name)) + { + this.locationField = Component.ParseLocationType(value); + this.locationFieldSet = true; + } + if (("MultiInstance" == name)) + { + this.multiInstanceField = Enums.ParseYesNoType(value); + this.multiInstanceFieldSet = true; + } + if (("NeverOverwrite" == name)) + { + this.neverOverwriteField = Enums.ParseYesNoType(value); + this.neverOverwriteFieldSet = true; + } + if (("Permanent" == name)) + { + this.permanentField = Enums.ParseYesNoType(value); + this.permanentFieldSet = true; + } + if (("Shared" == name)) + { + this.sharedField = Enums.ParseYesNoType(value); + this.sharedFieldSet = true; + } + if (("SharedDllRefCount" == name)) + { + this.sharedDllRefCountField = Enums.ParseYesNoType(value); + this.sharedDllRefCountFieldSet = true; + } + if (("Transitive" == name)) + { + this.transitiveField = Enums.ParseYesNoType(value); + this.transitiveFieldSet = true; + } + if (("UninstallWhenSuperseded" == name)) + { + this.uninstallWhenSupersededField = Enums.ParseYesNoType(value); + this.uninstallWhenSupersededFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum LocationType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Prevents the component from running from the source or the network (this is the default behavior if this attribute is not set). + /// + local, + + /// + /// Enforces that the component can only be run from the source (it cannot be run from the user's computer). + /// + source, + + /// + /// Allows the component to run from source or locally. + /// + either, + } + } + + /// + /// Groups together multiple components to be used in other locations. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private ISchemaElement parentElement; + + public ComponentGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the ComponentGroup. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets the default directory identifier for child Component elements. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// Used to set the default file system source for child Component elements. For more information, see + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + } + } + + /// + /// Create a reference to a ComponentGroup in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the ComponentGroup to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to make the parent feature of this component + /// the primary feature for this component. Components may belong to multiple features. + /// By designating a feature as the primary feature of a component, you ensure that + /// whenever a component is selected for install-on-demand (IOD), the primary feature + /// will be the one to install it. This attribute should only be set if a component + /// actually nests under multiple features. If a component nests under only one feature, + /// that feature is the primary feature for the component. You cannot set more than one + /// feature as the primary feature of a given component. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Used only for PatchFamilies to include all changes between the baseline and upgraded packages in a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class All : ISetAttributes, ISchemaElement + { + + private ISchemaElement parentElement; + + private string contentField; + + private bool contentFieldSet; + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Used only for PatchFamilies to include all changes between the baseline and upgraded packages in a patch. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("All", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + } + + /// + /// Used only for PatchFamilies to include only a binary table entry in a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BinaryRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Binary element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BinaryRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Used only for PatchFamilies to include only a icon table entry in a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IconRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Icon element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IconRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a Feature element in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComponentRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Component element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to make the parent feature of this component + /// the primary feature for this component. Components may belong to multiple features. + /// By designating a feature as the primary feature of a component, you ensure that + /// whenever a component is selected for install-on-demand (IOD), the primary feature + /// will be the one to install it. This attribute should only be set if a component + /// actually nests under multiple features. If a component nests under only one feature, + /// that feature is the primary feature for the component. You cannot set more than one + /// feature as the primary feature of a given component. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComponentRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Merge directive to bring in a merge module that will be redirected to the parent directory. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Merge : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private YesNoType fileCompressionField; + + private bool fileCompressionFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + public Merge() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ConfigurationData))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The unique identifier for the Merge element in the source code. Referenced by the MergeRef/@Id. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The value of this attribute should correspond to the Id attribute of a + /// Media element authored elsewhere. By creating this connection between the merge module and Media + /// element, you set the packaging options to the values specified in the Media + /// element (values such as compression level, cab embedding, etc...). + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Specifies if the files in the merge module should be compressed. + /// + public YesNoType FileCompression + { + get + { + return this.fileCompressionField; + } + set + { + this.fileCompressionFieldSet = true; + this.fileCompressionField = value; + } + } + + /// + /// Specifies the decimal LCID or localization token for the language to merge the Module in as. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// Path to the source location of the merge module. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ConfigurationData" == childName)) + { + childValue = new ConfigurationData(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Merge", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.fileCompressionFieldSet) + { + if ((this.fileCompressionField == YesNoType.no)) + { + writer.WriteAttributeString("FileCompression", "no"); + } + if ((this.fileCompressionField == YesNoType.yes)) + { + writer.WriteAttributeString("FileCompression", "yes"); + } + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("FileCompression" == name)) + { + this.fileCompressionField = Enums.ParseYesNoType(value); + this.fileCompressionFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + /// + /// Merge reference to connect a Merge Module to parent Feature + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MergeRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The unique identifier for the Merge element to be referenced. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies whether the feature containing this MergeRef is the primary feature for advertising the merge module's components. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MergeRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Data to use as input to a configurable merge module. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ConfigurationData : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// Name of the item in the ModuleConfiguration table. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Value to be passed to configurable merge module. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ConfigurationData", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Directory layout for the product. Also specifies the mappings between source and target directories. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Directory : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string componentGuidGenerationSeedField; + + private bool componentGuidGenerationSeedFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string fileSourceField; + + private bool fileSourceFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string shortNameField; + + private bool shortNameFieldSet; + + private string shortSourceNameField; + + private bool shortSourceNameFieldSet; + + private string sourceNameField; + + private bool sourceNameFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + public Directory() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Merge))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// This value is the unique identifier of the directory entry. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The Component Guid Generation Seed is a guid that must be used when a Component with the generate guid directive ("*") + /// is not rooted in a standard Windows Installer directory (for example, ProgramFilesFolder or CommonFilesFolder). + /// It is recommended that this attribute be avoided and that developers install their Components under standard + /// directories with unique names instead (for example, "ProgramFilesFolder\Company Name Product Name Version"). It is + /// important to note that once a directory is assigned a Component Guid Generation Seed the value must not change until + /// (and must be changed when) the path to that directory, including itself and all parent directories, changes. + /// + public string ComponentGuidGenerationSeed + { + get + { + return this.componentGuidGenerationSeedField; + } + set + { + this.componentGuidGenerationSeedFieldSet = true; + this.componentGuidGenerationSeedField = value; + } + } + + /// + /// Sets the default disk identifier for the files contained in this directory. + /// This attribute's value may be overridden by a child Component, Directory, + /// Merge or File element. See the File or Merge elements' DiskId attribute for + /// more information. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Used to set the file system source for this directory's child elements. For more information, see + /// + public string FileSource + { + get + { + return this.fileSourceField; + } + set + { + this.fileSourceFieldSet = true; + this.fileSourceField = value; + } + } + + /// + /// The name of the directory. + /// + /// Do not specify this attribute if this directory represents + /// the same directory as the parent (see the Windows Installer SDK's + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The short name of the directory in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short directory names + /// or the user wants to manually specify the short directory name. + /// + public string ShortName + { + get + { + return this.shortNameField; + } + set + { + this.shortNameFieldSet = true; + this.shortNameField = value; + } + } + + /// + /// The short name of the directory on the source media in 8.3 format. + /// This attribute should only be set if there is a conflict between generated short directory names + /// or the user wants to manually specify the short source directory name. + /// + public string ShortSourceName + { + get + { + return this.shortSourceNameField; + } + set + { + this.shortSourceNameFieldSet = true; + this.shortSourceNameField = value; + } + } + + /// + /// The name of the directory on the source media. + /// If this attribute is not specified, Windows Installer will default to the Name attribute. + /// + /// In prior versions of the WiX toolset, this attribute specified the short source directory name. + /// This attribute's value may now be either a short or long directory name. + /// If a short directory name is specified, the ShortSourceName attribute may not be specified. + /// If a long directory name is specified, the LongSource attribute may not be specified. + /// Also, if this value is a long directory name, the ShortSourceName attribute may be omitted to + /// allow WiX to attempt to generate a unique short directory name. + /// However, if this name collides with another directory or you wish to manually specify + /// the short directory name, then the ShortSourceName attribute may be specified. + /// + public string SourceName + { + get + { + return this.sourceNameField; + } + set + { + this.sourceNameFieldSet = true; + this.sourceNameField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("Merge" == childName)) + { + childValue = new Merge(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Directory", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.componentGuidGenerationSeedFieldSet) + { + writer.WriteAttributeString("ComponentGuidGenerationSeed", this.componentGuidGenerationSeedField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.fileSourceFieldSet) + { + writer.WriteAttributeString("FileSource", this.fileSourceField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.shortNameFieldSet) + { + writer.WriteAttributeString("ShortName", this.shortNameField); + } + if (this.shortSourceNameFieldSet) + { + writer.WriteAttributeString("ShortSourceName", this.shortSourceNameField); + } + if (this.sourceNameFieldSet) + { + writer.WriteAttributeString("SourceName", this.sourceNameField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ComponentGuidGenerationSeed" == name)) + { + this.componentGuidGenerationSeedField = value; + this.componentGuidGenerationSeedFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("FileSource" == name)) + { + this.fileSourceField = value; + this.fileSourceFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("ShortName" == name)) + { + this.shortNameField = value; + this.shortNameFieldSet = true; + } + if (("ShortSourceName" == name)) + { + this.shortSourceNameField = value; + this.shortSourceNameFieldSet = true; + } + if (("SourceName" == name)) + { + this.sourceNameField = value; + this.sourceNameFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + /// + /// Create a reference to a Directory element in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DirectoryRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string diskIdField; + + private bool diskIdFieldSet; + + private string fileSourceField; + + private bool fileSourceFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + public DirectoryRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Directory))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Merge))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the Directory element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Sets the default disk identifier for the files contained in this directory. + /// This attribute's value may be overridden by a child Component, Directory, + /// Merge or File element. See the File or Merge elements' DiskId attribute for + /// more information. + /// + public string DiskId + { + get + { + return this.diskIdField; + } + set + { + this.diskIdFieldSet = true; + this.diskIdField = value; + } + } + + /// + /// Used to set the file system source for this DirectoryRef's child elements. For more information, see + /// + public string FileSource + { + get + { + return this.fileSourceField; + } + set + { + this.fileSourceFieldSet = true; + this.fileSourceField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("Directory" == childName)) + { + childValue = new Directory(); + } + if (("Merge" == childName)) + { + childValue = new Merge(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DirectoryRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.diskIdFieldSet) + { + writer.WriteAttributeString("DiskId", this.diskIdField); + } + if (this.fileSourceFieldSet) + { + writer.WriteAttributeString("FileSource", this.fileSourceField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("DiskId" == name)) + { + this.diskIdField = value; + this.diskIdFieldSet = true; + } + if (("FileSource" == name)) + { + this.fileSourceField = value; + this.fileSourceFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UpgradeVersion : ISchemaElement, ISetAttributes + { + + private string minimumField; + + private bool minimumFieldSet; + + private string maximumField; + + private bool maximumFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private string removeFeaturesField; + + private bool removeFeaturesFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private YesNoType migrateFeaturesField; + + private bool migrateFeaturesFieldSet; + + private YesNoType onlyDetectField; + + private bool onlyDetectFieldSet; + + private YesNoType ignoreRemoveFailureField; + + private bool ignoreRemoveFailureFieldSet; + + private YesNoType includeMinimumField; + + private bool includeMinimumFieldSet; + + private YesNoType includeMaximumField; + + private bool includeMaximumFieldSet; + + private YesNoType excludeLanguagesField; + + private bool excludeLanguagesFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the lower bound on the range of product versions to be detected by FindRelatedProducts. + /// + public string Minimum + { + get + { + return this.minimumField; + } + set + { + this.minimumFieldSet = true; + this.minimumField = value; + } + } + + /// + /// Specifies the upper boundary of the range of product versions detected by FindRelatedProducts. + /// + public string Maximum + { + get + { + return this.maximumField; + } + set + { + this.maximumFieldSet = true; + this.maximumField = value; + } + } + + /// + /// Specifies the set of languages detected by FindRelatedProducts. Enter a list of numeric language identifiers (LANGID) separated by commas (,). Leave this value null to specify all languages. Set ExcludeLanguages to "yes" in order detect all languages, excluding the languages listed in this value. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// The installer sets the REMOVE property to features specified in this column. The features to be removed can be determined at run time. The Formatted string entered in this field must evaluate to a comma-delimited list of feature names. For example: [Feature1],[Feature2],[Feature3]. No features are removed if the field contains formatted text that evaluates to an empty string. The installer sets REMOVE=ALL only if the Remove field is empty. + /// + public string RemoveFeatures + { + get + { + return this.removeFeaturesField; + } + set + { + this.removeFeaturesFieldSet = true; + this.removeFeaturesField = value; + } + } + + /// + /// When the FindRelatedProducts action detects a related product installed on the system, it appends the product code to the property specified in this field. Windows Installer documentation for the + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// Set to "yes" to migrate feature states from upgraded products by enabling the logic in the MigrateFeatureStates action. + /// + public YesNoType MigrateFeatures + { + get + { + return this.migrateFeaturesField; + } + set + { + this.migrateFeaturesFieldSet = true; + this.migrateFeaturesField = value; + } + } + + /// + /// Set to "yes" to detect products and applications but do not uninstall. + /// + public YesNoType OnlyDetect + { + get + { + return this.onlyDetectField; + } + set + { + this.onlyDetectFieldSet = true; + this.onlyDetectField = value; + } + } + + /// + /// Set to "yes" to continue installation upon failure to remove a product or application. + /// + public YesNoType IgnoreRemoveFailure + { + get + { + return this.ignoreRemoveFailureField; + } + set + { + this.ignoreRemoveFailureFieldSet = true; + this.ignoreRemoveFailureField = value; + } + } + + /// + /// Set to "no" to make the range of versions detected exclude the value specified in Minimum. This attribute is "yes" by default. + /// + public YesNoType IncludeMinimum + { + get + { + return this.includeMinimumField; + } + set + { + this.includeMinimumFieldSet = true; + this.includeMinimumField = value; + } + } + + /// + /// Set to "yes" to make the range of versions detected include the value specified in Maximum. + /// + public YesNoType IncludeMaximum + { + get + { + return this.includeMaximumField; + } + set + { + this.includeMaximumFieldSet = true; + this.includeMaximumField = value; + } + } + + /// + /// Set to "yes" to detect all languages, excluding the languages listed in the Language attribute. + /// + public YesNoType ExcludeLanguages + { + get + { + return this.excludeLanguagesField; + } + set + { + this.excludeLanguagesFieldSet = true; + this.excludeLanguagesField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UpgradeVersion", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.minimumFieldSet) + { + writer.WriteAttributeString("Minimum", this.minimumField); + } + if (this.maximumFieldSet) + { + writer.WriteAttributeString("Maximum", this.maximumField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.removeFeaturesFieldSet) + { + writer.WriteAttributeString("RemoveFeatures", this.removeFeaturesField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.migrateFeaturesFieldSet) + { + if ((this.migrateFeaturesField == YesNoType.no)) + { + writer.WriteAttributeString("MigrateFeatures", "no"); + } + if ((this.migrateFeaturesField == YesNoType.yes)) + { + writer.WriteAttributeString("MigrateFeatures", "yes"); + } + } + if (this.onlyDetectFieldSet) + { + if ((this.onlyDetectField == YesNoType.no)) + { + writer.WriteAttributeString("OnlyDetect", "no"); + } + if ((this.onlyDetectField == YesNoType.yes)) + { + writer.WriteAttributeString("OnlyDetect", "yes"); + } + } + if (this.ignoreRemoveFailureFieldSet) + { + if ((this.ignoreRemoveFailureField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "no"); + } + if ((this.ignoreRemoveFailureField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "yes"); + } + } + if (this.includeMinimumFieldSet) + { + if ((this.includeMinimumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMinimum", "no"); + } + if ((this.includeMinimumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMinimum", "yes"); + } + } + if (this.includeMaximumFieldSet) + { + if ((this.includeMaximumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMaximum", "no"); + } + if ((this.includeMaximumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMaximum", "yes"); + } + } + if (this.excludeLanguagesFieldSet) + { + if ((this.excludeLanguagesField == YesNoType.no)) + { + writer.WriteAttributeString("ExcludeLanguages", "no"); + } + if ((this.excludeLanguagesField == YesNoType.yes)) + { + writer.WriteAttributeString("ExcludeLanguages", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Minimum" == name)) + { + this.minimumField = value; + this.minimumFieldSet = true; + } + if (("Maximum" == name)) + { + this.maximumField = value; + this.maximumFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("RemoveFeatures" == name)) + { + this.removeFeaturesField = value; + this.removeFeaturesFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("MigrateFeatures" == name)) + { + this.migrateFeaturesField = Enums.ParseYesNoType(value); + this.migrateFeaturesFieldSet = true; + } + if (("OnlyDetect" == name)) + { + this.onlyDetectField = Enums.ParseYesNoType(value); + this.onlyDetectFieldSet = true; + } + if (("IgnoreRemoveFailure" == name)) + { + this.ignoreRemoveFailureField = Enums.ParseYesNoType(value); + this.ignoreRemoveFailureFieldSet = true; + } + if (("IncludeMinimum" == name)) + { + this.includeMinimumField = Enums.ParseYesNoType(value); + this.includeMinimumFieldSet = true; + } + if (("IncludeMaximum" == name)) + { + this.includeMaximumField = Enums.ParseYesNoType(value); + this.includeMaximumFieldSet = true; + } + if (("ExcludeLanguages" == name)) + { + this.excludeLanguagesField = Enums.ParseYesNoType(value); + this.excludeLanguagesFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Upgrade info for a particular UpgradeCode + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Upgrade : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public Upgrade() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UpgradeVersion))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// This value specifies the upgrade code for the products that are to be detected by the FindRelatedProducts action. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("UpgradeVersion" == childName)) + { + childValue = new UpgradeVersion(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Upgrade", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// A feature for the Feature table. Features are the smallest installable unit. See msi.chm for more + /// detailed information on the myriad installation options for a feature. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Feature : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private AbsentType absentField; + + private bool absentFieldSet; + + private AllowAdvertiseType allowAdvertiseField; + + private bool allowAdvertiseFieldSet; + + private string configurableDirectoryField; + + private bool configurableDirectoryFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private string displayField; + + private bool displayFieldSet; + + private InstallDefaultType installDefaultField; + + private bool installDefaultFieldSet; + + private int levelField; + + private bool levelFieldSet; + + private string titleField; + + private bool titleFieldSet; + + private TypicalDefaultType typicalDefaultField; + + private bool typicalDefaultFieldSet; + + private ISchemaElement parentElement; + + public Feature() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier of the feature. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute determines if a user will have the option to set a feature to absent in the user interface. + /// + public AbsentType Absent + { + get + { + return this.absentField; + } + set + { + this.absentFieldSet = true; + this.absentField = value; + } + } + + /// + /// This attribute determines the possible advertise states for this feature. + /// + public AllowAdvertiseType AllowAdvertise + { + get + { + return this.allowAdvertiseField; + } + set + { + this.allowAdvertiseFieldSet = true; + this.allowAdvertiseField = value; + } + } + + /// + /// Specify the Id of a Directory that can be configured by the user at installation time. This identifier + /// must be a public property and therefore completely uppercase. + /// + public string ConfigurableDirectory + { + get + { + return this.configurableDirectoryField; + } + set + { + this.configurableDirectoryFieldSet = true; + this.configurableDirectoryField = value; + } + } + + /// + /// Longer string of text describing the feature. This localizable string is displayed by the + /// Text Control of the Selection Dialog. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// Determines the initial display of this feature in the feature tree. + /// This attribute's value should be one of the following: + /// + public string Display + { + get + { + return this.displayField; + } + set + { + this.displayFieldSet = true; + this.displayField = value; + } + } + + /// + /// This attribute determines the default install/run location of a feature. This attribute cannot be specified + /// if the value of the FollowParent attribute is 'yes' since that would ask the installer to force this feature + /// to follow the parent installation state and simultaneously favor a particular installation state just for this feature. + /// + public InstallDefaultType InstallDefault + { + get + { + return this.installDefaultField; + } + set + { + this.installDefaultFieldSet = true; + this.installDefaultField = value; + } + } + + /// + /// Sets the install level of this feature. A value of 0 will disable the feature. Processing the + /// Condition Table can modify the level value (this is set via the Condition child element). The + /// default value is "1". + /// + public int Level + { + get + { + return this.levelField; + } + set + { + this.levelFieldSet = true; + this.levelField = value; + } + } + + /// + /// Short string of text identifying the feature. This string is listed as an item by the + /// SelectionTree control of the Selection Dialog. + /// + public string Title + { + get + { + return this.titleField; + } + set + { + this.titleFieldSet = true; + this.titleField = value; + } + } + + /// + /// This attribute determines the default advertise state of the feature. + /// + public TypicalDefaultType TypicalDefault + { + get + { + return this.typicalDefaultField; + } + set + { + this.typicalDefaultFieldSet = true; + this.typicalDefaultField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("MergeRef" == childName)) + { + childValue = new MergeRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a AbsentType from a string. + /// + public static AbsentType ParseAbsentType(string value) + { + AbsentType parsedValue; + Feature.TryParseAbsentType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a AbsentType from a string. + /// + public static bool TryParseAbsentType(string value, out AbsentType parsedValue) + { + parsedValue = AbsentType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("allow" == value)) + { + parsedValue = AbsentType.allow; + } + else + { + if (("disallow" == value)) + { + parsedValue = AbsentType.disallow; + } + else + { + parsedValue = AbsentType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a AllowAdvertiseType from a string. + /// + public static AllowAdvertiseType ParseAllowAdvertiseType(string value) + { + AllowAdvertiseType parsedValue; + Feature.TryParseAllowAdvertiseType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a AllowAdvertiseType from a string. + /// + public static bool TryParseAllowAdvertiseType(string value, out AllowAdvertiseType parsedValue) + { + parsedValue = AllowAdvertiseType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("no" == value)) + { + parsedValue = AllowAdvertiseType.no; + } + else + { + if (("system" == value)) + { + parsedValue = AllowAdvertiseType.system; + } + else + { + if (("yes" == value)) + { + parsedValue = AllowAdvertiseType.yes; + } + else + { + parsedValue = AllowAdvertiseType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a InstallDefaultType from a string. + /// + public static InstallDefaultType ParseInstallDefaultType(string value) + { + InstallDefaultType parsedValue; + Feature.TryParseInstallDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a InstallDefaultType from a string. + /// + public static bool TryParseInstallDefaultType(string value, out InstallDefaultType parsedValue) + { + parsedValue = InstallDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("followParent" == value)) + { + parsedValue = InstallDefaultType.followParent; + } + else + { + if (("local" == value)) + { + parsedValue = InstallDefaultType.local; + } + else + { + if (("source" == value)) + { + parsedValue = InstallDefaultType.source; + } + else + { + parsedValue = InstallDefaultType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a TypicalDefaultType from a string. + /// + public static TypicalDefaultType ParseTypicalDefaultType(string value) + { + TypicalDefaultType parsedValue; + Feature.TryParseTypicalDefaultType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypicalDefaultType from a string. + /// + public static bool TryParseTypicalDefaultType(string value, out TypicalDefaultType parsedValue) + { + parsedValue = TypicalDefaultType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("advertise" == value)) + { + parsedValue = TypicalDefaultType.advertise; + } + else + { + if (("install" == value)) + { + parsedValue = TypicalDefaultType.install; + } + else + { + parsedValue = TypicalDefaultType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Feature", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.absentFieldSet) + { + if ((this.absentField == AbsentType.allow)) + { + writer.WriteAttributeString("Absent", "allow"); + } + if ((this.absentField == AbsentType.disallow)) + { + writer.WriteAttributeString("Absent", "disallow"); + } + } + if (this.allowAdvertiseFieldSet) + { + if ((this.allowAdvertiseField == AllowAdvertiseType.no)) + { + writer.WriteAttributeString("AllowAdvertise", "no"); + } + if ((this.allowAdvertiseField == AllowAdvertiseType.system)) + { + writer.WriteAttributeString("AllowAdvertise", "system"); + } + if ((this.allowAdvertiseField == AllowAdvertiseType.yes)) + { + writer.WriteAttributeString("AllowAdvertise", "yes"); + } + } + if (this.configurableDirectoryFieldSet) + { + writer.WriteAttributeString("ConfigurableDirectory", this.configurableDirectoryField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.displayFieldSet) + { + writer.WriteAttributeString("Display", this.displayField); + } + if (this.installDefaultFieldSet) + { + if ((this.installDefaultField == InstallDefaultType.followParent)) + { + writer.WriteAttributeString("InstallDefault", "followParent"); + } + if ((this.installDefaultField == InstallDefaultType.local)) + { + writer.WriteAttributeString("InstallDefault", "local"); + } + if ((this.installDefaultField == InstallDefaultType.source)) + { + writer.WriteAttributeString("InstallDefault", "source"); + } + } + if (this.levelFieldSet) + { + writer.WriteAttributeString("Level", this.levelField.ToString(CultureInfo.InvariantCulture)); + } + if (this.titleFieldSet) + { + writer.WriteAttributeString("Title", this.titleField); + } + if (this.typicalDefaultFieldSet) + { + if ((this.typicalDefaultField == TypicalDefaultType.advertise)) + { + writer.WriteAttributeString("TypicalDefault", "advertise"); + } + if ((this.typicalDefaultField == TypicalDefaultType.install)) + { + writer.WriteAttributeString("TypicalDefault", "install"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Absent" == name)) + { + this.absentField = Feature.ParseAbsentType(value); + this.absentFieldSet = true; + } + if (("AllowAdvertise" == name)) + { + this.allowAdvertiseField = Feature.ParseAllowAdvertiseType(value); + this.allowAdvertiseFieldSet = true; + } + if (("ConfigurableDirectory" == name)) + { + this.configurableDirectoryField = value; + this.configurableDirectoryFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Display" == name)) + { + this.displayField = value; + this.displayFieldSet = true; + } + if (("InstallDefault" == name)) + { + this.installDefaultField = Feature.ParseInstallDefaultType(value); + this.installDefaultFieldSet = true; + } + if (("Level" == name)) + { + this.levelField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.levelFieldSet = true; + } + if (("Title" == name)) + { + this.titleField = value; + this.titleFieldSet = true; + } + if (("TypicalDefault" == name)) + { + this.typicalDefaultField = Feature.ParseTypicalDefaultType(value); + this.typicalDefaultFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum AbsentType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Allows the user interface to display an option to change the feature state to Absent. + /// + allow, + + /// + /// Prevents the user interface from displaying an option to change the feature state + /// to Absent by setting the msidbFeatureAttributesUIDisallowAbsent attribute. This will force the feature + /// to the installation state, whether or not the feature is visible in the UI. + /// + disallow, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum AllowAdvertiseType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Prevents this feature from being advertised by setting the msidbFeatureAttributesDisallowAdvertise attribute. + /// + no, + + /// + /// Prevents advertising for this feature if the operating system shell does not support Windows Installer + /// descriptors by setting the msidbFeatureAttributesNoUnsupportedAdvertise attribute. + /// + system, + + /// + /// Allows the feature to be advertised. + /// + yes, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum InstallDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Forces the feature to follow the same installation state as its parent feature. + /// + followParent, + + /// + /// Favors installing this feature locally by setting the msidbFeatureAttributesFavorLocal attribute. + /// + local, + + /// + /// Favors running this feature from source by setting the msidbFeatureAttributesFavorSource attribute. + /// + source, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypicalDefaultType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Sets the feature to be advertised by setting the msidbFeatureAttributesFavorAdvertise attribute. + /// This value cannot be set if the value of the AllowAdvertise attribute is 'no' since that would ask the installer to + /// disallow the advertised state for this feature while at the same time favoring it. + /// + advertise, + + /// + /// Sets the feature to the default non-advertised installation option. + /// + install, + } + } + + /// + /// Groups together multiple components, features, and merges to be used in other locations. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FeatureGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public FeatureGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the FeatureGroup. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("MergeRef" == childName)) + { + childValue = new MergeRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FeatureGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Create a reference to a FeatureGroup in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FeatureGroupRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType ignoreParentField; + + private bool ignoreParentFieldSet; + + private YesNoType primaryField; + + private bool primaryFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the FeatureGroup to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Normally feature group references that end up nested under a parent element create a + /// connection to that parent. This behavior is undesirable when trying to simply reference + /// to a FeatureGroup in a different Fragment. Specify 'yes' to have this feature group + /// reference not create a connection to its parent. The default is 'no'. + /// + public YesNoType IgnoreParent + { + get + { + return this.ignoreParentField; + } + set + { + this.ignoreParentFieldSet = true; + this.ignoreParentField = value; + } + } + + /// + /// Set this attribute to 'yes' in order to make the parent feature of this group + /// the primary feature for any components and merges contained in the group. + /// Features may belong to multiple features. By designating a feature as the + /// primary feature of a component or merge, you ensure that whenever a component is + /// selected for install-on-demand (IOD), the primary feature will be the one to install + /// it. This attribute should only be set if a component actually nests under multiple + /// features. If a component nests under only one feature, that feature is the primary + /// feature for the component. You cannot set more than one feature as the primary + /// feature of a given component. + /// + public YesNoType Primary + { + get + { + return this.primaryField; + } + set + { + this.primaryFieldSet = true; + this.primaryField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FeatureGroupRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.ignoreParentFieldSet) + { + if ((this.ignoreParentField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreParent", "no"); + } + if ((this.ignoreParentField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreParent", "yes"); + } + } + if (this.primaryFieldSet) + { + if ((this.primaryField == YesNoType.no)) + { + writer.WriteAttributeString("Primary", "no"); + } + if ((this.primaryField == YesNoType.yes)) + { + writer.WriteAttributeString("Primary", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IgnoreParent" == name)) + { + this.ignoreParentField = Enums.ParseYesNoType(value); + this.ignoreParentFieldSet = true; + } + if (("Primary" == name)) + { + this.primaryField = Enums.ParseYesNoType(value); + this.primaryFieldSet = true; + } + } + } + + /// + /// Create a reference to a Feature element in another Fragment. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FeatureRef : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType ignoreParentField; + + private bool ignoreParentFieldSet; + + private ISchemaElement parentElement; + + public FeatureRef() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Component))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComponentRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Feature))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FeatureGroupRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MergeRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The identifier of the Feature element to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Normally feature references that are nested under a parent element create a connection to that + /// parent. This behavior is undesirable when trying to simply reference a Feature in a different + /// Fragment. Specify 'yes' to have this feature reference not create a connection to its parent. + /// The default is 'no'. + /// + public YesNoType IgnoreParent + { + get + { + return this.ignoreParentField; + } + set + { + this.ignoreParentFieldSet = true; + this.ignoreParentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Component" == childName)) + { + childValue = new Component(); + } + if (("ComponentGroupRef" == childName)) + { + childValue = new ComponentGroupRef(); + } + if (("ComponentRef" == childName)) + { + childValue = new ComponentRef(); + } + if (("Feature" == childName)) + { + childValue = new Feature(); + } + if (("FeatureRef" == childName)) + { + childValue = new FeatureRef(); + } + if (("FeatureGroup" == childName)) + { + childValue = new FeatureGroup(); + } + if (("FeatureGroupRef" == childName)) + { + childValue = new FeatureGroupRef(); + } + if (("MergeRef" == childName)) + { + childValue = new MergeRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FeatureRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.ignoreParentFieldSet) + { + if ((this.ignoreParentField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreParent", "no"); + } + if ((this.ignoreParentField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreParent", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IgnoreParent" == name)) + { + this.ignoreParentField = Enums.ParseYesNoType(value); + this.ignoreParentFieldSet = true; + } + } + } + + /// + /// Media element describes a disk that makes up the source media for the installation. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Media : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string cabinetField; + + private bool cabinetFieldSet; + + private CompressionLevelType compressionLevelField; + + private bool compressionLevelFieldSet; + + private string diskPromptField; + + private bool diskPromptFieldSet; + + private YesNoType embedCabField; + + private bool embedCabFieldSet; + + private string layoutField; + + private bool layoutFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private string volumeLabelField; + + private bool volumeLabelFieldSet; + + private string sourceField; + + private bool sourceFieldSet; + + private ISchemaElement parentElement; + + public Media() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(DigitalSignature))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(PatchBaseline))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(SymbolPath))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Disk identifier for Media table. This number must be equal to or greater than 1. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The name of the cabinet if some or all of the files stored on the media are in a cabinet file. If no cabinets are used, this attribute must not be set. + /// + public string Cabinet + { + get + { + return this.cabinetField; + } + set + { + this.cabinetFieldSet = true; + this.cabinetField = value; + } + } + + /// + /// Indicates the compression level for the Media's cabinet. This attribute can + /// only be used in conjunction with the Cabinet attribute. The default is 'mszip'. + /// + public CompressionLevelType CompressionLevel + { + get + { + return this.compressionLevelField; + } + set + { + this.compressionLevelFieldSet = true; + this.compressionLevelField = value; + } + } + + /// + /// The disk name, which is usually the visible text printed on the disk. This localizable text is used to prompt the user when this disk needs to be inserted. This value will be used in the "[1]" of the DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. + /// + public string DiskPrompt + { + get + { + return this.diskPromptField; + } + set + { + this.diskPromptFieldSet = true; + this.diskPromptField = value; + } + } + + /// + /// Instructs the binder to embed the cabinet in the product if 'yes'. This attribute can only be specified in conjunction with the Cabinet attribute. + /// + public YesNoType EmbedCab + { + get + { + return this.embedCabField; + } + set + { + this.embedCabFieldSet = true; + this.embedCabField = value; + } + } + + /// + /// This attribute specifies the root directory for the uncompressed files that + /// are a part of this Media element. By default, the src will be the output + /// directory for the final image. The default value ensures the binder generates + /// an installable image. If a relative path is specified in the src attribute, + /// the value will be appended to the image's output directory. If an absolute + /// path is provided, that path will be used without modification. The latter two + /// options are provided to ease the layout of an image onto multiple medias (CDs/DVDs). + /// + public string Layout + { + get + { + return this.layoutField; + } + set + { + this.layoutFieldSet = true; + this.layoutField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// The label attributed to the volume. This is the volume label returned + /// by the GetVolumeInformation function. If the SourceDir property refers + /// to a removable (floppy or CD-ROM) volume, then this volume label is + /// used to verify that the proper disk is in the drive before attempting + /// to install files. The entry in this column must match the volume label + /// of the physical media. + /// + public string VolumeLabel + { + get + { + return this.volumeLabelField; + } + set + { + this.volumeLabelFieldSet = true; + this.volumeLabelField = value; + } + } + + /// + /// Optional property that identifies the source of the embedded cabinet. + /// If a cabinet is specified for a patch, this property should be defined + /// and unique to each patch so that the embedded cabinet containing patched + /// and new files can be located in the patch package. If the cabinet is not + /// embedded - this is not typical - the cabinet can be found in the directory + /// referenced in this column. If empty, the external cabinet must be located + /// in the SourceDir directory. + /// + public string Source + { + get + { + return this.sourceField; + } + set + { + this.sourceFieldSet = true; + this.sourceField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("DigitalSignature" == childName)) + { + childValue = new DigitalSignature(); + } + if (("PatchBaseline" == childName)) + { + childValue = new PatchBaseline(); + } + if (("SymbolPath" == childName)) + { + childValue = new SymbolPath(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Media", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.cabinetFieldSet) + { + writer.WriteAttributeString("Cabinet", this.cabinetField); + } + if (this.compressionLevelFieldSet) + { + if ((this.compressionLevelField == CompressionLevelType.high)) + { + writer.WriteAttributeString("CompressionLevel", "high"); + } + if ((this.compressionLevelField == CompressionLevelType.low)) + { + writer.WriteAttributeString("CompressionLevel", "low"); + } + if ((this.compressionLevelField == CompressionLevelType.medium)) + { + writer.WriteAttributeString("CompressionLevel", "medium"); + } + if ((this.compressionLevelField == CompressionLevelType.mszip)) + { + writer.WriteAttributeString("CompressionLevel", "mszip"); + } + if ((this.compressionLevelField == CompressionLevelType.none)) + { + writer.WriteAttributeString("CompressionLevel", "none"); + } + } + if (this.diskPromptFieldSet) + { + writer.WriteAttributeString("DiskPrompt", this.diskPromptField); + } + if (this.embedCabFieldSet) + { + if ((this.embedCabField == YesNoType.no)) + { + writer.WriteAttributeString("EmbedCab", "no"); + } + if ((this.embedCabField == YesNoType.yes)) + { + writer.WriteAttributeString("EmbedCab", "yes"); + } + } + if (this.layoutFieldSet) + { + writer.WriteAttributeString("Layout", this.layoutField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.volumeLabelFieldSet) + { + writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); + } + if (this.sourceFieldSet) + { + writer.WriteAttributeString("Source", this.sourceField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Cabinet" == name)) + { + this.cabinetField = value; + this.cabinetFieldSet = true; + } + if (("CompressionLevel" == name)) + { + this.compressionLevelField = Enums.ParseCompressionLevelType(value); + this.compressionLevelFieldSet = true; + } + if (("DiskPrompt" == name)) + { + this.diskPromptField = value; + this.diskPromptFieldSet = true; + } + if (("EmbedCab" == name)) + { + this.embedCabField = Enums.ParseYesNoType(value); + this.embedCabFieldSet = true; + } + if (("Layout" == name)) + { + this.layoutField = value; + this.layoutFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("VolumeLabel" == name)) + { + this.volumeLabelField = value; + this.volumeLabelFieldSet = true; + } + if (("Source" == name)) + { + this.sourceField = value; + this.sourceFieldSet = true; + } + } + } + + /// + /// MediaTeplate element describes information to automatically assign files to cabinets. + /// A maximumum number of cabinets created is 999. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MediaTemplate : ISchemaElement, ISetAttributes + { + + private string cabinetTemplateField; + + private bool cabinetTemplateFieldSet; + + private CompressionLevelType compressionLevelField; + + private bool compressionLevelFieldSet; + + private string diskPromptField; + + private bool diskPromptFieldSet; + + private YesNoType embedCabField; + + private bool embedCabFieldSet; + + private string volumeLabelField; + + private bool volumeLabelFieldSet; + + private int maximumUncompressedMediaSizeField; + + private bool maximumUncompressedMediaSizeFieldSet; + + private int maximumCabinetSizeForLargeFileSplittingField; + + private bool maximumCabinetSizeForLargeFileSplittingFieldSet; + + private ISchemaElement parentElement; + + /// + /// Templated name of the cabinet if some or all of the files stored on the media are in + /// a cabinet file. This name must begin with either a letter or an underscore, contain + /// maximum of five characters and {0} in the cabinet name part and must end three character extension. + /// The default is cab{0}.cab. + /// + public string CabinetTemplate + { + get + { + return this.cabinetTemplateField; + } + set + { + this.cabinetTemplateFieldSet = true; + this.cabinetTemplateField = value; + } + } + + /// + /// Indicates the compression level for the Media's cabinet. This attribute can + /// only be used in conjunction with the Cabinet attribute. The default is 'mszip'. + /// + public CompressionLevelType CompressionLevel + { + get + { + return this.compressionLevelField; + } + set + { + this.compressionLevelFieldSet = true; + this.compressionLevelField = value; + } + } + + /// + /// The disk name, which is usually the visible text printed on the disk. This localizable text is used + /// to prompt the user when this disk needs to be inserted. This value will be used in the "[1]" of the + /// DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. + /// + public string DiskPrompt + { + get + { + return this.diskPromptField; + } + set + { + this.diskPromptFieldSet = true; + this.diskPromptField = value; + } + } + + /// + /// Instructs the binder to embed the cabinets in the product if 'yes'. + /// + public YesNoType EmbedCab + { + get + { + return this.embedCabField; + } + set + { + this.embedCabFieldSet = true; + this.embedCabField = value; + } + } + + /// + /// The label attributed to the volume. This is the volume label returned + /// by the GetVolumeInformation function. If the SourceDir property refers + /// to a removable (floppy or CD-ROM) volume, then this volume label is + /// used to verify that the proper disk is in the drive before attempting + /// to install files. The entry in this column must match the volume label + /// of the physical media. + /// + public string VolumeLabel + { + get + { + return this.volumeLabelField; + } + set + { + this.volumeLabelFieldSet = true; + this.volumeLabelField = value; + } + } + + /// + /// Size of uncompressed files in each cabinet, in megabytes. WIX_MUMS environment variable + /// can be used to override this value. Default value is 200 MB. + /// + public int MaximumUncompressedMediaSize + { + get + { + return this.maximumUncompressedMediaSizeField; + } + set + { + this.maximumUncompressedMediaSizeFieldSet = true; + this.maximumUncompressedMediaSizeField = value; + } + } + + /// + /// Maximum size of cabinet files in megabytes for large files. This attribute is used for packaging + /// files that are larger than MaximumUncompressedMediaSize into smaller cabinets. If cabinet size + /// exceed this value, then setting this attribute will cause the file to be split into multiple + /// cabinets of this maximum size. For simply controlling cabinet size without file splitting use + /// MaximumUncompressedMediaSize attribute. Setting this attribute will disable smart cabbing feature + /// for this Fragment / Package. Setting WIX_MCSLFS environment variable can be used to override this + /// value. Minimum allowed value of this attribute is 20 MB. Maximum allowed value and the Default + /// value of this attribute is 2048 MB (2 GB). + /// + public int MaximumCabinetSizeForLargeFileSplitting + { + get + { + return this.maximumCabinetSizeForLargeFileSplittingField; + } + set + { + this.maximumCabinetSizeForLargeFileSplittingFieldSet = true; + this.maximumCabinetSizeForLargeFileSplittingField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a CompressionLevelType from a string. + /// + public static CompressionLevelType ParseCompressionLevelType(string value) + { + CompressionLevelType parsedValue; + MediaTemplate.TryParseCompressionLevelType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CompressionLevelType from a string. + /// + public static bool TryParseCompressionLevelType(string value, out CompressionLevelType parsedValue) + { + parsedValue = CompressionLevelType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("high" == value)) + { + parsedValue = CompressionLevelType.high; + } + else + { + if (("low" == value)) + { + parsedValue = CompressionLevelType.low; + } + else + { + if (("medium" == value)) + { + parsedValue = CompressionLevelType.medium; + } + else + { + if (("mszip" == value)) + { + parsedValue = CompressionLevelType.mszip; + } + else + { + if (("none" == value)) + { + parsedValue = CompressionLevelType.none; + } + else + { + parsedValue = CompressionLevelType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MediaTemplate", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.cabinetTemplateFieldSet) + { + writer.WriteAttributeString("CabinetTemplate", this.cabinetTemplateField); + } + if (this.compressionLevelFieldSet) + { + if ((this.compressionLevelField == CompressionLevelType.high)) + { + writer.WriteAttributeString("CompressionLevel", "high"); + } + if ((this.compressionLevelField == CompressionLevelType.low)) + { + writer.WriteAttributeString("CompressionLevel", "low"); + } + if ((this.compressionLevelField == CompressionLevelType.medium)) + { + writer.WriteAttributeString("CompressionLevel", "medium"); + } + if ((this.compressionLevelField == CompressionLevelType.mszip)) + { + writer.WriteAttributeString("CompressionLevel", "mszip"); + } + if ((this.compressionLevelField == CompressionLevelType.none)) + { + writer.WriteAttributeString("CompressionLevel", "none"); + } + } + if (this.diskPromptFieldSet) + { + writer.WriteAttributeString("DiskPrompt", this.diskPromptField); + } + if (this.embedCabFieldSet) + { + if ((this.embedCabField == YesNoType.no)) + { + writer.WriteAttributeString("EmbedCab", "no"); + } + if ((this.embedCabField == YesNoType.yes)) + { + writer.WriteAttributeString("EmbedCab", "yes"); + } + } + if (this.volumeLabelFieldSet) + { + writer.WriteAttributeString("VolumeLabel", this.volumeLabelField); + } + if (this.maximumUncompressedMediaSizeFieldSet) + { + writer.WriteAttributeString("MaximumUncompressedMediaSize", this.maximumUncompressedMediaSizeField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maximumCabinetSizeForLargeFileSplittingFieldSet) + { + writer.WriteAttributeString("MaximumCabinetSizeForLargeFileSplitting", this.maximumCabinetSizeForLargeFileSplittingField.ToString(CultureInfo.InvariantCulture)); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("CabinetTemplate" == name)) + { + this.cabinetTemplateField = value; + this.cabinetTemplateFieldSet = true; + } + if (("CompressionLevel" == name)) + { + this.compressionLevelField = MediaTemplate.ParseCompressionLevelType(value); + this.compressionLevelFieldSet = true; + } + if (("DiskPrompt" == name)) + { + this.diskPromptField = value; + this.diskPromptFieldSet = true; + } + if (("EmbedCab" == name)) + { + this.embedCabField = Enums.ParseYesNoType(value); + this.embedCabFieldSet = true; + } + if (("VolumeLabel" == name)) + { + this.volumeLabelField = value; + this.volumeLabelFieldSet = true; + } + if (("MaximumUncompressedMediaSize" == name)) + { + this.maximumUncompressedMediaSizeField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maximumUncompressedMediaSizeFieldSet = true; + } + if (("MaximumCabinetSizeForLargeFileSplitting" == name)) + { + this.maximumCabinetSizeForLargeFileSplittingField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maximumCabinetSizeForLargeFileSplittingFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum CompressionLevelType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + high, + + low, + + medium, + + mszip, + + none, + } + } + + /// + /// This element has been deprecated. + /// Use the Binary/@SuppressModularization, CustomAction/@SuppressModularization, or Property/@SuppressModularization attributes instead. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IgnoreModularization : ISchemaElement, ISetAttributes + { + + private string nameField; + + private bool nameFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the item to ignore modularization for. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// The type of the item to ignore modularization for. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + IgnoreModularization.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Action" == value)) + { + parsedValue = TypeType.Action; + } + else + { + if (("Property" == value)) + { + parsedValue = TypeType.Property; + } + else + { + if (("Directory" == value)) + { + parsedValue = TypeType.Directory; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IgnoreModularization", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.Action)) + { + writer.WriteAttributeString("Type", "Action"); + } + if ((this.typeField == TypeType.Property)) + { + writer.WriteAttributeString("Type", "Property"); + } + if ((this.typeField == TypeType.Directory)) + { + writer.WriteAttributeString("Type", "Directory"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = IgnoreModularization.ParseTypeType(value); + this.typeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Action, + + Property, + + Directory, + } + } + + /// + /// Specifies a custom action to be added to the MSI CustomAction table. Various combinations of the attributes for this element + /// correspond to different custom action types. For more information about custom actions see the + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomAction : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string binaryKeyField; + + private bool binaryKeyFieldSet; + + private string fileKeyField; + + private bool fileKeyFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string directoryField; + + private bool directoryFieldSet; + + private string dllEntryField; + + private bool dllEntryFieldSet; + + private string exeCommandField; + + private bool exeCommandFieldSet; + + private string jScriptCallField; + + private bool jScriptCallFieldSet; + + private string vBScriptCallField; + + private bool vBScriptCallFieldSet; + + private ScriptType scriptField; + + private bool scriptFieldSet; + + private YesNoType suppressModularizationField; + + private bool suppressModularizationFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string errorField; + + private bool errorFieldSet; + + private ReturnType returnField; + + private bool returnFieldSet; + + private ExecuteType executeField; + + private bool executeFieldSet; + + private YesNoType impersonateField; + + private bool impersonateFieldSet; + + private YesNoType patchUninstallField; + + private bool patchUninstallFieldSet; + + private YesNoType win64Field; + + private bool win64FieldSet; + + private YesNoType terminalServerAwareField; + + private bool terminalServerAwareFieldSet; + + private YesNoType hideTargetField; + + private bool hideTargetFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the custom action. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// This attribute is a reference to a Binary element with matching Id attribute. That binary stream contains + /// the custom action for use during install. The custom action will not be installed into a target directory. This attribute is + /// typically used with the DllEntry attribute to specify the custom action DLL to use for a type 1 custom action, with the ExeCommand + /// attribute to specify a type 17 custom action that runs an embedded executable, or with the VBScriptCall or JScriptCall attributes + /// to specify a type 5 or 6 custom action. + /// + public string BinaryKey + { + get + { + return this.binaryKeyField; + } + set + { + this.binaryKeyFieldSet = true; + this.binaryKeyField = value; + } + } + + /// + /// This attribute specifies a reference to a File element with matching Id attribute that + /// will execute the custom action code in the file after the file is installed. This + /// attribute is typically used with the ExeCommand attribute to specify a type 18 custom action + /// that runs an installed executable, with the DllEntry attribute to specify an installed custom + /// action DLL to use for a type 17 custom action, or with the VBScriptCall or JScriptCall + /// attributes to specify a type 21 or 22 custom action. + /// + public string FileKey + { + get + { + return this.fileKeyField; + } + set + { + this.fileKeyFieldSet = true; + this.fileKeyField = value; + } + } + + /// + /// This attribute specifies a reference to a Property element with matching Id attribute that specifies the Property + /// to be used or updated on execution of this custom action. This attribute is + /// typically used with the Value attribute to create a type 51 custom action that parses + /// the text in Value and places it into the specified Property. This attribute is also used with + /// the ExeCommand attribute to create a type 50 custom action that uses the value of the + /// given property to specify the path to the executable. Type 51 custom actions are often useful to + /// pass values to a deferred custom action. + /// See + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// This attribute specifies a reference to a Directory element with matching Id attribute containing a directory path. + /// This attribute is typically used with the ExeCommand attribute to specify the source executable for a type 34 + /// custom action, or with the Value attribute to specify a formatted string to place in the specified Directory + /// table entry in a type 35 custom action. + /// + public string Directory + { + get + { + return this.directoryField; + } + set + { + this.directoryFieldSet = true; + this.directoryField = value; + } + } + + /// + /// This attribute specifies the name of a function in a custom action to execute. + /// This attribute is used with the BinaryKey attribute to create a type 1 custom + /// action, or with the FileKey attribute to create a type 17 custom action. + /// + public string DllEntry + { + get + { + return this.dllEntryField; + } + set + { + this.dllEntryFieldSet = true; + this.dllEntryField = value; + } + } + + /// + /// This attribute specifies the command line parameters to supply to an externally + /// run executable. This attribute is typically used with the BinaryKey attribute for a type 2 custom action, + /// the FileKey attribute for a type 18 custom action, the Property attribute for a type 50 custom action, + /// or the Directory attribute for a type 34 custom action that specify the executable to run. + /// + public string ExeCommand + { + get + { + return this.exeCommandField; + } + set + { + this.exeCommandFieldSet = true; + this.exeCommandField = value; + } + } + + /// + /// This attribute specifies the name of the JScript function to execute in a script. The script must be + /// provided in a Binary element identified by the BinaryKey attribute described above. In other words, this + /// attribute must be specified in conjunction with the BinaryKey attribute. + /// + public string JScriptCall + { + get + { + return this.jScriptCallField; + } + set + { + this.jScriptCallFieldSet = true; + this.jScriptCallField = value; + } + } + + /// + /// This attribute specifies the name of the VBScript Subroutine to execute in a script. The script must be + /// provided in a Binary element identified by the BinaryKey attribute described above. In other words, this + /// attribute must be specified in conjunction with the BinaryKey attribute. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public string VBScriptCall + { + get + { + return this.vBScriptCallField; + } + set + { + this.vBScriptCallFieldSet = true; + this.vBScriptCallField = value; + } + } + + /// + /// Creates a type 37 or 38 custom action. The text of the element should contain the script to be embedded in the package. + /// + public ScriptType Script + { + get + { + return this.scriptField; + } + set + { + this.scriptFieldSet = true; + this.scriptField = value; + } + } + + /// + /// Use to suppress modularization of this custom action name in merge modules. + /// This should only be necessary for table-driven custom actions because the + /// table name which they interact with cannot be modularized, so there can only + /// be one instance of the table. + /// + public YesNoType SuppressModularization + { + get + { + return this.suppressModularizationField; + } + set + { + this.suppressModularizationFieldSet = true; + this.suppressModularizationField = value; + } + } + + /// + /// This attribute specifies a string value to use in the custom action. This attribute + /// must be used with the Property attribute to set the property as part of a + /// type 51 custom action or with the Directory attribute to set a directory path in that + /// table in a type 35 custom action. The value can be a literal value or derived from a + /// Property element using the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// This attribute specifies an index in the MSI Error table to use as an error message for a + /// type 19 custom action that displays the error message and aborts a product's installation. + /// + public string Error + { + get + { + return this.errorField; + } + set + { + this.errorFieldSet = true; + this.errorField = value; + } + } + + /// + /// Set this attribute to set the return behavior of the custom action. + /// + public ReturnType Return + { + get + { + return this.returnField; + } + set + { + this.returnFieldSet = true; + this.returnField = value; + } + } + + /// + /// This attribute indicates the scheduling of the custom action. + /// + public ExecuteType Execute + { + get + { + return this.executeField; + } + set + { + this.executeFieldSet = true; + this.executeField = value; + } + } + + /// + /// This attribute specifies whether the Windows Installer, which executes as LocalSystem, + /// should impersonate the user context of the installing user when executing this custom action. + /// Typically the value should be 'yes', except when the custom action needs elevated privileges + /// to apply changes to the machine. + /// + public YesNoType Impersonate + { + get + { + return this.impersonateField; + } + set + { + this.impersonateFieldSet = true; + this.impersonateField = value; + } + } + + /// + /// This attribute specifies that the Windows Installer, execute the custom action only when + /// a patch is being uninstalled. These custom actions should also be conditioned using the + /// MSIPATCHREMOVE property to ensure proper down level (less than Windows Installer 4.5) + /// behavior. + /// + public YesNoType PatchUninstall + { + get + { + return this.patchUninstallField; + } + set + { + this.patchUninstallFieldSet = true; + this.patchUninstallField = value; + } + } + + /// + /// Specifies that a script custom action targets a 64-bit platform. Valid only when used with + /// the Script, VBScriptCall, and JScriptCall attributes. + /// The default value is based on the platform set by the -arch switch to candle.exe + /// or the InstallerPlatform property in a .wixproj MSBuild project: + /// For x86 and ARM, the default value is 'no'. + /// For x64 and IA64, the default value is 'yes'. + /// + public YesNoType Win64 + { + get + { + return this.win64Field; + } + set + { + this.win64FieldSet = true; + this.win64Field = value; + } + } + + /// + /// This attribute specifies controls whether the custom action will impersonate the + /// installing user during per-machine installs on Terminal Server machines. + /// Deferred execution custom actions that do not specify this attribute, or explicitly set it 'no', + /// will run with no user impersonation on Terminal Server machines during + /// per-machine installations. This attribute is only applicable when installing on the + /// Windows Server 2003 family. + /// + public YesNoType TerminalServerAware + { + get + { + return this.terminalServerAwareField; + } + set + { + this.terminalServerAwareFieldSet = true; + this.terminalServerAwareField = value; + } + } + + /// + /// Ensures the installer does not log the CustomActionData for the deferred custom action. + /// + public YesNoType HideTarget + { + get + { + return this.hideTargetField; + } + set + { + this.hideTargetFieldSet = true; + this.hideTargetField = value; + } + } + + /// + /// The text node is only valid if the Script attribute is specified. In that case, the text node contains the script to embed. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ScriptType from a string. + /// + public static ScriptType ParseScriptType(string value) + { + ScriptType parsedValue; + CustomAction.TryParseScriptType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ScriptType from a string. + /// + public static bool TryParseScriptType(string value, out ScriptType parsedValue) + { + parsedValue = ScriptType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("jscript" == value)) + { + parsedValue = ScriptType.jscript; + } + else + { + if (("vbscript" == value)) + { + parsedValue = ScriptType.vbscript; + } + else + { + parsedValue = ScriptType.IllegalValue; + return false; + } + } + return true; + } + + /// + /// Parses a ReturnType from a string. + /// + public static ReturnType ParseReturnType(string value) + { + ReturnType parsedValue; + CustomAction.TryParseReturnType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ReturnType from a string. + /// + public static bool TryParseReturnType(string value, out ReturnType parsedValue) + { + parsedValue = ReturnType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("asyncNoWait" == value)) + { + parsedValue = ReturnType.asyncNoWait; + } + else + { + if (("asyncWait" == value)) + { + parsedValue = ReturnType.asyncWait; + } + else + { + if (("check" == value)) + { + parsedValue = ReturnType.check; + } + else + { + if (("ignore" == value)) + { + parsedValue = ReturnType.ignore; + } + else + { + parsedValue = ReturnType.IllegalValue; + return false; + } + } + } + } + return true; + } + + /// + /// Parses a ExecuteType from a string. + /// + public static ExecuteType ParseExecuteType(string value) + { + ExecuteType parsedValue; + CustomAction.TryParseExecuteType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ExecuteType from a string. + /// + public static bool TryParseExecuteType(string value, out ExecuteType parsedValue) + { + parsedValue = ExecuteType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("commit" == value)) + { + parsedValue = ExecuteType.commit; + } + else + { + if (("deferred" == value)) + { + parsedValue = ExecuteType.deferred; + } + else + { + if (("firstSequence" == value)) + { + parsedValue = ExecuteType.firstSequence; + } + else + { + if (("immediate" == value)) + { + parsedValue = ExecuteType.immediate; + } + else + { + if (("oncePerProcess" == value)) + { + parsedValue = ExecuteType.oncePerProcess; + } + else + { + if (("rollback" == value)) + { + parsedValue = ExecuteType.rollback; + } + else + { + if (("secondSequence" == value)) + { + parsedValue = ExecuteType.secondSequence; + } + else + { + parsedValue = ExecuteType.IllegalValue; + return false; + } + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomAction", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.binaryKeyFieldSet) + { + writer.WriteAttributeString("BinaryKey", this.binaryKeyField); + } + if (this.fileKeyFieldSet) + { + writer.WriteAttributeString("FileKey", this.fileKeyField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.directoryFieldSet) + { + writer.WriteAttributeString("Directory", this.directoryField); + } + if (this.dllEntryFieldSet) + { + writer.WriteAttributeString("DllEntry", this.dllEntryField); + } + if (this.exeCommandFieldSet) + { + writer.WriteAttributeString("ExeCommand", this.exeCommandField); + } + if (this.jScriptCallFieldSet) + { + writer.WriteAttributeString("JScriptCall", this.jScriptCallField); + } + if (this.vBScriptCallFieldSet) + { + writer.WriteAttributeString("VBScriptCall", this.vBScriptCallField); + } + if (this.scriptFieldSet) + { + if ((this.scriptField == ScriptType.jscript)) + { + writer.WriteAttributeString("Script", "jscript"); + } + if ((this.scriptField == ScriptType.vbscript)) + { + writer.WriteAttributeString("Script", "vbscript"); + } + } + if (this.suppressModularizationFieldSet) + { + if ((this.suppressModularizationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressModularization", "no"); + } + if ((this.suppressModularizationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressModularization", "yes"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.errorFieldSet) + { + writer.WriteAttributeString("Error", this.errorField); + } + if (this.returnFieldSet) + { + if ((this.returnField == ReturnType.asyncNoWait)) + { + writer.WriteAttributeString("Return", "asyncNoWait"); + } + if ((this.returnField == ReturnType.asyncWait)) + { + writer.WriteAttributeString("Return", "asyncWait"); + } + if ((this.returnField == ReturnType.check)) + { + writer.WriteAttributeString("Return", "check"); + } + if ((this.returnField == ReturnType.ignore)) + { + writer.WriteAttributeString("Return", "ignore"); + } + } + if (this.executeFieldSet) + { + if ((this.executeField == ExecuteType.commit)) + { + writer.WriteAttributeString("Execute", "commit"); + } + if ((this.executeField == ExecuteType.deferred)) + { + writer.WriteAttributeString("Execute", "deferred"); + } + if ((this.executeField == ExecuteType.firstSequence)) + { + writer.WriteAttributeString("Execute", "firstSequence"); + } + if ((this.executeField == ExecuteType.immediate)) + { + writer.WriteAttributeString("Execute", "immediate"); + } + if ((this.executeField == ExecuteType.oncePerProcess)) + { + writer.WriteAttributeString("Execute", "oncePerProcess"); + } + if ((this.executeField == ExecuteType.rollback)) + { + writer.WriteAttributeString("Execute", "rollback"); + } + if ((this.executeField == ExecuteType.secondSequence)) + { + writer.WriteAttributeString("Execute", "secondSequence"); + } + } + if (this.impersonateFieldSet) + { + if ((this.impersonateField == YesNoType.no)) + { + writer.WriteAttributeString("Impersonate", "no"); + } + if ((this.impersonateField == YesNoType.yes)) + { + writer.WriteAttributeString("Impersonate", "yes"); + } + } + if (this.patchUninstallFieldSet) + { + if ((this.patchUninstallField == YesNoType.no)) + { + writer.WriteAttributeString("PatchUninstall", "no"); + } + if ((this.patchUninstallField == YesNoType.yes)) + { + writer.WriteAttributeString("PatchUninstall", "yes"); + } + } + if (this.win64FieldSet) + { + if ((this.win64Field == YesNoType.no)) + { + writer.WriteAttributeString("Win64", "no"); + } + if ((this.win64Field == YesNoType.yes)) + { + writer.WriteAttributeString("Win64", "yes"); + } + } + if (this.terminalServerAwareFieldSet) + { + if ((this.terminalServerAwareField == YesNoType.no)) + { + writer.WriteAttributeString("TerminalServerAware", "no"); + } + if ((this.terminalServerAwareField == YesNoType.yes)) + { + writer.WriteAttributeString("TerminalServerAware", "yes"); + } + } + if (this.hideTargetFieldSet) + { + if ((this.hideTargetField == YesNoType.no)) + { + writer.WriteAttributeString("HideTarget", "no"); + } + if ((this.hideTargetField == YesNoType.yes)) + { + writer.WriteAttributeString("HideTarget", "yes"); + } + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("BinaryKey" == name)) + { + this.binaryKeyField = value; + this.binaryKeyFieldSet = true; + } + if (("FileKey" == name)) + { + this.fileKeyField = value; + this.fileKeyFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Directory" == name)) + { + this.directoryField = value; + this.directoryFieldSet = true; + } + if (("DllEntry" == name)) + { + this.dllEntryField = value; + this.dllEntryFieldSet = true; + } + if (("ExeCommand" == name)) + { + this.exeCommandField = value; + this.exeCommandFieldSet = true; + } + if (("JScriptCall" == name)) + { + this.jScriptCallField = value; + this.jScriptCallFieldSet = true; + } + if (("VBScriptCall" == name)) + { + this.vBScriptCallField = value; + this.vBScriptCallFieldSet = true; + } + if (("Script" == name)) + { + this.scriptField = CustomAction.ParseScriptType(value); + this.scriptFieldSet = true; + } + if (("SuppressModularization" == name)) + { + this.suppressModularizationField = Enums.ParseYesNoType(value); + this.suppressModularizationFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Error" == name)) + { + this.errorField = value; + this.errorFieldSet = true; + } + if (("Return" == name)) + { + this.returnField = CustomAction.ParseReturnType(value); + this.returnFieldSet = true; + } + if (("Execute" == name)) + { + this.executeField = CustomAction.ParseExecuteType(value); + this.executeFieldSet = true; + } + if (("Impersonate" == name)) + { + this.impersonateField = Enums.ParseYesNoType(value); + this.impersonateFieldSet = true; + } + if (("PatchUninstall" == name)) + { + this.patchUninstallField = Enums.ParseYesNoType(value); + this.patchUninstallFieldSet = true; + } + if (("Win64" == name)) + { + this.win64Field = Enums.ParseYesNoType(value); + this.win64FieldSet = true; + } + if (("TerminalServerAware" == name)) + { + this.terminalServerAwareField = Enums.ParseYesNoType(value); + this.terminalServerAwareFieldSet = true; + } + if (("HideTarget" == name)) + { + this.hideTargetField = Enums.ParseYesNoType(value); + this.hideTargetFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ScriptType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + jscript, + + vbscript, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ReturnType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Indicates that the custom action will run asyncronously and execution may continue after the installer terminates. + /// + asyncNoWait, + + /// + /// Indicates that the custom action will run asynchronously but the installer will wait for the return code at sequence end. + /// + asyncWait, + + /// + /// Indicates that the custom action will run synchronously and the return code will be checked for success. This is the default. + /// + check, + + /// + /// Indicates that the custom action will run synchronously and the return code will not be checked. + /// + ignore, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ExecuteType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Indicates that the custom action will run after successful completion of the installation script (at the end of the installation). + /// + commit, + + /// + /// Indicates that the custom action runs in-script (possibly with elevated privileges). + /// + deferred, + + /// + /// Indicates that the custom action will only run in the first sequence that runs it. + /// + firstSequence, + + /// + /// Indicates that the custom action will run during normal processing time with user privileges. This is the default. + /// + immediate, + + /// + /// Indicates that the custom action will only run in the first sequence that runs it in the same process. + /// + oncePerProcess, + + /// + /// Indicates that a custom action will run in the rollback sequence when a failure + /// occurs during installation, usually to undo changes made by a deferred custom action. + /// + rollback, + + /// + /// Indicates that a custom action should be run a second time if it was previously run in an earlier sequence. + /// + secondSequence, + } + } + + /// + /// This will cause the entire contents of the Fragment containing the referenced CustomAction to be + /// included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomActionRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the CustomAction to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomActionRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Sets a Directory to a particular value. This is accomplished by creating a Type 51 custom action that is appropriately scheduled in + /// the InstallUISequence and InstallExecuteSequence. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SetDirectory : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string idField; + + private bool idFieldSet; + + private SequenceType sequenceField; + + private bool sequenceFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// By default the action is "Set" + Id attribute's value. This optional attribute can override the action name in the case + /// where multiple SetDirectory elements target the same Id (probably with mutually exclusive conditions). + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// This attribute specifies a reference to a Directory element with matching Id attribute. The path of the Directory will be set to + /// the Value attribute. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Controls which sequences the Directory assignment is sequenced in. + /// For 'execute', the assignment is scheduled in the InstallExecuteSequence. + /// For 'ui', the assignment is scheduled in the InstallUISequence. + /// For 'first', the assignment is scheduled in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped at install time. + /// For 'both', the assignment is scheduled in both the InstallUISequence and the InstallExecuteSequence. + /// The default is 'both'. + /// + public SequenceType Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// This attribute specifies a string value to assign to the Directory. The value can be a literal value or derived from a + /// Property element using the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The condition that determines whether the Directory is set. If the condition evaluates to false, the SetDirectory is skipped. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SetDirectory", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sequenceFieldSet) + { + if ((this.sequenceField == SequenceType.both)) + { + writer.WriteAttributeString("Sequence", "both"); + } + if ((this.sequenceField == SequenceType.first)) + { + writer.WriteAttributeString("Sequence", "first"); + } + if ((this.sequenceField == SequenceType.execute)) + { + writer.WriteAttributeString("Sequence", "execute"); + } + if ((this.sequenceField == SequenceType.ui)) + { + writer.WriteAttributeString("Sequence", "ui"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Enums.ParseSequenceType(value); + this.sequenceFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Sets a Property to a particular value. This is accomplished by creating a Type 51 custom action that is appropriately scheduled in + /// the InstallUISequence and InstallExecuteSequence. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SetProperty : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private string idField; + + private bool idFieldSet; + + private SequenceType sequenceField; + + private bool sequenceFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// By default the action is "Set" + Id attribute's value. This optional attribute can override the action name in the case + /// where multiple SetProperty elements target the same Id (probably with mutually exclusive conditions). + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// The name of the standard or custom action after which this action should be performed. Mutually exclusive with the Before attribute. A Before or After attribute is required when setting a Property. + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// The name of the standard or custom action before which this action should be performed. Mutually exclusive with the After attribute. A Before or After attribute is required when setting a Property. + /// + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + /// + /// This attribute specifies the Property to set to the Value. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Controls which sequences the Property assignment is sequenced in. + /// For 'execute', the assignment is scheduled in the InstallExecuteSequence. + /// For 'ui', the assignment is scheduled in the InstallUISequence. + /// For 'first', the assignment is scheduled in the InstallUISequence or the InstallExecuteSequence if the InstallUISequence is skipped at install time. + /// For 'both', the assignment is scheduled in both the InstallUISequence and the InstallExecuteSequence. + /// The default is 'both'. + /// + public SequenceType Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// This attribute specifies a string value to assign to the Property. The value can be a literal value or derived from a + /// Property element using the + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The condition that determines whether the Property is set. If the condition evaluates to false, the Set is skipped. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SetProperty", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sequenceFieldSet) + { + if ((this.sequenceField == SequenceType.both)) + { + writer.WriteAttributeString("Sequence", "both"); + } + if ((this.sequenceField == SequenceType.first)) + { + writer.WriteAttributeString("Sequence", "first"); + } + if ((this.sequenceField == SequenceType.execute)) + { + writer.WriteAttributeString("Sequence", "execute"); + } + if ((this.sequenceField == SequenceType.ui)) + { + writer.WriteAttributeString("Sequence", "ui"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Enums.ParseSequenceType(value); + this.sequenceFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// This will cause the entire contents of the Fragment containing the referenced PatchFamily to be + /// used in the process of creating a patch. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFamilyRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the PatchFamily to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Specifies the ProductCode of the product that this family applies to. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFamilyRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + } + } + + /// + /// Sets the ProductID property to the full product identifier. This action must be sequenced before the user interface wizard in the InstallUISequence table and before the RegisterUser action in the InstallExecuteSequence table. If the product identifier has already been validated successfully, the ValidateProductID action does nothing. The ValidateProductID action always returns a success, whether or not the product identifier is valid, so that the product identifier can be entered on the command line the first time the product is run. The product identifier can be validated without having the user reenter this information by setting the PIDKEY property on the command line or by using a transform. The display of the dialog box requesting the user to enter the product identifier can then be made conditional upon the presence of the ProductID property, which is set when the PIDKEY property is validated. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ValidateProductID : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ValidateProductID", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Initiates the internal installation costing process. Any standard or custom actions that affect costing should be sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action. Then call the CostFinalize action following the CostInitialize action to make all final cost calculations available to the installer through the Component table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CostInitialize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CostInitialize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Initiates dynamic costing of standard installation actions. Any standard or custom actions that affect costing should sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action. Then call the CostFinalize action following the FileCost action to make all final cost calculations available to the installer through the Component table. The CostInitialize action must be executed before the FileCost action. The installer then determines the disk-space cost of every file in the File table, on a per-component basis, taking both volume clustering and the presence of existing files that may need to be overwritten into account. All actions that consume or release disk space are also considered. If an existing file is found, a file version check is performed to determine whether the new file actually needs to be installed or not. If the existing file is of an equal or greater version number, the existing file is not overwritten and no disk-space cost is incurred. In all cases, the installer uses the results of version number checking to set the installation state of each file. The FileCost action initializes cost calculation with the installer. Actual dynamic costing does not occur until the CostFinalize action is executed. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FileCost : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FileCost", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Installs a copy of a component (commonly a shared DLL) into a private location for use by a specific application (typically an .exe). This isolates the application from other copies of the component that may be installed to a shared location on the computer. The action refers to each record of the IsolatedComponent table and associates the files of the component listed in the Component_Shared field with the component listed in the Component_Application field. The installer installs the files of Component_Shared into the same directory as Component_Application. The installer generates a file in this directory, zero bytes in length, having the short filename name of the key file for Component_Application (typically this is the same file name as the .exe) appended with .local. The IsolatedComponent action does not affect the installation of Component_Application. Uninstalling Component_Application also removes the Component_Shared files and the .local file from the directory. The IsolateComponents action can be used only in the InstallUISequence table and the InstallExecuteSequence table. This action must come after the CostInitialize action and before the CostFinalize action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class IsolateComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("IsolateComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Ends the internal installation costing process begun by the CostInitialize action. Any standard or custom actions that affect costing should be sequenced before the CostInitialize action. Call the FileCost action immediately following the CostInitialize action and then call the CostFinalize action to make all final cost calculations available to the installer through the Component table. The CostFinalize action must be executed before starting any user interface sequence which allows the user to view or modify Feature table selections or directories. The CostFinalize action queries the Condition table to determine which features are scheduled to be installed. Costing is done for each component in the Component table. The CostFinalize action also verifies that all the target directories are writable before allowing the installation to continue. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CostFinalize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CostFinalize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Checks for existing ODBC drivers and sets the target directory for each new driver to the location of an existing driver. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SetODBCFolders : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SetODBCFolders", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Used for upgrading or installing over an existing application. Reads feature states from existing application and sets these feature states for the pending installation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MigrateFeatureStates : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MigrateFeatureStates", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Initiates the execution sequence. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ExecuteAction : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ExecuteAction", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Verifies that all costed volumes have enough space for the installation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallValidate : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallValidate", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Marks the beginning of a sequence of actions that change the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallInitialize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallInitialize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Ensures the needed amount of space exists in the registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AllocateRegistrySpace : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AllocateRegistrySpace", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers and unregisters components, their key paths, and the component clients. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProcessComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProcessComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the unadvertisement of components listed in the PublishComponent table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnpublishComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnpublishComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the unadvertisement of CLR and Win32 assemblies that are being removed. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiUnpublishAssemblies : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiUnpublishAssemblies", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes selection-state and feature-component mapping information from the registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnpublishFeatures : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnpublishFeatures", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Stops system services. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class StopServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("StopServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Stops a service and removes its registration from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DeleteServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DeleteServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes COM+ applications from the registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterComPlus : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterComPlus", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Unregisters all modules listed in the SelfReg table that are scheduled to be uninstalled. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SelfUnregModules : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SelfUnregModules", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Unregisters type libraries from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterTypeLibraries : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterTypeLibraries", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes the data sources, translators, and drivers listed for removal during the installation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveODBC : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveODBC", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes registration information about installed fonts from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterFonts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterFonts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes a registry value that has been authored into the registry table if the associated component was installed locally or as run from source, and is now set to be uninstalled. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveRegistryValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveRegistryValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the removal of COM class information from the system registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterClassInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterClassInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the removal of extension-related information from the system registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterExtensionInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterExtensionInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the unregistration of OLE ProgId information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterProgIdInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterProgIdInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Unregisters MIME-related registry information from the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UnregisterMIMEInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UnregisterMIMEInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes .ini file information specified for removal in the RemoveIniFile table if the component is set to be installed locally or run from source. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveIniValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveIniValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the removal of an advertised shortcut whose feature is selected for uninstallation or a nonadvertised shortcut whose component is selected for uninstallation. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveShortcuts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveShortcuts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Modifies the values of environment variables. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveEnvironmentStrings : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveEnvironmentStrings", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Deletes files installed by the DuplicateFiles action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveDuplicateFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveDuplicateFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes files previously installed by the InstallFiles action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Removes any folders linked to components set to be removed or run from source. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveFolders : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveFolders", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Creates empty folders for components that are set to be installed. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CreateFolders : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CreateFolders", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Locates existing files on the system and moves or copies those files to a new location. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MoveFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MoveFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Copies the product database to the administrative installation point. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallAdminPackage : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallAdminPackage", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Copies files specified in the File table from the source directory to the destination directory. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Duplicates files installed by the InstallFiles action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DuplicateFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DuplicateFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Queries the Patch table to determine which patches are to be applied. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PatchFiles : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PatchFiles", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Binds each executable or DLL that must be bound to the DLLs imported by it. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BindImage : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BindImage", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the creation of shortcuts. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CreateShortcuts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CreateShortcuts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the registration of COM class information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterClassInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterClassInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the registration of extension related information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterExtensionInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterExtensionInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the registration of OLE ProgId information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterProgIdInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterProgIdInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers MIME-related registry information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterMIMEInfo : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterMIMEInfo", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Sets up an application's registry information. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WriteRegistryValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WriteRegistryValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Writes the .ini file information that the application needs written to its .ini files. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WriteIniValues : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WriteIniValues", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Modifies the values of environment variables. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WriteEnvironmentStrings : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WriteEnvironmentStrings", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers installed fonts with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterFonts : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterFonts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Installs the drivers, translators, and data sources in the ODBCDriver table, ODBCTranslator table, and ODBCDataSource table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallODBC : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallODBC", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers type libraries with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterTypeLibraries : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterTypeLibraries", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Processes all modules listed in the SelfReg table and registers all installed modules with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class SelfRegModules : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("SelfRegModules", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers COM+ applications. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterComPlus : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterComPlus", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers a service for the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Starts system services. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class StartServices : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("StartServices", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers the user information with the installer to identify the user of a product. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterUser : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterUser", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Registers the product information with the installer. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RegisterProduct : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RegisterProduct", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the advertisement of the components from the PublishComponent table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PublishComponents : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PublishComponents", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the advertisement of CLR and Win32 assemblies. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MsiPublishAssemblies : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MsiPublishAssemblies", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Writes each feature's state into the system registry. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PublishFeatures : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PublishFeatures", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Manages the advertisement of the product information with the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class PublishProduct : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("PublishProduct", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Marks the end of a sequence of actions that change the system. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallFinalize : ActionSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallFinalize", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Uses file signatures to search for existing versions of products. The AppSearch action may use this information to determine where upgrades are to be installed. The AppSearch action can also be used to set a property to the existing value of an registry or .ini file entry. AppSearch should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents The AppSearch action from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The AppSearch action searches for file signatures using the CompLocator table first, the RegLocator table next, then the IniLocator table, and finally the DrLocator table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AppSearch : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AppSearch", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Uses file signatures to validate that qualifying products are installed on a system before an upgrade installation is performed. The CCPSearch action should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents the CCPSearch action from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The CCPSearch action must come before the RMCCPSearch action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CCPSearch : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CCPSearch", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Uses file signatures to validate that qualifying products are installed on a system before an upgrade installation is performed. The RMCCPSearch action should be authored into the InstallUISequence table and InstallExecuteSequence table. The installer prevents RMCCPSearch from running in the InstallExecuteSequence sequence if the action has already run in InstallUISequence sequence. The RMCCPSearch action requires the CCP_DRIVE property to be set to the root path on the removable volume that has the installation for any of the qualifying products. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RMCCPSearch : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RMCCPSearch", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Queries the LaunchCondition table and evaluates each conditional statement recorded there. If any of these conditional statements fail, an error message is displayed to the user and the installation is terminated. The LaunchConditions action is optional. This action is normally the first in the sequence, but the AppSearch Action may be sequenced before the LaunchConditions action. If there are launch conditions that do not apply to all installation modes, the appropriate installation mode property should be used in a conditional expression in the appropriate sequence table. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class LaunchConditions : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("LaunchConditions", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Runs through each record of the Upgrade table in sequence and compares the upgrade code, product version, and language in each row to products installed on the system. When FindRelatedProducts detects a correspondence between the upgrade information and an installed product, it appends the product code to the property specified in the ActionProperty column of the UpgradeTable. The FindRelatedProducts action only runs the first time the product is installed. The FindRelatedProducts action does not run during maintenance mode or uninstallation. FindRelatedProducts should be authored into the InstallUISequence table and InstallExecuteSequence tables. The installer prevents FindRelatedProducts from running in InstallExecuteSequence if the action has already run in InstallUISequence. The FindRelatedProducts action must come before the MigrateFeatureStates action and the RemoveExistingProducts action. The condition for this action may be specified in the element's inner text. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class FindRelatedProducts : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("FindRelatedProducts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Runs a script containing all operations spooled since either the start of the installation or the last InstallExecute action, or InstallExecuteAgain action. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallExecute : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallExecute", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Runs a script containing all operations spooled since either the start of the installation or the last InstallExecute action, or InstallExecuteAgain action. Should only be used after InstallExecute. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallExecuteAgain : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallExecuteAgain", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Disables rollback for the remainder of the installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DisableRollback : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DisableRollback", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Goes through the product codes listed in the ActionProperty column of the Upgrade table and removes the products in sequence. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RemoveExistingProducts : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RemoveExistingProducts", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Prompts the user to restart the system at the end of installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ScheduleReboot : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ScheduleReboot", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Prompts the user for a restart of the system during the installation. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ForceReboot : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ForceReboot", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Determines the location of the source and sets the SourceDir property if the source has not been resolved yet. Special actions don't have a built-in sequence number and thus must appear relative to another action. The suggested way to do this is by using the Before or After attribute. InstallExecute and InstallExecuteAgain can optionally appear anywhere between InstallInitialize and InstallFinalize. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ResolveSource : ActionModuleSequenceType, ISchemaElement + { + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public override void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ResolveSource", "http://wixtoolset.org/schemas/v4/wxs"); + base.OutputXml(writer); + writer.WriteEndElement(); + } + } + + /// + /// Use to sequence a custom action. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Custom : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private ExitType onExitField; + + private bool onExitFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The action to which the Custom element applies. + /// + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// Mutually exclusive with Before, After, and Sequence attributes + /// + public ExitType OnExit + { + get + { + return this.onExitField; + } + set + { + this.onExitFieldSet = true; + this.onExitField = value; + } + } + + /// + /// The name of the standard or custom action before which this action should be performed. Mutually exclusive with OnExit, After, and Sequence attributes + /// + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + /// + /// The name of the standard or custom action after which this action should be performed. Mutually exclusive with Before, OnExit, and Sequence attributes + /// + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// If "yes", the sequencing of this action may be overridden by sequencing elsewhere. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + /// + /// The sequence number for this action. Mutually exclusive with Before, After, and OnExit attributes + /// + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + /// + /// Text node specifies the condition of the action. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Custom", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.onExitFieldSet) + { + if ((this.onExitField == ExitType.success)) + { + writer.WriteAttributeString("OnExit", "success"); + } + if ((this.onExitField == ExitType.cancel)) + { + writer.WriteAttributeString("OnExit", "cancel"); + } + if ((this.onExitField == ExitType.error)) + { + writer.WriteAttributeString("OnExit", "error"); + } + if ((this.onExitField == ExitType.suspend)) + { + writer.WriteAttributeString("OnExit", "suspend"); + } + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("OnExit" == name)) + { + this.onExitField = Enums.ParseExitType(value); + this.onExitFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Show : ISchemaElement, ISetAttributes + { + + private string dialogField; + + private bool dialogFieldSet; + + private ExitType onExitField; + + private bool onExitFieldSet; + + private string beforeField; + + private bool beforeFieldSet; + + private string afterField; + + private bool afterFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private int sequenceField; + + private bool sequenceFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + public string Dialog + { + get + { + return this.dialogField; + } + set + { + this.dialogFieldSet = true; + this.dialogField = value; + } + } + + /// + /// mutually exclusive with Before, After, and Sequence attributes + /// + public ExitType OnExit + { + get + { + return this.onExitField; + } + set + { + this.onExitFieldSet = true; + this.onExitField = value; + } + } + + public string Before + { + get + { + return this.beforeField; + } + set + { + this.beforeFieldSet = true; + this.beforeField = value; + } + } + + public string After + { + get + { + return this.afterField; + } + set + { + this.afterFieldSet = true; + this.afterField = value; + } + } + + /// + /// If "yes", the sequencing of this dialog may be overridden by sequencing elsewhere. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + public int Sequence + { + get + { + return this.sequenceField; + } + set + { + this.sequenceFieldSet = true; + this.sequenceField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Show", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.dialogFieldSet) + { + writer.WriteAttributeString("Dialog", this.dialogField); + } + if (this.onExitFieldSet) + { + if ((this.onExitField == ExitType.success)) + { + writer.WriteAttributeString("OnExit", "success"); + } + if ((this.onExitField == ExitType.cancel)) + { + writer.WriteAttributeString("OnExit", "cancel"); + } + if ((this.onExitField == ExitType.error)) + { + writer.WriteAttributeString("OnExit", "error"); + } + if ((this.onExitField == ExitType.suspend)) + { + writer.WriteAttributeString("OnExit", "suspend"); + } + } + if (this.beforeFieldSet) + { + writer.WriteAttributeString("Before", this.beforeField); + } + if (this.afterFieldSet) + { + writer.WriteAttributeString("After", this.afterField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.sequenceFieldSet) + { + writer.WriteAttributeString("Sequence", this.sequenceField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Dialog" == name)) + { + this.dialogField = value; + this.dialogFieldSet = true; + } + if (("OnExit" == name)) + { + this.onExitField = Enums.ParseExitType(value); + this.onExitFieldSet = true; + } + if (("Before" == name)) + { + this.beforeField = value; + this.beforeFieldSet = true; + } + if (("After" == name)) + { + this.afterField = value; + this.afterFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Sequence" == name)) + { + this.sequenceField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.sequenceFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallUISequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public InstallUISequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Show))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ScheduleReboot))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FindRelatedProducts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RMCCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ValidateProductID))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MigrateFeatureStates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExecuteAction))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("Show" == childName)) + { + childValue = new Show(); + } + if (("ScheduleReboot" == childName)) + { + childValue = new ScheduleReboot(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if (("FindRelatedProducts" == childName)) + { + childValue = new FindRelatedProducts(); + } + if (("AppSearch" == childName)) + { + childValue = new AppSearch(); + } + if (("CCPSearch" == childName)) + { + childValue = new CCPSearch(); + } + if (("RMCCPSearch" == childName)) + { + childValue = new RMCCPSearch(); + } + if (("ValidateProductID" == childName)) + { + childValue = new ValidateProductID(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("IsolateComponents" == childName)) + { + childValue = new IsolateComponents(); + } + if (("ResolveSource" == childName)) + { + childValue = new ResolveSource(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("MigrateFeatureStates" == childName)) + { + childValue = new MigrateFeatureStates(); + } + if (("ExecuteAction" == childName)) + { + childValue = new ExecuteAction(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallUISequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstallExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public InstallExecuteSequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ScheduleReboot))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ForceReboot))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FindRelatedProducts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AppSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RMCCPSearch))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ValidateProductID))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(IsolateComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SetODBCFolders))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MigrateFeatureStates))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(AllocateRegistrySpace))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProcessComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnpublishComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnpublishFeatures))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(StopServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DeleteServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterComPlus))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SelfUnregModules))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterTypeLibraries))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveODBC))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterFonts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveRegistryValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterClassInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterExtensionInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterProgIdInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UnregisterMIMEInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveIniValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveShortcuts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveEnvironmentStrings))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveDuplicateFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveFolders))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateFolders))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MoveFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DuplicateFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BindImage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateShortcuts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterClassInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterExtensionInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProgIdInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterMIMEInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteRegistryValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteIniValues))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(WriteEnvironmentStrings))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterFonts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallODBC))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterTypeLibraries))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(SelfRegModules))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterComPlus))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(StartServices))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterUser))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProduct))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishFeatures))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishProduct))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RemoveExistingProducts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DisableRollback))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallExecute))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallExecuteAgain))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPublishAssemblies))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiUnpublishAssemblies))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("ScheduleReboot" == childName)) + { + childValue = new ScheduleReboot(); + } + if (("ForceReboot" == childName)) + { + childValue = new ForceReboot(); + } + if (("ResolveSource" == childName)) + { + childValue = new ResolveSource(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if (("FindRelatedProducts" == childName)) + { + childValue = new FindRelatedProducts(); + } + if (("AppSearch" == childName)) + { + childValue = new AppSearch(); + } + if (("CCPSearch" == childName)) + { + childValue = new CCPSearch(); + } + if (("RMCCPSearch" == childName)) + { + childValue = new RMCCPSearch(); + } + if (("ValidateProductID" == childName)) + { + childValue = new ValidateProductID(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("IsolateComponents" == childName)) + { + childValue = new IsolateComponents(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("SetODBCFolders" == childName)) + { + childValue = new SetODBCFolders(); + } + if (("MigrateFeatureStates" == childName)) + { + childValue = new MigrateFeatureStates(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("AllocateRegistrySpace" == childName)) + { + childValue = new AllocateRegistrySpace(); + } + if (("ProcessComponents" == childName)) + { + childValue = new ProcessComponents(); + } + if (("UnpublishComponents" == childName)) + { + childValue = new UnpublishComponents(); + } + if (("UnpublishFeatures" == childName)) + { + childValue = new UnpublishFeatures(); + } + if (("StopServices" == childName)) + { + childValue = new StopServices(); + } + if (("DeleteServices" == childName)) + { + childValue = new DeleteServices(); + } + if (("UnregisterComPlus" == childName)) + { + childValue = new UnregisterComPlus(); + } + if (("SelfUnregModules" == childName)) + { + childValue = new SelfUnregModules(); + } + if (("UnregisterTypeLibraries" == childName)) + { + childValue = new UnregisterTypeLibraries(); + } + if (("RemoveODBC" == childName)) + { + childValue = new RemoveODBC(); + } + if (("UnregisterFonts" == childName)) + { + childValue = new UnregisterFonts(); + } + if (("RemoveRegistryValues" == childName)) + { + childValue = new RemoveRegistryValues(); + } + if (("UnregisterClassInfo" == childName)) + { + childValue = new UnregisterClassInfo(); + } + if (("UnregisterExtensionInfo" == childName)) + { + childValue = new UnregisterExtensionInfo(); + } + if (("UnregisterProgIdInfo" == childName)) + { + childValue = new UnregisterProgIdInfo(); + } + if (("UnregisterMIMEInfo" == childName)) + { + childValue = new UnregisterMIMEInfo(); + } + if (("RemoveIniValues" == childName)) + { + childValue = new RemoveIniValues(); + } + if (("RemoveShortcuts" == childName)) + { + childValue = new RemoveShortcuts(); + } + if (("RemoveEnvironmentStrings" == childName)) + { + childValue = new RemoveEnvironmentStrings(); + } + if (("RemoveDuplicateFiles" == childName)) + { + childValue = new RemoveDuplicateFiles(); + } + if (("RemoveFiles" == childName)) + { + childValue = new RemoveFiles(); + } + if (("RemoveFolders" == childName)) + { + childValue = new RemoveFolders(); + } + if (("CreateFolders" == childName)) + { + childValue = new CreateFolders(); + } + if (("MoveFiles" == childName)) + { + childValue = new MoveFiles(); + } + if (("InstallFiles" == childName)) + { + childValue = new InstallFiles(); + } + if (("DuplicateFiles" == childName)) + { + childValue = new DuplicateFiles(); + } + if (("PatchFiles" == childName)) + { + childValue = new PatchFiles(); + } + if (("BindImage" == childName)) + { + childValue = new BindImage(); + } + if (("CreateShortcuts" == childName)) + { + childValue = new CreateShortcuts(); + } + if (("RegisterClassInfo" == childName)) + { + childValue = new RegisterClassInfo(); + } + if (("RegisterExtensionInfo" == childName)) + { + childValue = new RegisterExtensionInfo(); + } + if (("RegisterProgIdInfo" == childName)) + { + childValue = new RegisterProgIdInfo(); + } + if (("RegisterMIMEInfo" == childName)) + { + childValue = new RegisterMIMEInfo(); + } + if (("WriteRegistryValues" == childName)) + { + childValue = new WriteRegistryValues(); + } + if (("WriteIniValues" == childName)) + { + childValue = new WriteIniValues(); + } + if (("WriteEnvironmentStrings" == childName)) + { + childValue = new WriteEnvironmentStrings(); + } + if (("RegisterFonts" == childName)) + { + childValue = new RegisterFonts(); + } + if (("InstallODBC" == childName)) + { + childValue = new InstallODBC(); + } + if (("RegisterTypeLibraries" == childName)) + { + childValue = new RegisterTypeLibraries(); + } + if (("SelfRegModules" == childName)) + { + childValue = new SelfRegModules(); + } + if (("RegisterComPlus" == childName)) + { + childValue = new RegisterComPlus(); + } + if (("InstallServices" == childName)) + { + childValue = new InstallServices(); + } + if (("StartServices" == childName)) + { + childValue = new StartServices(); + } + if (("RegisterUser" == childName)) + { + childValue = new RegisterUser(); + } + if (("RegisterProduct" == childName)) + { + childValue = new RegisterProduct(); + } + if (("PublishComponents" == childName)) + { + childValue = new PublishComponents(); + } + if (("PublishFeatures" == childName)) + { + childValue = new PublishFeatures(); + } + if (("PublishProduct" == childName)) + { + childValue = new PublishProduct(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("RemoveExistingProducts" == childName)) + { + childValue = new RemoveExistingProducts(); + } + if (("DisableRollback" == childName)) + { + childValue = new DisableRollback(); + } + if (("InstallExecute" == childName)) + { + childValue = new InstallExecute(); + } + if (("InstallExecuteAgain" == childName)) + { + childValue = new InstallExecuteAgain(); + } + if (("MsiPublishAssemblies" == childName)) + { + childValue = new MsiPublishAssemblies(); + } + if (("MsiUnpublishAssemblies" == childName)) + { + childValue = new MsiUnpublishAssemblies(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstallExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AdminUISequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public AdminUISequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Show))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ExecuteAction))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallAdminPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("Show" == childName)) + { + childValue = new Show(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("ExecuteAction" == childName)) + { + childValue = new ExecuteAction(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("InstallAdminPackage" == childName)) + { + childValue = new InstallAdminPackage(); + } + if (("InstallFiles" == childName)) + { + childValue = new InstallFiles(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AdminUISequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AdminExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public AdminExecuteSequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(FileCost))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallAdminPackage))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PatchFiles))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(LaunchConditions))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ResolveSource))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("FileCost" == childName)) + { + childValue = new FileCost(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("InstallAdminPackage" == childName)) + { + childValue = new InstallAdminPackage(); + } + if (("InstallFiles" == childName)) + { + childValue = new InstallFiles(); + } + if (("PatchFiles" == childName)) + { + childValue = new PatchFiles(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("LaunchConditions" == childName)) + { + childValue = new LaunchConditions(); + } + if (("ResolveSource" == childName)) + { + childValue = new ResolveSource(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AdminExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class AdvertiseExecuteSequence : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public AdvertiseExecuteSequence() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CostFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Custom))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallValidate))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallInitialize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(CreateShortcuts))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterClassInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterExtensionInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterMIMEInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RegisterProgIdInfo))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishComponents))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishFeatures))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PublishProduct))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(InstallFinalize))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(MsiPublishAssemblies))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("CostInitialize" == childName)) + { + childValue = new CostInitialize(); + } + if (("CostFinalize" == childName)) + { + childValue = new CostFinalize(); + } + if (("Custom" == childName)) + { + childValue = new Custom(); + } + if (("InstallValidate" == childName)) + { + childValue = new InstallValidate(); + } + if (("InstallInitialize" == childName)) + { + childValue = new InstallInitialize(); + } + if (("CreateShortcuts" == childName)) + { + childValue = new CreateShortcuts(); + } + if (("RegisterClassInfo" == childName)) + { + childValue = new RegisterClassInfo(); + } + if (("RegisterExtensionInfo" == childName)) + { + childValue = new RegisterExtensionInfo(); + } + if (("RegisterMIMEInfo" == childName)) + { + childValue = new RegisterMIMEInfo(); + } + if (("RegisterProgIdInfo" == childName)) + { + childValue = new RegisterProgIdInfo(); + } + if (("PublishComponents" == childName)) + { + childValue = new PublishComponents(); + } + if (("PublishFeatures" == childName)) + { + childValue = new PublishFeatures(); + } + if (("PublishProduct" == childName)) + { + childValue = new PublishProduct(); + } + if (("InstallFinalize" == childName)) + { + childValue = new InstallFinalize(); + } + if (("MsiPublishAssemblies" == childName)) + { + childValue = new MsiPublishAssemblies(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("AdvertiseExecuteSequence", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Binary data used for CustomAction elements and UI controls. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Binary : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private YesNoType suppressModularizationField; + + private bool suppressModularizationFieldSet; + + private ISchemaElement parentElement; + + public Binary() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ISchemaElement))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The Id cannot be longer than 55 characters. In order to prevent errors in cases where the Id is modularized, it should not be longer than 18 characters. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path to the binary file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + /// + /// Use to suppress modularization of this Binary identifier in merge modules. + /// + public YesNoType SuppressModularization + { + get + { + return this.suppressModularizationField; + } + set + { + this.suppressModularizationFieldSet = true; + this.suppressModularizationField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Binary", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.suppressModularizationFieldSet) + { + if ((this.suppressModularizationField == YesNoType.no)) + { + writer.WriteAttributeString("SuppressModularization", "no"); + } + if ((this.suppressModularizationField == YesNoType.yes)) + { + writer.WriteAttributeString("SuppressModularization", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("SuppressModularization" == name)) + { + this.suppressModularizationField = Enums.ParseYesNoType(value); + this.suppressModularizationFieldSet = true; + } + } + } + + /// + /// Icon used for Shortcut, ProgId, or Class elements (but not UI controls) + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Icon : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private ISchemaElement parentElement; + + /// + /// The Id cannot be longer than 55 characters. In order to prevent errors in cases where the Id is modularized, it should not be longer than 18 characters. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Path to the icon file. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Icon", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedChainer : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string commandLineField; + + private bool commandLineFieldSet; + + private string binarySourceField; + + private bool binarySourceFieldSet; + + private string fileSourceField; + + private bool fileSourceFieldSet; + + private string propertySourceField; + + private bool propertySourceFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Unique identifier for embedded chainer. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Value to append to the transaction handle and passed to the chainer executable. + /// + public string CommandLine + { + get + { + return this.commandLineField; + } + set + { + this.commandLineFieldSet = true; + this.commandLineField = value; + } + } + + /// + /// Reference to the Binary element that contains the chainer executable. Mutually exclusive with + /// the FileSource and PropertySource attributes. + /// + public string BinarySource + { + get + { + return this.binarySourceField; + } + set + { + this.binarySourceFieldSet = true; + this.binarySourceField = value; + } + } + + /// + /// Reference to the File element that is the chainer executable. Mutually exclusive with + /// the BinarySource and PropertySource attributes. + /// + public string FileSource + { + get + { + return this.fileSourceField; + } + set + { + this.fileSourceFieldSet = true; + this.fileSourceField = value; + } + } + + /// + /// Reference to a Property that resolves to the full path to the chainer executable. Mutually exclusive with + /// the BinarySource and FileSource attributes. + /// + public string PropertySource + { + get + { + return this.propertySourceField; + } + set + { + this.propertySourceFieldSet = true; + this.propertySourceField = value; + } + } + + /// + /// Element value is the condition. CDATA may be used to when a condition contains many XML characters + /// that must be escaped. It is important to note that each EmbeddedChainer element must have a mutually exclusive condition + /// to ensure that only one embedded chainer will execute at a time. If the conditions are not mutually exclusive the chainer + /// that executes is undeterministic. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedChainer", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.commandLineFieldSet) + { + writer.WriteAttributeString("CommandLine", this.commandLineField); + } + if (this.binarySourceFieldSet) + { + writer.WriteAttributeString("BinarySource", this.binarySourceField); + } + if (this.fileSourceFieldSet) + { + writer.WriteAttributeString("FileSource", this.fileSourceField); + } + if (this.propertySourceFieldSet) + { + writer.WriteAttributeString("PropertySource", this.propertySourceField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("CommandLine" == name)) + { + this.commandLineField = value; + this.commandLineFieldSet = true; + } + if (("BinarySource" == name)) + { + this.binarySourceField = value; + this.binarySourceFieldSet = true; + } + if (("FileSource" == name)) + { + this.fileSourceField = value; + this.fileSourceFieldSet = true; + } + if (("PropertySource" == name)) + { + this.propertySourceField = value; + this.propertySourceFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Reference to an EmbeddedChainer element. This will force the entire referenced Fragment's contents + /// to be included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedChainerRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedChainerRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Element value is the condition. Use CDATA if message contains delimiter characters. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedUI : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType ignoreFatalExitField; + + private bool ignoreFatalExitFieldSet; + + private YesNoType ignoreErrorField; + + private bool ignoreErrorFieldSet; + + private YesNoType ignoreWarningField; + + private bool ignoreWarningFieldSet; + + private YesNoType ignoreUserField; + + private bool ignoreUserFieldSet; + + private YesNoType ignoreInfoField; + + private bool ignoreInfoFieldSet; + + private YesNoType ignoreFilesInUseField; + + private bool ignoreFilesInUseFieldSet; + + private YesNoType ignoreResolveSourceField; + + private bool ignoreResolveSourceFieldSet; + + private YesNoType ignoreOutOfDiskSpaceField; + + private bool ignoreOutOfDiskSpaceFieldSet; + + private YesNoType ignoreActionStartField; + + private bool ignoreActionStartFieldSet; + + private YesNoType ignoreActionDataField; + + private bool ignoreActionDataFieldSet; + + private YesNoType ignoreProgressField; + + private bool ignoreProgressFieldSet; + + private YesNoType ignoreCommonDataField; + + private bool ignoreCommonDataFieldSet; + + private YesNoType ignoreInitializeField; + + private bool ignoreInitializeFieldSet; + + private YesNoType ignoreTerminateField; + + private bool ignoreTerminateFieldSet; + + private YesNoType ignoreShowDialogField; + + private bool ignoreShowDialogFieldSet; + + private YesNoType ignoreRMFilesInUseField; + + private bool ignoreRMFilesInUseFieldSet; + + private YesNoType ignoreInstallStartField; + + private bool ignoreInstallStartFieldSet; + + private YesNoType ignoreInstallEndField; + + private bool ignoreInstallEndFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private YesNoType supportBasicUIField; + + private bool supportBasicUIFieldSet; + + private ISchemaElement parentElement; + + public EmbeddedUI() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(EmbeddedUIResource))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for embedded UI.If this attribute is not specified the Name attribute or the file name + /// portion of the SourceFile attribute will be used. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_FATALEXIT messages. + /// + public YesNoType IgnoreFatalExit + { + get + { + return this.ignoreFatalExitField; + } + set + { + this.ignoreFatalExitFieldSet = true; + this.ignoreFatalExitField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_ERROR messages. + /// + public YesNoType IgnoreError + { + get + { + return this.ignoreErrorField; + } + set + { + this.ignoreErrorFieldSet = true; + this.ignoreErrorField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_WARNING messages. + /// + public YesNoType IgnoreWarning + { + get + { + return this.ignoreWarningField; + } + set + { + this.ignoreWarningFieldSet = true; + this.ignoreWarningField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_USER messages. + /// + public YesNoType IgnoreUser + { + get + { + return this.ignoreUserField; + } + set + { + this.ignoreUserFieldSet = true; + this.ignoreUserField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INFO messages. + /// + public YesNoType IgnoreInfo + { + get + { + return this.ignoreInfoField; + } + set + { + this.ignoreInfoFieldSet = true; + this.ignoreInfoField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_FILESINUSE messages. + /// + public YesNoType IgnoreFilesInUse + { + get + { + return this.ignoreFilesInUseField; + } + set + { + this.ignoreFilesInUseFieldSet = true; + this.ignoreFilesInUseField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_RESOLVESOURCE messages. + /// + public YesNoType IgnoreResolveSource + { + get + { + return this.ignoreResolveSourceField; + } + set + { + this.ignoreResolveSourceFieldSet = true; + this.ignoreResolveSourceField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_OUTOFDISKSPACE messages. + /// + public YesNoType IgnoreOutOfDiskSpace + { + get + { + return this.ignoreOutOfDiskSpaceField; + } + set + { + this.ignoreOutOfDiskSpaceFieldSet = true; + this.ignoreOutOfDiskSpaceField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_ACTIONSTART messages. + /// + public YesNoType IgnoreActionStart + { + get + { + return this.ignoreActionStartField; + } + set + { + this.ignoreActionStartFieldSet = true; + this.ignoreActionStartField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_ACTIONDATA messages. + /// + public YesNoType IgnoreActionData + { + get + { + return this.ignoreActionDataField; + } + set + { + this.ignoreActionDataFieldSet = true; + this.ignoreActionDataField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_PROGRESS messages. + /// + public YesNoType IgnoreProgress + { + get + { + return this.ignoreProgressField; + } + set + { + this.ignoreProgressFieldSet = true; + this.ignoreProgressField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_COMMONDATA messages. + /// + public YesNoType IgnoreCommonData + { + get + { + return this.ignoreCommonDataField; + } + set + { + this.ignoreCommonDataFieldSet = true; + this.ignoreCommonDataField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INITIALIZE messages. + /// + public YesNoType IgnoreInitialize + { + get + { + return this.ignoreInitializeField; + } + set + { + this.ignoreInitializeFieldSet = true; + this.ignoreInitializeField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_TERMINATE messages. + /// + public YesNoType IgnoreTerminate + { + get + { + return this.ignoreTerminateField; + } + set + { + this.ignoreTerminateFieldSet = true; + this.ignoreTerminateField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_SHOWDIALOG messages. + /// + public YesNoType IgnoreShowDialog + { + get + { + return this.ignoreShowDialogField; + } + set + { + this.ignoreShowDialogFieldSet = true; + this.ignoreShowDialogField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_RMFILESINUSE messages. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType IgnoreRMFilesInUse + { + get + { + return this.ignoreRMFilesInUseField; + } + set + { + this.ignoreRMFilesInUseFieldSet = true; + this.ignoreRMFilesInUseField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INSTALLSTART messages. + /// + public YesNoType IgnoreInstallStart + { + get + { + return this.ignoreInstallStartField; + } + set + { + this.ignoreInstallStartFieldSet = true; + this.ignoreInstallStartField = value; + } + } + + /// + /// Embedded UI will not recieve any INSTALLLOGMODE_INSTALLEND messages. + /// + public YesNoType IgnoreInstallEnd + { + get + { + return this.ignoreInstallEndField; + } + set + { + this.ignoreInstallEndFieldSet = true; + this.ignoreInstallEndField = value; + } + } + + /// + /// The name for the embedded UI DLL when it is extracted from the package and executed. (Windows Installer + /// does not support the typical short filename and long filename combination for embedded UI files as it + /// does for other kinds of files.) If this attribute is not specified the file name portion of the SourceFile + /// attribute will be used. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Path to the binary file that is the embedded UI. This must be a DLL that exports the following + /// three entry points: InitializeEmbeddedUI, EmbeddedUIHandler and ShutdownEmbeddedUI. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + /// + /// Set yes to allow the Windows Installer to display the embedded UI during basic UI level installation. + /// + public YesNoType SupportBasicUI + { + get + { + return this.supportBasicUIField; + } + set + { + this.supportBasicUIFieldSet = true; + this.supportBasicUIField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("EmbeddedUIResource" == childName)) + { + childValue = new EmbeddedUIResource(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedUI", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.ignoreFatalExitFieldSet) + { + if ((this.ignoreFatalExitField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreFatalExit", "no"); + } + if ((this.ignoreFatalExitField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreFatalExit", "yes"); + } + } + if (this.ignoreErrorFieldSet) + { + if ((this.ignoreErrorField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreError", "no"); + } + if ((this.ignoreErrorField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreError", "yes"); + } + } + if (this.ignoreWarningFieldSet) + { + if ((this.ignoreWarningField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreWarning", "no"); + } + if ((this.ignoreWarningField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreWarning", "yes"); + } + } + if (this.ignoreUserFieldSet) + { + if ((this.ignoreUserField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreUser", "no"); + } + if ((this.ignoreUserField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreUser", "yes"); + } + } + if (this.ignoreInfoFieldSet) + { + if ((this.ignoreInfoField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInfo", "no"); + } + if ((this.ignoreInfoField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInfo", "yes"); + } + } + if (this.ignoreFilesInUseFieldSet) + { + if ((this.ignoreFilesInUseField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreFilesInUse", "no"); + } + if ((this.ignoreFilesInUseField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreFilesInUse", "yes"); + } + } + if (this.ignoreResolveSourceFieldSet) + { + if ((this.ignoreResolveSourceField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreResolveSource", "no"); + } + if ((this.ignoreResolveSourceField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreResolveSource", "yes"); + } + } + if (this.ignoreOutOfDiskSpaceFieldSet) + { + if ((this.ignoreOutOfDiskSpaceField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreOutOfDiskSpace", "no"); + } + if ((this.ignoreOutOfDiskSpaceField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreOutOfDiskSpace", "yes"); + } + } + if (this.ignoreActionStartFieldSet) + { + if ((this.ignoreActionStartField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreActionStart", "no"); + } + if ((this.ignoreActionStartField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreActionStart", "yes"); + } + } + if (this.ignoreActionDataFieldSet) + { + if ((this.ignoreActionDataField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreActionData", "no"); + } + if ((this.ignoreActionDataField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreActionData", "yes"); + } + } + if (this.ignoreProgressFieldSet) + { + if ((this.ignoreProgressField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreProgress", "no"); + } + if ((this.ignoreProgressField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreProgress", "yes"); + } + } + if (this.ignoreCommonDataFieldSet) + { + if ((this.ignoreCommonDataField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreCommonData", "no"); + } + if ((this.ignoreCommonDataField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreCommonData", "yes"); + } + } + if (this.ignoreInitializeFieldSet) + { + if ((this.ignoreInitializeField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInitialize", "no"); + } + if ((this.ignoreInitializeField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInitialize", "yes"); + } + } + if (this.ignoreTerminateFieldSet) + { + if ((this.ignoreTerminateField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreTerminate", "no"); + } + if ((this.ignoreTerminateField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreTerminate", "yes"); + } + } + if (this.ignoreShowDialogFieldSet) + { + if ((this.ignoreShowDialogField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreShowDialog", "no"); + } + if ((this.ignoreShowDialogField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreShowDialog", "yes"); + } + } + if (this.ignoreRMFilesInUseFieldSet) + { + if ((this.ignoreRMFilesInUseField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreRMFilesInUse", "no"); + } + if ((this.ignoreRMFilesInUseField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreRMFilesInUse", "yes"); + } + } + if (this.ignoreInstallStartFieldSet) + { + if ((this.ignoreInstallStartField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInstallStart", "no"); + } + if ((this.ignoreInstallStartField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInstallStart", "yes"); + } + } + if (this.ignoreInstallEndFieldSet) + { + if ((this.ignoreInstallEndField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreInstallEnd", "no"); + } + if ((this.ignoreInstallEndField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreInstallEnd", "yes"); + } + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.supportBasicUIFieldSet) + { + if ((this.supportBasicUIField == YesNoType.no)) + { + writer.WriteAttributeString("SupportBasicUI", "no"); + } + if ((this.supportBasicUIField == YesNoType.yes)) + { + writer.WriteAttributeString("SupportBasicUI", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("IgnoreFatalExit" == name)) + { + this.ignoreFatalExitField = Enums.ParseYesNoType(value); + this.ignoreFatalExitFieldSet = true; + } + if (("IgnoreError" == name)) + { + this.ignoreErrorField = Enums.ParseYesNoType(value); + this.ignoreErrorFieldSet = true; + } + if (("IgnoreWarning" == name)) + { + this.ignoreWarningField = Enums.ParseYesNoType(value); + this.ignoreWarningFieldSet = true; + } + if (("IgnoreUser" == name)) + { + this.ignoreUserField = Enums.ParseYesNoType(value); + this.ignoreUserFieldSet = true; + } + if (("IgnoreInfo" == name)) + { + this.ignoreInfoField = Enums.ParseYesNoType(value); + this.ignoreInfoFieldSet = true; + } + if (("IgnoreFilesInUse" == name)) + { + this.ignoreFilesInUseField = Enums.ParseYesNoType(value); + this.ignoreFilesInUseFieldSet = true; + } + if (("IgnoreResolveSource" == name)) + { + this.ignoreResolveSourceField = Enums.ParseYesNoType(value); + this.ignoreResolveSourceFieldSet = true; + } + if (("IgnoreOutOfDiskSpace" == name)) + { + this.ignoreOutOfDiskSpaceField = Enums.ParseYesNoType(value); + this.ignoreOutOfDiskSpaceFieldSet = true; + } + if (("IgnoreActionStart" == name)) + { + this.ignoreActionStartField = Enums.ParseYesNoType(value); + this.ignoreActionStartFieldSet = true; + } + if (("IgnoreActionData" == name)) + { + this.ignoreActionDataField = Enums.ParseYesNoType(value); + this.ignoreActionDataFieldSet = true; + } + if (("IgnoreProgress" == name)) + { + this.ignoreProgressField = Enums.ParseYesNoType(value); + this.ignoreProgressFieldSet = true; + } + if (("IgnoreCommonData" == name)) + { + this.ignoreCommonDataField = Enums.ParseYesNoType(value); + this.ignoreCommonDataFieldSet = true; + } + if (("IgnoreInitialize" == name)) + { + this.ignoreInitializeField = Enums.ParseYesNoType(value); + this.ignoreInitializeFieldSet = true; + } + if (("IgnoreTerminate" == name)) + { + this.ignoreTerminateField = Enums.ParseYesNoType(value); + this.ignoreTerminateFieldSet = true; + } + if (("IgnoreShowDialog" == name)) + { + this.ignoreShowDialogField = Enums.ParseYesNoType(value); + this.ignoreShowDialogFieldSet = true; + } + if (("IgnoreRMFilesInUse" == name)) + { + this.ignoreRMFilesInUseField = Enums.ParseYesNoType(value); + this.ignoreRMFilesInUseFieldSet = true; + } + if (("IgnoreInstallStart" == name)) + { + this.ignoreInstallStartField = Enums.ParseYesNoType(value); + this.ignoreInstallStartFieldSet = true; + } + if (("IgnoreInstallEnd" == name)) + { + this.ignoreInstallEndField = Enums.ParseYesNoType(value); + this.ignoreInstallEndFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("SupportBasicUI" == name)) + { + this.supportBasicUIField = Enums.ParseYesNoType(value); + this.supportBasicUIFieldSet = true; + } + } + } + + /// + /// Defines a resource for use by the embedded UI. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EmbeddedUIResource : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string nameField; + + private bool nameFieldSet; + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the embedded UI resource. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The name for the resource when it is extracted from the package for use by the embedded UI DLL. (Windows + /// Installer does not support the typical short filename and long filename combination for embedded UI files + /// as it does for other kinds of files.) If this attribute is not specified the Id attribute will be used. + /// + public string Name + { + get + { + return this.nameField; + } + set + { + this.nameFieldSet = true; + this.nameField = value; + } + } + + /// + /// Path to the binary file that is the embedded UI resource. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EmbeddedUIResource", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.nameFieldSet) + { + writer.WriteAttributeString("Name", this.nameField); + } + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Name" == name)) + { + this.nameField = value; + this.nameFieldSet = true; + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Error : ISchemaElement, ISetAttributes + { + + private int idField; + + private bool idFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Number of the error for which a message is being provided. See MSI SDK for error definitions. + /// + public int Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Element value is Message, use CDATA if message contains delimiter characters + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Error", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField.ToString(CultureInfo.InvariantCulture)); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.idFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Publish : ISchemaElement, ISetAttributes + { + + private string controlField; + + private bool controlFieldSet; + + private string dialogField; + + private bool dialogFieldSet; + + private string eventField; + + private bool eventFieldSet; + + private string orderField; + + private bool orderFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// The parent Control for this Publish element, should only be specified when this element is a child of the UI element. + /// + public string Control + { + get + { + return this.controlField; + } + set + { + this.controlFieldSet = true; + this.controlField = value; + } + } + + /// + /// The parent Dialog for this Publish element, should only be specified when this element is a child of the UI element. + /// This attribute will create a reference to the specified Dialog, so an additional DialogRef is not necessary. + /// + public string Dialog + { + get + { + return this.dialogField; + } + set + { + this.dialogFieldSet = true; + this.dialogField = value; + } + } + + /// + /// Set this attribute's value to one of the standard control events to trigger that event. + /// Either this attribute or the Property attribute must be set, but not both at the same time. + /// + public string Event + { + get + { + return this.eventField; + } + set + { + this.eventFieldSet = true; + this.eventField = value; + } + } + + /// + /// This attribute should only need to be set if this element is nested under a UI element in order to + /// control the order in which this publish event will be started. + /// If this element is nested under a Control element, the default value will be one greater than any + /// previous Publish element's order (the first element's default value is 1). + /// If this element is nested under a UI element, the default value is always 1 (it does not get a + /// default value based on any previous Publish elements). + /// + public string Order + { + get + { + return this.orderField; + } + set + { + this.orderFieldSet = true; + this.orderField = value; + } + } + + /// + /// Set this attribute's value to a property name to set that property. + /// Either this attribute or the Event attribute must be set, but not both at the same time. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// If the Property attribute is specified, set the value of this attribute to the new value for the property. + /// To set a property to null, do not set this attribute (the ControlEvent Argument column will be set to '{}'). + /// Otherwise, this attribute's value should be the argument for the event specified in the Event attribute. + /// If the event doesn't take an attribute, a common value to use is "0". + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The element value is the optional Condition expression. + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Publish", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.controlFieldSet) + { + writer.WriteAttributeString("Control", this.controlField); + } + if (this.dialogFieldSet) + { + writer.WriteAttributeString("Dialog", this.dialogField); + } + if (this.eventFieldSet) + { + writer.WriteAttributeString("Event", this.eventField); + } + if (this.orderFieldSet) + { + writer.WriteAttributeString("Order", this.orderField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Control" == name)) + { + this.controlField = value; + this.controlFieldSet = true; + } + if (("Dialog" == name)) + { + this.dialogField = value; + this.dialogFieldSet = true; + } + if (("Event" == name)) + { + this.eventField = value; + this.eventFieldSet = true; + } + if (("Order" == name)) + { + this.orderField = value; + this.orderFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Sets attributes for events in the EventMapping table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Subscribe : ISchemaElement, ISetAttributes + { + + private string eventField; + + private bool eventFieldSet; + + private string attributeField; + + private bool attributeFieldSet; + + private ISchemaElement parentElement; + + /// + /// must be one of the standard control events' + /// + public string Event + { + get + { + return this.eventField; + } + set + { + this.eventFieldSet = true; + this.eventField = value; + } + } + + /// + /// if not present can only handle enable, disable, hide, unhide events + /// + public string Attribute + { + get + { + return this.attributeField; + } + set + { + this.attributeFieldSet = true; + this.attributeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Subscribe", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.eventFieldSet) + { + writer.WriteAttributeString("Event", this.eventField); + } + if (this.attributeFieldSet) + { + writer.WriteAttributeString("Attribute", this.attributeField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Event" == name)) + { + this.eventField = value; + this.eventFieldSet = true; + } + if (("Attribute" == name)) + { + this.attributeField = value; + this.attributeFieldSet = true; + } + } + } + + /// + /// An alternative to using the Text attribute when the value contains special XML characters like <, >, or &. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Text : ISchemaElement, ISetAttributes + { + + private string sourceFileField; + + private bool sourceFileFieldSet; + + private string srcField; + + private bool srcFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Instructs the text to be imported from a file instead of the element value during the binding process. + /// + public string SourceFile + { + get + { + return this.sourceFileField; + } + set + { + this.sourceFileFieldSet = true; + this.sourceFileField = value; + } + } + + [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] + public string src + { + get + { + return this.srcField; + } + set + { + this.srcFieldSet = true; + this.srcField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Text", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.sourceFileFieldSet) + { + writer.WriteAttributeString("SourceFile", this.sourceFileField); + } + if (this.srcFieldSet) + { + writer.WriteAttributeString("src", this.srcField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("SourceFile" == name)) + { + this.sourceFileField = value; + this.sourceFileFieldSet = true; + } + if (("src" == name)) + { + this.srcField = value; + this.srcFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Contains the controls that appear on each dialog. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Control : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string typeField; + + private bool typeFieldSet; + + private string xField; + + private bool xFieldSet; + + private string yField; + + private bool yFieldSet; + + private string widthField; + + private bool widthFieldSet; + + private string heightField; + + private bool heightFieldSet; + + private string propertyField; + + private bool propertyFieldSet; + + private string textField; + + private bool textFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private string toolTipField; + + private bool toolTipFieldSet; + + private string checkBoxValueField; + + private bool checkBoxValueFieldSet; + + private string checkBoxPropertyRefField; + + private bool checkBoxPropertyRefFieldSet; + + private YesNoType tabSkipField; + + private bool tabSkipFieldSet; + + private YesNoType defaultField; + + private bool defaultFieldSet; + + private YesNoType cancelField; + + private bool cancelFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType disabledField; + + private bool disabledFieldSet; + + private YesNoType sunkenField; + + private bool sunkenFieldSet; + + private YesNoType indirectField; + + private bool indirectFieldSet; + + private YesNoType integerField; + + private bool integerFieldSet; + + private YesNoType rightToLeftField; + + private bool rightToLeftFieldSet; + + private YesNoType rightAlignedField; + + private bool rightAlignedFieldSet; + + private YesNoType leftScrollField; + + private bool leftScrollFieldSet; + + private YesNoType transparentField; + + private bool transparentFieldSet; + + private YesNoType noPrefixField; + + private bool noPrefixFieldSet; + + private YesNoType noWrapField; + + private bool noWrapFieldSet; + + private YesNoType formatSizeField; + + private bool formatSizeFieldSet; + + private YesNoType userLanguageField; + + private bool userLanguageFieldSet; + + private YesNoType multilineField; + + private bool multilineFieldSet; + + private YesNoType passwordField; + + private bool passwordFieldSet; + + private YesNoType progressBlocksField; + + private bool progressBlocksFieldSet; + + private YesNoType removableField; + + private bool removableFieldSet; + + private YesNoType fixedField; + + private bool fixedFieldSet; + + private YesNoType remoteField; + + private bool remoteFieldSet; + + private YesNoType cDROMField; + + private bool cDROMFieldSet; + + private YesNoType rAMDiskField; + + private bool rAMDiskFieldSet; + + private YesNoType floppyField; + + private bool floppyFieldSet; + + private YesNoType showRollbackCostField; + + private bool showRollbackCostFieldSet; + + private YesNoType sortedField; + + private bool sortedFieldSet; + + private YesNoType comboListField; + + private bool comboListFieldSet; + + private YesNoType imageField; + + private bool imageFieldSet; + + private IconSizeType iconSizeField; + + private bool iconSizeFieldSet; + + private YesNoType fixedSizeField; + + private bool fixedSizeFieldSet; + + private YesNoType iconField; + + private bool iconFieldSet; + + private YesNoType bitmapField; + + private bool bitmapFieldSet; + + private YesNoType pushLikeField; + + private bool pushLikeFieldSet; + + private YesNoType hasBorderField; + + private bool hasBorderFieldSet; + + private YesNoType elevationShieldField; + + private bool elevationShieldFieldSet; + + private ISchemaElement parentElement; + + public Control() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Text))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ComboBox))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListBox))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListView))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RadioButtonGroup))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Binary))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Condition))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Publish))); + childCollection1.AddItem(new ElementCollection.ChoiceItem(typeof(Subscribe))); + childCollection0.AddCollection(childCollection1); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Combined with the Dialog Id to make up the primary key of the Control table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The type of the control. Could be one of the following: Billboard, Bitmap, CheckBox, ComboBox, DirectoryCombo, DirectoryList, Edit, GroupBox, Hyperlink, Icon, Line, ListBox, ListView, MaskedEdit, PathEdit, ProgressBar, PushButton, RadioButtonGroup, ScrollableText, SelectionTree, Text, VolumeCostList, VolumeSelectCombo + /// + public string Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Horizontal coordinate of the upper-left corner of the rectangular boundary of the control. This must be a non-negative number. + /// + public string X + { + get + { + return this.xField; + } + set + { + this.xFieldSet = true; + this.xField = value; + } + } + + /// + /// Vertical coordinate of the upper-left corner of the rectangular boundary of the control. This must be a non-negative number. + /// + public string Y + { + get + { + return this.yField; + } + set + { + this.yFieldSet = true; + this.yField = value; + } + } + + /// + /// Width of the rectangular boundary of the control. This must be a non-negative number. + /// + public string Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + /// + /// Height of the rectangular boundary of the control. This must be a non-negative number. + /// + public string Height + { + get + { + return this.heightField; + } + set + { + this.heightFieldSet = true; + this.heightField = value; + } + } + + /// + /// The name of a defined property to be linked to this control. This column is required for active controls. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + /// + /// A localizable string used to set the initial text contained in a control. This attribute can contain a formatted string that is processed at install time to insert the values of properties using [PropertyName] syntax. Also supported are environment variables, file installation paths, and component installation directories; see + /// + public string Text + { + get + { + return this.textField; + } + set + { + this.textFieldSet = true; + this.textField = value; + } + } + + /// + /// This attribute is reserved for future use. There is no need to use this until Windows Installer uses it for something. + /// + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// The string used for the Tooltip. + /// + public string ToolTip + { + get + { + return this.toolTipField; + } + set + { + this.toolTipFieldSet = true; + this.toolTipField = value; + } + } + + /// + /// This attribute is only valid for CheckBox Controls. When set, the linked Property will be set to this value when the check box is checked. + /// + public string CheckBoxValue + { + get + { + return this.checkBoxValueField; + } + set + { + this.checkBoxValueFieldSet = true; + this.checkBoxValueField = value; + } + } + + /// + /// This attribute is only valid for CheckBox controls. The value is the name of a Property that was already used as the Property for another CheckBox control. The Property attribute cannot be specified. The attribute exists to support multiple checkboxes on different dialogs being tied to the same property. + /// + public string CheckBoxPropertyRef + { + get + { + return this.checkBoxPropertyRefField; + } + set + { + this.checkBoxPropertyRefFieldSet = true; + this.checkBoxPropertyRefField = value; + } + } + + /// + /// Set this attribute to "yes" to cause this Control to be skipped in the tab sequence. + /// + public YesNoType TabSkip + { + get + { + return this.tabSkipField; + } + set + { + this.tabSkipFieldSet = true; + this.tabSkipField = value; + } + } + + /// + /// Set this attribute to "yes" to cause this Control to be invoked by the return key. + /// + public YesNoType Default + { + get + { + return this.defaultField; + } + set + { + this.defaultFieldSet = true; + this.defaultField = value; + } + } + + /// + /// Set this attribute to "yes" to cause this Control to be invoked by the escape key. + /// + public YesNoType Cancel + { + get + { + return this.cancelField; + } + set + { + this.cancelFieldSet = true; + this.cancelField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be hidden. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be disabled. + /// + public YesNoType Disabled + { + get + { + return this.disabledField; + } + set + { + this.disabledFieldSet = true; + this.disabledField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be sunken. + /// + public YesNoType Sunken + { + get + { + return this.sunkenField; + } + set + { + this.sunkenFieldSet = true; + this.sunkenField = value; + } + } + + /// + /// Specifies whether the value displayed or changed by this control is referenced indirectly. If this bit is set, the control displays or changes the value of the property that has the identifier listed in the Property column of the Control table. + /// + public YesNoType Indirect + { + get + { + return this.indirectField; + } + set + { + this.indirectFieldSet = true; + this.indirectField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the linked Property value for the Control to be treated as an integer. Otherwise, the Property will be treated as a string. + /// + public YesNoType Integer + { + get + { + return this.integerField; + } + set + { + this.integerFieldSet = true; + this.integerField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to display from right to left. + /// + public YesNoType RightToLeft + { + get + { + return this.rightToLeftField; + } + set + { + this.rightToLeftFieldSet = true; + this.rightToLeftField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the Control to be right aligned. + /// + public YesNoType RightAligned + { + get + { + return this.rightAlignedField; + } + set + { + this.rightAlignedFieldSet = true; + this.rightAlignedField = value; + } + } + + /// + /// Set this attribute to "yes" to cause the scroll bar to display on the left side of the Control. + /// + public YesNoType LeftScroll + { + get + { + return this.leftScrollField; + } + set + { + this.leftScrollFieldSet = true; + this.leftScrollField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType Transparent + { + get + { + return this.transparentField; + } + set + { + this.transparentFieldSet = true; + this.transparentField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType NoPrefix + { + get + { + return this.noPrefixField; + } + set + { + this.noPrefixFieldSet = true; + this.noPrefixField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType NoWrap + { + get + { + return this.noWrapField; + } + set + { + this.noWrapFieldSet = true; + this.noWrapField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType FormatSize + { + get + { + return this.formatSizeField; + } + set + { + this.formatSizeFieldSet = true; + this.formatSizeField = value; + } + } + + /// + /// This attribute is only valid for Text Controls. + /// + public YesNoType UserLanguage + { + get + { + return this.userLanguageField; + } + set + { + this.userLanguageFieldSet = true; + this.userLanguageField = value; + } + } + + /// + /// This attribute is only valid for Edit Controls. + /// + public YesNoType Multiline + { + get + { + return this.multilineField; + } + set + { + this.multilineFieldSet = true; + this.multilineField = value; + } + } + + /// + /// This attribute is only valid for Edit Controls. + /// + public YesNoType Password + { + get + { + return this.passwordField; + } + set + { + this.passwordFieldSet = true; + this.passwordField = value; + } + } + + /// + /// This attribute is only valid for ProgressBar Controls. + /// + public YesNoType ProgressBlocks + { + get + { + return this.progressBlocksField; + } + set + { + this.progressBlocksFieldSet = true; + this.progressBlocksField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Removable + { + get + { + return this.removableField; + } + set + { + this.removableFieldSet = true; + this.removableField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Fixed + { + get + { + return this.fixedField; + } + set + { + this.fixedFieldSet = true; + this.fixedField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Remote + { + get + { + return this.remoteField; + } + set + { + this.remoteFieldSet = true; + this.remoteField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType CDROM + { + get + { + return this.cDROMField; + } + set + { + this.cDROMFieldSet = true; + this.cDROMField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + [SuppressMessage("Microsoft.Naming", "CA1705:LongAcronymsShouldBePascalCased")] + public YesNoType RAMDisk + { + get + { + return this.rAMDiskField; + } + set + { + this.rAMDiskFieldSet = true; + this.rAMDiskField = value; + } + } + + /// + /// This attribute is only valid for Volume and Directory Controls. + /// + public YesNoType Floppy + { + get + { + return this.floppyField; + } + set + { + this.floppyFieldSet = true; + this.floppyField = value; + } + } + + /// + /// This attribute is only valid for VolumeCostList Controls. + /// + public YesNoType ShowRollbackCost + { + get + { + return this.showRollbackCostField; + } + set + { + this.showRollbackCostFieldSet = true; + this.showRollbackCostField = value; + } + } + + /// + /// This attribute is only valid for ListBox, ListView, and ComboBox Controls. Set + /// the value of this attribute to "yes" to have entries appear in the order specified under the Control. + /// If the attribute value is "no" or absent the entries in the control will appear in alphabetical order. + /// + public YesNoType Sorted + { + get + { + return this.sortedField; + } + set + { + this.sortedFieldSet = true; + this.sortedField = value; + } + } + + /// + /// This attribute is only valid for ComboBox Controls. + /// + public YesNoType ComboList + { + get + { + return this.comboListField; + } + set + { + this.comboListFieldSet = true; + this.comboListField = value; + } + } + + /// + /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. + /// + public YesNoType Image + { + get + { + return this.imageField; + } + set + { + this.imageFieldSet = true; + this.imageField = value; + } + } + + /// + /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. + /// + public IconSizeType IconSize + { + get + { + return this.iconSizeField; + } + set + { + this.iconSizeFieldSet = true; + this.iconSizeField = value; + } + } + + /// + /// This attribute is only valid for RadioButton, PushButton, and Icon Controls. + /// + public YesNoType FixedSize + { + get + { + return this.fixedSizeField; + } + set + { + this.fixedSizeFieldSet = true; + this.fixedSizeField = value; + } + } + + /// + /// This attribute is only valid for RadioButton and PushButton Controls. + /// + public YesNoType Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// This attribute is only valid for RadioButton and PushButton Controls. + /// + public YesNoType Bitmap + { + get + { + return this.bitmapField; + } + set + { + this.bitmapFieldSet = true; + this.bitmapField = value; + } + } + + /// + /// This attribute is only valid for RadioButton and Checkbox Controls. + /// + public YesNoType PushLike + { + get + { + return this.pushLikeField; + } + set + { + this.pushLikeFieldSet = true; + this.pushLikeField = value; + } + } + + /// + /// This attribute is only valid for RadioButton Controls. + /// + public YesNoType HasBorder + { + get + { + return this.hasBorderField; + } + set + { + this.hasBorderFieldSet = true; + this.hasBorderField = value; + } + } + + /// + /// This attribute is only valid for PushButton controls. + /// Set this attribute to "yes" to add the User Account Control (UAC) elevation icon (shield icon) to the PushButton control. + /// If this attribute's value is "yes" and the installation is not yet running with elevated privileges, + /// the pushbutton control is created using the User Account Control (UAC) elevation icon (shield icon). + /// If this attribute's value is "yes" and the installation is already running with elevated privileges, + /// the pushbutton control is created using the other icon attributes. + /// Otherwise, the pushbutton control is created using the other icon attributes. + /// + public YesNoType ElevationShield + { + get + { + return this.elevationShieldField; + } + set + { + this.elevationShieldFieldSet = true; + this.elevationShieldField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Text" == childName)) + { + childValue = new Text(); + } + if (("ComboBox" == childName)) + { + childValue = new ComboBox(); + } + if (("ListBox" == childName)) + { + childValue = new ListBox(); + } + if (("ListView" == childName)) + { + childValue = new ListView(); + } + if (("RadioButtonGroup" == childName)) + { + childValue = new RadioButtonGroup(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("Condition" == childName)) + { + childValue = new Condition(); + } + if (("Publish" == childName)) + { + childValue = new Publish(); + } + if (("Subscribe" == childName)) + { + childValue = new Subscribe(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Parses a IconSizeType from a string. + /// + public static IconSizeType ParseIconSizeType(string value) + { + IconSizeType parsedValue; + Control.TryParseIconSizeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a IconSizeType from a string. + /// + public static bool TryParseIconSizeType(string value, out IconSizeType parsedValue) + { + parsedValue = IconSizeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("16" == value)) + { + parsedValue = IconSizeType.Item16; + } + else + { + if (("32" == value)) + { + parsedValue = IconSizeType.Item32; + } + else + { + if (("48" == value)) + { + parsedValue = IconSizeType.Item48; + } + else + { + parsedValue = IconSizeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Control", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.typeFieldSet) + { + writer.WriteAttributeString("Type", this.typeField); + } + if (this.xFieldSet) + { + writer.WriteAttributeString("X", this.xField); + } + if (this.yFieldSet) + { + writer.WriteAttributeString("Y", this.yField); + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField); + } + if (this.heightFieldSet) + { + writer.WriteAttributeString("Height", this.heightField); + } + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + if (this.textFieldSet) + { + writer.WriteAttributeString("Text", this.textField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.toolTipFieldSet) + { + writer.WriteAttributeString("ToolTip", this.toolTipField); + } + if (this.checkBoxValueFieldSet) + { + writer.WriteAttributeString("CheckBoxValue", this.checkBoxValueField); + } + if (this.checkBoxPropertyRefFieldSet) + { + writer.WriteAttributeString("CheckBoxPropertyRef", this.checkBoxPropertyRefField); + } + if (this.tabSkipFieldSet) + { + if ((this.tabSkipField == YesNoType.no)) + { + writer.WriteAttributeString("TabSkip", "no"); + } + if ((this.tabSkipField == YesNoType.yes)) + { + writer.WriteAttributeString("TabSkip", "yes"); + } + } + if (this.defaultFieldSet) + { + if ((this.defaultField == YesNoType.no)) + { + writer.WriteAttributeString("Default", "no"); + } + if ((this.defaultField == YesNoType.yes)) + { + writer.WriteAttributeString("Default", "yes"); + } + } + if (this.cancelFieldSet) + { + if ((this.cancelField == YesNoType.no)) + { + writer.WriteAttributeString("Cancel", "no"); + } + if ((this.cancelField == YesNoType.yes)) + { + writer.WriteAttributeString("Cancel", "yes"); + } + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.disabledFieldSet) + { + if ((this.disabledField == YesNoType.no)) + { + writer.WriteAttributeString("Disabled", "no"); + } + if ((this.disabledField == YesNoType.yes)) + { + writer.WriteAttributeString("Disabled", "yes"); + } + } + if (this.sunkenFieldSet) + { + if ((this.sunkenField == YesNoType.no)) + { + writer.WriteAttributeString("Sunken", "no"); + } + if ((this.sunkenField == YesNoType.yes)) + { + writer.WriteAttributeString("Sunken", "yes"); + } + } + if (this.indirectFieldSet) + { + if ((this.indirectField == YesNoType.no)) + { + writer.WriteAttributeString("Indirect", "no"); + } + if ((this.indirectField == YesNoType.yes)) + { + writer.WriteAttributeString("Indirect", "yes"); + } + } + if (this.integerFieldSet) + { + if ((this.integerField == YesNoType.no)) + { + writer.WriteAttributeString("Integer", "no"); + } + if ((this.integerField == YesNoType.yes)) + { + writer.WriteAttributeString("Integer", "yes"); + } + } + if (this.rightToLeftFieldSet) + { + if ((this.rightToLeftField == YesNoType.no)) + { + writer.WriteAttributeString("RightToLeft", "no"); + } + if ((this.rightToLeftField == YesNoType.yes)) + { + writer.WriteAttributeString("RightToLeft", "yes"); + } + } + if (this.rightAlignedFieldSet) + { + if ((this.rightAlignedField == YesNoType.no)) + { + writer.WriteAttributeString("RightAligned", "no"); + } + if ((this.rightAlignedField == YesNoType.yes)) + { + writer.WriteAttributeString("RightAligned", "yes"); + } + } + if (this.leftScrollFieldSet) + { + if ((this.leftScrollField == YesNoType.no)) + { + writer.WriteAttributeString("LeftScroll", "no"); + } + if ((this.leftScrollField == YesNoType.yes)) + { + writer.WriteAttributeString("LeftScroll", "yes"); + } + } + if (this.transparentFieldSet) + { + if ((this.transparentField == YesNoType.no)) + { + writer.WriteAttributeString("Transparent", "no"); + } + if ((this.transparentField == YesNoType.yes)) + { + writer.WriteAttributeString("Transparent", "yes"); + } + } + if (this.noPrefixFieldSet) + { + if ((this.noPrefixField == YesNoType.no)) + { + writer.WriteAttributeString("NoPrefix", "no"); + } + if ((this.noPrefixField == YesNoType.yes)) + { + writer.WriteAttributeString("NoPrefix", "yes"); + } + } + if (this.noWrapFieldSet) + { + if ((this.noWrapField == YesNoType.no)) + { + writer.WriteAttributeString("NoWrap", "no"); + } + if ((this.noWrapField == YesNoType.yes)) + { + writer.WriteAttributeString("NoWrap", "yes"); + } + } + if (this.formatSizeFieldSet) + { + if ((this.formatSizeField == YesNoType.no)) + { + writer.WriteAttributeString("FormatSize", "no"); + } + if ((this.formatSizeField == YesNoType.yes)) + { + writer.WriteAttributeString("FormatSize", "yes"); + } + } + if (this.userLanguageFieldSet) + { + if ((this.userLanguageField == YesNoType.no)) + { + writer.WriteAttributeString("UserLanguage", "no"); + } + if ((this.userLanguageField == YesNoType.yes)) + { + writer.WriteAttributeString("UserLanguage", "yes"); + } + } + if (this.multilineFieldSet) + { + if ((this.multilineField == YesNoType.no)) + { + writer.WriteAttributeString("Multiline", "no"); + } + if ((this.multilineField == YesNoType.yes)) + { + writer.WriteAttributeString("Multiline", "yes"); + } + } + if (this.passwordFieldSet) + { + if ((this.passwordField == YesNoType.no)) + { + writer.WriteAttributeString("Password", "no"); + } + if ((this.passwordField == YesNoType.yes)) + { + writer.WriteAttributeString("Password", "yes"); + } + } + if (this.progressBlocksFieldSet) + { + if ((this.progressBlocksField == YesNoType.no)) + { + writer.WriteAttributeString("ProgressBlocks", "no"); + } + if ((this.progressBlocksField == YesNoType.yes)) + { + writer.WriteAttributeString("ProgressBlocks", "yes"); + } + } + if (this.removableFieldSet) + { + if ((this.removableField == YesNoType.no)) + { + writer.WriteAttributeString("Removable", "no"); + } + if ((this.removableField == YesNoType.yes)) + { + writer.WriteAttributeString("Removable", "yes"); + } + } + if (this.fixedFieldSet) + { + if ((this.fixedField == YesNoType.no)) + { + writer.WriteAttributeString("Fixed", "no"); + } + if ((this.fixedField == YesNoType.yes)) + { + writer.WriteAttributeString("Fixed", "yes"); + } + } + if (this.remoteFieldSet) + { + if ((this.remoteField == YesNoType.no)) + { + writer.WriteAttributeString("Remote", "no"); + } + if ((this.remoteField == YesNoType.yes)) + { + writer.WriteAttributeString("Remote", "yes"); + } + } + if (this.cDROMFieldSet) + { + if ((this.cDROMField == YesNoType.no)) + { + writer.WriteAttributeString("CDROM", "no"); + } + if ((this.cDROMField == YesNoType.yes)) + { + writer.WriteAttributeString("CDROM", "yes"); + } + } + if (this.rAMDiskFieldSet) + { + if ((this.rAMDiskField == YesNoType.no)) + { + writer.WriteAttributeString("RAMDisk", "no"); + } + if ((this.rAMDiskField == YesNoType.yes)) + { + writer.WriteAttributeString("RAMDisk", "yes"); + } + } + if (this.floppyFieldSet) + { + if ((this.floppyField == YesNoType.no)) + { + writer.WriteAttributeString("Floppy", "no"); + } + if ((this.floppyField == YesNoType.yes)) + { + writer.WriteAttributeString("Floppy", "yes"); + } + } + if (this.showRollbackCostFieldSet) + { + if ((this.showRollbackCostField == YesNoType.no)) + { + writer.WriteAttributeString("ShowRollbackCost", "no"); + } + if ((this.showRollbackCostField == YesNoType.yes)) + { + writer.WriteAttributeString("ShowRollbackCost", "yes"); + } + } + if (this.sortedFieldSet) + { + if ((this.sortedField == YesNoType.no)) + { + writer.WriteAttributeString("Sorted", "no"); + } + if ((this.sortedField == YesNoType.yes)) + { + writer.WriteAttributeString("Sorted", "yes"); + } + } + if (this.comboListFieldSet) + { + if ((this.comboListField == YesNoType.no)) + { + writer.WriteAttributeString("ComboList", "no"); + } + if ((this.comboListField == YesNoType.yes)) + { + writer.WriteAttributeString("ComboList", "yes"); + } + } + if (this.imageFieldSet) + { + if ((this.imageField == YesNoType.no)) + { + writer.WriteAttributeString("Image", "no"); + } + if ((this.imageField == YesNoType.yes)) + { + writer.WriteAttributeString("Image", "yes"); + } + } + if (this.iconSizeFieldSet) + { + if ((this.iconSizeField == IconSizeType.Item16)) + { + writer.WriteAttributeString("IconSize", "16"); + } + if ((this.iconSizeField == IconSizeType.Item32)) + { + writer.WriteAttributeString("IconSize", "32"); + } + if ((this.iconSizeField == IconSizeType.Item48)) + { + writer.WriteAttributeString("IconSize", "48"); + } + } + if (this.fixedSizeFieldSet) + { + if ((this.fixedSizeField == YesNoType.no)) + { + writer.WriteAttributeString("FixedSize", "no"); + } + if ((this.fixedSizeField == YesNoType.yes)) + { + writer.WriteAttributeString("FixedSize", "yes"); + } + } + if (this.iconFieldSet) + { + if ((this.iconField == YesNoType.no)) + { + writer.WriteAttributeString("Icon", "no"); + } + if ((this.iconField == YesNoType.yes)) + { + writer.WriteAttributeString("Icon", "yes"); + } + } + if (this.bitmapFieldSet) + { + if ((this.bitmapField == YesNoType.no)) + { + writer.WriteAttributeString("Bitmap", "no"); + } + if ((this.bitmapField == YesNoType.yes)) + { + writer.WriteAttributeString("Bitmap", "yes"); + } + } + if (this.pushLikeFieldSet) + { + if ((this.pushLikeField == YesNoType.no)) + { + writer.WriteAttributeString("PushLike", "no"); + } + if ((this.pushLikeField == YesNoType.yes)) + { + writer.WriteAttributeString("PushLike", "yes"); + } + } + if (this.hasBorderFieldSet) + { + if ((this.hasBorderField == YesNoType.no)) + { + writer.WriteAttributeString("HasBorder", "no"); + } + if ((this.hasBorderField == YesNoType.yes)) + { + writer.WriteAttributeString("HasBorder", "yes"); + } + } + if (this.elevationShieldFieldSet) + { + if ((this.elevationShieldField == YesNoType.no)) + { + writer.WriteAttributeString("ElevationShield", "no"); + } + if ((this.elevationShieldField == YesNoType.yes)) + { + writer.WriteAttributeString("ElevationShield", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = value; + this.typeFieldSet = true; + } + if (("X" == name)) + { + this.xField = value; + this.xFieldSet = true; + } + if (("Y" == name)) + { + this.yField = value; + this.yFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = value; + this.widthFieldSet = true; + } + if (("Height" == name)) + { + this.heightField = value; + this.heightFieldSet = true; + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + if (("Text" == name)) + { + this.textField = value; + this.textFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("ToolTip" == name)) + { + this.toolTipField = value; + this.toolTipFieldSet = true; + } + if (("CheckBoxValue" == name)) + { + this.checkBoxValueField = value; + this.checkBoxValueFieldSet = true; + } + if (("CheckBoxPropertyRef" == name)) + { + this.checkBoxPropertyRefField = value; + this.checkBoxPropertyRefFieldSet = true; + } + if (("TabSkip" == name)) + { + this.tabSkipField = Enums.ParseYesNoType(value); + this.tabSkipFieldSet = true; + } + if (("Default" == name)) + { + this.defaultField = Enums.ParseYesNoType(value); + this.defaultFieldSet = true; + } + if (("Cancel" == name)) + { + this.cancelField = Enums.ParseYesNoType(value); + this.cancelFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Disabled" == name)) + { + this.disabledField = Enums.ParseYesNoType(value); + this.disabledFieldSet = true; + } + if (("Sunken" == name)) + { + this.sunkenField = Enums.ParseYesNoType(value); + this.sunkenFieldSet = true; + } + if (("Indirect" == name)) + { + this.indirectField = Enums.ParseYesNoType(value); + this.indirectFieldSet = true; + } + if (("Integer" == name)) + { + this.integerField = Enums.ParseYesNoType(value); + this.integerFieldSet = true; + } + if (("RightToLeft" == name)) + { + this.rightToLeftField = Enums.ParseYesNoType(value); + this.rightToLeftFieldSet = true; + } + if (("RightAligned" == name)) + { + this.rightAlignedField = Enums.ParseYesNoType(value); + this.rightAlignedFieldSet = true; + } + if (("LeftScroll" == name)) + { + this.leftScrollField = Enums.ParseYesNoType(value); + this.leftScrollFieldSet = true; + } + if (("Transparent" == name)) + { + this.transparentField = Enums.ParseYesNoType(value); + this.transparentFieldSet = true; + } + if (("NoPrefix" == name)) + { + this.noPrefixField = Enums.ParseYesNoType(value); + this.noPrefixFieldSet = true; + } + if (("NoWrap" == name)) + { + this.noWrapField = Enums.ParseYesNoType(value); + this.noWrapFieldSet = true; + } + if (("FormatSize" == name)) + { + this.formatSizeField = Enums.ParseYesNoType(value); + this.formatSizeFieldSet = true; + } + if (("UserLanguage" == name)) + { + this.userLanguageField = Enums.ParseYesNoType(value); + this.userLanguageFieldSet = true; + } + if (("Multiline" == name)) + { + this.multilineField = Enums.ParseYesNoType(value); + this.multilineFieldSet = true; + } + if (("Password" == name)) + { + this.passwordField = Enums.ParseYesNoType(value); + this.passwordFieldSet = true; + } + if (("ProgressBlocks" == name)) + { + this.progressBlocksField = Enums.ParseYesNoType(value); + this.progressBlocksFieldSet = true; + } + if (("Removable" == name)) + { + this.removableField = Enums.ParseYesNoType(value); + this.removableFieldSet = true; + } + if (("Fixed" == name)) + { + this.fixedField = Enums.ParseYesNoType(value); + this.fixedFieldSet = true; + } + if (("Remote" == name)) + { + this.remoteField = Enums.ParseYesNoType(value); + this.remoteFieldSet = true; + } + if (("CDROM" == name)) + { + this.cDROMField = Enums.ParseYesNoType(value); + this.cDROMFieldSet = true; + } + if (("RAMDisk" == name)) + { + this.rAMDiskField = Enums.ParseYesNoType(value); + this.rAMDiskFieldSet = true; + } + if (("Floppy" == name)) + { + this.floppyField = Enums.ParseYesNoType(value); + this.floppyFieldSet = true; + } + if (("ShowRollbackCost" == name)) + { + this.showRollbackCostField = Enums.ParseYesNoType(value); + this.showRollbackCostFieldSet = true; + } + if (("Sorted" == name)) + { + this.sortedField = Enums.ParseYesNoType(value); + this.sortedFieldSet = true; + } + if (("ComboList" == name)) + { + this.comboListField = Enums.ParseYesNoType(value); + this.comboListFieldSet = true; + } + if (("Image" == name)) + { + this.imageField = Enums.ParseYesNoType(value); + this.imageFieldSet = true; + } + if (("IconSize" == name)) + { + this.iconSizeField = Control.ParseIconSizeType(value); + this.iconSizeFieldSet = true; + } + if (("FixedSize" == name)) + { + this.fixedSizeField = Enums.ParseYesNoType(value); + this.fixedSizeFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = Enums.ParseYesNoType(value); + this.iconFieldSet = true; + } + if (("Bitmap" == name)) + { + this.bitmapField = Enums.ParseYesNoType(value); + this.bitmapFieldSet = true; + } + if (("PushLike" == name)) + { + this.pushLikeField = Enums.ParseYesNoType(value); + this.pushLikeFieldSet = true; + } + if (("HasBorder" == name)) + { + this.hasBorderField = Enums.ParseYesNoType(value); + this.hasBorderFieldSet = true; + } + if (("ElevationShield" == name)) + { + this.elevationShieldField = Enums.ParseYesNoType(value); + this.elevationShieldFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum IconSizeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + Item16, + + Item32, + + Item48, + } + } + + /// + /// Billboard to display during install of a Feature + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Billboard : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private string featureField; + + private bool featureFieldSet; + + private ISchemaElement parentElement; + + public Billboard() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Control))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the Billboard. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Feature whose state determines if the Billboard is shown. + /// + public string Feature + { + get + { + return this.featureField; + } + set + { + this.featureFieldSet = true; + this.featureField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Control" == childName)) + { + childValue = new Control(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Billboard", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.featureFieldSet) + { + writer.WriteAttributeString("Feature", this.featureField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Feature" == name)) + { + this.featureField = value; + this.featureFieldSet = true; + } + } + } + + /// + /// Billboard action during which child Billboards are displayed + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class BillboardAction : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public BillboardAction() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Billboard))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Action name that determines when the Billboard should be shown. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Billboard" == childName)) + { + childValue = new Billboard(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("BillboardAction", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Defines a dialog box in the Dialog Table. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Dialog : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private int xField; + + private bool xFieldSet; + + private int yField; + + private bool yFieldSet; + + private int widthField; + + private bool widthFieldSet; + + private int heightField; + + private bool heightFieldSet; + + private string titleField; + + private bool titleFieldSet; + + private YesNoType hiddenField; + + private bool hiddenFieldSet; + + private YesNoType modelessField; + + private bool modelessFieldSet; + + private YesNoType noMinimizeField; + + private bool noMinimizeFieldSet; + + private YesNoType systemModalField; + + private bool systemModalFieldSet; + + private YesNoType keepModelessField; + + private bool keepModelessFieldSet; + + private YesNoType trackDiskSpaceField; + + private bool trackDiskSpaceFieldSet; + + private YesNoType customPaletteField; + + private bool customPaletteFieldSet; + + private YesNoType rightToLeftField; + + private bool rightToLeftFieldSet; + + private YesNoType rightAlignedField; + + private bool rightAlignedFieldSet; + + private YesNoType leftScrollField; + + private bool leftScrollFieldSet; + + private YesNoType errorDialogField; + + private bool errorDialogFieldSet; + + private ISchemaElement parentElement; + + public Dialog() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Control))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Unique identifier for the dialog. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Horizontal placement of the dialog box as a percentage of screen width. The default value is 50. + /// + public int X + { + get + { + return this.xField; + } + set + { + this.xFieldSet = true; + this.xField = value; + } + } + + /// + /// Vertical placement of the dialog box as a percentage of screen height. The default value is 50. + /// + public int Y + { + get + { + return this.yField; + } + set + { + this.yFieldSet = true; + this.yField = value; + } + } + + /// + /// The width of the dialog box in dialog units. + /// + public int Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + /// + /// The height of the dialog box in dialog units. + /// + public int Height + { + get + { + return this.heightField; + } + set + { + this.heightFieldSet = true; + this.heightField = value; + } + } + + /// + /// The title of the dialog box. + /// + public string Title + { + get + { + return this.titleField; + } + set + { + this.titleFieldSet = true; + this.titleField = value; + } + } + + /// + /// Used to hide the dialog. + /// + public YesNoType Hidden + { + get + { + return this.hiddenField; + } + set + { + this.hiddenFieldSet = true; + this.hiddenField = value; + } + } + + /// + /// Used to set the dialog as modeless. + /// + public YesNoType Modeless + { + get + { + return this.modelessField; + } + set + { + this.modelessFieldSet = true; + this.modelessField = value; + } + } + + /// + /// Used to specify if the dialog can be minimized. + /// + public YesNoType NoMinimize + { + get + { + return this.noMinimizeField; + } + set + { + this.noMinimizeFieldSet = true; + this.noMinimizeField = value; + } + } + + /// + /// Used to set the dialog as system modal. + /// + public YesNoType SystemModal + { + get + { + return this.systemModalField; + } + set + { + this.systemModalFieldSet = true; + this.systemModalField = value; + } + } + + /// + /// Keep modeless dialogs alive when this dialog is created through DoAction. + /// + public YesNoType KeepModeless + { + get + { + return this.keepModelessField; + } + set + { + this.keepModelessFieldSet = true; + this.keepModelessField = value; + } + } + + /// + /// Have the dialog periodically call the installer to check if available disk space has changed. + /// + public YesNoType TrackDiskSpace + { + get + { + return this.trackDiskSpaceField; + } + set + { + this.trackDiskSpaceFieldSet = true; + this.trackDiskSpaceField = value; + } + } + + /// + /// Used to specify if pictures in the dialog box are rendered with a custom palette. + /// + public YesNoType CustomPalette + { + get + { + return this.customPaletteField; + } + set + { + this.customPaletteFieldSet = true; + this.customPaletteField = value; + } + } + + /// + /// Used to specify if the text in the dialog should be displayed in right to left reading order. + /// + public YesNoType RightToLeft + { + get + { + return this.rightToLeftField; + } + set + { + this.rightToLeftFieldSet = true; + this.rightToLeftField = value; + } + } + + /// + /// Align text on the right. + /// + public YesNoType RightAligned + { + get + { + return this.rightAlignedField; + } + set + { + this.rightAlignedFieldSet = true; + this.rightAlignedField = value; + } + } + + /// + /// Used to align the scroll bar on the left. + /// + public YesNoType LeftScroll + { + get + { + return this.leftScrollField; + } + set + { + this.leftScrollFieldSet = true; + this.leftScrollField = value; + } + } + + /// + /// Specifies this dialog as an error dialog. + /// + public YesNoType ErrorDialog + { + get + { + return this.errorDialogField; + } + set + { + this.errorDialogFieldSet = true; + this.errorDialogField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Control" == childName)) + { + childValue = new Control(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Dialog", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.xFieldSet) + { + writer.WriteAttributeString("X", this.xField.ToString(CultureInfo.InvariantCulture)); + } + if (this.yFieldSet) + { + writer.WriteAttributeString("Y", this.yField.ToString(CultureInfo.InvariantCulture)); + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField.ToString(CultureInfo.InvariantCulture)); + } + if (this.heightFieldSet) + { + writer.WriteAttributeString("Height", this.heightField.ToString(CultureInfo.InvariantCulture)); + } + if (this.titleFieldSet) + { + writer.WriteAttributeString("Title", this.titleField); + } + if (this.hiddenFieldSet) + { + if ((this.hiddenField == YesNoType.no)) + { + writer.WriteAttributeString("Hidden", "no"); + } + if ((this.hiddenField == YesNoType.yes)) + { + writer.WriteAttributeString("Hidden", "yes"); + } + } + if (this.modelessFieldSet) + { + if ((this.modelessField == YesNoType.no)) + { + writer.WriteAttributeString("Modeless", "no"); + } + if ((this.modelessField == YesNoType.yes)) + { + writer.WriteAttributeString("Modeless", "yes"); + } + } + if (this.noMinimizeFieldSet) + { + if ((this.noMinimizeField == YesNoType.no)) + { + writer.WriteAttributeString("NoMinimize", "no"); + } + if ((this.noMinimizeField == YesNoType.yes)) + { + writer.WriteAttributeString("NoMinimize", "yes"); + } + } + if (this.systemModalFieldSet) + { + if ((this.systemModalField == YesNoType.no)) + { + writer.WriteAttributeString("SystemModal", "no"); + } + if ((this.systemModalField == YesNoType.yes)) + { + writer.WriteAttributeString("SystemModal", "yes"); + } + } + if (this.keepModelessFieldSet) + { + if ((this.keepModelessField == YesNoType.no)) + { + writer.WriteAttributeString("KeepModeless", "no"); + } + if ((this.keepModelessField == YesNoType.yes)) + { + writer.WriteAttributeString("KeepModeless", "yes"); + } + } + if (this.trackDiskSpaceFieldSet) + { + if ((this.trackDiskSpaceField == YesNoType.no)) + { + writer.WriteAttributeString("TrackDiskSpace", "no"); + } + if ((this.trackDiskSpaceField == YesNoType.yes)) + { + writer.WriteAttributeString("TrackDiskSpace", "yes"); + } + } + if (this.customPaletteFieldSet) + { + if ((this.customPaletteField == YesNoType.no)) + { + writer.WriteAttributeString("CustomPalette", "no"); + } + if ((this.customPaletteField == YesNoType.yes)) + { + writer.WriteAttributeString("CustomPalette", "yes"); + } + } + if (this.rightToLeftFieldSet) + { + if ((this.rightToLeftField == YesNoType.no)) + { + writer.WriteAttributeString("RightToLeft", "no"); + } + if ((this.rightToLeftField == YesNoType.yes)) + { + writer.WriteAttributeString("RightToLeft", "yes"); + } + } + if (this.rightAlignedFieldSet) + { + if ((this.rightAlignedField == YesNoType.no)) + { + writer.WriteAttributeString("RightAligned", "no"); + } + if ((this.rightAlignedField == YesNoType.yes)) + { + writer.WriteAttributeString("RightAligned", "yes"); + } + } + if (this.leftScrollFieldSet) + { + if ((this.leftScrollField == YesNoType.no)) + { + writer.WriteAttributeString("LeftScroll", "no"); + } + if ((this.leftScrollField == YesNoType.yes)) + { + writer.WriteAttributeString("LeftScroll", "yes"); + } + } + if (this.errorDialogFieldSet) + { + if ((this.errorDialogField == YesNoType.no)) + { + writer.WriteAttributeString("ErrorDialog", "no"); + } + if ((this.errorDialogField == YesNoType.yes)) + { + writer.WriteAttributeString("ErrorDialog", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("X" == name)) + { + this.xField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.xFieldSet = true; + } + if (("Y" == name)) + { + this.yField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.yFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.widthFieldSet = true; + } + if (("Height" == name)) + { + this.heightField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.heightFieldSet = true; + } + if (("Title" == name)) + { + this.titleField = value; + this.titleFieldSet = true; + } + if (("Hidden" == name)) + { + this.hiddenField = Enums.ParseYesNoType(value); + this.hiddenFieldSet = true; + } + if (("Modeless" == name)) + { + this.modelessField = Enums.ParseYesNoType(value); + this.modelessFieldSet = true; + } + if (("NoMinimize" == name)) + { + this.noMinimizeField = Enums.ParseYesNoType(value); + this.noMinimizeFieldSet = true; + } + if (("SystemModal" == name)) + { + this.systemModalField = Enums.ParseYesNoType(value); + this.systemModalFieldSet = true; + } + if (("KeepModeless" == name)) + { + this.keepModelessField = Enums.ParseYesNoType(value); + this.keepModelessFieldSet = true; + } + if (("TrackDiskSpace" == name)) + { + this.trackDiskSpaceField = Enums.ParseYesNoType(value); + this.trackDiskSpaceFieldSet = true; + } + if (("CustomPalette" == name)) + { + this.customPaletteField = Enums.ParseYesNoType(value); + this.customPaletteFieldSet = true; + } + if (("RightToLeft" == name)) + { + this.rightToLeftField = Enums.ParseYesNoType(value); + this.rightToLeftFieldSet = true; + } + if (("RightAligned" == name)) + { + this.rightAlignedField = Enums.ParseYesNoType(value); + this.rightAlignedFieldSet = true; + } + if (("LeftScroll" == name)) + { + this.leftScrollField = Enums.ParseYesNoType(value); + this.leftScrollFieldSet = true; + } + if (("ErrorDialog" == name)) + { + this.errorDialogField = Enums.ParseYesNoType(value); + this.errorDialogFieldSet = true; + } + } + } + + /// + /// Reference to a Dialog. This will cause the entire referenced section's contents + /// to be included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class DialogRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identifier of the Dialog to reference. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("DialogRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProgressText : ISchemaElement, ISetAttributes + { + + private string actionField; + + private bool actionFieldSet; + + private string templateField; + + private bool templateFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + public string Action + { + get + { + return this.actionField; + } + set + { + this.actionFieldSet = true; + this.actionField = value; + } + } + + /// + /// used to format ActionData messages from action processing + /// + public string Template + { + get + { + return this.templateField; + } + set + { + this.templateFieldSet = true; + this.templateField = value; + } + } + + /// + /// Element value is progress message text for action + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProgressText", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.actionFieldSet) + { + writer.WriteAttributeString("Action", this.actionField); + } + if (this.templateFieldSet) + { + writer.WriteAttributeString("Template", this.templateField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Action" == name)) + { + this.actionField = value; + this.actionFieldSet = true; + } + if (("Template" == name)) + { + this.templateField = value; + this.templateFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class TextStyle : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string faceNameField; + + private bool faceNameFieldSet; + + private string sizeField; + + private bool sizeFieldSet; + + private int redField; + + private bool redFieldSet; + + private int greenField; + + private bool greenFieldSet; + + private int blueField; + + private bool blueFieldSet; + + private YesNoType boldField; + + private bool boldFieldSet; + + private YesNoType italicField; + + private bool italicFieldSet; + + private YesNoType underlineField; + + private bool underlineFieldSet; + + private YesNoType strikeField; + + private bool strikeFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public string FaceName + { + get + { + return this.faceNameField; + } + set + { + this.faceNameFieldSet = true; + this.faceNameField = value; + } + } + + public string Size + { + get + { + return this.sizeField; + } + set + { + this.sizeFieldSet = true; + this.sizeField = value; + } + } + + /// + /// 0 to 255 + /// + public int Red + { + get + { + return this.redField; + } + set + { + this.redFieldSet = true; + this.redField = value; + } + } + + /// + /// 0 to 255 + /// + public int Green + { + get + { + return this.greenField; + } + set + { + this.greenFieldSet = true; + this.greenField = value; + } + } + + /// + /// 0 to 255 + /// + public int Blue + { + get + { + return this.blueField; + } + set + { + this.blueFieldSet = true; + this.blueField = value; + } + } + + public YesNoType Bold + { + get + { + return this.boldField; + } + set + { + this.boldFieldSet = true; + this.boldField = value; + } + } + + public YesNoType Italic + { + get + { + return this.italicField; + } + set + { + this.italicFieldSet = true; + this.italicField = value; + } + } + + public YesNoType Underline + { + get + { + return this.underlineField; + } + set + { + this.underlineFieldSet = true; + this.underlineField = value; + } + } + + public YesNoType Strike + { + get + { + return this.strikeField; + } + set + { + this.strikeFieldSet = true; + this.strikeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("TextStyle", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.faceNameFieldSet) + { + writer.WriteAttributeString("FaceName", this.faceNameField); + } + if (this.sizeFieldSet) + { + writer.WriteAttributeString("Size", this.sizeField); + } + if (this.redFieldSet) + { + writer.WriteAttributeString("Red", this.redField.ToString(CultureInfo.InvariantCulture)); + } + if (this.greenFieldSet) + { + writer.WriteAttributeString("Green", this.greenField.ToString(CultureInfo.InvariantCulture)); + } + if (this.blueFieldSet) + { + writer.WriteAttributeString("Blue", this.blueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.boldFieldSet) + { + if ((this.boldField == YesNoType.no)) + { + writer.WriteAttributeString("Bold", "no"); + } + if ((this.boldField == YesNoType.yes)) + { + writer.WriteAttributeString("Bold", "yes"); + } + } + if (this.italicFieldSet) + { + if ((this.italicField == YesNoType.no)) + { + writer.WriteAttributeString("Italic", "no"); + } + if ((this.italicField == YesNoType.yes)) + { + writer.WriteAttributeString("Italic", "yes"); + } + } + if (this.underlineFieldSet) + { + if ((this.underlineField == YesNoType.no)) + { + writer.WriteAttributeString("Underline", "no"); + } + if ((this.underlineField == YesNoType.yes)) + { + writer.WriteAttributeString("Underline", "yes"); + } + } + if (this.strikeFieldSet) + { + if ((this.strikeField == YesNoType.no)) + { + writer.WriteAttributeString("Strike", "no"); + } + if ((this.strikeField == YesNoType.yes)) + { + writer.WriteAttributeString("Strike", "yes"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("FaceName" == name)) + { + this.faceNameField = value; + this.faceNameFieldSet = true; + } + if (("Size" == name)) + { + this.sizeField = value; + this.sizeFieldSet = true; + } + if (("Red" == name)) + { + this.redField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.redFieldSet = true; + } + if (("Green" == name)) + { + this.greenField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.greenFieldSet = true; + } + if (("Blue" == name)) + { + this.blueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.blueFieldSet = true; + } + if (("Bold" == name)) + { + this.boldField = Enums.ParseYesNoType(value); + this.boldFieldSet = true; + } + if (("Italic" == name)) + { + this.italicField = Enums.ParseYesNoType(value); + this.italicFieldSet = true; + } + if (("Underline" == name)) + { + this.underlineField = Enums.ParseYesNoType(value); + this.underlineFieldSet = true; + } + if (("Strike" == name)) + { + this.strikeField = Enums.ParseYesNoType(value); + this.strikeFieldSet = true; + } + } + } + + /// + /// The value (and optional text) associated with an item in a ComboBox, ListBox, or ListView. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ListItem : ISchemaElement, ISetAttributes + { + + private string valueField; + + private bool valueFieldSet; + + private string textField; + + private bool textFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private ISchemaElement parentElement; + + /// + /// The value assigned to the associated ComboBox, ListBox, or ListView property if this item is selected. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + /// + /// The localizable, visible text to be assigned to the item. + /// If not specified, this will default to the value of the Value attribute. + /// + public string Text + { + get + { + return this.textField; + } + set + { + this.textFieldSet = true; + this.textField = value; + } + } + + /// + /// The identifier of the Binary (not Icon) element containing the icon to associate with this item. + /// This value is only valid when nested under a ListView element. + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ListItem", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.textFieldSet) + { + writer.WriteAttributeString("Text", this.textField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Text" == name)) + { + this.textField = value; + this.textFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + } + } + + /// + /// Set of items for a particular ListBox control tied to an install Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ListBox : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public ListBox() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ListItem" == childName)) + { + childValue = new ListItem(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ListBox", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Set of items for a particular ComboBox control tied to an install Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ComboBox : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public ComboBox() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ListItem" == childName)) + { + childValue = new ListItem(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ComboBox", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Set of items for a particular ListView control tied to an install Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ListView : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public ListView() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(ListItem))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("ListItem" == childName)) + { + childValue = new ListItem(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ListView", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Text or Icon plus Value that is assigned to the Property of the parent Control (RadioButtonGroup). + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RadioButton : ISchemaElement, ISetAttributes + { + + private string bitmapField; + + private bool bitmapFieldSet; + + private string heightField; + + private bool heightFieldSet; + + private string helpField; + + private bool helpFieldSet; + + private string iconField; + + private bool iconFieldSet; + + private string textField; + + private bool textFieldSet; + + private string toolTipField; + + private bool toolTipFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private string widthField; + + private bool widthFieldSet; + + private string xField; + + private bool xFieldSet; + + private string yField; + + private bool yFieldSet; + + private ISchemaElement parentElement; + + /// + /// This attribute defines the bitmap displayed with the radio button. The value of the attribute creates a reference + /// to a Binary element that represents the bitmap. This attribute is mutually exclusive with the Icon and Text + /// attributes. + /// + public string Bitmap + { + get + { + return this.bitmapField; + } + set + { + this.bitmapFieldSet = true; + this.bitmapField = value; + } + } + + public string Height + { + get + { + return this.heightField; + } + set + { + this.heightFieldSet = true; + this.heightField = value; + } + } + + public string Help + { + get + { + return this.helpField; + } + set + { + this.helpFieldSet = true; + this.helpField = value; + } + } + + /// + /// This attribute defines the icon displayed with the radio button. The value of the attribute creates a reference + /// to a Binary element that represents the icon. This attribute is mutually exclusive with the Bitmap and Text + /// attributes. + /// + public string Icon + { + get + { + return this.iconField; + } + set + { + this.iconFieldSet = true; + this.iconField = value; + } + } + + /// + /// Text displayed with the radio button. This attribute is mutually exclusive with the Bitmap and Icon attributes. + /// + public string Text + { + get + { + return this.textField; + } + set + { + this.textFieldSet = true; + this.textField = value; + } + } + + public string ToolTip + { + get + { + return this.toolTipField; + } + set + { + this.toolTipFieldSet = true; + this.toolTipField = value; + } + } + + /// + /// Value assigned to the associated control Property when this radio button is selected. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public string Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + public string X + { + get + { + return this.xField; + } + set + { + this.xFieldSet = true; + this.xField = value; + } + } + + public string Y + { + get + { + return this.yField; + } + set + { + this.yFieldSet = true; + this.yField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RadioButton", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.bitmapFieldSet) + { + writer.WriteAttributeString("Bitmap", this.bitmapField); + } + if (this.heightFieldSet) + { + writer.WriteAttributeString("Height", this.heightField); + } + if (this.helpFieldSet) + { + writer.WriteAttributeString("Help", this.helpField); + } + if (this.iconFieldSet) + { + writer.WriteAttributeString("Icon", this.iconField); + } + if (this.textFieldSet) + { + writer.WriteAttributeString("Text", this.textField); + } + if (this.toolTipFieldSet) + { + writer.WriteAttributeString("ToolTip", this.toolTipField); + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField); + } + if (this.xFieldSet) + { + writer.WriteAttributeString("X", this.xField); + } + if (this.yFieldSet) + { + writer.WriteAttributeString("Y", this.yField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Bitmap" == name)) + { + this.bitmapField = value; + this.bitmapFieldSet = true; + } + if (("Height" == name)) + { + this.heightField = value; + this.heightFieldSet = true; + } + if (("Help" == name)) + { + this.helpField = value; + this.helpFieldSet = true; + } + if (("Icon" == name)) + { + this.iconField = value; + this.iconFieldSet = true; + } + if (("Text" == name)) + { + this.textField = value; + this.textFieldSet = true; + } + if (("ToolTip" == name)) + { + this.toolTipField = value; + this.toolTipFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = value; + this.widthFieldSet = true; + } + if (("X" == name)) + { + this.xField = value; + this.xFieldSet = true; + } + if (("Y" == name)) + { + this.yField = value; + this.yFieldSet = true; + } + } + } + + /// + /// Set of radio buttons tied to the specified Property + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class RadioButtonGroup : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public RadioButtonGroup() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(RadioButton))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Property tied to this group. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("RadioButton" == childName)) + { + childValue = new RadioButton(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("RadioButtonGroup", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Text associated with certain controls + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UIText : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Element value is text, may use CDATA if needed to escape XML delimiters + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UIText", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Reference to a UI element. This will force the entire referenced Fragment's contents + /// to be included in the installer database. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UIRef : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UIRef", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Enclosing element to compartmentalize UI specifications. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class UI : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + public UI() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(EmbeddedUI))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Error))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ProgressText))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(BillboardAction))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ComboBox))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ListBox))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(ListView))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(RadioButtonGroup))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(TextStyle))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIText))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Dialog))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(DialogRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Publish))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(PropertyRef))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Property))); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Binary))); + ElementCollection childCollection1 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(AdminUISequence))); + childCollection1.AddItem(new ElementCollection.SequenceItem(typeof(InstallUISequence))); + childCollection0.AddCollection(childCollection1); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(UIRef))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("EmbeddedUI" == childName)) + { + childValue = new EmbeddedUI(); + } + if (("Error" == childName)) + { + childValue = new Error(); + } + if (("ProgressText" == childName)) + { + childValue = new ProgressText(); + } + if (("BillboardAction" == childName)) + { + childValue = new BillboardAction(); + } + if (("ComboBox" == childName)) + { + childValue = new ComboBox(); + } + if (("ListBox" == childName)) + { + childValue = new ListBox(); + } + if (("ListView" == childName)) + { + childValue = new ListView(); + } + if (("RadioButtonGroup" == childName)) + { + childValue = new RadioButtonGroup(); + } + if (("TextStyle" == childName)) + { + childValue = new TextStyle(); + } + if (("UIText" == childName)) + { + childValue = new UIText(); + } + if (("Dialog" == childName)) + { + childValue = new Dialog(); + } + if (("DialogRef" == childName)) + { + childValue = new DialogRef(); + } + if (("Publish" == childName)) + { + childValue = new Publish(); + } + if (("PropertyRef" == childName)) + { + childValue = new PropertyRef(); + } + if (("Property" == childName)) + { + childValue = new Property(); + } + if (("Binary" == childName)) + { + childValue = new Binary(); + } + if (("AdminUISequence" == childName)) + { + childValue = new AdminUISequence(); + } + if (("InstallUISequence" == childName)) + { + childValue = new InstallUISequence(); + } + if (("UIRef" == childName)) + { + childValue = new UIRef(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("UI", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// Defines a custom table for use from a custom action. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class CustomTable : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string idField; + + private bool idFieldSet; + + private YesNoType bootstrapperApplicationDataField; + + private bool bootstrapperApplicationDataFieldSet; + + private ISchemaElement parentElement; + + public CustomTable() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Column))); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Row))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// Identifier for the custom table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Indicates the table data is transformed into the bootstrapper application data manifest. + /// + public YesNoType BootstrapperApplicationData + { + get + { + return this.bootstrapperApplicationDataField; + } + set + { + this.bootstrapperApplicationDataFieldSet = true; + this.bootstrapperApplicationDataField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Column" == childName)) + { + childValue = new Column(); + } + if (("Row" == childName)) + { + childValue = new Row(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("CustomTable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.bootstrapperApplicationDataFieldSet) + { + if ((this.bootstrapperApplicationDataField == YesNoType.no)) + { + writer.WriteAttributeString("BootstrapperApplicationData", "no"); + } + if ((this.bootstrapperApplicationDataField == YesNoType.yes)) + { + writer.WriteAttributeString("BootstrapperApplicationData", "yes"); + } + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("BootstrapperApplicationData" == name)) + { + this.bootstrapperApplicationDataField = Enums.ParseYesNoType(value); + this.bootstrapperApplicationDataFieldSet = true; + } + } + } + + /// + /// Column definition for a Custom Table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Column : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType primaryKeyField; + + private bool primaryKeyFieldSet; + + private TypeType typeField; + + private bool typeFieldSet; + + private int widthField; + + private bool widthFieldSet; + + private YesNoType nullableField; + + private bool nullableFieldSet; + + private YesNoType localizableField; + + private bool localizableFieldSet; + + private long minValueField; + + private bool minValueFieldSet; + + private long maxValueField; + + private bool maxValueFieldSet; + + private string keyTableField; + + private bool keyTableFieldSet; + + private int keyColumnField; + + private bool keyColumnFieldSet; + + private CategoryType categoryField; + + private bool categoryFieldSet; + + private string setField; + + private bool setFieldSet; + + private string descriptionField; + + private bool descriptionFieldSet; + + private ModularizeType modularizeField; + + private bool modularizeFieldSet; + + private ISchemaElement parentElement; + + /// + /// Identifier for the column. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Whether this column is a primary key. + /// + public YesNoType PrimaryKey + { + get + { + return this.primaryKeyField; + } + set + { + this.primaryKeyFieldSet = true; + this.primaryKeyField = value; + } + } + + /// + /// The type of this column. + /// + public TypeType Type + { + get + { + return this.typeField; + } + set + { + this.typeFieldSet = true; + this.typeField = value; + } + } + + /// + /// Width of this column. + /// + public int Width + { + get + { + return this.widthField; + } + set + { + this.widthFieldSet = true; + this.widthField = value; + } + } + + /// + /// Whether this column can be left null. + /// + public YesNoType Nullable + { + get + { + return this.nullableField; + } + set + { + this.nullableFieldSet = true; + this.nullableField = value; + } + } + + /// + /// Whether this column can be localized. + /// + public YesNoType Localizable + { + get + { + return this.localizableField; + } + set + { + this.localizableFieldSet = true; + this.localizableField = value; + } + } + + /// + /// Minimum value for a numeric value, date or version in this column. + /// + public long MinValue + { + get + { + return this.minValueField; + } + set + { + this.minValueFieldSet = true; + this.minValueField = value; + } + } + + /// + /// Maximum value for a numeric value, date or version in this column. + /// + public long MaxValue + { + get + { + return this.maxValueField; + } + set + { + this.maxValueFieldSet = true; + this.maxValueField = value; + } + } + + /// + /// Table in which this column is an external key. Can be semicolon delimited. + /// + public string KeyTable + { + get + { + return this.keyTableField; + } + set + { + this.keyTableFieldSet = true; + this.keyTableField = value; + } + } + + /// + /// Column in the table in KeyTable attribute. + /// + public int KeyColumn + { + get + { + return this.keyColumnField; + } + set + { + this.keyColumnFieldSet = true; + this.keyColumnField = value; + } + } + + /// + /// Category of this column. + /// This attribute must be specified with a value of 'Binary' if the Type attribute's value is 'binary'. + /// + public CategoryType Category + { + get + { + return this.categoryField; + } + set + { + this.categoryFieldSet = true; + this.categoryField = value; + } + } + + /// + /// Semicolon delimited list of permissible values. + /// + public string Set + { + get + { + return this.setField; + } + set + { + this.setFieldSet = true; + this.setField = value; + } + } + + /// + /// Description of this column. + /// + public string Description + { + get + { + return this.descriptionField; + } + set + { + this.descriptionFieldSet = true; + this.descriptionField = value; + } + } + + /// + /// How this column should be modularized, if at all. + /// + public ModularizeType Modularize + { + get + { + return this.modularizeField; + } + set + { + this.modularizeFieldSet = true; + this.modularizeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a TypeType from a string. + /// + public static TypeType ParseTypeType(string value) + { + TypeType parsedValue; + Column.TryParseTypeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a TypeType from a string. + /// + public static bool TryParseTypeType(string value, out TypeType parsedValue) + { + parsedValue = TypeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("binary" == value)) + { + parsedValue = TypeType.binary; + } + else + { + if (("int" == value)) + { + parsedValue = TypeType.@int; + } + else + { + if (("string" == value)) + { + parsedValue = TypeType.@string; + } + else + { + parsedValue = TypeType.IllegalValue; + return false; + } + } + } + return true; + } + + /// + /// Parses a CategoryType from a string. + /// + public static CategoryType ParseCategoryType(string value) + { + CategoryType parsedValue; + Column.TryParseCategoryType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a CategoryType from a string. + /// + public static bool TryParseCategoryType(string value, out CategoryType parsedValue) + { + parsedValue = CategoryType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("Text" == value)) + { + parsedValue = CategoryType.text; + } + else + { + if (("UpperCase" == value)) + { + parsedValue = CategoryType.upperCase; + } + else + { + if (("LowerCase" == value)) + { + parsedValue = CategoryType.lowerCase; + } + else + { + if (("Integer" == value)) + { + parsedValue = CategoryType.integer; + } + else + { + if (("DoubleInteger" == value)) + { + parsedValue = CategoryType.doubleInteger; + } + else + { + if (("TimeDate" == value)) + { + parsedValue = CategoryType.timeDate; + } + else + { + if (("Identifier" == value)) + { + parsedValue = CategoryType.identifier; + } + else + { + if (("Property" == value)) + { + parsedValue = CategoryType.property; + } + else + { + if (("Filename" == value)) + { + parsedValue = CategoryType.filename; + } + else + { + if (("WildCardFilename" == value)) + { + parsedValue = CategoryType.wildCardFilename; + } + else + { + if (("Path" == value)) + { + parsedValue = CategoryType.path; + } + else + { + if (("Paths" == value)) + { + parsedValue = CategoryType.paths; + } + else + { + if (("AnyPath" == value)) + { + parsedValue = CategoryType.anyPath; + } + else + { + if (("DefaultDir" == value)) + { + parsedValue = CategoryType.defaultDir; + } + else + { + if (("RegPath" == value)) + { + parsedValue = CategoryType.regPath; + } + else + { + if (("Formatted" == value)) + { + parsedValue = CategoryType.formatted; + } + else + { + if (("FormattedSddl" == value)) + { + parsedValue = CategoryType.formattedSddl; + } + else + { + if (("Template" == value)) + { + parsedValue = CategoryType.template; + } + else + { + if (("Condition" == value)) + { + parsedValue = CategoryType.condition; + } + else + { + if (("Guid" == value)) + { + parsedValue = CategoryType.guid; + } + else + { + if (("Version" == value)) + { + parsedValue = CategoryType.version; + } + else + { + if (("Language" == value)) + { + parsedValue = CategoryType.language; + } + else + { + if (("Binary" == value)) + { + parsedValue = CategoryType.binary; + } + else + { + if (("CustomSource" == value)) + { + parsedValue = CategoryType.customSource; + } + else + { + if (("Cabinet" == value)) + { + parsedValue = CategoryType.cabinet; + } + else + { + if (("Shortcut" == value)) + { + parsedValue = CategoryType.shortcut; + } + else + { + parsedValue = CategoryType.IllegalValue; + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return true; + } + + /// + /// Parses a ModularizeType from a string. + /// + public static ModularizeType ParseModularizeType(string value) + { + ModularizeType parsedValue; + Column.TryParseModularizeType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ModularizeType from a string. + /// + public static bool TryParseModularizeType(string value, out ModularizeType parsedValue) + { + parsedValue = ModularizeType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("None" == value)) + { + parsedValue = ModularizeType.None; + } + else + { + if (("Column" == value)) + { + parsedValue = ModularizeType.Column; + } + else + { + if (("Condition" == value)) + { + parsedValue = ModularizeType.Condition; + } + else + { + if (("Icon" == value)) + { + parsedValue = ModularizeType.Icon; + } + else + { + if (("Property" == value)) + { + parsedValue = ModularizeType.Property; + } + else + { + if (("SemicolonDelimited" == value)) + { + parsedValue = ModularizeType.SemicolonDelimited; + } + else + { + parsedValue = ModularizeType.IllegalValue; + return false; + } + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Column", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.primaryKeyFieldSet) + { + if ((this.primaryKeyField == YesNoType.no)) + { + writer.WriteAttributeString("PrimaryKey", "no"); + } + if ((this.primaryKeyField == YesNoType.yes)) + { + writer.WriteAttributeString("PrimaryKey", "yes"); + } + } + if (this.typeFieldSet) + { + if ((this.typeField == TypeType.binary)) + { + writer.WriteAttributeString("Type", "binary"); + } + if ((this.typeField == TypeType.@int)) + { + writer.WriteAttributeString("Type", "int"); + } + if ((this.typeField == TypeType.@string)) + { + writer.WriteAttributeString("Type", "string"); + } + } + if (this.widthFieldSet) + { + writer.WriteAttributeString("Width", this.widthField.ToString(CultureInfo.InvariantCulture)); + } + if (this.nullableFieldSet) + { + if ((this.nullableField == YesNoType.no)) + { + writer.WriteAttributeString("Nullable", "no"); + } + if ((this.nullableField == YesNoType.yes)) + { + writer.WriteAttributeString("Nullable", "yes"); + } + } + if (this.localizableFieldSet) + { + if ((this.localizableField == YesNoType.no)) + { + writer.WriteAttributeString("Localizable", "no"); + } + if ((this.localizableField == YesNoType.yes)) + { + writer.WriteAttributeString("Localizable", "yes"); + } + } + if (this.minValueFieldSet) + { + writer.WriteAttributeString("MinValue", this.minValueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.maxValueFieldSet) + { + writer.WriteAttributeString("MaxValue", this.maxValueField.ToString(CultureInfo.InvariantCulture)); + } + if (this.keyTableFieldSet) + { + writer.WriteAttributeString("KeyTable", this.keyTableField); + } + if (this.keyColumnFieldSet) + { + writer.WriteAttributeString("KeyColumn", this.keyColumnField.ToString(CultureInfo.InvariantCulture)); + } + if (this.categoryFieldSet) + { + if ((this.categoryField == CategoryType.text)) + { + writer.WriteAttributeString("Category", "text"); + } + if ((this.categoryField == CategoryType.upperCase)) + { + writer.WriteAttributeString("Category", "upperCase"); + } + if ((this.categoryField == CategoryType.lowerCase)) + { + writer.WriteAttributeString("Category", "lowerCase"); + } + if ((this.categoryField == CategoryType.integer)) + { + writer.WriteAttributeString("Category", "integer"); + } + if ((this.categoryField == CategoryType.doubleInteger)) + { + writer.WriteAttributeString("Category", "doubleInteger"); + } + if ((this.categoryField == CategoryType.timeDate)) + { + writer.WriteAttributeString("Category", "timeDate"); + } + if ((this.categoryField == CategoryType.identifier)) + { + writer.WriteAttributeString("Category", "identifier"); + } + if ((this.categoryField == CategoryType.property)) + { + writer.WriteAttributeString("Category", "property"); + } + if ((this.categoryField == CategoryType.filename)) + { + writer.WriteAttributeString("Category", "filename"); + } + if ((this.categoryField == CategoryType.wildCardFilename)) + { + writer.WriteAttributeString("Category", "wildCardFilename"); + } + if ((this.categoryField == CategoryType.path)) + { + writer.WriteAttributeString("Category", "path"); + } + if ((this.categoryField == CategoryType.paths)) + { + writer.WriteAttributeString("Category", "paths"); + } + if ((this.categoryField == CategoryType.anyPath)) + { + writer.WriteAttributeString("Category", "anyPath"); + } + if ((this.categoryField == CategoryType.defaultDir)) + { + writer.WriteAttributeString("Category", "defaultDir"); + } + if ((this.categoryField == CategoryType.regPath)) + { + writer.WriteAttributeString("Category", "regPath"); + } + if ((this.categoryField == CategoryType.formatted)) + { + writer.WriteAttributeString("Category", "formatted"); + } + if ((this.categoryField == CategoryType.formattedSddl)) + { + writer.WriteAttributeString("Category", "formattedSddl"); + } + if ((this.categoryField == CategoryType.template)) + { + writer.WriteAttributeString("Category", "template"); + } + if ((this.categoryField == CategoryType.condition)) + { + writer.WriteAttributeString("Category", "condition"); + } + if ((this.categoryField == CategoryType.guid)) + { + writer.WriteAttributeString("Category", "guid"); + } + if ((this.categoryField == CategoryType.version)) + { + writer.WriteAttributeString("Category", "version"); + } + if ((this.categoryField == CategoryType.language)) + { + writer.WriteAttributeString("Category", "language"); + } + if ((this.categoryField == CategoryType.binary)) + { + writer.WriteAttributeString("Category", "Binary"); + } + if ((this.categoryField == CategoryType.customSource)) + { + writer.WriteAttributeString("Category", "customSource"); + } + if ((this.categoryField == CategoryType.cabinet)) + { + writer.WriteAttributeString("Category", "cabinet"); + } + if ((this.categoryField == CategoryType.shortcut)) + { + writer.WriteAttributeString("Category", "shortcut"); + } + } + if (this.setFieldSet) + { + writer.WriteAttributeString("Set", this.setField); + } + if (this.descriptionFieldSet) + { + writer.WriteAttributeString("Description", this.descriptionField); + } + if (this.modularizeFieldSet) + { + if ((this.modularizeField == ModularizeType.None)) + { + writer.WriteAttributeString("Modularize", "None"); + } + if ((this.modularizeField == ModularizeType.Column)) + { + writer.WriteAttributeString("Modularize", "Column"); + } + if ((this.modularizeField == ModularizeType.Condition)) + { + writer.WriteAttributeString("Modularize", "Condition"); + } + if ((this.modularizeField == ModularizeType.Icon)) + { + writer.WriteAttributeString("Modularize", "Icon"); + } + if ((this.modularizeField == ModularizeType.Property)) + { + writer.WriteAttributeString("Modularize", "Property"); + } + if ((this.modularizeField == ModularizeType.SemicolonDelimited)) + { + writer.WriteAttributeString("Modularize", "SemicolonDelimited"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("PrimaryKey" == name)) + { + this.primaryKeyField = Enums.ParseYesNoType(value); + this.primaryKeyFieldSet = true; + } + if (("Type" == name)) + { + this.typeField = Column.ParseTypeType(value); + this.typeFieldSet = true; + } + if (("Width" == name)) + { + this.widthField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.widthFieldSet = true; + } + if (("Nullable" == name)) + { + this.nullableField = Enums.ParseYesNoType(value); + this.nullableFieldSet = true; + } + if (("Localizable" == name)) + { + this.localizableField = Enums.ParseYesNoType(value); + this.localizableFieldSet = true; + } + if (("MinValue" == name)) + { + this.minValueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.minValueFieldSet = true; + } + if (("MaxValue" == name)) + { + this.maxValueField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.maxValueFieldSet = true; + } + if (("KeyTable" == name)) + { + this.keyTableField = value; + this.keyTableFieldSet = true; + } + if (("KeyColumn" == name)) + { + this.keyColumnField = Convert.ToInt32(value, CultureInfo.InvariantCulture); + this.keyColumnFieldSet = true; + } + if (("Category" == name)) + { + this.categoryField = Column.ParseCategoryType(value); + this.categoryFieldSet = true; + } + if (("Set" == name)) + { + this.setField = value; + this.setFieldSet = true; + } + if (("Description" == name)) + { + this.descriptionField = value; + this.descriptionFieldSet = true; + } + if (("Modularize" == name)) + { + this.modularizeField = Column.ParseModularizeType(value); + this.modularizeFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum TypeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Column contains a path to a file that will be inserted into the column as a binary object. + /// If this value is set, the Category attribute must also be set with a value of 'Binary' to pass ICE validation. + /// + binary, + + /// + /// Column contains an integer or datetime value (the MinValue and MaxValue attributes should also be set). + /// + @int, + + /// + /// Column contains a non-localizable string value. + /// + @string, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum CategoryType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + text, + + upperCase, + + lowerCase, + + integer, + + doubleInteger, + + timeDate, + + identifier, + + property, + + filename, + + wildCardFilename, + + path, + + paths, + + anyPath, + + defaultDir, + + regPath, + + formatted, + + formattedSddl, + + template, + + condition, + + guid, + + version, + + language, + + binary, + + customSource, + + cabinet, + + shortcut, + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ModularizeType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// Column should not be modularized. This is the default value. + /// + None, + + /// + /// Column should be modularized. + /// + Column, + + /// + /// Column is a condition and should be modularized. + /// + Condition, + + /// + /// When the column is an primary or foreign key to the Icon table it should be modularized special. + /// + Icon, + + /// + /// Any Properties in the column should be modularized. + /// + Property, + + /// + /// Semi-colon list of keys, all of which need to be modularized. + /// + SemicolonDelimited, + } + } + + /// + /// Row data for a Custom Table + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Row : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private ISchemaElement parentElement; + + public Row() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Sequence); + childCollection0.AddItem(new ElementCollection.SequenceItem(typeof(Data))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Data" == childName)) + { + childValue = new Data(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Row", "http://wixtoolset.org/schemas/v4/wxs"); + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + } + } + + /// + /// Used for a Custom Table. Specifies the data for the parent Row and specified Column. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Data : ISchemaElement, ISetAttributes + { + + private string columnField; + + private bool columnFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies in which column to insert this data. + /// + public string Column + { + get + { + return this.columnField; + } + set + { + this.columnFieldSet = true; + this.columnField = value; + } + } + + /// + /// A data value + /// + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Data", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.columnFieldSet) + { + writer.WriteAttributeString("Column", this.columnField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Column" == name)) + { + this.columnField = value; + this.columnFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } + + /// + /// Use this element to ensure that a table appears in the installer database, even if its empty. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class EnsureTable : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the table. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("EnsureTable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + } + } + + /// + /// This element exposes advanced WiX functionality. Use this element to declare WiX variables + /// from directly within your authoring. WiX variables are not resolved until the final msi/msm/pcp + /// file is actually generated. WiX variables do not persist into the msi/msm/pcp file, so they cannot + /// be used when an MSI file is being installed; it's a WiX-only concept. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class WixVariable : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private YesNoType overridableField; + + private bool overridableFieldSet; + + private string valueField; + + private bool valueFieldSet; + + private ISchemaElement parentElement; + + /// + /// The name of the variable. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// Set this value to 'yes' in order to make the variable's value overridable either by + /// another WixVariable entry or via the command-line option -d<name>=<value> + /// for light.exe. If the same variable is declared overridable in multiple places it + /// will cause an error (since WiX won't know which value is correct). The default value + /// is 'no'. + /// + public YesNoType Overridable + { + get + { + return this.overridableField; + } + set + { + this.overridableFieldSet = true; + this.overridableField = value; + } + } + + /// + /// The value of the variable. The value cannot be an empty string because that would + /// make it possible to accidentally set a column to null. + /// + public string Value + { + get + { + return this.valueField; + } + set + { + this.valueFieldSet = true; + this.valueField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("WixVariable", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.overridableFieldSet) + { + if ((this.overridableField == YesNoType.no)) + { + writer.WriteAttributeString("Overridable", "no"); + } + if ((this.overridableField == YesNoType.yes)) + { + writer.WriteAttributeString("Overridable", "yes"); + } + } + if (this.valueFieldSet) + { + writer.WriteAttributeString("Value", this.valueField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("Overridable" == name)) + { + this.overridableField = Enums.ParseYesNoType(value); + this.overridableFieldSet = true; + } + if (("Value" == name)) + { + this.valueField = value; + this.valueFieldSet = true; + } + } + } + + /// + /// Use this element to contain definitions for instance transforms. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class InstanceTransforms : IParentElement, ICreateChildren, ISchemaElement, ISetAttributes + { + + private ElementCollection children; + + private string propertyField; + + private bool propertyFieldSet; + + private ISchemaElement parentElement; + + public InstanceTransforms() + { + ElementCollection childCollection0 = new ElementCollection(ElementCollection.CollectionType.Choice); + childCollection0.AddItem(new ElementCollection.ChoiceItem(typeof(Instance))); + this.children = childCollection0; + } + + public virtual IEnumerable Children + { + get + { + return this.children; + } + } + + [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] + public virtual IEnumerable this[System.Type childType] + { + get + { + return this.children.Filter(childType); + } + } + + /// + /// The Id of the Property who's value should change for each instance. + /// + public string Property + { + get + { + return this.propertyField; + } + set + { + this.propertyFieldSet = true; + this.propertyField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + public virtual void AddChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.AddElement(child); + child.ParentElement = this; + } + + public virtual void RemoveChild(ISchemaElement child) + { + if ((null == child)) + { + throw new ArgumentNullException("child"); + } + this.children.RemoveElement(child); + child.ParentElement = null; + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + ISchemaElement ICreateChildren.CreateChild(string childName) + { + if (String.IsNullOrEmpty(childName)) + { + throw new ArgumentNullException("childName"); + } + ISchemaElement childValue = null; + if (("Instance" == childName)) + { + childValue = new Instance(); + } + if ((null == childValue)) + { + throw new InvalidOperationException(String.Concat(childName, " is not a valid child name.")); + } + return childValue; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("InstanceTransforms", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.propertyFieldSet) + { + writer.WriteAttributeString("Property", this.propertyField); + } + for (IEnumerator enumerator = this.children.GetEnumerator(); enumerator.MoveNext(); ) + { + ISchemaElement childElement = ((ISchemaElement)(enumerator.Current)); + childElement.OutputXml(writer); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Property" == name)) + { + this.propertyField = value; + this.propertyFieldSet = true; + } + } + } + + /// + /// Defines an instance transform for your product. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class Instance : ISchemaElement, ISetAttributes + { + + private string idField; + + private bool idFieldSet; + + private string productCodeField; + + private bool productCodeFieldSet; + + private string productNameField; + + private bool productNameFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private ISchemaElement parentElement; + + /// + /// The identity of the instance transform. This value will define the name by which the instance + /// should be referred to on the command line. In addition, the value of the this attribute will + /// determine what the value of the property specified in Property attribute on InstanceTransforms + /// will change to for each instance. + /// + public string Id + { + get + { + return this.idField; + } + set + { + this.idFieldSet = true; + this.idField = value; + } + } + + /// + /// The ProductCode for this instance. + /// + public string ProductCode + { + get + { + return this.productCodeField; + } + set + { + this.productCodeFieldSet = true; + this.productCodeField = value; + } + } + + /// + /// The ProductName for this instance. + /// + public string ProductName + { + get + { + return this.productNameField; + } + set + { + this.productNameFieldSet = true; + this.productNameField = value; + } + } + + /// + /// The UpgradeCode for this instance. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("Instance", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.idFieldSet) + { + writer.WriteAttributeString("Id", this.idField); + } + if (this.productCodeFieldSet) + { + writer.WriteAttributeString("ProductCode", this.productCodeField); + } + if (this.productNameFieldSet) + { + writer.WriteAttributeString("ProductName", this.productNameField); + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Id" == name)) + { + this.idField = value; + this.idFieldSet = true; + } + if (("ProductCode" == name)) + { + this.productCodeField = value; + this.productCodeFieldSet = true; + } + if (("ProductName" == name)) + { + this.productNameField = value; + this.productNameFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + } + } + + /// + /// Simplifies authoring for major upgrades, including support for preventing downgrades. + /// + /// The parent Package element must have valid UpgradeCode and Version attributes. + /// + /// When the FindRelatedProducts action detects a related product installed on the system, + /// it appends the product code to the property named WIX_UPGRADE_DETECTED. After the + /// FindRelatedProducts action is run, the value of the WIX_UPGRADE_DETECTED property is a + /// list of product codes, separated by semicolons (;), detected on the system. + /// + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class MajorUpgrade : ISchemaElement, ISetAttributes + { + + private YesNoType allowDowngradesField; + + private bool allowDowngradesFieldSet; + + private YesNoType allowSameVersionUpgradesField; + + private bool allowSameVersionUpgradesFieldSet; + + private YesNoType disallowField; + + private bool disallowFieldSet; + + private string downgradeErrorMessageField; + + private bool downgradeErrorMessageFieldSet; + + private string disallowUpgradeErrorMessageField; + + private bool disallowUpgradeErrorMessageFieldSet; + + private YesNoType migrateFeaturesField; + + private bool migrateFeaturesFieldSet; + + private YesNoType ignoreLanguageField; + + private bool ignoreLanguageFieldSet; + + private YesNoType ignoreRemoveFailureField; + + private bool ignoreRemoveFailureFieldSet; + + private string removeFeaturesField; + + private bool removeFeaturesFieldSet; + + private ScheduleType scheduleField; + + private bool scheduleFieldSet; + + private ISchemaElement parentElement; + + /// + /// When set to no (the default), products with lower version numbers are blocked from + /// installing when a product with a higher version is installed; the DowngradeErrorMessage + /// attribute must also be specified. + /// + /// When set to yes, any version can be installed over any other version. + /// + public YesNoType AllowDowngrades + { + get + { + return this.allowDowngradesField; + } + set + { + this.allowDowngradesFieldSet = true; + this.allowDowngradesField = value; + } + } + + /// + /// When set to no (the default), installing a product with the same version and upgrade code + /// (but different product code) is allowed and treated by MSI as two products. When set to yes, + /// WiX sets the msidbUpgradeAttributesVersionMaxInclusive attribute, which tells MSI to treat + /// a product with the same version as a major upgrade. + /// + /// This is useful when two product versions differ only in the fourth version field. MSI + /// specifically ignores that field when comparing product versions, so two products that + /// differ only in the fourth version field are the same product and need this attribute set to + /// yes to be detected. + /// + /// Note that because MSI ignores the fourth product version field, setting this attribute to + /// yes also allows downgrades when the first three product version fields are identical. + /// For example, product version 1.0.0.1 will "upgrade" 1.0.0.2998 because they're seen as the + /// same version (1.0.0). That could reintroduce serious bugs so the safest choice is to change + /// the first three version fields and omit this attribute to get the default of no. + /// + /// This attribute cannot be "yes" when AllowDowngrades is also "yes" -- AllowDowngrades + /// already allows two products with the same version number to upgrade each other. + /// + public YesNoType AllowSameVersionUpgrades + { + get + { + return this.allowSameVersionUpgradesField; + } + set + { + this.allowSameVersionUpgradesFieldSet = true; + this.allowSameVersionUpgradesField = value; + } + } + + /// + /// When set to yes, products with higer version numbers are blocked from + /// installing when a product with a lower version is installed; the UpgradeErrorMessage + /// attribute must also be specified. + /// + /// When set to no (the default), any version can be installed over any lower version. + /// + public YesNoType Disallow + { + get + { + return this.disallowField; + } + set + { + this.disallowFieldSet = true; + this.disallowField = value; + } + } + + /// + /// The message displayed if users try to install a product with a lower version number + /// when a product with a higher version is installed. Used only when AllowDowngrades + /// is no (the default). + /// + public string DowngradeErrorMessage + { + get + { + return this.downgradeErrorMessageField; + } + set + { + this.downgradeErrorMessageFieldSet = true; + this.downgradeErrorMessageField = value; + } + } + + /// + /// The message displayed if users try to install a product with a higer version number + /// when a product with a lower version is installed. Used only when Disallow + /// is yes. + /// + public string DisallowUpgradeErrorMessage + { + get + { + return this.disallowUpgradeErrorMessageField; + } + set + { + this.disallowUpgradeErrorMessageFieldSet = true; + this.disallowUpgradeErrorMessageField = value; + } + } + + /// + /// When set to yes (the default), the MigrateFeatureStates standard action will set the + /// feature states of the upgrade product to those of the installed product. + /// + /// When set to no, the installed features have no effect on the upgrade installation. + /// + public YesNoType MigrateFeatures + { + get + { + return this.migrateFeaturesField; + } + set + { + this.migrateFeaturesFieldSet = true; + this.migrateFeaturesField = value; + } + } + + /// + /// When set to yes, the Upgrade table rows will match any product with the same UpgradeCode. + /// + /// When set to no (the default), the Upgrade table rows will match only products with the + /// same UpgradeCode and ProductLanguage. + /// + public YesNoType IgnoreLanguage + { + get + { + return this.ignoreLanguageField; + } + set + { + this.ignoreLanguageFieldSet = true; + this.ignoreLanguageField = value; + } + } + + /// + /// When set to yes, failures removing the installed product during the upgrade will be + /// ignored. + /// + /// When set to no (the default), failures removing the installed product during the upgrade + /// will be considered a failure and, depending on the scheduling, roll back the upgrade. + /// + public YesNoType IgnoreRemoveFailure + { + get + { + return this.ignoreRemoveFailureField; + } + set + { + this.ignoreRemoveFailureFieldSet = true; + this.ignoreRemoveFailureField = value; + } + } + + /// + /// A formatted string that contains the list of features to remove from the installed + /// product. The default is to remove all features. Note that if you use formatted property + /// values that evaluate to an empty string, no features will be removed; only omitting + /// this attribute defaults to removing all features. + /// + public string RemoveFeatures + { + get + { + return this.removeFeaturesField; + } + set + { + this.removeFeaturesFieldSet = true; + this.removeFeaturesField = value; + } + } + + /// + /// Determines the scheduling of the RemoveExistingProducts standard action, which is when + /// the installed product is removed. The default is "afterInstallValidate" which removes + /// the installed product entirely before installing the upgrade product. It's slowest but + /// gives the most flexibility in changing components and features in the upgrade product. + /// + /// For more information, see + /// + public ScheduleType Schedule + { + get + { + return this.scheduleField; + } + set + { + this.scheduleFieldSet = true; + this.scheduleField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Parses a ScheduleType from a string. + /// + public static ScheduleType ParseScheduleType(string value) + { + ScheduleType parsedValue; + MajorUpgrade.TryParseScheduleType(value, out parsedValue); + return parsedValue; + } + + /// + /// Tries to parse a ScheduleType from a string. + /// + public static bool TryParseScheduleType(string value, out ScheduleType parsedValue) + { + parsedValue = ScheduleType.NotSet; + if (string.IsNullOrEmpty(value)) + { + return false; + } + if (("afterInstallValidate" == value)) + { + parsedValue = ScheduleType.afterInstallValidate; + } + else + { + if (("afterInstallInitialize" == value)) + { + parsedValue = ScheduleType.afterInstallInitialize; + } + else + { + if (("afterInstallExecute" == value)) + { + parsedValue = ScheduleType.afterInstallExecute; + } + else + { + if (("afterInstallExecuteAgain" == value)) + { + parsedValue = ScheduleType.afterInstallExecuteAgain; + } + else + { + if (("afterInstallFinalize" == value)) + { + parsedValue = ScheduleType.afterInstallFinalize; + } + else + { + parsedValue = ScheduleType.IllegalValue; + return false; + } + } + } + } + } + return true; + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("MajorUpgrade", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.allowDowngradesFieldSet) + { + if ((this.allowDowngradesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowDowngrades", "no"); + } + if ((this.allowDowngradesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowDowngrades", "yes"); + } + } + if (this.allowSameVersionUpgradesFieldSet) + { + if ((this.allowSameVersionUpgradesField == YesNoType.no)) + { + writer.WriteAttributeString("AllowSameVersionUpgrades", "no"); + } + if ((this.allowSameVersionUpgradesField == YesNoType.yes)) + { + writer.WriteAttributeString("AllowSameVersionUpgrades", "yes"); + } + } + if (this.disallowFieldSet) + { + if ((this.disallowField == YesNoType.no)) + { + writer.WriteAttributeString("Disallow", "no"); + } + if ((this.disallowField == YesNoType.yes)) + { + writer.WriteAttributeString("Disallow", "yes"); + } + } + if (this.downgradeErrorMessageFieldSet) + { + writer.WriteAttributeString("DowngradeErrorMessage", this.downgradeErrorMessageField); + } + if (this.disallowUpgradeErrorMessageFieldSet) + { + writer.WriteAttributeString("DisallowUpgradeErrorMessage", this.disallowUpgradeErrorMessageField); + } + if (this.migrateFeaturesFieldSet) + { + if ((this.migrateFeaturesField == YesNoType.no)) + { + writer.WriteAttributeString("MigrateFeatures", "no"); + } + if ((this.migrateFeaturesField == YesNoType.yes)) + { + writer.WriteAttributeString("MigrateFeatures", "yes"); + } + } + if (this.ignoreLanguageFieldSet) + { + if ((this.ignoreLanguageField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreLanguage", "no"); + } + if ((this.ignoreLanguageField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreLanguage", "yes"); + } + } + if (this.ignoreRemoveFailureFieldSet) + { + if ((this.ignoreRemoveFailureField == YesNoType.no)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "no"); + } + if ((this.ignoreRemoveFailureField == YesNoType.yes)) + { + writer.WriteAttributeString("IgnoreRemoveFailure", "yes"); + } + } + if (this.removeFeaturesFieldSet) + { + writer.WriteAttributeString("RemoveFeatures", this.removeFeaturesField); + } + if (this.scheduleFieldSet) + { + if ((this.scheduleField == ScheduleType.afterInstallValidate)) + { + writer.WriteAttributeString("Schedule", "afterInstallValidate"); + } + if ((this.scheduleField == ScheduleType.afterInstallInitialize)) + { + writer.WriteAttributeString("Schedule", "afterInstallInitialize"); + } + if ((this.scheduleField == ScheduleType.afterInstallExecute)) + { + writer.WriteAttributeString("Schedule", "afterInstallExecute"); + } + if ((this.scheduleField == ScheduleType.afterInstallExecuteAgain)) + { + writer.WriteAttributeString("Schedule", "afterInstallExecuteAgain"); + } + if ((this.scheduleField == ScheduleType.afterInstallFinalize)) + { + writer.WriteAttributeString("Schedule", "afterInstallFinalize"); + } + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("AllowDowngrades" == name)) + { + this.allowDowngradesField = Enums.ParseYesNoType(value); + this.allowDowngradesFieldSet = true; + } + if (("AllowSameVersionUpgrades" == name)) + { + this.allowSameVersionUpgradesField = Enums.ParseYesNoType(value); + this.allowSameVersionUpgradesFieldSet = true; + } + if (("Disallow" == name)) + { + this.disallowField = Enums.ParseYesNoType(value); + this.disallowFieldSet = true; + } + if (("DowngradeErrorMessage" == name)) + { + this.downgradeErrorMessageField = value; + this.downgradeErrorMessageFieldSet = true; + } + if (("DisallowUpgradeErrorMessage" == name)) + { + this.disallowUpgradeErrorMessageField = value; + this.disallowUpgradeErrorMessageFieldSet = true; + } + if (("MigrateFeatures" == name)) + { + this.migrateFeaturesField = Enums.ParseYesNoType(value); + this.migrateFeaturesFieldSet = true; + } + if (("IgnoreLanguage" == name)) + { + this.ignoreLanguageField = Enums.ParseYesNoType(value); + this.ignoreLanguageFieldSet = true; + } + if (("IgnoreRemoveFailure" == name)) + { + this.ignoreRemoveFailureField = Enums.ParseYesNoType(value); + this.ignoreRemoveFailureFieldSet = true; + } + if (("RemoveFeatures" == name)) + { + this.removeFeaturesField = value; + this.removeFeaturesFieldSet = true; + } + if (("Schedule" == name)) + { + this.scheduleField = MajorUpgrade.ParseScheduleType(value); + this.scheduleFieldSet = true; + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public enum ScheduleType + { + + IllegalValue = int.MaxValue, + + NotSet = -1, + + /// + /// (Default) Schedules RemoveExistingProducts after the InstallValidate standard + /// action. This scheduling removes the installed product entirely before installing + /// the upgrade product. It's slowest but gives the most flexibility in changing + /// components and features in the upgrade product. Note that if the installation + /// of the upgrade product fails, the machine will have neither version installed. + /// + afterInstallValidate, + + /// + /// Schedules RemoveExistingProducts after the InstallInitialize standard action. + /// This is similar to the afterInstallValidate scheduling, but if the installation + /// of the upgrade product fails, Windows Installer also rolls back the removal of + /// the installed product -- in other words, reinstalls it. + /// + afterInstallInitialize, + + /// + /// Schedules RemoveExistingProducts between the InstallExecute and InstallFinalize standard actions. + /// This scheduling installs the upgrade product "on top of" the installed product then lets + /// RemoveExistingProducts uninstall any components that don't also exist in the upgrade product. + /// Note that this scheduling requires strict adherence to the component rules because it relies + /// on component reference counts to be accurate during installation of the upgrade product and + /// removal of the installed product. For more information, see + /// + afterInstallExecute, + + /// + /// Schedules RemoveExistingProducts between the InstallExecuteAgain and InstallFinalize standard actions. + /// This is identical to the afterInstallExecute scheduling but after the InstallExecuteAgain standard + /// action instead of InstallExecute. + /// + afterInstallExecuteAgain, + + /// + /// Schedules RemoveExistingProducts after the InstallFinalize standard action. This is similar to the + /// afterInstallExecute and afterInstallExecuteAgain schedulings but takes place outside the + /// installation transaction so if installation of the upgrade product fails, Windows Installer does + /// not roll back the removal of the installed product, so the machine will have both versions + /// installed. + /// + afterInstallFinalize, + } + } + + [GeneratedCode("WixBuildTools.XsdGen", "4.0.0.0")] + public class ProductSearch : ISchemaElement, ISetAttributes + { + + private string minimumField; + + private bool minimumFieldSet; + + private string maximumField; + + private bool maximumFieldSet; + + private string languageField; + + private bool languageFieldSet; + + private YesNoType includeMinimumField; + + private bool includeMinimumFieldSet; + + private YesNoType includeMaximumField; + + private bool includeMaximumFieldSet; + + private YesNoType excludeLanguagesField; + + private bool excludeLanguagesFieldSet; + + private string upgradeCodeField; + + private bool upgradeCodeFieldSet; + + private string contentField; + + private bool contentFieldSet; + + private ISchemaElement parentElement; + + /// + /// Specifies the lower bound on the range of product versions to be detected by FindRelatedProducts. + /// + public string Minimum + { + get + { + return this.minimumField; + } + set + { + this.minimumFieldSet = true; + this.minimumField = value; + } + } + + /// + /// Specifies the upper boundary of the range of product versions detected by FindRelatedProducts. + /// + public string Maximum + { + get + { + return this.maximumField; + } + set + { + this.maximumFieldSet = true; + this.maximumField = value; + } + } + + /// + /// Specifies the set of languages detected by FindRelatedProducts. Enter a list of numeric language identifiers (LANGID) separated by commas (,). Leave this value null to specify all languages. Set ExcludeLanguages to "yes" in order detect all languages, excluding the languages listed in this value. + /// + public string Language + { + get + { + return this.languageField; + } + set + { + this.languageFieldSet = true; + this.languageField = value; + } + } + + /// + /// Set to "no" to make the range of versions detected exclude the value specified in Minimum. This attribute is "yes" by default. + /// + public YesNoType IncludeMinimum + { + get + { + return this.includeMinimumField; + } + set + { + this.includeMinimumFieldSet = true; + this.includeMinimumField = value; + } + } + + /// + /// Set to "yes" to make the range of versions detected include the value specified in Maximum. + /// + public YesNoType IncludeMaximum + { + get + { + return this.includeMaximumField; + } + set + { + this.includeMaximumFieldSet = true; + this.includeMaximumField = value; + } + } + + /// + /// Set to "yes" to detect all languages, excluding the languages listed in the Language attribute. + /// + public YesNoType ExcludeLanguages + { + get + { + return this.excludeLanguagesField; + } + set + { + this.excludeLanguagesFieldSet = true; + this.excludeLanguagesField = value; + } + } + + /// + /// This value specifies the upgrade code for the products that are to be detected by the FindRelatedProducts action. + /// + public string UpgradeCode + { + get + { + return this.upgradeCodeField; + } + set + { + this.upgradeCodeFieldSet = true; + this.upgradeCodeField = value; + } + } + + public string Content + { + get + { + return this.contentField; + } + set + { + this.contentFieldSet = true; + this.contentField = value; + } + } + + public virtual ISchemaElement ParentElement + { + get + { + return this.parentElement; + } + set + { + this.parentElement = value; + } + } + + /// + /// Processes this element and all child elements into an XmlWriter. + /// + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + public virtual void OutputXml(XmlWriter writer) + { + if ((null == writer)) + { + throw new ArgumentNullException("writer"); + } + writer.WriteStartElement("ProductSearch", "http://wixtoolset.org/schemas/v4/wxs"); + if (this.minimumFieldSet) + { + writer.WriteAttributeString("Minimum", this.minimumField); + } + if (this.maximumFieldSet) + { + writer.WriteAttributeString("Maximum", this.maximumField); + } + if (this.languageFieldSet) + { + writer.WriteAttributeString("Language", this.languageField); + } + if (this.includeMinimumFieldSet) + { + if ((this.includeMinimumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMinimum", "no"); + } + if ((this.includeMinimumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMinimum", "yes"); + } + } + if (this.includeMaximumFieldSet) + { + if ((this.includeMaximumField == YesNoType.no)) + { + writer.WriteAttributeString("IncludeMaximum", "no"); + } + if ((this.includeMaximumField == YesNoType.yes)) + { + writer.WriteAttributeString("IncludeMaximum", "yes"); + } + } + if (this.excludeLanguagesFieldSet) + { + if ((this.excludeLanguagesField == YesNoType.no)) + { + writer.WriteAttributeString("ExcludeLanguages", "no"); + } + if ((this.excludeLanguagesField == YesNoType.yes)) + { + writer.WriteAttributeString("ExcludeLanguages", "yes"); + } + } + if (this.upgradeCodeFieldSet) + { + writer.WriteAttributeString("UpgradeCode", this.upgradeCodeField); + } + if (this.contentFieldSet) + { + writer.WriteString(this.contentField); + } + writer.WriteEndElement(); + } + + [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + void ISetAttributes.SetAttribute(string name, string value) + { + if (String.IsNullOrEmpty(name)) + { + throw new ArgumentNullException("name"); + } + if (("Minimum" == name)) + { + this.minimumField = value; + this.minimumFieldSet = true; + } + if (("Maximum" == name)) + { + this.maximumField = value; + this.maximumFieldSet = true; + } + if (("Language" == name)) + { + this.languageField = value; + this.languageFieldSet = true; + } + if (("IncludeMinimum" == name)) + { + this.includeMinimumField = Enums.ParseYesNoType(value); + this.includeMinimumFieldSet = true; + } + if (("IncludeMaximum" == name)) + { + this.includeMaximumField = Enums.ParseYesNoType(value); + this.includeMaximumFieldSet = true; + } + if (("ExcludeLanguages" == name)) + { + this.excludeLanguagesField = Enums.ParseYesNoType(value); + this.excludeLanguagesFieldSet = true; + } + if (("UpgradeCode" == name)) + { + this.upgradeCodeField = value; + this.upgradeCodeFieldSet = true; + } + if (("Content" == name)) + { + this.contentField = value; + this.contentFieldSet = true; + } + } + } +} diff --git a/src/wix/heat/TypeLibraryHarvester.cs b/src/wix/heat/TypeLibraryHarvester.cs new file mode 100644 index 00000000..4a271a35 --- /dev/null +++ b/src/wix/heat/TypeLibraryHarvester.cs @@ -0,0 +1,93 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Globalization; + using System.Runtime.InteropServices; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring from a type library file. + /// + internal class TypeLibraryHarvester + { + /// + /// Harvest the registry values written by RegisterTypeLib. + /// + /// The file to harvest registry values from. + /// The harvested registry values. + public Wix.RegistryValue[] HarvestRegistryValues(string path) + { + using (RegistryHarvester registryHarvester = new RegistryHarvester(true)) + { + NativeMethods.RegisterTypeLibrary(path); + + return registryHarvester.HarvestRegistry(); + } + } + + /// + /// Parses a hexadecimal version string into a Version object. + /// + /// Hexadecimal version string, for example "1.A.3C.F241" + /// Version object, or null if versionString is not a valid hex version. + public static Version ParseHexVersion(string versionString) + { + if (String.IsNullOrEmpty(versionString)) + { + return null; + } + + int[] versionNumbers = new int[4]; + string[] versionNumberStrings = versionString.Split('.'); + + for (int i = 0; i < versionNumbers.Length && i < versionNumberStrings.Length; i++) + { + if (!Int32.TryParse(versionNumberStrings[i], NumberStyles.HexNumber, CultureInfo.InvariantCulture, out versionNumbers[i])) + { + return null; + } + } + + return new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]); + } + + /// + /// Native methods for registering type libraries. + /// + private sealed class NativeMethods + { + /// + /// Registers a type library. + /// + /// The type library file to register. + internal static void RegisterTypeLibrary(string typeLibraryFile) + { + IntPtr ptlib; + + LoadTypeLib(typeLibraryFile, out ptlib); + + RegisterTypeLib(ptlib, typeLibraryFile, null); + } + + /// + /// Loads and registers a type library. + /// + /// Contains the name of the file from which LoadTypeLib should attempt to load a type library. + /// On return, contains a pointer to a pointer to the loaded type library. + /// LoadTypeLib will not register the type library if the path of the type library is specified. + [DllImport("oleaut32.dll", PreserveSig = false)] + private static extern void LoadTypeLib([MarshalAs(UnmanagedType.BStr)] string szFile, out IntPtr pptlib); + + /// + /// Adds information about a type library to the system registry. + /// + /// Pointer to the type library being registered. + /// Fully qualified path specification for the type library being registered. + /// Directory in which the Help file for the library being registered can be found. Can be Null. + [DllImport("oleaut32.dll", PreserveSig = false)] + private static extern void RegisterTypeLib(IntPtr ptlib, [MarshalAs(UnmanagedType.BStr)] string szFullPath, [MarshalAs(UnmanagedType.BStr)] string szHelpDir); + } + } +} diff --git a/src/wix/heat/UtilFinalizeHarvesterMutator.cs b/src/wix/heat/UtilFinalizeHarvesterMutator.cs new file mode 100644 index 00000000..3e9f1ce7 --- /dev/null +++ b/src/wix/heat/UtilFinalizeHarvesterMutator.cs @@ -0,0 +1,1185 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Collections.Specialized; + using System.Globalization; + using System.IO; + using System.Runtime.InteropServices; + using System.Text; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The finalize harvester mutator for the WiX Toolset Utility Extension. + /// + internal class UtilFinalizeHarvesterMutator : BaseMutatorExtension + { + private ArrayList components; + private ArrayList directories; + private SortedList directoryPaths; + private Hashtable filePaths; + private ArrayList files; + private ArrayList registryValues; + private bool suppressCOMElements; + private bool suppressVB6COMElements; + private string preprocessorVariable; + + /// + /// Instantiate a new UtilFinalizeHarvesterMutator. + /// + public UtilFinalizeHarvesterMutator() + { + this.components = new ArrayList(); + this.directories = new ArrayList(); + this.directoryPaths = new SortedList(); + this.filePaths = new Hashtable(); + this.files = new ArrayList(); + this.registryValues = new ArrayList(); + } + + /// + /// Gets or sets the preprocessor variable for substitution. + /// + /// The preprocessor variable for substitution. + public string PreprocessorVariable + { + get { return this.preprocessorVariable; } + set { this.preprocessorVariable = value; } + } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public override int Sequence + { + get { return 2000; } + } + + /// + /// Gets or sets the option to suppress COM elements. + /// + /// The option to suppress COM elements. + public bool SuppressCOMElements + { + get { return this.suppressCOMElements; } + set { this.suppressCOMElements = value; } + } + + /// + /// Gets or sets the option to suppress VB6 COM elements. + /// + /// The option to suppress VB6 COM elements. + public bool SuppressVB6COMElements + { + get { return this.suppressVB6COMElements; } + set { this.suppressVB6COMElements = value; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.components.Clear(); + this.directories.Clear(); + this.directoryPaths.Clear(); + this.filePaths.Clear(); + this.files.Clear(); + this.registryValues.Clear(); + + // index elements in this wix document + this.IndexElement(wix); + + this.MutateDirectories(); + this.MutateFiles(); + this.MutateRegistryValues(); + + // must occur after all the registry values have been formatted + this.MutateComponents(); + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is Wix.Component) + { + // Component elements only need to be indexed if COM registry values will be strongly typed + if (!this.suppressCOMElements) + { + this.components.Add(element); + } + } + else if (element is Wix.Directory) + { + this.directories.Add(element); + } + else if (element is Wix.File) + { + this.files.Add(element); + } + else if (element is Wix.RegistryValue) + { + this.registryValues.Add(element); + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the components. + /// + private void MutateComponents() + { + if (this.suppressVB6COMElements) + { + // Search for VB6 specific COM registrations + foreach (Wix.Component component in this.components) + { + ArrayList vb6RegistryValues = new ArrayList(); + + foreach (Wix.RegistryValue registryValue in component[typeof(Wix.RegistryValue)]) + { + if (Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root) + { + string[] parts = registryValue.Key.Split('\\'); + + if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 CLSID {D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731}", StringComparison.OrdinalIgnoreCase)) + { + if (!vb6RegistryValues.Contains(registryValue)) + { + vb6RegistryValues.Add(registryValue); + } + } + } + } + else if (String.Equals(parts[0], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(parts[1], "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + if (!vb6RegistryValues.Contains(registryValue)) + { + vb6RegistryValues.Add(registryValue); + } + } + } + } + else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + // Search for any Interfaces that reference the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (3 <= parts.Length) + { + if (String.Equals(parts[2], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + if (String.Equals(registryValue.Value, "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(registryValue.Value, "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + // Having found a match we have to loop through again finding the matching Interface entries + foreach (Wix.RegistryValue regValue in component[typeof(Wix.RegistryValue)]) + { + if (Wix.RegistryValue.ActionType.write == regValue.Action && Wix.RegistryRootType.HKCR == regValue.Root) + { + string[] rvparts = regValue.Key.Split('\\'); + if (String.Equals(rvparts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + if (2 <= rvparts.Length) + { + if (String.Equals(rvparts[1], parts[1], StringComparison.OrdinalIgnoreCase)) + { + if (!vb6RegistryValues.Contains(regValue)) + { + vb6RegistryValues.Add(regValue); + } + } + } + } + } + } + } + } + } + } + } + } + + // Remove all the VB6 specific COM registry values + foreach (Object entry in vb6RegistryValues) + { + component.RemoveChild((Wix.RegistryValue)entry); + } + } + } + + foreach (Wix.Component component in this.components) + { + SortedList indexedElements = CollectionsUtil.CreateCaseInsensitiveSortedList(); + SortedList indexedRegistryValues = CollectionsUtil.CreateCaseInsensitiveSortedList(); + List duplicateRegistryValues = new List(); + + // index all the File elements + foreach (Wix.File file in component[typeof(Wix.File)]) + { + indexedElements.Add(String.Concat("file/", file.Id), file); + } + + // group all the registry values by the COM element they would correspond to and + // create a COM element for each group + foreach (Wix.RegistryValue registryValue in component[typeof(Wix.RegistryValue)]) + { + if (!String.IsNullOrEmpty(registryValue.Key) && Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root && Wix.RegistryValue.TypeType.@string == registryValue.Type) + { + string index = null; + string[] parts = registryValue.Key.Split('\\'); + + // create a COM element for COM registration and index it + if (1 <= parts.Length) + { + if (String.Equals(parts[0], "AppID", StringComparison.OrdinalIgnoreCase)) + { + // only work with GUID AppIds here + if (2 <= parts.Length && parts[1].StartsWith("{", StringComparison.Ordinal) && parts[1].EndsWith("}", StringComparison.Ordinal)) + { + index = String.Concat(parts[0], '/', parts[1]); + + if (!indexedElements.Contains(index)) + { + Wix.AppId appId = new Wix.AppId(); + appId.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + indexedElements.Add(index, appId); + } + } + } + else if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + if (2 <= parts.Length) + { + index = String.Concat(parts[0], '/', parts[1]); + + if (!indexedElements.Contains(index)) + { + Wix.Class wixClass = new Wix.Class(); + wixClass.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + indexedElements.Add(index, wixClass); + } + } + } + else if (String.Equals(parts[0], "Component Categories", StringComparison.OrdinalIgnoreCase)) + { + // If this is the .NET Component Category it should not end up in the authoring. Therefore, add + // the registry key to the duplicate list to ensure it gets removed later. + if (String.Equals(parts[1], "{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}", StringComparison.OrdinalIgnoreCase)) + { + duplicateRegistryValues.Add(registryValue); + } + else + { + // TODO: add support for Component Categories to the compiler. + } + } + else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + if (2 <= parts.Length) + { + index = String.Concat(parts[0], '/', parts[1]); + + if (!indexedElements.Contains(index)) + { + Wix.Interface wixInterface = new Wix.Interface(); + wixInterface.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + indexedElements.Add(index, wixInterface); + } + } + } + else if (String.Equals(parts[0], "TypeLib", StringComparison.Ordinal)) + { + if (3 <= parts.Length) + { + // use a special index to ensure progIds are processed before classes + index = String.Concat(".typelib/", parts[1], '/', parts[2]); + + if (!indexedElements.Contains(index)) + { + Version version = TypeLibraryHarvester.ParseHexVersion(parts[2]); + if (version != null) + { + Wix.TypeLib typeLib = new Wix.TypeLib(); + typeLib.Id = parts[1].ToUpper(CultureInfo.InvariantCulture); + typeLib.MajorVersion = version.Major; + typeLib.MinorVersion = version.Minor; + indexedElements.Add(index, typeLib); + } + else // not a valid type library registry value + { + index = null; + } + } + } + } + else if (parts[0].StartsWith(".", StringComparison.Ordinal)) + { + // extension + } + else // ProgId (hopefully) + { + // use a special index to ensure progIds are processed before classes + index = String.Concat(".progid/", parts[0]); + + if (!indexedElements.Contains(index)) + { + Wix.ProgId progId = new Wix.ProgId(); + progId.Id = parts[0]; + indexedElements.Add(index, progId); + } + } + } + + // index the RegistryValue element according to the COM element it corresponds to + if (null != index) + { + SortedList registryValues = (SortedList)indexedRegistryValues[index]; + + if (null == registryValues) + { + registryValues = CollectionsUtil.CreateCaseInsensitiveSortedList(); + indexedRegistryValues.Add(index, registryValues); + } + + try + { + registryValues.Add(String.Concat(registryValue.Key, '/', registryValue.Name), registryValue); + } + catch (ArgumentException) + { + duplicateRegistryValues.Add(registryValue); + + if (String.IsNullOrEmpty(registryValue.Value)) + { + this.Core.Messaging.Write(HarvesterWarnings.DuplicateDllRegistryEntry(String.Concat(registryValue.Key, '/', registryValue.Name), component.Id)); + } + else + { + this.Core.Messaging.Write(HarvesterWarnings.DuplicateDllRegistryEntry(String.Concat(registryValue.Key, '/', registryValue.Name), registryValue.Value, component.Id)); + } + } + } + } + } + + foreach (Wix.RegistryValue removeRegistryEntry in duplicateRegistryValues) + { + component.RemoveChild(removeRegistryEntry); + } + + // set various values on the COM elements from their corresponding registry values + Hashtable indexedProcessedRegistryValues = new Hashtable(); + foreach (DictionaryEntry entry in indexedRegistryValues) + { + Wix.ISchemaElement element = (Wix.ISchemaElement)indexedElements[entry.Key]; + string parentIndex = null; + SortedList registryValues = (SortedList)entry.Value; + + // element-specific variables (for really tough situations) + string classAppId = null; + bool threadingModelSet = false; + + foreach (Wix.RegistryValue registryValue in registryValues.Values) + { + string[] parts = registryValue.Key.ToLower(CultureInfo.InvariantCulture).Split('\\'); + bool processed = false; + + if (element is Wix.AppId) + { + Wix.AppId appId = (Wix.AppId)element; + + if (2 == parts.Length) + { + if (null == registryValue.Name) + { + appId.Description = registryValue.Value; + processed = true; + } + } + } + else if (element is Wix.Class) + { + Wix.Class wixClass = (Wix.Class)element; + + if (2 == parts.Length) + { + if (null == registryValue.Name) + { + wixClass.Description = registryValue.Value; + processed = true; + } + else if (String.Equals(registryValue.Name, "AppID", StringComparison.OrdinalIgnoreCase)) + { + classAppId = registryValue.Value; + processed = true; + } + } + else if (3 == parts.Length) + { + Wix.Class.ContextType contextType = Wix.Class.ContextType.None; + + switch (parts[2]) + { + case "control": + wixClass.Control = Wix.YesNoType.yes; + processed = true; + break; + case "inprochandler": + if (null == registryValue.Name) + { + if (null == wixClass.Handler) + { + wixClass.Handler = "1"; + processed = true; + } + else if ("2" == wixClass.Handler) + { + wixClass.Handler = "3"; + processed = true; + } + } + break; + case "inprochandler32": + if (null == registryValue.Name) + { + if (null == wixClass.Handler) + { + wixClass.Handler = "2"; + processed = true; + } + else if ("1" == wixClass.Handler) + { + wixClass.Handler = "3"; + processed = true; + } + } + break; + case "inprocserver": + contextType = Wix.Class.ContextType.InprocServer; + break; + case "inprocserver32": + contextType = Wix.Class.ContextType.InprocServer32; + break; + case "insertable": + wixClass.Insertable = Wix.YesNoType.yes; + processed = true; + break; + case "localserver": + contextType = Wix.Class.ContextType.LocalServer; + break; + case "localserver32": + contextType = Wix.Class.ContextType.LocalServer32; + break; + case "progid": + if (null == registryValue.Name) + { + Wix.ProgId progId = (Wix.ProgId)indexedElements[String.Concat(".progid/", registryValue.Value)]; + + // verify that the versioned ProgId appears under this Class element + // if not, toss the entire element + if (null == progId || wixClass != progId.ParentElement) + { + element = null; + } + else + { + processed = true; + } + } + break; + case "programmable": + wixClass.Programmable = Wix.YesNoType.yes; + processed = true; + break; + case "typelib": + if (null == registryValue.Name) + { + foreach (DictionaryEntry indexedEntry in indexedElements) + { + string key = (string)indexedEntry.Key; + Wix.ISchemaElement possibleTypeLib = (Wix.ISchemaElement)indexedEntry.Value; + + if (key.StartsWith(".typelib/", StringComparison.Ordinal) && + 0 == String.Compare(key, 9, registryValue.Value, 0, registryValue.Value.Length, StringComparison.OrdinalIgnoreCase)) + { + // ensure the TypeLib is nested under the same thing we want the Class under + if (null == parentIndex || indexedElements[parentIndex] == possibleTypeLib.ParentElement) + { + parentIndex = key; + processed = true; + } + } + } + } + break; + case "version": + if (null == registryValue.Name) + { + wixClass.Version = registryValue.Value; + processed = true; + } + break; + case "versionindependentprogid": + if (null == registryValue.Name) + { + Wix.ProgId progId = (Wix.ProgId)indexedElements[String.Concat(".progid/", registryValue.Value)]; + + // verify that the version independent ProgId appears somewhere + // under this Class element - if not, toss the entire element + if (null == progId || wixClass != progId.ParentElement) + { + // check the parent of the parent + if (null == progId || null == progId.ParentElement || wixClass != progId.ParentElement.ParentElement) + { + element = null; + } + } + + processed = true; + } + break; + } + + if (Wix.Class.ContextType.None != contextType) + { + wixClass.Context |= contextType; + + if (null == registryValue.Name) + { + if ((registryValue.Value.StartsWith("[!", StringComparison.Ordinal) || registryValue.Value.StartsWith("[#", StringComparison.Ordinal)) + && registryValue.Value.EndsWith("]", StringComparison.Ordinal)) + { + parentIndex = String.Concat("file/", registryValue.Value.Substring(2, registryValue.Value.Length - 3)); + processed = true; + } + else if (String.Equals(Path.GetFileName(registryValue.Value), "mscoree.dll", StringComparison.OrdinalIgnoreCase)) + { + wixClass.ForeignServer = "mscoree.dll"; + processed = true; + } + else if (String.Equals(Path.GetFileName(registryValue.Value), "msvbvm60.dll", StringComparison.OrdinalIgnoreCase)) + { + wixClass.ForeignServer = "msvbvm60.dll"; + processed = true; + } + else + { + // Some servers are specifying relative paths (which the above code doesn't find) + // If there's any ambiguity leave it alone and let the developer figure it out when it breaks in the compiler + + bool possibleDuplicate = false; + string possibleParentIndex = null; + + foreach (Wix.File file in this.files) + { + if (String.Equals(registryValue.Value, Path.GetFileName(file.Source), StringComparison.OrdinalIgnoreCase)) + { + if (null == possibleParentIndex) + { + possibleParentIndex = String.Concat("file/", file.Id); + } + else + { + possibleDuplicate = true; + break; + } + } + } + + if (!possibleDuplicate) + { + if (null == possibleParentIndex) + { + wixClass.ForeignServer = registryValue.Value; + processed = true; + } + else + { + parentIndex = possibleParentIndex; + wixClass.RelativePath = Wix.YesNoType.yes; + processed = true; + } + } + } + } + else if (String.Equals(registryValue.Name, "ThreadingModel", StringComparison.OrdinalIgnoreCase)) + { + Wix.Class.ThreadingModelType threadingModel; + + if (String.Equals(registryValue.Value, "apartment", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.apartment; + processed = true; + } + else if (String.Equals(registryValue.Value, "both", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.both; + processed = true; + } + else if (String.Equals(registryValue.Value, "free", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.free; + processed = true; + } + else if (String.Equals(registryValue.Value, "neutral", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.neutral; + processed = true; + } + else if (String.Equals(registryValue.Value, "rental", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.rental; + processed = true; + } + else if (String.Equals(registryValue.Value, "single", StringComparison.OrdinalIgnoreCase)) + { + threadingModel = Wix.Class.ThreadingModelType.single; + processed = true; + } + else + { + continue; + } + + if (!threadingModelSet || wixClass.ThreadingModel == threadingModel) + { + wixClass.ThreadingModel = threadingModel; + threadingModelSet = true; + } + else + { + element = null; + break; + } + } + } + } + else if (4 == parts.Length) + { + if (String.Equals(parts[2], "implemented categories", StringComparison.Ordinal)) + { + switch (parts[3]) + { + case "{7dd95801-9882-11cf-9fa9-00aa006c42c4}": + wixClass.SafeForScripting = Wix.YesNoType.yes; + processed = true; + break; + case "{7dd95802-9882-11cf-9fa9-00aa006c42c4}": + wixClass.SafeForInitializing = Wix.YesNoType.yes; + processed = true; + break; + } + } + } + } + else if (element is Wix.Interface) + { + Wix.Interface wixInterface = (Wix.Interface)element; + + if (2 == parts.Length && null == registryValue.Name) + { + wixInterface.Name = registryValue.Value; + processed = true; + } + else if (3 == parts.Length) + { + switch (parts[2]) + { + case "proxystubclsid": + if (null == registryValue.Name) + { + wixInterface.ProxyStubClassId = registryValue.Value.ToUpper(CultureInfo.InvariantCulture); + processed = true; + } + break; + case "proxystubclsid32": + if (null == registryValue.Name) + { + wixInterface.ProxyStubClassId32 = registryValue.Value.ToUpper(CultureInfo.InvariantCulture); + processed = true; + } + break; + case "nummethods": + if (null == registryValue.Name) + { + wixInterface.NumMethods = Convert.ToInt32(registryValue.Value, CultureInfo.InvariantCulture); + processed = true; + } + break; + case "typelib": + if (String.Equals("Version", registryValue.Name, StringComparison.OrdinalIgnoreCase)) + { + parentIndex = String.Concat(parentIndex, registryValue.Value); + processed = true; + } + else if (null == registryValue.Name) // TypeLib guid + { + parentIndex = String.Concat(".typelib/", registryValue.Value, '/', parentIndex); + processed = true; + } + break; + } + } + } + else if (element is Wix.ProgId) + { + Wix.ProgId progId = (Wix.ProgId)element; + + if (null == registryValue.Name) + { + if (1 == parts.Length) + { + progId.Description = registryValue.Value; + processed = true; + } + else if (2 == parts.Length) + { + if (String.Equals(parts[1], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + parentIndex = String.Concat("CLSID/", registryValue.Value); + processed = true; + } + else if (String.Equals(parts[1], "CurVer", StringComparison.OrdinalIgnoreCase)) + { + // If a progId points to its own ProgId with CurVer, it isn't meaningful, so ignore it + if (!String.Equals(progId.Id, registryValue.Value, StringComparison.OrdinalIgnoreCase)) + { + // this registry value should usually be processed second so the + // version independent ProgId should be under the versioned one + parentIndex = String.Concat(".progid/", registryValue.Value); + processed = true; + } + } + } + } + } + else if (element is Wix.TypeLib) + { + Wix.TypeLib typeLib = (Wix.TypeLib)element; + + if (null == registryValue.Name) + { + if (3 == parts.Length) + { + typeLib.Description = registryValue.Value; + processed = true; + } + else if (4 == parts.Length) + { + if (String.Equals(parts[3], "flags", StringComparison.OrdinalIgnoreCase)) + { + int flags = Convert.ToInt32(registryValue.Value, CultureInfo.InvariantCulture); + + if (0x1 == (flags & 0x1)) + { + typeLib.Restricted = Wix.YesNoType.yes; + } + + if (0x2 == (flags & 0x2)) + { + typeLib.Control = Wix.YesNoType.yes; + } + + if (0x4 == (flags & 0x4)) + { + typeLib.Hidden = Wix.YesNoType.yes; + } + + if (0x8 == (flags & 0x8)) + { + typeLib.HasDiskImage = Wix.YesNoType.yes; + } + + processed = true; + } + else if (String.Equals(parts[3], "helpdir", StringComparison.OrdinalIgnoreCase)) + { + if (registryValue.Value.StartsWith("[", StringComparison.Ordinal) && (registryValue.Value.EndsWith("]", StringComparison.Ordinal) + || registryValue.Value.EndsWith("]\\", StringComparison.Ordinal))) + { + typeLib.HelpDirectory = registryValue.Value.Substring(1, registryValue.Value.LastIndexOf(']') - 1); + } + else if (0 == String.Compare(registryValue.Value, Environment.SystemDirectory, StringComparison.OrdinalIgnoreCase)) // VB6 DLLs register their help directory as SystemFolder + { + typeLib.HelpDirectory = "SystemFolder"; + } + else if (null != component.Directory) // -sfrag has not been specified + { + typeLib.HelpDirectory = component.Directory; + } + else if (component.ParentElement is Wix.Directory) // -sfrag has been specified + { + typeLib.HelpDirectory = ((Wix.Directory)component.ParentElement).Id; + } + else if (component.ParentElement is Wix.DirectoryRef) // -sfrag has been specified + { + typeLib.HelpDirectory = ((Wix.DirectoryRef)component.ParentElement).Id; + } + + //If the helpdir has not matched a known directory, drop it because it cannot be resolved. + processed = true; + } + } + else if (5 == parts.Length && String.Equals("win32", parts[4], StringComparison.OrdinalIgnoreCase)) + { + typeLib.Language = Convert.ToInt32(parts[3], CultureInfo.InvariantCulture); + + if ((registryValue.Value.StartsWith("[!", StringComparison.Ordinal) || registryValue.Value.StartsWith("[#", StringComparison.Ordinal)) + && registryValue.Value.EndsWith("]", StringComparison.Ordinal)) + { + parentIndex = String.Concat("file/", registryValue.Value.Substring(2, registryValue.Value.Length - 3)); + } + + processed = true; + } + } + } + + // index the processed registry values by their corresponding COM element + if (processed) + { + indexedProcessedRegistryValues.Add(registryValue, element); + } + } + + // parent the COM element + if (null != element) + { + if (null != parentIndex) + { + Wix.IParentElement parentElement = (Wix.IParentElement)indexedElements[parentIndex]; + + if (null != parentElement) + { + parentElement.AddChild(element); + } + } + else if (0 < indexedProcessedRegistryValues.Count) + { + component.AddChild(element); + } + + // special handling for AppID since it doesn't fit the general model + if (null != classAppId) + { + Wix.AppId appId = (Wix.AppId)indexedElements[String.Concat("AppID/", classAppId)]; + + // move the Class element under the AppId (and put the AppId under its old parent) + if (null != appId) + { + // move the AppId element + ((Wix.IParentElement)appId.ParentElement).RemoveChild(appId); + ((Wix.IParentElement)element.ParentElement).AddChild(appId); + + // move the Class element + ((Wix.IParentElement)element.ParentElement).RemoveChild(element); + appId.AddChild(element); + } + } + } + } + + // remove the RegistryValue elements which were converted into COM elements + // that were successfully nested under the Component element + foreach (DictionaryEntry entry in indexedProcessedRegistryValues) + { + Wix.ISchemaElement element = (Wix.ISchemaElement)entry.Value; + Wix.RegistryValue registryValue = (Wix.RegistryValue)entry.Key; + + while (null != element) + { + if (element == component) + { + ((Wix.IParentElement)registryValue.ParentElement).RemoveChild(registryValue); + break; + } + + element = element.ParentElement; + } + } + } + } + + /// + /// Mutate the directories. + /// + private void MutateDirectories() + { + foreach (Wix.Directory directory in this.directories) + { + string path = directory.FileSource; + + // create a new directory element without the FileSource attribute + if (null != path) + { + Wix.Directory newDirectory = new Wix.Directory(); + + newDirectory.Id = directory.Id; + newDirectory.Name = directory.Name; + + foreach (Wix.ISchemaElement element in directory.Children) + { + newDirectory.AddChild(element); + } + + ((Wix.IParentElement)directory.ParentElement).AddChild(newDirectory); + ((Wix.IParentElement)directory.ParentElement).RemoveChild(directory); + + if (null != newDirectory.Id) + { + this.directoryPaths[path.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[", newDirectory.Id, "]"); + } + } + } + } + + /// + /// Mutate the files. + /// + private void MutateFiles() + { + string sourceDirSubstitution = this.preprocessorVariable; + if (sourceDirSubstitution != null) + { + string prefix = "$("; + if (sourceDirSubstitution.StartsWith("wix.", StringComparison.Ordinal)) + { + prefix = "!("; + } + sourceDirSubstitution = String.Concat(prefix, sourceDirSubstitution, ")"); + } + + foreach (Wix.File file in this.files) + { + if (null != file.Id && null != file.Source) + { + string fileSource = this.Core.ResolveFilePath(file.Source); + + // index the long path + this.filePaths[fileSource.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[#", file.Id, "]"); + + // index the long path as a URL for assembly harvesting + Uri fileUri = new Uri(fileSource); + this.filePaths[fileUri.ToString().ToLower(CultureInfo.InvariantCulture)] = String.Concat("file:///[#", file.Id, "]"); + + // index the short path + string shortPath = NativeMethods.GetShortPathName(fileSource); + this.filePaths[shortPath.ToLower(CultureInfo.InvariantCulture)] = String.Concat("[!", file.Id, "]"); + + // escape literal $ characters + file.Source = file.Source.Replace("$", "$$"); + + if (null != sourceDirSubstitution && file.Source.StartsWith("SourceDir\\", StringComparison.Ordinal)) + { + file.Source = file.Source.Substring(9).Insert(0, sourceDirSubstitution); + } + } + } + } + + /// + /// Mutate an individual registry string, according to a collection of replacement items. + /// + /// The string to mutate. + /// The collection of items to replace within the string. + /// The mutated registry string. + private string MutateRegistryString(string value, ICollection replace) + { + int index; + string lowercaseValue = value.ToLower(CultureInfo.InvariantCulture); + + foreach (DictionaryEntry entry in replace) + { + while (0 <= (index = lowercaseValue.IndexOf((string)entry.Key, StringComparison.Ordinal))) + { + value = value.Remove(index, ((string)entry.Key).Length); + value = value.Insert(index, (string)entry.Value); + lowercaseValue = value.ToLower(CultureInfo.InvariantCulture); + } + } + + return value; + } + + /// + /// Mutate the registry values. + /// + private void MutateRegistryValues() + { + if (this.SuppressVB6COMElements && this.SuppressCOMElements) + { + var vb6RegistryValues = new List(); + foreach (Wix.RegistryValue registryValue in this.registryValues) + { + if (IsVb6RegistryValue(registryValue)) + { + if (!vb6RegistryValues.Contains(registryValue)) + { + vb6RegistryValues.Add(registryValue); + } + } + } + + // Remove all the VB6 specific COM registry values + foreach (var reg in vb6RegistryValues) + { + if (reg.ParentElement is Wix.Component component) + { + component.RemoveChild(reg); + } + this.registryValues.Remove(reg); + } + } + + + ArrayList reversedDirectoryPaths = new ArrayList(); + + // reverse the indexed directory paths to ensure the longest paths are found first + foreach (DictionaryEntry entry in this.directoryPaths) + { + reversedDirectoryPaths.Insert(0, entry); + } + + foreach (Wix.RegistryValue registryValue in this.registryValues) + { + // Multi-string values are stored as children - their "Value" member is null + if (Wix.RegistryValue.TypeType.multiString == registryValue.Type) + { + foreach (Wix.MultiStringValue multiStringValue in registryValue.Children) + { + // first replace file paths with their MSI tokens + multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)this.filePaths); + // next replace directory paths with their MSI tokens + multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)reversedDirectoryPaths); + } + } + else + { + // first replace file paths with their MSI tokens + registryValue.Value = this.MutateRegistryString(registryValue.Value, (ICollection)this.filePaths); + // next replace directory paths with their MSI tokens + registryValue.Value = this.MutateRegistryString(registryValue.Value, (ICollection)reversedDirectoryPaths); + } + } + } + + private static bool IsVb6RegistryValue(Wix.RegistryValue registryValue) + { + if (Wix.RegistryValue.ActionType.write == registryValue.Action && Wix.RegistryRootType.HKCR == registryValue.Root) + { + string[] parts = registryValue.Key.Split('\\'); + if (String.Equals(parts[0], "CLSID", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 CLSID {D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731}", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + } + else if (String.Equals(parts[0], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + // Search for the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (2 <= parts.Length) + { + if (String.Equals(parts[1], "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(parts[1], "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + } + else if (String.Equals(parts[0], "Interface", StringComparison.OrdinalIgnoreCase)) + { + // Search for any Interfaces that reference the VB6 TypeLibs {EA544A21-C82D-11D1-A3E4-00A0C90AEA82} or {000204EF-0000-0000-C000-000000000046} + if (3 <= parts.Length) + { + if (String.Equals(parts[2], "TypeLib", StringComparison.OrdinalIgnoreCase)) + { + if (String.Equals(registryValue.Value, "{EA544A21-C82D-11D1-A3E4-00A0C90AEA82}", StringComparison.OrdinalIgnoreCase) || + String.Equals(registryValue.Value, "{000204EF-0000-0000-C000-000000000046}", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + } + } + } + return false; + } + + /// + /// The native methods for grabbing machine-specific short file paths. + /// + private class NativeMethods + { + /// + /// Gets the short name for a file. + /// + /// Fullpath to file on disk. + /// Short name for file. + internal static string GetShortPathName(string fullPath) + { + var bufferSize = (int)GetShortPathName(fullPath, null, 0); + if (0 == bufferSize) + { + int err = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); + throw new System.Runtime.InteropServices.COMException(String.Concat("Failed to get short path buffer size for file: ", fullPath), err); + } + + bufferSize += 1; + var shortPath = new StringBuilder(bufferSize, bufferSize); + + uint result = GetShortPathName(fullPath, shortPath, bufferSize); + + if (0 == result) + { + int err = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); + throw new System.Runtime.InteropServices.COMException(String.Concat("Failed to get short path name for file: ", fullPath), err); + } + + return shortPath.ToString(); + } + + /// + /// Gets the short name for a file. + /// + /// Long path to convert to short path. + /// Short path from long path. + /// Size of short path. + /// zero if success. + [DllImport("kernel32.dll", EntryPoint = "GetShortPathNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static extern uint GetShortPathName(string longPath, StringBuilder shortPath, [MarshalAs(UnmanagedType.U4)]int buffer); + } + } +} diff --git a/src/wix/heat/UtilHarvesterMutator.cs b/src/wix/heat/UtilHarvesterMutator.cs new file mode 100644 index 00000000..59fb9a93 --- /dev/null +++ b/src/wix/heat/UtilHarvesterMutator.cs @@ -0,0 +1,218 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.IO; + using System.Reflection; + using System.Runtime.InteropServices; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The WiX Toolset harvester mutator. + /// + internal class UtilHarvesterMutator : BaseMutatorExtension + { + // Flags for SetErrorMode() native method. + private const UInt32 SEM_FAILCRITICALERRORS = 0x0001; + private const UInt32 SEM_NOGPFAULTERRORBOX = 0x0002; + private const UInt32 SEM_NOALIGNMENTFAULTEXCEPT = 0x0004; + private const UInt32 SEM_NOOPENFILEERRORBOX = 0x8000; + + // Remember whether we were able to call OaEnablePerUserTLibRegistration + private bool calledPerUserTLibReg; + + /// + /// allow process to handle serious system errors. + /// + [DllImport("Kernel32.dll")] + private static extern void SetErrorMode(UInt32 uiMode); + + /// + /// enable the RegisterTypeLib API to use the appropriate override mapping for non-admin users on Vista + /// + [DllImport("Oleaut32.dll")] + private static extern void OaEnablePerUserTLibRegistration(); + + public UtilHarvesterMutator() + { + this.calledPerUserTLibReg = false; + + SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); + + try + { + OaEnablePerUserTLibRegistration(); + this.calledPerUserTLibReg = true; + } + catch (EntryPointNotFoundException) + { + } + } + + /// + /// Gets the sequence of this mutator extension. + /// + /// The sequence of this mutator extension. + public override int Sequence + { + get { return 100; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.MutateElement(null, wix); + } + + /// + /// Mutate an element. + /// + /// The parent of the element to mutate. + /// The element to mutate. + private void MutateElement(Wix.IParentElement parentElement, Wix.ISchemaElement element) + { + if (element is Wix.File) + { + this.MutateFile(parentElement, (Wix.File)element); + } + + // mutate the child elements + if (element is Wix.IParentElement) + { + ArrayList childElements = new ArrayList(); + + // copy the child elements to a temporary array (to allow them to be deleted/moved) + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + childElements.Add(childElement); + } + + foreach (Wix.ISchemaElement childElement in childElements) + { + this.MutateElement((Wix.IParentElement)element, childElement); + } + } + } + + /// + /// Mutate a file. + /// + /// The parent of the element to mutate. + /// The file to mutate. + private void MutateFile(Wix.IParentElement parentElement, Wix.File file) + { + if (null != file.Source) + { + string fileExtension = Path.GetExtension(file.Source); + string fileSource = this.Core.ResolveFilePath(file.Source); + + if (String.Equals(".ax", fileExtension, StringComparison.OrdinalIgnoreCase) || // DirectShow filter + String.Equals(".dll", fileExtension, StringComparison.OrdinalIgnoreCase) || + String.Equals(".exe", fileExtension, StringComparison.OrdinalIgnoreCase) || + String.Equals(".ocx", fileExtension, StringComparison.OrdinalIgnoreCase)) // ActiveX + { + // try the assembly harvester + try + { + AssemblyHarvester assemblyHarvester = new AssemblyHarvester(); + + this.Core.Messaging.Write(HarvesterVerboses.HarvestingAssembly(fileSource)); + Wix.RegistryValue[] registryValues = assemblyHarvester.HarvestRegistryValues(fileSource); + + foreach (Wix.RegistryValue registryValue in registryValues) + { + parentElement.AddChild(registryValue); + } + + // also try self-reg since we could have a mixed-mode assembly + this.HarvestSelfReg(parentElement, fileSource); + } + catch (BadImageFormatException) // not an assembly, try raw DLL. + { + this.HarvestSelfReg(parentElement, fileSource); + } + catch (Exception ex) + { + this.Core.Messaging.Write(HarvesterWarnings.AssemblyHarvestFailed(fileSource, ex.Message)); + } + } + else if (String.Equals(".olb", fileExtension, StringComparison.OrdinalIgnoreCase) || // type library + String.Equals(".tlb", fileExtension, StringComparison.OrdinalIgnoreCase)) // type library + { + // try the type library harvester + try + { + TypeLibraryHarvester typeLibHarvester = new TypeLibraryHarvester(); + + this.Core.Messaging.Write(HarvesterVerboses.HarvestingTypeLib(fileSource)); + Wix.RegistryValue[] registryValues = typeLibHarvester.HarvestRegistryValues(fileSource); + + foreach (Wix.RegistryValue registryValue in registryValues) + { + parentElement.AddChild(registryValue); + } + } + catch (COMException ce) + { + // 0x8002801C (TYPE_E_REGISTRYACCESS) + // If we don't have permission to harvest typelibs, it's likely because we're on + // Vista or higher and aren't an Admin, or don't have the appropriate QFE installed. + if (!this.calledPerUserTLibReg && (0x8002801c == unchecked((uint)ce.ErrorCode))) + { + this.Core.Messaging.Write(WarningMessages.InsufficientPermissionHarvestTypeLib()); + } + else if (0x80029C4A == unchecked((uint)ce.ErrorCode)) // generic can't load type library + { + this.Core.Messaging.Write(HarvesterWarnings.TypeLibLoadFailed(fileSource, ce.Message)); + } + } + } + } + } + + /// + /// Calls self-reg harvester. + /// + /// The parent element. + /// The file source. + private void HarvestSelfReg(Wix.IParentElement parentElement, string fileSource) + { + // try the self-reg harvester + try + { + DllHarvester dllHarvester = new DllHarvester(); + + this.Core.Messaging.Write(HarvesterVerboses.HarvestingSelfReg(fileSource)); + Wix.RegistryValue[] registryValues = dllHarvester.HarvestRegistryValues(fileSource); + + foreach (Wix.RegistryValue registryValue in registryValues) + { + parentElement.AddChild(registryValue); + } + } + catch (TargetInvocationException tie) + { + if (tie.InnerException is EntryPointNotFoundException) + { + // No DllRegisterServer(), which is fine by me. + } + else + { + this.Core.Messaging.Write(HarvesterWarnings.SelfRegHarvestFailed(fileSource, tie.Message)); + } + } + catch (Exception ex) + { + this.Core.Messaging.Write(HarvesterWarnings.SelfRegHarvestFailed(fileSource, ex.Message)); + } + } + } +} diff --git a/src/wix/heat/UtilHeatExtension.cs b/src/wix/heat/UtilHeatExtension.cs new file mode 100644 index 00000000..7296a3b3 --- /dev/null +++ b/src/wix/heat/UtilHeatExtension.cs @@ -0,0 +1,405 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections.Generic; + using System.IO; + using WixToolset.Core.Burn.Interfaces; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// A utility heat extension for the WiX Toolset Harvester application. + /// + internal class UtilHeatExtension : BaseHeatExtension + { + public UtilHeatExtension(IServiceProvider serviceProvider) + { + this.PayloadHarvester = serviceProvider.GetService(); + } + + private IPayloadHarvester PayloadHarvester { get; } + + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public override HeatCommandLineOption[] CommandLineTypes + { + get + { + return new HeatCommandLineOption[] + { + new HeatCommandLineOption("dir", "harvest a directory"), + new HeatCommandLineOption("file", "harvest a file"), + new HeatCommandLineOption("exepackagepayload", "harvest a bundle payload as ExePackagePayload"), + new HeatCommandLineOption("msupackagepayload", "harvest a bundle payload as MsuPackagePayload"), + new HeatCommandLineOption("perf", "harvest performance counters"), + new HeatCommandLineOption("reg", "harvest a .reg file"), + new HeatCommandLineOption("-ag", "autogenerate component guids at compile time"), + new HeatCommandLineOption("-cg ", "component group name (cannot contain spaces e.g -cg MyComponentGroup)"), + new HeatCommandLineOption("-dr ", "directory reference to root directories (cannot contain spaces e.g. -dr MyAppDirRef)"), + new HeatCommandLineOption("-var ", "substitute File/@Source=\"SourceDir\" with a preprocessor or a wix variable" + Environment.NewLine + + "(e.g. -var var.MySource will become File/@Source=\"$(var.MySource)\\myfile.txt\" and " + Environment.NewLine + + "-var wix.MySource will become File/@Source=\"!(wix.MySource)\\myfile.txt\""), + new HeatCommandLineOption("-gg", "generate guids now"), + new HeatCommandLineOption("-g1", "generated guids are not in brackets"), + new HeatCommandLineOption("-ke", "keep empty directories"), + new HeatCommandLineOption("-scom", "suppress COM elements"), + new HeatCommandLineOption("-sfrag", "suppress fragments"), + new HeatCommandLineOption("-srd", "suppress harvesting the root directory as an element"), + new HeatCommandLineOption("-svb6", "suppress VB6 COM elements"), + new HeatCommandLineOption("-sreg", "suppress registry harvesting"), + new HeatCommandLineOption("-suid", "suppress unique identifiers for files, components, & directories"), + new HeatCommandLineOption("-t", "transform harvested output with XSL file"), + new HeatCommandLineOption("-template", "use template, one of: fragment,module,product"), + }; + } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public override void ParseOptions(string type, string[] args) + { + bool active = false; + IHarvesterExtension harvesterExtension = null; + bool suppressHarvestingRegistryValues = false; + UtilFinalizeHarvesterMutator utilFinalizeHarvesterMutator = new UtilFinalizeHarvesterMutator(); + UtilMutator utilMutator = new UtilMutator(); + List transformMutators = new List(); + GenerateType generateType = GenerateType.Components; + + // select the harvester + switch (type) + { + case "dir": + harvesterExtension = new DirectoryHarvester(); + active = true; + break; + case "file": + harvesterExtension = new FileHarvester(); + active = true; + break; + case "exepackagepayload": + harvesterExtension = new PayloadHarvester(this.PayloadHarvester, WixBundlePackageType.Exe); + active = true; + break; + case "msupackagepayload": + harvesterExtension = new PayloadHarvester(this.PayloadHarvester, WixBundlePackageType.Msu); + active = true; + break; + case "perf": + harvesterExtension = new PerformanceCategoryHarvester(); + active = true; + break; + case "reg": + harvesterExtension = new RegFileHarvester(); + active = true; + break; + } + + // set default settings + utilMutator.CreateFragments = true; + utilMutator.SetUniqueIdentifiers = true; + + // parse the options + for (int i = 0; i < args.Length; i++) + { + string commandSwitch = args[i]; + + if (null == commandSwitch || 0 == commandSwitch.Length) // skip blank arguments + { + continue; + } + + if ('-' == commandSwitch[0] || '/' == commandSwitch[0]) + { + string truncatedCommandSwitch = commandSwitch.Substring(1); + + if ("ag" == truncatedCommandSwitch) + { + utilMutator.AutogenerateGuids = true; + } + else if ("cg" == truncatedCommandSwitch) + { + utilMutator.ComponentGroupName = this.GetArgumentParameter(args, i); + + if (this.Core.Messaging.EncounteredError) + { + return; + } + } + else if ("dr" == truncatedCommandSwitch) + { + string dr = this.GetArgumentParameter(args, i); + + if (this.Core.Messaging.EncounteredError) + { + return; + } + + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).RootedDirectoryRef = dr; + } + else if (harvesterExtension is FileHarvester) + { + ((FileHarvester)harvesterExtension).RootedDirectoryRef = dr; + } + } + else if ("gg" == truncatedCommandSwitch) + { + utilMutator.GenerateGuids = true; + } + else if ("g1" == truncatedCommandSwitch) + { + utilMutator.GuidFormat = "D"; + } + else if ("ke" == truncatedCommandSwitch) + { + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).KeepEmptyDirectories = true; + } + else if (active) + { + // TODO: error message - not applicable to file harvester + } + } + else if ("scom" == truncatedCommandSwitch) + { + if (active) + { + utilFinalizeHarvesterMutator.SuppressCOMElements = true; + } + else + { + // TODO: error message - not applicable + } + } + else if ("svb6" == truncatedCommandSwitch) + { + if (active) + { + utilFinalizeHarvesterMutator.SuppressVB6COMElements = true; + } + else + { + // TODO: error message - not applicable + } + } + else if ("sfrag" == truncatedCommandSwitch) + { + utilMutator.CreateFragments = false; + } + else if ("srd" == truncatedCommandSwitch) + { + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).SuppressRootDirectory = true; + } + else if (harvesterExtension is FileHarvester) + { + ((FileHarvester)harvesterExtension).SuppressRootDirectory = true; + } + } + else if ("sreg" == truncatedCommandSwitch) + { + suppressHarvestingRegistryValues = true; + } + else if ("suid" == truncatedCommandSwitch) + { + utilMutator.SetUniqueIdentifiers = false; + + if (harvesterExtension is DirectoryHarvester) + { + ((DirectoryHarvester)harvesterExtension).SetUniqueIdentifiers = false; + } + else if (harvesterExtension is FileHarvester) + { + ((FileHarvester)harvesterExtension).SetUniqueIdentifiers = false; + } + } + else if (truncatedCommandSwitch.StartsWith("t:", StringComparison.Ordinal) || "t" == truncatedCommandSwitch) + { + string xslFile; + if (truncatedCommandSwitch.StartsWith("t:", StringComparison.Ordinal)) + { + this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("t:", "t")); + xslFile = truncatedCommandSwitch.Substring(2); + } + else + { + xslFile = this.GetArgumentParameter(args, i, true); + } + + if (0 <= xslFile.IndexOf('\"')) + { + this.Core.Messaging.Write(ErrorMessages.PathCannotContainQuote(xslFile)); + return; + } + + try + { + xslFile = Path.GetFullPath(xslFile); + } + catch (Exception e) + { + this.Core.Messaging.Write(ErrorMessages.InvalidCommandLineFileName(xslFile, e.Message)); + return; + } + + transformMutators.Add(new UtilTransformMutator(xslFile, transformMutators.Count)); + } + else if (truncatedCommandSwitch.StartsWith("template:", StringComparison.Ordinal) || "template" == truncatedCommandSwitch) + { + string template; + if(truncatedCommandSwitch.StartsWith("template:", StringComparison.Ordinal)) + { + this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("template:", "template")); + template = truncatedCommandSwitch.Substring(9); + } + else + { + template = this.GetArgumentParameter(args, i); + } + + switch (template) + { + case "fragment": + utilMutator.TemplateType = TemplateType.Fragment; + break; + case "module": + utilMutator.TemplateType = TemplateType.Module; + break; + case "product": + utilMutator.TemplateType = TemplateType.Package ; + break; + default: + // TODO: error + break; + } + } + else if ("var" == truncatedCommandSwitch) + { + if (active) + { + utilFinalizeHarvesterMutator.PreprocessorVariable = this.GetArgumentParameter(args, i); + + if (this.Core.Messaging.EncounteredError) + { + return; + } + } + } + else if ("generate" == truncatedCommandSwitch) + { + if (harvesterExtension is DirectoryHarvester) + { + string genType = this.GetArgumentParameter(args, i).ToUpperInvariant(); + switch (genType) + { + case "COMPONENTS": + generateType = GenerateType.Components; + break; + case "PAYLOADGROUP": + generateType = GenerateType.PayloadGroup; + break; + default: + throw new WixException(HarvesterErrors.InvalidDirectoryOutputType(genType)); + } + } + else + { + // TODO: error message - not applicable + } + } + } + } + + // set the appropriate harvester extension + if (active) + { + this.Core.Harvester.Extension = harvesterExtension; + + if (!suppressHarvestingRegistryValues) + { + this.Core.Mutator.AddExtension(new UtilHarvesterMutator()); + } + + this.Core.Mutator.AddExtension(utilFinalizeHarvesterMutator); + + if (harvesterExtension is DirectoryHarvester directoryHarvester) + { + directoryHarvester.GenerateType = generateType; + this.Core.Harvester.Core.RootDirectory = this.Core.Harvester.Core.ExtensionArgument; + } + else if (harvesterExtension is FileHarvester) + { + if (((FileHarvester)harvesterExtension).SuppressRootDirectory) + { + this.Core.Harvester.Core.RootDirectory = Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument)); + } + else + { + this.Core.Harvester.Core.RootDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument))); + + // GetDirectoryName() returns null for root paths such as "c:\", so make sure to support that as well + if (null == this.Core.Harvester.Core.RootDirectory) + { + this.Core.Harvester.Core.RootDirectory = Path.GetPathRoot(Path.GetDirectoryName(Path.GetFullPath(this.Core.Harvester.Core.ExtensionArgument))); + } + } + } + } + + // set the mutator + this.Core.Mutator.AddExtension(utilMutator); + + // add the transforms + foreach (UtilTransformMutator transformMutator in transformMutators) + { + this.Core.Mutator.AddExtension(transformMutator); + } + } + + private string GetArgumentParameter(string[] args, int index) + { + return this.GetArgumentParameter(args, index, false); + } + + private string GetArgumentParameter(string[] args, int index, bool allowSpaces) + { + string truncatedCommandSwitch = args[index]; + string commandSwitchValue = args[index + 1]; + + //increment the index to the switch value + index++; + + if (IsValidArg(args, index) && !String.IsNullOrEmpty(commandSwitchValue.Trim())) + { + if (!allowSpaces && commandSwitchValue.Contains(" ")) + { + this.Core.Messaging.Write(HarvesterErrors.SpacesNotAllowedInArgumentValue(truncatedCommandSwitch, commandSwitchValue)); + } + else + { + return commandSwitchValue; + } + } + else + { + this.Core.Messaging.Write(HarvesterErrors.ArgumentRequiresValue(truncatedCommandSwitch)); + } + + return null; + } + } +} diff --git a/src/wix/heat/UtilMutator.cs b/src/wix/heat/UtilMutator.cs new file mode 100644 index 00000000..3ba3a8eb --- /dev/null +++ b/src/wix/heat/UtilMutator.cs @@ -0,0 +1,633 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// The template type. + /// + internal enum TemplateType + { + /// + /// A fragment template. + /// + Fragment, + + /// + /// A module template. + /// + Module, + + /// + /// A product template. + /// + Package + } + + /// + /// The mutator for the WiX Toolset Internet Information Services Extension. + /// + internal class UtilMutator : BaseMutatorExtension + { + private ArrayList components; + private ArrayList componentGroups; + private string componentGroupName; + private bool createFragments; + private ArrayList directories; + private ArrayList directoryRefs; + private ArrayList files; + private ArrayList features; + private SortedList fragments; + private bool autogenerateGuids; + private bool generateGuids; + private string guidFormat = "B"; // Defaults to guid in {} + private Wix.IParentElement rootElement; + private bool setUniqueIdentifiers; + private TemplateType templateType; + + /// + /// Instantiate a new UtilMutator. + /// + public UtilMutator() + { + this.components = new ArrayList(); + this.componentGroups = new ArrayList(); + this.directories = new ArrayList(); + this.directoryRefs = new ArrayList(); + this.features = new ArrayList(); + this.files = new ArrayList(); + this.fragments = new SortedList(); + } + + /// + /// Gets or sets the value of the component group name. + /// + /// The component group name. + public string ComponentGroupName + { + get { return this.componentGroupName; } + set { this.componentGroupName = value; } + } + + /// + /// Gets or sets the option to create fragments. + /// + /// The option to create fragments. + public bool CreateFragments + { + get { return this.createFragments; } + set { this.createFragments = value; } + } + + /// + /// Gets or sets the option to autogenerate component guids at compile time. + /// + /// The option to autogenerate component guids. + public bool AutogenerateGuids + { + get { return this.autogenerateGuids; } + set { this.autogenerateGuids = value; } + } + + /// + /// Gets or sets the option to generate missing guids. + /// + /// The option to generate missing guids. + public bool GenerateGuids + { + get { return this.generateGuids; } + set { this.generateGuids = value; } + } + + /// + /// Gets or sets the option to set the format of guids. + /// D - 32 digits separated by hyphens: + /// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + /// B - 32 digits separated by hyphens, enclosed in brackets: + /// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} + /// + /// Guid format either B or D. + public string GuidFormat + { + get { return this.guidFormat; } + set { this.guidFormat = value; } + } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public override int Sequence + { + get { return 1000; } + } + + /// + /// Gets of sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Gets or sets the template type. + /// + /// The template type. + public TemplateType TemplateType + { + get { return this.templateType; } + set { this.templateType = value; } + } + + /// + /// Mutate a WiX document. + /// + /// The Wix document element. + public override void Mutate(Wix.Wix wix) + { + this.components.Clear(); + this.directories.Clear(); + this.directoryRefs.Clear(); + this.features.Clear(); + this.files.Clear(); + this.fragments.Clear(); + this.rootElement = null; + + // index elements in this wix document + this.IndexElement(wix); + + this.MutateWix(wix); + + this.MutateFiles(); + + this.MutateDirectories(); + + this.MutateComponents(); + + if (null != this.componentGroupName) + { + this.CreateComponentGroup(wix); + } + + // add the components to the product feature after all the identifiers have been set + if (TemplateType.Package == this.templateType) + { + Wix.Feature feature = (Wix.Feature)this.features[0]; + + foreach (Wix.ComponentGroup group in this.componentGroups) + { + Wix.ComponentGroupRef componentGroupRef = new Wix.ComponentGroupRef(); + componentGroupRef.Id = group.Id; + + feature.AddChild(componentGroupRef); + } + } + else if (TemplateType.Module == this.templateType) + { + foreach (Wix.ISchemaElement element in wix.Children) + { + if (element is Wix.Module) + { + foreach (Wix.ComponentGroup group in this.componentGroups) + { + Wix.ComponentGroupRef componentGroupRef = new Wix.ComponentGroupRef(); + componentGroupRef.Id = group.Id; + + ((Wix.IParentElement)element).AddChild(componentGroupRef); + } + break; + } + } + } + + //if(!this.createFragments && TemplateType.Package + foreach (Wix.Fragment fragment in this.fragments.Values) + { + wix.AddChild(fragment); + } + } + + /// + /// Creates a component group with a given name. + /// + /// The Wix document element. + private void CreateComponentGroup(Wix.Wix wix) + { + Wix.ComponentGroup componentGroup = new Wix.ComponentGroup(); + componentGroup.Id = this.componentGroupName; + this.componentGroups.Add(componentGroup); + + Wix.Fragment cgFragment = new Wix.Fragment(); + cgFragment.AddChild(componentGroup); + wix.AddChild(cgFragment); + + int componentCount = 0; + for (; componentCount < this.components.Count; componentCount++) + { + Wix.Component c = this.components[componentCount] as Wix.Component; + + if (this.createFragments) + { + if (c.ParentElement is Wix.Directory) + { + Wix.Directory parentDirectory = c.ParentElement as Wix.Directory; + + componentGroup.AddChild(c); + c.Directory = parentDirectory.Id; + parentDirectory.RemoveChild(c); + } + else if (c.ParentElement is Wix.DirectoryRef) + { + Wix.DirectoryRef parentDirectory = c.ParentElement as Wix.DirectoryRef; + + componentGroup.AddChild(c); + c.Directory = parentDirectory.Id; + parentDirectory.RemoveChild(c); + + // Remove whole fragment if moving the component to the component group just leaves an empty DirectoryRef + if (0 < this.fragments.Count && parentDirectory.ParentElement is Wix.Fragment) + { + Wix.Fragment parentFragment = parentDirectory.ParentElement as Wix.Fragment; + int childCount = 0; + foreach (Wix.ISchemaElement element in parentFragment.Children) + { + childCount++; + } + + // Component should always have an Id but the SortedList creation allows for null and bases the name on the fragment count which we cannot reverse engineer here. + if (1 == childCount && !String.IsNullOrEmpty(c.Id)) + { + int removeIndex = this.fragments.IndexOfKey(String.Concat("Component:", c.Id)); + if (0 <= removeIndex) + { + this.fragments.RemoveAt(removeIndex); + } + } + } + } + } + else + { + Wix.ComponentRef componentRef = new Wix.ComponentRef(); + componentRef.Id = c.Id; + componentGroup.AddChild(componentRef); + } + } + } + + /// + /// Index an element. + /// + /// The element to index. + private void IndexElement(Wix.ISchemaElement element) + { + if (element is Wix.Component) + { + this.components.Add(element); + } + else if (element is Wix.ComponentGroup) + { + this.componentGroups.Add(element); + } + else if (element is Wix.Directory) + { + this.directories.Add(element); + } + else if (element is Wix.DirectoryRef) + { + this.directoryRefs.Add(element); + } + else if (element is Wix.Feature) + { + this.features.Add(element); + } + else if (element is Wix.File) + { + this.files.Add(element); + } + else if (element is Wix.Module || element is Wix.PatchCreation || element is Wix.Package) + { + Debug.Assert(null == this.rootElement); + this.rootElement = (Wix.IParentElement)element; + } + + // index the child elements + if (element is Wix.IParentElement) + { + foreach (Wix.ISchemaElement childElement in ((Wix.IParentElement)element).Children) + { + this.IndexElement(childElement); + } + } + } + + /// + /// Mutate the components. + /// + private void MutateComponents() + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("Component", this.Core); + if (TemplateType.Module == this.templateType) + { + identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; + } + + foreach (Wix.Component component in this.components) + { + if (null == component.Id) + { + string firstFileId = string.Empty; + + // attempt to create a possible identifier from the first file identifier in the component + foreach (Wix.File file in component[typeof(Wix.File)]) + { + firstFileId = file.Id; + break; + } + + if (string.IsNullOrEmpty(firstFileId)) + { + firstFileId = this.GetGuid(); + } + + component.Id = identifierGenerator.GetIdentifier(firstFileId); + } + + if (null == component.Guid) + { + if (this.AutogenerateGuids) + { + component.Guid = "*"; + } + else + { + component.Guid = this.GetGuid(); + } + } + + if (this.createFragments && component.ParentElement is Wix.Directory) + { + Wix.Directory directory = (Wix.Directory)component.ParentElement; + + // parent directory must have an identifier to create a reference to it + if (null == directory.Id) + { + break; + } + + if (this.rootElement is Wix.Module) + { + // add a ComponentRef for the Component + Wix.ComponentRef componentRef = new Wix.ComponentRef(); + componentRef.Id = component.Id; + this.rootElement.AddChild(componentRef); + } + + // create a new Fragment + Wix.Fragment fragment = new Wix.Fragment(); + this.fragments.Add(String.Concat("Component:", (null != component.Id ? component.Id : this.fragments.Count.ToString())), fragment); + + // create a new DirectoryRef + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = directory.Id; + fragment.AddChild(directoryRef); + + // move the Component from the the Directory to the DirectoryRef + directory.RemoveChild(component); + directoryRef.AddChild(component); + } + } + } + + /// + /// Mutate the directories. + /// + private void MutateDirectories() + { + if (!this.setUniqueIdentifiers) + { + // assign all identifiers before fragmenting (because fragmenting requires them all to be present) + IdentifierGenerator identifierGenerator = new IdentifierGenerator("Directory", this.Core); + if (TemplateType.Module == this.templateType) + { + identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; + } + + foreach (Wix.Directory directory in this.directories) + { + if (null == directory.Id) + { + directory.Id = identifierGenerator.GetIdentifier(directory.Name); + } + } + } + + if (this.createFragments) + { + foreach (Wix.Directory directory in this.directories) + { + if (directory.ParentElement is Wix.Directory) + { + Wix.Directory parentDirectory = (Wix.Directory)directory.ParentElement; + + // parent directory must have an identifier to create a reference to it + if (null == parentDirectory.Id) + { + return; + } + + // create a new Fragment + Wix.Fragment fragment = new Wix.Fragment(); + this.fragments.Add(String.Concat("Directory:", ("TARGETDIR" == directory.Id ? null : (null != directory.Id ? directory.Id : this.fragments.Count.ToString()))), fragment); + + // create a new DirectoryRef + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + directoryRef.Id = parentDirectory.Id; + fragment.AddChild(directoryRef); + + // move the Directory from the parent Directory to DirectoryRef + parentDirectory.RemoveChild(directory); + directoryRef.AddChild(directory); + } + else if (directory.ParentElement is Wix.Fragment) + { + // When creating fragments, remove any top-level Directory elements; + // the fragments should be pulled in by their DirectoryRefs instead. + Wix.Fragment parent = (Wix.Fragment)directory.ParentElement; + parent.RemoveChild(directory); + + // Remove the fragment if it is empty. + if (parent.Children.GetEnumerator().Current == null && parent.ParentElement != null) + { + ((Wix.IParentElement)parent.ParentElement).RemoveChild(parent); + } + } + else if (directory.ParentElement == this.rootElement) + { + // create a new Fragment + Wix.Fragment fragment = new Wix.Fragment(); + this.fragments.Add(String.Concat("Directory:", ("TARGETDIR" == directory.Id ? null : (null != directory.Id ? directory.Id : this.fragments.Count.ToString()))), fragment); + + // move the Directory from the root element to the Fragment + this.rootElement.RemoveChild(directory); + fragment.AddChild(directory); + } + } + } + } + + /// + /// Mutate the files. + /// + private void MutateFiles() + { + IdentifierGenerator identifierGenerator = new IdentifierGenerator("File", this.Core); + if (TemplateType.Module == this.templateType) + { + identifierGenerator.MaxIdentifierLength = IdentifierGenerator.MaxModuleIdentifierLength; + } + + foreach (Wix.File file in this.files) + { + if (null == file.Id) + { + file.Id = identifierGenerator.GetIdentifier(Path.GetFileName(file.Source)); + } + } + } + + /// + /// Mutate a Wix element. + /// + /// The Wix element to mutate. + private void MutateWix(Wix.Wix wix) + { + if (TemplateType.Fragment != this.templateType) + { + if (null != this.rootElement || 0 != this.features.Count) + { + throw new Exception("The template option cannot be used with Feature, Package, or Module elements present."); + } + + // create a package element although it won't always be used + Wix.SummaryInformation package = new Wix.SummaryInformation(); + if (TemplateType.Module == this.templateType) + { + package.Id = this.GetGuid(); + } + else + { + package.Compressed = Wix.YesNoType.yes; + } + + package.InstallerVersion = 200; + + Wix.Directory targetDir = new Wix.Directory(); + targetDir.Id = "TARGETDIR"; + targetDir.Name = "SourceDir"; + + foreach (Wix.DirectoryRef directoryRef in this.directoryRefs) + { + if (String.Equals(directoryRef.Id, "TARGETDIR", StringComparison.OrdinalIgnoreCase)) + { + Wix.IParentElement parent = directoryRef.ParentElement as Wix.IParentElement; + + foreach (Wix.ISchemaElement element in directoryRef.Children) + { + targetDir.AddChild(element); + } + + parent.RemoveChild(directoryRef); + + if (null != ((Wix.ISchemaElement)parent).ParentElement) + { + int i = 0; + + foreach (Wix.ISchemaElement element in parent.Children) + { + i++; + } + + if (0 == i) + { + Wix.IParentElement supParent = (Wix.IParentElement)((Wix.ISchemaElement)parent).ParentElement; + supParent.RemoveChild((Wix.ISchemaElement)parent); + } + } + + break; + } + } + + if (TemplateType.Module == this.templateType) + { + Wix.Module module = new Wix.Module(); + module.Id = "PUT-MODULE-NAME-HERE"; + module.Language = "1033"; + module.Version = "1.0.0.0"; + + package.Manufacturer = "PUT-COMPANY-NAME-HERE"; + module.AddChild(package); + module.AddChild(targetDir); + + wix.AddChild(module); + this.rootElement = module; + } + else // product + { + Wix.Package product = new Wix.Package(); + product.Id = this.GetGuid(); + product.Language = "1033"; + product.Manufacturer = "PUT-COMPANY-NAME-HERE"; + product.Name = "PUT-PRODUCT-NAME-HERE"; + product.UpgradeCode = this.GetGuid(); + product.Version = "1.0.0.0"; + product.AddChild(package); + product.AddChild(targetDir); + + Wix.Media media = new Wix.Media(); + media.Id = "1"; + media.Cabinet = "product.cab"; + media.EmbedCab = Wix.YesNoType.yes; + product.AddChild(media); + + Wix.Feature feature = new Wix.Feature(); + feature.Id = "ProductFeature"; + feature.Title = "PUT-FEATURE-TITLE-HERE"; + feature.Level = 1; + product.AddChild(feature); + this.features.Add(feature); + + wix.AddChild(product); + this.rootElement = product; + } + } + } + + /// + /// Get a generated guid or a placeholder for a guid. + /// + /// A generated guid or placeholder. + private string GetGuid() + { + if (this.generateGuids) + { + return Guid.NewGuid().ToString(this.guidFormat, CultureInfo.InvariantCulture).ToUpper(CultureInfo.InvariantCulture); + } + else + { + return "PUT-GUID-HERE"; + } + } + } +} diff --git a/src/wix/heat/UtilTransformMutator.cs b/src/wix/heat/UtilTransformMutator.cs new file mode 100644 index 00000000..f4dda3c5 --- /dev/null +++ b/src/wix/heat/UtilTransformMutator.cs @@ -0,0 +1,77 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using System.Xml; + using System.Xml.Xsl; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + internal class UtilTransformMutator : BaseMutatorExtension + { + private string transform; + private int transformSequence; + + /// + /// Instantiate a new UtilTransformMutator. + /// + /// Path to the XSL transform file. + /// Order in which the transform should be applied, + /// relative to other transforms. + public UtilTransformMutator(string transform, int transformSequence) + { + this.transform = transform; + this.transformSequence = transformSequence; + } + + /// + /// Gets the sequence of the extension. + /// + /// The sequence of the extension. + public override int Sequence + { + get { return 3000 + this.transformSequence; } + } + + /// + /// Mutate a WiX document as a string. + /// + /// The Wix document element as a string. + /// The mutated Wix document as a string. + public override string Mutate(string wixString) + { + try + { + XslCompiledTransform xslt = new XslCompiledTransform(); + xslt.Load(this.transform, XsltSettings.TrustedXslt, new XmlUrlResolver()); + + using (XmlTextReader xmlReader = new XmlTextReader(new StringReader(wixString))) + { + using (StringWriter stringWriter = new StringWriter()) + { + XmlWriterSettings xmlSettings = new XmlWriterSettings(); + xmlSettings.Indent = true; + xmlSettings.IndentChars = " "; + xmlSettings.OmitXmlDeclaration = true; + + using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + xslt.Transform(xmlReader, xmlWriter); + } + + wixString = stringWriter.ToString(); + } + } + } + catch (Exception ex) + { + this.Core.Messaging.Write(HarvesterErrors.ErrorTransformingHarvestedWiX(this.transform, ex.Message)); + return null; + } + + return wixString; + } + } +} diff --git a/src/wix/heat/VSHeatExtension.cs b/src/wix/heat/VSHeatExtension.cs new file mode 100644 index 00000000..7c0539bf --- /dev/null +++ b/src/wix/heat/VSHeatExtension.cs @@ -0,0 +1,229 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.Collections; + using WixToolset.Data; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + + /// + /// Defines generated element types. + /// + internal enum GenerateType + { + /// Generate Components. + Components, + + /// Generate a Container with Payloads. + Container, + + /// Generate a Bundle PackageGroups. + PackageGroup, + + /// Generate a PayloadGroup with Payloads. + PayloadGroup, + } + + /// + /// VS-related extensions for the WiX Toolset Harvester application. + /// + internal class VSHeatExtension : BaseHeatExtension + { + /// + /// Gets the supported command line types for this extension. + /// + /// The supported command line types for this extension. + public override HeatCommandLineOption[] CommandLineTypes + { + get + { + return new HeatCommandLineOption[] + { + new HeatCommandLineOption("project", "harvest outputs of a VS project"), + new HeatCommandLineOption("-configuration", "configuration to set when harvesting the project"), + new HeatCommandLineOption("-directoryid", "overridden directory id for generated directory elements"), + new HeatCommandLineOption("-generate", Environment.NewLine + + " specify what elements to generate, one of:" + Environment.NewLine + + " components, container, payloadgroup, packagegroup" + Environment.NewLine + + " (default is components)"), + new HeatCommandLineOption("-msbuildbinpath", "msbuild bin directory path"), + new HeatCommandLineOption("-platform", "platform to set when harvesting the project"), + new HeatCommandLineOption("-pog", Environment.NewLine + + " specify output group of VS project, one of:" + Environment.NewLine + + " " + String.Join(",", VSProjectHarvester.GetOutputGroupNames()) + Environment.NewLine + + " This option may be repeated for multiple output groups."), + new HeatCommandLineOption("-projectname", "overridden project name to use in variables"), + new HeatCommandLineOption("-usetoolsversion", "ignore msbuildbinpath if project specifies known msbuild version"), + new HeatCommandLineOption("-wixvar", "generate binder variables instead of preprocessor variables"), + }; + } + } + + /// + /// Parse the command line options for this extension. + /// + /// The active harvester type. + /// The option arguments. + public override void ParseOptions(string type, string[] args) + { + if ("project" == type) + { + string[] allOutputGroups = VSProjectHarvester.GetOutputGroupNames(); + bool suppressUniqueId = false; + bool generateWixVars = false; + bool useToolsVersion = false; + GenerateType generateType = GenerateType.Components; + string directoryIds = null; + string msbuildBinPath = null; + string projectName = null; + string configuration = null; + string platform = null; + ArrayList outputGroups = new ArrayList(); + + for (int i = 0; i < args.Length; i++) + { + if ("-configuration" == args[i]) + { + configuration = args[++i]; + } + else if ("-directoryid" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidDirectoryId(args[i])); + } + + directoryIds = args[i]; + } + else if ("-generate" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidProjectOutputType(args[i])); + } + + string genType = args[i].ToUpperInvariant(); + switch(genType) + { + case "CONTAINER": + generateType = GenerateType.Container; + break; + case "COMPONENTS": + generateType = GenerateType.Components; + break; + case "PACKAGEGROUP": + generateType = GenerateType.PackageGroup; + break; + case "PAYLOADGROUP": + generateType = GenerateType.PayloadGroup; + break; + default: + throw new WixException(HarvesterErrors.InvalidProjectOutputType(genType)); + } + } + else if ("-msbuildbinpath" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.ArgumentRequiresValue(args[i-1])); + } + + msbuildBinPath = args[i]; + } + else if ("-platform" == args[i]) + { + platform = args[++i]; + } + else if ("-pog" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(args[i])); + } + + string pogName = args[i]; + bool found = false; + foreach (string availableOutputGroup in allOutputGroups) + { + if (String.Equals(pogName, availableOutputGroup, StringComparison.Ordinal)) + { + outputGroups.Add(availableOutputGroup); + found = true; + break; + } + } + + if (!found) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(pogName)); + } + } + else if (args[i].StartsWith("-pog:", StringComparison.Ordinal)) + { + this.Core.Messaging.Write(WarningMessages.DeprecatedCommandLineSwitch("pog:", "pog")); + + string pogName = args[i].Substring(5); + bool found = false; + foreach (string availableOutputGroup in allOutputGroups) + { + if (String.Equals(pogName, availableOutputGroup, StringComparison.Ordinal)) + { + outputGroups.Add(availableOutputGroup); + found = true; + break; + } + } + + if (!found) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(pogName)); + } + } + else if ("-projectname" == args[i]) + { + if (!IsValidArg(args, ++i)) + { + throw new WixException(HarvesterErrors.InvalidProjectName(args[i])); + } + + projectName = args[i]; + } + else if ("-suid" == args[i]) + { + suppressUniqueId = true; + } + else if ("-usetoolsversion" == args[i]) + { + useToolsVersion = true; + } + else if ("-wixvar" == args[i]) + { + generateWixVars = true; + } + } + + if (outputGroups.Count == 0) + { + throw new WixException(HarvesterErrors.NoOutputGroupSpecified()); + } + + VSProjectHarvester harvester = new VSProjectHarvester( + (string[]) outputGroups.ToArray(typeof(string))); + + harvester.SetUniqueIdentifiers = !suppressUniqueId; + harvester.GenerateWixVars = generateWixVars; + harvester.GenerateType = generateType; + harvester.DirectoryIds = directoryIds; + harvester.MsbuildBinPath = msbuildBinPath; + harvester.ProjectName = projectName; + harvester.Configuration = configuration; + harvester.Platform = platform; + harvester.UseToolsVersion = String.IsNullOrEmpty(msbuildBinPath) || useToolsVersion; + + this.Core.Harvester.Extension = harvester; + } + } + } +} diff --git a/src/wix/heat/VSProjectHarvester.cs b/src/wix/heat/VSProjectHarvester.cs new file mode 100644 index 00000000..115ee828 --- /dev/null +++ b/src/wix/heat/VSProjectHarvester.cs @@ -0,0 +1,1455 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Harvesters +{ + using System; + using System.IO; + using System.Reflection; + using System.Collections; + using System.Collections.Generic; + using System.Globalization; + using System.Text.RegularExpressions; + using System.Xml; + using WixToolset.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters.Data; + using WixToolset.Harvesters.Extensibility; + using Wix = WixToolset.Harvesters.Serialize; + + /// + /// Harvest WiX authoring for the outputs of a VS project. + /// + internal class VSProjectHarvester : BaseHarvesterExtension + { + // These format strings are used for generated element identifiers. + // {0} = project name + // {1} = POG name + // {2} = file name + private const string DirectoryIdFormat = "{0}.{1}"; + private const string ComponentIdFormat = "{0}.{1}.{2}"; + private const string FileIdFormat = "{0}.{1}.{2}"; + private const string VariableFormat = "$(var.{0}.{1})"; + private const string WixVariableFormat = "!(wix.{0}.{1})"; + + private const string ComponentPrefix = "cmp"; + private const string DirectoryPrefix = "dir"; + private const string FilePrefix = "fil"; + + private string projectGUID; + private string directoryIds; + private string directoryRefSeed; + private string projectName; + private string configuration; + private string platform; + private bool setUniqueIdentifiers; + private GenerateType generateType; + private bool generateWixVars; + + + private static readonly ProjectOutputGroup[] allOutputGroups = new ProjectOutputGroup[] + { + new ProjectOutputGroup("Binaries", "BuiltProjectOutputGroup", "TargetDir"), + new ProjectOutputGroup("Symbols", "DebugSymbolsProjectOutputGroup", "TargetDir"), + new ProjectOutputGroup("Documents", "DocumentationProjectOutputGroup", "ProjectDir"), + new ProjectOutputGroup("Satellites", "SatelliteDllsProjectOutputGroup", "TargetDir"), + new ProjectOutputGroup("Sources", "SourceFilesProjectOutputGroup", "ProjectDir"), + new ProjectOutputGroup("Content", "ContentFilesProjectOutputGroup", "ProjectDir"), + }; + + private string[] outputGroups; + + /// + /// Instantiate a new VSProjectHarvester. + /// + /// List of project output groups to harvest. + public VSProjectHarvester(string[] outputGroups) + { + if (outputGroups == null) + { + throw new ArgumentNullException("outputGroups"); + } + + this.outputGroups = outputGroups; + } + + /// + /// Gets or sets the configuration to set when harvesting. + /// + /// The configuration to set when harvesting. + public string Configuration + { + get { return this.configuration; } + set { this.configuration = value; } + } + + public string DirectoryIds + { + get { return this.directoryIds; } + set { this.directoryIds = value; } + } + + /// + /// Gets or sets what type of elements are to be generated. + /// + /// The type of elements being generated. + public GenerateType GenerateType + { + get { return this.generateType; } + set { this.generateType = value; } + } + + /// + /// Gets or sets whether or not to use wix variables. + /// + /// Whether or not to use wix variables. + public bool GenerateWixVars + { + get { return this.generateWixVars; } + set { this.generateWixVars = value; } + } + + /// + /// Gets or sets the location to load MSBuild from. + /// + public string MsbuildBinPath { get; set; } + + /// + /// Gets or sets the platform to set when harvesting. + /// + /// The platform to set when harvesting. + public string Platform + { + get { return this.platform; } + set { this.platform = value; } + } + + /// + /// Gets or sets the project name to use in wix variables. + /// + /// The project name to use in wix variables. + public string ProjectName + { + get { return this.projectName; } + set { this.projectName = value; } + } + + /// + /// Gets or sets the option to set unique identifiers. + /// + /// The option to set unique identifiers. + public bool SetUniqueIdentifiers + { + get { return this.setUniqueIdentifiers; } + set { this.setUniqueIdentifiers = value; } + } + + /// + /// Gets or sets whether to ignore MsbuildBinPath when the project file specifies a known MSBuild version. + /// + public bool UseToolsVersion { get; set; } + + /// + /// Gets a list of friendly output group names that will be recognized on the command-line. + /// + /// Array of output group names. + public static string[] GetOutputGroupNames() + { + string[] names = new string[VSProjectHarvester.allOutputGroups.Length]; + for (int i = 0; i < names.Length; i++) + { + names[i] = VSProjectHarvester.allOutputGroups[i].Name; + } + return names; + } + + /// + /// Harvest a VS project. + /// + /// The path of the VS project file. + /// The harvested directory. + public override Wix.Fragment[] Harvest(string argument) + { + if (null == argument) + { + throw new ArgumentNullException("argument"); + } + + if (!System.IO.File.Exists(argument)) + { + throw new FileNotFoundException(argument); + } + + // Match specified output group names to available POG structures + // and collect list of build output groups to pass to MSBuild. + ProjectOutputGroup[] pogs = new ProjectOutputGroup[this.outputGroups.Length]; + string[] buildOutputGroups = new string[this.outputGroups.Length]; + for (int i = 0; i < this.outputGroups.Length; i++) + { + foreach (ProjectOutputGroup pog in VSProjectHarvester.allOutputGroups) + { + if (pog.Name == this.outputGroups[i]) + { + pogs[i] = pog; + buildOutputGroups[i] = pog.BuildOutputGroup; + } + } + + if (buildOutputGroups[i] == null) + { + throw new WixException(HarvesterErrors.InvalidOutputGroup(this.outputGroups[i])); + } + } + + string projectFile = Path.GetFullPath(argument); + + IDictionary buildOutputs = this.GetProjectBuildOutputs(projectFile, buildOutputGroups); + + ArrayList fragmentList = new ArrayList(); + + for (int i = 0; i < pogs.Length; i++) + { + this.HarvestProjectOutputGroup(projectFile, buildOutputs, pogs[i], fragmentList); + } + + return (Wix.Fragment[]) fragmentList.ToArray(typeof(Wix.Fragment)); + } + + /// + /// Runs MSBuild on a project file to get the list of filenames for the specified output groups. + /// + /// VS MSBuild project file to load. + /// List of MSBuild output group names. + /// Dictionary mapping output group names to lists of filenames in the group. + private IDictionary GetProjectBuildOutputs(string projectFile, string[] buildOutputGroups) + { + MSBuildProject project = this.GetMsbuildProject(projectFile); + + project.Load(projectFile); + + IDictionary buildOutputs = new Hashtable(); + + string originalDirectory = System.IO.Directory.GetCurrentDirectory(); + System.IO.Directory.SetCurrentDirectory(Path.GetDirectoryName(projectFile)); + bool buildSuccess = false; + try + { + buildSuccess = project.Build(projectFile, buildOutputGroups, buildOutputs); + } + finally + { + System.IO.Directory.SetCurrentDirectory(originalDirectory); + } + + if (!buildSuccess) + { + throw new WixException(HarvesterErrors.BuildFailed()); + } + + this.projectGUID = project.GetEvaluatedProperty("ProjectGuid"); + + if (null == this.projectGUID) + { + throw new WixException(HarvesterErrors.BuildFailed()); + } + + IDictionary newDictionary = new Dictionary(); + foreach (string buildOutput in buildOutputs.Keys) + { + IEnumerable buildOutputFiles = buildOutputs[buildOutput] as IEnumerable; + + bool hasFiles = false; + + foreach (object file in buildOutputFiles) + { + hasFiles = true; + break; + } + + // Try the item group if no outputs + if (!hasFiles) + { + IEnumerable itemFiles = project.GetEvaluatedItemsByName(String.Concat(buildOutput, "Output")); + List itemFileList = new List(); + + // Get each BuildItem and add the file path to our list + foreach (object itemFile in itemFiles) + { + itemFileList.Add(project.GetBuildItem(itemFile)); + } + + // Use our list for this build output + newDictionary.Add(buildOutput, itemFileList); + } + else + { + newDictionary.Add(buildOutput, buildOutputFiles); + } + } + + return newDictionary; + } + + /// + /// Creates WiX fragments for files in one output group. + /// + /// VS MSBuild project file. + /// Dictionary of build outputs retrieved from an MSBuild run on the project file. + /// Project output group parameters. + /// List to which generated fragments will be added. + /// Count of harvested files. + private int HarvestProjectOutputGroup(string projectFile, IDictionary buildOutputs, ProjectOutputGroup pog, IList fragmentList) + { + string projectName = Path.GetFileNameWithoutExtension(projectFile); + string projectBaseDir = null; + + if (this.ProjectName != null) + { + projectName = this.ProjectName; + } + + string sanitizedProjectName = this.Core.CreateIdentifierFromFilename(projectName); + + Wix.IParentElement harvestParent; + + if (this.GenerateType == GenerateType.Container) + { + Wix.Container container = new Wix.Container(); + harvestParent = container; + + container.Name = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else if (this.GenerateType == GenerateType.PayloadGroup) + { + Wix.PayloadGroup payloadGroup = new Wix.PayloadGroup(); + harvestParent = payloadGroup; + + payloadGroup.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else if (this.GenerateType == GenerateType.PackageGroup) + { + Wix.PackageGroup packageGroup = new Wix.PackageGroup(); + harvestParent = packageGroup; + + packageGroup.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else + { + Wix.DirectoryRef directoryRef = new Wix.DirectoryRef(); + harvestParent = directoryRef; + + if (!String.IsNullOrEmpty(this.directoryIds)) + { + directoryRef.Id = this.directoryIds; + } + else if (this.setUniqueIdentifiers) + { + directoryRef.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else + { + directoryRef.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name)); + } + + this.directoryRefSeed = this.Core.GenerateIdentifier(DirectoryPrefix, this.projectGUID, pog.Name); + } + + IEnumerable pogFiles = buildOutputs[pog.BuildOutputGroup] as IEnumerable; + if (pogFiles == null) + { + throw new WixException(HarvesterErrors.MissingProjectOutputGroup( + projectFile, pog.BuildOutputGroup)); + } + + if (pog.FileSource == "ProjectDir") + { + projectBaseDir = Path.GetDirectoryName(projectFile) + "\\"; + } + + int harvestCount = this.HarvestProjectOutputGroupFiles(projectBaseDir, projectName, pog.Name, pog.FileSource, pogFiles, harvestParent); + + if (this.GenerateType == GenerateType.Container) + { + // harvestParent must be a Container at this point + Wix.Container container = harvestParent as Wix.Container; + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(container); + fragmentList.Add(fragment); + } + else if (this.GenerateType == GenerateType.PackageGroup) + { + // harvestParent must be a PackageGroup at this point + Wix.PackageGroup packageGroup = harvestParent as Wix.PackageGroup; + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(packageGroup); + fragmentList.Add(fragment); + } + else if (this.GenerateType == GenerateType.PayloadGroup) + { + // harvestParent must be a Container at this point + Wix.PayloadGroup payloadGroup = harvestParent as Wix.PayloadGroup; + + Wix.Fragment fragment = new Wix.Fragment(); + fragment.AddChild(payloadGroup); + fragmentList.Add(fragment); + } + else + { + // harvestParent must be a DirectoryRef at this point + Wix.DirectoryRef directoryRef = harvestParent as Wix.DirectoryRef; + + if (harvestCount > 0) + { + Wix.Fragment drf = new Wix.Fragment(); + drf.AddChild(directoryRef); + fragmentList.Add(drf); + } + + Wix.ComponentGroup cg = new Wix.ComponentGroup(); + + if (this.setUniqueIdentifiers || !String.IsNullOrEmpty(this.directoryIds)) + { + cg.Id = String.Format(CultureInfo.InvariantCulture, DirectoryIdFormat, sanitizedProjectName, pog.Name); + } + else + { + cg.Id = directoryRef.Id; + } + + if (harvestCount > 0) + { + this.AddComponentsToComponentGroup(directoryRef, cg); + } + + Wix.Fragment cgf = new Wix.Fragment(); + cgf.AddChild(cg); + fragmentList.Add(cgf); + } + + return harvestCount; + } + + /// + /// Add all Components in an element tree to a ComponentGroup. + /// + /// Parent of an element tree that will be searched for Components. + /// The ComponentGroup the Components will be added to. + private void AddComponentsToComponentGroup(Wix.IParentElement parent, Wix.ComponentGroup cg) + { + foreach (Wix.ISchemaElement childElement in parent.Children) + { + Wix.Component c = childElement as Wix.Component; + if (c != null) + { + Wix.ComponentRef cr = new Wix.ComponentRef(); + cr.Id = c.Id; + cg.AddChild(cr); + } + else + { + Wix.IParentElement p = childElement as Wix.IParentElement; + if (p != null) + { + this.AddComponentsToComponentGroup(p, cg); + } + } + } + } + + /// + /// Harvest files from one output group of a VS project. + /// + /// The base directory of the files. + /// Name of the project, to be used as a prefix for generated identifiers. + /// Name of the project output group, used for generating identifiers for WiX elements. + /// The ProjectOutputGroup file source. + /// The files from one output group to harvest. + /// The parent element that will contain the components of the harvested files. + /// The number of files harvested. + private int HarvestProjectOutputGroupFiles(string baseDir, string projectName, string pogName, string pogFileSource, IEnumerable outputGroupFiles, Wix.IParentElement parent) + { + int fileCount = 0; + + Wix.ISchemaElement exeFile = null; + Wix.ISchemaElement dllFile = null; + Wix.ISchemaElement appConfigFile = null; + + // Keep track of files inserted + // Files can have different absolute paths but get mapped to the same SourceFile + // after the project variables have been used. For example, a WiX project that + // is building multiple cultures will have many output MSIs/MSMs, but will all get + // mapped to $(var.ProjName.TargetDir)\ProjName.msm. These duplicates would + // prevent generated code from compiling. + Dictionary seenList = new Dictionary(); + + foreach (object output in outputGroupFiles) + { + string filePath = output.ToString(); + string fileName = Path.GetFileName(filePath); + string fileDir = Path.GetDirectoryName(filePath); + string link = null; + + MethodInfo getMetadataMethod = output.GetType().GetMethod("GetMetadata"); + if (getMetadataMethod != null) + { + link = (string)getMetadataMethod.Invoke(output, new object[] { "Link" }); + if (!String.IsNullOrEmpty(link)) + { + fileDir = Path.GetDirectoryName(Path.Combine(baseDir, link)); + } + } + + Wix.IParentElement parentDir = parent; + // Ignore Containers and PayloadGroups because they do not have a nested structure. + if (baseDir != null && !String.Equals(Path.GetDirectoryName(baseDir), fileDir, StringComparison.OrdinalIgnoreCase) + && this.GenerateType != GenerateType.Container && this.GenerateType != GenerateType.PackageGroup && this.GenerateType != GenerateType.PayloadGroup) + { + Uri baseUri = new Uri(baseDir); + Uri relativeUri = baseUri.MakeRelativeUri(new Uri(fileDir)); + parentDir = this.GetSubDirElement(parentDir, relativeUri); + } + + string parentDirId = null; + + if (parentDir is Wix.DirectoryRef) + { + parentDirId = this.directoryRefSeed; + } + else if (parentDir is Wix.Directory) + { + parentDirId = ((Wix.Directory)parentDir).Id; + } + + if (this.GenerateType == GenerateType.Container || this.GenerateType == GenerateType.PayloadGroup) + { + Wix.Payload payload = new Wix.Payload(); + + this.HarvestProjectOutputGroupPayloadFile(baseDir, projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, payload, seenList); + } + else if (this.GenerateType == GenerateType.PackageGroup) + { + this.HarvestProjectOutputGroupPackage(projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, seenList); + } + else + { + Wix.Component component = new Wix.Component(); + Wix.File file = new Wix.File(); + + this.HarvestProjectOutputGroupFile(baseDir, projectName, pogName, pogFileSource, filePath, fileName, link, parentDir, parentDirId, component, file, seenList); + + if (String.Equals(Path.GetExtension(file.Source), ".exe", StringComparison.OrdinalIgnoreCase)) + { + exeFile = file; + } + else if (String.Equals(Path.GetExtension(file.Source), ".dll", StringComparison.OrdinalIgnoreCase)) + { + dllFile = file; + } + else if (file.Source.EndsWith("app.config", StringComparison.OrdinalIgnoreCase)) + { + appConfigFile = file; + } + } + + fileCount++; + } + + // if there was no exe file found fallback on the dll file found + if (exeFile == null && dllFile != null) + { + exeFile = dllFile; + } + + // Special case for the app.config file in the Binaries POG... + // The POG refers to the files in the OBJ directory, while the + // generated WiX code references them in the bin directory. + // The app.config file gets renamed to match the exe name. + if ("Binaries" == pogName && null != exeFile && null != appConfigFile) + { + if (appConfigFile is Wix.File) + { + Wix.File appConfigFileAsWixFile = appConfigFile as Wix.File; + Wix.File exeFileAsWixFile = exeFile as Wix.File; + // Case insensitive replace + appConfigFileAsWixFile.Source = Regex.Replace(appConfigFileAsWixFile.Source, @"app\.config", Path.GetFileName(exeFileAsWixFile.Source) + ".config", RegexOptions.IgnoreCase); + } + } + + return fileCount; + } + + private void HarvestProjectOutputGroupFile(string baseDir, string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, string parentDirId, Wix.Component component, Wix.File file, Dictionary seenList) + { + string varFormat = VariableFormat; + if (this.generateWixVars) + { + varFormat = WixVariableFormat; + } + + if (pogName.Equals("Satellites", StringComparison.OrdinalIgnoreCase)) + { + Wix.Directory locDirectory = new Wix.Directory(); + + locDirectory.Name = Path.GetFileName(Path.GetDirectoryName(Path.GetFullPath(filePath))); + file.Source = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", locDirectory.Name, "\\", Path.GetFileName(filePath)); + + if (!seenList.ContainsKey(file.Source)) + { + parentDir.AddChild(locDirectory); + locDirectory.AddChild(component); + component.AddChild(file); + seenList.Add(file.Source, true); + + if (this.setUniqueIdentifiers) + { + locDirectory.Id = this.Core.GenerateIdentifier(DirectoryPrefix, parentDirId, locDirectory.Name); + file.Id = this.Core.GenerateIdentifier(FilePrefix, locDirectory.Id, fileName); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, locDirectory.Id, file.Id); + } + else + { + locDirectory.Id = this.Core.CreateIdentifierFromFilename(String.Format(DirectoryIdFormat, (parentDir is Wix.DirectoryRef) ? ((Wix.DirectoryRef)parentDir).Id : parentDirId, locDirectory.Name)); + file.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.FileIdFormat, projectName, pogName, String.Concat(locDirectory.Name, ".", fileName))); + component.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.ComponentIdFormat, projectName, pogName, String.Concat(locDirectory.Name, ".", fileName))); + } + } + } + else + { + file.Source = GenerateSourceFilePath(baseDir, projectName, pogFileSource, filePath, link, varFormat); + + if (!seenList.ContainsKey(file.Source)) + { + component.AddChild(file); + parentDir.AddChild(component); + seenList.Add(file.Source, true); + + if (this.setUniqueIdentifiers) + { + file.Id = this.Core.GenerateIdentifier(FilePrefix, parentDirId, fileName); + component.Id = this.Core.GenerateIdentifier(ComponentPrefix, parentDirId, file.Id); + } + else + { + file.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.FileIdFormat, projectName, pogName, fileName)); + component.Id = this.Core.CreateIdentifierFromFilename(String.Format(CultureInfo.InvariantCulture, VSProjectHarvester.ComponentIdFormat, projectName, pogName, fileName)); + } + } + } + } + + private void HarvestProjectOutputGroupPackage(string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, Dictionary seenList) + { + string varFormat = VariableFormat; + if (this.generateWixVars) + { + varFormat = WixVariableFormat; + } + + if (pogName.Equals("Binaries", StringComparison.OrdinalIgnoreCase)) + { + if (String.Equals(Path.GetExtension(filePath), ".exe", StringComparison.OrdinalIgnoreCase)) + { + Wix.ExePackage exePackage = new Wix.ExePackage(); + exePackage.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); + if (!seenList.ContainsKey(exePackage.SourceFile)) + { + parentDir.AddChild(exePackage); + seenList.Add(exePackage.SourceFile, true); + } + } + else if (String.Equals(Path.GetExtension(filePath), ".msi", StringComparison.OrdinalIgnoreCase)) + { + Wix.MsiPackage msiPackage = new Wix.MsiPackage(); + msiPackage.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); + if (!seenList.ContainsKey(msiPackage.SourceFile)) + { + parentDir.AddChild(msiPackage); + seenList.Add(msiPackage.SourceFile, true); + } + } + } + } + + private void HarvestProjectOutputGroupPayloadFile(string baseDir, string projectName, string pogName, string pogFileSource, string filePath, string fileName, string link, Wix.IParentElement parentDir, Wix.Payload file, Dictionary seenList) + { + string varFormat = VariableFormat; + if (this.generateWixVars) + { + varFormat = WixVariableFormat; + } + + if (pogName.Equals("Satellites", StringComparison.OrdinalIgnoreCase)) + { + string locDirectoryName = Path.GetFileName(Path.GetDirectoryName(Path.GetFullPath(filePath))); + file.SourceFile = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", locDirectoryName, "\\", Path.GetFileName(filePath)); + + if (!seenList.ContainsKey(file.SourceFile)) + { + parentDir.AddChild(file); + seenList.Add(file.SourceFile, true); + } + } + else + { + file.SourceFile = GenerateSourceFilePath(baseDir, projectName, pogFileSource, filePath, link, varFormat); + + if (!seenList.ContainsKey(file.SourceFile)) + { + parentDir.AddChild(file); + seenList.Add(file.SourceFile, true); + } + } + } + + /// + /// Helper function to generates a source file path when harvesting files. + /// + /// + /// + /// + /// + /// + /// + /// + private static string GenerateSourceFilePath(string baseDir, string projectName, string pogFileSource, string filePath, string link, string varFormat) + { + string ret; + + if (null == baseDir && !String.IsNullOrEmpty(link)) + { + // This needs to be the absolute path as a link can be located anywhere. + ret = filePath; + } + else if (null == baseDir) + { + ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", Path.GetFileName(filePath)); + } + else if (filePath.StartsWith(baseDir, StringComparison.OrdinalIgnoreCase)) + { + ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", filePath.Substring(baseDir.Length)); + } + else + { + // come up with a relative path to the file + Uri sourcePathUri = new Uri(filePath); + Uri baseDirUri = new Uri(baseDir); + Uri sourceRelativeUri = baseDirUri.MakeRelativeUri(sourcePathUri); + string relativePath = sourceRelativeUri.ToString().Replace('/', Path.DirectorySeparatorChar); + if (!sourceRelativeUri.UserEscaped) + { + relativePath = Uri.UnescapeDataString(relativePath); + } + + ret = String.Concat(String.Format(CultureInfo.InvariantCulture, varFormat, projectName, pogFileSource), "\\", relativePath); + } + + return ret; + } + + /// + /// Gets a Directory element corresponding to a relative subdirectory within the project, + /// either by locating a suitable existing Directory or creating a new one. + /// + /// The parent element which the subdirectory is relative to. + /// Relative path of the subdirectory. + /// Directory element for the relative path. + private Wix.IParentElement GetSubDirElement(Wix.IParentElement parentDir, Uri relativeUri) + { + string[] segments = relativeUri.ToString().Split('\\', '/'); + string firstSubDirName = Uri.UnescapeDataString(segments[0]); + DirectoryAttributeAccessor subDir = null; + + if (String.Equals(firstSubDirName, "..", StringComparison.Ordinal)) + { + return parentDir; + } + + Type directoryType; + Type directoryRefType; + if (parentDir is Wix.Directory || parentDir is Wix.DirectoryRef) + { + directoryType = typeof(Wix.Directory); + directoryRefType = typeof(Wix.DirectoryRef); + } + else + { + throw new ArgumentException("GetSubDirElement parentDir"); + } + + // Search for an existing directory element. + foreach (Wix.ISchemaElement childElement in parentDir.Children) + { + if(VSProjectHarvester.AreTypesEquivalent(childElement.GetType(), directoryType)) + { + DirectoryAttributeAccessor childDir = new DirectoryAttributeAccessor(childElement); + if (String.Equals(childDir.Name, firstSubDirName, StringComparison.OrdinalIgnoreCase)) + { + subDir = childDir; + break; + } + } + } + + if (subDir == null) + { + string parentId = null; + DirectoryAttributeAccessor parentDirectory = null; + DirectoryAttributeAccessor parentDirectoryRef = null; + + if (VSProjectHarvester.AreTypesEquivalent(parentDir.GetType(), directoryType)) + { + parentDirectory = new DirectoryAttributeAccessor((Wix.ISchemaElement)parentDir); + } + else if (VSProjectHarvester.AreTypesEquivalent(parentDir.GetType(), directoryRefType)) + { + parentDirectoryRef = new DirectoryAttributeAccessor((Wix.ISchemaElement)parentDir); + } + + if (parentDirectory != null) + { + parentId = parentDirectory.Id; + } + else if (parentDirectoryRef != null) + { + if (this.setUniqueIdentifiers) + { + //Use the GUID of the project instead of the project name to help keep things stable. + parentId = this.directoryRefSeed; + } + else + { + parentId = parentDirectoryRef.Id; + } + } + + Wix.ISchemaElement newDirectory = (Wix.ISchemaElement)directoryType.GetConstructor(new Type[] { }).Invoke(null); + subDir = new DirectoryAttributeAccessor(newDirectory); + + if (this.setUniqueIdentifiers) + { + subDir.Id = this.Core.GenerateIdentifier(DirectoryPrefix, parentId, firstSubDirName); + } + else + { + subDir.Id = String.Format(DirectoryIdFormat, parentId, firstSubDirName); + } + + subDir.Name = firstSubDirName; + + parentDir.AddChild(subDir.Element); + } + + if (segments.Length == 1) + { + return subDir.ElementAsParent; + } + else + { + Uri nextRelativeUri = new Uri(Uri.UnescapeDataString(relativeUri.ToString()).Substring(firstSubDirName.Length + 1), UriKind.Relative); + return this.GetSubDirElement(subDir.ElementAsParent, nextRelativeUri); + } + } + + private MSBuildProject GetMsbuildProject(string projectFile) + { + XmlDocument document = new XmlDocument(); + try + { + document.Load(projectFile); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadProject(projectFile, e.Message)); + } + + string version = null; + + if (this.UseToolsVersion) + { + foreach (XmlNode child in document.ChildNodes) + { + if (String.Equals(child.Name, "Project", StringComparison.Ordinal) && child.Attributes != null) + { + XmlNode toolsVersionAttribute = child.Attributes["ToolsVersion"]; + if (toolsVersionAttribute != null) + { + version = toolsVersionAttribute.Value; + this.Core.Messaging.Write(HarvesterVerboses.FoundToolsVersion(version)); + + break; + } + } + } + + switch (version) + { + case "4.0": + version = "4.0.0.0"; + break; + case "12.0": + version = "12.0.0.0"; + break; + case "14.0": + version = "14.0.0.0"; + break; + default: + if (String.IsNullOrEmpty(this.MsbuildBinPath)) + { + throw new WixException(HarvesterErrors.MsbuildBinPathRequired(version ?? "(none)")); + } + + version = null; + break; + } + } + + var project = this.ConstructMsbuild40Project(version); + return project; + } + + private Assembly ResolveFromMsbuildBinPath(object sender, ResolveEventArgs args) + { + var assemblyName = new AssemblyName(args.Name); + + var assemblyPath = Path.Combine(this.MsbuildBinPath, $"{assemblyName.Name}.dll"); + if (!File.Exists(assemblyPath)) + { + return null; + } + + return Assembly.LoadFrom(assemblyPath); + } + + private MSBuildProject ConstructMsbuild40Project(string loadVersion) + { + const string MSBuildEngineAssemblyName = "Microsoft.Build, Version={0}, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + const string MSBuildFrameworkAssemblyName = "Microsoft.Build.Framework, Version={0}, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + Assembly msbuildAssembly; + Assembly msbuildFrameworkAssembly; + + if (loadVersion == null) + { + this.Core.Messaging.Write(HarvesterVerboses.LoadingProjectWithBinPath(this.MsbuildBinPath)); + AppDomain.CurrentDomain.AssemblyResolve += this.ResolveFromMsbuildBinPath; + + try + { + msbuildAssembly = Assembly.Load("Microsoft.Build"); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + + try + { + msbuildFrameworkAssembly = Assembly.Load("Microsoft.Build.Framework"); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + } + else + { + this.Core.Messaging.Write(HarvesterVerboses.LoadingProjectWithVersion(loadVersion)); + + try + { + msbuildAssembly = Assembly.Load(String.Format(MSBuildEngineAssemblyName, loadVersion)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + + try + { + msbuildFrameworkAssembly = Assembly.Load(String.Format(MSBuildFrameworkAssemblyName, loadVersion)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildAssembly(e.Message)); + } + } + + Type projectType; + Type buildItemType; + + Type buildManagerType; + Type buildParametersType; + Type buildRequestDataFlagsType; + Type buildRequestDataType; + Type hostServicesType; + Type projectCollectionType; + Type projectInstanceType; + + Type writeHandlerType; + Type colorSetterType; + Type colorResetterType; + Type loggerVerbosityType; + Type consoleLoggerType; + Type iLoggerType; + + try + { + buildItemType = msbuildAssembly.GetType("Microsoft.Build.Execution.ProjectItemInstance", true); + projectType = msbuildAssembly.GetType("Microsoft.Build.Evaluation.Project", true); + + buildManagerType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildManager", true); + buildParametersType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildParameters", true); + buildRequestDataFlagsType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildRequestDataFlags", true); + buildRequestDataType = msbuildAssembly.GetType("Microsoft.Build.Execution.BuildRequestData", true); + hostServicesType = msbuildAssembly.GetType("Microsoft.Build.Execution.HostServices", true); + projectCollectionType = msbuildAssembly.GetType("Microsoft.Build.Evaluation.ProjectCollection", true); + projectInstanceType = msbuildAssembly.GetType("Microsoft.Build.Execution.ProjectInstance", true); + + writeHandlerType = msbuildAssembly.GetType("Microsoft.Build.Logging.WriteHandler", true); + colorSetterType = msbuildAssembly.GetType("Microsoft.Build.Logging.ColorSetter", true); + colorResetterType = msbuildAssembly.GetType("Microsoft.Build.Logging.ColorResetter", true); + loggerVerbosityType = msbuildFrameworkAssembly.GetType("Microsoft.Build.Framework.LoggerVerbosity", true); + consoleLoggerType = msbuildAssembly.GetType("Microsoft.Build.Logging.ConsoleLogger", true); + iLoggerType = msbuildFrameworkAssembly.GetType("Microsoft.Build.Framework.ILogger", true); + } + catch (TargetInvocationException tie) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildEngine(tie.InnerException.Message)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadMSBuildEngine(e.Message)); + } + + MSBuild40Types types = new MSBuild40Types(); + types.buildManagerType = buildManagerType; + types.buildParametersType = buildParametersType; + types.buildRequestDataFlagsType = buildRequestDataFlagsType; + types.buildRequestDataType = buildRequestDataType; + types.hostServicesType = hostServicesType; + types.projectCollectionType = projectCollectionType; + types.projectInstanceType = projectInstanceType; + types.writeHandlerType = writeHandlerType; + types.colorSetterType = colorSetterType; + types.colorResetterType = colorResetterType; + types.loggerVerbosityType = loggerVerbosityType; + types.consoleLoggerType = consoleLoggerType; + types.iLoggerType = iLoggerType; + return new MSBuild40Project(null, projectType, buildItemType, loadVersion, types, this.Core, this.configuration, this.platform); + } + + private static bool AreTypesEquivalent(Type a, Type b) + { + return (a == b) || (a.IsAssignableFrom(b) && b.IsAssignableFrom(a)); + } + + private abstract class MSBuildProject + { + protected Type projectType; + protected Type buildItemType; + protected object project; + private string loadVersion; + + public MSBuildProject(object project, Type projectType, Type buildItemType, string loadVersion) + { + this.project = project; + this.projectType = projectType; + this.buildItemType = buildItemType; + this.loadVersion = loadVersion; + } + + public string LoadVersion + { + get { return this.loadVersion; } + } + + public abstract bool Build(string projectFileName, string[] targetNames, IDictionary targetOutputs); + + public abstract MSBuildProjectItemType GetBuildItem(object buildItem); + + public abstract IEnumerable GetEvaluatedItemsByName(string itemName); + + public abstract string GetEvaluatedProperty(string propertyName); + + public abstract void Load(string projectFileName); + } + + private abstract class MSBuildProjectItemType + { + public MSBuildProjectItemType(object buildItem) + { + this.buildItem = buildItem; + } + + public abstract override string ToString(); + + public abstract string GetMetadata(string name); + + protected object buildItem; + } + + + private struct MSBuild40Types + { + public Type buildManagerType; + public Type buildParametersType; + public Type buildRequestDataFlagsType; + public Type buildRequestDataType; + public Type hostServicesType; + public Type projectCollectionType; + public Type projectInstanceType; + public Type writeHandlerType; + public Type colorSetterType; + public Type colorResetterType; + public Type loggerVerbosityType; + public Type consoleLoggerType; + public Type iLoggerType; + } + + private class MSBuild40Project : MSBuildProject + { + private MSBuild40Types types; + private object projectCollection; + private object currentProjectInstance; + private object buildManager; + private object buildParameters; + private IHarvesterCore harvesterCore; + + public MSBuild40Project(object project, Type projectType, Type buildItemType, string loadVersion, MSBuild40Types types, IHarvesterCore harvesterCore, string configuration, string platform) + : base(project, projectType, buildItemType, loadVersion) + { + this.types = types; + this.harvesterCore = harvesterCore; + + this.buildParameters = this.types.buildParametersType.GetConstructor(new Type[] { }).Invoke(null); + + try + { + var loggers = this.CreateLoggers(); + + // this.buildParameters.Loggers = loggers; + this.types.buildParametersType.GetProperty("Loggers").SetValue(this.buildParameters, loggers, null); + } + catch (TargetInvocationException tie) + { + if (this.harvesterCore != null) + { + this.harvesterCore.Messaging.Write(HarvesterWarnings.NoLogger(tie.InnerException.Message)); + } + } + catch (Exception e) + { + if (this.harvesterCore != null) + { + this.harvesterCore.Messaging.Write(HarvesterWarnings.NoLogger(e.Message)); + } + } + + this.buildManager = this.types.buildManagerType.GetConstructor(new Type[] { }).Invoke(null); + + if (configuration != null || platform != null) + { + Dictionary globalVariables = new Dictionary(); + if (configuration != null) + { + globalVariables.Add("Configuration", configuration); + } + + if (platform != null) + { + globalVariables.Add("Platform", platform); + } + + this.projectCollection = this.types.projectCollectionType.GetConstructor(new Type[] { typeof(IDictionary) }).Invoke(new object[] { globalVariables }); + } + else + { + this.projectCollection = this.types.projectCollectionType.GetConstructor(new Type[] {}).Invoke(null); + } + } + + private object CreateLoggers() + { + var logger = new HarvestLogger(this.harvesterCore.Messaging); + var loggerVerbosity = Enum.Parse(this.types.loggerVerbosityType, "Minimal"); + var writeHandler = Delegate.CreateDelegate(this.types.writeHandlerType, logger, nameof(logger.LogMessage)); + var colorSetter = Delegate.CreateDelegate(this.types.colorSetterType, logger, nameof(logger.SetColor)); + var colorResetter = Delegate.CreateDelegate(this.types.colorResetterType, logger, nameof(logger.ResetColor)); + + var consoleLoggerCtor = this.types.consoleLoggerType.GetConstructor(new Type[] { + this.types.loggerVerbosityType, + this.types.writeHandlerType, + this.types.colorSetterType, + this.types.colorResetterType, + }); + var consoleLogger = consoleLoggerCtor.Invoke(new object[] { loggerVerbosity, writeHandler, colorSetter, colorResetter }); + + var loggers = Array.CreateInstance(this.types.iLoggerType, 1); + loggers.SetValue(consoleLogger, 0); + + return loggers; + } + + public override bool Build(string projectFileName, string[] targetNames, IDictionary targetOutputs) + { + try + { + // this.buildManager.BeginBuild(this.buildParameters); + this.types.buildManagerType.GetMethod("BeginBuild", new Type[] { this.types.buildParametersType }).Invoke(this.buildManager, new object[] { this.buildParameters }); + + // buildRequestData = new BuildRequestData(this.currentProjectInstance, targetNames, null, BuildRequestData.BuildRequestDataFlags.ReplaceExistingProjectInstance); + ConstructorInfo buildRequestDataCtor = this.types.buildRequestDataType.GetConstructor( + new Type[] + { + this.types.projectInstanceType, typeof(string[]), this.types.hostServicesType, this.types.buildRequestDataFlagsType + }); + object buildRequestDataFlags = this.types.buildRequestDataFlagsType.GetField("ReplaceExistingProjectInstance").GetRawConstantValue(); + object buildRequestData = buildRequestDataCtor.Invoke(new object[] { this.currentProjectInstance, targetNames, null, buildRequestDataFlags }); + + // BuildSubmission submission = this.buildManager.PendBuildRequest(buildRequestData); + object submission = this.types.buildManagerType.GetMethod("PendBuildRequest", new Type[] { this.types.buildRequestDataType }) + .Invoke(this.buildManager, new object[] { buildRequestData }); + + // BuildResult buildResult = submission.Execute(); + object buildResult = submission.GetType().GetMethod("Execute", new Type[] { }).Invoke(submission, null); + + // bool buildSucceeded = buildResult.OverallResult == BuildResult.Success; + object overallResult = buildResult.GetType().GetProperty("OverallResult").GetValue(buildResult, null); + bool buildSucceeded = String.Equals(overallResult.ToString(), "Success", StringComparison.Ordinal); + + // this.buildManager.EndBuild(); + this.types.buildManagerType.GetMethod("EndBuild", new Type[] { }).Invoke(this.buildManager, null); + + // fill in empty lists for each target so that heat will look at the item group later + foreach (string target in targetNames) + { + targetOutputs.Add(target, new List()); + } + + return buildSucceeded; + } + catch (TargetInvocationException tie) + { + throw new WixException(HarvesterErrors.CannotBuildProject(projectFileName, tie.InnerException.Message)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotBuildProject(projectFileName, e.Message)); + } + } + + public override MSBuildProjectItemType GetBuildItem(object buildItem) + { + return new MSBuild40ProjectItemType(buildItem); + } + + public override IEnumerable GetEvaluatedItemsByName(string itemName) + { + MethodInfo getEvaluatedItem = this.types.projectInstanceType.GetMethod("GetItems", new Type[] { typeof(string) }); + return (IEnumerable)getEvaluatedItem.Invoke(this.currentProjectInstance, new object[] { itemName }); + } + + public override string GetEvaluatedProperty(string propertyName) + { + MethodInfo getProperty = this.types.projectInstanceType.GetMethod("GetPropertyValue", new Type[] { typeof(string) }); + return (string)getProperty.Invoke(this.currentProjectInstance, new object[] { propertyName }); + } + + public override void Load(string projectFileName) + { + try + { + //this.project = this.projectCollection.LoadProject(projectFileName); + this.project = this.types.projectCollectionType.GetMethod("LoadProject", new Type[] { typeof(string) }).Invoke(this.projectCollection, new object[] { projectFileName }); + + // this.currentProjectInstance = this.project.CreateProjectInstance(); + MethodInfo createProjectInstanceMethod = this.projectType.GetMethod("CreateProjectInstance", new Type[] { }); + this.currentProjectInstance = createProjectInstanceMethod.Invoke(this.project, null); + } + catch (TargetInvocationException tie) + { + throw new WixException(HarvesterErrors.CannotLoadProject(projectFileName, tie.InnerException.Message)); + } + catch (Exception e) + { + throw new WixException(HarvesterErrors.CannotLoadProject(projectFileName, e.Message)); + } + } + } + + private class MSBuild40ProjectItemType : MSBuildProjectItemType + { + public MSBuild40ProjectItemType(object buildItem) + : base(buildItem) + { + } + + public override string ToString() + { + PropertyInfo includeProperty = this.buildItem.GetType().GetProperty("EvaluatedInclude"); + return (string)includeProperty.GetValue(this.buildItem, null); + } + + public override string GetMetadata(string name) + { + MethodInfo getMetadataMethod = this.buildItem.GetType().GetMethod("GetMetadataValue"); + if (null != getMetadataMethod) + { + return (string)getMetadataMethod.Invoke(this.buildItem, new object[] { name }); + } + return string.Empty; + } + } + + /// + /// Used internally in the VSProjectHarvester class to encapsulate + /// the settings for a particular MSBuild "project output group". + /// + private struct ProjectOutputGroup + { + public readonly string Name; + public readonly string BuildOutputGroup; + public readonly string FileSource; + + /// + /// Creates a new project output group. + /// + /// Friendly name used by heat. + /// MSBuild's name of the project output group. + /// VS directory token containing the files of the POG. + public ProjectOutputGroup(string name, string buildOutputGroup, string fileSource) + { + this.Name = name; + this.BuildOutputGroup = buildOutputGroup; + this.FileSource = fileSource; + } + } + + /// + /// Internal class for getting and setting common attrbiutes on + /// directory elements. + /// + internal class DirectoryAttributeAccessor + { + public Wix.ISchemaElement directoryElement; + + public DirectoryAttributeAccessor(Wix.ISchemaElement directoryElement) + { + this.directoryElement = directoryElement; + } + + /// + /// Gets the element as a ISchemaElement. + /// + public Wix.ISchemaElement Element + { + get { return this.directoryElement; } + } + + /// + /// Gets the element as a IParentElement. + /// + public Wix.IParentElement ElementAsParent + { + get { return (Wix.IParentElement)this.directoryElement; } + } + + /// + /// Gets or sets the Id attrbiute. + /// + public string Id + { + get + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + return wixDirectory.Id; + } + else if (this.directoryElement is Wix.DirectoryRef wixDirectoryRef) + { + return wixDirectoryRef.Id; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Id")); + } + } + set + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + wixDirectory.Id = value; + } + else if (this.directoryElement is Wix.DirectoryRef wixDirectoryRef) + { + wixDirectoryRef.Id = value; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Id")); + } + } + } + + /// + /// Gets or sets the Name attribute. + /// + public string Name + { + get + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + return wixDirectory.Name; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Name")); + } + } + set + { + if (this.directoryElement is Wix.Directory wixDirectory) + { + wixDirectory.Name = value; + } + else + { + throw new WixException(HarvesterErrors.DirectoryAttributeAccessorBadType("Name")); + } + } + } + } + + internal class HarvestLogger + { + public HarvestLogger(IMessaging messaging) + { + this.Color = ConsoleColor.Black; + this.Messaging = messaging; + } + + private ConsoleColor Color { get; set; } + private IMessaging Messaging { get; } + + public void LogMessage(string message) + { + if (this.Color == ConsoleColor.Red) + { + this.Messaging.Write(HarvesterErrors.BuildErrorDuringHarvesting(message)); + } + } + + public void SetColor(ConsoleColor color) + { + this.Color = color; + } + + public void ResetColor() + { + this.Color = ConsoleColor.Black; + } + } + } +} diff --git a/src/wix/heat/app.config b/src/wix/heat/app.config new file mode 100644 index 00000000..65d3d6c3 --- /dev/null +++ b/src/wix/heat/app.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/wix/heat/heat.csproj b/src/wix/heat/heat.csproj new file mode 100644 index 00000000..650203b0 --- /dev/null +++ b/src/wix/heat/heat.csproj @@ -0,0 +1,54 @@ + + + + + + netcoreapp3.1;net461 + Exe + Harvester + WiX Harvester + embedded + true + + win-x86 + app.config + heat.exe.manifest + LatestMajor + + + + + + + + + True + True + WixHarvesterStrings.resx + + + + + + ResXFileCodeGenerator + WixHarvesterStrings.Designer.cs + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/heat/heat.exe.manifest b/src/wix/heat/heat.exe.manifest new file mode 100644 index 00000000..b4adfbb7 --- /dev/null +++ b/src/wix/heat/heat.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + WiX Toolset Harvester + + + + + + + + + + true + + + diff --git a/src/wix/heat/heat.net461.v3.ncrunchproject b/src/wix/heat/heat.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/heat/heat.net461.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/heat/heat.netcoreapp2.1.v3.ncrunchproject b/src/wix/heat/heat.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/heat/heat.netcoreapp2.1.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/nuget-Tools.config b/src/wix/nuget-Tools.config new file mode 100644 index 00000000..81117c3d --- /dev/null +++ b/src/wix/nuget-Tools.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs b/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs new file mode 100644 index 00000000..9d132f66 --- /dev/null +++ b/src/wix/test/WixToolsetTest.BuildTasks/WixBuildTaskFixture.cs @@ -0,0 +1,67 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.BuildTasks +{ + using System.IO; + using System.Linq; + using Microsoft.Build.Utilities; + using WixBuildTools.TestSupport; + using WixToolset.BuildTasks; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using Xunit; + + public class WixBuildTaskFixture + { + [Fact] + public void CanBuildSimpleMsiPackage() + { + var folder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var pdbPath = Path.Combine(baseFolder, @"bin\testpackage.wixpdb"); + var engine = new FakeBuildEngine(); + + var task = new WixBuild + { + BuildEngine = engine, + SourceFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.wxs")), + new TaskItem(Path.Combine(folder, "PackageComponents.wxs")), + }, + LocalizationFiles = new[] + { + new TaskItem(Path.Combine(folder, "Package.en-us.wxl")), + }, + BindInputPaths = new[] + { + new TaskItem(Path.Combine(folder, "data")), + }, + IntermediateDirectory = new TaskItem(intermediateFolder), + OutputFile = new TaskItem(Path.Combine(baseFolder, @"bin\test.msi")), + PdbType = "Full", + PdbFile = new TaskItem(pdbPath), + DefaultCompressionLevel = "nOnE", + }; + + var result = task.Execute(); + Assert.True(result, $"MSBuild task failed unexpectedly. Output:\r\n{engine.Output}"); + + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); + Assert.True(File.Exists(pdbPath)); + Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\cab1.cab"))); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(folder, @"data\test.txt"), fileSymbol[FileSymbolFields.Source].AsPath().Path); + Assert.Equal(@"test.txt", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath().Path); + } + } + } +} diff --git a/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj b/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj new file mode 100644 index 00000000..c01860cd --- /dev/null +++ b/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.csproj @@ -0,0 +1,35 @@ + + + + + + net461 + false + embedded + win-x86 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject b/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject new file mode 100644 index 00000000..f1d03cd7 --- /dev/null +++ b/src/wix/test/WixToolsetTest.BuildTasks/WixToolsetTest.BuildTasks.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Heat/HeatRunner.cs b/src/wix/test/WixToolsetTest.Heat/HeatRunner.cs new file mode 100644 index 00000000..287698a9 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Heat/HeatRunner.cs @@ -0,0 +1,92 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Harvesters +{ + using System; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Core; + using WixToolset.Core.Burn; + using WixToolset.Core.TestPackage; + using WixToolset.Data; + using WixToolset.Extensibility.Data; + using WixToolset.Extensibility.Services; + using WixToolset.Harvesters; + + /// + /// Utility class to emulate heat.exe. + /// + public static class HeatRunner + { + /// + /// Emulates calling heat.exe. + /// + /// + /// + /// + /// + public static int Execute(string[] args, out List messages, bool warningsAsErrors = true) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var task = Execute(args, serviceProvider, out messages, warningsAsErrors: warningsAsErrors); + return task.Result; + } + + /// + /// Emulates calling wix.exe with standard backends. + /// This overload always treats warnings as errors. + /// + /// + /// + public static WixRunnerResult Execute(params string[] args) + { + return Execute(true, args); + } + + /// + /// Emulates calling wix.exe with standard backends. + /// + /// + /// + /// + public static WixRunnerResult Execute(bool warningsAsErrors, params string[] args) + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); + var exitCode = Execute(args, serviceProvider, out var messages, warningsAsErrors: warningsAsErrors); + return new WixRunnerResult { ExitCode = exitCode.Result, Messages = messages.ToArray() }; + } + + /// + /// Emulates calling wix.exe with standard backends. + /// + /// + /// + /// + /// + /// + public static Task Execute(string[] args, IWixToolsetCoreServiceProvider coreProvider, out List messages, bool warningsAsErrors = true) + { + coreProvider.AddBundleBackend(); + + var listener = new TestMessageListener(); + + messages = listener.Messages; + + var messaging = coreProvider.GetService(); + messaging.SetListener(listener); + + if (warningsAsErrors) + { + messaging.WarningsAsError = true; + } + + var arguments = coreProvider.GetService(); + arguments.Populate(args); + + var commandLine = HeatCommandLineFactory.CreateCommandLine(coreProvider); + var command = commandLine.ParseStandardCommandLine(arguments); + return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1); + } + } +} diff --git a/src/wix/test/WixToolsetTest.Heat/PayloadTests.cs b/src/wix/test/WixToolsetTest.Heat/PayloadTests.cs new file mode 100644 index 00000000..8072f50d --- /dev/null +++ b/src/wix/test/WixToolsetTest.Heat/PayloadTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Harvesters +{ + using System; + using System.IO; + using WixBuildTools.TestSupport; + using Xunit; + + public class PayloadTests + { + [Fact] + public void CanHarvestExePackagePayload() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var outputFilePath = Path.Combine(baseFolder, "test.wxs"); + + var result = HeatRunner.Execute(new[] + { + "exepackagepayload", + Path.Combine(folder, ".Data", "burn.exe"), + "-o", outputFilePath, + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(outputFilePath)); + + var expected = File.ReadAllText(Path.Combine(folder, "Payload", "HarvestedExePackagePayload.wxs")).Replace("\r\n", "\n"); + var actual = File.ReadAllText(outputFilePath).Replace("\r\n", "\n"); + Assert.Equal(expected, actual); + } + } + + [Fact] + public void CanHarvestMsuPackagePayload() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var outputFilePath = Path.Combine(baseFolder, "test.wxs"); + + var result = HeatRunner.Execute(new[] + { + "msupackagepayload", + Path.Combine(folder, ".Data", "Windows8.1-KB2937592-x86.msu"), + "-o", outputFilePath, + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(outputFilePath)); + + var expected = File.ReadAllText(Path.Combine(folder, "Payload", "HarvestedMsuPackagePayload.wxs")).Replace("\r\n", "\n"); + var actual = File.ReadAllText(outputFilePath).Replace("\r\n", "\n"); + Assert.Equal(expected, actual); + } + } + } +} diff --git a/src/wix/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu b/src/wix/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu new file mode 100644 index 00000000..c39f53b0 Binary files /dev/null and b/src/wix/test/WixToolsetTest.Heat/TestData/.Data/Windows8.1-KB2937592-x86.msu differ diff --git a/src/wix/test/WixToolsetTest.Heat/TestData/.Data/burn.exe b/src/wix/test/WixToolsetTest.Heat/TestData/.Data/burn.exe new file mode 100644 index 00000000..2a4f423f Binary files /dev/null and b/src/wix/test/WixToolsetTest.Heat/TestData/.Data/burn.exe differ diff --git a/src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs b/src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs new file mode 100644 index 00000000..40100f22 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedExePackagePayload.wxs @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs b/src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs new file mode 100644 index 00000000..f203fe27 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Heat/TestData/Payload/HarvestedMsuPackagePayload.wxs @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj b/src/wix/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj new file mode 100644 index 00000000..4af6749c --- /dev/null +++ b/src/wix/test/WixToolsetTest.Heat/WixToolsetTest.Heat.csproj @@ -0,0 +1,28 @@ + + + + + + netcoreapp3.1 + false + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs new file mode 100644 index 00000000..3c8e79e7 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs @@ -0,0 +1,442 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Sdk +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + using Xunit; + + public class MsbuildFixture + { + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleBundle(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "SimpleBundle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "SimpleBundle.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(new[] + { + @"bin\x86\Release\SimpleBundle.exe", + @"bin\x86\Release\SimpleBundle.wixpdb", + }, paths); + } + } + + [Theory(Skip = "Test demonstrates failure")] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildUncompressedBundle(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "UncompressedBundle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "UncompressedBundle.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(new[] + { + @"bin\x86\Release\SimpleBundle.exe", + @"bin\x86\Release\SimpleBundle.wixpdb", + @"bin\x86\Release\test.txt", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule\SimpleMergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "SimpleMergeModule.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(new[] + { + @"bin\x86\Release\SimpleMergeModule.msm", + @"bin\x86\Release\SimpleMergeModule.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.Contains("-platform x86")); + Assert.Single(platformSwitches); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Equal(4, warnings.Count()); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(new[] + { + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithMergeModule(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\MergeModule"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "MergeMsiPackage"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MergeMsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(new[] + { + @"bin\x86\Release\cab1.cab", + @"bin\x86\Release\MergeMsiPackage.msi", + @"bin\x86\Release\MergeMsiPackage.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildWithDefaultAndExplicitlyFullWixpdbs(BuildSystem buildSystem) + { + var expectedOutputs = new[] + { + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + @"bin\x86\Release\en-US\MsiPackage.wixpdb", + }; + + this.AssertWixpdb(buildSystem, null, expectedOutputs); + this.AssertWixpdb(buildSystem, "Full", expectedOutputs); + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildWithNoWixpdb(BuildSystem buildSystem) + { + this.AssertWixpdb(buildSystem, "NONE", new[] + { + @"bin\x86\Release\en-US\cab1.cab", + @"bin\x86\Release\en-US\MsiPackage.msi", + }); + } + + private void AssertWixpdb(BuildSystem buildSystem, string wixpdbType, string[] expectedOutputFiles) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + wixpdbType == null ? String.Empty : $"-p:WixPdbType={wixpdbType}", + }); + result.AssertSuccess(); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(expectedOutputFiles, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuild64BitMsiPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + $"-p:Platform=x64", + }); + result.AssertSuccess(); + + var platformSwitches = result.Output.Where(line => line.Contains("-platform x64")); + Assert.Single(platformSwitches); + + var paths = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + WixAssert.CompareLineByLine(new[] + { + @"bin\x64\Release\en-US\cab1.cab", + @"bin\x64\Release\en-US\MsiPackage.msi", + @"bin\x64\Release\en-US\MsiPackage.wixpdb", + }, paths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithIceSuppressions(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressIces", "ICE45;ICE46"), + }); + result.AssertSuccess(); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildSimpleMsiPackageWithWarningSuppressions(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "SuppressSpecificWarnings", "1118;1102"), + }); + result.AssertSuccess(); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk, null)] + [InlineData(BuildSystem.DotNetCoreSdk, true)] + [InlineData(BuildSystem.MSBuild, null)] + [InlineData(BuildSystem.MSBuild, true)] + [InlineData(BuildSystem.MSBuild64, null)] + [InlineData(BuildSystem.MSBuild64, true)] + public void CanBuildSimpleMsiPackageAsWixipl(BuildSystem buildSystem, bool? outOfProc) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + "-p:OutputType=IntermediatePostLink", + }, outOfProc: outOfProc); + result.AssertSuccess(); + + var wixBuildCommands = MsbuildUtilities.GetToolCommandLines(result, "wix", "build", buildSystem, outOfProc); + Assert.Single(wixBuildCommands); + + var path = Directory.EnumerateFiles(binFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .Single(); + Assert.Equal(@"bin\x86\Release\MsiPackage.wixipl", path); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildAndCleanSimpleMsiPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + // Build + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, verbosityLevel: "diag"); + result.AssertSuccess(); + + var buildOutput = String.Join("\r\n", result.Output); + + var createdPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .OrderBy(s => s) + .ToArray(); + Assert.NotEmpty(createdPaths); + + // Clean + result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + "-t:Clean", + }, verbosityLevel: "diag"); + result.AssertSuccess(); + + var cleanOutput = String.Join("\r\n", result.Output); + + // Clean is only expected to delete the files listed in {Project}.FileListAbsolute.txt, + // so this is not quite right but close enough. + var allowedFiles = new HashSet + { + "MsiPackage.wixproj", + "Package.en-us.wxl", + "Package.wxs", + "PackageComponents.wxs", + @"data\test.txt", + @"obj\x86\Release\MsiPackage.wixproj.FileListAbsolute.txt", + }; + + var remainingPaths = Directory.EnumerateFiles(baseFolder, @"*.*", SearchOption.AllDirectories) + .Select(s => s.Substring(baseFolder.Length + 1)) + .Where(s => !allowedFiles.Contains(s)) + .OrderBy(s => s) + .ToArray(); + Assert.Empty(remainingPaths); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void ReportsInnerExceptionForUnexpectedExceptions(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\SimpleMsiPackage\MsiPackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var projectPath = Path.Combine(baseFolder, "MsiPackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + MsbuildUtilities.GetQuotedPropertySwitch(buildSystem, "WixToolDir", Path.Combine(MsbuildUtilities.WixMsbuildPath, "broken", "net461")), + }, outOfProc: true); + Assert.Equal(1, result.ExitCode); + + var expectedMessage = "System.PlatformNotSupportedException: Could not find platform specific 'wixnative.exe' ---> System.IO.FileNotFoundException: Could not find internal piece of WiX Toolset from"; + Assert.Contains(result.Output, m => m.Contains(expectedMessage)); + } + } + } +} diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs new file mode 100644 index 00000000..8b2e8e3d --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildHeatFixture.cs @@ -0,0 +1,375 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Sdk +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using Xunit; + + public class MsbuildHeatFixture + { + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildHeatFilePackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\HeatFilePackage"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatFilePackage.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); + Assert.Single(heatCommandLines); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ProductComponents_INSTALLFOLDER_HeatFilePackage.wixproj_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal(@"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFilePackage.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(@"SourceDir\HeatFilePackage.wixproj", fileSymbol[FileSymbolFields.Source].PreviousValue.AsPath()?.Path); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk)] + [InlineData(BuildSystem.MSBuild)] + [InlineData(BuildSystem.MSBuild64)] + public void CanBuildHeatFileWithMultipleFilesPackage(BuildSystem buildSystem) + { + var sourceFolder = TestData.Get(@"TestData\HeatFileMultipleFilesSameFileName"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = fs.BaseFolder; + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatFileMultipleFilesSameFileName.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "file", buildSystem, true); + Assert.Equal(2, heatCommandLines.Count()); + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_TxtProductComponents_INSTALLFOLDER_MyProgram.txt_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_JsonProductComponents_INSTALLFOLDER_MyProgram.json_file.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + generatedContents = File.ReadAllText(generatedFilePath); + testXml = generatedContents.GetTestXml(); + Assert.Equal("" + + "" + + "" + + "" + + @"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatFileMultipleFilesSameFileName.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbols = section.Symbols.OfType().ToArray(); + Assert.Equal(@"SourceDir\MyProgram.txt", fileSymbols[0][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); + Assert.Equal(@"SourceDir\MyProgram.json", fileSymbols[1][FileSymbolFields.Source].PreviousValue.AsPath()?.Path); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk, true)] + [InlineData(BuildSystem.DotNetCoreSdk, false)] + [InlineData(BuildSystem.MSBuild, true)] + [InlineData(BuildSystem.MSBuild, false)] + [InlineData(BuildSystem.MSBuild64, true)] + [InlineData(BuildSystem.MSBuild64, false)] + public void CanBuildHeatProjectPreSdkStyle(BuildSystem buildSystem, bool useToolsVersion) + { + var sourceFolder = TestData.Get(@"TestData\HeatProject"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectPreSdkStyle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatProjectPreSdkStyle.wixproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, + }); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); + var heatCommandLine = Assert.Single(heatCommandLines); + + if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) + { + Assert.Contains("-usetoolsversion", heatCommandLine); + } + else + { + Assert.DoesNotContain("-usetoolsversion", heatCommandLine); + } + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_ToolsVersion4Cs.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal(@"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatProjectPreSdkStyle.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(fs.BaseFolder, "ToolsVersion4Cs", "bin", "Release\\\\ToolsVersion4Cs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); + } + } + + [Theory] + [InlineData(BuildSystem.DotNetCoreSdk, true)] + [InlineData(BuildSystem.DotNetCoreSdk, false)] + [InlineData(BuildSystem.MSBuild, true)] + [InlineData(BuildSystem.MSBuild, false)] + [InlineData(BuildSystem.MSBuild64, true)] + [InlineData(BuildSystem.MSBuild64, false)] + public void CanBuildHeatProjectSdkStyle(BuildSystem buildSystem, bool useToolsVersion) + { + var sourceFolder = TestData.Get(@"TestData\HeatProject"); + + using (var fs = new TestDataFolderFileSystem()) + { + fs.Initialize(sourceFolder); + var baseFolder = Path.Combine(fs.BaseFolder, "HeatProjectSdkStyle"); + var binFolder = Path.Combine(baseFolder, @"bin\"); + var intermediateFolder = Path.Combine(baseFolder, @"obj\"); + var projectPath = Path.Combine(baseFolder, "HeatProjectSdkStyle.wixproj"); + var referencedProjectPath = Path.Combine(fs.BaseFolder, "SdkStyleCs", "SdkStyleCs.csproj"); + + var result = MsbuildUtilities.BuildProject(buildSystem, referencedProjectPath, new[] + { + "-t:restore", + }); + result.AssertSuccess(); + + result = MsbuildUtilities.BuildProject(buildSystem, projectPath, new[] + { + useToolsVersion ? $"-p:HarvestProjectsUseToolsVersion=true" : String.Empty, + }); + result.AssertSuccess(); + + var heatCommandLines = MsbuildUtilities.GetToolCommandLines(result, "heat", "project", buildSystem, true); + var heatCommandLine = Assert.Single(heatCommandLines); + + if (useToolsVersion && buildSystem != BuildSystem.DotNetCoreSdk) + { + Assert.Contains("-usetoolsversion", heatCommandLine); + } + else + { + Assert.DoesNotContain("-usetoolsversion", heatCommandLine); + } + + var warnings = result.Output.Where(line => line.Contains(": warning")); + Assert.Empty(warnings); + + var generatedFilePath = Path.Combine(intermediateFolder, "x86", "Release", "_SdkStyleCs.wxs"); + Assert.True(File.Exists(generatedFilePath)); + + var generatedContents = File.ReadAllText(generatedFilePath); + var testXml = generatedContents.GetTestXml(); + Assert.Equal(@"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "", testXml); + + var pdbPath = Path.Combine(binFolder, "x86", "Release", "HeatProjectSdkStyle.wixpdb"); + Assert.True(File.Exists(pdbPath)); + + var intermediate = Intermediate.Load(pdbPath); + var section = intermediate.Sections.Single(); + + var fileSymbol = section.Symbols.OfType().Single(); + Assert.Equal(Path.Combine(fs.BaseFolder, "SdkStyleCs", "bin", "Release", "netstandard2.0\\\\SdkStyleCs.dll"), fileSymbol[FileSymbolFields.Source].AsPath()?.Path); + } + } + } +} diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildUtilities.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildUtilities.cs new file mode 100644 index 00000000..2e07af3a --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildUtilities.cs @@ -0,0 +1,98 @@ +// Copyright(c) .NET Foundation and contributors.All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.Sdk +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + + public enum BuildSystem + { + DotNetCoreSdk, + MSBuild, + MSBuild64, + } + + public static class MsbuildUtilities + { + public static readonly string WixMsbuildPath = Path.Combine(Path.GetDirectoryName(new Uri(typeof(MsbuildUtilities).Assembly.CodeBase).AbsolutePath), "..", "publish", "WixToolset.Sdk"); + public static readonly string WixPropsPath = Path.Combine(WixMsbuildPath, "build", "WixToolset.Sdk.props"); + + public static MsbuildRunnerResult BuildProject(BuildSystem buildSystem, string projectPath, string[] arguments = null, string configuration = "Release", bool? outOfProc = null, string verbosityLevel = "normal") + { + var allArgs = new List + { + $"-verbosity:{verbosityLevel}", + $"-p:Configuration={configuration}", + GetQuotedPropertySwitch(buildSystem, "WixMSBuildProps", MsbuildUtilities.WixPropsPath), + // Node reuse means that child msbuild processes can stay around after the build completes. + // Under that scenario, the root msbuild does not reliably close its streams which causes us to hang. + "-nr:false", + }; + + if (outOfProc.HasValue) + { + allArgs.Add($"-p:RunWixToolsOutOfProc={outOfProc.Value}"); + } + + if (arguments != null) + { + allArgs.AddRange(arguments); + } + + switch (buildSystem) + { + case BuildSystem.DotNetCoreSdk: + { + allArgs.Add(projectPath); + var result = DotnetRunner.Execute("msbuild", allArgs.ToArray()); + return new MsbuildRunnerResult + { + ExitCode = result.ExitCode, + Output = result.StandardOutput, + }; + } + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + return MsbuildRunner.Execute(projectPath, allArgs.ToArray(), buildSystem == BuildSystem.MSBuild64); + } + default: + { + throw new NotImplementedException(); + } + } + } + + public static string GetQuotedPropertySwitch(BuildSystem buildSystem, string propertyName, string valueToQuote) + { + switch (buildSystem) + { + case BuildSystem.DotNetCoreSdk: + { + return $"-p:{propertyName}=\\\"{valueToQuote}\\\""; + } + case BuildSystem.MSBuild: + case BuildSystem.MSBuild64: + { + return $"-p:{propertyName}=\"{valueToQuote}\""; + } + default: + { + throw new NotImplementedException(); + } + } + } + + public static IEnumerable GetToolCommandLines(MsbuildRunnerResult result, string toolName, string operation, BuildSystem buildSystem, bool? outOfProc = null) + { + var expectedOutOfProc = buildSystem == BuildSystem.DotNetCoreSdk || outOfProc.HasValue && outOfProc.Value; + var expectedToolExe = !expectedOutOfProc ? $"({toolName}.exe)" : + buildSystem == BuildSystem.DotNetCoreSdk ? $"{toolName}.dll\"" : $"{toolName}.exe"; + var expectedToolCommand = $"{expectedToolExe} {operation}"; + return result.Output.Where(line => line.Contains(expectedToolCommand)); + } + } +} diff --git a/src/wix/test/WixToolsetTest.Sdk/README.md b/src/wix/test/WixToolsetTest.Sdk/README.md new file mode 100644 index 00000000..7faf34b9 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/README.md @@ -0,0 +1,5 @@ +In order to properly test wix.targets, +all of the supported architectures for WixToolset.BuildTasks need to be available in the layout used in the Nuget package. +Making this happen on every build for the solution takes too long, +so this project relies on manually running appveyor.cmd to publish everything before the tests can be run. +appveyor.cmd needs to be ran again every time changes are made in other projects, including the targets themselves. \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj new file mode 100644 index 00000000..7d751319 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/HeatFileMultipleFilesSameFileName.wixproj @@ -0,0 +1,58 @@ + + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + + + + + TxtProductComponents + INSTALLFOLDER + true + + + JsonProductComponents + INSTALLFOLDER + true + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.json @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/MyProgram.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs new file mode 100644 index 00000000..5abcee9f --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFileMultipleFilesSameFileName/Package.wxs @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj new file mode 100644 index 00000000..3988acaf --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/HeatFilePackage.wixproj @@ -0,0 +1,53 @@ + + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + + + + + ProductComponents + INSTALLFOLDER + true + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs new file mode 100644 index 00000000..f5fa8cf6 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatFilePackage/Package.wxs @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj new file mode 100644 index 00000000..c569e8ac --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/HeatProjectPreSdkStyle.wixproj @@ -0,0 +1,50 @@ + + + + + Debug + x86 + + + + BB919765-DD69-41E7-91C5-415A69BE923E + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + true + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs new file mode 100644 index 00000000..6c12861b --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectPreSdkStyle/Package.wxs @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj new file mode 100644 index 00000000..907f0bb0 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/HeatProjectSdkStyle.wixproj @@ -0,0 +1,50 @@ + + + + + Debug + x86 + + + + CE998A54-9BEC-4268-BFA2-8E3DAE5831C8 + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + true + true + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs new file mode 100644 index 00000000..d30218f3 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/HeatProjectSdkStyle/Package.wxs @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs new file mode 100644 index 00000000..2b2c5be2 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.cs @@ -0,0 +1,8 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace SdkStyleCs +{ + public class SdkStyleCs + { + } +} diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj new file mode 100644 index 00000000..755976bc --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/SdkStyleCs/SdkStyleCs.csproj @@ -0,0 +1,8 @@ + + + + + + netstandard2.0 + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c29a2303 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("ToolsVersion4Cs")] +[assembly: AssemblyDescription("ToolsVersion4Cs")] +[assembly: AssemblyProduct("WiX Toolset")] +[assembly: AssemblyCompany("WiX Toolset Team")] +[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and contributors. All rights reserved.")] diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj new file mode 100644 index 00000000..9c55f7a5 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/HeatProject/ToolsVersion4Cs/ToolsVersion4Cs.csproj @@ -0,0 +1,36 @@ + + + + + + + {8B19578A-816A-48A1-A6C4-58067334EB79} + ToolsVersion4Cs + Library + ToolsVersion4Cs + v4.0 + + + true + false + $(DefineConstants);DEBUG;TRACE + bin\Debug\ + + + true + true + $(DefineConstants);TRACE + bin\Release\ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj new file mode 100644 index 00000000..77ee4420 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/MergeMsiPackage.wixproj @@ -0,0 +1,44 @@ + + + + + Debug + x86 + + + + {B00939D5-7952-4ADF-BEB1-507D227B2FE2} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + SimpleMergeModule + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs new file mode 100644 index 00000000..ef62c31b --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/MergeMsiPackage/Package.wxs @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs new file mode 100644 index 00000000..b892debd --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/MergeModule.wxs @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj new file mode 100644 index 00000000..91579790 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/SimpleMergeModule.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + Module + + + + {9F84998B-7F45-4CB3-8795-915801DBBB74} + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MergeModule/SimpleMergeModule/data/MergeModule.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..555addbe --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,50 @@ + + + + + Debug + x86 + 0.9 + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + MsiPackage + Package + MsiPackage + MsiPackage + en-US,en;de-DE + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl new file mode 100644 index 00000000..23493ace --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.de-de.wxl @@ -0,0 +1,11 @@ + + + + + + German DowngradeError + German FeatureTitle + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..df24aa33 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln new file mode 100644 index 00000000..2c88704e --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/MultiCulturalMsiPackage/MultiCulturalMsiPackage.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj new file mode 100644 index 00000000..18ae08b2 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/MsiPackage.wixproj @@ -0,0 +1,46 @@ + + + + + Debug + x86 + + + + 7fb77005-c6e0-454f-8c2d-0a4a79c918ba + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.en-us.wxl @@ -0,0 +1,11 @@ + + + + + + A newer version of [ProductName] is already installed. + MsiPackage + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs new file mode 100644 index 00000000..0a133c7d --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/Package.wxs @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs new file mode 100644 index 00000000..ddb95faf --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/PackageComponents.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/MsiPackage/data/test.txt @@ -0,0 +1 @@ +This is test.txt. \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs new file mode 100644 index 00000000..3b4a9d6a --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/Bundle.wxs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj new file mode 100644 index 00000000..199eb6d9 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleBundle/SimpleBundle.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + + + + 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d + Bundle + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln new file mode 100644 index 00000000..dd21489d --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/SimpleMsiPackage.sln @@ -0,0 +1,39 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MsiPackage", "MsiPackage\MsiPackage.wixproj", "{7FB77005-C6E0-454F-8C2D-0A4A79C918BA}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SimpleBundle", "SimpleBundle\SimpleBundle.wixproj", "{6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.ActiveCfg = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x64.Build.0 = Debug|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.ActiveCfg = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Debug|x86.Build.0 = Debug|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.ActiveCfg = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x64.Build.0 = Release|x64 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.ActiveCfg = Release|x86 + {7FB77005-C6E0-454F-8C2D-0A4A79C918BA}.Release|x86.Build.0 = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x64.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.ActiveCfg = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Debug|x86.Build.0 = Debug|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x64.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.ActiveCfg = Release|x86 + {6670D5C9-BBEC-4828-AB60-4A1C0FFEB97D}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {585B0599-4EB5-4AB6-BC66-819CC78B63D5} + EndGlobalSection +EndGlobal diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs new file mode 100644 index 00000000..6ab9a016 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/Bundle.wxs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj new file mode 100644 index 00000000..199eb6d9 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/TestData/SimpleMsiPackage/UncompressedBundle/UncompressedBundle.wixproj @@ -0,0 +1,42 @@ + + + + + Debug + x86 + + + + 6670d5c9-bbec-4828-ab60-4a1c0ffeb97d + Bundle + + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + Debug + + + $(Platform) + bin\$(Platform)\$(Configuration)\ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj b/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj new file mode 100644 index 00000000..35ed053a --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.csproj @@ -0,0 +1,59 @@ + + + + + + net461 + false + embedded + TestData\**;$(DefaultItemExcludes) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject b/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject new file mode 100644 index 00000000..f1d03cd7 --- /dev/null +++ b/src/wix/test/WixToolsetTest.Sdk/WixToolsetTest.Sdk.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/wix/wix.csproj b/src/wix/wix.csproj deleted file mode 100644 index 7fac5e95..00000000 --- a/src/wix/wix.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - netcoreapp3.1;net461 - Exe - Compiler - WiX Toolset Compiler - embedded - true - - win-x86 - app.config - wix.exe.manifest - Major - - - - NU1701 - - - - - - - - - - - - - - - - - - - diff --git a/src/wix/wix.exe.manifest b/src/wix/wix.exe.manifest deleted file mode 100644 index f35b5534..00000000 --- a/src/wix/wix.exe.manifest +++ /dev/null @@ -1,18 +0,0 @@ - - - - - WiX Toolset Compiler - - - - - - - - - - true - - - diff --git a/src/wix/wix.net461.v3.ncrunchproject b/src/wix/wix.net461.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/wix/wix.net461.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/wix/wix.netcoreapp2.1.v3.ncrunchproject b/src/wix/wix.netcoreapp2.1.v3.ncrunchproject deleted file mode 100644 index cf22dfa9..00000000 --- a/src/wix/wix.netcoreapp2.1.v3.ncrunchproject +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/wix/wix/ConsoleMessageListener.cs b/src/wix/wix/ConsoleMessageListener.cs new file mode 100644 index 00000000..ebf1622b --- /dev/null +++ b/src/wix/wix/ConsoleMessageListener.cs @@ -0,0 +1,90 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools.Core +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Text; + using System.Threading; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + public sealed class ConsoleMessageListener : IMessageListener + { + public ConsoleMessageListener(string prefix, string appName) + { + this.Prefix = prefix; + this.AppName = appName; + + PrepareConsoleForLocalization(); + } + + public string AppName { get; } + + public string Prefix { get; } + + public void Write(Message message) + { + var filename = message.SourceLineNumbers?.FileName ?? this.AppName; + var type = message.Level.ToString().ToLowerInvariant(); + var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; + + if (message.SourceLineNumbers?.LineNumber.HasValue == true) + { + filename = String.Concat(filename, "(", message.SourceLineNumbers?.LineNumber.Value, ")"); + } + + output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.Prefix, message.Id, message.ToString()); + + var fileNames = GetFileNames(message.SourceLineNumbers); + if (fileNames.Count > 1) + { + foreach (var fileName in fileNames) + { + output.WriteLine("Source trace: {0}", fileName); + } + } + } + + public void Write(string message) => Console.Out.WriteLine(message); + + public MessageLevel CalculateMessageLevel(IMessaging messaging, Message message, MessageLevel defaultMessageLevel) => defaultMessageLevel; + + private static IList GetFileNames(SourceLineNumber sourceLineNumbers) + { + var fileNames = new List(); + + for (var sln = sourceLineNumbers; null != sln; sln = sln.Parent) + { + if (String.IsNullOrEmpty(sln.FileName)) + { + continue; + } + else if (sln.LineNumber.HasValue) + { + fileNames.Add(String.Format(CultureInfo.CurrentUICulture, "{0}: line {1}", sln.FileName, sln.LineNumber)); + } + else + { + fileNames.Add(sln.FileName); + } + } + + return fileNames; + } + + private static void PrepareConsoleForLocalization() + { + Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); + + if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) + { + Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); + } + } + } +} diff --git a/src/wix/wix/Program.cs b/src/wix/wix/Program.cs new file mode 100644 index 00000000..d1818df0 --- /dev/null +++ b/src/wix/wix/Program.cs @@ -0,0 +1,92 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Tools +{ + using System; + using System.Runtime.InteropServices; + using System.Threading; + using System.Threading.Tasks; + using WixToolset.Converters; + using WixToolset.Core; + using WixToolset.Core.Burn; + using WixToolset.Core.ExtensionCache; + using WixToolset.Core.WindowsInstaller; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + using WixToolset.Tools.Core; + + /// + /// Wix Toolset Command-Line Interface. + /// + public sealed class Program + { + /// + /// The main entry point for wix command-line interface. + /// + /// Commandline arguments for the application. + /// Returns the application error code. + [MTAThread] + public static async Task Main(string[] args) + { + var cts = new CancellationTokenSource(); + var listener = new ConsoleMessageListener("WIX", "wix.exe"); + + Console.CancelKeyPress += (s, e) => + { + cts.Cancel(); + e.Cancel = true; + }; + + try + { + var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider() + .AddWindowsInstallerBackend() + .AddBundleBackend() + .AddExtensionCacheManager() + .AddConverter(); + + return await Run(serviceProvider, listener, args, cts.Token); + } + catch (OperationCanceledException) + { + return -1; + } + catch (WixException e) + { + listener.Write(e.Error); + + return e.Error.Id; + } + catch (Exception e) + { + listener.Write(ErrorMessages.UnexpectedException(e)); + + if (e is NullReferenceException || e is SEHException) + { + throw; + } + + return e.HResult; + } + } + + /// + /// Executes the wix command-line interface. + /// + /// Service provider to use throughout this execution. + /// Listener to use for the messaging system. + /// Command-line arguments to execute. + /// Cancellation token. + /// Returns the application error code. + public static Task Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args, CancellationToken cancellationToken) + { + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + + var commandLine = serviceProvider.GetService(); + var command = commandLine.CreateCommand(args); + return command?.ExecuteAsync(cancellationToken) ?? Task.FromResult(1); + } + } +} diff --git a/src/wix/wix/app.config b/src/wix/wix/app.config new file mode 100644 index 00000000..081fea2c --- /dev/null +++ b/src/wix/wix/app.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/wix/wix/wix.csproj b/src/wix/wix/wix.csproj new file mode 100644 index 00000000..7fac5e95 --- /dev/null +++ b/src/wix/wix/wix.csproj @@ -0,0 +1,39 @@ + + + + + + netcoreapp3.1;net461 + Exe + Compiler + WiX Toolset Compiler + embedded + true + + win-x86 + app.config + wix.exe.manifest + Major + + + + NU1701 + + + + + + + + + + + + + + + + + + + diff --git a/src/wix/wix/wix.exe.manifest b/src/wix/wix/wix.exe.manifest new file mode 100644 index 00000000..f35b5534 --- /dev/null +++ b/src/wix/wix/wix.exe.manifest @@ -0,0 +1,18 @@ + + + + + WiX Toolset Compiler + + + + + + + + + + true + + + diff --git a/src/wix/wix/wix.net461.v3.ncrunchproject b/src/wix/wix/wix.net461.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/wix/wix.net461.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/wix/wix/wix.netcoreapp2.1.v3.ncrunchproject b/src/wix/wix/wix.netcoreapp2.1.v3.ncrunchproject new file mode 100644 index 00000000..cf22dfa9 --- /dev/null +++ b/src/wix/wix/wix.netcoreapp2.1.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/version.json b/version.json deleted file mode 100644 index eaeb2c79..00000000 --- a/version.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "4.0.0-build.{height}", - "publicReleaseRefSpec": [ - "^refs/heads/master$" - ], - "cloudBuild": { - "buildNumber": { - "enabled": true - } - } -} -- cgit v1.2.3-55-g6feb