Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto set an ISE build version to match project version
Message
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00894568
Message ID:
00894592
Views:
22
>And, .ISE files ARE in Orca DB format... therefore, I expect the msi.lib msiXXXX api functions will manipulate it, and I've already found the "ProductVersion" record of the "Property" table..... When I have VFP code, I'll post it!

Ok, I've got it. While this is Rough, it works, and I'll be refining it as time goes on. Expect a topic 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...
* 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!!
Previous
Reply
Map
View

Click here to load this message in the networking platform