Old 15th June 2006, 04:28   #1
hailm
Junior Member
 
Join Date: Jun 2006
Posts: 3
Question multiple uninstall sections with MUI

Hola,

I'm trying to create a MUI installer with muliple uninstall sections. I can't seem to get the uninstall section description text to show up on uninstall sections. Here's my test script (below) which is just a mod of InstallOptions.nsi. This looks like a bug to me. Can anybody make this work?

cheers




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

!include "MUI.nsh"

;--------------------------------
;General

;Name and file
Name "Modern UI Test 0.1"
OutFile "InstallOptions.exe"

;Default installation folder
InstallDir "$PROGRAMFILES\Modern UI Test"

;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Modern UI Test" ""

;--------------------------------
;Pages

!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES

;Language strings
LangString DESC_Section1 ${LANG_ENGLISH} "First uninstall section."
LangString DESC_Section2 ${LANG_ENGLISH} "Second uninstall section."

;Assign language strings to sections
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING

;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy
DetailPrint "this really does not install anything except the uninstaller"
SetOutPath "$INSTDIR"
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd


;--------------------------------
;Uninstaller Sections

Section un.Section1
DetailPrint "This actually does nothing for section 1"
SectionEnd

Section un.Section2
;ADD YOUR OWN FILES HERE...
DetailPrint "Removes folder and uninstaller for section 2"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
SectionEnd
hailm is offline   Reply With Quote
Old 15th June 2006, 07:37   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Move the descriptions below the sections.
Joost Verburg is offline   Reply With Quote
Old 15th June 2006, 12:04   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You should check the makensis compiler output more often as well. No doubt you'd have warnings for this.

-Stu
Afrow UK is offline   Reply With Quote
Old 15th June 2006, 12:08   #4
hailm
Junior Member
 
Join Date: Jun 2006
Posts: 3
I can't get the script in my earlier post to show my descriptions in the uninstaller sections no matter where I put the descriptions. Also, I get this warning message when the script is compiled:


2 warnings:
unknown variable/constant "{Section1}" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:5)
unknown variable/constant "{Section2}" detected, ignoring (macro:MUI_DESCRIPTION_TEXT:5)

Any other ideas?

Thanks!
hailm is offline   Reply With Quote
Old 15th June 2006, 13:06   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ah I see...

Section un.Section1 must be:
Section un.Section1 Section1
and...
Section un.Section2 must be:
Section un.Section2 Section2

-Stu
Afrow UK is offline   Reply With Quote
Old 15th June 2006, 13:27   #6
hailm
Junior Member
 
Join Date: Jun 2006
Posts: 3
Afrow UK,

Thanks, the combination of Joost's suggestion of putting the description below the uninstall section plus your suggestion fixed the problem!

Thanks!
hailm 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