Wrong directory of the bat file? - izpack

I am trying to create a installer with IzPack. I am trying to execute a batch file before the installation.
install.xml
<izpack:installation version="5.0"
xmlns:izpack="http://izpack.org/schema/installation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
<guiprefs width="640" height="480" resizable="yes"/>
<variables>
<variable name="DesktopShortcutCheckboxEnabled" value="true"/>
</variables>
<locale>
<langpack iso3="eng"/>
</locale>
<resources>
<res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/>
<res id="shortcutSpec.xml" src="shortcutSpec.xml"/>
<res id="LicencePanel.licence" src="License.txt"/>
<res id="InfoPanel.info" src="Readme.txt"/>
</resources>
<panels>
<panel classname="HelloPanel"/>
<panel classname="ProcessPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="FinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<file src="Readme.txt" targetdir="$INSTALL_PATH"/>
<file src="License.txt" targetdir="$INSTALL_PATH"/>
<file src="phone.ico" targetdir="$INSTALL_PATH"/>
<fileset dir="lib" targetdir="$INSTALL_PATH\lib">
<include name="**"/>
</fileset>
</pack>
</packs>
<native type="izpack" name="ShellLink.dll"/>
<native type="3rdparty" name="COIOSHelper.dll" stage="both">
<os family="windows"/>
</native>
</izpack:installation>
ProcessPanel.Spec.xml
<?xml version="1.0" encoding="UTF-8" ?>
<processing>
<job name="doxyz">
<os family="windows" />
<executefile name="$INSTALL_PATH/scripts/mytest.bat">
<arg>doit</arg><arg>$variable</arg>
</executefile>
</job>
<onFail previous="true" next="false" />
<onSuccess previous="false" next="true" />
</processing>
At the compile time, I don't get any error! But when I am executing the install.jar and when I open the ProcessPanel I am getting the following error:
I used the:
izpack-dist-5.0.6
to generate the installer and my java version is:
java version "1.8.0_66" Java(TM) SE Runtime Environment
(build 1.8.0_66-b18) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

I would call this an expected behaviour.
The file $INSTALL_PATH/scripts/mytest.bat cannot be found because it isn't probably preinstalled due to the activation order of the panels. ProcessPanel is shown before InstallPanel, but InstallPanel is the one installing the file. Problems of this kind the compiler does NOT complain about, you must care about them on your own. It is more or less a problem of the logic introduced by the installer description, not of IzPack.

Related

Does xliff 1.2 supports custom annotations

I am working on a sample file in Xliff 1.2 but confused with annotation.As I didnot find anywhere whether it supports custom annotation or not?
Can anyone refer links for sample xliff1.2 file with annotations(if it supports any kind of annotations)
Thanks
you can read more about this in the following link:
http://docs.oasis-open.org/xliff/v1.2/cs02/xliff-core.html#note
This is an example:
<xliff version="1.2">
<file original="Graphic Example.psd"
source-language="en-US" target-language="ja-JP"
tool="Rainbow" datatype="photoshop">
<header>
<skl>
<external-file uid="3BB236513BB24732" href="Graphic Example.psd.skl"/>
</skl>
<phase-group>
<phase phase-name="extract" process-name="extraction"
tool="Rainbow" date="20010926T152258Z"
company-name="NeverLand Inc." job-id="123"
contact-name="Peter Pan" contact-email="ppan#example.com">
<note>Make sure to use the glossary I sent you yesterday.
Thanks.</note>
</phase>
</phase-group>
</header>
<body>
<trans-unit id="1" maxbytes="14">
<source xml:lang="en-US">Quetzal</source>
<target xml:lang="ja-JP">Quetzal</target>
</trans-unit>
<trans-unit id="3" maxbytes="114">
<source xml:lang="en-US">An application to manipulate and
process XLIFF documents</source>
<target xml:lang="ja-JP">XLIFF 文書を編集、または処理
するアプリケーションです。</target>
</trans-unit>
<trans-unit id="4" maxbytes="36">
<source xml:lang="en-US">XLIFF Data Manager</source>
<target xml:lang="ja-JP">XLIFF データ・マネージャ</target>
</trans-unit>
</body>
</file>
</xliff>

