Forum Discussion

Oferv's avatar
Oferv
Super Contributor
14 years ago

MSI file is not running and popup an error message

Hi,



I'm trying to run an msi file using script i copied from your website.when i'm running the script on my local machine the script is running properly but,when i run it on a vmware i'm getting the following error - see attached.



the function:




 User = Sys["UserName"]

    var MSIpath = "C:\\Users\\" + User + "\\Downloads\\xxx.msi";

     if(TestedApps.Find("msiexec.exe") == -1)

       {

         TestedApps.Add(msiexec.exe, "/i " + MSIpath);

       }   

     Delay(5000)    

     TestedApps.msiexec.Run();

     Delay(3000)



why do i get the error?



thanks 

1 Reply


  • Hi Ofer,



    This error appears, because your MSI file cannot be found. You should check whether the specified MSI file exists. Try using the sample code given below:





    User = Sys["UserName"] 

    var MSIpath = "C:\\Users\\" + User + "\\Downloads\\xxx.msi";



    //Checks  whether the specified file exists

    Log.Message(MSIpath);

    if (! aqFileSystem.Exists(MSIpath)) { 

      Log.Message("File " + MSIpath + " is not exist!");

      return;

    }



    if(TestedApps.Find("msiexec.exe") == -1) { 

      TestedApps.Add(msiexec.exe, "/i " + MSIpath); 

    }        

    TestedApps.msiexec.Run(-1, true); 





    If this does not help, please post here the actual path to the MSI file.