Problems creating a plugin installation package

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems creating a plugin installation package

Jesus Zarzoso
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es


_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems creating a plugin installation package

Jorge Piera Llodrá
Hello Jesús.

The standard installation just create an installer that copies the extension folder. If you want to do more advanced actions, you can select in the third window of the "Create plugin installation package" wizard, the "Enable the advanced mode" option. Using this option you can select more files to copy outside the extension folder (in the 4th step of the wizard), and you can also edit an ant file (5th step) that will be executed at the end of the installation process to personalize your installation.



Regards,
Jorge

On 05/17/2011 03:42 PM, Jesus Zarzoso wrote:
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems creating a plugin installation package

Jesus Zarzoso
Hi Jorge, thanks for the quick reply!
Yes, I´m using the advanced mode. In the 4th step I select the folder where I have the native libraries but they are not included in the installer. I have to put them inside manually with a ZIP manager.
Regarding the 5th step, that was what I was referring to in my previous mail. I have edited the ANT script to perform the copy of  the libraries, but it doesn´t seem to work for me. Any changes I make to that file seems to be ignored by the installer. If you tell me that you have used this functionallity and it has worked for you, then it´s clear I am doing something wrong, and I willl have to look a bit deeper into it to see what is happening. By the way, is there some documentation regarding this topic? I did a quick search and couldn´t find it.

Regards.

El 17 de mayo de 2011 16:35, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

The standard installation just create an installer that copies the extension folder. If you want to do more advanced actions, you can select in the third window of the "Create plugin installation package" wizard, the "Enable the advanced mode" option. Using this option you can select more files to copy outside the extension folder (in the 4th step of the wizard), and you can also edit an ant file (5th step) that will be executed at the end of the installation process to personalize your installation.



Regards,
Jorge


On 05/17/2011 03:42 PM, Jesus Zarzoso wrote:
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es


_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems creating a plugin installation package

Jorge Piera Llodrá
Hello.

I've had a look to the source code and it looks that the script is executed. Could you please send us your installer file and we will check it?

Regards,
Jorge

On 05/17/2011 04:57 PM, Jesus Zarzoso wrote:
Hi Jorge, thanks for the quick reply!
Yes, I´m using the advanced mode. In the 4th step I select the folder where I have the native libraries but they are not included in the installer. I have to put them inside manually with a ZIP manager.
Regarding the 5th step, that was what I was referring to in my previous mail. I have edited the ANT script to perform the copy of  the libraries, but it doesn´t seem to work for me. Any changes I make to that file seems to be ignored by the installer. If you tell me that you have used this functionallity and it has worked for you, then it´s clear I am doing something wrong, and I willl have to look a bit deeper into it to see what is happening. By the way, is there some documentation regarding this topic? I did a quick search and couldn´t find it.

Regards.

El 17 de mayo de 2011 16:35, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

The standard installation just create an installer that copies the extension folder. If you want to do more advanced actions, you can select in the third window of the "Create plugin installation package" wizard, the "Enable the advanced mode" option. Using this option you can select more files to copy outside the extension folder (in the 4th step of the wizard), and you can also edit an ant file (5th step) that will be executed at the end of the installation process to personalize your installation.



Regards,
Jorge


On 05/17/2011 03:42 PM, Jesus Zarzoso wrote:
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems creating a plugin installation package

Jesus Zarzoso
Hi Jorge. We have been looking into this problem and we think we know what is happening. In the Advanced Mode, when selecting the files to add to the installer, if you select individual files, they are added correctly into the "files" folder of the installer. However, if you select a whole folder, it doesn't copy its files, and the folder "files" is not created, That's the reason why the script wasn't doing anything, as it looks for this folder.

We think the problem lies in the method addSelectedFiles from the SelectFilesTree.java class (package org.gvsig.installer.swing.impl.creation.model). The method reads as:

    public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
        if (node.isSelected) {
            File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
                selectedFiles.add(absolutePath);
            }
        } else {
            if (node.getFile().isDirectory()) {
                for (int i = 0; i < node.getChildCount(); i++) {
                    addSelectedFiles((SelectFilesTreeCheckNode) node
                        .getChildAt(i), selectedFiles);
                }
            }
        }
    }

The problem when selecting a folder is that the execution path enters the first IF sentence, and as the item is a directory, its files are not added to the selectedFiles list.

I have done some modifications to the method (splitted in two to avoid code duplication):

