WIX Custom Actions - wix

I need to create custom actions in WIX for my MSI. I want to be able to read from a txt,xml or ini file and pass them through into a configuration file.
My problem is I cannot use .net, as the scope for the MSI is to not have any .net interaction and I understand jscript is not a good idea for several reasons.
What options if any do I have left?

So basically your options:
Custom c++ actions
XML wix Util tool
Ini wix Util tool

Related

WIX Toolset I want the ActionData log to continue to be written as a scroll

If you add ActionData to the Subscribe event in Edit Control on Wix,
the line is written and erased. I want the ActionData log to continue to be written as a scroll.
Burn: WiX Burn allows you to write your own GUI to run your installer. You should be able to implement whatever you want in terms of GUI if you go down that path. However: installers run quicker and quicker as IO becomes better, are you sure this is time well spent? I'd say just use logging and be done with it? See my comments above for your question.
Burn Bootstrapper Appliation: There are not that many samples I know about for Custom WiX Burn Bootstrapper applications. Here are two:
Write your own WiX Burn setup GUI application (advanced)
https://github.com/rstropek/Samples/tree/master/WiXSamples/CustomBurnUI
Documentation: For documentation go online, or better yet open WiX.chm and locate section "Building Installation Package Bundles".
Here are two past answers that I would suggest you at least skim:
Ways to customize your WiX GUI (do read this one for overall understanding of MSI GUI)
Custom GUI - WiX Burn, Installshield Suite Project, Advanced Installer - their options
The Implementation of a custom GUI for an MSI depends on the core MSI API function MsiSetExternalUI function. It allows what Burn is doing - making a custom GUI. Throwing in an SDK sample too:
MSI SDK Sample: Some details on the MsiSetExternalUI function (serverfault answer). Concrete code sample to handle Windows Installer messages: https://learn.microsoft.com/en-us/windows/desktop/Msi/handling-progress-messages-using-msisetexternalui. This is MSI API calls direct - nothing to do with Burn as such, Burn makes use of these calls.
Links: Link overload - as usual - but here is an example of a custom Burn theme - as opposed to a custom bootstrapper application. This changes the look of the standard Burn bundle.
https://github.com/frederiksen/Classic-WiX-Burn-Theme
SQL Server named instance with Visual Studio 2017 Installer project (just for inclusion)
Native Windows Installer UI doesn't support this. You would need to create a custom UI handler to display it the way you want.

installshield - how to let user add files to program files folder in the install

I am trying to create an installer that will get the project to install from my server. The project will be chosen dynamically by the user (the user has access to the server), so I can't copy the files to the installer when I create it.
I want that the files will add to to ProgramFilesFolder in the installer.
How can I do this?
Not entirely sure what you want to do. Do you want to automatically add files to a project that they select and then build and MSI? Installshield can be run via automation (i.e via VBScript, VB, C# etc...), and you can achieve what you want using this approach. To work with a project you start from the ISWiProject Object. See this answer: Installshield Build Automation. And for C#: Getting Started with InstallShield Automation and C#.
Personally I would use Wix instead and automate via the Heat.exe tool and standard XML editing via code.
See how Installshield compares to other setup tools: What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc
Learn about Wix:
Windows Installer and the creation of WiX
MSI vs nuget packages: which are is better for continuous delivery?
Newer answer on automation

How to modify the installed features of msi with wix bootstrapper?

I am trying to call a msi inside wix bootstrapper program.It is working properly at the time of installation.And selected features are installed properly.But after installation i am trying to modify the installed features.In the control panel there is change button.But when i click it then it is showing a dialog with Repair, uninstall, cancel buttons.There is no modify button for modifying the features of installer.
Please specify the solution if any.
code inside Bootstrappertheme.wxl is
<!-- Modify dialog -->
<String Id="ModifyHeader">Modify Setup</String>
<String Id="ModifyNotice">[WixBundleName] is already installed on this machine. If it's not working correctly, you may repair it. You may also uninstall it.</String>
<String Id="ModifyRepairButton">&Repair</String>
<String Id="ModifyUninstallButton">&Uninstall</String>
<String Id="ModifyCloseButton">&Cancel</String>
The wix standard bootsrapper application does not currently support msi feature selection. Currently, the only way to get it is to create a custom bootstrapper application. People have asked about this on the WiX mailing list multiple times. Rob Mensching is the project leader, and Bob Arnson currently manages the 3.x branch.
This guide: Writing Your Own .Net-based Installer with WiX is the best resource I know about for building one in WPF. The actual WiX source code is very helpful as well. It's a very big task though.
I don't have a sample project to share with you, but the blog post I mentioned above does have a section "HANDLING CURRENT & FUTURE STATE" which describes how to do this. I think it really is a terrific resource.
Also, see this question: Custom WiX Burn bootstrapper user interface?
Burn GUI
Burn GUI is very different from MSI-GUI. Here is an older, similar answer
Please also see comments in these answers:
On customized GUI
Changing text color to Wix dialogs
Custom WiX Managed Bootstrapper Application
MSI File
What dialog set are you using for the MSI files? Have you tried enabling the advanced dialog set? I haven't tried it yet: http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_advanced.html
WixUI Dialogs:
http://wixtoolset.org/documentation/manual/v3/wixui/dialog_reference/wixui_dialogs.html
Tutorial:
http://wix.tramontana.co.hu/tutorial/user-interface/ui-wizardry
It might be possible to use Orca (http://support.microsoft.com/kb/255905) to edit the MSI and resave it so that it, without special configuration in wix, automatically has the Modify option in Programs and Features. When creating an MSI from scratch (using InstallShield for example), the user can specify which options are available. There should be a way to edit the file to accomplish the same thing.
When you open up the "Change" feature from the Programs and Features menu, it reruns a cached version of the MSI installer in maintenance mode. Regardless of what program is bootstrapping the MSI (wix vs InstallShield), the MSI is the only thing that Windows knows about. If it is not configured to have a Modify option, it won't have it.

Migrate WiX UI to Burn

I have a working WiX installer with a custom UI using a WixUI_Mondo_MyApp.wxs file. I have to extend my installer to also run another exe installer. I understand Burn is the way to do this.
I created a Burn project that chains my original MSI with the custom UI (using DisplayInternalUI="yes"), and that works fine. But I don't want two UIs popping up (the Burn default UI, and my MSI UI), and I need to get some info from the MSI UI to determine if I should install the other exe (it will listed as one of the features).
I suppose the proper solution would be to migrate my UI code from my MSI to my Burn project, but I can find no docs on describing how to do this.
Thanks in advance.
There is no migration path; MSI UI is declarative using the MSI UI tables and Burn supports arbitrary code in a bootstrapper application. If you have any logic in your UI customizations, you'd have to write a custom bootstrapper application to get that in a bundle.

WiX Repeat Dynamic Configurable Build?

I have a .wixproj in VS 2010 that makes a MSI just the way I need it (using heat for harvesting in the pre build event). Now I need to distribute 3 versions of the same thing, that only need to differ in app.config settings, output MSI name, and some dialog stuff defined in some secondary .wxs files.
I was thinking about creating a console app that would take parameters and modify the .wixproj and .wxs and app.config files and then kick off MSBuild, but that seems like a lot of work.
What would be a better way to use WiX as a build factory so I can have it generate many customized MSI installers?
Thanks.
The WiX Preprocessor is your friend here. Using its values and conditional statements will help you to make "universal" sources, which will output various packages based on what you pass in.