.Net Windows服务和InstallState文件-确实需要吗? [英] .Net Windows Services and InstallState file - is it really needed?

查看:44
本文介绍了.Net Windows服务和InstallState文件-确实需要吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有许多托管代码的Windows服务,我们使用Frameworks InstallUtil工具将其安装到服务控制管理器中.此工具在安装时创建一个扩展名为.InstallState的新文件.我已经尝试删除此文件,但是卸载后仍然可以正常工作.

I've got a number of managed code Windows Services for which we use the Frameworks InstallUtil tool to install into the service control manager. This tool creates a new file at install time with an extension of .InstallState. I have experimented with deleting this file and an uninstall still works fine afterwards.

所以我的问题是,该文件的用途是什么?有什么理由我不应该删除它?

So my questions is, what is this file for and is there any reason I shouldn't delete it?

修改5/3/10:是吗?没有人知道此文件的价值是什么?

推荐答案

在VS.NET中,您可以为您的msi项目定义一个自定义对话框,我正在使用这样的对话框来询问SQL Server地址和凭据,即msi将文本框中的所有信息存储到InstallState文件中.卸载服务后,它将从InstallState文件中读取值,并删除在安装阶段创建的数据库.在我的情况下,必须安装InstallState文件,因为如果在安装后删除该文件,则卸载将失败.

In VS.NET you can define a custom dialog for your msi project, I am using such a dialog to ask for the SQL Server address and credentials, the msi stores all the info from the textboxes into InstallState file. When the service is uninstalled it will read the values from InstallState file and will drop the database created in the install phase. In my case InstallState file is a must because the uninstall will fail if the file was deleted after install.

这篇关于.Net Windows服务和InstallState文件-确实需要吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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