Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate updating Installshield Version Number

Status
Not open for further replies.

wgcs

Programmer
Joined
Mar 31, 2002
Messages
2,056
Location
EC
Anyone know how to, from within VFP, update the version number of an InstallShield Express v4.0SP1 .ISE file?

It's SO annoying to have to change the version for EVERY Build increment... My VFP project can auto-inc the build, and I can get that build number, but The Operator of the release must still manually change the version in ISE.

Spending nearly $1000 for InstallShield Developer isn't an option....

(alternatively, I've been exploring putting up instructions showing the current build version to be changed to (and explaining that the "product code" must be regenerated) in thread184-820446 )
 
Ok, I've got it. While this is Rough, it works, and I'll be refining it as time goes on. Expect a topic in FAQs or on the Fox Wiki or something....

It turns out that ISE uses the Orca Installer database format for the .ISE files, and you can use Windows Installer MSI.DLL functions to manipulate it.

This code has the one irritation that it duplicates the ISE file, since I haven't been able to determine how to declare the MSIDB_OPEN_DIRECT constant in VFP...
Code:
* This is the original defining in MSI.H:
* #define MSIDBOPEN_DIRECT    (LPCTSTR)2  // database direct read/write without transaction
* This attempt does NOT seem to work
*  (MsiOpenDatabase returns an error, 1638 or something)
#define MSIDBOPEN_DIRECT    CHR(2)

DECLARE integer msiOpenDatabase IN msi string DB, string persistMode, LONG @ DbHandle
DECLARE LONG MsiDatabaseOpenView IN MSI LONG hDbHandle, STRING @ cSql, LONG @ nViewHndl
DECLARE LONG MsiViewExecute IN MSI LONG hView, LONG hParamRecord
DECLARE LONG MsiCloseHandle IN MSI LONG hMSIHANDLE
DECLARE long MsiViewFetch IN MSI LONG hView, LONG @ hRecord
DECLARE LONG MsiRecordGetString IN MSI LONG hRecord, LONG nFldIdx, String @ cOutValue, LONG @ nValueLen
DECLARE LONG MsiRecordSetString IN MSI LONG hRecord, LONG nFldIdx, String cOutValue
DECLARE LONG MsiDatabaseCommit IN MSI LONG hDB

STORE 0 TO hDB, hView
?msiOpenDatabase( "c:\temp\jnk.ise", "C:\Temp\jnk2.ise", @hDB )
cSql = "UPDATE Property SET Value='11.12.345' WHERE Property='ProductVersion'"
?msiDatabaseOpenView(hDb,@cSql,@hView)
?msiViewExecute(hview,0)
?msiCloseHandle(hView)
?MsiDatabaseCommit(hDB)
?msiCloseHandle(hDB)

*Voila! c:\temp\jnk2.ise now has the new version number!!
 
Update: To edit the .ISE file without creating a new copy,
use:
Code:
DECLARE LONG MsiOpenDatabase IN msi string DB, string persistMode, LONG DbHandle
hDB=0
nSuccess = MsiOpenDatabase('C:\Path\InstallFile.ISE',2,@hDB)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top