Problems with single instance - 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!

ahjimbo
Posts: 1
Joined: Mon Sep 03, 2007 2:18 pm

Problems with single instance

Hi, I am having problems with single java instance.

As described by the user mannual, I added the following codes into the program,

static void secondaryMain(String args[]){
shell.dispose();
}

and selected single instance option on configuration panel.

However, when I associated certain file type to the program, and performed a double click on the file, it didn't behave on what it should be.

In detail, when I double clicked on the file, it launched the application and popullated the data; but when i clicked on another file, nothing was changed, ( the single instance is actually working, it just doesn't go into the secondaryMain() function, by right it should dispose the current shell).

In addtion, I oso have problem with file path configuration. Means when I double click on a file, the JVM gives source file not found error. It only works when i drag the file into the installation folder.

Can anyone provide me a solution.

Thx a lot

SIP
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,
the single instance is actually working, it just doesn't go into the secondaryMain() function, by right it should dispose the current shell
Is the "secondaryMain" function called or not? You can determine this using the following code:

Code: Select all

import javax.swing.JOptionPane;

public class YourMainClass
{
  static void secondaryMain(String args[])
  {
    JOptionPane.showMessageDialog(null, "secondaryMain called!");
  }
}
In addtion, I oso have problem with file path configuration. Means when I double click on a file, the JVM gives source file not found error. It only works when i drag the file into the installation folder.
This seems to be a problem in your code. You are probably trying to use a file path that is relative to the current directory. You should use an absolute path instead.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”