How to activite [DefaultUnInstall] section in INF file?

Hi All,

I have an MSI package that install our Network drivers.
As part of the installation process, all the sys files are copied to system32\drivers directory.
Upon uninstall the sys files, registry entries are remain.

The problem happen when the user uninstall the package and try to install an old package, this will lead to driver stack mismatch, the upper drivers in the stack will be bounded to the core driver being installed.

I found that there is a section in the inf file called [DefaultUnInstall] that can delete files and services upon uninstall.
I tried to add it and it didn’t work.

My question:
Does the DefaultUnInstall section help me in this case? if yes can anyone help me how to add and activate it?

Thx Firas.

On 12/23/2010 11:20 AM, xxxxx@mellanox.co.il wrote:

I found that there is a section in the inf file called
[DefaultUnInstall] that can delete files and services upon uninstall.

Not in the general INF documentation:
http://msdn.microsoft.com/en-us/library/ff553377(v=VS.85).aspx

I tried to add it and it didn’t work.

Could it be this only works for File System Filters and Minifilters?:
http://msdn.microsoft.com/en-us/library/ff540035(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/ff557255(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/ff540045(VS.85).aspx

I suggest you consider using DIFxAPP and specify the flag to DIFx that
deletes the files on uninstall.

IIRC DIFx handles this ‘cleanup’ by itself (e.g. in code in DIFx) after
driver removal by processing the CopyFiles sections to figure out what to
delete.

I think you found the answer to your question already. No,
[DefaultUnInstall] does not help. Like all INF sections, something has to
decide to process it. Ultimately what sections are processed (and how they
are interpreted) is decided by the installer and if the installer is
delegating to SetupDi via a class-installer, it is decided by the
class-installer, co-installers, and possibly (for Net*) notify objects.

I will assume for the moment that by “network drivers” you mean one of the
classes of device/driver installed by NetCfg - Net, NetTrans, NetService,
NetClient. If not, please do tell us what you mean.

Some of the Net* classes (Trans/Service/Client) do support processing a
section during uninstall in which one can do some cleanup.

A PnP Device INF (like a Net [adapter] class) does not have an uninstall
section because nothing is keeping track of how many instances of the device
might be still installed; e.g. referencing the driver package. Moreover,
having such behavior would be rather a poor experience for the Admin whom
deletes and re-enumerates the last ‘device instance’. The driver would
commit suicide and the device would come back without a driver.

So bottom line? You either need to write the behavior into your installer /
uninstaller or leverage an existing implementation like DIFx.

Good Luck,
Dave Cattley