cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Matronix
Level 6

Having issues calling a IISCertDeploy.vbs from Installscript

I am trying to call IISCertDeploy.vbs from an install script to import a certificate and set the SSL port for a website I am setting up during the installation.

The custom action is being called after Install Finalize. Not sure what it is happening, it is just failing and the error messages says "Unexpected Error"

Are there any limitations with calling this VBScript or any from an Installscript?


		strCertificate = "\"" + strSupportDir ^ "Cert.pfx\"";    

strSSLPort = "7899";

strArgs = "-c " + strCertificate + " -p password -port \":" + strSSLPort +
":\" -i w3svc/" + strSiteID;

MessageBox(strArgs,INFORMATION);
if (LaunchAppAndWait(strSupportDir ^ "IISCertDeploy.vbs",strArgs,LAAW_OPTION_WAIT) < 0) then
SprintfBox(WARNING, "Error", "SSL Site Failed with error %s", FormatMessage( Err.Number ),LAAW_OPTION_WAIT);
return -1;
endif;
Labels (1)
0 Kudos
(2) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

I think the problem is that the .vbs file is not an executable. One way to fix this would be to call cscript or wscript directly, and pass the .vbs file as an argument.

In order to call it without specifying the executable, you will need to use a ShellExecute call. The easiest way to do that would be to switch to the LaunchApplication function and use the LAAW_OPTION_USE_SHELLEXECUTE flag. See the function's help topic for more details.
0 Kudos
TheTraveler
Level 8

I run WINSYSDIR ^ "iisext.vbs" during my installation. You need to run it in a command shell.

So try this....


WINSYSDIR ^ "cmd.exe /c cscript

strCommand = WINSYSDIR ^ "cmd.exe";
strArguments = "/c cscript \"" + strSupportDir ^ "IISCertDeploy.vbs -p password\""

LaunchAppAndWait(strCommand, strArguments, WAIT);


Please keep in mind that I through this together without compiling it. But, it should put you on the right track.
0 Kudos