View Full Version : Create a File
25th April 2003, 15:12
Is it possible to create a file during installation?
Create in the $INSTDIR the dummy file "dummy.txt"
With the text "Hi, I'm a dummy" :D
25th April 2003, 15:13
Use FileOpen, FileWrite and FileClose to do this. Just open a file using FileOpen, write your string into it using FileWrite and close it using FileClose.
25th April 2003, 15:43
But the files isn't in the compiled source files.
I'm going to create a new one.
Does FileOpen creates new ones?
25th April 2003, 15:44
Yes, FileOpen creates the file if it isn't there already.
25th April 2003, 15:53
thanks dude ;)
25th April 2003, 16:54
Just saw the page you've created (http://nsis.sourceforge.net/archive/viewpage.php?pageid=222) on the archive using this code. There is an easier way as can be seen in makensis.nsi:
WriteINIStr "$SMPROGRAMS\NSIS\NSIS Development Site.url" "InternetShortcut" "URL" "http://nsis.sourceforge.net/"
25th April 2003, 17:26
I have a create batch function in my app.
It extracts the base file (compile.bat) which I have already crated here on my pc. That batch has keys in it like so:
I use a modified version of the replacetext function to replace these keys with the right executables (e.g. I replace <bsp_compile_area> with "$INSTDIR\quake2\compilers\qbsp3.exe $8.map" which is all set ready for an ms-dos environment.
I also use a slightly modified replacetext function which allows me to use it like so:
Push "[Text to replace]"
Push "[Replace text with this]"
26th April 2003, 14:11
Will do, KichiK ;) :up:
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.