Izpack simple installation just to copy files

I am trying to make a very simplistic installer using IzPack. It should do the following two things
1. Copy and paste all the content of dist directory to UserHome/MyApp dir.
2. Execute a batch file to edit registry entry to start the jar file on user logon.
But I am stuck at the first step only! nothing is installed if I use the following XML and generate the installer. Generated installer runs and does show the InstallPanel but nothing is copied to the user_home directory.
From what it seems like I am not able to assign value to Install_path variable.
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<variables>
<variable name="INSTALL_PATH" value="$USER_HOME/MyApp"/>
</variables>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="My APP Author" email="support#myapp.com"/>
</authors>
<url>http://SomeURL.net</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="InstallPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
UPDATE
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME\MyTeamNinja"/>
<variable name="TargetPanel.dir.mac" value="$USER_HOME/MyTeamNinja"/>
</variables>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="MyTeamNinja" email="support#MyTeamNinja.com"/>
</authors>
<url>http://myteam.ninja</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="DefaultTargetPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
Now as soon as I click the installer it starts the install but in c:\program files\My App\
what you need is a TargetPanel. it allows the user to select the destination dir. to install the files. the location selected in this panel sets the value of $INSTALL_PATH.
however, you may also override the default value of the $INSTALL_PATH.in order to override the default value of $INSTALL_PATH, you may do the following:
<variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME/MyApp"/>
<variable name="TargetPanel.dir.unix" value="$USER_HOME/MyApp"/>
</variables>
or,
<variables>
<variable name="DEFAULT_INSTALL_PATH" value="$USER_HOME/MyApp"/>
</variables>
and also, remember to include the TargetPanel before the InstallPanel in case you choose to allow the user to select the target loc. for the installation.
<panels>
<panel classname="TargetPanel"/>
<panel classname="InstallPanel"/>
</panels>
See HERE for more on this.
UPDATE:
place the entry for TargetPanel before the InstallPanel in the <panels> section.
remove the <resources> section:
<resources>
<res id="TargetPanel.dir.windows" src="$USER_HOME/MyApp"/>
<res id="TargetPanel.dir.unix" src="$USER_HOME/MyApp"/>
</resources> This is where the error is being generated. Instead use <variables> to specify default values for ${INSTALL_PATH} (see in my answer above).
also, to set a value for ${INSTALL_PATH} through <variables> you need to use name="DEFAULT_INSTALL_PATH" or TargetPanel.dir.windows/unix
UPDATE 2: The following piece of code installs in the correct location (as specified by you in the defaultInstallDir.txt).
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<!-- variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME\MyTeamNinja"/>
<variable name="TargetPanel.dir.mac" value="$USER_HOME/MyTeamNinja"/>
</variables -->
<!-- remove the above <varible> section and include the REQUIRED defaultInstallDir.txt to set the value for the DefaultTargetPanel -->
<resources>
<res id="TargetPanel.dir" src="defaultInstallDir.txt"/>
</resources>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="MyTeamNinja" email="support#MyTeamNinja.com"/>
</authors>
<url>http://myteam.ninja</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="DefaultTargetPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
now, create a file named defaultInstallDir.txt and simply write the following within this file :
$USER_HOME/MyApp
just make sure that you include this file correctly in the installer through the src=".." attribute of the <resources> section and you're good to go.
double clicking on the installer directly installs the files in $USER_HOME/MyApp (in my case: at C:\Users\Sunny\MyApp)

setup installer script in magento module

