I needed to add a new custom dialogue to a MSI basic project that captures a new path for the data folder for a project. The dialog should take the INSTALLPATH add DATADIR, then allow the user to change the path. On install the DATADIR path will be inserted into an app.config xml file so the application knows where to look
Create a new Basic MSI Project
Application Information
Installation Interview
Installation Designer
Create new component
Rename to DATAFOLDER
Click on the three dots Buttons next to Destination
Click on the three dots Buttons next to Destination
New Component Files
New Component Files
Configure XML Changes
import the XML file
Choose only the elements you need to change
Take out the xpath information that searches for specific elements in the config file, we just want it to match on runtime element, not the dataFolder orenviromentId
Change the dataFolder Parameter to [DATAFOLDER]
Delete the environmentID since we are not changing that
Navigate to Dialogs
right click Clone
Rename the dialog
Select the Location Control
Create new string for the control you are changing by clicking on the three dots
Click New
Enter Value: [DATAFOLDER]
Select DlgTitle Control
Select the three dots the text
Select New
Enter DataFolder
Select LocLabel
Click three dots next to Text
Click New
Enter “Choose Data Directory for [ProductName]:”
Select Bahavior
Select ChangeFolder
Change INSTALLDIR to DATAFOLDER
Select Destination Folder
Select Next
Change NewDialog to DataFolder
Select DataFolder
Select Back
Change New Dialog to Destination Folder
Goto ReadyToInstall
Go to Back
Change DestinationFolder to DataFolder
To DataFolder
Now do a build, and you install, you should see
And when you check your XML file you should see the changes reflected there.