Old 21st March 2005, 09:58   #1
beule
Guest
 
Posts: n/a
Heacer Image not displayed, Startmenu entires not removed

I have the following script. The problem is the header image is not displayed and the startmenu entries are not removed after unistallation.
code:

; BT4Dsign Demo installer
;
; This script is based on example2.nsi

;--------------------------------
;Include Modern UI

!include "MUI.nsh"

; The name of the installer
Name "BT4Dsign Demo"

; The file to write
OutFile "InstallBT4DsignDemo.exe"

; The default installation directory
InstallDir $PROGRAMFILES\BT4Dsign_Demo

; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\BT4DsignDemo" "Install_Dir"

;--------------------------------
!define MUI_ICON "BTIcon.ico"
!define MUI_UNICON "BTIcon.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "Image_Installer.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "Image_Installer.bmp"
!define MUI_ABORTWARNING

!insertmacro MUI_PAGE_LICENSE "DemoLicense.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES


; The stuff to install
Section "BT4Dsign Demo" demo

SectionIn RO

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
File /r "bin"
File /r "lib"
File /r "jre"
File /r "profiledb"
File "BTIcon.ico"
File "Image_Installer.bmp"

; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\BT4DsignDemo "Install_Dir" "$INSTDIR"

; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BT4DsignDemo" "DisplayName" "BT4Dsign Demo"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BT4DsignDemo" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BT4DsignDemo" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BT4DsignDemo" "NoRepair" 1
WriteUninstaller "uninstall.exe"

WriteRegStr HKCR ".btp" "" "BT.Project"
WriteRegStr HKCR "BT.Project" "" "BT Project File"
WriteRegStr HKCR "BT.Project\DefaultIcon" "" "$INSTDIR\BTIcon.ico"
ReadRegStr $R0 HKCR "BT.Project\shell\open\command" ""
WriteRegStr HKCR "BT.Project\shell" "" "open"
WriteRegStr HKCR "BT.Project\shell\open\command" "" '$INSTDIR\jre\bin\javaw.exe -jar "$INSTDIR\bin\BT4Dsign.jar" -f "%1"'

;System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'


SectionEnd

; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts" shortcuts
SetOutPath $INSTDIR\bin
CreateDirectory "$SMPROGRAMS\BT4Dsign\Demo"
CreateShortCut "$SMPROGRAMS\BT4Dsign\Demo\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\BT4Dsign\Demo\BT4Dsign.lnk" "$INSTDIR\bin\BT4Dsign.exe" "" "$INSTDIR\bin\BT4Dsign.exe" 0
CreateShortCut "$SMPROGRAMS\BT4Dsign\Demo\BT4Dsign_de.lnk" "$INSTDIR\bin\BT4Dsign_de.exe" "" "$INSTDIR\bin\BT4Dsign_de.exe" 0
CreateShortCut "$SMPROGRAMS\BT4Dsign\Demo\BT4Dsign_en.lnk" "$INSTDIR\bin\BT4Dsign_en.exe" "" "$INSTDIR\bin\BT4Dsign_en.exe" 0

SectionEnd
;--------------------------------
;Descriptions

;Language strings
LangString DESC_Demo ${LANG_ENGLISH} "Installes the BT4Dsign demo."
LangString DESC_shortcuts ${LANG_ENGLISH} "Installes shortcuts for BT4Dsign demo."

;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Demo} $(DESC_Demo)
!insertmacro MUI_DESCRIPTION_TEXT ${shortcuts} $(DESC_shortcuts)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------

; Uninstaller

Section "Uninstall"


; Remove directories used
Delete "$SMPROGRAMS\BT4Dsign\Demo\BT4Dsign.ink"
Delete "$SMPROGRAMS\BT4Dsign\Demo\Uninstall.ink"
RMDir /r "$SMPROGRAMS\BT4Design"
RMDir /r "$INSTDIR"

; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\BT4DsignDemo"
DeleteRegKey HKLM SOFTWARE\BT4DsignDemo

DeleteRegKey HKCR ".btp"
DeleteRegKey HKCR "BT.Project"


SectionEnd

  Reply With Quote
Old 21st March 2005, 10:14   #2
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Delete "$SMPROGRAMS\BT4Dsign\Demo\BT4Dsign.lnk"
Delete "$SMPROGRAMS\BT4Dsign\Demo\Uninstall.lnk"
and may be full path
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
Takhir is offline   Reply With Quote
Old 21st March 2005, 13:18   #3
beule
Guest
 
Posts: n/a
The icons work, but the header image does not.
  Reply With Quote
Old 21st March 2005, 16:06   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Works in my test with bmp in the current (nsi) and Header folders (full path), original NSIS MUI header size image (150x57) and with another size, 8 and 24 bits/color.. So find the difference - start with existing NSIS headers and replace one with you Image_Installer.bmp content.
BTW you can skip last 2 File command if these files not required for your application - compiller includes image resources to uninstaller without this.
Takhir is offline   Reply With Quote
Old 22nd March 2005, 05:32   #5
beule
Junior Member
 
Join Date: Mar 2005
Posts: 2
Thanks for your suggestion.
Any help about the startmenu entries not removed?
beule is offline   Reply With Quote
Old 22nd March 2005, 05:42   #6
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Please read my first post, ink != lnk, and BT4Dsign != BT4Design.
Takhir is offline   Reply With Quote
Old 22nd March 2005, 06:09   #7
beule
Junior Member
 
Join Date: Mar 2005
Posts: 2
Sorry did not see it.
Thank you again that you took time to look over it.
beule 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