[izpack-users] file type association

Csizmadia Peter szocsp at freemail.hu
Thu Sep 13 10:26:26 CEST 2007


Hi,

I want to associate a file type (.sls) to my application. Unfortunately, the only documented method,  https://izpack.github.io/wiki/how_to_associate_file_types_in_windows is wrong (let me not go into details, but I'm afraid the author has never even tried it). Even if it would work, the absolute paths appearing in the exported .reg file would make it impossible to use the same file in another installation.
I think the right way is to make a RegistrySpec.xml. However, I'm not a windows expert to make such a file and I couldn't find any examples.
After a huge lot of futile attempts (rewriting slightly differently, recompiling, rebooting in windows etc.) I have a RegistrySpec.xml which works only partially, see below. The name of the file type ("SlideProject Slides") and the icon appears on .sls files in explorer, but if I click it, windows says "E:\...\file.sls is not a valid Win32 application." instead of running my program. I cannot even select slideproject from the popup menu. I can select it from Open with.../Recommended Programs, but then I get the same error message.

Could someone send me a working example?
Thanks.

Peter

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<registry>
    <pack name="Core">
        <value root="HKCR" keypath="SlideProject.SLSFile"
            name="" string="SlideProject Slides"/>
        <value root="HKCR" keypath="SlideProject.SLSFile\DefaultIcon"
            name="" string="$INSTALL_PATH\icons\slideproject.ico,0"/>
        <value root="HKCR" keypath="SlideProject.SLSFile\shell"
            name="" string="open"/>
        <value root="HKCR" keypath="SlideProject.SLSFile\shell\open"
            name="" string="&amp;Open"/>
        <value root="HKCR" keypath="SlideProject.SLSFile\shell\open\command"
            name="" string='"$INSTALL_PATH\bin\slideproject.vbs" "%1"'/>

        <value root="HKLM"
            keypath="software\classes\SlideProject.SLSFile"
            name="" string="SlideProject Slides"/>
        <value root="HKLM"
            keypath="software\classes\SlideProject.SLSFile\DefaultIcon"
            name="" string="$INSTALL_PATH\icons\slideproject.ico,0"/>
        <value root="HKLM"
            keypath="software\classes\SlideProject.SLSFile\shell"
            name="" string="open"/>
        <value root="HKLM"
            keypath="software\classes\SlideProject.SLSFile\shell\open"
            name="" string="&amp;Open"/>
        <value root="HKLM"
            keypath="software\classes\SlideProject.SLSFile\shell\open\command"
            name="" string='"$INSTALL_PATH\bin\slideproject.vbs" "%1"'/>

        <key root="HKCU"
            keypath="software\microsoft\windows\currentversion\explorer\fileexts\open\.sls"/>
        <key root="HKCU"
            keypath="software\microsoft\windows\currentversion\explorer\fileexts\open\.sls\OpenWithList"/>
        <key root="HKCU"
            keypath="software\microsoft\windows\currentversion\explorer\fileexts\open\.sls\OpenWithProgIds"/>
        <value root="HKCU"
            keypath="software\microsoft\windows\currentversion\explorer\fileexts\open\.sls"
            name="Application" string="slideproject.vbs"/>
        <value root="HKCU" keypath="software\microsoft\windows\currentversion\explorer\fileexts\open\.sls\OpenWithProgIds"
            name="SlideProject.SLSFile"><bin data=""/></value>
    </pack>
</registry>

Note that slideproject.vbs is a visual basic script to run the java code. (I use it instead of batch because batch files show a superfluous terminal window.) In install.xml:
        <appname>SlideProject</appname>
...
            <parsable os="windows" type="shell"
                      targetfile="$INSTALL_PATH/bin/slideproject.vbs"/>
            <executable os="windows" stage="never"
                        targetfile="$INSTALL_PATH/bin/slideproject.vbs"/>

Utazások Erotikában - Vámos Miklós nemsokára megjelenő regényét előre megrendelheti nálunk.
http://ad.adverticum.net/b/cl,1,6022,201702,253867/click.prm



More information about the izpack-users mailing list