How to add a version number to an Access file in a

2019-07-25 18:30发布

I'm building an install using VS 2003. The install has an Excel workbook and two Access databases. I need to force the Access files to load regardless of the create/mod date of the existing databases on the user's computer. I currently use ORCA to force in a Version number on the two files, but would like to find a simpler, more elegant solution (hand editing a .msi file is not something I see as "best practice".

Is there a way to add a version number to the databases using Access that would then be used in the install?

Is there a better way for me to do this?

4条回答
一夜七次
2楼-- · 2019-07-25 18:55

You should populate the MsiFileHash table for these files. Look at WiFilVer.vbs thtat is part of the Microsoft Platform SDK to see how to do this.

My other suggestion would be to look at WiX instead of Visual Studio 2003 for doing installs. Visual Studio 2003 has very limited MSI support and you can end up spending a lot of time fighting it, rather than getting useful work don.

查看更多
beautiful°
3楼-- · 2019-07-25 18:58

Since it sounds like you don't have properly versioned resources, have you tried changing the REINSTALLMODE property?

IIRC, in the default value of 'omus', it's the 'o' flag that's only allowing you to install if you have an older version. You may try changing this from 'o' to 'e'. Be warned that this will overwrite missing, older AND equally versioned files.

Manually adding in versions was the wrong way to start, but this should ensure that you don't have to manually bump up the version numbers to get them to install.

查看更多
Rolldiameter
4楼-- · 2019-07-25 19:01

Look into Build Events for your project. It may be possible to rev the versions of the files during a build event. [Just don't quote me on that]. I am not sure if you can or not, but that would be the place I would start investigating first.

查看更多
Emotional °昔
5楼-- · 2019-07-25 19:15

@LanceSc

I don't think MsiFileHash table will help here. See this excellent post by Aaron Stebner. Most likely last modified date of Access database on client computer will be different from its creation date. Windows Installer will correctly assume that the file has changed since installation and will not replace it.

The right way to solve this (as question author pointed out) is to set Version field in File table.

Unfortunately setup projects in Visual Studio are very limited. You can create simple VBS script that would modify records in File table (using SQL) but I suggest looking at alternative setup authoring tools instead, such as WiX, InstallShield or Wise. WiX in my opinion is the best.

查看更多
登录 后发表回答