Old 17th April 2006, 22:12   #1
release_dude
Junior Member
 
Join Date: Apr 2006
Posts: 2
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
Attached Files
File Type: nsi gnumed_from_cvs_v2.nsi (33.2 KB, 119 views)
release_dude is offline   Reply With Quote
Old 18th April 2006, 08:34   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Does $PYTHON_PATH have quotes around it when displayed in the MessageBox?

-Stu
Afrow UK is offline   Reply With Quote
Old 18th April 2006, 14:43   #3
release_dude
Junior Member
 
Join Date: Apr 2006
Posts: 2
obvious solution

Quote:
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
release_dude is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump