Archive: change installation directory at runtime ?


change installation directory at runtime ?
Hi !

I am new to NSIS. It's pretty powerful once you leave the path of script wizards. Amazing what can be done with it.

I am in the middle of building a complex installer and would like your help.

After reading the Wiki, examples and manual I was able to solve some problems but when it comes to scripting I just about getting stareted.

1.) I want to package a python app. During installation I would like to detect a python installation and copy some of my files there. So I have two output paths. $INSTDIR and $PYTHONDIR

After much fiddling around I managed to detect python (I hope)

Function GetPythonPath

ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" ""
StrCpy $PYTHON_PATH $R0

FunctionEnd

What does not seem to work is this :

Section !$(Sec1Name) SEC01
SetOverwrite try
SetOutPath "$PYTHON_PATH\Lib\site-packages\Gnumed"
File "gnumed\gnumed\client\__init__.py"
SetOutPath "$PYTHON_PATH\Lib\site-packages\Gnumed\business"
File "gnumed\gnumed\client\business\*.py"
File "gnumed\gnumed\client\business\README"

---------------------

I would like to know if it is possible to use the python path I dtected at runtime (oninit) and use it as outpath as outlined above.

I have attached the complete script in case anyone finds the time to look at it.

Thanks for your help,
Sebastian


Does $PYTHON_PATH have quotes around it when displayed in the MessageBox?

-Stu


obvious solution

Originally posted by Afrow UK
Does $PYTHON_PATH have quotes around it when displayed in the MessageBox?

-Stu
Hi !

Never mind my question. The code is correct. $PYTHON_PATH value wasn't assigned correctly (filename instead of directory) so NSIS silently failed to install the files.

I am starting to get somewhere. The examples are really helpful.

Sebastian