Old 23rd October 2017, 14:52   #1
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 20
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.
sfx09 is offline   Reply With Quote
Old 23rd October 2017, 16:33   #2
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 20
I try this:
PHP Code:
IntFmt $"%c" 0x24
File 
"/oname=$0UPDATE.INI" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\$0UPDATE.INI" 
But it also don't work.
sfx09 is offline   Reply With Quote
Old 23rd October 2017, 16:42   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,636
The /oname parameter needs $ as $$ but the source file path does not, just use $.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 23rd October 2017, 17:15   #4
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 20
Unhappy

Quote:
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.

PHP Code:
File "/oname=$$UPDATE.INI" "C:\!NEW_INSTALLER\!DEVELOP\!!cache1\$UPDATE.INI" 
sfx09 is offline   Reply With Quote
Old 23rd October 2017, 17:24   #5
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 20
All works fine!!! Thank you, very much!
sfx09 is offline   Reply With Quote
Old 23rd October 2017, 21:18   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,636
Remember to use the full path with /oname.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th October 2017, 15:49   #7
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 20
Quote:
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:

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" 
sfx09 is offline   Reply With Quote
Old 24th October 2017, 17:26   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,636
"/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
Anders is offline   Reply With Quote
Old 24th October 2017, 17:38   #9
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 20
Quote:
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:

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?

Big thanks for your fast answers!
sfx09 is offline   Reply With Quote
Old 24th October 2017, 22:07   #10
sfx09
Junior Member
 
Join Date: Jul 2017
Posts: 20
Thanks for all! All worked, it's my error - file in ..\!!cache1\data\ed\5_10_0\ was deleted.
sfx09 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