public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
    
    if (node.isSelected) {
    File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
            selectedFiles.add(absolutePath);
            }
       
            else {
            traverseChildren(node, selectedFiles);
       }
        }
    else {
    if (node.getFile().isDirectory()) {
    traverseChildren(node, selectedFiles);
    }
        }
    }


   protected void traverseChildren(SelectFilesTreeCheckNode node, List<File> selectedFiles){

    for (int i = 0; i < node.getChildCount(); i++) {
    addSelectedFiles((SelectFilesTreeCheckNode) node.getChildAt(i), selectedFiles);
        }

    }

If you don't see anything wrong I can send it as a patch to the bug tracker.

Regards.


El 17 de mayo de 2011 17:17, Jorge Piera Llodrá <[hidden email]> escribió:
Hello.

I've had a look to the source code and it looks that the script is executed. Could you please send us your installer file and we will check it?

Regards,
Jorge


On 05/17/2011 04:57 PM, Jesus Zarzoso wrote:
Hi Jorge, thanks for the quick reply!
Yes, I´m using the advanced mode. In the 4th step I select the folder where I have the native libraries but they are not included in the installer. I have to put them inside manually with a ZIP manager.
Regarding the 5th step, that was what I was referring to in my previous mail. I have edited the ANT script to perform the copy of  the libraries, but it doesn´t seem to work for me. Any changes I make to that file seems to be ignored by the installer. If you tell me that you have used this functionallity and it has worked for you, then it´s clear I am doing something wrong, and I willl have to look a bit deeper into it to see what is happening. By the way, is there some documentation regarding this topic? I did a quick search and couldn´t find it.

Regards.

El 17 de mayo de 2011 16:35, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

The standard installation just create an installer that copies the extension folder. If you want to do more advanced actions, you can select in the third window of the "Create plugin installation package" wizard, the "Enable the advanced mode" option. Using this option you can select more files to copy outside the extension folder (in the 4th step of the wizard), and you can also edit an ant file (5th step) that will be executed at the end of the installation process to personalize your installation.



Regards,
Jorge


On 05/17/2011 03:42 PM, Jesus Zarzoso wrote:
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es


_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems creating a plugin installation package

Jorge Piera Llodrá
Hello Jesús.

Yes, your update looks fine. You can create a new ticket and attach the patch and we will apply it asap.

Regards,
Jorge

On 05/18/2011 02:36 PM, Jesus Zarzoso wrote:
Hi Jorge. We have been looking into this problem and we think we know what is happening. In the Advanced Mode, when selecting the files to add to the installer, if you select individual files, they are added correctly into the "files" folder of the installer. However, if you select a whole folder, it doesn't copy its files, and the folder "files" is not created, That's the reason why the script wasn't doing anything, as it looks for this folder.

We think the problem lies in the method addSelectedFiles from the SelectFilesTree.java class (package org.gvsig.installer.swing.impl.creation.model). The method reads as:

    public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
        if (node.isSelected) {
            File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
                selectedFiles.add(absolutePath);
            }
        } else {
            if (node.getFile().isDirectory()) {
                for (int i = 0; i < node.getChildCount(); i++) {
                    addSelectedFiles((SelectFilesTreeCheckNode) node
                        .getChildAt(i), selectedFiles);
                }
            }
        }
    }

The problem when selecting a folder is that the execution path enters the first IF sentence, and as the item is a directory, its files are not added to the selectedFiles list.

I have done some modifications to the method (splitted in two to avoid code duplication):

public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
    
    if (node.isSelected) {
    File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
            selectedFiles.add(absolutePath);
            }
       
            else {
            traverseChildren(node, selectedFiles);
       }
        }
    else {
    if (node.getFile().isDirectory()) {
    traverseChildren(node, selectedFiles);
    }
        }
    }


   protected void traverseChildren(SelectFilesTreeCheckNode node, List<File> selectedFiles){

    for (int i = 0; i < node.getChildCount(); i++) {
    addSelectedFiles((SelectFilesTreeCheckNode) node.getChildAt(i), selectedFiles);
        }

    }

If you don't see anything wrong I can send it as a patch to the bug tracker.

Regards.


El 17 de mayo de 2011 17:17, Jorge Piera Llodrá <[hidden email]> escribió:
Hello.

I've had a look to the source code and it looks that the script is executed. Could you please send us your installer file and we will check it?

Regards,
Jorge


On 05/17/2011 04:57 PM, Jesus Zarzoso wrote:
Hi Jorge, thanks for the quick reply!
Yes, I´m using the advanced mode. In the 4th step I select the folder where I have the native libraries but they are not included in the installer. I have to put them inside manually with a ZIP manager.
Regarding the 5th step, that was what I was referring to in my previous mail. I have edited the ANT script to perform the copy of  the libraries, but it doesn´t seem to work for me. Any changes I make to that file seems to be ignored by the installer. If you tell me that you have used this functionallity and it has worked for you, then it´s clear I am doing something wrong, and I willl have to look a bit deeper into it to see what is happening. By the way, is there some documentation regarding this topic? I did a quick search and couldn´t find it.

