Skip to content
⌘ NSIS Forum Archive

nsis error: resolving install function

4 posts

cx08#

nsis error: resolving install function

Sample script:

(--helpers.nsh--)
!define CreateSymbolicLinkFolder "!insertmacro CreateSymbolicLinkFolder"
!ifdef CreateSymbolicLinkFolder_
Function CreateSymbolicLinkFolder_
Exch $0 ; _TARGET
Exch 1
Exch $1 ; _JUNCTION
IfFileExists "$0" 0 done
${GetParent} "$1" $R0
CreateDirectory "$R0"
System::Call "kernel32::CreateSymbolicLinkW(w `$1`, w `$0`, i 1) i .s"
done:
Pop $R0
Pop $1
Pop $0
FunctionEnd
!endif
!macro CreateSymbolicLinkFolder _JUNCTION _TARGET
!define CreateSymbolicLinkFolder_
Push "${_JUNCTION}"
Push "${_TARGET}"
Call CreateSymbolicLinkFolder_
!macroend

(--sample.nsi--)
!include "helpers.nsh"
...
${CreateSymbolicLinkFolder} "$APPDATA\SOMEPATH" "$EXEDIR\Data"
Nsis error:
Error: resolving install function "DeleteLinkOrFolder_" in function "Clean"
Note: uninstall functions must begin with "un.", and install functions must not

How can i do fix the this?

In this code:

!define CreateSymbolicLinkFolder "!insertmacro CreateSymbolicLinkFolder"
!define CreateSymbolicLinkFolder_
!ifdef CreateSymbolicLinkFolder_
Function CreateSymbolicLinkFolder_
Exch $0 ; _TARGET
Exch 1
Exch $1 ; _JUNCTION
IfFileExists "$0" 0 done
${GetParent} "$1" $R0
CreateDirectory "$R0"
System::Call "kernel32::CreateSymbolicLinkW(w `$1`, w `$0`, i 1) i .s"
done:
Pop $R0
Pop $1
Pop $0
FunctionEnd
!endif
!macro CreateSymbolicLinkFolder _JUNCTION _TARGET
Push "${_JUNCTION}"
Push "${_TARGET}"
Call CreateSymbolicLinkFolder_
!macroend
if i modify the script like this and if i don't need the macro "CreateSymbolicLinkFolder", nsis give me a warning:
install function "CreateSymbolicLinkFolder_" not referenced - zeroing code
Anders#
I assume this is the same question as you posted on SO? It is a bit hopeless when the errors are in "DeleteLinkOrFolder_" or "Clean" and you don't even show us what those functions look like!
cx08#edited
Sorry, the correct source code:

Sample nsis script:

(--helpers.nsh--)
!define CreateSymbolicLinkFolder "!insertmacro CreateSymbolicLinkFolder"
!ifdef CreateSymbolicLinkFolder_ ; <--- always false
Function CreateSymbolicLinkFolderFunc
Exch $0 ; _TARGET
Exch 1
Exch $1 ; _JUNCTION
IfFileExists "$0" 0 done
${GetParent} "$1" $R0
CreateDirectory "$R0"
System::Call "kernel32::CreateSymbolicLinkW(w `$1`, w `$0`, i 1) i .s"
done:
Pop $R0
Pop $1
Pop $0
FunctionEnd
!endif
!macro CreateSymbolicLinkFolder _JUNCTION _TARGET
!define CreateSymbolicLinkFolder_ ; <--- not work...
Push "${_JUNCTION}"
Push "${_TARGET}"
Call CreateSymbolicLinkFolderFunc
!macroend

(--sample.nsi--)
!include "helpers.nsh"
...
Function Clean
${CreateSymbolicLinkFolder} "$APPDATA\SOMEPATH" "$EXEDIR\Data"
FunctionEnd
Section "Main"
Call Clean
SectionEnd
Nsis error:
Error: resolving install function "CreateSymbolicLinkFolderFunc" in function "Clean"
Note: uninstall functions must begin with "un.", and install functions must not

How can i define CreateSymbolicLinkFolder_ correctly in macro CreateSymbolicLinkFolder?
The "!ifdef CreateSymbolicLinkFolder_" code is to avoid nsis warning, when i don't need to call the macro CreateSymbolicLinkFolder:
install function "CreateSymbolicLinkFolder_" not referenced - zeroing code
Anders#
CreateSymbolicLinkFolder_ is not defined at the top before the !ifdef so the function is never created. Define it before the !include or check my answer on SO for a better way to do this...