Archive: Error


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.


Perhaps try another register other than $0. I know there were previously problems use ReadRegStr with $0

-Scott


thanks for the tip, but the error remains


Works fine here. Please use the latest CVS version.


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.

There are two other bugs in your script. Does the attached script work?


thanks, that worked. what not worked, i replaced the messagebox with the createdirectory command. got a clue why that is?


anyone an idea?


I don't understand what you mean. Please give a better description.


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.