cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LeTjock
Level 3

Write to file with installscript fails on windows vista

The installscript command OpenFile failes on Windows Vista are there any other installscript command to use in Vista that will work?
Labels (1)
0 Kudos
(2) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

I'm not aware of any problems with the file APIs on Vista. However there are a lot of tricks that the UAC-related elevation can play on where your files really are vs. where you originally thought they were. Could you be running into a case where the path your code tries to open becomes incorrect?
0 Kudos
LeTjock
Level 3

The path is correct.
When Im using
OpenFileMode(FILE_MODE_APPEN);
if(OpenFile(nvFileHandle, sDir, sFile) < 0) then
...

I get negative result from OpenFile on Vista (not on XP)


With the following code the return value is greater then 0 on both XP and Vista:
OpenFileMode(FILE_MODE_NORMAL);
if(OpenFile(nvFileHandle, sDir, sFile) < 0) then
...


I no longer need to write to the specific file via Installscript, but maybe some other user searching the forum would like to know how to do..
Thanks anyway MichaelU.
0 Kudos