cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Action for Uninstall

I have made this MSI with 2 custom actions inside

1 . InstallPrinter to install a local printer driver and

2: Remove Printer to remove the printer driver in case the MSI is to be uninstalled.

The first one the installation part works fine but the last Custom action dos not work properly

It is not the command line but some of the other settings, Driverfiles are installed also in this package

that's why I use After installFiles in the first one.

What is wrong in my settings,

I get a 2762 error



InstallPrinter

Working Directory : SystemFolder
Filename & Commandline : rundll32 printui.dll,PrintUIEntry /if /b "CaseWarePrinter" /f "C:\windows\system32\hp4drv\lj456p5.inf" /r "Lpt1:" /m "HP LaserJet 4" /z /u

Return Processing : Synchronous(ignores exit code)
In-script Execution : Immidiate Execution
Execution Sceduling : Always execute
Use 64bit : no
Install UI sequence :

Install Exec Sequence : After InstallFiles
Install Exec Condition :

Admin UI Sequence :

Admin Exec Sequence :
Admin Exec Condition :
MSI type number : 98


RemovePrinter

Working Directory : SystemFolder
Filename & Commandline : rundll32 printui.dll,PrintUIEntry /dl /n "CaseWarePrinter" /q

Return Processing : Synchronous(ignores exit code)
In-script Execution : Commit Execution
Execution Sceduling : Always execute
Use 64bit : no
Install UI sequence :

Install Exec Sequence : After InstallValidate
Install Exec Condition : REMOVE="ALL"

Admin UI Sequence :

Admin Exec Sequence : After InstallValidate
Admin Exec Condition : REMOVE="ALL"
MSI type number : 1634

Please help

Sweede 😞
(5) Replies
I have solved the problem, and I will return later with the solution

Sweede 😉
CChong
By Level 11 Flexeran
Level 11 Flexeran
Comeon sweedy i am wating for ur reply please send me the
solution.

regards
chakri
Here is my solution:

First I was pleased because I had one MSI running fine when installed manually, like I always do testing before running by GPO.

The MSI could install printer and remove printer when activated by me logged on as administrator.

But running By GPO the installation stopped like some dialog wanted reply I did´t get any error messages.


So I had to study more about the Windows Installer operation and Custom Action basics

One great help for me has been the new Install Shield Press book by Bob Baker

Practical Windows Installer Solutions ISBN 0-9715708-3-3.

I have bought the book because of his solution to install PnP devises also with custom actions

I don’t have that one yet but I’m getting there I hope.

First the installed printer driver must be digitally signed, that was my first problem.
The printer driver I got from HP was not signed.

I found that Microsoft have included ntprint.inf supporting all included printers in the box.
ntprint.inf is a system file so you don’t find it at first, but it I located at %SystemRoot%\inf folder

It is vital that you use the right combination of execution type and the right sequence to get it working. Bob Baker’s book helped me there.

This is my Custom Action for install Printer:


InstallPrinter

Working Directory : SystemFolder
Filename & Command line : rundll32 printui.dll,PrintUIEntry /if /b "CaseWarePrinter" /f "C:\windows\inf\ntprint.inf" /r "Lpt1:" /m "HP LaserJet 4" /z /u

Return Processing : Synchronous(ignores exit code)
In-script Execution : Deferred Execution in System Context
Execution Scheduling : Always execute
Use 64bit : no
Install UI sequence :

Install Exec Sequence : After Install Files
Install Exec Condition : REMOVE=""

Admin UI Sequence :

Admin Exec Sequence :
Admin Exec Condition :
MSI type number : 3170


RemovePrinter

Working Directory : SystemFolder
Filename & Command line : rundll32 printui.dll,PrintUIEntry /dl /n "CaseWarePrinter" /q

Return Processing : Synchronous(ignores exit code)
In-script Execution : Deferred Execution in System Context
Execution Scheduling : Always execute
Use 64bit : no
Install UI sequence :

Install Exec Sequence : After Install Files
Install Exec Condition : REMOVE="ALL"

Admin UI Sequence :

Admin Exec Sequence :
Admin Exec Condition :
MSI type number : 3170


The Install Printer Custom action is also running when you remove the package, that’s why I have to place a condition there ass well.
Other wise the printer gets off an on again when pulling it off.

my testing so far confirms me in how invincible I am.

Sweede 😉 🙂
How did you bypass the problem with the dialog box for confirming installation of an unsigned driver? Or did you manage to get ahold of a signed driver?
Good one 🙂 Thank you....