|
|
#1 |
|
Guest
Posts: n/a
|
Wrong installation path when updating
I have created a setup which correctly installs my application. The application's main executable is located in a "bin" folder below the installation directory. For example, after installation, the installation directory looks like this:
{InstallDir}\bin\myapp.exe {InstallDir}\data\datafile.dat So far so good. The problem is, that when I start the setup kit again, e.g. to update my app, the installer proposes "{InstallDir}\bin" as the installation directory. Where does it get this path from and how can I correct it? Thanks a lot, Martin |
|
|
|
#2 |
|
Senior Member
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
|
Did you use InstallDir, InstallDirRegKey functions in your script?
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2002
Posts: 5
|
The script was generated using HM NIS Editor wizard.
All I did was to add (for example) an exe file which goes to {InstallDir}\bin and a data file which goes to {InstallDir}\data. The installation works OK. But when I start the setup again (immediately after installation), it proposes {InstallDir}\bin as the installation directory. I can post the script tomorrow. Thanks |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Sep 2002
Posts: 5
|
Here's the script (generated with HM NIS's wizard).
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
|
Try in Section -Post change
code: on code: |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Sep 2002
Posts: 5
|
Thanks for your help, your solution works.
But since my application is already installed and I am now in the process of creating the setup for a newer version of the app I had to solve it differently. What I'm doing now is to check $INSTDIR in .onInit and if it ends with "\bin", I take its parent directory instead. In case anyone is interested, here's the code I used for that: code: The functions StrStr and GetParent can be found in the NSIS help file (Appendix C). |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
|
What are you want to do?
Now, by default, your installer place files in "c:\program files\My application\bin", where "c:\program files\My application\"=$INSTDIR -> this path selected by user. This location ($INSTDIR) store in regestry. However, if user select "c:\programm\myapp\bin" (this is value of $INSTDIR) path to install programm your files will be place in "c:\programm\myapp\bin\bin". So if your take parent dir location of files will be "c:\programm\myapp". |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|