I have created Wix custom bootstrapper application (managed code, in C# along with bundle.wxs) which installs MSI on target pc. Following is a code snippet:

public class WinLogonBootstrapper : BootstrapperApplication
{
    protected override void Run()
    {
        Engine.Detect();
        //property = value

        //Launch the MSI
        Engine.Plan(LaunchAction.Install);

        //Apply the plan (InstallMessage MSI)
        Engine.Apply(IntPtr.Zero);
    }
}

There is a situation where customers use InstallShield command line to install MSI. And now I have migrated the installer to Wix. Customers may not want to modify the existing InstallShield command line for silent install, which makes me to modify their command line dynamically to work with Wix Bootstrapper.

I'm testing the use case for silent install. My solution installs MSI with the following command line(1) but doesn't installs MSI with InstallShield command line(2):

(1) Setup.exe /S /qn string_property_1="string_val_1" string_property_2="string_val_2" num_property_3=#num_val_3"

(2) Installshield command line:

Setup.exe /S /V" /qn string_property_1="string_val_1" string_property_2="string_val_2" num_property_3=#num_val_3"

If I run command (2) in command window, by removing '"' (one double quotes after /V) and one double quotes at the end of command line(2), MSI silent install works since it become similar to command line (1).

An observation: Whereas, when I intercept and display command line (2) string from following code:

string[] commandLineArgs = Environment.GetCommandLineArgs();
string str = string.Concat(commandLineArgs);
System.Windows.MessageBox.Show(str);

It doesn't display double quotes, it looks like this: Setup.exe /S /V /qn string_property_1="string_val_1" string_property_2="string_val_2" num_property_3=#num_val_3

not sure why double quotes are not visible in message box, but the command line doen't work as originally it has double quotes.

Kindly let me know how can I intercept Installshield commndline(2) with double quotes and and modify it similar to commandline(1) before MSI gets it. Basically I want to transform (2) in to (1). Your inputs will be very help full and savior to me.

0

There are 0 best solutions below