4

We(my project team) have an existing MSI installer for a VS 2010 windows application. There is a license file we are using to validate the windows installation. We are using the standard VS setup project to do the installation.

Currently, we are using a test box in the MSI installation to get the license file path, so the user has to manually copy and paste the license file path. I want to change this by adding a 'Browse file' button that shows browse file dialog to select license file and auto populates the textbox on selecting the file.

I have used the Orca tool to modify the UI for a adding a button next to the existing textbox in the installation UI.

My question is: Is it possible to write some C# managed code to show, say the Open file dialog to select the license file and then populate the text box. I understand this is possible by writing C/C++ code. I see a lot of people using WIX toolset for creating setup files. Right now, I cannot create a new setup installer project because it involves learning WIX and I do not have the time for that now.

2 Answers 2

2

This is possible (see tools like DTF which can wrap .NET code in an unmanaged DLL), but for the level of complexity of a custom action which calls GetOpenFileName and MsiSetProperty, I would suggest avoiding the extra dependency on the .NET framework.

Sign up to request clarification or add additional context in comments.

Comments

1

I don't believe it is possible.
The out-of-the-box MSI does not support managed code, and therefore you will not be able to write a managed dialog.
You can, however, write a bootstrapper to attach a custom graphic interface to your installer. It is quite complicated, though.

I know you wrote you can not convert to WIX in this stage, but I can reassure you that if you know the MSI structure well, learning it will be quite easy.
And than, you can use SharpSetup to create a C# GUI to your installer.

2 Comments

Thanks for the recommendation of the SharpSetup. Unfortunately, all of the download link on their page is broken since yesterday.
Yes, their project is not active for some time. There is WixSharp instead that does the same and much more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.