Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

msiexec /q /x does not remove all files

460 views
Skip to first unread message

Philip Martin

unread,
Oct 29, 2002, 3:02:20 PM10/29/02
to
I'm having a problem uninstalling an application from a
batch file using msiexec. I run:
msiexec /q /x {EC72DA17-F356-4995-BEC6-BD3FB9CD2DF5}
Where {EC72DA17-F356-4995-BEC6-BD3FB9CD2DF5} is the
product number.

If I uninstall the application via the Control Panel
everything works fine.
If I run msiexec using the syntax above, it leaves files
in the Application Folder. When I try to reinstall I run
into all sorts of problems.

How should msiexec be used to uninstall software correctly?


Philip Martin

unread,
Oct 29, 2002, 3:31:08 PM10/29/02
to
There are Custom Actions, but they shouldn't stop the
files from being removed. The Custom Actions don't require
the GUI so that's not the problem.
>-----Original Message-----
>You've suppressed the user interface totally, so maybe
there is a custom action that should run on
>an uninstall, and it's being skipped?
>
>"Philip Martin" <garg...@nospam.com> wrote in message
>news:0ebf01c27f86$17098400$3aef2ecf@TKMSFTNGXA09...
>.
>

Ruidong Li [MS]

unread,
Oct 29, 2002, 4:10:14 PM10/29/02
to
What happen if you uninstall without /q switch?

Thanks!
Ruidong [MS]

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.
--------------------
>>Content-Class: urn:content-classes:message
>>From: "Philip Martin" <garg...@nospam.com>
>>Sender: "Philip Martin" <garg...@nospam.com>
>>References: <0ebf01c27f86$17098400$3aef2ecf@TKMSFTNGXA09>
<eoEvlj4fCHA.2284@tkmsftngp11>
>>Subject: Re: msiexec /q /x does not remove all files
>>Date: Tue, 29 Oct 2002 12:31:08 -0800
>>Lines: 30
>>Message-ID: <102001c27f8a$1cc4a920$2ae2...@phx.gbl>
>>MIME-Version: 1.0
>>Content-Type: text/plain;
>> charset="iso-8859-1"
>>Content-Transfer-Encoding: 7bit
>>X-Newsreader: Microsoft CDO for Windows 2000
>>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>>Thread-Index: AcJ/ihzEwnrI51PMQvCSpNDgqCV09A==
>>Newsgroups: microsoft.public.platformsdk.msi
>>Path: cpmsftngxa09
>>Xref: cpmsftngxa09 microsoft.public.platformsdk.msi:9761
>>NNTP-Posting-Host: TKMSFTNGXA14 10.201.226.42
>>X-Tomcat-NG: microsoft.public.platformsdk.msi

Philip Martin

unread,
Oct 29, 2002, 4:35:52 PM10/29/02
to
It still does not remove the files. I do notice that on
install there are files added to the directory where the
dll's are installed named XXXX.InstallState, where XXXX is
the name of a dll from which contains an Installer class
and is run as a Custom Action.
For instance, two of the dll's which are in the installer
project are DBAccess.dll and
Gargoyle.HistoricalAnalysis.Forms.dll.
They both have Installer classes.
DBAccess and Gargoyle.HistoricalAnalysis.Forms are added
to Custom Actions-> Install
Gargoyle.HistoricalAnalysis.Forms is added to
CustomActions -> Uninstall

Any ideas? I need to be able to run a script to roll back
my application to an older version if needed. I'm doing
this by using msiexec to uninstall the current version and
then install the old version.


Phil Wilson

unread,
Oct 29, 2002, 4:41:00 PM10/29/02
to
Actually custom actions in the user interface DO require the GUI - maybe that's not want you meant
to say, but I just want to be sure you understand that none of the custom actions in the user
interface sequence will run if you skip the entire InstallUISequence with the /q switch. There may
be other issues too - for example if you require an AppSearch to happen and you don't have the
action in both the user and execute sequences, then you won't get your AppSearch done.

"Philip Martin" <garg...@nospam.com> wrote in message

news:102001c27f8a$1cc4a920$2ae2...@phx.gbl...

Phil Wilson

unread,
Oct 29, 2002, 3:23:46 PM10/29/02
to
You've suppressed the user interface totally, so maybe there is a custom action that should run on
an uninstall, and it's being skipped?

"Philip Martin" <garg...@nospam.com> wrote in message
news:0ebf01c27f86$17098400$3aef2ecf@TKMSFTNGXA09...

Phil Wilson

