Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.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
Vbscript 无法使用vbs更新msi_Vbscript_Windows Installer - Fatal编程技术网

Vbscript 无法使用vbs更新msi

Vbscript 无法使用vbs更新msi,vbscript,windows-installer,Vbscript,Windows Installer,Im目前面临msi的组件GUID为小写的问题。需要将所有组件GUID转换为大写,因此编写了一个小脚本,如下所示: VBS: msi_完整路径= 暗斯特林 strLine=“更新组件集ComponentId=UPPER(ComponentId)” 设置WI=CreateObject(“WindowsInstaller.Installer”) Set DB=WI.OpenDatabase(msi_fullpath,1) "更新" Set view=DB.OpenView(strLine) 查看。执行

Im目前面临msi的组件GUID为小写的问题。需要将所有组件GUID转换为大写,因此编写了一个小脚本,如下所示:

VBS:

msi_完整路径=
暗斯特林
strLine=“更新组件集ComponentId=UPPER(ComponentId)”
设置WI=CreateObject(“WindowsInstaller.Installer”)
Set DB=WI.OpenDatabase(msi_fullpath,1)
"更新"
Set view=DB.OpenView(strLine)
查看。执行
DB.Commit
视图。关闭
设置视图=无
Set DB=Nothing
设置WI=无

但是,上述方法不起作用。有人能帮忙吗?

它到底是如何“不起作用”的?您的SQL命令似乎可疑-您没有指定特定的组件,我不相信该命令会自动更新组件表中的每个组件id。@AnsgarWiechers在执行上述VBS后遇到的错误是错误:OpenView,SQL代码:80004005,来源:Msi APIError@PhilDW上面的SQL命令是一个有效的SQL命令,用于以大写形式更新列的所有行,我们在SQL Server 2012中的一个虚拟表上尝试过它。MSI fle并不完全是SQL数据库,即使它的(某些)数据结构有SQL接口。我不能担保,但我不认为
UPPER()
适用于Windows Installer数据库界面。
msi_fullpath = <Path of msi>

Dim strLine
strLine = "UPDATE Component SET ComponentId = UPPER(ComponentId)"
Set WI = CreateObject("WindowsInstaller.Installer")
Set DB = WI.OpenDatabase(msi_fullpath, 1)

' Update
Set view = DB.OpenView(strLine)
view.Execute
DB.Commit
View.Close
Set view = Nothing
Set DB = Nothing
Set WI = Nothing