command line error - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Shouab
Posts: 2
Joined: Wed Jun 07, 2006 7:31 am
Location: Pakistan
Contact: Yahoo Messenger

command line error

i enable the updater and make the ini file at the server there is a updater.exe in my instalation directory at clent end but wheni click and want to run that it gives me command line error i dnt knw how to give those command line options i have go through the url about updater but i am unable to understand how to give those command line options please help me to resolve this issue
Thanks
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The updater tool cannot be run without a command line. To learn how to integrate the updater tool with your application please follow this link:
http://www.advancedinstaller.com/user-g ... dater.html

Also for a list of all command lines currently supported be the updater take a look on this link:
http://www.advancedinstaller.com/user-g ... dater.html

If you have any other question please let me know.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Shouab
Posts: 2
Joined: Wed Jun 07, 2006 7:31 am
Location: Pakistan
Contact: Yahoo Messenger

Hiz
will you plzz help me how should i do it for the java application any reference code i am unable to understand the reference code provided in ATL Thanks in advance
Regards
Shouab
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Here's some code that could help you to integrate the updater with your Java application:

Code: Select all

package com.updater;

import java.awt.*;
import java.awt.event.*;
import java.io.*;

/*****************************************************************************************
 * Sample code for using the Advanced Updater from java applications.
 * 
 * Note: For this sample code to work you must have the updater.exe and updater.ini in
 *       classpath. Just place them in the same folder as you java application .jar files.
 * 
 * @author Advanced Installer team
 *****************************************************************************************/
public class TestUpdater extends Frame 
                          implements Runnable {
    
    public static void main(String[] args) {
      TestUpdater frame = new TestUpdater();
      frame.setVisible(true);
    }
    
    public void run() 
    {
      try {
        Thread.sleep(30000); // wait for about 30 seconds.
        StartUpdater("updater.exe /silent"); // launch the updater in silent mode.
      } catch (InterruptedException ex) {
        ex.printStackTrace();
      }
    }
    
    /**
     * The constructor.
     */  
     public TestUpdater() {
     
        Thread checkSilent = new Thread(this);
        checkSilent.start(); // start the updater in silent mode. 
                
        MenuBar menuBar = new MenuBar();
        Menu menuFile = new Menu();
        MenuItem menuFileExit = new MenuItem();
        
        menuFile.setLabel("File");
        menuFileExit.setLabel("Exit");
        
        // Add action listener.for the menu button
        menuFileExit.addActionListener
        (
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    TestUpdater.this.windowClosed();
                }
            }
        );
        
        Menu menuHelp = new Menu();
        menuHelp.setLabel("Help");
        MenuItem menuCheckForUpdates = new MenuItem();
        menuCheckForUpdates.setLabel("Check for Updates...");
        
        menuCheckForUpdates.addActionListener
        (
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    TestUpdater.this.StartUpdater("updater.exe /checknow");
                }
            }
        );
        
        MenuItem menuUpdatesOptions = new MenuItem();
        menuUpdatesOptions.setLabel("Updates Options...");
        
        menuUpdatesOptions.addActionListener
        (
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    TestUpdater.this.StartUpdater("updater.exe /configure");
                }
            }
        );
        
        menuHelp.add(menuUpdatesOptions);
        menuHelp.addSeparator(); 
        menuHelp.add(menuCheckForUpdates);
         
        menuFile.add(menuFileExit);
        menuBar.add(menuFile);
        menuBar.add(menuHelp);
        
        setTitle("Sample code for using the Advanced Updater from java applications");
        setMenuBar(menuBar);
        setSize(new Dimension(600, 400));
        
        // Add window listener.
        this.addWindowListener
        (
            new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    TestUpdater.this.windowClosed();
                }
            }
        );  
    }
    
    protected class DefAdapter extends WindowAdapter{
      public void windowClosing(WindowEvent e) {
        System.exit(0);              
      }
    }
    
    protected void StartUpdater(String cmd) {
      try {
        Runtime.getRuntime().exec(cmd);
      }
      catch(IOException ex) {
        ex.printStackTrace();
      }
    }
    
    
    /**
     * Shutdown procedure when run as an application.
     */
    protected void windowClosed() {
    	
        // Exit application.
        System.exit(0);
    }
}
Regards,
Gigi
__________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”