- NSIS Discussion
- FontRegAdv Problem
Archive: FontRegAdv Problem
ajfisher
8th May 2006 17:23 UTC
FontRegAdv Problem
Hi--
I'm new to NSIS and the forum. I'm having a problem using the FontRegAdv header provided in the wiki for uninstalling fonts. I get the following message:
Call must be used with function names starting with "un." in the uninstall section.
Usage: Call function_name | [:label_name]
Error in macro GetFileNameCall on macroline 2
Error in macro RemoveTTF on macroline 11
Error in script "C:\Documents and Settings\me\My Documents\Work\Win\FontsFull.nsi" on line 224 -- aborting creation process
Here's the beginning of my unistall section:
Section /o un.Main UNSEC0000
StrCpy $FONT_DIR $FONTS
!insertmacro RemoveTTF 'TAMBURO_.TTF'; line 224
Any Suggestions?
Thanks
Allen
kichik
8th May 2006 20:14 UTC
Try replacing the part between "### Modified Code from FileFunc.nsh ###" and "### End Code From ###" with:
!ifmacrondef GetFileName
!macro GetFileName _PATHSTRING _RESULT
Push `${_PATHSTRING}`
Exch $0
Push $1
Push $2
StrCpy $2 $0 1 -1
StrCmp $2 '\' 0 +3
StrCpy $0 $0 -1
goto -3
StrCpy $1 0
IntOp $1 $1 - 1
StrCpy $2 $0 1 $1
StrCmp $2 '' end
StrCmp $2 '\' 0 -3
IntOp $1 $1 + 1
StrCpy $0 $0 '' $1
end:
Pop $2
Pop $1
Exch $0
Pop ${_RESULT}
!macroend
!define GetFileName `!insertmacro GetFileName`
!endif
Let me know if it works, so I can update the Wiki, or you can update the Wiki yourself.
ajfisher
8th May 2006 22:42 UTC
kichik--
Thanks for the response. That seems to have broken something in InstallTTF. If I call installTTF more than once in a section, there's another compile error:
Error: label "end:" already declared in section
Error in macro GetFileName on macroline 20
Error in macro InstallTTF on macroline 10
Error in script "C:\Documents and Settings\me\My Documents\Work\Win\FontsFull.nsi" on line 76 -- aborting creation process
Line 76 is just another call to InstallTTF.
thanks for the help so far.
--A
kichik
8th May 2006 22:51 UTC
Then:
!ifmacrondef GetFileName
!macro GetFileName _PATHSTRING _RESULT
Push `${_PATHSTRING}`
Exch $0
Push $1
Push $2
StrCpy $2 $0 1 -1
StrCmp $2 '' 0 +3
StrCpy $0 $0 -1
goto -3
StrCpy $1 0
IntOp $1 $1 - 1
StrCpy $2 $0 1 $1
StrCmp $2 '' +4
StrCmp $2 '' 0 -3
IntOp $1 $1 + 1
StrCpy $0 $0 '' $1
Pop $2
Pop $1
Exch $0
Pop ${_RESULT}
!macroend
!define GetFileName `!insertmacro GetFileName`
!endif
ajfisher
8th May 2006 23:50 UTC
kichik--
Thanks again. This brings me back to the original error, but this time with differnt line numbers:
Call must be used with function names starting with "un." in the uninstall section.
Usage: Call function_name | [:label_name]
Error in macro FontName on macroline 2
Error in macro RemoveTTF on macroline 64
Error in script "C:\Documents and Settings\afisher.CODA\My Documents\Work\Win\MMFontsFull.nsi" on line 224 -- aborting creation process
Am I calling RemoveTTF correctly?
!insertmacro RemoveTTF 'TAMBURO_.TTF'
When something says that it's incorrectin "macroline XXX" where would I go to look for that in the header file?
Thanks,
Allen
kichik
9th May 2006 13:07 UTC
Well, the functions in FontName.nsh also need an upgrade. They only work for the installer. I suggest you contact Vytautas and ask him to upgrade the functions for compatibility with the uninstaller.
"macroline XXX" is the XXX-th line of the macro itself. You should look where the macro is defined and count those number of lines from the !macro line.
ajfisher
9th May 2006 14:35 UTC
kichik,
Thanks for all your help. It's greatly appreciated. Would you like me to update the wiki?
Allen
kichik
9th May 2006 14:36 UTC
No, it doesn't work yet in the uninstaller and it'll just make installers larger.
govmust
11th September 2007 12:38 UTC
So this RemoveTTF doesn't work?
Would someone update wiki then?
I would guess there arre more people like me who are trying to use it without any luck.
msroboto
19th August 2008 15:32 UTC
Has there been any resolution on this?
Error in macro GetFileNameCall on macroline 2
Error in macro RemoveTTF on macroline 11
Error in script "C:\Users\Sue\workspace\ConVAInstaller\fonttest.nsi" on line 39 -- aborting creation process
I tried a couple of tests including the one from the wiki and this is what I get on the un.
nortle73
28th July 2010 16:46 UTC
I know this is an old thread but has anyone successfully managed to get the RemoveTTFfont command to work succesfully?
I have been struggling for days now before having a look on the forum and finding people are having similar problems.