PDA

View Full Version : IS_MAJOR_UPGRADE - won't work in script



cbonobgt
10-25-2010, 09:07 AM
We are doing checks for IS_MINOR_UPGRADE and IS_MAJOR_UPGRADE. When we do the check in the condition Field of a Custom Action everthing works as expected using the conditions
IS_MAJOR_UPGRADE="Yes" or IS_MINOR_UPGRADE="1"

However we also have script running to check these variables and only the IS_MINOR_UPGRADE value ever gets set. During a Major Upgrade the variable svIsMajorUpgrade never equals "Yes".....

HEre is the code... I am obviously doing something dumb!! Can anyone tell me what it is??


STRING svIsMinorUpgrade;
STRING svIsMajorUpgrade;
NUMBER nBufferSize;
begin

nBufferSize=256;
MsiGetProperty(ISMSI_HANDLE, "IS_MINOR_UPGRADE", svIsMinorUpgrade,nBufferSize);
MsiGetProperty(ISMSI_HANDLE, "IS_MAJOR_UPGRADE", svIsMajorUpgrade,nBufferSize);
SprintfBox (INFORMATION, "Centocor IOM", "This Installer may be a Minor upgrade - %s",svIsMinorUpgrade);
SprintfBox (INFORMATION, "Centocor IOM", "This Installer may be a Major upgrade - %s",svIsMajorUpgrade);


Thanks
cb

Roman1
10-25-2010, 09:19 AM
Hallo,

please set nBufferSize= 255 just before the next MsiGetProperty!

cbonobgt
10-25-2010, 09:53 AM
Bingo!!! That did the trick!

Thanks!


nBufferSize=256;
MsiGetProperty(ISMSI_HANDLE, "IS_MINOR_UPGRADE", svIsMinorUpgrade,nBufferSize);
nBufferSize=256;
MsiGetProperty(ISMSI_HANDLE, "IS_MAJOR_UPGRADE", svIsMajorUpgrade,nBufferSize);

SprintfBox (INFORMATION, "This Works!", ", "This Installer may be a Minor upgrade - %s",svIsMinorUpgrade);

SprintfBox (INFORMATION, "This Works!", "This Installer may be a Major upgrade - %s",svIsMajorUpgrade);