Uninstall is not clean

Got a problem you cannot solve? Try here.
gibbie99
Posts: 26
Joined: Fri Jan 14, 2011 9:57 am

Uninstall is not clean

Postby gibbie99 » Mon Feb 23, 2015 4:15 pm

I am having an issue with IA 18 where the uninstall would go smoothly but the icon is still present in the add/remove programs dialog in windows, and there are still references in the regedit to the program.

Is there a check list of what needs to occur for a clean uninstall? One thing that is occuring is a few files that are generated during the installation process and are not being removed. I'm not sure if that is the issue that is blocking the uninstall.

Also there is a folder I am creating in MSI code under the $TARGETDIR$, how can I remove this during uninstall?

Update: I removed the two files from MSI code and the there are still items in the registry and in Start Menu (the program folder and a uninstall icon) that indicate the program is not being uninstalled cleanly.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Uninstall is not clean

Postby FrancescoT » Tue Feb 24, 2015 1:34 pm

Dear gibbie99,

are you having this problem when un-installing from ADD REMOVE PROGRAM?

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

gibbie99
Posts: 26
Joined: Fri Jan 14, 2011 9:57 am

Re: Uninstall is not clean

Postby gibbie99 » Tue Feb 24, 2015 3:45 pm

Yes, so when we run the uninstall from add/remove programs, the uninstall part of installaware finishes without errors. But the icon remains in add/remove programs and must be removed again, when I did that, Windows generates an error to the effect "the uninstall was not clean, want me to remove this now"? Also there are elements in the registry left behind, such as the entries to the programdata. Sorry this is probably pretty confusing. The files are being removed automatically but it looks like the part that removes the program from the registry is not working.

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Uninstall is not clean

Postby bokkie » Tue Feb 24, 2015 5:49 pm

Did you use the native engine anywhere? If so, could it have still been active when your registry items, etc were created? If so, they will never be removed or reclaimed unless you set the native engine to remove them. I once did that in an installer project. I set the native engine but forgot to "turn it off" and I was left with things that didn't go away when I uninstalled. Just an idea...
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

gibbie99
Posts: 26
Joined: Fri Jan 14, 2011 9:57 am

Re: Uninstall is not clean

Postby gibbie99 » Wed Feb 25, 2015 6:47 am

I don't think so, how would I know if I used the native engine? Still confused on that concept. I know there are two engines but not sure which is which and how to know if you are invoking Native Engine.

Thanks!

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Uninstall is not clean

Postby bokkie » Wed Feb 25, 2015 8:56 am

The native engine is now most unlikely in your case. It's not something you can activate by misfortune or bad luck or being in the right place at the wrong time. :)

In short, you specify a flag as true which enables the native engine and then set it false to disable it. Native engine commands are invoked at the time they are used. No record is retained about them in the MSI tables. Without it, statements are run only when Apply Install is executed and because they are recorded in the MSI tables they are therefore reversible during uninstall.

That doesn't resolve your issue because if you aren't using the native engine then your package should have uninstalled everything correctly.

I'm just shooting arrows here but did you change the project GUIDs at anytime in the past?

You might need to manually delete all the artifacts from your machine such as any files and registry keys and then try installing them again and then run the uninstallation immediately after to see if they are removed without a problem.

If you have leftover folders that won't delete then could another application have created a file inside it which could prevent it being deleted unless it was empty. In this case, the native engine might help because you could forcibly delete a folder's contents and then let Apply Install handle the rest.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

gibbie99
Posts: 26
Joined: Fri Jan 14, 2011 9:57 am

Re: Uninstall is not clean

Postby gibbie99 » Wed Feb 25, 2015 9:12 am

This is great. I think the issue is that $TARGETDIR$ has a bunch of stuff that was not in the install package. I'll delete it manually and wipe all traces from the registry, then retry it. So does this mean that $TARGETDIR$ must be clean to be removed, and otherwise the package does not uninstall correctly?

Thanks very much!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Uninstall is not clean

Postby FrancescoT » Wed Feb 25, 2015 10:07 am

Dear gibbie99,

by default the Windows Installer engine doesn't delete an installation folder at uninstall time, if its content becomes updated after product installation.
For example; when a new file is saved within the folder successively the product installation.


Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

gibbie99
Posts: 26
Joined: Fri Jan 14, 2011 9:57 am

Re: Uninstall is not clean

Postby gibbie99 » Wed Feb 25, 2015 10:10 am

Thanks. I deleted the old data and re-tried the uninstall. Same result (there is still an icon in add/remove programs, still registry entries, etc.), but now I have an empty $TARGETDIR$.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Uninstall is not clean

Postby FrancescoT » Wed Feb 25, 2015 10:20 am

Dear gibbie99,

sometimes and under some unknown circumstances, the Windows Installer engine doesn't remove all registry entries during un-install ( ...The same doesn't happen if the package is removed from control panel).

If this is your case, it's possible to achieve this issue via IA script code and as workaround, please use the attached script with your project.

How to use the attached script;

1- decompress the attached archive to a local folder on your system.

2- Open your project in the IA IDE

3- Switch to IA MSIcode view.

4- right click the "Include Script" node (from the left tree pane) and then select "Add existing scripts ..." to include the "df_remove_old_ver_app_entry_in addremove.mia" script that you have previously stored on your local system.

5- Use the command "Include Script" to execute the script just before the call "Install/Remove MSI" Package ("Install Application Pre-Requisites" REGION) in your main script code (#code line 32, if you create a new project from scratch).

6- Finally, Re-Build your project.


Hope this helps you.


Regards
Attachments
df_remove_old_ver_app_entry_in addremove.rar
(545 Bytes) Downloaded 469 times
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 25 guests