Why does my Delphi application say a file exists that is not there? [duplicate]












2
















This question already has an answer here:




  • Why do files get placed in “C:Users<username>AppDataLocalVirtualStoreProgram Files(x86)”?

    2 answers




I have the following 32bit Delphi project source:



program TestApp;

uses
SysUtils, Dialogs, Windows;

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


When I run it, both the Windows API FindFirst call and the FileExists call return True, even though the file does not exist in that directory.



Why is it claiming a file is there when it is not?










share|improve this question















marked as duplicate by David Heffernan delphi
Users with the  delphi badge can single-handedly close delphi questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 22:48


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Note that though this has been marked as a duplicate of the another question, that question actually assumes you know the answer BEFORE you ask the question.

    – jep
    Dec 3 '18 at 14:20
















2
















This question already has an answer here:




  • Why do files get placed in “C:Users<username>AppDataLocalVirtualStoreProgram Files(x86)”?

    2 answers




I have the following 32bit Delphi project source:



program TestApp;

uses
SysUtils, Dialogs, Windows;

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


When I run it, both the Windows API FindFirst call and the FileExists call return True, even though the file does not exist in that directory.



Why is it claiming a file is there when it is not?










share|improve this question















marked as duplicate by David Heffernan delphi
Users with the  delphi badge can single-handedly close delphi questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 22:48


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Note that though this has been marked as a duplicate of the another question, that question actually assumes you know the answer BEFORE you ask the question.

    – jep
    Dec 3 '18 at 14:20














2












2








2









This question already has an answer here:




  • Why do files get placed in “C:Users<username>AppDataLocalVirtualStoreProgram Files(x86)”?

    2 answers




I have the following 32bit Delphi project source:



program TestApp;

uses
SysUtils, Dialogs, Windows;

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


When I run it, both the Windows API FindFirst call and the FileExists call return True, even though the file does not exist in that directory.



Why is it claiming a file is there when it is not?










share|improve this question

















This question already has an answer here:




  • Why do files get placed in “C:Users<username>AppDataLocalVirtualStoreProgram Files(x86)”?

    2 answers




I have the following 32bit Delphi project source:



program TestApp;

uses
SysUtils, Dialogs, Windows;

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


When I run it, both the Windows API FindFirst call and the FileExists call return True, even though the file does not exist in that directory.



Why is it claiming a file is there when it is not?





This question already has an answer here:




  • Why do files get placed in “C:Users<username>AppDataLocalVirtualStoreProgram Files(x86)”?

    2 answers








windows delphi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 28 '18 at 14:34







jep

















asked Nov 27 '18 at 22:05









jepjep

427222




427222




marked as duplicate by David Heffernan delphi
Users with the  delphi badge can single-handedly close delphi questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 22:48


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by David Heffernan delphi
Users with the  delphi badge can single-handedly close delphi questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 22:48


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Note that though this has been marked as a duplicate of the another question, that question actually assumes you know the answer BEFORE you ask the question.

    – jep
    Dec 3 '18 at 14:20



















  • Note that though this has been marked as a duplicate of the another question, that question actually assumes you know the answer BEFORE you ask the question.

    – jep
    Dec 3 '18 at 14:20

















Note that though this has been marked as a duplicate of the another question, that question actually assumes you know the answer BEFORE you ask the question.

– jep
Dec 3 '18 at 14:20





Note that though this has been marked as a duplicate of the another question, that question actually assumes you know the answer BEFORE you ask the question.

– jep
Dec 3 '18 at 14:20












1 Answer
1






active

oldest

votes


















3














The file exists in the VirtualStore directory located in



C:Users{username}AppDataLocalVirtualStoreProgram Files (x86)


This is a feature called UAC Virtualization first introduced in Windows Vista. It allows applications to write to restricted directories that they otherwise have no permissions to. When a 32 bit application with UAC Virtualization enabled writes to the real directory and would receive an access denied result, Windows instead creates a copy of the file in the VirtualStore .



When this application or another 32 bit application with UAC Virtualization enabled tries to read from the file, it will first check the VirtualStore for the file. You can see that UAC Virtualization is Enabled by adding this column in Task Manager.