Regards.

El 17 de mayo de 2011 16:35, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

The standard installation just create an installer that copies the extension folder. If you want to do more advanced actions, you can select in the third window of the "Create plugin installation package" wizard, the "Enable the advanced mode" option. Using this option you can select more files to copy outside the extension folder (in the 4th step of the wizard), and you can also edit an ant file (5th step) that will be executed at the end of the installation process to personalize your installation.



Regards,
Jorge


On 05/17/2011 03:42 PM, Jesus Zarzoso wrote:
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems creating a plugin installation package

Jesus Zarzoso
Bug and patch submitted.
Regards.

El 18 de mayo de 2011 15:50, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

Yes, your update looks fine. You can create a new ticket and attach the patch and we will apply it asap.

Regards,
Jorge


On 05/18/2011 02:36 PM, Jesus Zarzoso wrote:
Hi Jorge. We have been looking into this problem and we think we know what is happening. In the Advanced Mode, when selecting the files to add to the installer, if you select individual files, they are added correctly into the "files" folder of the installer. However, if you select a whole folder, it doesn't copy its files, and the folder "files" is not created, That's the reason why the script wasn't doing anything, as it looks for this folder.

We think the problem lies in the method addSelectedFiles from the SelectFilesTree.java class (package org.gvsig.installer.swing.impl.creation.model). The method reads as:

    public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
        if (node.isSelected) {
            File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
                selectedFiles.add(absolutePath);
            }
        } else {
            if (node.getFile().isDirectory()) {
                for (int i = 0; i < node.getChildCount(); i++) {
                    addSelectedFiles((SelectFilesTreeCheckNode) node
                        .getChildAt(i), selectedFiles);
                }
            }
        }
    }

The problem when selecting a folder is that the execution path enters the first IF sentence, and as the item is a directory, its files are not added to the selectedFiles list.

I have done some modifications to the method (splitted in two to avoid code duplication):

public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
    
    if (node.isSelected) {
    File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
            selectedFiles.add(absolutePath);
            }
       
            else {
            traverseChildren(node, selectedFiles);
       }
        }
    else {
    if (node.getFile().isDirectory()) {
    traverseChildren(node, selectedFiles);
    }
        }
    }


   protected void traverseChildren(SelectFilesTreeCheckNode node, List<File> selectedFiles){

    for (int i = 0; i < node.getChildCount(); i++) {
    addSelectedFiles((SelectFilesTreeCheckNode) node.getChildAt(i), selectedFiles);
        }

    }

If you don't see anything wrong I can send it as a patch to the bug tracker.

Regards.


El 17 de mayo de 2011 17:17, Jorge Piera Llodrá <[hidden email]> escribió:
Hello.

I've had a look to the source code and it looks that the script is executed. Could you please send us your installer file and we will check it?

Regards,
Jorge


On 05/17/2011 04:57 PM, Jesus Zarzoso wrote:
Hi Jorge, thanks for the quick reply!
Yes, I´m using the advanced mode. In the 4th step I select the folder where I have the native libraries but they are not included in the installer. I have to put them inside manually with a ZIP manager.
Regarding the 5th step, that was what I was referring to in my previous mail. I have edited the ANT script to perform the copy of  the libraries, but it doesn´t seem to work for me. Any changes I make to that file seems to be ignored by the installer. If you tell me that you have used this functionallity and it has worked for you, then it´s clear I am doing something wrong, and I willl have to look a bit deeper into it to see what is happening. By the way, is there some documentation regarding this topic? I did a quick search and couldn´t find it.

Regards.

El 17 de mayo de 2011 16:35, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

The standard installation just create an installer that copies the extension folder. If you want to do more advanced actions, you can select in the third window of the "Create plugin installation package" wizard, the "Enable the advanced mode" option. Using this option you can select more files to copy outside the extension folder (in the 4th step of the wizard), and you can also edit an ant file (5th step) that will be executed at the end of the installation process to personalize your installation.



Regards,
Jorge


On 05/17/2011 03:42 PM, Jesus Zarzoso wrote:
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es


_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems creating a plugin installation package

Jorge Piera Llodrá
Thanks a lot!

On 05/18/2011 04:49 PM, Jesus Zarzoso wrote:
Bug and patch submitted.
Regards.

El 18 de mayo de 2011 15:50, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

Yes, your update looks fine. You can create a new ticket and attach the patch and we will apply it asap.

