Archive: Problem compiling script with uninstall section.


Problem compiling script with uninstall section.
Hi,

I have been battling with this script for the past 2 hours and am getting nowhere fast. I have tried the documentation, checked the sample files, checked the archives and I still cannot see what I am doing wrong.

When I compile this script I get the following error.
Processed 1 file, writing output:
Adding plug-ins initializing function... Done!
Error: resolving pre-page function "un.mui.ConfirmPre" in uninstall pages
Note: uninstall functions must begin with "un.", and install functions must not
Error - aborting creation process

Could someone please look at it and tell me what I have done wrong.

I know the script is huge, please help me with the uninstall issue.
:hang:


Do the example scripts with uninstall functions compile on you system or is this related to the script?

Vytautas


It appears to be related to my scrip as the samples do work.
BTW. It is Version 2.0B4 of the NSIS software


Yes I did get the same error when I tried to compile your script, I will try to figure something out although I can't promise anything, not tonight anyway.

Vytautas

PS. You were not joking when you said it was a huge script:D


Thats what happens when one's installers do not know how to RTFM ;) Read The Fine Manual.

And we poor developers have to spoon feed them.:igor:


I do agree. I once had the same problem with the uninstaller, after a while I descided to leave it out since in that program it was not essencial. However now is the time to revisit and hopefully solve this problem.

Vytautas


I have simplified the script and still get the same error. :hang:


!include "MUI.nsh"

;------------------------------------
; Add Defines Here
;------------------------------------

!define MUI_PRODUCT "ZXFusion"
!define MUI_VERSION "4.0"
!define MUI_ICON "COMMON\ICONS\INST.ICO"
!define MUI_UNICON "COMMON\ICONS\UNINST.ICO"
!define MUI_CHECKBITMAP "COMMON\GRAPHICS\Checks_Sajal_Nails.bmp"
!define MUI_BRANDINGTEXT "Atcom Computer Services (c) 2000-2003 "
!define MUI_UI "${NSISDIR}\Contrib\UIs\default.exe"





!define MUI_WELCOMEPAGE
!define MUI_SPECIALBITMAP "COMMON\GRAPHICS\zxflogorot.bmp"

!define MUI_CUSTOMPAGECOMMANDS

!define MUI_COMPONENTSPAGE
!define MUI_COMPONENTSPAGE_NODESC
!define MUI_HEADERBITMAP "COMMON\GRAPHICS\zxflogo.BMP"

!define MUI_DIRECTORYPAGE

!define MUI_FINISHPAGE
!define MUI_FINISHPAGE_NOREBOOTSUPPORT

!define MUI_CONFIRM

!define MUI_ABORTWARNING


;-------------------------------------
; Macro Insertions Here
;-------------------------------------

!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_PAGE_FINISH

;-------------------------------------
; Config Section
;-------------------------------------
Outfile "Test.exe"
ShowInstDetails "nevershow"
ShowUninstDetails "nevershow"
CRCCheck on
XPStyle On

Section "Test" TEST
SetOutPath $INSTDIR
WriteUninstaller "Unwise.exe"
SectionEnd

function .oninit
Messagebox MB_OK "Start"
StrCpy $INSTDIR "C:\@PROGRAM\ZXFUSION\INSTALL40"
functionend

Section "Uninstall"
MessageBox MB_OK "UnInstall"
SectionEnd


The simplified script does not follow the rules given in the current MUI ReadMe.

The latest MUI no longer uses Page "defines" such as

!define MUI_WELCOMEPAGE
!define MUI_DIRECTORYPAGE
etc

All you need now are the "!insertmacro" commands such as

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
etc

If you move the

!insertmacro MUI_LANGUAGE "English"

line further down the script, say after all of the "!insertmacro MUI_PAGE..." lines, the simplified script compiles without the error you complained about in your first post.

If you read the MUI ReadMe you will find that it gives step-by-step instructions for creating scripts. Step 1 is the !include "MUI.nsh" command, Step 3 covers the new PAGE !insertmacro commands but it is not until Step 6 that the MUI_LANGUAGE commands are discussed.