Hi Gino,

action position and action condition are very simple.
For your problem, I would execute the custom action at the beginning of the InstallExecuteSequence, not in the InstallUISequence. The InstallExecuteSequence is started, after the user pressed the Next-button in the "Ready to install" dialog. The position is currently determined relative to another CustomAction. You can define the position "end" (including your CustomAction at the end of the table) or you can determine another CustomAction. Then your CustomAction is included before this (Attention: The CustomAction you used to dertermine the position must not be used by another CustomAction, because both would get the same sequence number). So I would suggest something like "MigrateFeatureStates". By the way: For OOo 2.0 I have to think about an easier mechanism for this. Ideally the complete CustomAction definition can be done in scp2 project, not in solenv. Your second question was the custom action condition. You can simply define no condition, then your custom action is always executed. But I would use something like

"Not REMOVE="ALL" And Not Installed"

This means that your custom action is not executed during deinstallation (where REMOVE="ALL" is true) and not during maintenance mode installation (where Installed is true) (probably "Not Installed" is sufficient for both).

Regards

 Ingo


Gino wrote:
Hello Ingo Schmidt!

        Thanks for your reply!

        Now I can code a simply custom action. But I found some keys like
action position and action condition I don't know how to deal with.

For example :
        I want to add a custom action to uninstall the old openoffice.org
1.1.2v before installing the 680 version.I should better let the
installer call my "check_and_delete_old_version" action first. What are
the values of position key and condition key should I code?

        Thank you :-)

Gino
Regards
June.08.2005



Ingo Schmidt wrote:
Hello Gino,

adding a Custom Action to the installation is very simple (although I will have to simplify this process in the near future ;-) )

I.
The source code for the CustomAction has to be defined in cvs module setup_native (setup_native/source/win32/customactions). You can create a new library or use an existing library for which you create a new entry point for the Windows Installer.

II.
(Only if you create a new library) A new library has to be defined in scp2. Then it will be included into the installation set.
Example in file_library_ooo.scp:

#ifdef WNT
File gid_File_Lib_Reg4msdocmsi
    TXT_FILE_BODY;
    Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
    Dir = gid_Dir_Program;
    Name = "reg4msdocmsi.dll";
End
#endif

Flags:
BINARYTABLE: The file is included into the msi database.
BINARYTABLE_ONLY: The file is not installed into the program-directory, it is only part of the msi database.

III.
The entry point of the library has to be defined for the Windows Installer. This has to happen in the future also in the scp project, but is currently only implemented in cws module solenv (solenv/bin/make_installer.pl).
At the end of the file you find the following three code lines:

# adding the custom action for the regactivex in executesequence table into the product (CustomAc.idt and InstallE.idt) $added_customaction = installer::windows::idtglobal::set_custom_action($customactionidttable, $binarytable, "Regactivexdll1", "65", "regactivex.dll", "InstallActiveXControl", 1, $filesinproductlanguageresolvedarrayref, $customactionidttablename); if ( $added_customaction ) { installer::windows::idtglobal::add_custom_action_to_install_table($installexecutetable, "regactivex.dll", "Regactivexdll1", "\&FEATURETEMPLATE=3 And Not PATCH", "end", $filesinproductlanguageresolvedarrayref, $installexecutetablename); }

First "set_custom_action" sets "$added_customaction" only to true, if the library is part of the product. It defines the CustomAction in the table "CustomAction". Therefore you need a Custom Action name ("Regactivexdll1"), the correct type ("65", means 1+64, 1: library in binary table, 64: synchronous execution, ignoring exit code), the library ("regactivex.dll"), the entry point (target "InstallActiveXControl") and a value ("1") showing that the library is part of the binary table. If the Custom Action was added (returning $added_customaction) it has to be called in the InstallExecuteSequence or in the InstallUISequence (or both). The necessary line is written into the table in the function "add_custom_action_to_install_table". Parameter are again the library name, the name of the Custom Action, a condition and a position in the table.

That's it. Then you have to build setup_native, scp2 and instsetoo_native and everything should work fine.
Regards

 Ingo


Gino wrote:

hello everybody.

        I want to add a custom action in openoffice.org win32 installation.
what should I do? and where could I find documents talking about the
custom action?

        thank you. :-)

Regards
Gino
June.07.2005


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to