PDA

View Full Version : How to Uninstall before starting an installation


boltonwolf
07-05-2005, 04:47 AM
Hi,

When I updade our software on clients machines I'm having a problem where by Setup Factory is not replacing DLL's that have been changed. I've been advised to uninstall the package first, before the installtion starts.

Does any body have any pointer on how to do this without the user knowing. Ideally I only want to remove the files, leave the registry and shortcuts intact.

TIA
Bolton Wolf

Brett
07-05-2005, 09:15 AM
Well, to remove just the files is a bit of a challenge. If you wanted to run the old uninstall, you would be better off just reading the path to the uninstaller from:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Uninstall\<<Your Product ID>>

But if you want to just remove files what you could do is read in the existing uninstall.xml file using the XML plugin and then iterate through the files section and remove them manually.

However, if the core problem is that DLLs are not being replaced, I do not see how this method witll help you anyhow. What does the log file say about the existing DLLs when you run the install? Are they in use at the time of the install? What is your overwrite option set to?

csd214
07-05-2005, 11:38 AM
I have a project where I successfully run the uninstall in silent mode as the first task "While Installing" (remember to check "Allow silent uninstall" when you build the project).

If you want to keep the registry entries you could have a conditionally delete in your uninstall process, or you could read the values into variables before starting the uninstaller.

What really concerns me is WHY your DLL isn't updated. Do you have "Always overwrite existing file" or…? Some error trapping should tell why the DLL's aren't replaced.