Uninstalling gracefully.

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
alexk
Posts: 4
Joined: Tue Feb 10 2004

Uninstalling gracefully.

Post by alexk »

Hello,

Our company recently purchased a developer licence of the PDF Converter. I was trying to include the package into our installation but faced a problem.

We deploy our msi package using the Active Directory, so we cannot use install.exe to perform the installation. I read in TN04 the following:
In your application’s install procedure, call PDFDriverInit( “MyCompany PDF
Export” ) or any other xxxDriverInit function. If you are using the ActiveX interface,
the printer will be removed as soon as you exit the install application, to avoid this call
DriverInit( “MyCompany PDF Export” ) immediately after PDFDriverInit(
“MyCompany PDF Export” ).
...and this seems to work fine. The problem is, I cannot uninstall the PDF Converter programmatically. Do I have to use Win32 to remove the printer or there is a more elegant way?

Thanks!
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You can use the PDF Converter programatically in two ways:

1 - You Install the printer when lauching your application and remove it before closing your application.
To do so you need to call PDFDriverInit when lauching the application and DriverEnd before closing it.

2 - You can install the printer on the system and keep it there even after closing your application.
To do so you call DriverInit right after PDFDriverInit.

Hope this helps, if you need more information please let me know.
alexk
Posts: 4
Joined: Tue Feb 10 2004

Post by alexk »

Thank you Joan.

I think I didn't explain this well. Our application runs under domain user account, so PDFDriverInit/DriverEnd on application's startup/shutdown won't work (domain users cannot install/remove printers).

PDFDriverInit during the installation works fine, but then I cannot uninstall the Amyuni PDF Converter when our application is uninstalled. As I mentioned install.exe -u won't work because our application is deployed with Windows Active Directory.

Is there another way to uninstall the Amyuni PDF Converter? If no, may be you could expose a function (something like PDFDriverUninstall)? Otherwise I would need to manually remove system and program files, and remove the printer using our uninstallation script.

Thank you.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello Alex,

I am not sure I did get your suggestion.

If you are running your application under a user account than the user will not be able to remove the PDF Printer or any other printer because he/she doesn't have enough rights to do so.

It is not a matter of adding a new function, it is an issue about Windows giving administrators only the right to add and remove a printer under 2000 / XP.

You can call DriverEnd in your unistall routine, this will unistall the printer if it was installed using PDFDriverInit but your users should have enough rights to unistall a printer from the system.

If this is not possible than you can unistall the printer using Windows APIs to delete the Printer and then delete the printer driver from inside your unistall routine.

Hope this helps if not please send an e-mail to support@amyuni.com with details about your request.

Thanks.
Dany
Amyuni Team
Posts: 113
Joined: Wed Sep 11 2002
Location: Montreal.
Contact:

Uninstalling the Amyuni printer

Post by Dany »

To uninstall, you can call:
PDFDriverInit( MyPrinterName )
followed by
DriverEnd

This will remove the printer. You still need to remove our files after rebooting the system.
Post Reply