This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Getting your current version
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 14, 2006
10:39 AM
Getting your current version
Is there a way using the InstallShield APIs to get the current version that is being installed? I tried using $P(.key.version.major).$P(.key.version.minor) as Robert Dickau suggested in aother post but that doesn't seem to work for me.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 14, 2006
12:37 PM
As a quick test, this wizard action seems to do it:
import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.product.*;
import com.installshield.product.service.product.*;
public class GetVersionTest extends WizardAction
{
private static final String SRC = ProductService.DEFAULT_PRODUCT_SOURCE;
public void execute(WizardBeanEvent event)
{
try
{
ProductService ps = (ProductService)getService(ProductService.NAME);
String rootbeanid = ps.getProductTreeRoot(SRC);
SoftwareObjectKey rootsok =
(SoftwareObjectKey)ps.getProductBeanProperty(
SRC, rootbeanid, "key");
SoftwareVersion sv = rootsok.getVersion( );
javax.swing.JOptionPane.showMessageDialog(null,
sv.getMajor( ) + "." +
sv.getMinor( ) + "." +
sv.getMaintenance( ));
} catch(ServiceException drat) { drat.printStackTrace( ); }
}
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 18, 2006
07:52 PM
That was exactly what I needed. It works great. Thanks!