BUT when the program runs and tries to open one of the files in the Sample Files directory, no matter which directory it is, I get the same error message: errno 2, "File not found." But it's there. I can see it in Windows File Explorer.
What is wrong?
How do I fix this so that the executable can open the sample files that were created during installation?
I ask here because it seems like ANYONE who uses Inno Setup would have the same problem.Where else would I ask?
On Friday, January 7, 2022, 17:38:05, Bill Stewart wrote:
Keep in mind: 32-bit applications on 64-bit Windows run in the WoW (Windows on Windows) 32-bit emulator, and this can often cause confusion regarding finding of files in redirected file system locations.
WoW64 filesystem redirection only affects specific directories inside Windows directory, not anything else on the disk (Registry redirection is slightly more annoying, since it affects the whole HKLM\Software tree).
On Friday, January 7, 2022, 18:50:27, 'Colleen Kobe' via innosetup wrote:
So yes, since Inno Setup is working great for me, I shouldn't be asking here how to modify my install so that it works. But I have no idea where else to start.
Start by copying the program manually to a different computer (preferably a VM, since it's easier to roll back to a clean state), and if that works, replicate what you did manually inside Inno. If it doesn't, figure out why.
When accessing files in %PROGRAMDATA%, %APPDATA% and %LOCALAPPDATA%, also ensure you're using WinAPI to get the location of these directories, since their names and locations may differ depending on Windows version. Another thing you should pay attention to is to never install anything inside user profile directory (and of the {user*} constants in Inno), because the user installing the program may not be the user running it (at the same time, your program should not attempt to write anywhere outside the user profile, unless the user is specifically saving a file there, since regular programs usually won't have write permissions there).
WoW64 filesystem redirection only affects specific directories inside Windows directory, not anything else on the disk (Registry redirection is slightly more annoying, since it affects the whole HKLM\Software tree).