Archive: newbi nsis questions


newbi nsis questions
ok here we go:

1. Is there a way to be able to give the icon for the setup file created a higher colour count, eg 256 or 16M?

2. Is there a way to just get the installer to read all the files in the one folder instead of typing in every file?

3. Is there a way to have only one .exe file that is like a shortcut to dragging the mysetupscript.nsi file into "makeNSIS"?

4. Are there any cool little tips i can add to my script to spruce it up a bit, (like the splash screen)?


5. How do i get it to install a link in my start menu with the string of: C:\SIERRA\Half-Life\hl.exe -console -game cstrike
?


This should work.


Section "Counter Strike Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Counter Strike"
CreateShortCut "$SMPROGRAMS\Counter Strike\CounterStrike.lnk" "C:\SIERRA\Half-Life\hl.exe -console -game cstrike"
SectionEnd



- Jarsonic

Splash Screen Stuff:


; ==============Command line instructions:============================
Function .onInit ; Makes splashscreen: adds ~130k, though.
SetOutPath $TEMP
File /oname=spltmp.dat "C:\program files\nsis\jarsonic_splash.bmp"
File /oname=spltmp.exe "C:\program files\nsis\splash.exe"
ExecWait '"$TEMP\spltmp.exe" 1000 $HWNDPARENT spltmp.dat'
Delete $TEMP\spltmp.exe
Delete $TEMP\spltmp.dat
FunctionEnd
; ============End command line instructions.==========================


Also, read "splash.txt" in your NSIS directory.

- Jarsonic

Sorry, I'm reading the questions from the bottom up. ;^)

As far as color count in icons, I beleive you can have high color icons... I leeched the pimp hat icon from PiMP using Microangelo, and I use it as the icon when I'm using NSIS to make plugin / AVS preset packages. It's in 256 color, I believe. As long as you make an icon in 256 colors, etc. (w/ Microangelo or some other program), I'm pretty sure you can use it in NSIS.

--peace--

- Jarsonic

P.S. - for the question about including all files in a directory: use wildcards (*.html, etc.).

ex:

File "C:\program files\winamp\plugins\avs\Jarsonic\*.avs"


P.P.S. - As far as compiling using Makensis, you can right click the .nsi file, click "compile," and it will compile the .nsi script automatically.

Originally posted by jarsonic

As far as color count in icons, I beleive you can have high color icons... I leeched the pimp hat icon from PiMP using Microangelo, and I use it as the icon when I'm using NSIS to make plugin / AVS preset packages. It's in 256 color, I believe. As long as you make an icon in 256 colors, etc. (w/ Microangelo or some other program), I'm pretty sure you can use it in NSIS.
* using microangelo 5.02 and nsis 1.44 i get error when compiling script:
no 32x32x16 icon -- failing!

did this happen to you? i think that hat icon is only 16 colours though, check it.



* also how do i execute two files (to open together) at the end of the installer?



* and the command line for the start menu shortcut was:
"C:\SIERRA\Half-Life\hl.exe" -console -game cstrike
not
"C:\SIERRA\Half-Life\hl.exe -console -game cstrike"

note the quotation marks.

Sorry about the icon stuff... not sure about that. Might want to shoot Justin off an e-mail. As far as the Counter Strike thing.... did you try:


"'C:\SIERRA\Half-Life\hl.exe' -console -game cstrike"

?

and for the execute 2 files @ end of the installer:

Function .onInstSuccess
MessageBox MB_YESNO|MB_ICONQUESTION \
"Setup has completed. View first file?" \
IDNO NoFile
ExecShell open "$INSTDIR\first_file.exe"
NoFile
FunctionEnd

Function .onInstSuccess
ExecShell open '$INSTDIR\second_file.exe"
FunctionEnd


Did you try that? If that doesn't work, try to include both of them in one .onInstSucess function.


Sorry if that wasn't completely clear. I'm slightly inebriated right now. :D

- Jarsonic

got the shortcut thing, it goes like this:
CreateShortCut "$SMPROGRAMS\Sierra\CounterStrike.lnk" "C:\SIERRA\Half-Life\hl.exe" "-console -game cstrike" "C:\Program Files\Custom Counter-Strike Installer\cstrike.ico"

3rd""'s are paramaters
4th""'s is icon file


but with the exec 2 files i meant within each other, what i want to do is have the installer compile another nsi file at the end.


You can only have 32x32x16 icons - it's the way NSIS was designed and it's coded directly somewhere - you can't change it.

The compile NSIS thing:

If you Exec the MAKENSIS program, with the name of you script as a parameter, it will compile. eg MAKENSIS MyScript.NSI


another question
why do i get "installation faild" (msg) both times in this function no matter what file is newer?

Function .onInit
CompareFileTimes "C:\Program Files\Custom Counter-Strike\Custom CS Installer.exe" "C:\Program Files\Custom Counter-Strike\source\Custom CS Installer.exe" "bad" "goodi"
bad:
MessageBox MB_OK|MB_ICONSTOP "Installation failed"
Abort
goodi:
FunctionEnd