Regards,
Jorge


On 05/18/2011 02:36 PM, Jesus Zarzoso wrote:
Hi Jorge. We have been looking into this problem and we think we know what is happening. In the Advanced Mode, when selecting the files to add to the installer, if you select individual files, they are added correctly into the "files" folder of the installer. However, if you select a whole folder, it doesn't copy its files, and the folder "files" is not created, That's the reason why the script wasn't doing anything, as it looks for this folder.

We think the problem lies in the method addSelectedFiles from the SelectFilesTree.java class (package org.gvsig.installer.swing.impl.creation.model). The method reads as:

    public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
        if (node.isSelected) {
            File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
                selectedFiles.add(absolutePath);
            }
        } else {
            if (node.getFile().isDirectory()) {
                for (int i = 0; i < node.getChildCount(); i++) {
                    addSelectedFiles((SelectFilesTreeCheckNode) node
                        .getChildAt(i), selectedFiles);
                }
            }
        }
    }

The problem when selecting a folder is that the execution path enters the first IF sentence, and as the item is a directory, its files are not added to the selectedFiles list.

I have done some modifications to the method (splitted in two to avoid code duplication):

public void addSelectedFiles(SelectFilesTreeCheckNode node,
        List<File> selectedFiles) {
    
    if (node.isSelected) {
    File absolutePath = new File(node.getFile().getAbsolutePath());
            if (!absolutePath.isDirectory()) {
            selectedFiles.add(absolutePath);
            }
       
            else {
            traverseChildren(node, selectedFiles);
       }
        }
    else {
    if (node.getFile().isDirectory()) {
    traverseChildren(node, selectedFiles);
    }
        }
    }


   protected void traverseChildren(SelectFilesTreeCheckNode node, List<File> selectedFiles){

    for (int i = 0; i < node.getChildCount(); i++) {
    addSelectedFiles((SelectFilesTreeCheckNode) node.getChildAt(i), selectedFiles);
        }

    }

If you don't see anything wrong I can send it as a patch to the bug tracker.

Regards.


El 17 de mayo de 2011 17:17, Jorge Piera Llodrá <[hidden email]> escribió:
Hello.

I've had a look to the source code and it looks that the script is executed. Could you please send us your installer file and we will check it?

Regards,
Jorge


On 05/17/2011 04:57 PM, Jesus Zarzoso wrote:
Hi Jorge, thanks for the quick reply!
Yes, I´m using the advanced mode. In the 4th step I select the folder where I have the native libraries but they are not included in the installer. I have to put them inside manually with a ZIP manager.
Regarding the 5th step, that was what I was referring to in my previous mail. I have edited the ANT script to perform the copy of  the libraries, but it doesn´t seem to work for me. Any changes I make to that file seems to be ignored by the installer. If you tell me that you have used this functionallity and it has worked for you, then it´s clear I am doing something wrong, and I willl have to look a bit deeper into it to see what is happening. By the way, is there some documentation regarding this topic? I did a quick search and couldn´t find it.

Regards.

El 17 de mayo de 2011 16:35, Jorge Piera Llodrá <[hidden email]> escribió:
Hello Jesús.

The standard installation just create an installer that copies the extension folder. If you want to do more advanced actions, you can select in the third window of the "Create plugin installation package" wizard, the "Enable the advanced mode" option. Using this option you can select more files to copy outside the extension folder (in the 4th step of the wizard), and you can also edit an ant file (5th step) that will be executed at the end of the installation process to personalize your installation.



Regards,
Jorge


On 05/17/2011 03:42 PM, Jesus Zarzoso wrote:
Hello. 
We are doing some tests with the "Create plugin installation package" tool included in the latest builds of gvSIG. 
While it works perfectly when packaging simple plugins (JAVA source code only), we are having problems with plugins that include native dependencies, like the 3D extension.
We need the installer to copy some native libraries to the "native" folder of the gvSIG installation (gvSIG 2.0). If i understood correctly, the way to do this is to modify the install.xml script and add the necessary code to do it.
The problem we are facing is that any changes performed to this file seem to be ignored by the installer, and it simply copies the files inside the package to the "gvsig/extensiones" folder.
We'd like to know if it is a known bug of the installer, or we are simply doing something wrong.

Regards.



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    



--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org
    

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel




--
Jesús Zarzoso Muñoz

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial 
http://www.ai2.upv.es

_______________________________________________ gvSIG-desktop-devel mailing list [hidden email] https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: [hidden email]
http://www.prodevelop.es
http://www.gvsig.org

_______________________________________________
gvSIG-desktop-devel mailing list
[hidden email]
https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel