Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

After CreateFile in Append, WriteLine fails...


1 reply to this topic

theVBGuy

theVBGuy
  • Members
  • 5 posts

Posted 16 April 2002 - 22:43

When I create a batch file using OpenFileMode FILE_MODE_APPEND and create it (CreateFile), sometime (!;) the WriteLine (all of them) will fails PLUS the batch file is not really created.
However when trying to uninstall, IS give a warning that the [folder] is in use. I deduced that the file was created, could not be written to and was not closed (it does not show in the explorer) but remains marked as in-use. Rebooting will not help.
It happened in Win98 (two different machines) and WinXp.

Somehow, the XP machine became again "writable" and the install wrote the thing correctly.

============================================
richard.jalbert@interfacing.com
Please reply to Board first.
============================================
Any idea?
========================================
richard.jalbert@interfacing.com
Did you know cats can type by sitting on the keyboard?
http://www3.sympatico.ca/richmann/
========================================

theVBGuy

theVBGuy
  • Members
  • 5 posts

Posted 19 April 2002 - 16:39

During the installation a directory structure is built.

It seems IS does not know, after building it that it IS there.
So any file creation, opening or edition from within that directory path will fail.

The solution was simply to build the batch file at run time in the existing ROOT of the TARGETDIR, add the lines to it, close it then CopyFile it to the TARGETDIR, then DeleteFile it (you have to switch the path in TARGETDIR so it contains the ROOT because DeleteFile works only on TARGET... then reset it after) .

One more hoop to jump through...
========================================
richard.jalbert@interfacing.com
Did you know cats can type by sitting on the keyboard?
http://www3.sympatico.ca/richmann/
========================================