Archive: Fileopen Big problems


Fileopen Big problems
I'm writing an installer who creates a text file. The problem is that it it aint being created. It does run throw the installer but does not create the file dice100.path

This is the codein the mainpart:

Section -MainProgram
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\Commands.lng"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\Dice100Client.exe"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\mscomctl.ocx"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\MSWINSCK.OCX"
SetOutPath "$INSTDIR\Resources"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\Resources\Dice100.ico"
SetOutPath "$INSTDIR\Language"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\Language\eng_programtext.sdf"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\Language\eng_skills.sdf"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\Language\nor_programtext.sdf"
File "E:\Project Dice100\Dice100client + installer\Dice100Client\Language\nor_skills.sdf"
; We make our Dice100.path file
DELETE "$APPDATA\Dice100.path"
ClearErrors

FileOpen $0 "$APPDATA\Dice100.path" w
iferrors 0 Outdata
MessageBox MB_OK "Error creating Dice100.path"
goto done
OutData:
FileWrite $0 "version=1$\r$\nclientpath=$INSTDIR$\r$\n"
Done:
FileClose $0
SectionEnd

Anyone has any idea?


The file open/write part of the script works as expected.
Could be a problem with $APPDATA and/or all users access, did you try to verify that $APPDATA is initialized correctly with a messagebox for instance, and/or create the file for current user - create the file at another location e.g. $INSTDIR?


I made the installer with "NSIS Quick Setup Script Generator" then just added those lines afterwards. Since it did not work, and I really can't make out head and tail of it, I just threw it away, and copied those few lines with "file" in to and older installer file that worked. I think it might have something to do with single/multiple users stuff, even if it was installing on a account with admin rights.

Thanks for the hints btw.