Skip to content
⌘ NSIS Forum Archive

FileWrite

7 posts

Bugge T. Jensen#

FileWrite

Hi

I want to write a bat file on my installation and have tried this


FileOpen $9 "${SOURCE}\\bin\\ssShutDown.bat" w
IfErrors 0 NoError
  MessageBox MB_OK "File open error"
  Goto ErrorYay
NoError:
  MessageBox MB_OK "FileOpen"
ErrorYay:
DetailPrint $9
FileWrite $9 "C:\\SimFlex-stability\\bin\\KillApps.exe c:\\SimFlex-stability\\bin\\dssShutdown.txt"
FileWrite $9 "C:\\Program Files\\CNS International\\The InterCom System\\Server\\ICSvrNT.exe /stop"
FileWrite $9 "C:\\SimFlex-stability\\bin\\KillApps.exe c:\\SimFlex-stability\\bin\\dssShutdown.txt"
FileWrite $9 "C:\\Program Files\\CNS International\\The InterCom System\\Server\\ICSvrNT.exe /start"
FileClose $9 
But i Allways run in to the File open error.
By the way a actualy wants to write quotes (") in the string How can i do that.

Any suggestions
Bugge T. Jensen#
Sorry after posting the question i found the problem is the destination was wrong i should use $INSTDIR further i guess my Iferrors i wrong. Sorry to disturb you...

But the question about quoutes is still walid ?
Joost Verburg#
'bla "quote" bla'

Or, if you are using the latest NSIS 2 version:

"bla $\"quote$\" bla"
Bugge T. Jensen#
I use 2.0b0 and had succes with first solution the second failed, anyway thanks i am back on track
Thanks
Bugge T. Jensen#
Aha! I forget the $ so probably no problem at all.
Did not try as my current solution do the job