ElsterFormular

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

ElsterFormular is a software provided by the German tax authorities for submitting tax declarations: www.elster.de

ElsterFormular 13.3[edit]

  <package id='elsterformular_13_3_0_9066'
    name='Elster Formular 13.3.0.9066'
    revision='0'
    reboot='false'
    priority='5' >

    <variable name="PKG_VERSION" value="13.3.0.9066" />

    <check type='uninstall' condition='versiongreaterorequal' path='ElsterFormular' value='%PKG_VERSION%'/>

    <install cmd='&quot;%SOFTWARE%\ElsterFormular %PKG_VERSION%\ElsterFormular.exe&quot; --mode unattended' timeout='300'>
    </install>

    <remove cmd='cscript &quot;%SOFTWARE%\ElsterFormular %PKG_VERSION%\uninstall.js&quot;' timeout='300'>
    </remove>
  </package>

The installer ("ElsterFormular.exe") should be placed in the directory "ElsterFormular 13.3.0.9066" the following script file for the Windows Scripting Host should be placed in the same directory and named "uninstall.js".

var wshShell = WScript.CreateObject("WScript.Shell");
var fs = WScript.CreateObject("Scripting.FileSystemObject");
var allUserAppData = wshShell.RegRead("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Common AppData");
var uninstall = allUserAppData + "\\elsterformular\\setup\\uninstall.exe";
var rc = 0;
if (fs.FileExists(uninstall)) {
  try {
    rc = wshShell.Run("\"" + uninstall + "\" --mode unattended", 0, true);
  } catch (e) {
    WScript.Quit(-1);
  }
  WScript.Sleep(5000);
}
WScript.Quit(rc);

This script is needed because the path of the uninstall program depends on the Windows version (and language) and there is no environment variable for determing the path. On Windows Vista and Windows 7 systems, the path is %PROGRAMDATA%, but this environment variable does not exist on Windows XP. The five seconds wait period after uninstallation is needed, because otherwise WPKG might still see the registry entry from the uninstaller although the uninstall process has been successful.

Links[edit]

  • ELSTER ELSTER website (including download)