Old 18th June 2016, 11:45   #1
mohessaid
Junior Member
 
Join Date: Jun 2016
Posts: 3
How to use FontRegAdv to install fonts

Hi,

I am using NSIS to build an installer for my application, but I need to install also some fonts to use them in the app. I am using the fonts macros here. But I get an error in the un.Fonts section (uninstalling the fonts) here is my code

This one for the uninstall:
code:

Section "un.Fonts"
StrCpy $FONT_DIR $FONTS

!insertmacro RemoveTTF '$FONT_DIR\digital-7(italic).ttf'
!insertmacro RemoveTTF '$FONT_DIR\digital-7 (mono italic).ttf'
!insertmacro RemoveTTF '$FONT_DIR\digital-7 (mono).ttf'
!insertmacro RemoveTTF '$FONT_DIR\digital-7.ttf'
!insertmacro RemoveTTF '$FONT_DIR\DIGITALDREAM.ttf'
!insertmacro RemoveTTF '$FONT_DIR\DroidKufi-Bold.ttf'
!insertmacro RemoveTTF '$FONT_DIR\DroidKufi-Regular.ttf'
!insertmacro RemoveTTF '$FONT_DIR\DroidNaskh-Bold.ttf'
!insertmacro RemoveTTF '$FONT_DIR\DroidNaskh-Regular.ttf'
!insertmacro RemoveTTF '$FONT_DIR\NotoKufiArabic-Bold.ttf'
!insertmacro RemoveTTF '$FONT_DIR\NotoKufiArabic-Regular.ttf'
!insertmacro RemoveTTF '$FONT_DIR\NotoNaskhArabicUI-Bold.ttf'
!insertmacro RemoveTTF '$FONT_DIR\NotoNaskhArabicUI-Regular.ttf'
!insertmacro RemoveTTF '$FONT_DIR\NotoNastaliqUrduDraft.ttf'
!insertmacro RemoveTTF '$FONT_DIR\Thabit.ttf'
!insertmacro RemoveTTF '$FONT_DIR\Thabit-Bold.ttf'
!insertmacro RemoveTTF '$FONT_DIR\Thabit-BoldOblique.ttf'
!insertmacro RemoveTTF '$FONT_DIR\Thabit-Oblique.ttf'

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
SectionEnd



And this one for the install :

the "New folder (2)\Resdources\Fonts\" is the path where the font file in my machine.

code:
Section "Fonts"

StrCpy $FONT_DIR $FONTS

!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\digital-7 (italic).ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\digital-7 (mono italic).ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\digital-7 (mono).ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\digital-7.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\DIGITALDREAM.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\DroidKufi-Bold.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\DroidKufi-Regular.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\DroidNaskh-Bold.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\DroidNaskh-Regular.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\NotoKufiArabic-Bold.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\NotoKufiArabic-Regular.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\NotoNaskhArabicUI-Bold.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\NotoNaskhArabicUI-Regular.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\NotoNastaliqUrduDraft.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\Thabit.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\Thabit-Bold.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\Thabit-BoldOblique.ttf"
!insertmacro InstallTTF "New folder (2)\Resdources\Fonts\Thabit-Oblique.ttf"

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
SectionEnd



And this is the error message :


code:
Section: "un.Fonts"
StrCpy $FONT_DIR "$FONTS" () ()
!insertmacro: RemoveTTF
Push: $0
Push: $R0
Push: $R1
Push: $R2
Push: $R3
Push: $R4
!define: "Index"="Line775.8"
!insertmacro: GetFileNameCall
Push: $FONT_DIR\digital-7(italic).ttf
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 "D:\Other\ZADTVSCM.nsi" on line 775 -- aborting creation process



Can anybody give me a hint?
mohessaid is offline   Reply With Quote
Old 18th June 2016, 17:51   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,190
Did you see this part on the wiki:
Quote:
Font removal function do not seem to work at the momment
I made some changes to the code on the wiki, you can try it again now...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th June 2016, 18:57   #3
mohessaid
Junior Member
 
Join Date: Jun 2016
Posts: 3
I read a lots of pages in the wiki and forum concerning this topic but I never encounter this one, can you give me a link to check please, at the moment I omitted the un.Fonts section to compile the installer but I need to add it in the future.
mohessaid is offline   Reply With Quote
Old 18th June 2016, 22:04   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,190
Quote:
Originally Posted by mohessaid View Post
I read a lots of pages in the wiki and forum concerning this topic but I never encounter this one, can you give me a link to check please, at the moment I omitted the un.Fonts section to compile the installer but I need to add it in the future.
I changed the page you linked to in your first post...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 19th June 2016, 14:14   #5
mohessaid
Junior Member
 
Join Date: Jun 2016
Posts: 3
You mention that there is a problem in the un.Fonts section but it still not fixed
mohessaid is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
font installation

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