Insert to RemoveFile table in MSI

In order to automate some actions in MSI, I tried to insert into the RemoveFile table using JScript and continue to receive errors, and since there are not so many error descriptions, I cannot understand the problem in the request and the only error I get when I try to debug using csript. this is -2147467259 OpenView, SQL,

This is the query that I use to insert the removefile into the table. Can someone help me deal with the problem.

"INSERT INTO `RemoveFile` (`FileKey`, `Component_`, `FileName`, `DirProperty`, `InstallMode`) VALUES (`_142D31F52C744D6FB945F01BA06EEFB3`, `C__931358B017AE83C769F5CB9E95BD2401`, `Product version 2.0.lnk`, `DesktopFolder`, 1) 
+1
file insert windows-installer
source share
1 answer

Did you open the view in 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(); 
0
source share

All Articles