This happens in a Delphi program when you remove the {$R *.res} directive. If you change the project source to add the {$R *.res} directive back in



program TestApp;

uses
SysUtils, Dialogs, Windows;

{$R *.res}

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


it will recognize your app as having UAC Virtualization disabled (as is the norm for most applications). You can see that in Task Manager, and the results of the file finding operations will be what you expect.



The reason why leaving out the .RES file causes this is that it includes a manifest. The following line in this manifest disables UAC Virtualization:



<requestedExecutionLevel level="asInvoker" uiAccess="false"/>



When level is omitted, UAC Virtualization is enabled.






share|improve this answer





















  • 1





    This can't be discerned from the question that was asked. It's also a rather tired subject. UAC is 13 years old now. Surely we don't need more posts on the subject. Let's see if I can find some dupes.

    – David Heffernan
    Nov 27 '18 at 22:47











  • Well, that's a shame. I basically lost a day to this issue. The problem isn't that there's another question about UAC VIrtualization, it's that if you make the mistake of removing the {$R *.res} line in Delphi, you wind up with this very opaque problem. It's a very easy trap to stumble into but difficult to find the right answer. Had this Q & A been here, it would have been quite easy for me to have found the answer and saved most of my day. So I was attempting to pay it forward.

    – jep
    Nov 28 '18 at 5:39











  • Thanks. Nevertheless, probably because you already know the solution, the question came out to be vague - which indeed you cant discern this answer from. With so many copy/paste errors (!) seen on the site, it's not very clear that the directive is missing. It's not even clear if the code is 32 bit or not. Normally to find a solution for such a question, a fair amount of question/answer game is played in comments.

    – Sertac Akyuz
    Nov 28 '18 at 12:31











  • I'm surprised it's not clear that the directive is missing, as I stated that right before the second block of code. I can touch that up to make it even clearer. The question was pretty specific in that this was the behavior being seen. I had a Delphi app claiming a file was there that was not. I found this baffling, as I had never heard of UAC Virtualization. Neither had the other lead programmer. Both of us have been coding for Delphi for 20 years. It's just not something that comes up because in most cases the user doesn't write to the Program Files directory.

    – jep
    Nov 28 '18 at 14:31











  • But in this case, we're required by our client to do so. And we didn't notice it while testing on the client because they had those permission set up to allow the right. It only happened on a developers machine because they had normally set up permissions. So they ran the app and it checked for a file existing and created it when it didn't. But the OTHER app that depended on that file being there failed, because it wasn't using UAC Virtualization. I will also add in the description that it was 32bit. But without knowing the answer first, that bit doesn't make much sense to someone asking.

    – jep
    Nov 28 '18 at 14:33


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














The file exists in the VirtualStore directory located in



C:Users{username}AppDataLocalVirtualStoreProgram Files (x86)


This is a feature called UAC Virtualization first introduced in Windows Vista. It allows applications to write to restricted directories that they otherwise have no permissions to. When a 32 bit application with UAC Virtualization enabled writes to the real directory and would receive an access denied result, Windows instead creates a copy of the file in the VirtualStore .



When this application or another 32 bit application with UAC Virtualization enabled tries to read from the file, it will first check the VirtualStore for the file. You can see that UAC Virtualization is Enabled by adding this column in Task Manager.



This happens in a Delphi program when you remove the {$R *.res} directive. If you change the project source to add the {$R *.res} directive back in



program TestApp;

uses
SysUtils, Dialogs, Windows;

{$R *.res}

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


it will recognize your app as having UAC Virtualization disabled (as is the norm for most applications). You can see that in Task Manager, and the results of the file finding operations will be what you expect.



The reason why leaving out the .RES file causes this is that it includes a manifest. The following line in this manifest disables UAC Virtualization:



<requestedExecutionLevel level="asInvoker" uiAccess="false"/>



When level is omitted, UAC Virtualization is enabled.






