Replace .SDF database file through .msi upgrade proceed

本文介绍了一种通过编辑MSI文件的Filetable来为SDF数据库文件添加FileVersion编号的方法,以此实现现有文件替换策略下SDF文件的更新。文中还提供了一个用于更新MSI文件中指定SDF文件版本号的命令示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://msdn.microsoft.com/en-us/library/windows/desktop/aa371221(v=vs.85).aspx
Since there's no File Version attribute for the SDF database file for the Existing File replacement policy, but sometimes we really need to replace the SDF file(change the init data, or others things makes you need to replace the database file).
Then we just can edit the .MSI file File table to add the File Version number for the .SDF file, then it can use the Existing File replacement policy:

Then we just need to update the version number once we need to replace the .sdf database file for our product.

fileversion

Then we can configure the Setup project Post-build Event according to this command to update the msi file:

Cscript WiRunSQL.vbs Setup2.msi "UPDATE `File` SET `File`.`Version`='1.0.0.0' WHERE `File`.`FileName` = 'DATABA~1.SDF|Database1.sdf'"

https://skydrive.live.com/redir.aspx?cid=bb789f72272d4858&resid=BB789F72272D4858!723&parid=BB789F72272D4858!721

[C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\sysmgmt\msi\scripts\WiRunSQL.vbs]

I have not found any MSDN document mentioned this way to help our work, this is just based on my experiences and test cases, so please consider carefully before use this way in your product deployment.

ref my Google Blog: http://mikedoszhang.blogspot.com/2012/02/replace-sdf-database-file-through-msi.html

转载于:https://www.cnblogs.com/telnet_mike/archive/2012/02/06/2340246.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值