On 2/15/09, <b class="gmail_sendername">Mathieu Simon</b> <<a href="mailto:mathieu.sim@gmail.com">mathieu.sim@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
While this solutions works fine you will need to have a good eye on<br> packaging in mixed environments because you have to know, which host<br> needs to get the x64 package and which the x86 one. Did I oversee<br> something on the docs?<br>
</blockquote></div><br><div style="text-align: left;"><span id="_user_r.meier@wpkg.org" style="color: rgb(0, 0, 0);">Rainer </span>has some .cmd files that allow you to set the name of the 32-bit and the 64-bit installer for a certain program. The .cmd does a rudimentary check for a 32-bit or 64-bit system and executes the appropriate installer. Here's an example of one of his package definitions along with his .cmd files from a previous post:<br>
<br>Package example:<br>
<?xml version="1.0" encoding="utf-8" ?><br>
<packages><br>
<br>
<package id='TortoiseSVN' name='TortoiseSVN' revision='156' priority='50' reboot='false' ><br>
<!-- TortoiseSVN --><br>
<div style="direction: ltr;"><span class="q"> <check type='logical' condition='or'><br>
</span></div> <check type='uninstall' condition='exists' path='TortoiseSVN 1.5.6.14908 (32 bit)' /><br>
<check type='uninstall' condition='exists' path='TortoiseSVN 1.5.6.14908 (64 bit)' /><br>
</check><br>
<install <span id="st" name="st" class="st">cmd</span>='"%SOFTWARE%\software.free\TortoiseSVN v.1.5.6.14908\unattended.<span id="st" name="st" class="st">cmd</span>"' ><br><div style="direction: ltr;">
<exit code='3010' /><br>
</install><br>
<remove <span id="st" name="st" class="st">cmd</span>='"%SOFTWARE%\software.free\TortoiseSVN v.1.5.6.14908\unattended-uninstall.<span id="st" name="st" class="st">cmd</span>"' ><br>
<exit code='3010' /><br>
</remove><br>
<upgrade <span id="st" name="st" class="st">cmd</span>='"%SOFTWARE%\software.free\TortoiseSVN v.1.5.6.14908\unattended.<span id="st" name="st" class="st">cmd</span>"' ><br>
<exit code='3010' /><br>
</upgrade><br>
</package><br>
<br>
</packages><br>
<br>
<br>
<br>
unattended.<span id="st" name="st" class="st">cmd</span>:<br>
@echo off<br>
<br>
set CMD32=TortoiseSVN-1.5.6.14908-win32-svn-1.5.5.msi<br>
set CMD64=TortoiseSVN-1.5.6.14908-x64-svn-1.5.5.msi<br>
set INSTALLER=install.<span id="st" name="st" class="st">cmd</span><br>
set INSTALLER_LOC=%~dp0<br>
<br>
echo Installing TortoiseSVN<br>
<br>
call "%INSTALLER_LOC%%INSTALLER%" msiinstall "%CMD32%" "%CMD64%"<br>
<br>
<br>
<br>
<br>
<br>
unattended-uninstall.<span id="st" name="st" class="st">cmd</span>:<br>
@echo off<br>
<br>
set CMD32=TortoiseSVN-1.5.5.14361-win32-svn-1.5.4.msi<br>
set CMD64=TortoiseSVN-1.5.5.14361-x64-svn-1.5.4.msi<br>
set INSTALLER=install.<span id="st" name="st" class="st">cmd</span><br>
set INSTALLER_LOC=%~dp0<br>
<br>
echo Removing TortoiseSVN<br>
<br>
call "%INSTALLER_LOC%%INSTALLER%" msiuninstall "%CMD32%" "%CMD64%"<br>
<br>
<br>
<br>
<br>
<br>
<br>
install.<span id="st" name="st" class="st">cmd</span>:<br>
@echo off<br>
<br>
REM Usage:<br>
REM msiinstall.<span id="st" name="st" class="st">cmd</span> <type> <32-bit-installer> <64-bit-installer> [installer-location [custom-options]]<br>
REM where type is one of<br>
REM msiinstall Install the given MSI package<br>
REM msiuninstall Uninstall the given MSI package<br>
REM install4j Install4J setup<br>
REM innosetup Inno setup<br>
REM installshield Install shield<br>
REM nsis Nullsoft install system (NSIS)<br>
REM custom Custom installer - options required in this case<br>
REM 32-bit-installer Full file name (including extension) of 32-bit installer<br>
REM 64-bit-installer Full file name (including extension) of 64-bit installer<br>
REM installer-location Path where the installers are stored, if empty assumes directory where install.<span id="st" name="st" class="st">cmd</span> is<br>
REM custom-options Replace the default installer options with the ones given<br>
<br>
REM Global variables<br>
set INSTALL_CMD=<br>
set EXIT_CODE=0<br>
<br>
REM Get command type<br>
set TYPE=%~1<br>
<br>
REM Get 32-bit installer name<br>
set CMD32=%~2<br>
<br>
REM Get 64-bit installer name<br>
set CMD64=%~3<br>
<br>
REM get file path<br>
set INSTALLER_PATH=%~dp0<br>
if not "%~4" == "" (<br>
set INSTALLER_PATH=%~4<br>
)<br>
<br>
set OPTIONS=<br>
if not "%~5" == "" (<br>
set OPTIONS=%~5<br>
)<br>
<br>
<br>
REM Detect which system is used<br>
if not "%ProgramFiles(x86)%" == "" goto 64bit<br>
goto 32bit<br>
<br>
<br>
REM ##########################################################################<br>
REM 64-bit system detected<br>
REM ##########################################################################<br>
:64bit<br>
REM Determine 64-bit installer to be used<br>
echo 64-bit system detected.<br>
REM set INSTALLER64=<br>
if not "%CMD64%" == "" (<br>
set INSTALLER64=%CMD64%<br>
) else (<br>
REM Use 32-bit installer if available, no 64-bit installer available.<br>
if not "%CMD32%" == "" (<br>
echo Using 32-bit installer, no 64-bit installer specified.<br>
set INSTALLER64=%CMD32%<br>
) else (<br>
echo Neither 64-bit nor 32-bit installer specified. Exiting.<br>
goto usage<br>
)<br>
)<br>
<br>
REM Check if installer is valid<br>
if exist "%INSTALLER_PATH%%INSTALLER64%" (<br>
set INSTALL_CMD=%INSTALLER_PATH%%INSTALLER64%<br>
) else (<br>
echo Installer "%INSTALLER_PATH%%INSTALLER64%" cannot be found! Exiting.<br>
exit /B 97<br>
)<br>
goto installerselection<br>
<br>
<br>
REM ##########################################################################<br>
REM 32-bit system detected<br>
REM ##########################################################################<br>
:32bit<br>
REM Determine 32-bit installer to be used<br>
echo 32-bit system detected.<br>
set INSTALLER32=<br>
if not "%CMD32%" == "" (<br>
set INSTALLER32=%CMD32%<br>
) else (<br>
echo No 32-bit installer specified. Exiting.<br>
exit /B 96<br>
)<br>
<br>
<br>
REM Check if installer is valid<br>
if exist "%INSTALLER_PATH%%INSTALLER32%" (<br>
set INSTALL_CMD=%INSTALLER_PATH%%INSTALLER32%<br>
) else (<br>
echo Installer "%INSTALLER_PATH%%INSTALLER32%" cannot be found! Exiting.<br>
exit /B 95<br>
)<br>
goto installerselection<br>
<br>
<br>
<br>
REM ##########################################################################<br>
REM select installer system<br>
REM ##########################################################################<br>
:installerselection<br>
if /i "%TYPE%" == "msiinstall" goto msiinstaller<br>
if /i "%TYPE%" == "msiuninstall" goto msiuninstaller<br>
if /i "%TYPE%" == "install4j" goto install4j<br>
if /i "%TYPE%" == "innosetup" goto innoinstaller<br>
if /i "%TYPE%" == "installshield" goto installshieldinstaller<br>
if /i "%TYPE%" == "nsis" goto nsisinstaller<br>
if /i "%TYPE%" == "custom" goto custominstaller<br>
goto usage<br>
<br>
<br>
<br>
:msiinstaller<br>
echo Installing "%INSTALL_CMD%"<br>
if "%OPTIONS%" == "" (<br>
set OPTIONS=/qn /norestart<br>
)<br>
start /wait "Software installation" msiexec /i "%INSTALL_CMD%" %OPTIONS%<br>
set EXIT_CODE=%ERRORLEVEL%<br>
goto end<br>
<br>
<br>
:msiuninstaller<br>
echo Uninstalling "%INSTALL_CMD%"<br>
if "%OPTIONS%" == "" (<br>
set OPTIONS=/qn /norestart<br>
)<br>
start /wait "Software uninstallation" msiexec /x "%INSTALL_CMD%" %OPTIONS%<br>
set EXIT_CODE=%ERRORLEVEL%<br>
goto end<br>
<br>
<br>
:install4j<br>
echo Installing "%INSTALL_CMD%"<br>
start /wait "Software installation" "%INSTALL_CMD%" -q %OPTIONS%<br>
set EXIT_CODE=%ERRORLEVEL%<br>
goto end<br>
<br>
<br>
:innoinstaller<br>
echo Installing "%INSTALL_CMD%"<br>
REM if "%OPTIONS%" == "" (<br>
REM set OPTIONS=/verysilent /norestart /sp-<br>
REM )<br>
start /wait "Software installation" "%INSTALL_CMD%" /verysilent /norestart /sp- %OPTIONS%<br>
set EXIT_CODE=%ERRORLEVEL%<br>
goto end<br>
<br>
<br>
:installshieldinstaller<br>
echo Installing "%INSTALL_CMD%"<br>
start /wait "Software installation" "%INSTALL_CMD%" /s %OPTIONS%<br>
set EXIT_CODE=%ERRORLEVEL%<br>
goto end<br>
<br>
<br>
:nsisinstaller<br>
echo Installing "%INSTALL_CMD%"<br>
start /wait "Software installation" "%INSTALL_CMD%" /S %OPTIONS%<br>
set EXIT_CODE=%ERRORLEVEL%<br>
goto end<br>
<br>
:custominstaller<br>
if "%OPTIONS%" == "" goto usage<br>
echo Installing "%INSTALL_CMD%"<br>
start /wait "Software installation" "%INSTALL_CMD%" %OPTIONS%<br>
set EXIT_CODE=%ERRORLEEL%<br>
goto end<br>
<br>
:usage<br>
echo Usage:<br>
echo "%~nx0 <type> <32-bit-installer> <64-bit-installer> [installer-location [custom-options]]"<br>
echo where type is one of<br>
echo msiinstall Install the given MSI package<br>
echo msiuninstall Uninstall the given MSI package<br>
echo innosetup Inno setup<br>
echo installshield Install shield<br>
echo nsis Nullsoft install system (NSIS)<br>
echo custom Custom installer - options required in this case<br>
echo 32-bit-installer Full file name (including extension) of 32-bit installer<br>
echo 64-bit-installer Full file name (including extension) of 64-bit installer<br>
echo installer-location Path where the installers are stored<br>
echo custom-options Replace the default installer options with the ones given<br>
exit /B 99<br>
<br>
:end<br>
exit /B %EXIT_CODE%</div><br></div>