install function "" not referenced - zeroing code

0

Heyy,

Im trying to switch from mui2 to umui and im still pretty bad in coding so i hope you guys can help me.

 !define PRODUCT_NAME "UMUI-Setup"
 !define PRODUCT_VERSION "1.0"
 !define PRODUCT_PUBLISHER "Marvin Schulz"

;Plugin Files 

 !include "nsArray.nsh"
 !include "MUIEx.nsh"
 !include "InstallOptions.nsh"
 !include "NsDialogs.nsh"
 !include "LogicLib.nsh"
 !include "FileAssociationVNC.nsh"
 !include "Registry.nsh"

;UMUI Settings
 !define MUI_ABORTWARNING

;Require Adminrights
 RequestExecutionLevel admin

 !insertmacro UMUI_PAGE_MULTILANGUAGE
    !define UMUI_WELCOMEPAGE_ALTERNATIVETEXT
  !insertmacro MUI_PAGE_WELCOME
    !define ModifyWelcome 
    !define LeaveWelcome
  !insertmacro MUI_PAGE_LICENSE "C:\Program Files (x86)\NSIS\Docs\SkinnedControls\license.txt"
  !insertmacro MUI_PAGE_COMPONENTS
    !define UMUI_ALTERNATIVESTARTMENUPAGE_SETSHELLVARCONTEXT
    !define UMUI_ALTERNATIVESTARTMENUPAGE_USE_TREEVIEW
    !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
    !define MUI_STARTMENUPAGE_DEFAULTFOLDER "NSIS\Contrib"
    !define UMUI_CONFIRMPAGE_TEXTBOX confirm_function
  !insertmacro MUI_PAGE_INSTFILES
    !define MUI_FINISHPAGE_SHOWREADME "C:\installer.ini"
    !define MUI_FINISHPAGE_LINK "SkinnedControls Home Page"
    !define MUI_FINISHPAGE_LINK_LOCATION "http://ultramodernui.sourceforge.net/"
  !insertmacro MUI_PAGE_FINISH
    !define UMUI_ABORTPAGE_LINK "SkinnedControls Home Page"
    !define UMUI_ABORTPAGE_LINK_LOCATION "http://ultramodernui.sourceforge.net/"
  !insertmacro UMUI_PAGE_ABORT
  ChangeUI IDD_INSTFILES "${NSISDIR}\Contrib\UIs\default_sb.exe"


 ;Languages 
  !insertmacro MUI_LANGUAGE "English"
  !insertmacro MUI_LANGUAGE "French"
  !insertmacro MUI_LANGUAGE "Hungarian"
  !insertmacro MUI_LANGUAGE "Czech"
  !insertmacro MUI_LANGUAGE "Japanese"
  !insertmacro MUI_LANGUAGE "Polish"
  !insertmacro MUI_LANGUAGE "PortugueseBR"
  !insertmacro MUI_LANGUAGE "German"

 ;Reserve files
 var checkbox
 var checkboxstate  

 Function ModifyWelcome
 ${NSD_CreateLabel} 120u -50u 100% 22u "HINWEIS: Wenn die UAC noch an ist $\n werden die meisten Pakete nicht funktionieren."
 ${NSD_CreateCheckBox} 120u -20u 50% 22u "Installationssicherung auf C:\Daten auswaehlen"
 Pop $checkbox
 SetCtlColors $checkbox "" ${MUI_BGCOLOR}
 ${NSD_Check} $checkbox
FunctionEnd

Function LeaveWelcome
 ${NSD_GetState} $checkbox $checkbox
 ${if} $checkbox != 0
    MessageBox MB_OK "Installationssicherung auf C:\Daten wurde ausgewaehlt"
    StrCpy $checkboxstate "1"
 ${else}
    MessageBox MB_OK "Installationssicherung auf C:\Daten wurde nicht ausgewaehlt"
    StrCpy $checkboxstate "0"
 ${endif}
Push $checkboxstate
CreateDirectory C:\Daten
FunctionEnd

Function .onInit
UserInfo::GetAccountType
pop $0
${If} $0 != "admin" ;Require admin rights on NT4+
    MessageBox mb_iconstop "Administrator Rechte benötigt!"
    SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
    Quit
${EndIf}
!insertmacro UMUI_MULTILANG_GET

  !define UMUI_BUTTONIMAGE_BMP "${NSISDIR}\Contrib\SkinnedControls\skins\defaultbtn.bmp"
  !define UMUI_SCROLLBARIMAGE_BMP "${NSISDIR}\Contrib\SkinnedControls\skins\defaultsb.bmp"

FunctionEnd

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "UMUI-Setup.exe"
InstallDir "$PROGRAMFILES\"

ShowInstDetails show

SectionGroup "Test"

Section /o "Benutzerkontensteuerung deaktivieren"
    ${registry::Write} "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System" "EnableLUA" "0x00000000" "REG_DWORD" $R0
SectionEnd

SectionGroupEnd

So thats my code and i got the function modifyWelcome and LeaveWelcome and when i try to compile this, then i get "install function "LeaveWelcome" not referenced - zeroing code", the same with ModifyWelcome. So idk what that means or what i have to do so i hope you can help me and sorry for my English

nsis
asked on Stack Overflow Oct 11, 2019 by Marvin-S

1 Answer

0

"install function not referenced - zeroing code" means that your code contains a function that is never called by any other code. It usually means you forgot to call or configure the function.

In your case, you have some page related functions that are not used.

If you don't want/need that code, delete them. If you do want them to be called, add the correct defines:

...
!define UMUI_WELCOMEPAGE_ALTERNATIVETEXT
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ModifyWelcome
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveWelcome
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "C:\...
...
answered on Stack Overflow Oct 11, 2019 by Anders

User contributions licensed under CC BY-SA 3.0