Hi,

I want to pass a parameter to a java launcher when the user clicks on a valid extension. Also I want to use the java launcher to launch the app when clicked directly.

If I set the extension and launch a batch file it works fine but with the launcher the %L is not getting translated. Please suggest the correct way.

I just want the parameter to be "-path=<the file="" clicked="">"

The following are the XML snippets :

<javaLauncher>
    <allowCommandLineArguments>1</allowCommandLineArguments>
    <arguments>-path=%1</arguments>
    <binaryName>Launcher</binaryName>
    <classpath></classpath>
    <jarFile>${installdir}/test.jar</jarFile>
    <mainClass></mainClass>
    <preferredJavaBinary></preferredJavaBinary>
    <requestedExecutionLevel>highestAvailable</requestedExecutionLevel>
    <runInConsole>1</runInConsole>
    <vmParameters></vmParameters>
    <windowsResourceComments>Test Launcher</windowsResourceComments>
    <windowsResourceCompanyName>Tester</windowsResourceCompanyName>
    <windowsResourceFileVersion>1.0.0.0</windowsResourceFileVersion>
    <windowsResourceProductName>XY2</windowsResourceProductName>
    <windowsResourceProductVersion>1.0</windowsResourceProductVersion>
    <workingDirectory>${installdir}</workingDirectory>
</javaLauncher>

<associateWindowsFileExtension>
    <extensions>.xy2</extensions>
    <friendlyName>XYZ file</friendlyName>
    <icon>${installdir}/icon.ico</icon>
    <mimeType></mimeType>
    <progID>XYZ generated file</progID>
    <commandList>
        <command>
            <makeDefault>0</makeDefault>
            <runProgram>${installdir}/Launcher.exe</runProgram>
            <runProgramArguments>"%L"</runProgramArguments>
            <verb>open</verb>
        </command>
    </commandList>
</associateWindowsFileExtension>

asked 09 May '12, 12:25

Dracu's gravatar image

Dracu
18811
accept rate: 0%


This was solved from support@bitrock.com. The problem occurred while updating the requested execution label of the installer, probably because the binary was locked by an external process such as an antivirus

link

answered 11 May '12, 09:54

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Could you try the below instead?:

<javaLauncher>
    <allowCommandLineArguments>1</allowCommandLineArguments>
    <arguments></arguments>
    ...
</javaLauncher>

<associateWindowsFileExtension>
    ...
    <commandList>
        <command>
            <makeDefault>0</makeDefault>
            <runProgram>${installdir}/Launcher.exe</runProgram>
            <runProgramArguments>-path="%L"</runProgramArguments>
            <verb>open</verb>
        </command>
    </commandList>
</associateWindowsFileExtension>
link

answered 09 May '12, 13:06

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Juanjo,

Your suggestion works fine.

I now notice an error message during installation that says " Problem running post-install step. Installation may not complete correctly.

Problem creating launcher in C:Program FilesTestApp."

(09 May '12, 13:20) Dracu

Could you execute the installer as:

installer.exe --debugtrace debug.txt

And send us the generated file to support@bitrock.com?

(09 May '12, 13:37) juanjo ♦♦

Just sent the same

(09 May '12, 13:52) Dracu
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7
×6

Asked: 09 May '12, 12:25

Seen: 2,476 times

Last updated: 11 May '12, 09:54