Archive: delete fonts


delete fonts
hello
i want to delete font in the font's folder.

in my script to install font, i use this:
ReadRegStr $R1 \
HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Fonts"
SetOutPath "$R1"
file "..\tools\fonts\*.*"
for me it's good

after in the uninstall section, i write:
Delete "$R1\N01bc*.*"
Delete "$R1\Ocrb.ttf"

when i uninstall nothing happened, fonts remain in font's folder.

can you help me
sorry for my english


The Uninstall and Install sections are completely seperate executables.
Therefore, the value of $R1 in the install section will be fine, but in the uninstall section it will be blank "" because you need to read the fonts directory value from the registry again.

-Stu


i added in uninstall section
ReadRegStr $R1 \
HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Fonts"
Delete "$R1\N01bc*.*"
Delete "$R1\Ocrb.ttf"
but nothing happen again. is it not necessary to uninstall font with registry??
and i want to know if i put delete "$R1\N01bc*.ttf", it del all files who begin by "N01bc" because i have lot of font like N01bc72n.ttf, N01bc54n.ttf...
thanks


Ah ok, maybe windows isn't letting you delete the files.
You should delete them on a PC reboot maybe.

I'm not sure how that's done (I've never been in that area.)

-Stu


Does it works when you do this? :


Delete "$WINDIR\Fonts\font.ttf"

i tried the reboot, and whem i go one time on font's folder, my fonts are in folder but theirs sizes are at 0kb. but if i'm going to another folder and i back in font's folder, my fonts disappeared.
for me it's good.
thanks


You probably need to unregister them first. See this thread about registering and unregistering fonts:

http://forums.winamp.com/showthread....ighlight=fonts

BTW, the function call mentioned in that page won't work with wildcards (* and ?) so you'll have to enumerate all of the fonts that you want to delete using FindFirst, FindNext and FindClose.


E.g.

FindOpen $0 $1 "C:\blah\*.txt"
loop:
Delete $1
ClearErrors
FindNext $0 $1
IfErrors done
Goto loop
done:
FindClose $0


-Stu