插入到MSI中的RemoveFile表中 [英] Insert into RemoveFile table in MSI

查看:67
本文介绍了插入到MSI中的RemoveFile表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了自动执行MSI中的某些操作,我一直试图使用JScript插入RemoveFile表中并保持错误状态,并且由于错误描述不多,所以我无法找出查询中的问题以及唯一的错误我在尝试使用csript进行调试时得到的是-2147467259 OpenView,SQL,

In order to automate some actions in MSI I have been trying to insert into RemoveFile table using JScript and keep getting errors and since there is not much error description i am not able to figure out the issue in query and the only error that i get when i try to debug using csript is -2147467259 OpenView,SQL,

这是我要插入到removefile表中的查询,任何人都可以帮我弄清楚这个问题.

This is the query that i am using to insert into removefile table, Can anyone please help me figuring out the issue.

"INSERT INTO `RemoveFile` (`FileKey`, `Component_`, `FileName`, `DirProperty`, `InstallMode`) VALUES (`_142D31F52C744D6FB945F01BA06EEFB3`, `C__931358B017AE83C769F5CB9E95BD2401`, `Product version 2.0.lnk`, `DesktopFolder`, 1)

推荐答案

您是否已在安装程序数据库上打开视图?

Have you opened the view on the installer database?

var installer = WScript.CreateObject("WindowsInstaller.Installer");
var database = installer.OpenDatabase(<your-product.msi>,
                                      msiOpenDatabaseModeTransact);

sql = "INSERT INTO `RemoveFile` "
          + "(`FileKey`, `Component_`, `FileName`, "
              + "`DirProperty`, `InstallMode`) "
          + "VALUES ('_142D31F52C744D6FB945F01BA06EEFB3', "
                   + "'C__931358B017AE83C769F5CB9E95BD2401', "
                   + "'Product version 2.0.lnk', 'DesktopFolder', 1)";
view = database.OpenView(sql);
view.Execute();
view.Close();

这篇关于插入到MSI中的RemoveFile表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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