如何让我的安装程序应用程序在Windows上正常运行? [英] How do I get my Installer Application to behave correctly with Windows?

查看:320
本文介绍了如何让我的安装程序应用程序在Windows上正常运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Delphi中做了一个简单的安装程序,没什么好奇的。基本上我将文件包含到Exe中,然后将其解压缩到用户指定的路径。



然而,我偶然遇到一个问题,我注意到这与任何Windows可执行文件如果安装程序是安装程序,则无关紧要。



如果Exe被命名,或者在文件名中包含以下单词,则安装程序,构建 ,安装,也可能是其他,然后..每当应用程序运行和关闭,Windows弹出一个产品兼容性助手对话框,说应用程序可能没有正确安装。



这是一个问题,即使我的安装程序中的文件实际上已经提取,在我看来,安装程序已经完成了工作,Windows正在抱怨。



我唯一的想法是,Windows必须在执行时检查应用程序的文件名,并在这种情况下将其标识为安装程序。 Windows必须然后在系统上设置一个标志或某些东西,然后我的安装程序必须更新此标志才能说安装成功?



Windows不会抱怨这个当从IDE调试时,所以它不能与代码相关,它必须是操作系统 - 这只会在从Windows而不是Delphi启动应用程序时发生。



您可以尝试这很容易,创建一个应用程序或重命名为一个Setup.exe,运行它,然后关闭它 - 等待几秒钟,产品兼容性助理对话框将显示。



我不知道从哪里开始调查如何停止此对话,或者设置可能告诉Windows安装程序已正确完成。



欣赏您的想法和解决方案谢谢。

解决方案

如果我记得正确,当您的安装应用程序不包含应用程序清单时,会发生这种情况。当引入UAC时,MS引入了安装程序的启发式检测,并显示了UAC标高对话框。启发式检查名称,如setup.exe,install.exe。简单的解决方案是包含应用程序清单。如果是安装程序,您可能希望使用 requireAdministrator 设置。



该功能称为安装程序检测和在此讨论此处



对于什么是值得的,我将始终使用像InnoSetup这样的专用安装工具来构建一个安装程序。


I have made a simple installer application in Delphi, nothing fancy. Basically I include files into the Exe, and then extract them to a user specified path.

I stumbled across a problem however, and I have noticed this works with ANY Windows Executable, it does not matter if it is an installer or not.

If an Exe is named, or contains the following words in the filename, "Setup", "Build", "Install" and maybe others, then.. whenever the Application is run and closed, Windows pops up a Product Compatibility Assistant dialog, saying the Application may not have installed correctly.

This is a problem, as even though the Files from my installer have actually extracted, and in my eyes the installer has done its job, Windows is complaining about it.

The only idea I have regarding this, is that Windows must check the filename of the Applications when executed, and in this case has identified it as an Installer. Windows must of then set a flag or something on the System, my Installer must then update this flag to say that the installation was a success?

Windows does not complain about this when debugging from the IDE, so it cannot be code related, it must be the OS - this only happens when launching the Application from Windows, not Delphi.

You can try this easily, either create an Application or rename one as Setup.exe, Run it and then close it - wait a few seconds and the Product Compatibility Assistant Dialog will show.

I don't know where to start investigating how to stop this dialog, or where a setting may be to tell Windows the Installer was completed correctly.

Appreciate your thoughts and solutions thanks.

解决方案

If I recall correctly, this happens when your install app does not include an application manifest. When UAC was introduced, MS introduced a heuristic detection for installers and shows the UAC elevation dialog. The heuristic checks for names like setup.exe, install.exe. The simple solution is to include an application manifest. If it is an installer you probably want to use the requireAdministrator setting.

The feature is known as Installer Detection and is discussed here.

For what it is worth, I would always build an installer with a dedicated install tool like InnoSetup for example.

这篇关于如何让我的安装程序应用程序在Windows上正常运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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