unread,
Oct 30, 2002, 12:50:28 PM10/30/02
to
In your complete msi file, I suggest you use Orca (in the Windows Installer section of the Platform
SDK) to look at the msi file. It's not clear from the way VSI does this where your custom actions
actually occur in the sequences. If you look at the InstallUISequence and InstallExecute sequence
you'll see custom actions. The general flow in these sequences might have some other clues as to
what's going on during Add/Remove Programs (which shows a minimal gui) and /q.

There is also a machine policy for logging (look up machine policies and the Logging option in
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer). If you turn this on (I think it
needs a reboot to take effect) all installs will produce a log, including your Add/Remove programs.
Comparing your msiexec log with the one from ARP might show some clues.


"Philip Martin" <garg...@nospam.com> wrote in message

news:6e7101c28023$0ac57a80$3bef2ecf@TKMSFTNGXA10...
> Here is how I add the Custom Actions.
> 1) In my Installer project I right click on the project
> and select "View Custom Actions".
> 2) Right click on the Install folder and "Add Custom
> Action"
> 3) Select the Application Folder and add one of my dlls
> which has an installer.
>
> I repeat this action for a couple of dlls in the
> Application Folder and then repeat this for the Uninstall
> actions.
>
> Do these "Custom Actions" require the GUI?
> Also, this seems to leave the files when I don't use
> the /q as well.
>
> I've tried running msiexec with /L*v and looked through
> the logfile but I don't see anything that looks like an
> error.

> >.
> >


Kallely Sajan

unread,
Oct 31, 2002, 12:31:35 AM10/31/02
to
Chech if you have feature condition that will set the install level to 0

--
Regards,
Sajan.

PS: Please don't send me emails, use the news room, so that others also will
be benefited.

"Philip Martin" <garg...@nospam.com> wrote in message
news:0ebf01c27f86$17098400$3aef2ecf@TKMSFTNGXA09...

Philip Martin

unread,
Nov 4, 2002, 4:16:21 PM11/4/02
to
What do you use to create installers? Is there any decent documentation on
the way VSI creates installers? I looked at the InstallUISequence and the
InstallExecuteSequence and only see the custom actions in the
InstallExecuteSequence. I'm about to reboot and see if I can use the logs to
figure out what is going on.
Right now it looks like when you remove a program using the Add/Remove
Programs the system runs msiexec using some flags that I don't know about
because I don't get the same results if I uninstall my app using Add/Remove
Programs as when I uninstall using the command:
msiexec /x pathToTheOriginalMSIFile

"Phil Wilson" <phil....@unisys.spamcom> wrote in message
news:#jZLlyDgCHA.1848@tkmsftngp10...

Phil Wilson

unread,
Nov 7, 2002, 4:13:10 PM11/7/02
to
I think Add/Remove Programs runs msiexec /x {productcode guid}, and perhaps has a /q option of some
kind.

"Philip Martin" <garg...@nospam.com> wrote in message news:uvSFPdEhCHA.1368@tkmsftngp09...

Philip Martin

unread,
Nov 7, 2002, 5:21:18 PM11/7/02
to
Does anyone know for a fact what Add/Remove Programs does? I am running
msiexec /x productcode and not getting the same results as when I remove the
program from the control panel. It is not just msiexec /x productcode

Curtis Sawin

unread,
Nov 7, 2002, 7:37:22 PM11/7/02
to
Add/Remove programs is just an interface into the registry. Specifically,
the registry key "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall"

The subkeys under this registry key usually represent applications. Each
application typically has an "UninstallString" registry value that defines
what happens when one uninstalls an application via the registry. If MSI
installed the product, then "msiexec /x {productcode}" is usually entered as
the uninstall string.

However, a setup author has the ability to change this value during install,
simply by editing the registry table. Thus, the only way to know for a fact
what happens when one uses add/remove programs to remove a product is to
look in the registry.

Hope this helps!

Curtis Sawin

"Philip Martin" <garg...@nospam.com> wrote in message

news:O7aagvqhCHA.1960@tkmsftngp08...

Chris Gouge [MS]

unread,
Nov 7, 2002, 9:13:00 PM11/7/02
to
While this description is accurate in most cases involving non-MSI software,
applications installed via MSI are more tightly integrated with Add/Remove
Programs. When Add/Remove Programs uninstalls an application, it works
directly with the normal Windows Installer APIs to launch the uninstall
operation.

This is possible because MSI provides a standard method for uninstalling all
MSI-based products (including advertised applications).

-Chris Gouge
Microsoft Windows Installer Team

This posting is provided "AS IS" with no warranties, and confers no rights.

Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

MSI FAQ:
http://www.microsoft.com/windows2000/community/centers/management/msi_faq.as
p


"Curtis Sawin" <curti...@comcast.net> wrote in message
news:#9sQD6rhCHA.1952@tkmsftngp09...

0 new messages