Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to add bal:overridable for Variable with wix# #586

Closed
maratoss opened this issue Feb 2, 2019 · 3 comments
Closed

[Question] How to add bal:overridable for Variable with wix# #586

maratoss opened this issue Feb 2, 2019 · 3 comments

Comments

@maratoss
Copy link

maratoss commented Feb 2, 2019

Hi, i am using wix# 1.9.3
i run bundle.exe from command line
and want to pass variable to my Bundle.exe bundle like this
and seems Variable should have Overridable attribute:
cmd> Bundle.exe SITECONFIGURATION=blabla

i added variable for my bundle:
new Variable("SITECONFIGURATION") { AttributesDefinition = "bal:Overridable=yes" },

but get the compilation error:
Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.ApplicationException: Cannot resolve custom attribute definition:bal:Overridable=yes 3> at WixSharp.AutoElements.ExpandCustomAttributes(XDocument doc, WixProject project) 3> at WixSharp.Compiler.BuildWxs(Bundle project) 3> at WixSharp.Compiler.Build(Bundle project, String path) 3> at WixSharp.Bootstrapper.Bundle.Build(String path)

Could you help me with it?
Thanks!

@maratoss maratoss changed the title [Question] How add bal:overridable for variable with wix# [Question] How to add bal:overridable for Variable with wix# Feb 2, 2019
@maratoss
Copy link
Author

maratoss commented Feb 2, 2019

this works but anyway want to do it without that xml injection :)

code:

bundle.WixSourceGenerated += document =>
{
	var variable = document
		.Descendants()
		.FirstOrDefault(x => x.Name == "Variable" && x.HasAttribute("Name", "SITECONFIGURATION"));

	if (variable != null)
	{
		variable.Add(new XAttribute("{http://schemas.microsoft.com/wix/BalExtension}Overridable", "yes"));
		Console.WriteLine(variable);
	}
};

cmd:
bundle.exe /i SITECONFIGURATION=ALALALALALALALALLAA -log log.txt

logs:
[4AF0:6C58][2019-02-02T19:59:00]i000: Setting string variable 'SITECONFIGURATION' to value 'ALALALALALALALALLAA'

@oleg-shilo
Copy link
Owner

Scheduled for the next release. Txs

oleg-shilo pushed a commit that referenced this issue Feb 17, 2019
…n with `WixObject.ToXElement()`

- Issue #586: How to add bal:overridable for Variable with wix#
@oleg-shilo
Copy link
Owner

The next release will also have the fix for a minor bug in AttributesDefinition support that will enable the following syntax for the cases when the additional (unsupported) attributes require the use of XML namespaces:

bootstrapper.Variables = new[]
{
    new Variable("BundleVariable", "333")
    {
        AttributesDefinition = "{http://schemas.microsoft.com/wix/BalExtension}Overridable=yes"
    }
};

oleg-shilo pushed a commit that referenced this issue Feb 18, 2019
…n with `WixObject.ToXElement()`

- Issue #586: How to add bal:overridable for Variable with wix#
- Added missing sample files
oleg-shilo pushed a commit that referenced this issue Mar 19, 2019
* Added new XML injection extensions `WixProject.AddXml` and `WixProject.AddXmlElement`
* Issue #608: Create Shortcut on Desktop to dotnet.exe
* Issue #551: Cannot include extra .wxs as part of a bundle
* Issue #610: Warning when building two bundles in one setup
* Issue #604: Is it possible to suppress the "UAC prompt" text if UAC is not enabled?
* Issue #606:  Platform.x64 not marking some folders win64="yes"
* Issue #599: Files creating empty folders on Destination (2)
* Issue #599: Files creating empty folders on Destination
* Added `WixEntity.ComponentCondition` to assist with cases when WiX element does not have condition (e.g. `RegistryKey`). Triggered by issue #593
* Added support for attribute namespaces during XML auto serialization with `WixObject.ToXElement()`
* Issue #586: How to add bal:overridable for Variable with wix#
* Issue #591: Code signing timestamping fails if old Windows SDK is installed
* Issue #585: Question: Warning about auto-generated IDs
* Issue #580: Wrong path to the AdminToolsFolder
* Add MsuPackage Element
* Fix Condition Net462_Installed, Net47_Installed, Net471_Installed, Net472_Installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants