开发者

Unable to Pass parameters to MSI thro Msiexec via command prompt

Hii ppl I am trying to pass parameter thro msiexec in command prompt . The problem is eventhough the parameter is passed properly the value doesnt get reflected in the OnBeforeInstallEvent. Therefore the msi doesnt get installed.

The OnBeforeInstall is written C#.net framework 2.09 (VS 2005) and the event call is given below,

string serverName=Context.Parameters["SERVERNAME"].

For example, In the custom action the parameter is properly declared as /SERVERNAME=[SERVERNAME] s开发者_C百科o as to access the server name.

There is no problem when I install thro normal UI mode when I pass the parameter thro Msiexec the value doesnt get reflected at the OnBeforeInstall event. I even tried logging the flow of installation thro MSIEXEC /Log , the value gets changed in log ( shown below)

PROPERTY CHANGE: Adding SERVERNAME property. Its value is 'machine1'.

I have given below the msiexec command which I use to pass values,

msiexec.exe /i "C:\Server.msi" /l*v "C:\Server.txt" ALLUSERS=1 REBOOT=ReallySupress TARGETDIR="C:\Program Files\Server" SERVERNAME="machine1" PORT="9090"

but on reaching ONBeforeInstall the value is empty (show below).

Error 1001. An exception occurred in the OnBeforeInstall event handler of Server.ServicesInstaller. --> Installation cannot be continued as some of the installation parameters are not given. More Info -Server Name cannot be empty. DEBUG: Error 2769: Custom Action _542E7AC5_7403_434A_874B_DE2872A4848D.install did not close 1 MSIHANDLEs. The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769.

Moreover, the Operating system is Win 2003 . I even tried the Msiexec in Win XP too Still no go. The SERVERNAME is the property name of one of the textboxes in the TextBox2 Dialog box of setup kit. While observing the installation log , the property change event is recognizing the value change for SERVERNAME but It becomes null while reaching the OnBeforeInstall event don kno wy.

As said earlier it works perfectly in normal UI mode. I even tried modifying the property table of Server.msi thro ORCA(as given below).

Table :Property Row :SecureCustomProperties Property -> SecureCustomProperties Changed value from NEWERPRODUCTFOUND to NEWERPRODUCTFOUND;SERVERNAME

Still no go

Please Help.

Many thanks,

byfour


Hii PPl, I fixed it myself I jus removed the rows like CustomTextA_SetProperty_EDIT1 from customaction table and their refferences in other tables using ORCA and it solved the issue.

Many thanks,

byfour

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