launching bat file from Izpack installer - izpack

Hi I am currently developing a installer with Izpack 5.
I want to execute a bat file from the installer. I added the processPanelSpec.xml in install.xml but the bat file is not starting.
I am geeting this error:
Launserver.bat not found under izpack-dist/target/staging.

It's late and I'm not familiar with izpack, but at work we have an application deployed with it for which we execute a batch at post install stage with:
<pack name="Network Tools" required="yes"
installGroups="Server upgrade,Server installation">
<description>Network rules</description>
<singlefile src="conf/network/firewall.bat"
target="$INSTALL_PATH/tools/firewall.bat"
override="true"/>
<executable
targetfile="$INSTALL_PATH/tools/firewall.bat"
stage="postinstall" keep="false">
<args>
<arg value="$INSTALL_PATH"/>
</args>
</executable>
</pack>
File is no more available after install, I assume this is due to keep="false".

Related

How to enable AnsiColorLogger by default in Apache Ant?

How can I enable the AnsiColorLogger Apache Ant built-in logger by default without running manually command ant -logger org.apache.tools.ant.listener.AnsiColorLogger or adding the environment variable ANT_ARGS ?
I tried to run the command from the ant build.
build.xml
<exec dir="${sdk.dir}" executable="cmd">
<arg value="${sdk.dir}" />
<arg value="AnsiColorLogger.cmd" />
</exec>
AnsiColorLogger.cmd
START -logger org.apache.tools.ant.listener.AnsiColorLogger
Then I run the ant command to compile my project but the logs are not colored.
Fuiba#FUIBA D:\DEV\TEST\proj
> ant
Buildfile: D:\DEV\TEST\proj\build.xml
Trying to override old definition of task for
[exec] Microsoft Windows [Versione 10.0.10240]
[exec] (c) 2015 Microsoft Corporation. Tutti i diritti sono riservati.
[exec]
[exec] Fuiba#FUIBA D:\DEV\TEST\proj
[exec] >
Instead when I run ant -logger org.apache.tools.ant.listener.AnsiColorLogger it works.
When you say you run ant directly it works, how are you running it? From ant's own documentation it doesn't support Windows NT derivatives (including Windows 8 , 10, etc). From your output, it looks like you're running on Windows, so please go into more detail on how to reproduce this problem.
From ant's manual:
Note: It doesn't work on WinNT and successors, even when a COMMAND.COM console loaded with ANSI.SYS is used.
Source: https://ant.apache.org/manual/index.html
If you are running ant from within a terminal that supports ANSI escape sequences, like Cygwin's MinTTY or CMDER, you try passing the env argument to your exec task:
<exec dir="${sdk.dir}" executable="cmd">
<env key="ANT_ARGS" value="-logger org.apache.tools.ant.listener.AnsiColorLogger"/>
<arg value="${sdk.dir}" />
<arg value="AnsiColorLogger.cmd" />
</exec>
Commander: https://cmder.net/
Cygwin: https://cygwin.com/

MSBuild a .dbproj seems to run twice

