Archive: FontRegAdv Problem


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


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.

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


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

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

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.


kichik,

Thanks for all your help. It's greatly appreciated. Would you like me to update the wiki?

Allen


No, it doesn't work yet in the uninstaller and it'll just make installers larger.


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.


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.


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.