View Full Version : Newbie need help! :)
2nd June 2004, 20:57
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 :)
2nd June 2004, 21:23
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:
But has another command that affects where it will be put, called SetOutPath. Example:
(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:
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:
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...
2nd June 2004, 22:36
I wonder how I make this entries in the register with nsi
I just want one blah.exe file
3rd June 2004, 01:07
you can find your answer in the file : bigtest.nsi .
use this three function :
WriteRegStr WriteRegDword WriteRegBin
3rd June 2004, 05:12
Thanks for all your helps. :)
3rd June 2004, 06:54
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 :)
3rd June 2004, 07:07
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
3rd June 2004, 08:42
Last 2 Questions :D
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? :D
please give me one specific example :)
3rd June 2004, 09:12
1.:File /nonfatal /a /r "C:\My Program Folder\*.*"
this includes all Files, Folders and Subfolders with relative paths into the Installer
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\My Program"
;) keep on working it grows byte by byte
3rd June 2004, 09:32
Okay,thanks again for all your helps :D
I've just finished my installer :D:D:D
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.