WiX optional Section Content - wix

I am trying to write a simple windows installer that has to write some fields in a .ini file if a feature is enabled. On the lower level, this is if a specific property is set from a checkbox.
I have been googling for days, but neither the internet nor the docs seem to be of help. Can anyone point me in the right direction regarding having optional fields in a section?

All changes to resources on the machine (dir,file,reg,ini and so on) are associated with components. Components are associated to features. So if a feature is being installed, the component is being installed and therefore the resource is being installed.
So you nest an IniFile element underneath a Component element.
https://wixtoolset.org/docs/v3/xsd/wix/inifile/
Checkboxes controll a property. Checked it has a value you specify. Unchecked it has no value.
There's also a little problem that Windows Installer doesn't remember property values for subsequent transactions and that the IniLocator table can only read ini files from the Windows folder.
You might want to store this value in a registry key also that way you can read it back in as part of the remember pattern.
Find my email address and hit me up. I'd be happy to walk you through it as an excercise.

Related

Auto select License Agreement checkbox (or hide it)

I made an installer using wix burn.
I used the standard bootstrapper with Hyperlink license theme.
I don't want to display the EULA checkbox on upgrades. Once accepted one time, I don't want to show it again, or at least auto select it.
To achieve that, I customized the bafunctions.dll and wrote some code in OnDetect(). After a given condition is match, I set the variable EulaAcceptCheckbox = 1. I know that this is the variable name corresponding to the EULA checkbox because I inspected the log of the installer before making this changes.
After making all the modifications, I know my logic is working because I see the following lines in the log:
[1510:1410][2015-11-17T19:01:04]i000: Running detect complete BA function
[1510:1410][2015-11-17T19:01:04]i000: Setting numeric variable 'EulaAcceptCheckbox' to value 1
But the checkbox is not displayed as checked. I tried to set 'EulaAcceptCheckbox' in OnDetect() and also in OnDetectComplete(): no luck.
I also tried to set LicenseUrl="" and WixStdbaLicenseUrl="" but that does not work either.
I have already used bafunctions.dll to do some checkbox customization in another installer. It seems not to work with the EULA checkbox only. What's wrong with my approach?
There seems to be no solution for this.

WIX: change/repair/remove buttons disabled in WixUI_MaintenanceTypeDlg

I'm using WIX to create an installer and WixUI_Mondo for the UI. Everything had gone well until I stumbled upon a problem with MaintenanceTypeDlg. Things work finely when I install the application, however when I click the MSI later on (when the app is installed), I get change/repair/remove buttons grayed out.
Here are relevant parts of my installation project (sorry, didn't manage to put them inline, since they got cut by the forum software, so had to upload them to pastebin.ca): http://pastebin.ca/1958654.
So, as you see, I'm setting ARPNO*** properties to zero, and, what's more, the log shows these properties set to zero during install. I've also tried to swap include directives, so that UI goes after ControlPanel - unfortunately, with no luck. Any ideas about what am I doing wrong? Thanks in advance.
Don't set the ARPNO* properties; as the documentation says, "setting them" -- i.e., to anything -- disables the ARP behavior.

My.Settings.mytext has a value but i cannot find where it is set?

onload i do a msgbox (my.settings.mytext)
it returns a value, but i cannot find where in the project i have set this value!! it was definitely set by me, but i cannot find it anywhere. please help
it is attached to textbox1.text, but that has no value either
Please see My.Settings:
The My.Settings object provides access
to the application's settings and
allows you to dynamically store and
retrieve property settings and other
information for your application. For
more information, see Managing
Application Settings.
and also How to: Add or Remove Application Settings:
Application settings allow you to
store and retrieve property settings
and other information for your
application dynamically. There are two
types of application settings, based
on scope: user-scoped and
application-scoped settings.
At design time, you can add
application settings either using the
Settings pane of the Project Designer,
or using the Properties window for a
form or control, which allows you to
bind a setting directly to a property.
This last line that I have emphasized is most likely where you want to look.
Maybe you could goto the Edit menu and do a Quick Find on the Settings name, if it finds it you'll probably find out where you've set the value.
Also, have you checked the Program.vb file? I always forget about that file.
Hope this has helped.

WIX RemoveFolder issue

I am trying to add a feature to my msi based installer, written in wix, which will allow the user to change the name of the folder that keeps the shortcuts within the Windows start menu.
What I did so far is to add a folder there (with a static name), add shortcuts to that folder and remove all of them during uninstall (by using the RemoveFolder tag). Then I added a custom action that will pick up the property that is set from an edit box in UI and set that as the name of the folder, something like:
By running this within the InstallExecuteSequence, the folder is created correctly (with the name the user set for it) and all things are set into place. However, when I uninstall the product, the folder remains with all of it's shortcuts in it (that point to nothing now and they ask for deletion when you click them).
Is there any way to remove a folder that I dynamically changed it's Name attribute during installation, as described above?
Thanks.
You'll need to save the dynamic property to the registry, and read it back during maintenance/repair/uninstall. Windows Installer doesn't "remember" property changes, you need to do it yourself.

WiX Show Dialog Based on Feature to be Installed

Let me be upfront I am novice with WiX. I have a custom dialog CustomSetupTypeDlg.wxs that changes the Typical/Custom/Complete to Desktop/Server/Suite. It sets WixUI_InstallMode to InstallDesktop, InstallServer and InstallSuite appropriately.
I need to have the user browse for an installation folder depending upon what feature is to be installed. If InstallDesktop or InstallSuite is selected the user has to select two different paths for DESKTOPINSTALLDIRECTORY and SERVERINSTALLDIRECTORY. However if the install mode is InstallServer only SERVERINSTALLDIRECTORY choice should be presented.
I am uncertain on how to go about doing this.
You want to have actions in your InstallExecute sequence that display the dialogs you need. Inside the tag you provide a conditional, which, when true, causes the action to actually happen. See this tutorial, specifically section 5.3 for a list of conditionals.
I decided to simplify the project by splitting the desktop and server features into two separate installers.