SCCM Package Uninstall MSI File Issue

I really just started using SCCM in the past couple of weeks so if I'm missing something obvious, I'm sorry. Since I've been using it, I have deployed a number of applications with no failures, including the program that I'm now trying to uninstall.

I am having an issue with uninstalling a custom program that was installed using an MSI file built by developers within my company. Being a custom application, I immediately thought the issue was related to the .msi itself, but I can remove the program successfully using the "msiexec /uninstall program.msi /quiet" command when logged in as a domain admin. The problem occurs when I try to wrap it up into a package and advertise it to a collection in SCCM 2007 R2.

Here are some of the many things I've tried so far:
1. Build a program within a package with the source .msi file in it and use the same command line as above.
2. Build a program within a package with the source .msi file in it and use the same command as above except instead of the "program.msi" I use the .msi installer code.
3. Build a program within a package that only runs the command line as seen above (no source files)
4. Advertise a task sequence that runs the same command line as seen above. (The task sequence I had only run the command line)
5. Advertise a task sequence that runs the same command line as seen above and run that sequence as a domain admin user. (The task sequence I had only run the command line)
6. Build a program within a package that contains a batch file that runs the command line as seen above.

The status message details indicate an exit code of 1603, which I believe is pretty generic and unhelpful. Any suggestions?
dpsysAsked:
Who is Participating?
 
Adam LeinssServer SpecialistCommented:
If you are running the package locally from the PC, you shouldn't have to set the "start in".  The current directory will be set to C:\windows\system32\ccm\cache\<package.id>.  "Start in" would be used if you wanted to set the current directory to say "C:\program files\someprogram" and you wanted to run "unwise.exe" within "C:\program files\some program".  Instead of using "C:\program files\someprogram\unwise.exe" for the command line, you could just set the "start in" path and use "unwise.exe" for the command line.
If you are running the program under the administrator mode, it uses the local system account which will not have access to HKCU.  This could cause a failure for your MSI uninstall.  
0
 
merowingerCommented:
You need one package in summary. The package points to the directory with the msi in it. Within the package you need two different programs. One for installtion and one for removing the application.

command line for installation: msiexec.exe /I yourmsi.msi /qb-!
command line for removing: msiexec.exe /X {MSI Product Code}
0
 
dpsysAuthor Commented:
I could be wrong, but I was under the impression that /X and /uninstall were one in the same. If so, then I believe my example #2 is what you're saying to try.

What I did in #2 is create a program that sits in the same package as the installation program, the uninstall program uses the command line "msiexec /uninstall {MSI Product Code} /quiet" and I've also tried "msiexec /uninstall {MSI Product Code}" in another program within the same package. The latter timed out during the run process, the prior fails with the exit code 1603.

0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Adam LeinssServer SpecialistCommented:
Add some logging to your command line and then look at the log:
msiexec /uninstall program.msi /quiet /l*v debug.log
The log should be created within the package source itself, somewhere in C:\windows\system32\ccm\cache\<packageid>
Does the uninstall remove anything from the user's registry, i.e. HKEY_CURRENT_USER (HKCU)?
0
 
dpsysAuthor Commented:
Thanks for the comment, I enabled logging and this is what I get:

=== Verbose logging started: 4/23/2010 9:29:30 Build type: SHIP UNICODE 5.00.7600.00 Calling process: C:\Windows\system32\msiexec.exe ===
MSI (c) (30:B8) [09:29:30:874]: Resetting cached policy values
MSI (c) (30:B8) [09:29:30:874]: Machine policy value 'Debug' is 0
MSI (c) (30:B8) [09:29:30:874]: ******* RunEngine:
******* Product: program.msi
******* Action:
******* CommandLine: **********
MSI (c) (30:B8) [09:29:30:874]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (30:B8) [09:29:30:874]: Grabbed execution mutex.
MSI (c) (30:B8) [09:29:31:030]: Cloaking enabled.
MSI (c) (30:B8) [09:29:31:030]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (30:B8) [09:29:31:045]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (7C:D0) [09:29:31:061]: Running installation inside multi-package transaction C:\program.msi
MSI (s) (7C:D0) [09:29:31:061]: Grabbed execution mutex.
MSI (s) (7C:E0) [09:29:31:077]: Resetting cached policy values
MSI (s) (7C:E0) [09:29:31:077]: Machine policy value 'Debug' is 0
MSI (s) (7C:E0) [09:29:31:077]: ******* RunEngine:
******* Product: C:\program.msi
******* Action:
******* CommandLine: **********
MSI (s) (7C:E0) [09:29:31:077]: Note: 1: 2203 2: C:\program.msi 3: -2147287038
MSI (s) (7C:E0) [09:29:31:077]: MainEngineThread is returning 2
MSI (s) (7C:D0) [09:29:31:077]: User policy value 'DisableRollback' is 0
MSI (s) (7C:D0) [09:29:31:077]: Machine policy value 'DisableRollback' is 0
MSI (s) (7C:D0) [09:29:31:077]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (7C:D0) [09:29:31:077]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (7C:D0) [09:29:31:077]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2
MSI (s) (7C:D0) [09:29:31:077]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
MSI (s) (7C:D0) [09:29:31:077]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\InProgress 3: 2
MSI (s) (7C:D0) [09:29:31:077]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (s) (7C:D0) [09:29:31:077]: Restoring environment variables
MSI (c) (30:B8) [09:29:31:092]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (30:B8) [09:29:31:092]: MainEngineThread is returning 2
=== Verbose logging stopped: 4/23/2010 9:29:31 ===

 
0
 
Adam LeinssServer SpecialistCommented:
2203 is an internal error.  Why does it say C:\program.msi?  What command line are you using?  You really don't want to use "C:\" in your command line if the MSI is in package source.
0
 
dpsysAuthor Commented:
What should the 'Start in:' be set to in the program properties?
0
 
dpsysAuthor Commented:
I'm sorry, you also asked if any changes to the registry were made with this program. The answer is yes. There are changes made in HKCR, HKCU, HKLM and HKU, as well as program files added to the C:\Program Files\Program directory.
0
 
Vadim RappCommented:
1. If the program was installed per-user, then you need to uninstall it using per-user program as well. Actually, when you created the package, if you used "create package from definition", you should already have the uninstall program under the same package, so just advertise it.

2. To cut off the issues with package delivery, make sure the program is using form /uninstall {code} . Add /l*v debug.log to the command, and post the log here.
0
 
dpsysAuthor Commented:
I have been able to resolve the issue, although not exactly how I would like to do it.

I created a program that runs the following command:

msiexec /i program.msi /qb-! REINSTALLMODE=vemus REINSTALL=ALL /l*v vemuslogfile.log

This command line should reinstall the application over the old one, and it does...almost. What ends up happening is that the old program is removed completely but the new program only installs partially. What I did to combat this is to create another program with the following command line:

msiexec /x program.msi /qb-! /l*v uninstalllogfile.log

This uninstalls the remnants of the program and gets me back to a machine state without the application. In order to install the new program, I used the following command:

msiexec /i program.msi /qb-! /l*v installlogfile.log

This installs the program and everything works fine. It's obviously not the way I'd like accomplish the uninstall/install, but being in the time crunch I'm in, it's ok with me.
I considered running REINSTALLMODE=a, which would have forced a reinstall of everything, but I decided to stop with what worked and not try any more experimentation.
Thanks for the comments, unless you guys have anything to add, I'm going to award the points to alienss as his comments really got me pointed in the right direction.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.