Application installed with Inno Setup writes files

2019-06-01 09:23发布

问题:

I try to make a setup with Inno Setup for my program.

I have installed more file XML in the same folder as the .exe. The install work well, but when I run the program and modify the XML, the file is saved in another place, not the folder of the .exe and I can't find it. I think the file is stored in the PC because the program can open it without problems.

I also try to make the same setup with InstallAware Express 7 and it works well. Io I think it's not a problem in my exe but in Inno Setup.

Thanks

回答1:

I think you are a victim of Windows File virtualization.

You probably install data files to Program Files folder.

That folder is not writable (unless your program runs with elevated privileges). If your program does not have application manifest, Windows considers it a legacy application that is not aware of its inability to write to Program Files and enables file virtualization. So, when your application tries to write the data/XML files, Windows redirects the write (and future reads) to a virtual store (C:\Users\username\AppData\Local\VirtualStore). The actual files in the Program Files are not modified.

It's difficult to answer, why it works with the InstallAware Express. If you tried it after the Inno Setup, the results can be affected by an existence of the file in the virtual store.

Anyway, the root cause is that your application tries to write the files in the Program Files. That's just wrong. No application should write to Program Files.



标签: inno-setup