使用Inno Setup安装的应用程序会将文件写入未知位置而不是其安装文件夹 [英] Application installed with Inno Setup writes files to unknown location instead of its installation folder

查看:135
本文介绍了使用Inno Setup安装的应用程序会将文件写入未知位置而不是其安装文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用我的程序的Inno Setup进行设置.

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

我在与.exe相同的文件夹中安装了更多文件XML.安装效果很好,但是当我运行程序并修改XML时,文件保存在另一个位置,而不是.exe的文件夹,我找不到它.我认为该文件存储在PC中,因为该程序可以毫无问题地打开它.

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.

我还尝试使用InstallAware Express 7进行相同的设置,并且效果很好.我认为这不是我的exe的问题,而是Inno Setup中的问题.

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.

谢谢

推荐答案

我认为您是Windows File虚拟化的受害者.

I think you are a victim of Windows File virtualization.

您可能将数据文件安装到Program Files文件夹中.

You probably install data files to Program Files folder.

该文件夹不可写(除非您的程序以提升的特权运行).如果您的程序没有应用程序清单,Windows认为它是旧版应用程序,无法识别其无法写入Program Files并启用文件虚拟化.因此,当您的应用程序尝试写入数据/XML文件时,Windows会将写入(以及将来的读取)重定向到虚拟存储(C:\Users\username\AppData\Local\VirtualStore). Program Files中的实际文件未修改.

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.

很难回答,为什么它可以与InstallAware Express一起使用.如果您在Inno Setup之后尝试过此操作,则结果可能会受到虚拟存储中文件的存在的影响.

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.

无论如何,根本原因是您的应用程序试图将文件写入Program Files中.那是错误的.没有应用程序应写入Program Files.
另请参见通过Inno Setup安装后应用程序无法正常工作.

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.
See also Application does not work when installed with Inno Setup.

这篇关于使用Inno Setup安装的应用程序会将文件写入未知位置而不是其安装文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