Hi i am developing a little magento module.
below is my directory structure of module
app/code/local/Xyz/Total
/var/www/magext/app/code/local/Xyz/Total/Block/Prototal.php
/var/www/magext/app/code/local/Xyz/Total/controllers/IndexController.php
/var/www/magext/app/code/local/Xyz/Total/etc/config.xml
/var/www/magext/app/code/local/Xyz/Total/Model/Price/Observer.php
below is my config file code
<?xml version="1.0"?>
<config>
<global>
<blocks>
<total>
<class>Xyz_Total_Block</class>
</total>
</blocks>
<models>
<xyztotal>
<class>Xyz_Total_Model</class>
</xyztotal>
</models>
<events>
<sales_order_place_after>
<observers>
<xyz_total_price_observer>
<type>singleton</type>
<class>Xyz_Total_Model_Price_Observer</class>
<method>apply_discount_percent</method>
</xyz_total_price_observer>
</observers>
</sales_order_place_after>
</events>
</global>
<frontend>
<routers>
<total>
<use>standard</use>
<args>
<module>Xyz_Total</module>
<frontName>newcatalog</frontName>
</args>
</total>
</routers>
<layout>
<updates>
<total>
<file>total.xml</file>
</total>
</updates>
</layout>
</frontend>
</config>
now what i need to install a product attribute through my module
.But i cant understand understand where should i put my installer
script and how to modify config file.
please suggest.
I saw your config.xml i am not able to find xml vesrion.
So you need to give xml version like below example:
<config>
<modules>
<Xyz_Total>
<version>0.1.0</version> <!-- Version of module -->
</Xyz_Total>
</modules>
</config>
Now create the file app/code/local/Xyz/Total/sql/total_setup/mysql4-install-0.1.0.ph‌​p
After that reinstall the module And check it.
You also have to add below code in config.xml under config tag.
<global>
<resources> <!-- These are resource setting giving access to module, read/write permission on database -->
<total_setup>
<setup>
<module>Xyz_Total</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</total_setup>
<total_write>
<connection>
<use>core_write</use>
</connection>
</total_write>
<total_read>
<connection>
<use>core_read</use>
</connection>
</total_read>
</resources>
</global>
After that reinstall module.
Take a look # Adding custom product attributes in Magento using setup script
<modules>
<Xyz_Total>
<version>0.1.0</version>
</Xyz_Total>
</modules>
<global>
....
<models>
<xyztotal>
<class>Xyz_Total_Model</class>
<resourceModel>total_setup</resourceModel>
</xyztotal>
</models>
<resources>
<catalog_setup>
<setup>
<module>Mage_Catalog</module>
<class>Mage_Catalog_Model_Resource_Setup</class><!-- that line !-->
</setup>
</catalog_setup>
</resources>
...
In
app/code/local/Xyz/Total/sql/total_setup/mysql4-install-0.1.0.ph‌​p
$installer->addAttribute('catalog_product', 'offer_type', array(
'backend' => '',
...
));

Deploying .war containing JavaFX .jar to GlassFish NoClassDefFoundError

My JavaFX application requires a class in another jar file.
Both are deployed as part of a war file
The JavaFX jar is not finding the my-xxx.class contained in WEB-INF/lib/MyJavaFXClient.jar
The contents of my war file are:
images/
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/lib/
WEB-INF/lib/bin/glass.dll
WEB-INF/lib/MyJavaFxClient.jar ( this is the jar my JavaFX app requires )
WEB-INF/sun-web.xml
WEB-INF/web.xml
index.jsp
index.html
MyJavaFxApp.jnlp
MyJavaFxApp.jar (my JavaFx app)
JNLP:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="MyJavaFxApp.jnlp">
<information>
<title>App: TestDriver</title>
<vendor>Demo</vendor>
<description>JavaFX application test client</description>
<homepage href="http://localhost:8080/testdriver/"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jfx:javafx-runtime version="2.2+"
href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows- i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version="1.6+" java-vm-args="-verbose:class
href="http://java.sun.com/products/autodl/j2se"/>
<property name="javafx.verbose" value="true"/>
<property name="java.library.path" value="WEB-INF/lib/bin"/>
<jar href="MyJavaFxApp.jar" size="318607" download="eager" />
</resources>
<applet-desc width="800" height="600"
main-class="com.javafx.main.NoJavaFXFallback"
name="MyJavaFxApp" >
<param name="requiredFXVersion" value="2.2+"/>
</applet-desc>
<jfx:javafx-desc width="800" height="600"
main-class="ui.client.MyJavaFXMain" name="MyJavaFxApp" />
<update check="background"/>
</jnlp>