share|improve this answer





















  • 1





    This can't be discerned from the question that was asked. It's also a rather tired subject. UAC is 13 years old now. Surely we don't need more posts on the subject. Let's see if I can find some dupes.

    – David Heffernan
    Nov 27 '18 at 22:47











  • Well, that's a shame. I basically lost a day to this issue. The problem isn't that there's another question about UAC VIrtualization, it's that if you make the mistake of removing the {$R *.res} line in Delphi, you wind up with this very opaque problem. It's a very easy trap to stumble into but difficult to find the right answer. Had this Q & A been here, it would have been quite easy for me to have found the answer and saved most of my day. So I was attempting to pay it forward.

    – jep
    Nov 28 '18 at 5:39











  • Thanks. Nevertheless, probably because you already know the solution, the question came out to be vague - which indeed you cant discern this answer from. With so many copy/paste errors (!) seen on the site, it's not very clear that the directive is missing. It's not even clear if the code is 32 bit or not. Normally to find a solution for such a question, a fair amount of question/answer game is played in comments.

    – Sertac Akyuz
    Nov 28 '18 at 12:31











  • I'm surprised it's not clear that the directive is missing, as I stated that right before the second block of code. I can touch that up to make it even clearer. The question was pretty specific in that this was the behavior being seen. I had a Delphi app claiming a file was there that was not. I found this baffling, as I had never heard of UAC Virtualization. Neither had the other lead programmer. Both of us have been coding for Delphi for 20 years. It's just not something that comes up because in most cases the user doesn't write to the Program Files directory.

    – jep
    Nov 28 '18 at 14:31











  • But in this case, we're required by our client to do so. And we didn't notice it while testing on the client because they had those permission set up to allow the right. It only happened on a developers machine because they had normally set up permissions. So they ran the app and it checked for a file existing and created it when it didn't. But the OTHER app that depended on that file being there failed, because it wasn't using UAC Virtualization. I will also add in the description that it was 32bit. But without knowing the answer first, that bit doesn't make much sense to someone asking.

    – jep
    Nov 28 '18 at 14:33
















3














The file exists in the VirtualStore directory located in



C:Users{username}AppDataLocalVirtualStoreProgram Files (x86)


This is a feature called UAC Virtualization first introduced in Windows Vista. It allows applications to write to restricted directories that they otherwise have no permissions to. When a 32 bit application with UAC Virtualization enabled writes to the real directory and would receive an access denied result, Windows instead creates a copy of the file in the VirtualStore .



When this application or another 32 bit application with UAC Virtualization enabled tries to read from the file, it will first check the VirtualStore for the file. You can see that UAC Virtualization is Enabled by adding this column in Task Manager.



This happens in a Delphi program when you remove the {$R *.res} directive. If you change the project source to add the {$R *.res} directive back in



program TestApp;

uses
SysUtils, Dialogs, Windows;

{$R *.res}

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


it will recognize your app as having UAC Virtualization disabled (as is the norm for most applications). You can see that in Task Manager, and the results of the file finding operations will be what you expect.



The reason why leaving out the .RES file causes this is that it includes a manifest. The following line in this manifest disables UAC Virtualization:



<requestedExecutionLevel level="asInvoker" uiAccess="false"/>



When level is omitted, UAC Virtualization is enabled.






