1. Changed jsharp files to java files

2. Added CommandLauncher to allow java classes to be invoked from msi install
This commit is contained in:
Greg Richardson
2007-01-24 07:18:15 +00:00
parent 6b83871de5
commit c3aa5727fc
31 changed files with 3046 additions and 3268 deletions

View File

@@ -22,15 +22,13 @@
*
***********************************************************************/
package InitConfigFile;
import java.io.*;
import java.util.*;
/**
* Summary description for Program
*/
public class Program
public class InitConfigFile
{
final static int ERROR_NO_ERROR = 0;
final static int ERROR_INVALID_NUMBER_OF_PARAMS = -1;
@@ -76,10 +74,10 @@ public class Program
public static void main(String[] args)
{
Program p = new Program(args);
InitConfigFile p = new InitConfigFile(args);
}
Program(String[] args)
InitConfigFile(String[] args)
{
int rc = ERROR_NO_ERROR;
@@ -119,7 +117,7 @@ public class Program
{
try
{
log("return code = " + rc);
log(rc);
fw.flush();
fw.close();
}
@@ -399,9 +397,6 @@ public class Program
case ERROR_MISSING_TEMPLATE:
sMessage = "Template file not found";
break;
// case ERROR_TEMPLATE_PROPERTY_MISSING:
// sMessage = "Template file parameter missing";
// break;
case ERROR_OUTPUT_PROPERTY_MISSING:
sMessage = "Output file parameter missing";
break;
@@ -414,6 +409,48 @@ public class Program
case ERROR_MISSING_PROPERTIES:
sMessage = "Properties file not found";
break;
case ERROR_MISSING_TEMPLATE_FILE:
sMessage = "Missing template file";
break;
case ERROR_PROPERTIES_FILE_IS_EMPTY:
sMessage = "Properties file is empty";
break;
case ERROR_MISSING_INSTALL_DIR:
sMessage = "Missing install dir";
break;
case ERROR_INSTALL_DIR_NOT_A_DIR:
sMessage = "Install directory is not a directory";
break;
case ERROR_BAD_INSTALL_DIR_PARAM:
sMessage = "Bad install directory parameter";
break;
case ERROR_BAD_PROPERTY_FILE_PARAM:
sMessage = "Bad property file parameter";
break;
case ERROR_MISSING_PROPERTIES_FILE:
sMessage = "Missing properties file";
break;
case ERROR_MISSING_INSTALL_DIR_PARAM:
sMessage = "Missing install directory parameter";
break;
case ERROR_MISSING_PROPERTY_FILE_PARAM:
sMessage = "Missing property file parameter";
break;
case ERROR_BAD_TEMPLATE_FILE_PARAM:
sMessage = "Bad template file parameter";
break;
case ERROR_BAD_OUTPUT_FILE_PARAM:
sMessage = "Bad output file parameter";
break;
case ERROR_MISSING_TEMPLATE_FILE_PARAM:
sMessage = "Missing template file parameter";
break;
case ERROR_MISSING_OUTPUT_FILE_PARAM:
sMessage = "Missing output file parameter";
break;
case ERROR_BAD_PROPERTY_PARAM:
sMessage = "Bad property parameter";
break;
case ERROR_UNABLE_TO_READ_PROPERTIES:
sMessage = "Unable to read properties file";
break;

View File

@@ -1,47 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E3528B18-D4A0-4604-B2C5-8EE36E094A40}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>InitConfigFile</RootNamespace>
<AssemblyName>InitConfigFile</AssemblyName>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.jsl" />
<Compile Include="Properties\AssemblyInfo.jsl" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualJSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -1,69 +1,77 @@
#######################################################################
#
# Copyright (C) 2004 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Author: Greg Richardson <grichardson@novell.com>
#
#######################################################################
SUBDIRS =
DIST_SUBDIRS =
EXTRA_DIST = InitConfigFile.vjsproj Program.jsl
if DEBUG
TARGET_CFG = Debug
else
TARGET_CFG = Release
endif
PACKAGE = InitConfigFile
TARGET_FILE = $(PACKAGE).exe
LOG_FILE = $(PACKAGE).log
.PHONY: package package-clean package-install package-uninstall devenv
package: $(TARGET_FILE)
devenv:
@if ! test -x "$(VSINSTALLDIR)/Common7/IDE/devenv.exe"; then echo "Error: Microsoft Visual Studio .NET is currently required to build MSI and MSM packages"; exit 1; fi
$(TARGET_FILE): devenv
@rm -f $(LOG_FILE) $@
@CMD='"$(VSINSTALLDIR)/Common7/IDE/devenv.exe" ../server-java_msi/server-java_msi.sln /build $(TARGET_CFG) /project $(PACKAGE) /out $(LOG_FILE)'; \
echo $$CMD; \
if eval $$CMD; then \
ls -l bin/$(TARGET_CFG)/$(TARGET_FILE); \
else \
grep -a "ERROR:" $(LOG_FILE); \
fi
package-clean clean-local:
rm -rf Release/* Release Debug/* Debug*/Release */Debug *.log *.suo
clean:
rm -rf Release/* Release Debug/* Debug */Release */Debug *.log *.suo
distclean-local: package-clean
rm -f Makefile
maintainer-clean-local:
rm -f Makefile.in
#######################################################################
#
# Copyright (C) 2004 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Author: Greg Richardson <grichardson@novell.com>
#
#######################################################################
SUBDIRS =
DIST_SUBDIRS =
EXTRA_DIST = InitConfigFile.java
if DEBUG
TARGET_CFG = Debug
DEBUG = -g
else
TARGET_CFG = Release
DEBUG = -g:none
endif
PACKAGE = InitConfigFile
TARGET_FILE = $(PACKAGE).class
LOG_FILE = $(PACKAGE).log
JAVAFILES = InitConfigFile.java
CLASSES = $(addprefix $(BUILDDIR)/, $(JAVAFILES:%.java=%.class))
BUILDDIR = bin/$(TARGET_CFG)
.PHONY: package package-clean package-install package-uninstall
all: $(BUILDDIR) $(CLASSES)
$(BUILDDIR)/%.class: %.java
@rm -f $(LOG_FILE) $@
@echo [======== Compiling $@ ========]
@javac $(DEBUG) -d $(BUILDDIR) $< 2> $(LOG_FILE)
@echo $$CMD; \
if eval $$CMD; then \
ls -l $(BUILDDIR)/$(TARGET_FILE); \
cp $(BUILDDIR)/$(TARGET_FILE) bin; \
else \
grep -a "ERROR:" $(LOG_FILE); \
fi
$(BUILDDIR):
[ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR)
package-clean clean-local:
rm -rf bin/Release/* bin/Release bin/Debug/* bin/Debug bin/* bin *.log
clean:
rm -rf bin/Release/* bin/Release bin/Debug/* bin/Debug bin/* bin *.log
distclean-local: package-clean
rm -f Makefile
maintainer-clean-local:
rm -f Makefile.in

View File

@@ -1,36 +0,0 @@
import System.Reflection.*;
import System.Runtime.CompilerServices.*;
import System.Runtime.InteropServices.*;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
/** @assembly AssemblyTitle("InitConfigFile") */
/** @assembly AssemblyDescription("") */
/** @assembly AssemblyCompany("Novell") */
/** @assembly AssemblyProduct("InitConfigFile") */
/** @assembly AssemblyCopyright("Copyright © Novell 2006") */
/** @assembly AssemblyTrademark("") */
/** @assembly AssemblyCulture("") */
// The ComVisible attribute controls accessibility of an individual type
// or member, or of all types within this assembly, from COM. To access
// a type or member in this assembly from COM, set the ComVisible attribute
// on that type or member to true.
/** @assembly ComVisible(false) */
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
/** @assembly AssemblyVersion("1.0.0.0") */