Maybe I didn't explain this well. Anyway I found a solution.
After searching my install log I found a very handy property:
CLIENTPROCESSID.
CLIENTPROCESSID is the process ID of the msiexec.exe that is working with
the loaded msi database.
I added this property to the wix project:
<Property id="COMMANDLINE"/>
Added the below Custom Action:
<CustomAction()>_
Public Shared Sub GetCommandLine(ByVal session As Session) As ActionResult
Try
'Get all Win32 processes
Dim mngmtClass As ManagementClass = New
ManagementClass("Win32_Process")
For Each o As ManagementObject In mngmtClass.GetInstances()
'weed out the needed msiexec.exe
If o.GetPropertyValue("ProcessId").ToString =
session.item("CLIENTPROCESSID") Then
'Get entire command-line
session.item("COMMANDLINE")=
o.Properties("CommandLine").Value.ToString
Exit for
End If
Return ActionResult.Success
Catch ex As Exception
#If DEBUG Then
MsgBox(ex.Message & " @ " &
Reflection.MethodInfo.GetCurrentMethod.Name)
#Else
session.Log("Error: {0}", ex.Message)
#End If
Return ActionResult.Failure
End Try
End Sub
It works!
Now back to why I needed this in the first place.
Both msiexec /passive /x {ProductCode} and ARP uninstall cause the msi to
uninstall at UILevel=3
Now I know if the user supplied the /passive switch or if the user initiated
a normal uninstall.
My tests confimed that:
COMMANDLINE = 'C:\...msiexec.exe /i {ProductCode}' during normal ARP
uninstall
COMMANDLINE = 'C:\...msiexec.exe /i {ProductCode} /passive' when the user
supplies the switch
Bob Arnson-6 wrote:
>
> slmnow wrote:
>> So how can i differentiate between the user doing "msiexec /passive /x
>> {xxx-xxx}" vs a normal uninstall.
>
> You can't. There's no difference between how ARP runs your uninstall and
> how someone might run it programmatically or via the command line.
>
> --
> sig://boB
> http://joyofsetup.com/
>
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensign option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
--
View this message in context:
http://n2.nabble.com/Retriving-msiexec-command-line-options-tp2683347p2741246.html
Sent from the wix-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users