Archive: Installation directory defaults to window' system32


Installation directory defaults to window' system32
I've made my own script file for installing several software components here at work. Once I run the final executable installer and get to choose the installation directory, most of the time it is ok and it defaults to application name, however often it rather defaults to windows' system32!!!

It is quite problematic if someone just expect to click next, next, next and finish. Somehow when the browse button is clicked even though nothing was selected, the installation directory sometime comes back to what is expected.

I've actually "disabled" two computers here at work ( my fault) because of this. Since I was lazy and didn't specifically add all of the files in the de-installation sequence (but rather used Delete "$INSTDIR\*.*” to get rid of any remaining files, followed by RMDir "$INSTDIR") unfortunately, the two times the installation defaulted to windows’ system32 install directory…you can then figure out that happened …

Any clue why it often defaults to system32 ? Does it have to do with “current dir”?

In the script I do install few files in system32 but through the !insertmacro InstallLib macro.

I am using the latest NSIS installer intallation ie.: 2.06

And yes I have now fixed the de-installation sequence to be specific about files to delete :) Too bad that one have to learn lessons the hard way.

Thank.


The current working directory is not used as the installation directory, unless you've used it to somehow calculate the installation directory. Not much can be said without the script. You should attach it so someone can check it out and tell you what might have gotten wrong.


I didn't first posted the script, as I though it wouldn't usefull unless I also attach the equivalent entire tree (only relevant files) so someone can compile the script.

Anyhow here it is.


Here's your problem:

InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
# ...
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$SYSDIR\FTD2XXUN.EXE"
You should be writing $INSTDIR to that key, not $SYSDIR.

Wow, that was quick! You know your stuff quite well!

I guess those particular lines slip me as I didn't added them myself.

Thank you anyhow.