WiX Burn custom UI

I am trying to create a custom UI for WiX and Burn. I have followed some of the guides I've found, and so far I have a project that has the following, which inherits from BootstrapperApplication.
namespace MyBA
{
public class TestBA : BootstrapperApplication
{
protected override void Run()
{
MessageBox.Show("My BA is running");
this.Engine.Quit(0);
}
}
}
And in the AssemblyInfo.cs:
[assembly: BootstrapperApplication(typeof(TestBA))]
Then in my Bootstrapper project I have the following.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle Name="MyApplication"
Version="1.0.0"
Manufacturer="Acme Ltd"
UpgradeCode="F84A4058-FDF6-4218-BCB5-12C811DA3C99"
Condition="NOT ((VersionNT = 600 AND ServicePackLevel >=2) OR (VersionNT >= 601))"
IconSourceFile="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)logo.ico"
SplashScreenSourceFile="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Splashscreen.bmp"
DisableRepair="no"
DisableRemove="no"
DisableModify="no">
<WixVariable Id="WixMbaPrereqPackageId"
Value="Netfx4Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl"
Value="NetfxLicense.rtf" />
<WixVariable Id="WixStdbaLicenseRtf"
Value="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Licence.en-gb.rtf" />
<WixVariable Id="WixStdbaLogo"
Value="$(var.MyApplicationInstallerRequiredFiles.ProjectDir)logoInstallSmall.bmp" />
<BootstrapperApplicationRef Id='ManagedBootstrapperApplicationHost'>
<Payload Name='BootstrapperCore.config'
SourceFile='$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Bootstrapper\MyBA.BootstrapperCore.config' />
<Payload SourceFile='$(var.MyApplicationInstallerRequiredFiles.ProjectDir)Bootstrapper\MyBA.dll' />
</BootstrapperApplicationRef>
<Chain>
<PackageGroupRef Id="MyApplicationPackage" />
</Chain>
</Bundle>
</Wix>
and I have added MyBA.BootstrapperCore.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="wix.bootstrapper"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
<section name="host"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
</sectionGroup>
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
<wix.bootstrapper>
<host assemblyName="MyBA">
<supportedFramework version="v4\Full" />
<supportedFramework version="v4\Client" />
</host>
</wix.bootstrapper>
</configuration>
However, whenever I run the Setup.exe for the bootstrapper, I get the splashscreen appear briefly, but nothing else. If I look in the %TEMP% at the logs there is the following
[0A00:0424][2011-11-02T15:52:08]: Burn v3.6.2221.0, path: C:\MyApplication\dev\source\Bootstrapper1\bin\Debug\Setup.exe, cmdline: ''
[0A00:0424][2011-11-02T15:52:08]: Setting string variable 'WixBundleName' to value 'MyApplication'
[0A00:0424][2011-11-02T15:52:08]: Setting string variable 'WixBundleLog' to value 'C:\Users\AppData\Local\Temp\MyApplication_20111102155208.log'
[0A00:0424][2011-11-02T15:52:08]: Condition 'NOT ((VersionNT = 600 AND ServicePackLevel >=2) OR (VersionNT >= 601))' evaluates to true.
[0A00:0424][2011-11-02T15:52:08]: Setting string variable 'WixBundleOriginalSource' to value 'C:\MyApplication\dev\source\Bootstrapper1\bin\Debug\Setup.exe'
[0A00:0424][2011-11-02T15:52:08]: Loading managed bootstrapper application.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to create the managed bootstrapper application.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to create UX.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to load UX.
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed while running
[0A00:0424][2011-11-02T15:52:08]: Error 0x80131040: Failed to run per-user mode.
Why is this happening and why are the above errors occurring?
If you look at the source code for the WixBA, they declare a global Threading.Dispatcher, and then in the overridden Run() method, there is the following line:
Threading.Dispatcher.Run();
I had similar issues, and similarly adding the Threading.Dispatcher to my bootstrapper application fixed them.
Also, if your Bootstrapper Application depends on any other dlls, you need to include them as a <Payload/> under your <BootstrapperApplicationRef/>.