PDA

View Full Version : Font Install Problem



NewsArchive
09-17-2007, 01:36 AM
In SB6 I am having customers and prospects report the Attached error very
intermittently..

Never had this error in many years with SB4.

Happens with XP and Vista. Never happens here.

Insight any one?
--
Lynn Howard
www.linkedsoftware.com

NewsArchive
09-17-2007, 01:37 AM
>Insight any one?

Virus scanner running?

Steve

--
Stephen Wolstenholme Neural Planner Software Ltd

EasyNN-plus. The easy way to build neural networks.

http://www.easynn.com

NewsArchive
09-17-2007, 01:38 AM
Mark Riffey reported;

"Nothing odd on my machine. I use AVG 7.5 network edition anti-virus.
Windows
Defender is turned on. No other anti-spyware stuff. "

That was one of Friedrich's thought too!

Thanks.

Lynn Howard

NewsArchive
09-17-2007, 01:41 AM
> Virus scanner running?

Of course. No other program has ever caused a problem installing a font
while AVG was running. Why should this one?

In fact, I dont think Ive ever had to turn off anti-virus to install
something - except another anti-virus.
--

Mark Riffey
http://www.rescuemarketing.com/blog/

NewsArchive
09-17-2007, 01:42 AM
Error -200 means that the CreateFile() Windows API fails with an
INVALID_HANDLE_VALUE error code.

If this happens, "something" on the machine does not allow access to the
file. There is absolutely nothing we can do because the error code comes
directly from the Windows API.

This is the original source code line from the LSPack library.

