Forum Discussion

akalogeropoulos's avatar
akalogeropoulos
Occasional Contributor
12 years ago

Execute installation via msiexec

I'm trying to execute the mis but i only get the "Windows Installer" help window. I think the problem is there is spaces in the msi file and  i was not able to find a solution. Help.  Here the my code:                                                                                                                              function startInstall()

{

 

  var TestApp, foundFiles, afile;

 

 

  foundFiles = aqFileSystem.FindFiles("C:\\Users\\insideview\\Downloads\\Release\\","xxxxxx.msi");

 

  if (foundFiles != null)

  {

    while (foundFiles.HasNext())

    {

    afile = foundFiles.Next();

    }

  }

  else

  {

    .....   

  }

  TestApp = TestedApps.msiexec;

 

  TestedApps.msiexec.Params.SimpleParams.CommandLineParameters = "/i " + afile.path;

 

  TestedApps.msiexec.Params.SimpleParams.Activate();

 

  // Launches the tested application

  TestApp.RunAs("","xxxxxxx","xxxxxxx")                                                                                                    }Thank you.

  • Hi Tasso,


     


    If there are spaces in the file name, try adding the following line to your code:




    TestedApps.msiexec.Params.SimpleParams.CommandLineParameters = "/i " + ' "' + afile.path + '" ';