Old 25th July 2017, 20:03   #1
tnteverett
Junior Member
 
Join Date: Jul 2017
Posts: 17
INSTALLOPTIONS_EXTRACT PluginsDir

Attempting to use InstallOptions with a custom menu.ini file. However when I put my INI file in a different directory and fully define the path, the compiler shows "$PLUGINSDIR\" in front of my fully qualified file name.
Is there any way to redefine $PLUGINSDIR or is there a way to make individual function calls ignore this variable?
This was not a problem until I attempted to use this command to reset the "state" value in the INI before using it again.
!insertmacro INSTALLOPTIONS_WRITE "{my path}\menu.ini" "field 3" "state" "{my value}"

From the compiler:
!insertmacro: INSTALLOPTIONS_EXTRACT
InitPluginsDir
File: "menu.ini"->"$PLUGINSDIR\{my path}\menu.ini"
Is there any way to make this work?
tnteverett is offline   Reply With Quote
Old 25th July 2017, 21:31   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 853
Just use a relative path. $pluginsdir is a temp directory specifically for files used during the install. You don't have to use the MUI installoptions macros, you can use the installoptions plugin directly as well. Although it's probably better to use nsDialogs which superseded installoptions.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 25th July 2017, 22:01   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,593
There is a "extract as" macro IIRC, otherwise you can manually extract like Jason suggested.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 26th July 2017, 12:04   #4
tnteverett
Junior Member
 
Join Date: Jul 2017
Posts: 17
Relative path is cumbersome when paths are so different. I will consider moving to nsDialogs.
Thanks
tnteverett is offline   Reply With Quote
Old 26th July 2017, 12:51   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,593
You don't have to use the EXTRACT macro, you can use File and extract wherever you want.

IntOp $PostCount $PostCount + 1
Anders 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