When we build our Visual Studio 2010 Database Project from the command line using msbuild.exe it can sometimes run twice from the same command line.
We call msbuild from a nAnt script, and just call the 'Build' target. Our database project is quite large so it can take about 4 mins to run through a single time. When it runs through twice our database build takes over 8 minutes.
Here is the exec section we use to call the build. It runs on a .sln file that only has a single .dbproj in it.
<exec program="${framework::get-tool-path('msbuild.exe')}" append="true" failonerror="true" verbose="true">
<arg value="${database.sln}" />
<arg value="/p:OutputPath=${build.output.database}" />
<arg value="/nologo" />
<arg value="/t:Build" />
<arg value="/p:Configuration=Release" />
<arg value="/p:WorkingDir="."" />
<arg value="/verbosity:normal" />
<arg value="/v:m" />
</exec>
The output we get looks like
Creating a model to represent the project...
Loading project references...
Loading project files...
Building the project model and resolving object interdependencies...
Validating the project model...
(x) problems have been detected.
[a list of warnings based on the db analysis]
The results are saved in (y).
Creating a model to represent the project...
Loading project references...
Loading project files...
Building the project model and resolving object interdependencies...
Validating the project model...
(x) problems have been detected.
[a list of warnings based on the db analysis]
The results are saved in (y).
Can anyone help as to why the target seems to be called twice (only sometimes - I haven't figured out why only sometimes). The script always runs on an empty folder structure so there is never a build output left over from a previous run of the build.
First of all try to change the output verbosity to diagnostic for MSBuild:
<arg value="/v:diag" />
And the same for the Ant script. I don't have experience with Ant , but you shpould know how to do it ;)
Hopefully you will find a reason in the diagnostic logs...
BTW:
You have duplicate command line options for MSBuild. Remove one arg from the following:
<arg value="/verbosity:normal" />
<arg value="/v:m" />
/v is abbreviation for /verbosity see MSDN for MSBuild command line options reference.

MSBuild failing for CruiseControl 1.6

G'day.
We've updated to ccnet 1.6 due to our TFS server being upgraded to 2010.
Within our ccnet.config we're executing a nant (0.9) build script that contains an MSBuild exec task.
Running MSBuild at command line with the parameters as specified by the nant script works okay, but for some reason when ccnet executes the MSBuild task via the nant script it fails with the following:
External Program Failed: C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe (return code was 128)
The nant exec task:
<property name="MSBuildPath" value="${framework.dir}\MSBuild.exe"/>
<exec program="${MSBuildPath}">
<arg line="${project.svds}.sln" />
<arg value="/t:Rebuild" />
<arg value="/p:Configuration=Release" />
<arg value="/p:Platform=x86" />
<arg value="/verbosity:normal" />
<arg line="/logger:'C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll'"/>
</exec>
Unfortunately no more is revealed and it's all rather cryptic.
128 There are no child processes to wait for.
Set MSBuildPath as below and try...
<property name="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe" />
This thread might help you.
EDIT
Possibly this can be due to the service user account. It may be running as the Local System account. Changing the service account - via Control Panel / Administrative Tools / Services may help.

MSBuild calling incorrect version of csc.exe

I am using team city to call a nant script, currently this nant script is very simplistic and only calls an msbuild task on a single project in the solution.
The build is failing, it looks like msbuild 3.5 is being called, but it is incorrectly calling the csc.exe from the .net 2.0 folder. Since we are using .net 3.5 language features the compilation fails.
Looking at the csproj file, both the ToolsVersion and TargetFrameworkVersion are both set to use 3.5. What would be causing msbuild to pick the wrong version of csc.exe?
MSBuild uses a Toolset of tasks, targets, and tools to build an application. Typically, a MSBuild Toolset includes a microsoft.common.tasks file, a microsoft.common.targets file, and compilers such as csc.exe and vbc.exe. To ensure MSBuild invokes the correct C# compiler (csc.exe), specify the Toolset in the ToolsVersion attribute on the Project element in the project file.
The following example specifies that the project should be built by using the MSBuild 4.0 Toolset.
<Project ToolsVersion="4.0" ... </Project>
More information pertaining to the ToolsVersion attribute can be found here:
http://msdn.microsoft.com/en-us/library/78f4aasd.aspx
Do you have the 2.0 version of csc directly in your path, perhaps?
What happens when you run msbuild from a Visual Studio 2008 Command Prompt?
You can directly point which msbuild you want to use in nant script by declaring:
<!-- Initial path to use MSBuild from .NET Framework 3.5 -->
<property name="MSBuildApp" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe" />
And then execute build via msbuild:
<exec failonerror="true" program="${MSBuildApp}" verbose="true">
<arg value="${SlnDir}\${SlnFile}" />
<arg value="/t:Rebuild" />
<arg value="/p:Configuration=${SlnConfig}" />
</exec>
Or you can point to proper .NET framework version when running NANT script:
nant CreateYouProjectTask -t:net-3.5 -buildfile:BuildYourProject.build

Cruise Control.NET File Merge NUnit File - Getting XmlException

I am new to Cruise Control. I'm running a project where I use an MSBuild file to build my project. I'm using the NUNit task in the MSBuild Community Tasks project to run all of my unit tests and output an xml file with the test results with this command:
<NUnit Assemblies="#(OutputFiles)" WorkingDirectory="$(UnitTestResultsLocation)"
OutputXmlFile="$(UnitTestResultsLocation)\$(ProjectNameSpace).UnitTests.xml"
ToolPath="$(NUnitToolPath)"
ContinueOnError="true" />
This works great. Now I'm trying to get those results to show in the Cruise Control web dashboard by doing a file merge with this command:
<publishers>
<merge>
<file>C:\CC\Project1\Code\UnitTestResults\Project1TestResults.UnitTests.xml</file>
</merge>
</publishers>
When I do this, the build still completes, but I get an exception in the Cruise Control console, which also show in the log:
2009-09-03 13:44:57,310 [Project1:DEBUG] Exception: System.Xml.XmlException: Name cannot begin with the '.' character, hexadecimal value 0x2E. Line 837, position 36.
Am I going about this wrong? How can I get my NUnit test results into the Cruise Control dashboard?
Try
<merge>
<files>
<string>C:\CC\Project1\Code\UnitTestResults\Project1TestResults.UnitTests.xml</string>
</files>
</merge>
The following works for me, though I'm using NAnt to trigger NUnit, not MSBuild:
<publishers>
<merge>
<files>
<file>C:\Projects\SomeApp\CI\TestResult.xml</file>
</files>
</merge>
<xmllogger />
</publishers>