UpdateCheck for every installer

cusax-fix
Damian Minkov 18 years ago
parent 5cfe944d37
commit 7e2192e263

@ -1613,11 +1613,9 @@ javax.swing.event, javax.swing.border"/>
<!--BUNDLE-UpdateCheckPlugin-->
<target name="bundle-updatecheckplugin">
<jar compress="false" destfile="${bundles.dest}/updatechecker.jar"
manifest="src/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf">
manifest="${src}/net/java/sip/communicator/plugin/updatechecker/updatecheck.manifest.mf">
<zipfileset dir="classes/net/java/sip/communicator/plugin/updatechecker"
prefix="net/java/sip/communicator/plugin/updatechecker" />
<zipfileset dir="${resources}/config" includes="updatecheck.properties"
prefix="resources/config" />
<zipfileset dir="${resources}/languages/plugin/updatechecker"
prefix="resources/languages/plugin/updatechecker"/>
</jar>

@ -1 +0,0 @@
destinationPath=http://download.sip-communicator.org/nightly

@ -97,6 +97,13 @@
<target name="build-installation-generic"
depends="clean-install-generic,define-izpack-task,version">
<propertyfile file="${generic.app.dir}/versionupdate.properties"
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="http://download.sip-communicator.org/nightly/generic/${package.name}-${sip-communicator.version}.jar"/>
</propertyfile>
<filter token="VERSION" value="${sip-communicator.version}" />
<filter token="BUILDDATE" value="${build.date}" />
<filter token="PKG_NAME" value="${package.name}" />
@ -146,6 +153,8 @@
<propertyfile file="${linux.app.dir}/versionupdate.properties"
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="http://download.sip-communicator.org/nightly/linux/${package.name}-${sip-communicator.version}-linux.bin"/>
</propertyfile>
<filter token="VERSION" value="${sip-communicator.version}" />
@ -226,7 +235,7 @@
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="http://download.sip-communicator.org/nightly/windows/"/>
value="http://download.sip-communicator.org/nightly/windows/${package.name}-${sip-communicator.version}.exe"/>
</propertyfile>
<filter token="VERSION" value="${sip-communicator.version}" />
@ -346,7 +355,7 @@
<echo file="${macosx.resrc.dir}/felix.client.run.properties"
append="true">felix.auto.start.70= reference:file:sc-bundles/growlnotification.jar
</echo>
<!-- We copy macosx-specific bundles from
sc-bundles/os-specific/macosx to sc-bundles -->
<copy todir="${bundles.dest}">
@ -402,6 +411,8 @@
files="logging.properties"/>
<javafilelist dir="${macosx.resrc.dir}"
files="felix.client.run.properties"/>
<javafilelist dir="${macosx.resrc.dir}"
files="versionupdate.properties"/>
</jarbundler>
<mkdir dir="${macosx.app.dir}/${application.name}.app/Contents/Resources/Java/log"/>
</target>
@ -415,7 +426,7 @@
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="http://download.sip-communicator.org/nightly/macosx/"/>
value="http://download.sip-communicator.org/nightly/macosx/${package.name}-${sip-communicator.version}.dmg"/>
</propertyfile>
<property name="macosx.dmg.name"
@ -486,6 +497,13 @@
if="dpkg.build.present"
description="Create a .deb package for Debian (needs dpkg utilities)">
<propertyfile file="${debian.dir}/versionupdate.properties"
comment="Last Build Version">
<entry key="last_version" value="${sip-communicator.version}"/>
<entry key="download_link"
value="http://download.sip-communicator.org/nightly/debian/${package.name}_${sip-communicator.version}_i386.deb"/>
</propertyfile>
<!-- Prepare the changelog file for the version number -->
<copy file="${inst.resrc}/debian/changelog.tmpl"
tofile="${inst.resrc}/debian/changelog"

