Can't do a FileWrite to a text file
I am just trying to append a couple of string lines to a text file. No matter what variables and quotes I use, the file remains unchanged from the original that is extracted on the install. The debug output alway says the filewrites are happening, but the file does not change and has the same number of bytes as the original. What am I doing wrong here?
Here are the lines in question in from the install section
File "gui.relmod"
ClearErrors
FileOpen "$R0" "$INSTDIR\gui.relmod" "A"
DetailPrint 'FileOpen handle is $R0 for "$INSTDIR\gui.relmod"'
;FileSeek $R0 0 END
IfErrors next1
FileWrite "$R0" "DownloadFilename = ${PRODUCT_INSTALL_FILE}$\r$\n"
DetailPrint "DownloadFilename = ${PRODUCT_INSTALL_FILE}"
IfErrors next2
FileWrite "$R0" "DownloadFileMD5 = $STR_MD5$\r$\n"
DetailPrint "DownloadFileMD5 = $STR_MD5"
IfErrors next3
FileClose "$R0"
DetailPrint "Appends to gui.relmod completed. $R0"
goto next4
next1:
DetailPrint "Error on open gui.relmod $R0"
goto next4
next2:
DetailPrint "Error on FileWrite1 $R0"
goto next4
next3:
DetailPrint "Error on FileWrite2 $R0"
next4: