- NSIS Discussion
- Newbie need help! :)
Archive: Newbie need help! :)
flyingshadow
2nd June 2004 21:57 UTC
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 :)
deguix
2nd June 2004 22:23 UTC
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:
File "FileNameInYourHardDrive.exe"
But has another command that affects where it will be put, called
SetOutPath. Example:
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:
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:
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...
L1pp3r
2nd June 2004 23:36 UTC
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
kenooze
3rd June 2004 02:07 UTC
you can find your answer in the file : bigtest.nsi .
use this three function :
WriteRegStr WriteRegDword WriteRegBin
flyingshadow
3rd June 2004 06:12 UTC
Thanks for all your helps. :)
flyingshadow
3rd June 2004 07:54 UTC
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 :)
Davion
3rd June 2004 08:07 UTC
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
flyingshadow
3rd June 2004 09:42 UTC
Thanks!
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 :)
Davion
3rd June 2004 10:12 UTC
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
flyingshadow
3rd June 2004 10:32 UTC
Okay,thanks again for all your helps :D
I've just finished my installer :D:D:D