0

I created my java application as EXE file, everything works i can open it etc, my problem is that i want to use this EXE as default application for .ctr files, when i try to open that file in Windows Explorer, it doesn't do anything, no log is being created, it looks like it did not even try to open anything.

In the application, I am taking arguments from main method and creating files from it.

How can i even debug to find out what is going on.

I think that the arguments should come by as normal as you would execute app.jar -jar arguments here.

What also strikes me is that if i use terminal to open exe with argument for the file i want it opens and works correctly.

The problem seems to be more associated with Windows in my opinion, I tried to delete file association from registry for the .ctr file and explorer no longer showed any associations, but when i selected open i have seen my app in recommended programs. This also worked for me for the first time, but then i had to move the app exe files into different directory and it looks like it did not update in windows or something so it may point to the old directory which doesn't exist anymore.

I also tried to write simple .bat file which starts the exe and pass parameter into it, this also doesn't work, it only shows terminal windows for milliseconds and closing it so quick, that i cant see what is going on there.

Gurwinder Singh
  • 38,557
  • 6
  • 51
  • 76

1 Answers1

0

Launch4j only creates an exe which wraps around your jar files. For file associations, you'll need to edit the registry.

I would recommend using tools that will create and installer or your exe and then also make changes to the registry during installation. Inno Setup Compiler is a very good tool to create windows installer.

Here is a quick start tutorial.

To create file associations, refer to these answers on SO inno setup file association How to change file associations in Inno-setup

Community
  • 1
  • 1
ares
  • 4,283
  • 6
  • 32
  • 63