WiX bootstrapper - disable a control using HexStyle - wix

I have a WiX bootstrapper theme xml file, and I want to permanently disable a control. I have tried to set HexStyle to the value of WS_DISABLED (link). However the control is still enabled. Anyone knows if I can use HexStyle or know of another way of having a control permanently disabled. I use the WixStandardBootstrapperApplication.RtfLicense BootstrapperApplication.

The possible solution is to find Id of this control and then create Variable with postfix "State". I hope it should work:
<Variable Name="EulaRicheditState" Type="string" Value="disable" />

Related

How to Override the property value in the transform file in WIX during Installation

I am looking for a suggestion How to Override the property value in the transform file in WIX during Installation.
Basically we have a property - for example USE_WINDOWS_AUTH
Consider that, Transform file (.mst) has USE_WINDOWS_AUTH=1
Now the requirement is, let the property value in transform be whatever, but WIX code should override it to USE_WINDOWS_AUTH=0 .
Reason for such requirement is, there is an enhancement happened in the product and clients are still using old properties , which is causing us lots of issues.
So the installer should ignore/override the property value of .mst file.
We tried After="CostFinalize", Before= "InstallInitialize" and etc. NO luck
<SetProperty After="CostFinalize" Id="USE_WINDOWS_AUTH" Value="0"/>
Another observation is, we are facing issue in silent mode (/quiet), but not interactive mode..
not sure what I am missing..
Any suggestions or advise please..
Please let me know if I can provide you any other information on this.
Thanks In Advance..
Rajkumar.
After further investigation seems to be below logic is helping me to serve the requirement. Hence Posting here.. which may help someone looking for some clues to the similar requirement.
<CustomAction Id='ModifyWindowsAuthValue' Property='USE_WINDOWS_AUTH' Value='0' Execute='immediate' />
<InstallExecuteSequence>
<Custom Action='ModifyWindowsAuthValue' Before="CostFinalize"/>
//existing other actions
</InstallExecuteSequence>

How to set custom value to Wix Bundle Log Element?

If I put a hard-coded value it works fine
<Log PathVariable="C:\myProjectDir\myLogs\log.txt"/>
 
But if I make a separate variable and replace the hard-code, it does NOT work
<Log PathVariable="[LogLocation]"/>
<Variable Name="LogLocation" bal:Overridable="no" Type="string" Value="C:\myProjectDir\myLogs\log.txt" Persisted="yes"/>
 
I found something on the lines of <WixVariable Id="WixBundleLog"/> but I don't really know how to use it.
My end goal here is that I have a bootstrapper application and I want to change the location where logs of my msi and exe installation is created
I able able to change a Variable element value using _bootstrapper.Engine.StringVariables["LogLocation"] = "C:\ProjectGorilla\logs\log.txt"
Using the above code in C#, the Variable Id="LogLocation" is changed but that change is not reflected in Log element's PathVariable
So, my question is how can I put a variable in PathVariable attribute of Log element
Thanks in advance :)
According to the documentation, the PathVariable attribute is:
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".
PathVariable does not specify the path where the (bundle) log will be written. It is a variable that the BA is supposed to read if it wants to copy the file somewhere else. The Burn engine never reads this variable's value so changing it during runtime won't do anything.
The (bundle) log is created (https://github.com/wixtoolset/wix3/blob/58abd6993afba08b39e37b0e76b1790161df9231/src/burn/engine/engine.cpp#L499) before loading the BootstrapperApplication (https://github.com/wixtoolset/wix3/blob/58abd6993afba08b39e37b0e76b1790161df9231/src/burn/engine/engine.cpp#L545). There is no way for the BA to change the path.
The package (MSI, EXE, etc) log locations work the same way today as the bundle log. However since they are created after loading the BA, it's theoretically possible that someone could implement a feature so that the BA can change their path.

How to customize icon for Wix custom bootstrapper

I want to use different icons for my setup.exe (top-leftmost corner of the installer window) and Add/Remove Programs. In my Bundle.wxs, I used <Bundle ... IconSourceFile='path\to\product1.ico'> but when I set the value there it is applying to both places as described in its documentation. So I tried this in my Product.wxs <Icon Id="ProductIcon" SourceFile="path\to\product2.ico"/> <Property Id='ARPPRODUCTICON' Value='ProductIcon'/> in an attempt to override the declaration in Bundle, but it still shows the first icon in Add/Remove programs. Any help? Thanks!
I faced the same problem. The solution is to change Logo attribute of custom BA main window.

WiX: returning a value from exepackage

I have been asked to add a function to an existing WiX package.
Specifically, I need to run a small c# application and return a single int back to WiX to conditionally control further actions.
I can see from ExePackage help that there is an ExitCode, but this is an enumeration of success, error, scheduleReboot or forceReboot.
I have googled quite a bit and I am wondering if I am missing the point. I can probably implement the C# process internally within WiX to get the user to provide the information I need, but the existing package already has custom ExePackages written in C# with a particular style, so I'd like to stay with that if I can. (The existing packages don't return any needed values)
Can I do this, or do I need to try and operate entirely within WiX?
For reference, one of the existing packages looks like this:
<ExePackage
SourceFile="..."
DisplayName="License Key"
InstallSize="0"
Permanent="yes"
InstallCommand="/ignoreIfLicensed"
RepairCommand="/ignore"
UninstallCommand="/ignore"
/>
The reference to <ExePackage ...> implies you want the condition to operate in a WIX bundle. In this scenario I think your options are limited and you can only map the return value of an ExePackage to global behaviour like forceReboot.
Do you have any <MsiPackage...> references? If you have, you could move the conditional behaviour inside each <MsiPackage...> using a Custom Action to call the exe and set a property. The property can then be used as a condition in each <component...> you want to conditionally install. See Using a WiX custom action to set a property's value for more information on custom actions setting properties.

WiX: Use [ComputerName] with property in Transforms.xml

I need to use the built-in variable [ComputerName] in a property in a Transforms.xml WiX file.
What I'm doing: <Property Id="MYCOMPUTERNAME" VALUE="[ComputerName]" />
What shows up is: "[ComputerName]"
That's not what I want.
I want the real computer name made available to the Property "MYCOMPUTERNAME".
Has anyone tried this successfully and how? Thank you.
WiX has a way to access environment variables. Check out the tutorial:
http://wix.tramontana.co.hu/tutorial/com-expression-syntax-miscellanea/expression-syntax
I think the syntax you would use is this, but I haven't tested it.