Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 2nd June 2004, 20:57   #1
flyingshadow
Junior Member
 
Join Date: Mar 2004
Posts: 5
Smile Newbie need help! :)

First time using NSIS,I don't know how to creat an exactly nis file.

1. For example,I have some program files,and I want to make the installer(welcome,license,install page,add shortcuts to start menu and desktop,uninstall...)
Can you give me an example from any program?

2. I read the example: C:\Program Files\NSIS\Examples\Modern UI\Basic.nsi
It's good,but i don't understand the line:
;ADD YOUR OWN FILES HERE... <---?????

And uninstaller isn't added to Add or Remove Programs?

Sorry for my English.
I'm a Vietnamese newbie
flyingshadow is offline   Reply With Quote
Old 2nd June 2004, 21:23   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,353
Send a message via ICQ to deguix
Quote:
I'm a Vietnamese newbie
No problems! Have some in my school...

Now getting back to the question:

1) You can use the example WelcomeFinish.nsi which is complete (with Welcome and Finish pages).

2) And about how to add files you can use the command File. Example:

code:
File "FileNameInYourHardDrive.exe"


But has another command that affects where it will be put, called SetOutPath. Example:

code:
SetOutPath "$INSTDIR\Dir"


(Any file added after this command in a section or function is extracted to this folder when installing)

$INSTDIR is the folder chose by the user in the Directory page or set up by you (using InstallDir or InstallDirRegKey instructions or using StrCpy command).

With that information you can at least have some experience in how to use NSIS.

And now, showing another example of the two combined:

code:
SetOutPath "$INSTDIR"
File "Program.exe"
File "Readme.txt"

SetOutPath "$INSTDIR\Images"
File "MyImage.bmp"
File "MyImage.jpg"



NOTE: Don't forget to put quotes (") around the path name, because sometimes an user can install in a folder with a space separating one part of the path.

3) And a third thing, about the Add/Remove Programs:

There has a command to write registry strings called WriteRegStr, you can use it to write that information. An example:

code:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Product" "DisplayName" "Application Name"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Product" "UninstallString" "$INSTDIR"



Replace "Application Name" by the application name, and and "$INSTDIR" by the folder where you're installing your program (generally it is "$INSTDIR").

You can see more information on this subject at the NSIS documentation Apendix C: Useful Information.

Oh, and thanks to be in the NSIS community...

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 2nd June 2004, 22:36   #3
L1pp3r
Junior Member
 
Join Date: Jun 2004
Posts: 3
I wonder how I make this entries in the register with nsi
I just want one blah.exe file

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"wint"="C:\\temp\\wint.exe /start"

and

[HKEY_LOCAL_MACHINE\SYSTEM\RAdmin]

[HKEY_LOCAL_MACHINE\SYSTEM\RAdmin\v2.0]

[HKEY_LOCAL_MACHINE\SYSTEM\RAdmin\v2.0\Server]

[HKEY_LOCAL_MACHINE\SYSTEM\RAdmin\v2.0\Server\iplist]

[HKEY_LOCAL_MACHINE\SYSTEM\RAdmin\v2.0\Server\Parameters]
"NTAuthEnabled"=hex:00,00,00,00
"Parameter"=hex:1d,a6,d6,16,50,2e,ef,71,1d,9c,9a,15,63,81,06,c3
"Port"=hex:90,1f,00,00
"Timeout"=hex:0a,00,00,00
"EnableLogFile"=hex:00,00,00,00
"LogFilePath"="c:\\logfile.txt"
"FilterIp"=hex:00,00,00,00
"DisableTrayIcon"=hex:01,00,00,00
"AutoAllow"=hex:00,00,00,00
"AskUser"=hex:00,00,00,00
"EnableEventLog"=hex:00,00,00,00
"NTAuthId"=hex:01,00,00,00
L1pp3r is offline   Reply With Quote
Old 3rd June 2004, 01:07   #4
kenooze
Junior Member
 
Join Date: May 2004
Posts: 3
you can find your answer in the file : bigtest.nsi .
use this three function :
WriteRegStr WriteRegDword WriteRegBin
kenooze is offline   Reply With Quote
Old 3rd June 2004, 05:12   #5
flyingshadow
Junior Member
 
Join Date: Mar 2004
Posts: 5
Thanks for all your helps.
flyingshadow is offline   Reply With Quote
Old 3rd June 2004, 06:54   #6
flyingshadow
Junior Member
 
Join Date: Mar 2004
Posts: 5
But in example "welcomeFinish", I can find the command to add icon to startmenu and Desktop.

CreateShortCut link.lnk target.file [parameters [icon.file [icon_index_number [start_options [keyboard_shortcut [description]]]]]] <--- my foreign language is too bad ,please give me one specific example
flyingshadow is offline   Reply With Quote
Old 3rd June 2004, 07:07   #7
Davion
Senior Member
 
Join Date: Apr 2004
Location: Nuremberg, Germany
Posts: 130
Send a message via Yahoo to Davion
CreateDirectory "$SMPROGRAMS\My App"
ok, this will create a Folder in your Startmenue

CreateShortCut "$SMPROGRAMS\My App\Run My App.lnk" "$INSTDIR\MyApp.EXE" "Additional Parameters" "$INSTDIR\MyIco.ICO"

and this^^ will add the Shortcut into the Folder in the Startmenue, setting it to point on $INSTDIR\MyApp.EXE and the Icon would be $INSTDIR\MyIco.Ico (leaving this part will use the Icon of the EXE I think)

Additional Parameters is self explaining I think

CreateShortCut "$DESKTOP\App.lnk" "$INSTDIR\MyApp.EXE" "Additional Parameters" "$INSTDIR\MyIco.ICO"

^^Will do the same as in the Startmenue, but of course on the Desktop


hope this helps

Dave
Davion is offline   Reply With Quote
Old 3rd June 2004, 08:42   #8
flyingshadow
Junior Member
 
Join Date: Mar 2004
Posts: 5
Thanks!
Last 2 Questions

1. If I have one folder which contains all my program files.
What script/command to adds all file(s)and folder(s)from "my program folder" to be extracted to the $INSTDIR.

2. Example,I use this to add uninstaller into add/remove:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\My program" "DisplayName" "my program"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\My program" "UninstallString" '"$INSTDIR\uninstall.exe"'

What script/command to remove it from registry after uninstall?

please give me one specific example
flyingshadow is offline   Reply With Quote
Old 3rd June 2004, 09:12   #9
Davion
Senior Member
 
Join Date: Apr 2004
Location: Nuremberg, Germany
Posts: 130
Send a message via Yahoo to Davion
1.:File /nonfatal /a /r "C:\My Program Folder\*.*"
this includes all Files, Folders and Subfolders with relative paths into the Installer

2.:
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\My Program"

keep on working it grows byte by byte
Davion is offline   Reply With Quote
Old 3rd June 2004, 09:32   #10
flyingshadow
Junior Member
 
Join Date: Mar 2004
Posts: 5
Okay,thanks again for all your helps
I've just finished my installer
flyingshadow 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