Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 自定义VS 2008安装项目卸载程序_.net_Setup Project_Uninstallation - Fatal编程技术网

.net 自定义VS 2008安装项目卸载程序

.net 自定义VS 2008安装项目卸载程序,.net,setup-project,uninstallation,.net,Setup Project,Uninstallation,我有一个.NET应用程序的安装项目,安装/卸载都可以正常工作,如果它们在工作时不受影响的话 但是,如果有人在卸载过程中取消卸载,回滚似乎没有得到正确处理,并且在稍后再次尝试卸载时,用户会收到一个空引用异常 我只想简化一下情况;我想删除用户取消正在进行的卸载的功能。这能做到吗 谢谢, -Ben是的,这是可能的。MSDN清单;但是,只修补VisualStudio创建的MSI文件可能更简单。这可以使用Orca完成(您可以在Windows SDK文件夹中找到此工具的安装程序,通常位于C:\Program

我有一个.NET应用程序的安装项目,安装/卸载都可以正常工作,如果它们在工作时不受影响的话

但是,如果有人在卸载过程中取消卸载,回滚似乎没有得到正确处理,并且在稍后再次尝试卸载时,用户会收到一个空引用异常

我只想简化一下情况;我想删除用户取消正在进行的卸载的功能。这能做到吗

谢谢,
-Ben是的,这是可能的。MSDN清单;但是,只修补VisualStudio创建的MSI文件可能更简单。这可以使用Orca完成(您可以在Windows SDK文件夹中找到此工具的安装程序,通常位于C:\Program Files\Microsoft SDK\Windows\v6.0A\Bin\Orca.msi下)

Orca允许您编辑MSI数据库表。要隐藏“取消”按钮,您必须向ControlCondition表中添加一条记录(从):

使用Orca添加记录的手动任务最好使用以下短VBScript完成:

Set oMsi = CreateObject("WindowsInstaller.Installer")

' get path to msi from command line
strMsiFullPath = Wscript.Arguments(0)
' open transacted
Set oDB = oMsi.OpenDatabase(strMsiFullPath , 1)

' insert a record into the [ControlCondition][3] table
Set oView = oDB.OpenView("INSERT INTO `ControlCondition` " & _
    "(`ControlCondition`.`Dialog_`, `ControlCondition`.`Control_`," & _
     "`ControlCondition`.`Action`, `ControlCondition`.`Condition`) " & _
     "VALUES ('ProgressForm', 'CancelButton', 'Hide', '1')")

' clean up
oView.Execute: oView.Close: oDB.Commit
Set oMsi = Nothing
此脚本可以作为生成后步骤添加到安装项目中(请注意,输出路径的Visual Studio变量中存在键入错误):


是的,这是可能的。MSDN清单;但是,只修补VisualStudio创建的MSI文件可能更简单。这可以使用Orca完成(您可以在Windows SDK文件夹中找到此工具的安装程序,通常位于C:\Program Files\Microsoft SDK\Windows\v6.0A\Bin\Orca.msi下)

Orca允许您编辑MSI数据库表。要隐藏“取消”按钮,您必须向ControlCondition表中添加一条记录(从):

使用Orca添加记录的手动任务最好使用以下短VBScript完成:

Set oMsi = CreateObject("WindowsInstaller.Installer")

' get path to msi from command line
strMsiFullPath = Wscript.Arguments(0)
' open transacted
Set oDB = oMsi.OpenDatabase(strMsiFullPath , 1)

' insert a record into the [ControlCondition][3] table
Set oView = oDB.OpenView("INSERT INTO `ControlCondition` " & _
    "(`ControlCondition`.`Dialog_`, `ControlCondition`.`Control_`," & _
     "`ControlCondition`.`Action`, `ControlCondition`.`Condition`) " & _
     "VALUES ('ProgressForm', 'CancelButton', 'Hide', '1')")

' clean up
oView.Execute: oView.Close: oDB.Commit
Set oMsi = Nothing
此脚本可以作为生成后步骤添加到安装项目中(请注意,输出路径的Visual Studio变量中存在键入错误):


回答得好。你为我指明了正确的方向。遗憾的是,“ProgressForm”不是在卸载过程中显示进度的对话框。事实上,我浏览了对话框表中的所有对话框,并在标题中添加了数字,这样我就可以追踪到这个对话框了,一点运气都没有。我的猜测是,使用ControlCondition表无法编辑卸载进度对话框。尽管如此,我还是很感激这个答案,因为它为我提供了很多定制的可能性。谢谢:)回答得好。你为我指明了正确的方向。遗憾的是,“ProgressForm”不是在卸载过程中显示进度的对话框。事实上,我浏览了对话框表中的所有对话框,并在标题中添加了数字,这样我就可以追踪到这个对话框了,一点运气都没有。我的猜测是,使用ControlCondition表无法编辑卸载进度对话框。尽管如此,我还是很感激这个答案,因为它为我提供了很多定制的可能性。谢谢:)
cscript $(ProjectDir)patch.vbs $(BuiltOuputPath)