MrK2
5th November 2008 11:52 UTC
NSIS, XP Embedded and EWF
I'm using NSIS to install software in a XP embedded system which has the EWF (a filesystem protection system) enabled.
Even when I disable EWF, the installer acts weird, specially with files to be copied on reboot: They usually don't get copied. Has anyone found a similar problem so that I can have a look at it? (the forum shows nothng about EWF)
The installer works flawlessly on a normal XP with no EWF.
TIA,
Jordi
kichik
7th November 2008 22:40 UTC
What exactly does EWF do and is it an official Microsoft product?
MrK2
18th November 2008 18:42 UTC
Originally posted by kichik
What exactly does EWF do and is it an official Microsoft product?
Hi kichik,
sorry for the delay. EWF is a "Write Filter". It basically protects the hard disk by using a memory overlay, and every write done to the hard disk is "redirected" to memory, so that you don't really modify your HD and can boot exactly the same way across reboots (it's widely used for embedded devices).
There are tools to commit changes (of course, otherwise you couldn't write to HD), but sometimes NSIS just doesn't write those files even when you've commited the overlay :?
It is indeed an official Microsoft product, although (afaik) it is only available to XP embedded.
EDIT: I think it might be related to the MoveFileEx Function (supposing that NSIS is using it to delete & copy the final name).Is the 'move' of MoveFileEx effective before the reboot or just after the system boots?
EDIT2: I'm having a look at the windows event viewer. When I reboot under the circumstances that make the files disappear, I get an event 1524 and 1517, but I don't know if those could be the cause.
EDIT3: I think I've found the problem. All my software is installed to d:\, and the TEMP & TMP are pointing to e:\temp. If I change it to d:\temp then everything works... does that make sense???? D and E are obviously different primary partitions.
The thing is I don't want to have the swap in the d:, as it could be a CF (although it isn't now) and I'd prefer to avoid all writes to it.
MrK2
19th November 2008 08:44 UTC
OK, I think it's really a MoveFileEX behaviour problem. From MSDN's documentation
MOVEFILE_COPY_ALLOWED
If the file is to be moved to a different volume, the function simulates the move by using the CopyFile and DeleteFile functions.
This value cannot be used with MOVEFILE_DELAY_UNTIL_REBOOT.
So, if I want to move the file to another volume I'd have to specify MOVEFILE_COPY_ALLOWED, but I can't because it must be done on reboot.
Does anybody has a clever idea about how to do that? I'm really lost and the deadline is here :confused: :D
kichik
19th November 2008 18:56 UTC
You should create the temporary file right next to the file you want to overwrite. Use GetTempFilename for that. The second parameter specifies the base directory.
MrK2
20th November 2008 11:14 UTC
Originally posted by kichik
You should create the temporary file right next to the file you want to overwrite. Use GetTempFilename for that. The second parameter specifies the base directory.
That's it, lots of thanks! :)