安装服务后安装文件夹下面会生成一个*.InstallState文件

badiku 2010-12-22 03:42:47
建了个c#服务,安装时添加了自定义操作后在安装文件夹下面会生成一个*.InstallState文件,为啥呢?

http://topic.csdn.net/u/20080412/18/3FEC3D2B-0414-49F5-8FB9-BB908932C5E2.html这个好像问过但也没说清
...全文
496 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
badiku 2010-12-22
  • 打赏
  • 举报
回复
I have an MSI file that I have created using a Visual Studio Setup Project. The installed generates an .InstallState file in the application directory. Is there a way to have this file generated in a different location rather than the default location?

难道这个文件是必须的?以前没见过



This should also work by specifying /InstallStateDir="c:\myfolder" from the commandline (see KB946503). However, InstallContext is converting all parameter names to lowercase which breaks the following code from AssemblyInstaller, expecting to find the mixed case parameter name:

private string GetInstallStatePath(string assemblyPath)
{
string str2 = base.Context.Parameters["InstallStateDir"];
assemblyPath = Path.ChangeExtension(assemblyPath, ".InstallState");
if (!string.IsNullOrEmpty(str2))
{
return Path.Combine(str2, Path.GetFileName(assemblyPath));
}
return assemblyPath;
}

Setting Context["InstallStateDir"] would possibly work for saving the state; however, as the state is loaded before Uninstall can modify the context, this is no viable solution until Microsoft fixes the above AssemblyInstaller.GetInstallStatePath method.
badiku 2010-12-22
  • 打赏
  • 举报
回复
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schems.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap

打开看都是些奇怪的东西

111,077

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