share|improve this answer





















  • 1





    This can't be discerned from the question that was asked. It's also a rather tired subject. UAC is 13 years old now. Surely we don't need more posts on the subject. Let's see if I can find some dupes.

    – David Heffernan
    Nov 27 '18 at 22:47











  • Well, that's a shame. I basically lost a day to this issue. The problem isn't that there's another question about UAC VIrtualization, it's that if you make the mistake of removing the {$R *.res} line in Delphi, you wind up with this very opaque problem. It's a very easy trap to stumble into but difficult to find the right answer. Had this Q & A been here, it would have been quite easy for me to have found the answer and saved most of my day. So I was attempting to pay it forward.

    – jep
    Nov 28 '18 at 5:39











  • Thanks. Nevertheless, probably because you already know the solution, the question came out to be vague - which indeed you cant discern this answer from. With so many copy/paste errors (!) seen on the site, it's not very clear that the directive is missing. It's not even clear if the code is 32 bit or not. Normally to find a solution for such a question, a fair amount of question/answer game is played in comments.

    – Sertac Akyuz
    Nov 28 '18 at 12:31











  • I'm surprised it's not clear that the directive is missing, as I stated that right before the second block of code. I can touch that up to make it even clearer. The question was pretty specific in that this was the behavior being seen. I had a Delphi app claiming a file was there that was not. I found this baffling, as I had never heard of UAC Virtualization. Neither had the other lead programmer. Both of us have been coding for Delphi for 20 years. It's just not something that comes up because in most cases the user doesn't write to the Program Files directory.

    – jep
    Nov 28 '18 at 14:31











  • But in this case, we're required by our client to do so. And we didn't notice it while testing on the client because they had those permission set up to allow the right. It only happened on a developers machine because they had normally set up permissions. So they ran the app and it checked for a file existing and created it when it didn't. But the OTHER app that depended on that file being there failed, because it wasn't using UAC Virtualization. I will also add in the description that it was 32bit. But without knowing the answer first, that bit doesn't make much sense to someone asking.

    – jep
    Nov 28 '18 at 14:33














3












3








3







The file exists in the VirtualStore directory located in



C:Users{username}AppDataLocalVirtualStoreProgram Files (x86)


This is a feature called UAC Virtualization first introduced in Windows Vista. It allows applications to write to restricted directories that they otherwise have no permissions to. When a 32 bit application with UAC Virtualization enabled writes to the real directory and would receive an access denied result, Windows instead creates a copy of the file in the VirtualStore .



When this application or another 32 bit application with UAC Virtualization enabled tries to read from the file, it will first check the VirtualStore for the file. You can see that UAC Virtualization is Enabled by adding this column in Task Manager.



This happens in a Delphi program when you remove the {$R *.res} directive. If you change the project source to add the {$R *.res} directive back in



program TestApp;

uses
SysUtils, Dialogs, Windows;

{$R *.res}

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


it will recognize your app as having UAC Virtualization disabled (as is the norm for most applications). You can see that in Task Manager, and the results of the file finding operations will be what you expect.



The reason why leaving out the .RES file causes this is that it includes a manifest. The following line in this manifest disables UAC Virtualization:



<requestedExecutionLevel level="asInvoker" uiAccess="false"/>



When level is omitted, UAC Virtualization is enabled.






share|improve this answer















The file exists in the VirtualStore directory located in



C:Users{username}AppDataLocalVirtualStoreProgram Files (x86)


This is a feature called UAC Virtualization first introduced in Windows Vista. It allows applications to write to restricted directories that they otherwise have no permissions to. When a 32 bit application with UAC Virtualization enabled writes to the real directory and would receive an access denied result, Windows instead creates a copy of the file in the VirtualStore .



When this application or another 32 bit application with UAC Virtualization enabled tries to read from the file, it will first check the VirtualStore for the file. You can see that UAC Virtualization is Enabled by adding this column in Task Manager.



This happens in a Delphi program when you remove the {$R *.res} directive. If you change the project source to add the {$R *.res} directive back in



program TestApp;

uses
SysUtils, Dialogs, Windows;

{$R *.res}

var
filename: String = 'C:Program Files (x86)Some Applicationfoo.txt';
fd: TWIN32FindData;
h: THandle;

begin
FillChar(fd, SizeOf(fd), 0);
h := FindFirstFile(PChar(filename), fd);
if h = INVALID_HANDLE_VALUE then
ShowMessage('FindFirstFile=false')
else
begin
ShowMessage('FindFirstFile=true');
FindClose(h);
end;

if FileExists(filename) then
ShowMessage('FileExists=true')
else
ShowMessage('FileExists=false');
end.


it will recognize your app as having UAC Virtualization disabled (as is the norm for most applications). You can see that in Task Manager, and the results of the file finding operations will be what you expect.



The reason why leaving out the .RES file causes this is that it includes a manifest. The following line in this manifest disables UAC Virtualization:



<requestedExecutionLevel level="asInvoker" uiAccess="false"/>



When level is omitted, UAC Virtualization is enabled.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 28 '18 at 14:34

























