Winamp & SHOUTcast Forums NSIS and & symbol in File "/oname=..."
 User Name Remember Me? Password

 Thread Tools Search this Thread Display Modes
 23rd October 2017, 14:52 #1 sfx09 Junior Member   Join Date: Jul 2017 Posts: 27 NSIS and & symbol in File "/oname=..." Hello! Sorry for my English. I need add some files, which named as "\$profile.bat", "&settings.ini", etc. They all include in filename a character \$. I try double-\$: PHP Code: File "/oname=\$\$profile.bat" "C:\!NEW_INSTALLER\!!cache\\$\$profile.bat"  But it don't works (compiler error). Please, help me with solution. Thanks.
 23rd October 2017, 16:33 #2 sfx09 Junior Member   Join Date: Jul 2017 Posts: 27 I try this: PHP Code: IntFmt \$0 "%c" 0x24 File "/oname=\$0UPDATE.INI" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\\$0UPDATE.INI"  But it also don't work.
 23rd October 2017, 16:42 #3 Anders Moderator     Join Date: Jun 2002 Location: \${NSISDIR} Posts: 4,926 The /oname parameter needs \$ as \$\$ but the source file path does not, just use \$. IntOp \$PostCount \$PostCount + 1
23rd October 2017, 17:15   #4
sfx09
Junior Member

Join Date: Jul 2017
Posts: 27

Quote:
 Originally Posted by Anders The /oname parameter needs \$ as \$\$ but the source file path does not, just use \$.
Thank you!! Now try this.

PHP Code:
File "/oname=\$\$UPDATE.INI" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\\$UPDATE.INI"

 23rd October 2017, 17:24 #5 sfx09 Junior Member   Join Date: Jul 2017 Posts: 27 All works fine!!! Thank you, very much!
 23rd October 2017, 21:18 #6 Anders Moderator     Join Date: Jun 2002 Location: \${NSISDIR} Posts: 4,926 Remember to use the full path with /oname. IntOp \$PostCount \$PostCount + 1
24th October 2017, 15:49   #7
sfx09
Junior Member

Join Date: Jul 2017
Posts: 27
Quote:
 Originally Posted by Anders Remember to use the full path with /oname.
what's mean?
for example, i need to use something like that:

PHP Code:
File "/oname=\$INSTDIR\\$\$UPDATE.INI" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\\$UPDATE.INI"
?

P.S. I found a new problem. Why not worked this? File contain two ore more dots in filename? Thanks for answer.

PHP Code:
File "/oname=data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf"

 24th October 2017, 17:26 #8 Anders Moderator     Join Date: Jun 2002 Location: \${NSISDIR} Posts: 4,926 "/oname=data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf" is not a full path, it should start with \$instdir or something like that. IntOp \$PostCount \$PostCount + 1
24th October 2017, 17:38   #9
sfx09
Junior Member

Join Date: Jul 2017
Posts: 27
Quote:
 Originally Posted by Anders "/oname=data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf" is not a full path, it should start with \$instdir or something like that.
Unfortunately this:

PHP Code:
File "/oname=\$INSTDIR\data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf"
leads to syntax error too.

And what's mean this:

PHP Code:
Use /oname=switch to change the output nameX may contain variables and can be a fully qualified path or a relative path in which case it will be appended to \$OUTDIR set by SetOutPathWhen using this switch, only one file can be specified. If the output name contains spacesquote the entire parameterincluding /oname, as shown in the examples below
from here:

http://nsis.sourceforge.net/Reference/File

It's old article? Full path absolutely need?