NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed. (sponsored)
In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.
Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.
Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Julien Ponge, author of IzPack, describes how you can easily create a native installer that handles the missing JRE problem. Read on for how easy it can be!
Name "${PRODUCT_NAME}"
OutFile "Install_${PRODUCT_NAME}.exe"
; Some default compiler settings (uncomment and change at will):
SetCompressor lzma
SetCompress auto ; (can be off or force)
; SetDatablockOptimize on ; (can be off)
CRCCheck on ; (can be off)
; AutoCloseWindow false ; (can be true for the window go away automatically at end)
ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
; SetDateSave off ; (can be on to have files restored to their orginal date)
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${COMPANY_NAME}\${PRODUCT_NAME}" ""
;DirShow hide ; make this show to let the user change it)
; Delete Uninstaller
Delete "$INSTDIR\Uninstall.exe"
SectionEnd ; end of uninstall section
; eof
Notes
In the launcher script ${APPNAME}.exe is a copy of either java.exe or javaw.exe . It is so that in the process list you get ${APPNAME}.exe instead of java.exe or javaw.exe .
installDir includes the bundled JRE, jar files, and other resource files. As per the README.txt of the JRE remove the optional files that you don't use from the bundled JRE.
Using these scripts I have gotten the installer down under 10MB with Sun's JRE 1.4.2 included. The resulting installer is very simple to use, no need for the end-user to know about Java or installation of JRE. The disadvantage is the JRE is not installed system wide.
Re: Building Native Windows Installers with IzPack Native Launcher
Hi Julian:
Thanks for your article.
I followed the instructions and in the end i get the same output file you do an .exe.
However when I tried to run the .exe i get an 7-zip dialog box asking me if I want to unpack the files.
This is, I don't get the 'izpack' installation dialog box.
Re: Building Native Windows Installers with IzPack Native Launcher
This links to a page I created that explains a similar method using launch4j and Orangevolt ANT tasks to create a native launcher for Windows that includes and installs a JRE, with the build occuring on Linux. --Scott Plante
Building Native Windows Installers with IzPack Native Launcher
At 2:23 PM on Feb 23, 2005, Matthew Schmidt wrote:
Fresh Jobs for Developers Post a job opportunity
Read the full article now!
3 replies so far (
Post your own)
Re: Building Native Windows Installers with IzPack Native Launcher
Using NSIS (see http://nsis.sourceforge.net/) I have the following scripts:Program Launcher
; Program Launcher
!define APPNAME "MyApp"
!define CLASSPATH "lib\somelib.jar;lib\someotherlib.jar"
!define MAINCLASS "app.StartUp"
; Uncomment the next line to specify an icon for the EXE
Icon "myApp.ico"
;--------------------------
Name "${APPNAME}"
Caption "${APPNAME}"
OutFile "installDir\${APPNAME}.exe"
SilentInstall silent
ShowInstDetails nevershow
AutoCloseWindow true
Section ""
SetOutPath $EXEDIR
Exec '$EXEDIR\jre\bin\${APPNAME}.exe -classpath ${CLASSPATH} ${MAINCLASS}'
SectionEnd
Installer script
!define PRODUCT_NAME "MyProduct"
!define COMPANY_NAME "MyCompany"
; ----------------------------
Name "${PRODUCT_NAME}"
OutFile "Install_${PRODUCT_NAME}.exe"
; Some default compiler settings (uncomment and change at will):
SetCompressor lzma
SetCompress auto ; (can be off or force)
; SetDatablockOptimize on ; (can be off)
CRCCheck on ; (can be off)
; AutoCloseWindow false ; (can be true for the window go away automatically at end)
ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
; SetDateSave off ; (can be on to have files restored to their orginal date)
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${COMPANY_NAME}\${PRODUCT_NAME}" ""
;DirShow hide ; make this show to let the user change it)
Section "" ; (default section)
SetOutPath "$INSTDIR"
; add files / whatever that need to be installed here.
File /r "installDir\*"
; allow write access to database folder
AccessControl::GrantOnFile "$INSTDIR\resources\db" "BUILTIN\USERS" "FullAccess"
; create desktop shortcut
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe" ""
; create start-menu items
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe" "" "$INSTDIR\${PRODUCT_NAME}.exe" 0
; write uninstall registry keys
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\${COMPANY_NAME}\${PRODUCT_NAME}" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME} (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoModify" "1"
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" "1"
; write out uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd ; end of default section
; begin uninstall settings/section
UninstallText "This will uninstall ${PRODUCT_NAME} from your system"
Section Uninstall
; Delete installation files
RMDir /r "$INSTDIR"
; Delete Desktop Shortcut
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
; Delete Start Menu Shortcuts
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk"
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk"
RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
; Delete uninstall registry keys
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${COMPANY_NAME}\${PRODUCT_NAME}"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
; Delete Uninstaller
Delete "$INSTDIR\Uninstall.exe"
SectionEnd ; end of uninstall section
; eof
Notes
In the launcher script ${APPNAME}.exe is a copy of either java.exe or javaw.exe . It is so that in the process list you get ${APPNAME}.exe instead of java.exe or javaw.exe .
installDir includes the bundled JRE, jar files, and other resource files. As per the README.txt of the JRE remove the optional files that you don't use from the bundled JRE.
Using these scripts I have gotten the installer down under 10MB with Sun's JRE 1.4.2 included. The resulting installer is very simple to use, no need for the end-user to know about Java or installation of JRE. The disadvantage is the JRE is not installed system wide.
Re: Building Native Windows Installers with IzPack Native Launcher
Hi Julian:Thanks for your article.
I followed the instructions and in the end i get the same output file you do an .exe.
However when I tried to run the .exe i get an 7-zip dialog box asking me if I want to unpack the files.
This is, I don't get the 'izpack' installation dialog box.
Any idea what it could have gone wrong.
Best Regards,
Marlon
Re: Building Native Windows Installers with IzPack Native Launcher
This links to a page I created that explains a similar method using launch4j and Orangevolt ANT tasks to create a native launcher for Windows that includes and installs a JRE, with the build occuring on Linux. --Scott Plantehttp://openfacts.berlios.de/index-en.phtml?title=IzPack/JRE-Install