answered Nov 27 '18 at 22:05









jepjep

427222




427222








  • 1





    This can't be discerned from the question that was asked. It's also a rather tired subject. UAC is 13 years old now. Surely we don't need more posts on the subject. Let's see if I can find some dupes.

    – David Heffernan
    Nov 27 '18 at 22:47











  • Well, that's a shame. I basically lost a day to this issue. The problem isn't that there's another question about UAC VIrtualization, it's that if you make the mistake of removing the {$R *.res} line in Delphi, you wind up with this very opaque problem. It's a very easy trap to stumble into but difficult to find the right answer. Had this Q & A been here, it would have been quite easy for me to have found the answer and saved most of my day. So I was attempting to pay it forward.

    – jep
    Nov 28 '18 at 5:39











  • Thanks. Nevertheless, probably because you already know the solution, the question came out to be vague - which indeed you cant discern this answer from. With so many copy/paste errors (!) seen on the site, it's not very clear that the directive is missing. It's not even clear if the code is 32 bit or not. Normally to find a solution for such a question, a fair amount of question/answer game is played in comments.

    – Sertac Akyuz
    Nov 28 '18 at 12:31











  • I'm surprised it's not clear that the directive is missing, as I stated that right before the second block of code. I can touch that up to make it even clearer. The question was pretty specific in that this was the behavior being seen. I had a Delphi app claiming a file was there that was not. I found this baffling, as I had never heard of UAC Virtualization. Neither had the other lead programmer. Both of us have been coding for Delphi for 20 years. It's just not something that comes up because in most cases the user doesn't write to the Program Files directory.

    – jep
    Nov 28 '18 at 14:31











  • But in this case, we're required by our client to do so. And we didn't notice it while testing on the client because they had those permission set up to allow the right. It only happened on a developers machine because they had normally set up permissions. So they ran the app and it checked for a file existing and created it when it didn't. But the OTHER app that depended on that file being there failed, because it wasn't using UAC Virtualization. I will also add in the description that it was 32bit. But without knowing the answer first, that bit doesn't make much sense to someone asking.

    – jep
    Nov 28 '18 at 14:33














  • 1





    This can't be discerned from the question that was asked. It's also a rather tired subject. UAC is 13 years old now. Surely we don't need more posts on the subject. Let's see if I can find some dupes.

    – David Heffernan
    Nov 27 '18 at 22:47











  • Well, that's a shame. I basically lost a day to this issue. The problem isn't that there's another question about UAC VIrtualization, it's that if you make the mistake of removing the {$R *.res} line in Delphi, you wind up with this very opaque problem. It's a very easy trap to stumble into but difficult to find the right answer. Had this Q & A been here, it would have been quite easy for me to have found the answer and saved most of my day. So I was attempting to pay it forward.

    – jep
    Nov 28 '18 at 5:39











  • Thanks. Nevertheless, probably because you already know the solution, the question came out to be vague - which indeed you cant discern this answer from. With so many copy/paste errors (!) seen on the site, it's not very clear that the directive is missing. It's not even clear if the code is 32 bit or not. Normally to find a solution for such a question, a fair amount of question/answer game is played in comments.

    – Sertac Akyuz
    Nov 28 '18 at 12:31











  • I'm surprised it's not clear that the directive is missing, as I stated that right before the second block of code. I can touch that up to make it even clearer. The question was pretty specific in that this was the behavior being seen. I had a Delphi app claiming a file was there that was not. I found this baffling, as I had never heard of UAC Virtualization. Neither had the other lead programmer. Both of us have been coding for Delphi for 20 years. It's just not something that comes up because in most cases the user doesn't write to the Program Files directory.

    – jep
    Nov 28 '18 at 14:31











  • But in this case, we're required by our client to do so. And we didn't notice it while testing on the client because they had those permission set up to allow the right. It only happened on a developers machine because they had normally set up permissions. So they ran the app and it checked for a file existing and created it when it didn't. But the OTHER app that depended on that file being there failed, because it wasn't using UAC Virtualization. I will also add in the description that it was 32bit. But without knowing the answer first, that bit doesn't make much sense to someone asking.

    – jep
    Nov 28 '18 at 14:33








