Skip to content
⌘ NSIS Forum Archive

Error

10 posts

Yathosho#

Error

i got a very simple script, using no strings until the first section, the first command there is:

FileOpen $0 "file.txt" r

when i compile the the installer, i get the following error message

Invalid command: FileOpen $0 "file.txt"
Error in script "test.nsi" on line 21 -- aborting creation process


i have no clue why that is. there's no other string used in the script until that position.
sdbarker#
Perhaps try another register other than $0. I know there were previously problems use ReadRegStr with $0

-Scott
Yathosho#
i constantly updated my nsis, but i always had this error (actually i posted this some months ago).

Name "test"
OutFile test.exe
CRCCheck on
XPStyle on
#InstallDir "$PROGRAMFILES\test"
DirText "Select a target directory."
DirShow show
SetCompress force
InstType Standard
Section "Required Components"
FileOpen $R1 "file.txt" r
loop:
FileRead $R1 $R2
IfErrors done
MessageBox MB_OK $R2
Goto loop
done:
Exit
Section End 
the odd thing is, that it claims "FileOpen" to be an invalid command

Invalid command: FileOpen $R1 "file.txt"
Error in script "C:\_dirdupe\test.nsi" on line 14 -- aborting creation process


kichik helped me with this script a while ago. he also could compile it. i'm running win xp, if that helps.
Joost Verburg#
There are two other bugs in your script. Does the attached script work?
Yathosho#
thanks, that worked. what not worked, i replaced the messagebox with the createdirectory command. got a clue why that is?
Yathosho#
you see the pasted script of mine above. when i replace 'MessageBox' with 'CreateDirectory', the compiled exe does not create the directories or creates a maximum of one (that depends on the given text file). the purpose of the program is to create empty directories, names gotten from a text file. i only used messagebox before, to see if it generally works properly, which it does unless i replace it with createdirectories.