使用 Inno Setup 安装时应用程序不起作用 [英] Application does not work when installed with Inno Setup

查看:66
本文介绍了使用 Inno Setup 安装时应用程序不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发桌面数据库应用程序.使用 rdlc 报告和报告查看器.开发过程中一切正常,reportviewer 显示所有数据都很顺利.我使用 Inno Setup 部署应用程序.但是当我安装应用程序时,reportviewer 没有显示数据.虽然数据已正确插入表中.

I am developing desktop database application. Using rdlc report and reportviewer. Everything was fine in developing process, reportviewer was showing all data smoothly. I deploy app with Inno Setup. But when I install the app, the reportviewer is not showing data. While data is correctly inserted in the tables.

推荐答案

对于工作不正常或完全失败的应用程序,当由 Inno Setup 安装到 Program Files 文件夹时,首先要测试的是尝试手动将应用程序部署到同一文件夹.

For applications that work incorrectly or fail completely, when installed by Inno Setup to Program Files folder, the first thing to test, is to try to deploy the application manually to the same folder.

如果应用程序在手动部署后仍然失败,最常见的问题是应用程序需要用户对应用程序文件夹具有写入权限.由于在现代版本的 Windows 上,用户通常没有对 Program Files 文件夹的写入权限,因此该应用程序无法运行.所以问题通常与Inno Setup无关,而是应用程序本身的问题.

If the application fails even after a manual deployment, the most usual problem is that the application requires a user to have write permissions to application folder. As on modern versions of Windows a user typically does not have write permissions to the Program Files folder, the application does not work. So the problem usually has nothing to do with Inno Setup, but it's a problem of the application itself.

解决问题:

  • The best solution is to redesign the application so that it does not require write permissions to its folder. Windows applications should not require write permissions to their folder. That's against Windows guidelines. The application should write data to a user profile folder (C:UsersusernameAppData) or to a common data folder (C:ProgramData).
  • A dirty workaround is have the installer grant a user(s) write permissions to the installation folder. Do that only, if you cannot get the application fixed (e.g. it's 3rd party application).
    See Inno Setup - How to set permissions of installation folder.
  • Even more gross workaround is to configure the application to be executed with elevated (Administrator) privileges.
    See Inno Setup desktop shortcut (link) which has "Run as administrator" advanced property set or How to set 'Run as administrator' on a file using Inno Setup.
  • Another solution is enabling legacy compatibility mode that makes Windows redirect all application write attempts to a virtual store. See also Application installed with Inno Setup writes files to unknown location instead of its installation folder.

应用程序安装失败的原因还有很多,包括:

There are numerous other possible reasons, why the application might be failing when installed, including:

  • 你省略了一些依赖:

  • You omitted some dependency:

  • DLL 库
  • .NET 程序集
  • .NET 框架
  • Java 运行时环境
  • 其他运行时
  • COM/ActiveX 对象等

应用程序需要一些配置:

The application requires some configuration:

  • 一个文件
  • 一个注册表项[包括 COM/ActiveX 对象注册]
  • 环境变量等

该应用程序并非设计为从名称中包含空格的文件夹 (Program Files) 中执行.

The application is not designed to be executed from a folder that has a space in its name (Program Files).

应用程序被 Windows 文件虚拟化弄糊涂了(虽然不太可能).请参阅使用 Inno Setup 安装的应用程序将文件写入未知位置而不是其安装文件夹.

The application gets confused by Windows File virtualization (though it's unlikely). See Application installed with Inno Setup writes files to unknown location instead of its installation folder.

这篇关于使用 Inno Setup 安装时应用程序不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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