Creating a custom dialog using C # in the MSI installer

We (my project team) have an existing MSI installer for the Windows VS 2010 application. A license file is used to verify the installation of Windows. We use the standard VS installation project for installation.

We are currently using the test block in the MSI installation to get the path to the license file, so the user needs to manually copy and paste the path to the license file. I want to change this by adding a Browse File button, which shows a file browsing dialog box to select a license file, and automatically fills in the text box when a file is selected.

I used the Orca tool to change the user interface to add a button next to an existing text box in the installation interface.

My question is: is it possible to write some managed code in C # to show, say, the Open File dialog box, to select a license file, and then fill in the text box. I understand that this is possible by writing C / C ++ code. I see that many people use the WIX toolkit to create installation files. Right now I can’t create a new installation installer project because it includes WIX training and I don’t have the time right now.

+4
source share
2 answers

I do not believe that this is possible.
Ready MSI does not support managed code, so you cannot write a managed dialog.
However, you can write a bootloader to connect the graphical user interface to your installer. This is pretty tricky.

I know that you wrote that at this stage you cannot convert to WIX, but I can reassure you that if you know the MSI structure well, learning this will be quite simple.
And how can you use SharpSetup to create a C # GUI for your installer.

+1
source

It is possible (see DTF tools that can transfer .NET code into an unmanaged DLL), but for the level of complexity of a custom action that calls GetOpenFileName and MsiSetProperty , I would suggest avoiding an additional dependency on the .NET platform.

+1
source

Source: https://habr.com/ru/post/1379941/


All Articles