views:

98

answers:

3

As you know, Windows has a "Add/Remove Programs" system in the Control Panel.

Let's say I am preparing an installer and I want to register my program to list of installed programs and want it to be uninstallable from "Add/Remove Programs"?

Which protocols should I use. Any tutorials or docs about registering programs to that list?

I am coding with python and I can use WMI (Windows Management Instrument) or Win32 API. IMHO, it is done with Registry keys but I am not sure with it.

I also want to execute an uninstaller upon the Uninstallation to remove installed files. Any related docs or tutorials are highly appreciated. Thanks.

+2  A: 

As stated on IRC:

"Windows keeps its uninstall information in the registry"

Its in HLLM\Software\Microsoft\Windows\CurrentVersion\uninstall\ keys.

You need a few things from the Win32 API, but I belive there's a fair amount of Python support for the win32 API.

Basically, a key in ...\Uninstall\ with a unique name (like "MyApp") with a few special values stashed in there. Add/Remove programs looks through there.

Its pretty self-explanatory.

Indrora
A: 

Inno Setup is open source so perhaps you can get some ideas from that.

Cidtek
+1  A: 

If you are developing for Windows platform I think using Windows Installer from Microsoft won't be a problem.

You can check documentation of Windows Installer from Microsoft.com Windows Installer Page

Musa Ülker
not allowed to use any 3rd party software but win32 api. using Microsoft(R) licensed software is highly restricted.
Ahmet Alp Balkan