在安装我们的应用程序之前了解Windows版本 [英] Know Windows version before installing our application

查看:65
本文介绍了在安装我们的应用程序之前了解Windows版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我已经用C#开发了一个应用程序,并创建了它的安装安装程序和msi.我想在安装前检查Windows版本.我的意思是,如果它的95/98等等,我不希望用户安装,因为我的应用程序不支持那些平台.任何想法在安装应用程序时如何知道平台和位(2000,XP,Vista和32等位)?还必须根据该位执行一个exe文件.

非常感谢您的帮助.

谢谢

Hello,

I have developed an application in C# and created its setup installer and msi. I want to check the windows version before installing. I mean if its 95/98, etc then I don''t want the user to install, as my application doesn''t support those platforms. Any idea how can I know the platform and the bit (2000, XP, Vista, &, etc 32/64 bit) while installing the application ? As also got to execute a exe file based on which bit.

Any help is highly appreciated.

Thanks

推荐答案

除非您编写了仅64位的应用程序,或者同时编写了32位和64位的应用程序版本,否则,架构通常并不重要.如果您完成了上述两项操作中的任何一项,则可以通过以下一种方法进行处理:

0)为您的应用程序创建适当的安装程序,并生成msi文件.

1)创建一个小的32位应用程序,以检测操作系统是否为64位OS.

2)创建一个运行此32位应用程序的32位安装程序.

3)如果您的体系结构检测器检测到32位操作系统,请采取适当的措施(运行32位安装程序或因为您的应用程序仅是64位而拒绝安装).

4)如果您的体系结构检测器检测到64位操作系统,请采取适当的措施(运行64位安装程序).
Unless you''ve either written a 64-bit-only app, or both a 32-bit and 64-buit version of your app, no, architecture doesn''t typically matter. If you did either of those two things, here''s one way to approach it:

0) Create the appropriate installer(s) for your application, and genetare the msi file.

1) Create a small 32-bit application that detects whether or not the OS is a 64-bit OS.

2) Create a 32-bit installer that runs this 32-bit app.

3) If your architecture detector detects a 32-bit OS, take the appropriate action (either run the 32-bit installer or refuse to install because your app is 64-bit only).

4) If your architecture detector detects a 64-bit OS, take the appropriate action (run the 64-bit installer).


您可以使用VersionNT [
You can get the version of the OS using VersionNT[^] Then you need to decide which OS version want to support. If the OS is supported continue, else quit the install.


您无法在安装程序中检查操作系统,因为您的安装程序将无法在Windows 95或Windows 98上运行.在操作系统上,您需要一个正在运行的进程.用户将收到一条消息,提示无法启动安装程序.

祝你好运!

爱德华
You cannot check the operating system in your installer because your installer will not run on Windows 95 or Windows 98. In order to perform checks on the operating system you need a running process. The user will receive a message that the installer could not be started.

Good luck!

Eduard


这篇关于在安装我们的应用程序之前了解Windows版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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