Archive: setting install directory to exe location


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


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.

thank you but I do not have control over how the .exe is installed.
Ryland


You can set the default folder using InstallDir.


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


You can use the .onVerifyInstDir function to validate.