Я пытаюсь создать msi для своего приложения.
Я передаю параметр client и version, используя команду:
C: \ my client \ nant -D:client = abc -D: версия = 1.0
Я получаю следующее сообщение об ошибке:
**
[msi] Building Installer Database 'C:\irx-client\irxclient.msi'.
[msi] Adding Properties:
[msi] ProductName
[msi] ProductVersion
[msi] Manufacturer
[msi] ProductCode
[msi] UpgradeCode
[msi] ALLUSERS
[msi] TARGETDIR
[msi] Adding Directories:
[msi] client
[msi] bitmaps
[msi] icsrun552
[msi] nls
[msi] reports
[msi] Compressing Files...
[exec] Starting 'cabarc (-r N C:\my-client\target\myclient.cab *)' in 'C:\Documents and Settings\user123\Local Settings\Temp\tmp12AE.tmp' BUILD FAILED
**
Тем не менее, я могу вручную успешно выполнить следующую команду:
C:\my-client\target\cabarc -r -p n myclient.cab *.*
Я установил cabarc.exe, nantcontrib и microsoft platform sdk и включил их в переменную PATH.Я делаю неправильно здесь.
Сводка скрипта nant:
- Копирование файлов в \ target \ appname-version \
- создание msi, содержащего все файлы и папкив \ target \ appname-version \
<?xml version="1.0"?>
<project name="my client" default="msi-package">
<!-- import the extra libraries -->
<loadtasks assembly="${path::combine(environment::get-variable('NANT_HOME'),'contrib/bin/NAnt.Contrib.Tasks.dll')}"/>
<!--********************************************************************
Initialize all the required variables
************************************************************************-->
<property name="source-core" value="./src/core" />
<property name="client" value="client" overwrite="false"/>
<property name="version" value="3.3.9.7.6" overwrite="false"/>
<property name="client-target" value="./target/appname-version" />
<property name="source-bank" value="./src/${client}"/>
<property name="ProductName" value="appname" />
<property name="ProductVersion" value="${version}"/>
<property name="ProductManufacturer" value="manufacturer Inc"/>
<echo message="${client}"/>
<echo message="${version}"/>
<!--********************************************************************
Delete 'target' folder if it exists and create a new empty target folder.
************************************************************************-->
<target name="clean">
<delete dir="./target" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="target" />
<property name="target" value="./target" />
</target>
<!--**************************************************************************************
Copy files from /src/core and /src/client to target/appname-version
****************************************************************************************-->
<target name="copy-core" depends="prepare">
<copy todir="${client-target}">
<fileset basedir="${source-core}">
<include name="**/*.*" />
</fileset>
</copy>
</target>
<target name="copy-bank" depends="copy-core">
<copy todir="${client-target}" overwrite="true">
<fileset basedir="${source-bank}">
<include name="**/*.bmp"/>
<include name="**/*.exe"/>
<include name="**/*.icx"/>
<include name="**/*.img"/>
<include name="**/*.ini"/>
<include name="**/*.txt"/>
<include name="**/nls/*.*"/>
<include name="**/Reports/*.*"/>
</fileset>
</copy>
</target>
<!--**************************************************************************************
msi part should go in this section
*****************************************************************************************-->
<target name="msi-package" depends="copy-bank">
<!--this section calls the cabarc.exe which has been installed and the PATH environment variable has been edited to include the exe-->
<setenv>
<variable name="PATH" path="C:\Program Files\NAnt\bin\;%PATH%" />
</setenv>
<msi sourcedir="C:\my-client\target" output="C:\my-client\myclient.msi" verbose="true" debug="true">
<properties>
<property name="ProductName" value="appname" />
<property name="ProductVersion" value="${version}"/>
<property name="Manufacturer" value="mamufacturer Inc."/>
<property name="ProductCode" value="{}" />
<property name="UpgradeCode" value="{}" />
<property name="ALLUSERS" value="2" />
<property name="TARGETDIR" value="C:\appname-version" />
</properties>
<directories>
<directory name="C_CLIENT" foldername="client" root="TARGETDIR"/>
<directory name="C_BITMAP" foldername="bitmaps" root="TARGETDIR"/>
<directory name="C_ICSRUN" foldername="icsrun552" root="TARGETDIR" />
<directory name="C_NLS" foldername="nls" root="TARGETDIR" />
<directory name="C_RPTS" foldername="reports" root="TARGETDIR" />
</directories>
</msi>
</target>
</project>