问题
I have to create installer for Jitsi SIP Communicator after I have done changes in it. I have searched on net and found some steps as given below:
SOFTWARE REQUIREMENTS
- Cygwin: include libs "make, gcc & g++" http://cygwin.com/setup.exe
- MinGW: (only gcc, no g++) (use installation file .zip, taken into account that build.xml is looking for a sub-folder x86 y x64 into MinGW root folder) http://sourceforge.net/projects/mingw/files/latest/download Install in C:\MinGW\x86
- copy mingw-make.exe to make.exe (folder C:\MinGW\x86{-}\bin)
- bzip2: (v1.0.5 in this case): install in C:\MinGW\bzip2 http://gnuwin32.sourceforge.net/downlinks/bzip2.php
- xz: (v5.0.3 in this case): unzip in C:\MinGW\xz http://tukaani.org/xz/xz5.0.3windows.zip
- make for win32: (v3.8.1 in this case) http://gnuwin32.sourceforge.net/downlinks/make.php
- wix35-binaries: (v3.5 in this case): unzip in C:\Program Files\WiX
- Use binaries (wix35-binaries.zip), not WiX .msi installer. http://wix.codeplex.com/releases/view/60102#DownloadId=204418
- ant: (v1.8.3 in this case): unzip in C:\apache-ant-1.8.3 http://ant.apache.org/bindownload.cgi
- jdk1.6: (v1.6.0_31 in this case)
ENVIRONMENT VARIABLES:
- Export variables containing:
- ANT_HOME=C:\apache-ant-1.8.3
- JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_31
- Add to PATH : %ANT_HOME%\bin C:\MinGW\bin C:\cygwin\bin C:\MinGW\msys\1.0 C:\Program Files\WiX C:\Program Files (x86)\Gnuwin32\Make\bin
ADDITIONAL TASKS:
- Edit "installers.properties" adding path for JRE files to add into installer and/or for JRE (.zip or folder) files.
- Compile project.
EXECUTE build SCRIPT:
- Launch Cygwin terminal
- Go to /cygdrive/.../{dir_root Jitsi} -Execute: ant build-installation-wix (to create an installer for windows x86) ant build-installation-wix-64 (to create an installer for windows x64) ant build-installation-linux (to create an installer for linux) ant dmg (to create an installer for MacOSX, only run on MacOSX
But when I excute commands given above on cygwin I found the following error:
build-installation-wix-base: [propertyfile] Creating new property file: D:\javaprojects\jitsi\release\windows\versionupdate.properties [mkdir] Created dir: D:\javaprojects\jitsi\release\windows\tmp\light [exec] Makefile:40: * target pattern contains no `%'. Stop.
BUILD FAILED D:\javaprojects\jitsi\resources\install\build.xml:302: The following error occurred while executing this line: D:\javaprojects\jitsi\resources\install\build.xml:403: exec returned: 2
Please suggest a solution.
回答1:
I faced the same issues as you mentioned. I finally tried myself, and built Jitsi in Windows, both 32 bit and 64 bit versions.
I didn't use Cygwin, but just used Mingw+Msys.
Here is what I did:
- Install Mingw + Msys in C:/mingw/x86 folder
- Install ANT
- Install BZip2 in c:/mingw/bzip2
- Install xz in c:/mingw/xz
- Install Wix , I installed in C:/win35. Change the location of wix installation path in resources/install/build.xml 6) Delete the make.exe file inside mingw/msys/1.0/bin and rename the mingw/bin/mingw-make.exe to make.exe
I had to change the Makefiles a little, here are the changes I made:
1) Removed quotes in Target directory initialization:
- target.dir := "$(TARGET_DIR)"
- cygwin.target.dir := "$(TARGET_DIR)"
+ target.dir := $(TARGET_DIR)
+ cygwin.target.dir := $(TARGET_DIR)
2) Changed single line echo into multiline:
- echo.exe -e '#define PRODUCTNAME "$(PRODUCTNAME)"\n#define PRODUCTBUILDVERSION "$(PRODUCTBUILDVERSION)"\n#define
+ echo #define PRODUCTNAME "$(PRODUCTNAME)" > $(cygwin.target.dir)/config.h
+ echo #define PRODUCTBUILDVERSION "$(PRODUCTBUILDVERSION)" >> $(cygwin.target.dir)/config.h
+ echo #define TARGET_BASENAME "$(TARGET_BASENAME)" >> $(cygwin.target.dir)/config.h
+ echo #define TARGET_BASENAME_EXE "$(TARGET_BASENAME).exe" >> $(cygwin.target.dir)/config.h
3) In the resources/install/installers/properties - Specified the location where IzPack is installed, and gave location for zip files of JRE. When I used the setup file of JRE, the build didn't bundle the JRE along"
+windows.jre.zip=C:\\JavaInstallers\\jre32.zip
+windows.jre64.zip=C:\\JavaInstallers\\jre64.zip
Finally, I wrote a simple batch script to build the installer:
set PATH=C:\apps\apache-ant-1.9.1\bin;C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\wix35
set ANT_HOME=C:\apps\apache-ant-1.9.1
set JAVA_HOME=C:/Program Files (x86)\Java\jdk1.7.0_17
set BZ2_HOME=c:/mingw/bzip2_x86
set LZMA_HOME=C:/mingw/xz
set MINGW_HOME=C:/mingw
start /B /LOW /WAIT ant build-installation-wix
This is for the 32 bit version.
For 64 bit though, I had to build bzip2 from source myself. That can be done by downloading Bzip2 source and compile it through mingw. Was an easy task. Rest of the steps are all the same.
Please try this out and let me know if this worked for you.
来源:https://stackoverflow.com/questions/14495465/installer-for-jitsi-sip-communicator