1




1





This can't be discerned from the question that was asked. It's also a rather tired subject. UAC is 13 years old now. Surely we don't need more posts on the subject. Let's see if I can find some dupes.

– David Heffernan
Nov 27 '18 at 22:47





This can't be discerned from the question that was asked. It's also a rather tired subject. UAC is 13 years old now. Surely we don't need more posts on the subject. Let's see if I can find some dupes.

– David Heffernan
Nov 27 '18 at 22:47













Well, that's a shame. I basically lost a day to this issue. The problem isn't that there's another question about UAC VIrtualization, it's that if you make the mistake of removing the {$R *.res} line in Delphi, you wind up with this very opaque problem. It's a very easy trap to stumble into but difficult to find the right answer. Had this Q & A been here, it would have been quite easy for me to have found the answer and saved most of my day. So I was attempting to pay it forward.

– jep
Nov 28 '18 at 5:39





Well, that's a shame. I basically lost a day to this issue. The problem isn't that there's another question about UAC VIrtualization, it's that if you make the mistake of removing the {$R *.res} line in Delphi, you wind up with this very opaque problem. It's a very easy trap to stumble into but difficult to find the right answer. Had this Q & A been here, it would have been quite easy for me to have found the answer and saved most of my day. So I was attempting to pay it forward.

– jep
Nov 28 '18 at 5:39













Thanks. Nevertheless, probably because you already know the solution, the question came out to be vague - which indeed you cant discern this answer from. With so many copy/paste errors (!) seen on the site, it's not very clear that the directive is missing. It's not even clear if the code is 32 bit or not. Normally to find a solution for such a question, a fair amount of question/answer game is played in comments.

– Sertac Akyuz
Nov 28 '18 at 12:31





Thanks. Nevertheless, probably because you already know the solution, the question came out to be vague - which indeed you cant discern this answer from. With so many copy/paste errors (!) seen on the site, it's not very clear that the directive is missing. It's not even clear if the code is 32 bit or not. Normally to find a solution for such a question, a fair amount of question/answer game is played in comments.

– Sertac Akyuz
Nov 28 '18 at 12:31













I'm surprised it's not clear that the directive is missing, as I stated that right before the second block of code. I can touch that up to make it even clearer. The question was pretty specific in that this was the behavior being seen. I had a Delphi app claiming a file was there that was not. I found this baffling, as I had never heard of UAC Virtualization. Neither had the other lead programmer. Both of us have been coding for Delphi for 20 years. It's just not something that comes up because in most cases the user doesn't write to the Program Files directory.

– jep
Nov 28 '18 at 14:31





I'm surprised it's not clear that the directive is missing, as I stated that right before the second block of code. I can touch that up to make it even clearer. The question was pretty specific in that this was the behavior being seen. I had a Delphi app claiming a file was there that was not. I found this baffling, as I had never heard of UAC Virtualization. Neither had the other lead programmer. Both of us have been coding for Delphi for 20 years. It's just not something that comes up because in most cases the user doesn't write to the Program Files directory.

– jep
Nov 28 '18 at 14:31













But in this case, we're required by our client to do so. And we didn't notice it while testing on the client because they had those permission set up to allow the right. It only happened on a developers machine because they had normally set up permissions. So they ran the app and it checked for a file existing and created it when it didn't. But the OTHER app that depended on that file being there failed, because it wasn't using UAC Virtualization. I will also add in the description that it was 32bit. But without knowing the answer first, that bit doesn't make much sense to someone asking.

– jep
Nov 28 '18 at 14:33





But in this case, we're required by our client to do so. And we didn't notice it while testing on the client because they had those permission set up to allow the right. It only happened on a developers machine because they had normally set up permissions. So they ran the app and it checked for a file existing and created it when it didn't. But the OTHER app that depended on that file being there failed, because it wasn't using UAC Virtualization. I will also add in the description that it was 32bit. But without knowing the answer first, that bit doesn't make much sense to someone asking.

– jep
Nov 28 '18 at 14:33





Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)