Skip to content
⌘ NSIS Forum Archive

NSIS and & symbol in File "/oname=..."

10 posts

sfx09#

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-$:

File "/oname=$$profile.bat" "C:\!NEW_INSTALLER\!!cache\$$profile.bat" 
But it don't works (compiler error). Please, help me with solution. Thanks.
sfx09#
I try this:
IntFmt $0 "%c" 0x24
File "/oname=$0UPDATE.INI" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\$0UPDATE.INI" 
But it also don't work.
sfx09#
Originally Posted by Anders View Post
The /oname parameter needs $ as $$ but the source file path does not, just use $.
Thank you!! Now try this.

File "/oname=$$UPDATE.INI" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\$UPDATE.INI" 
sfx09#
Originally Posted by Anders View Post
Remember to use the full path with /oname.
what's mean?
for example, i need to use something like that:

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.

File "/oname=data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf" 
Anders#
"/oname=data\ed\5_10_0\ACTCOMMONFORM.XSD.Dcf" is not a full path, it should start with $instdir or something like that.
sfx09#
Originally Posted by Anders View Post
"/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:

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:

Use /oname=X switch to change the output name. X 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 SetOutPath. When using this switch, only one file can be specified. If the output name contains spaces, quote the entire parameter, including /oname, as shown in the examples below. 
from here:



It's old article? Full path absolutely need?

Big thanks for your fast answers! 👍