Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 25th April 2003, 15:12   #1
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,898
Create a File

Is it possible to create a file during installation?

For example:

Create in the $INSTDIR the dummy file "dummy.txt"
With the text "Hi, I'm a dummy"

Thanks


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4.
Joel is offline   Reply With Quote
Old 25th April 2003, 15:13   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 25th April 2003, 15:43   #3
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,898
OK.
But the files isn't in the compiled source files.
I'm going to create a new one.
Does FileOpen creates new ones?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4.
Joel is offline   Reply With Quote
Old 25th April 2003, 15:44   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
Yes, FileOpen creates the file if it isn't there already.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 25th April 2003, 15:53   #5
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,898
thanks dude


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4.
Joel is offline   Reply With Quote
Old 25th April 2003, 16:54   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
Just saw the page you've created 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/"

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 25th April 2003, 17:26   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
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:

<bsp_area>
<bsp_compile_area>
<vis_compile_area>
<rad_compile_area>
<copy_files_area>

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]"
Call replacetext

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 26th April 2003, 14:11   #8
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,898
Will do, KichiK


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4.
Joel is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump