Archive: UMUI Maintenance Page Remove error


UMUI Maintenance Page Remove error
In order to have a Maintenance Page using UMUI you must '!define' (among other things) UMUI_UNINSTALL_FULLPATH. The problem is, this may be declared before the install directory is finalized (and therefore the uninstall directory) which causes the 'Remove' option on the maintenance page to not be selectable.

I attempted to '!define' it to a default and then change the created registry key (in my case "UninstallString") once I knew the appropriate location, but this also causes the error of 'Remove' not being selectable on the Maintenance page. This seems like a pretty big flaw considering that any installer that allows the user to change the install directory would have a broken 'Remove' option on the Maintenance Page. This is of course assuming that the '!define' uses something like "$INSTDIR\uninstall.exe" (which all the examples show).

Therefore, I am wondering if there is a way around this because I feel like I am missing something. Any thoughts?


It appears to be yet another issue with Windows User Account Control. Thank you Windows.


shoot, it doesn't appear to be a UAC issue. Things are still broken. You simply can not change the value of the Registry key created by '!define UNINSTALLER_FULL_PATH'. This is a problem since the path is not know until after the user defines the installation directory (unfortunately this happens after defining the above registry key). Therefore, the Remove option on the Maintenance page doesn't work and can't even be selected...bummer.

Does anyone have any ideas on this? I may just have to write my own Modify/Repair/Remove page but would like to avoid it as I am up against a tight deadline. Thanks.


Originally posted by blh83
You simply can not change the value of the Registry key created by '!define UNINSTALLER_FULL_PATH'.
Why not? Just define it as "$INSTDIR\Uninstall.exe".

Thanks MSG, but the crux of the problem is the "$INSTDIR" portion. The installation directory may change if the user is given the option to do so. This choice is not made until AFTER the registry key has been written (in my case, the key is "UninstallString"). If you then go in and change the registry key once you know the correct location, it breaks everything. The act of changing the key breaks the Remove option on the Maintenance page. I don't know why it exhibits this behavior, but I have verified it. If I write the registry key and don't change the install path, everything works swimmingly. If I change the install path and then change the registry key, the Remove option is broken.

I am not sure if this is making any sense. Here is some basic code to show what I mean:

!define UMUI_UNINSTALL_FULLPATH "$INSTDIR\uninstall.exe" //lets say this is C:\uninstall.exe

If I do nothing more and don't give the user the option to change the install directory, then everything is great. But now I do this:

!define UMUI_UNINSTALL_FULLPATH "$INSTDIR\uninstall.exe"

//the installer runs and the user chooses a directory and the uninstaller ends up in "C:\SomeProgram\uninstall.exe"

Therefore I go in and change the registry key (I have done this multiple ways but lets say I delete then add):

DeleteRegValue ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "C:\SomeProgram\uninstall.exe" //pretend this was not hard-coded but retrieved from the appropriate place. This just makes it easier to see.

Now when the user receives the Maintenance page, if they re-run the installer, the Remove option is not selectable: Why?. Hopefully this makes more sense.


Ok, I see the problem. No idea why it'd disable the remove function... Guess you can either wait for SuperPat to show up, or modify the UMUI header files to write the uninstall regkey at a later time. (BTW, you could also check whether maybe changing the page order is an option.)