Fix for MoveFileExA

Ove Kaaven ovehk at ping.uio.no
Wed Jan 30 12:44:47 CST 2002


On Wed, 30 Jan 2002, Gerhard W. Gruber wrote:

> Also I don't want to submit it right now because my current fix is a bit ugly.
> The fix is applied for files that should be moved or deleted when windows
> boots after an application is installed. Currently there was a message telling
> the user that he has to delete/rename the specified files. Now I added some
> code that writes an entry in (WINECONFIG)/bootmove and (WINECONFIG)/bootdel
> when these functions are called. I also added some code in loader/main.c that
> checks if these files exists and if they do it will open them and
> deletes/renames the specified files. I hope this solution is acceptable. :)
> The only ugly thing about this is that the filenames for bootmove and bootdel
> are curerntly hardcoded where I need them. I don't know if there is a global
> space somewhere where I can add some fixed names so I did it this way for now,
> but this is not the best way in case the names should be changed or something
> and also I don't like hardecoded names.
> 
> Another drawback of this approach is that it would be possible that more than
> one process is writing or reading at the same time there could be potential
> problems, so I'd like to hear some opinions if this is ok.

Windows stores this information in c:\windows\wininit.ini, and several
installers access this file directly. Using Get/SetPrivateProfileString
should make accessing the file better protected from simultaneous access.
Format of wininit.ini:

[rename]
c:\newfilename=c:\oldfilename
nul=c:\filetodelete

I think Andreas Mohr may already have done some work on this though?





More information about the wine-devel mailing list