I do a WaitForExit and get an error code back from MSIEXEC of 1605 -- this
means product not installed. So I go into the registry to locate the
produce code and verify that it does indeed exist. Since I'm baffled as to
why shell ot MSIEXEC would return this error when the product IS installed,
I decide to try Start | Run and enter the exact same:
As this is your total code than it is definitly wrong because you are not
adding the ProsesStartInfo to the proces..
See this sample to open regedit.
\\\Registry
Dim p As New Process
Dim pi As ProcessStartInfo = New ProcessStartInfo
pi.FileName = "regedit"
pi.Arguments = "/S C:\yourRegFile.reg"
p.StartInfo = pi
p.Start()
///
I didn't post all my code, just the critical parts. The start process is
working fine as MSIEXEC is returning 1605 error code. I'm going to try to
log the MSIEXEC output but according to Microsoft 1605 means "This action is
only valid for products that are currently installed."
What has me really puzzled is the exact same command entered via Start | Run
works fine. There must be some undocumented "feature" of the Process or
something? I've talked to other developers that have received the 1605 from
MSIEXEC when it had nothing to do with the actual error.
The root of the problem seems to steam my Windows Service (interacts with
desktop is checked) shell. Here is the sequence:
DUSM.EXE (my Windows Service running un LocalSystem with "interact with
desktop" enabled)
DUSM performs a Process.Start which loads DUSM_UI.EXE
DUSM_UI.EXE performs a Process.Start which runs the MSIEXEC (see below)
Results: 1605 error (this appears to be a bogus error reported by MSIEXEC
but product does NOT uninstall)
Since DUSM_UI.EXE is a stand alone program I can run it directly (double
click in Explorer)
run DUSM_UI.EXE (from explorer) which performs a Process.Start which runs
MSIEXEC
Results: 0 (no errors and MSIEXEC performs the uninstall)
So this looks like some type of thread restriction being imposed on MSIEXEC
when its source thread path originates from a Windows Service.
The $64,000 question -- how can I work around this problem? My DUSM service
MUST be the originator of these tasks, what are my options? Where do I even
start to look for answers?