Old 18th January 2009, 04:29   #1
RigorMortis
Junior Member
 
Join Date: Jan 2009
Posts: 3
User editable install directory - help!

From the subject you would assume I'm an idiot - but let's assume I'm not for a minute.

This installer is for a map pack which must be placed in a very specific directory to function. I found some code to extract the correct directory from the registry/filesystem, but it only functions inside of "section" and thus I cannot use "Page directory" to let people edit the directory if it happens to be wrong.

My question is: Is there a way to allow a user to modify a variable created inside of "Section," and if so, how can I do this?

Any help would be appreciated.
RigorMortis is offline   Reply With Quote
Old 18th January 2009, 05:01   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
read from the registry in .oninit and put the result in $instdir

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th January 2009, 07:27   #3
RigorMortis
Junior Member
 
Join Date: Jan 2009
Posts: 3
I tried that, but unfortunately the install directory doesn't auto-populate with the supposed-correct directory... which is bad.

I'm unfortunately very new to NSIS and will probably be fighting with this until I give up and just don't use an installer... lol. This thing has been driving me nuts for weeks.
RigorMortis is offline   Reply With Quote
Old 18th January 2009, 07:36   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Quote:
Originally posted by RigorMortis
I tried that, but unfortunately the install directory doesn't auto-populate with the supposed-correct directory...
...What does that mean, exactly? If you StrCpy $INSTDIR in .onInit, the directory page will enter that value into the path field as the default. Unless you change the contents of $INSTDIR again at a later time.
MSG is offline   Reply With Quote
Old 19th January 2009, 00:25   #5
RigorMortis
Junior Member
 
Join Date: Jan 2009
Posts: 3
Perhaps looking at the script you can see what I've done wrong?
Attached Files
File Type: nsi map_installer.nsi (3.9 KB, 219 views)
RigorMortis is offline   Reply With Quote
Old 19th January 2009, 00:29   #6
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
looks like you've got the code to copy the dynamic Steam Account-generated folder to $INSTDIR in your section? you should put that StrCpy in .onInit after calling - and verifying the output from - Call GetSteamAccountName. ( actually, after the "gogogo:" label - no point in doing any code that may not actually get used.
Animaether 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