outFile = CreateFile(TargetFile, GENERIC_READ | GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (outFile == INVALID_HANDLE_VALUE)
return -200;

TargetFile holds the fully qualified path to the file to be installed (in
your case c:\windows\fonts\3of9.ttf)

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-17-2007, 01:43 AM
I have had this happen a couple of times and in fact it occurs on one
machine in my office every time - never found a solution.

Don Harvey

NewsArchive
09-17-2007, 01:43 AM
> I have had this happen a couple of times and in fact it occurs on one
> machine in my office every time - never found a solution.

What anti-virus?
--

Mark Riffey
http://www.rescuemarketing.com/blog/

NewsArchive
09-17-2007, 01:45 AM
Hi Lynn,

I have tested your installer on two Windows Vista Ultimate 32-bit machines
and on one Windows Vista Ultimate 64-bit machine.

It installed on all machines without any problem (see attached screenshot).
I'll test it on our XP machines now.

Friedrich

NewsArchive
09-17-2007, 01:46 AM
Okay, installed your software on another Windows Vista machine here in the
building. It's a 32-bit Business edition, running ZoneAlarm for Vista. The
3of9.ttf font already existed in the Fonts folder. Your installer worked
without any problem.

Friedrich

NewsArchive
09-17-2007, 01:47 AM
Okay, more test results. Your application installed fine on three Windows
XP SP2, one Windows 2000, one Windows Server 2003 and one Windows Server
2008 (Longhorn). 3OF9.TTF was already available on one XP and the Windows
2000 machine.

But I think I know what your problem is. It seems to me that, on Mark's
machine, the 3OF9.TTF file is currently being used and cannot be replaced.
The file is not locked so a file in-use function cannot detect this. If a
font is being used, the CreateFile() API fails.

You only have to set the "Replacement Option" in your 3OF9.TTF File
Properties to "Never" and you are done!

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-17-2007, 01:56 AM
BTW, the same would have happened with SB4 (or SB3, etc.). This is not an
installer issue per-se.

Friedrich

NewsArchive
09-18-2007, 02:20 AM
> Error -200 means that the CreateFile() Windows API fails with an
> INVALID_HANDLE_VALUE error code.
>
> If this happens, "something" on the machine does not allow access to the
> file. There is absolutely nothing we can do because the error code comes
> directly from the Windows API.

In this case, the font in question was already installed. Seems like a bit
too serious a failure to roll the entire install back.
--

Mark Riffey
http://www.rescuemarketing.com/blog/

NewsArchive
09-18-2007, 02:20 AM
Mark,

> In this case, the font in question was already installed. Seems like a bit
> too serious a failure to roll the entire install back.

I have to respectfully disagree, because a file installation failure is
always a fatal error and the developer selected the "always replace" option.

In this case, (by default) the installer has to perform a complete rollback.
So it was the expected and correct behavior.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-18-2007, 02:21 AM
None. I uninstalled everything. WinXP Pro. It occurs only on this one
machine.

Don Harvey

NewsArchive
09-18-2007, 02:22 AM
> I have had this happen a couple of times and in fact it occurs on one
> machine in my office every time - never found a solution.

Set the "Replacement Option" in your font File Properties to "Never" and you
are done.

Or use something like the following to replace an existing font (if it is
not in-use).

Delete Files "%WINDIR%\Fonts\3of9.ttf"
If %_SB_ERRORCODE% Not Equals "0" Then
Install File "C:\5\3of9.ttf" to "%FONTSDIR%\3of9.ttf" [TrueType]
End

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-18-2007, 02:24 AM
Hi Friedrich,

By Jove I believe you have it! I'll make a new build for Mark to test
shortly.

Thank you so much for all your work on my problem. This is special
support!!

So I guess the general rule for fonts would be to never replace a font
unless there is a special need?

Now I don't even have to worry about Longhorn.

Lynn

NewsArchive
09-18-2007, 02:24 AM
Hi Lynn,

> By Jove I believe you have it! I'll make a new build for Mark to test
> shortly.
>
> Thank you so much for all your work on my problem. This is special
> support!!
>
> So I guess the general rule for fonts would be to never replace a font
> unless there is a special need?
>
> Now I don't even have to worry about Longhorn.

Yes, I am 100% sure that it is caused by a font currently being used issue.
The problem is that it is not possible to detect if a font is "in-use"
(locked).

I would suggest to never replace a font.

But I am testing a workaround right now. I found out that it should be
possible to remove an in-use (locked) font (strange, isn't it?) and then
replace it (no reboot required). If this really works on all Windows OSs
then we'll add it to the installer runtime.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-18-2007, 02:25 AM
Hi Friedrich,

I always knew you could do it. <BG>

Thanks a million.

Lynn

NewsArchive
09-18-2007, 02:25 AM
<G> :)

Friedrich

NewsArchive
09-18-2007, 02:26 AM
>But I am testing a workaround right now. I found out that it should be
>possible to remove an in-use (locked) font (strange, isn't it?) and then
>replace it (no reboot required). If this really works on all Windows OSs
>then we'll add it to the installer runtime.

I use VC++ code similar to that below before every file write or
replace just in case the file is in use. I'm sure Clarion can do the
same check.

CFileStatus fileStatus;

if(file.GetStatus(fileStatus) && fileStatus.m_size > 0)
file.Close();

Steve

--
Stephen Wolstenholme Neural Planner Software Ltd

EasyNN-plus. The easy way to build neural networks.

http://www.easynn.com

NewsArchive
09-18-2007, 02:28 AM
Hi Steve,

>>But I am testing a workaround right now. I found out that it should be
>>possible to remove an in-use (locked) font (strange, isn't it?) and then
>>replace it (no reboot required). If this really works on all Windows OSs
>>then we'll add it to the installer runtime.
>
> I use VC++ code similar to that below before every file write or
> replace just in case the file is in use. I'm sure Clarion can do the
> same check.
>
> CFileStatus fileStatus;
>
> if(file.GetStatus(fileStatus) && fileStatus.m_size > 0)
> file.Close();

Thank you. The SetupBuilder installer engine itself is VC++. But the
problem is that file.GetStatus(fileStatus) would return the file is *NOT*
in-use. The CreateFile() Windows API to overwrite an existing file fails
with an INVALID_HANDLE_VALUE error code.

We found out that a font which is currently being used cannot be replaced.
Even Windows Explorer cannot do it (see attached screenshot).

To find out if a Font is in-use, we have to use the Delete File function.
For example:

Delete Files "%WINDIR%\Fonts\3of9.ttf"
If %_SB_ERRORCODE% Not Equals "0" Then
Install File "C:\5\3of9.ttf" to "%FONTSDIR%\3of9.ttf" [TrueType]
End

The above can replace an existing font. It will not replace it if it is
in-use.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-18-2007, 02:30 AM
> But I think I know what your problem is. It seems to me that, on Mark's
> machine, the 3OF9.TTF file is currently being used and cannot be replaced.

Shouldnt be, but something might be loading it just for kicks.
--

Mark Riffey
http://www.rescuemarketing.com/blog/

NewsArchive
09-18-2007, 02:33 AM
Hi Mark,

Did you try the new install I sent which does not replace the font?

Lynn

NewsArchive
09-18-2007, 03:10 AM
> Did you try the new install I sent which does not replace the font?

Yep, works fine now.
--

Mark Riffey
http://www.rescuemarketing.com/blog/

NewsArchive
09-18-2007, 03:11 AM
Great!

Thanks everyone for all your help!

Just don't replace fonts. <G>

Mark did you ever find out how 3of9 was being used on your machine? If you
rename your 3of9 will my install still work?

Lynn

NewsArchive
09-18-2007, 03:11 AM
> Mark did you ever find out how 3of9 was being used on your machine? If you
> rename your 3of9 will my install still work?

Got me. I installed 3of9 for some barcoding stuff I need to do, but the
only way its in use is if some app is loading it before its really needed.
--

Mark Riffey
http://www.rescuemarketing.com/blog/