0

I use following code to run an install file from c: drive.But it throws "Invalid Procedure call or Argument" error.I have tried "eval" to regularize the string ,but it didn't work.

dim BookName
dim Tmonth
dim Trimyear
    BookName="Name of a book"
       Tmonth="02"
       Trimyear="15"
       Installfile = "Install " &BookName&" ("&Tmonth&"-"&Trimyear&").msi"
       SystemUtil.Run Installfile,"","C:\TitleInstall"
tiny sunlight
  • 6,231
  • 3
  • 21
  • 42

3 Answers3

0

Hey thanks for the intrest. I have checked it with hard coded values, it worked fine. The issue only appears when the value changes dinamically. Please check it with any application on your system and try to assign the value dinamically.

0

If it works for hardcoded value, it will work for dynamic values as well. Just make sure that the dynamic value you generate in variable Installfile, the same file name is present in your "C:\TitleInstall" folder

As per your above code there should be a file named "Install Name of a book (02-15).msi". Is there any file named like that in your folder?

Just put that Installfile variable in msgbox just above the SystemUtil.Run and verify that file name which comes in msgbox is present in your folder or not.

Also try removing the blank string parameter from your run command(Unless you actually want to pass blank string as parameter) i.e

Change SystemUtil.Run Installfile,"","C:\TitleInstall"

to SystemUtil.Run Installfile,,"C:\TitleInstall"

user5612655
  • 200
  • 1
  • 11
  • and please comment here, and tag my name as @user5612655 as tracking answers are difficult – user5612655 Jan 14 '16 at 07:55
  • I have added the install file value to watch and checked and the required string is same. Please check with any of the applications from your system. And please try it once before posting a query since I have tried and checked all the things which needed. I need the spaces since it was the format the application is. Thanks for the reply – nishanth madala Jan 14 '16 at 08:03
  • Dude I tried it and then only replied. We cant bring dynamic files generated on our machine. And by dynamic you mean what, I tried keeping the file name in var and tried and it works for me on my machine. – user5612655 Jan 14 '16 at 09:37
  • I will copy a install file (book) from different location to local and then try to install it, each time the install file name changes and I generate it using parameters and try to invoke the file using system until. – nishanth madala Jan 23 '16 at 08:19
  • Seems it cant be solved without actually looking at the files or your actual code – user5612655 Jan 25 '16 at 09:42
0
myInstallerPath= "Inataller - Copy.msi"
SystemUtil.Run myInstallerPath , "\q" , "C:\InstallerDir"

The Above worked for me, please note that "\q" is to install an app with out user interaction and does not have any specific implications. SystemUtil.Run is basically your Command window. Launch CMD window, and enter the file path u are trying to execute, to be sure that is valid. (You may want to give the file path within double quotes)

Another option is to give the installer path straight away.. like this..

myInstallerPath= "C:\InstallerDir\Inataller - Copy.msi"
SystemUtil.Run myInstallerPath , "\q" 
Prageeth Saravanan
  • 1,053
  • 1
  • 8
  • 24