Archive: Create and write to a file?


Create and write to a file?
I'm trying to write some data gained from a checkbox on my finish screen to a file. However the file doesn't exist, it needs to be created.

Function write_settings_data
SetOutPath "$INSTDIR"
ReadINIStr $1 "$PLUGINSDIR\iospecial.ini" "Field 6" "State"
MessageBox MB_OK $1
FileOpen $0 $INSTALL_DIR\abc.txt w
FileWrite $0 'DBUSERID="$1"$\r$\n'
FileClose $0
FunctionEnd


Heres the error, I think its saying the first doesn't exist.

1 warning:
unknown variable/constant "INSTALL_DIR\abc.txt" detected, ignoring

Should I be using FileOpen when the file doesn't exist?

What should I be using instead?

Whats the problem here?

Thanks in advance.

I think you want to use $INSTDIR, not $INSTALL_DIR...

If the compiler says it doesn't recognize a variable, it usually means you're not calling the correct variable.