CABs installieren mit Mort

  • Dieser Lösungsansatz ist, so meine ich es, selbsterklärend. Ich mache ihn
    hiermit öffentlich, weil vielleicht irgendwer das für sich brauchen kann: einen
    support liefere ich nicht - danke für Euer Verständnis.


    ###############################################################################
    #
    # INSTALL_CAB_PROMPT.mscr
    #
    # Author: jwoegerbauer
    #
    # GNU General Public License (GPL), Version 2, June 1991
    #
    # Release: 0.a
    #
    # Abstract:
    # to install a cab file we use the wceload.exe
    # ( the cab installation utility of Windows CE ... )
    #
    # thanks to this utility, I got rid of copying CABs to PNA, clicking in
    # the file explorer, copying the CAB file to a secure place if I need
    # reinstalling, etc. Even if its not that difficult, its a waste of time.
    #
    # Note:
    # see also
    # http://forum.xda-developers.com/showthread.php?t=289197&page=71
    #
    ###############################################################################
    #
    Local()
    isRunning = ProcExists( "INSTALL_CAB_PROMPT" )
    # if INSTALL_CAB_PROMPT.exe is already running close it.
    # This is done to get consistent operation
    If ( isRunning )
    Close( "INSTALL_CAB_PROMPT" )
    Sleep 100
    EndIf
    #
    Set YIELD, "300"
    #
    # adjust to your needs
    Set CAB_DIR, "\Storage Card\Cabs"
    Sleep 100
    #
    If (Not DirExists(%CAB_DIR%))
    SetMessageFont(20, "Verdana")
    BigMessage("^NL^^NL^Verzeichnis^NL^" & %CAB_DIR% & "^NL^nicht gefunden.", \
    "Fehler")
    #
    # go out
    Exit
    EndIf
    #
    # populate 2 arrays:
    # CabFilesFound holds fullfilepathnames
    # CabFiles holds the filename
    n=0
    ForEach FileName in files (%CAB_DIR% & "\*.cab")
    n=n+1
    CabFilesFound[n] = FileName
    #
    # extract filename from full pathname
    Split(CabFilesFound[n], "\", 0, parts )
    CabFiles[n] = parts[ ElementCount( parts ) ]
    #
    # free mem
    Clear(parts)
    Sleep %YIELD%
    #
    EndForEach
    #
    If(n < 1)
    SetMessageFont(20, "Verdana")
    BigMessage("^NL^^NL^Keine .CAB Dateien im Verzeichnis^NL^" & %CAB_DIR% & "^NL^gefunden.",\
    "Fehler")
    #
    # free mem
    Clear(CabFiles)
    Clear(CabFilesFound)
    Sleep 100
    #
    # go out
    Exit
    EndIf
    #
    # preset to cancelled
    index=0
    #
    SetChoiceEntryFormat(26, 20, "Verdana")
    index = Choice("CabInstaller", "^NL^*** Wählen Sie die zu installierende .CAB Datei ***^NL^", \
    0,0, CabFiles)
    #
    # free mem
    Clear(CabFiles)
    #
    If(index=0)
    #
    # free mem
    Clear(CabFilesFound)
    Sleep 100
    #
    # go out
    Exit
    EndIf
    #
    Set CAB_SELECTED, CabFilesFound[index]
    #
    # free mem
    Clear(CabFilesFound)
    Sleep %YIELD%
    #
    # Using "/noui" in the "wceload" command line it will install to the default
    # location, skipping some prompts. Of course, if you want to wait for a window
    # to pop up, you would need to change the RunWait to Run.
    # Reply With Quote
    #
    RunWait( "\Windows\wceload.exe", "/noui /delete 0 " & """" & %CAB_SELECTED% & """" )
    SetMessageFont(20, "Verdana")
    BigMessage( "...CAB Datei installiert" )
    #
    # done
    Exit
    ################################################################################