告诉setup.exe是否首次运行 [英] tell setup.exe if its first run or not

查看:110
本文介绍了告诉setup.exe是否首次运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以告诉setup.exe文件在安装过程中检查其是否首次运行?我正在使用Visual Studio 2010创建安装文件.

is there a way to tell setup.exe file to check if its first run or not during installation ? I am using visual studio 2010 to create setups files.

推荐答案

一种方法是检查是否存在由安装文件在其首次创建时创建的注册表参数.运行.

例如:
假设您的setup.exe首次运行.它检查注册表参数"HKLM \ Software \ MySoftware \ Installed"是否存在.如果不存在,则它是第一次运行,setup.exe会在安装的最后一步中创建此注册表参数.现在,当setup.exe第二次运行时,它会检查此注册表参数,因为setup.exe在首次运行时已创建了此注册表参数,所以它会出现.
One way is to check if there is any registry parameter present which is created by the setup file during its first run.

for example:
Let say your setup.exe runs for the first time. It check if registry parameter "HKLM\Software\MySoftware\Installed" is present or not. If not present then it is its first run and setup.exe creates this registry parameter as a last step of installation. Now when setup.exe runs for the second time it checks this registry parameter, it will be present as setup.exe has created this registry parameter during its first run.


问题是当我尝试将安装文件运行到另一台机器上...
the problem is when i try to run the setup file into another machine...


这篇关于告诉setup.exe是否首次运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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