[wpkg-users] [Bug 114] new parameter /force2 ?

bugzilla-daemon at bugzilla.wpkg.org bugzilla-daemon at bugzilla.wpkg.org
Wed May 7 21:48:42 CEST 2008


http://bugzilla.wpkg.org/show_bug.cgi?id=114


Rainer Meier <r.meier at wpkg.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.meier at wpkg.org




--- Comment #2 from Rainer Meier <r.meier at wpkg.org>  2008-05-07 21:48:34 ---
@#0:
>From the documentation:
/force
        When used in conjunction with /synchronize WPKG will ignore the local
        settings file (wpkg.xml) and re-build the database with installed
        packages.
        When used in conjunction with /remove forces removal of the specified
        package even if not all packages which depend on the one to be removed
        could be removed.

It is exactly the purpose to ignore wpkg.xml and install the packages exactly
as for the first synchronization.
If you want WPKG to regard the local wpkg.xml then do not use the /force
parameter as WPKG cannot know about the previous installation if you use
/force. That's exactly why the /force was introduced.

Unfortunately you did not explain at all what would be wrong when not using the
/force parameter. In fact if /force is not used then WPKG uses the specified
checks to verify if a software is actually still installed correctly. Yes it
does this at every synchronization. So if your checks are correct then there is
really no need to force the re-installation of every package during each boot.

In your case I would say: Simply do not use /force. This will solve it and work
as expected. WPKG will do the VLC upgrade commands. It would be simply a waste
of resources to re-install each package on each boot (what the /force parameter
is actually doing). That's why WPKG supports appropriate checks to verify the
installed package.

Probably you could specify a bit more your "various reasons" why you use the
inappropriate /force parameter. In my eyes it is just useless and dangerous in
productive environments and more to be used as a debug parameter on clients
where a forced re-installation is required.

If you want to execute a package installation on each synchronization simply
use the execute=always flag in the package definition. This will also regard
the upgrade procedure. It seems to be exactly what you want to achieve.

1. package not installed => execute install commands
2. package already there (same version) => re-install (install commands)
3. package already there (new version available) => execute upgrade

So please specify in which "sense" your use case is different from the outlined
one. I do not accept "various reasons" as a reason to spend time on such a
feature.

@#2
Yes, just add the uninstall command-line to the install commands. But please
take care of the exit code in case it is not installed and calling
uninstallation fails.
Unfortunately such a work-around is required for VLC as it is reluctant to
upgrade silently if a previous version is already installed.
Personally I wrote a small batch script: unattended.cmd
@echo off

set BINARY=vlc-0.8.6f-win32.exe

echo Installing VLC media plyer

set INSTALLER_LOC=%~dp0
set EXIT_CODE=0
set PROG_FILES=%ProgramFiles%
if not "%ProgramFiles(x86)%" == "" set PROG_FILES=%ProgramFiles(x86)%

echo - Removing previous version "%INSTALLER_LOC%unattended-uninstall.cmd"
call "%INSTALLER_LOC%unattended-uninstall.cmd"

echo - Installing player
start /wait "VLC" "%INSTALLER_LOC%%BINARY%" /S /NCRC /D="%PROG_FILES%"
set EXIT_CODE=%ERRORLEVEL%

call "%INSTALLER_LOC%cleanup.cmd"

exit /B %EXIT_CODE%

it calls unattended-uninstall.cmd:

@echo off

echo Removing VLC media plyer

set INSTALLER_LOC=%~dp0
set UNINSTALLER=VideoLAN\VLC\uninstall.exe
set OPTIONS=/S
set PROG_FILES=%ProgramFiles%
if not "%ProgramFiles(x86)%" == "" set PROG_FILES=%ProgramFiles(x86)%

if not exist "%PROG_FILES%\%UNINSTALLER%" goto end
start /wait "VLC uninstall" "%PROG_FILES%\%UNINSTALLER%" %OPTIONS%
REM Unfortunately the uninstaller seems to fork a child process and the parent
REM process exits immediately. So give it some time to uninstall
REM Get sleep.exe from the Windows Resource Kit Tools
for /L %%C IN (1,1,30) DO (
  if not exist "%PROG_FILES%\%UNINSTALLER%" goto end
  "%INSTALLER_LOC%sleep.exe" 1
)

:end


the uninstall script I added to the remove commands. The install and upgrade
commands both point to "unattended.cmd" it tries to remove a previous version
and discards the exit code of the uninstall command.

Works absolutely OK. If you want to fix it please file a bug to the VLC
developers.


-- 
Configure bugmail: http://bugzilla.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the wpkg-users mailing list