Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   New to NSIS (http://forums.winamp.com/showthread.php?t=262193)

Spyder25000 21st December 2006 04:26

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
:confused:

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?

Red Wine 21st December 2006 08:09

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!

Spyder25000 21st December 2006 09:58

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

Red Wine 21st December 2006 10:04

plz read about File Instruction

Spyder25000 21st December 2006 10:05

i have been looking but havn't found it

Spyder25000 21st December 2006 10:07

cant you just tell me?

Red Wine 21st December 2006 10:21

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.

Spyder25000 21st December 2006 19:55

i dont get it

Red Wine 21st December 2006 20:28

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

Spyder25000 22nd December 2006 05:57

Thx now do i make the unistaller unistall them?

Spyder25000 27th December 2006 04:35

how do i make the unistaller delete the files

Red Wine 27th December 2006 04:49

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.

Spyder25000 27th December 2006 22:26

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

Red Wine 28th December 2006 03:09

There is a ready solution at wiki http://nsis.sourceforge.net/Uninstal...nstalled_files

Spyder25000 28th December 2006 04:47

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 28th December 2006 04:53

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?

Red Wine 28th December 2006 04:57

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


All times are GMT. The time now is 04:35.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.