Skip to content
⌘ NSIS Forum Archive

setting install directory to exe location

6 posts

burn_mame#

setting install directory to exe location

Hello again,

I did read about that faxt that one should be able to
set the default install location to where a specified
exe file is located. Of course still letting user
select there own output directory.

I can't figure out how to.

Thanks,
Ryland
MathiasSimmack#
Re: setting install directory to exe location

You could use InstallDirRegKey with the "UninstallString" value in the registry. But this requires a previous installed version.
InstallDirRegKey HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\YourOldApp" \
"UninstallString"
Another way is using FindFirst (and related) to search the file. The best place for this should be the ".onInit" event.


Mathias.
burn_mame#
I can do that but I would have to guess as to where the end user has the exe file installed....hoping to run installer and have it search for exe file and set InstallDir to the directory that the specified exe resides in.
Thanks,
Ryland