@ -55,6 +55,7 @@ install: build
cp $(BASEDIR)/resources/install/logging.properties debian/$(PACKAGE_NAME)/usr/lib/sip-communicator/lib/
cp $(BASEDIR)/lib/felix.client.run.properties debian/$(PACKAGE_NAME)/usr/lib/sip-communicator/lib/
cp -r $(BASEDIR)/lib/bundle debian/$(PACKAGE_NAME)/usr/lib/sip-communicator/lib/
cp debian/versionupdate.properties debian/$(PACKAGE_NAME)/usr/lib/sip-communicator/
# Copy OS specific and native libs
cp $(BASEDIR)/lib/os-specific/linux/*.jar debian/$(PACKAGE_NAME)/usr/lib/sip-communicator/lib/

@ -0,0 +1,2 @@
# Check Update Link
update_link=http://download.sip-communicator.org/nightly/debian/versionupdate.properties

@ -89,6 +89,7 @@
<!-- The executable files -->
<pack name="run" required="yes">
<description>Exceutable</description>
<file targetdir="$INSTALL_PATH" src="resources/install/generic/versionupdate.properties" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/generic/run.sh" os="linux" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/linux/sc-logo.png" os="linux" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/windows/run.bat" os="windows" override="true"/>

@ -0,0 +1,2 @@
# Check Update Link
update_link=http://download.sip-communicator.org/nightly/generic/versionupdate.properties

@ -106,6 +106,7 @@
<!-- The executable files -->
<pack name="run" required="yes">
<description>Executable</description>
<file targetdir="$INSTALL_PATH" src="resources/install/linux/versionupdate.properties" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/linux/run.sh" os="linux" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/linux/sc-logo.png" os="linux" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/linux/uninstall.sh" override="true"/>

@ -0,0 +1,2 @@
# Check Update Link
update_link=http://download.sip-communicator.org/nightly/linux/versionupdate.properties

@ -0,0 +1,2 @@
# Check Update Link
update_link=http://download.sip-communicator.org/nightly/macosx/versionupdate.properties

@ -110,6 +110,7 @@
<!-- The executable files -->
<pack name="run" required="yes">
<description>Exceutable</description>
<file targetdir="$INSTALL_PATH" src="resources/install/windows/versionupdate.properties" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/windows/run.bat" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/windows/uninstall.bat" override="true"/>
<file targetdir="$INSTALL_PATH" src="resources/install/windows/sc-logo.ico" override="true"/>

@ -0,0 +1,2 @@
# Check Update Link
update_link=http://download.sip-communicator.org/nightly/windows/versionupdate.properties

@ -1,3 +1,7 @@
dialogTitle=New version available
dialogMessage1=<html>There is new version of {0} !
dialogMessage2=<br>You can download it at : <br>
dialogMessage1=<html>A new version of {0} is available for download.
dialogMessage2=<br>{0} ({1}): <br>
dialogMessageDebian=
buttonDownload=Download
buttonClose=Close

@ -22,11 +22,10 @@ public class Resources
{
private static Logger logger = Logger.getLogger(Resources.class);
private static final String CONFIG_BUNDLE_NAME
= "resources.config.updatecheck";
private static final String CONFIG_PROP_FILE_NAME
= "versionupdate.properties";
private static final ResourceBundle configBundle = ResourceBundle
.getBundle(CONFIG_BUNDLE_NAME);
private static Properties configProps = null;
private static final String LANG_BUNDLE_NAME
= "resources.languages.plugin.updatechecker.resources";
@ -44,11 +43,17 @@ public static String getConfigString(String key)
{
try
{
return configBundle.getString(key);
if(configProps == null)
{
configProps = new Properties();
configProps.load(new FileInputStream(CONFIG_PROP_FILE_NAME));
}
return configProps.getProperty(key);
}
catch (MissingResourceException e)
catch (IOException e)
{
logger.error("Missing resources.", e);
logger.error("Cannot open config file.", e);
return null;
}

@ -88,35 +88,20 @@ public void start(BundleContext bundleContext) throws Exception
String dialogMsg = MessageFormat.format(
Resources.getLangString("dialogMessage1"),
ver.getApplicationName());
if(downloadLink != null)
{
dialogMsg += Resources.getLangString("dialogMessage2") +
"<a href=\"" + downloadLink + "\">" +
downloadLink + "</a> </html>";
}
dialogMsg += MessageFormat.format(
Resources.getLangString("dialogMessage2"),
ver.getApplicationName(), ver.toString());
contentMessage.setText(dialogMsg);
contentMessage.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e)
{
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
{
getBrowserLauncher().openURL(e.getDescription());
}
}
});
JPanel contentPane = new JPanel(new BorderLayout(5,5));
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
contentPane.add(contentMessage, BorderLayout.CENTER);
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
JButton okButton = new JButton("OK");
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10));
JButton closeButton = new JButton(Resources.getLangString("buttonClose"));
okButton.addActionListener(new ActionListener() {
closeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
@ -124,7 +109,23 @@ public void actionPerformed(ActionEvent e)
}
});
buttonPanel.add(okButton);
if(downloadLink != null)
{
JButton downloadButton =
new JButton(Resources.getLangString("buttonDownload"));
downloadButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
getBrowserLauncher().openURL(downloadLink);
}
});
buttonPanel.add(downloadButton);
}
buttonPanel.add(closeButton);
contentPane.add(buttonPanel, BorderLayout.SOUTH);
@ -178,18 +179,7 @@ private boolean isNewestVersion(String currentVersionStr)
{
try
{
String osName = System.getProperty("os.name");
String osDir = null;
if (osName.startsWith("Mac"))
osDir = "/macosx";
else if (osName.startsWith("Linux"))
osDir = "/linux";
else if (osName.startsWith("Windows"))
osDir = "/windows";
URL url = new URL(Resources.getConfigString("destinationPath") +
osDir + "/versionupdate.properties");
URL url = new URL(Resources.getConfigString("update_link"));
Properties props = new Properties();
props.load(url.openStream());

Loading…
Cancel
Save