Old 30th July 2003, 18:10   #1
suzanneh
Junior Member
 
Join Date: Jul 2003
Posts: 4
Custom Icon

Does anyone know if a custom icon can be set anywhere in NSIS? My program, Firebird, has a bug and an icon cannot be set on the .exe, even by using programs such as resHack so I'm hoping I can tell it to use a custom icon.

Thanks for your help.
suzanneh is offline   Reply With Quote
Old 30th July 2003, 18:47   #2
SGI
Junior Member
 
Join Date: Jul 2003
Location: USA
Posts: 34
!define MUI_ICON "${NSISDIR}\Contrib\Icons\Youriconname.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Icons\YourIconname.ico"

Copy your Icons in the folder
SGI is offline   Reply With Quote
Old 30th July 2003, 19:52   #3
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
the previous example applies to installers with modern interface. if you use the standard interface use

Icon [path\]icon.ico
UninstallIcon [path\]icon.ico

you can find this in the documentation
Yathosho is offline   Reply With Quote
Old 30th July 2003, 22:20   #4
suzanneh
Junior Member
 
Join Date: Jul 2003
Posts: 4
Thanks for your reply but I want to set the icon for the program itself. ie: MozillaFirebird.exe. When compiling this program, it won't create the program icon and I was hoping I would be able to set it with the installer.
suzanneh is offline   Reply With Quote
Old 30th July 2003, 23:12   #5
suzanneh
Junior Member
 
Join Date: Jul 2003
Posts: 4
In reading over my post, I did not make it clear. Here is a portion of my script:

; Subsection about shortcuts (desktop, startmenu, quicklaunch)
;

SubSection /e "${NAME_SecAddShortcuts}" SecAddShortcuts

Section "${NAME_SecAddDesktopShortcut}" SecAddDesktopShortcut
CreateShortCut "$DESKTOP\${DESC_DesktopShortcut}.lnk" \
"$INSTDIR\${EXE}" "" "$INSTDIR\${EXE}" 0
SectionEnd

Section "${NAME_SecAddStartShortcuts}" SecAddStartShortcuts
CreateDirectory "$SMPROGRAMS\${DESC_StartDir}"
CreateShortCut "$SMPROGRAMS\${DESC_StartDir}\${DESC_StartUninst}.lnk" \
"$INSTDIR\${UNINSTALLER}" "" "$INSTDIR\${UNINSTALLER}" 0
CreateShortCut "$SMPROGRAMS\${DESC_StartDir}\${DESC_StartProg}.lnk" \
"$INSTDIR\${EXE}" "" "$INSTDIR\${EXE}" 0
SectionEnd

Section "${NAME_SecAddQuicklaunchShortcut}" SecAddQuicklaunchShortcut
CreateShortCut "$QUICKLAUNCH\${DESC_Quicklaunch}.lnk" \
"$INSTDIR\${EXE}" "" "$INSTDIR\${EXE}" 0
SectionEnd

SubSectionEnd

I need to tell the installer to use my icon located here: [D:\!Browsers\InTouch\intouch\32i.ico]
suzanneh is offline   Reply With Quote
Old 30th July 2003, 23:16   #6
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
ok... sinxe your icon for the shorcut isn't the same of the installer or the uninstaller...
Try this:
code:

CreateShortCut "short.lnk" "$INSTDIR\${exe}.exe" "" \
"$INSTDIR\theico.ico" 0 "SW_SHOWNORMAL" "" "Hi. I'm a shortcut"



Where "$INSTDIR\theico.ico" is the installed path of the icon...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 31st July 2003, 00:38   #7
suzanneh
Junior Member
 
Join Date: Jul 2003
Posts: 4
Please forgive me as I am a noobie. I tried entering the lines you suggested and I get an error. Do I replace

CreateShortCut "$DESKTOP\${DESC_DesktopShortcut}.lnk" \
"$INSTDIR\${EXE}" "" "$INSTDIR\${EXE}" 0

with

CreateShortCut "short.lnk" "$INSTDIR\${exe}.exe" "" \
"$INSTDIR\D:\!Browsers\InTouch\intouch\32i.ico" 0 "SW_SHOWNORMAL" "" "Intouch"

If so, I receive the following error:

CreateShortCut: "short.lnk"->"$INSTDIR\InTouch.exe.exe" icon:$INSTDIR\D:\!Browsers\InTouch\intouch\32i.ico,0, showmode=0x1, hotkey=0x0, comment=Intouch
Error: Can't add entry, no section or function is open!
Error in script "D:\!Browsers\InTouch\InTouchinstaller\installer.nsi" on line 216 -- aborting creation process
suzanneh is offline   Reply With Quote
Old 31st July 2003, 10:09   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You must place the code in a Function or section.

Example
code:
Section "Install my program"
File "/oname=$INSTDIR\${exe}.exe" "${exe}.exe"
CreateShortCut "short.lnk" "$INSTDIR\${exe}.exe" "" \
"$INSTDIR\D:\!Browsers\InTouch\intouch\32i.ico" 0 "SW_SHOWNORMAL" "" "Intouch"
SectionEnd



-Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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