Old 21st December 2006, 04:26   #1
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
New to NSIS

I am brand new just discovered NSIS

i want to make a installer (MUI)
I know how to do some things but...

I have no clue how to add files and put them in the install dir ($INSTDIR)when it installs


i have already made the MUI I JUST NEED TO ADD THE FILES

thx

also when i am here
I have made a mod for Cnc Generals Zero hour
How do i make the installer installed into Directers that are there already (e.g.)

When they select the Dir which will be
C:\Program Files\EA Games\Command & Conquer Generals Zero Hour

i want some files instaled to
C:\Program Files\EA Games\Command & Conquer Generals Zero Hour\Data\INI

How do i do this?
Spyder25000 is offline   Reply With Quote
Old 21st December 2006, 08:09   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Take a walk at wiki, pick up a development environment that suits your needs, also discover there useful stuff like full working code examples for instance, and script generators among others, and you're ready to go!

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 21st December 2006, 09:58   #3
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
thx, i know how to add files but...
how do i add a folder with the stuff in it?
e.g.
\My Documents\Zero Hour\CnC Zero HOur data\Data\INI

The files in the folder INI
Spyder25000 is offline   Reply With Quote
Old 21st December 2006, 10:04   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
plz read about File Instruction

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 21st December 2006, 10:05   #5
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
i have been looking but havn't found it
Spyder25000 is offline   Reply With Quote
Old 21st December 2006, 10:07   #6
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
cant you just tell me?
Spyder25000 is offline   Reply With Quote
Old 21st December 2006, 10:21   #7
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
This wiki article might help you.
As for the File Instruction:
4.9.1.5 File

[/nonfatal] [/a] ([/r] [/x file|wildcard [...]] (file|wildcard) [...] | /oname=file.dat infile.dat)

Adds file(s) to be extracted to the current output path ($OUTDIR).

* Note that the output file name is $OUTDIR\filename_portion_of_file.
* If the /oname=X switch is used, the output name becomes $OUTDIR\X. When using the /oname= switch, only one file can be specified, and the file name can contain variables (or a fully qualified path, e.g. $SYSDIR\whatever.dll). If the output name contains spaces, quote the entire parameter, including /oname, as shown in the examples below.
* Wildcards are supported.
* If the /r switch is used, matching files and directories are recursively searched for in subdirectories. If just one path segment is specified (e.g. File /r something), the current directory will be recursively searched. If more than one segment is specified (e.g. File /r something\*.*), the last path segment will be used as the matching condition and the rest for the directory to search recursively. If a directory name matches, all of its contents is added recursively. Directory structure is preserved.
* Use the /x switch to exclude files or directories.
* If the /a switch is used, the attributes of the file(s) added will be preserved.
* The File command sets the error flag if overwrite mode is set to 'try' and the file could not be overwritten, or if the overwrite mode is set to 'on' and the file could not be overwritten and the user selects ignore.
* If the /nonfatal switch is used and no files are found, a warning will be issued instead of an error.

File something.exe
File /a something.exe
File *.exe
File /r *.dat
File /r data
File /oname=$TEMP\temp.dat somefile.ext
File "/oname=$TEMP\name with spaces.dat" somefile.ext
File /nonfatal "a file that might not exist"
File /r /x CVS myproject\*.*
File /r /x *.res /x *.obj /x *.pch source\*.*

Note: when using the /r switch, both matching directories and files will be searched. This is always done with or without the use of wildcards, even if the given path perfectly matches one directory. That means, the following directory structure:

<DIR> something
file.dat
another.dat
<DIR> dir
something
<DIR> dir2
file2.dat
<DIR> another
<DIR> something
readme.txt

with the following File usage:

File /r something

will match the directory named something on the root directory, the file named something in the directory named dir and the directory named something in the directory named another. To match only the directory named something on the root directory, use the following:

File /r something\*.*

When adding \*.*, it will be used as the matching condition and something will be used as the directory to search. When only something is specified, the current directory will be recursively searched for every and directory named something and another\something will be matched.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 21st December 2006, 19:55   #8
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
i dont get it
Spyder25000 is offline   Reply With Quote
Old 21st December 2006, 20:28   #9
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
File /r 'D:\My Documents\Zero Hour\CnC Zero HOur data\Data\INI\*'
to add all the files and subdirs under INI

or

File /r 'D:\My Documents\Zero Hour\CnC Zero HOur data\Data\INI'
to add INI as parent and all the files and subdirs under INI

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 22nd December 2006, 05:57   #10
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
Thx now do i make the unistaller unistall them?
Spyder25000 is offline   Reply With Quote
Old 27th December 2006, 04:35   #11
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
how do i make the unistaller delete the files
Spyder25000 is offline   Reply With Quote
Old 27th December 2006, 04:49   #12
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
You could do it either by Rmdir /r $INSTDIR (risky!), or by creating an install.log that unistaller would read. Search the forum with install log keywords, to find out how you would achieve this method.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 27th December 2006, 22:26   #13
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
i would like the 2nd option,
the first option sounds like i wont have a c:/ drive left

How do i make the install log thing

Thx
Spyder25000 is offline   Reply With Quote
Old 28th December 2006, 03:09   #14
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
There is a ready solution at wiki http://nsis.sourceforge.net/Uninstal...nstalled_files

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 28th December 2006, 04:47   #15
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
I am sorry, but how do i do it on a MUI (Modern UI)

In fact how do i do it, it contains no instructions, i can see
Spyder25000 is offline   Reply With Quote
Old 28th December 2006, 04:53   #16
Spyder25000
Junior Member
 
Join Date: Dec 2006
Posts: 11
I got an idea how about you make me a MUI installer
(dont compile it PLZ!!!)
(dont compiler it PLZ!!!)
(dont compiler it PLZ!!!)

It needs to have the INstaller insatller a:
.txt to the install dir
.jpg to the insatll dir

and the unistaller delete them

I will just look at the coding

Is that okay?
Spyder25000 is offline   Reply With Quote
Old 28th December 2006, 04:57   #17
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
The function is suitable for both MUI and classic UI.
There are full instructions on this forum thread:
http://forums.winamp.com/showthread....hreadid=199750

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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