Old 8th May 2006, 17:23   #1
ajfisher
Junior Member
 
Join Date: May 2006
Location: Minneapolis, MN USA
Posts: 26
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
ajfisher is offline   Reply With Quote
Old 8th May 2006, 20:14   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Try replacing the part between "### Modified Code from FileFunc.nsh ###" and "### End Code From ###" with:
code:

!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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th May 2006, 22:42   #3
ajfisher
Junior Member
 
Join Date: May 2006
Location: Minneapolis, MN USA
Posts: 26
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
ajfisher is offline   Reply With Quote
Old 8th May 2006, 22:51   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Then:
code:
!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


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th May 2006, 23:50   #5
ajfisher
Junior Member
 
Join Date: May 2006
Location: Minneapolis, MN USA
Posts: 26
kichik--

Thanks again. This brings me back to the original error, but this time with differnt line numbers:

code:
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?

code:
!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
ajfisher is offline   Reply With Quote
Old 9th May 2006, 13:07   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th May 2006, 14:35   #7
ajfisher
Junior Member
 
Join Date: May 2006
Location: Minneapolis, MN USA
Posts: 26
kichik,

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

Allen
ajfisher is offline   Reply With Quote
Old 9th May 2006, 14:36   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
No, it doesn't work yet in the uninstaller and it'll just make installers larger.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 11th September 2007, 12:38   #9
govmust
Junior Member
 
Join Date: Aug 2007
Posts: 11
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.
govmust is offline   Reply With Quote
Old 19th August 2008, 15:32   #10
msroboto
Junior Member
 
Join Date: Sep 2006
Posts: 47
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.
msroboto is offline   Reply With Quote
Old 28th July 2010, 16:46   #11
nortle73
Junior Member
 
Join Date: Jul 2010
Posts: 1
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.
nortle73 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump