VirtualBox

Changeset 45317 in vbox


Ignore:
Timestamp:
Apr 3, 2013 5:46:20 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84725
Message:

ARG - installer stub exits successfully on failure. -> windows box

Location:
trunk/src/VBox/Installer/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/Stub/VBoxStub.cpp

    r44529 r45317  
    55
    66/*
    7  * Copyright (C) 2010-2012 Oracle Corporation
     7 * Copyright (C) 2010-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    348348    /* Do not use a global namespace ("Global\\") for mutex name here, will blow up NT4 compatibility! */
    349349    HANDLE hMutexAppRunning = CreateMutex(NULL, FALSE, "VBoxStubInstaller");
    350     if (   (hMutexAppRunning != NULL)
    351         && (GetLastError() == ERROR_ALREADY_EXISTS))
     350    if (   hMutexAppRunning != NULL
     351        && GetLastError() == ERROR_ALREADY_EXISTS)
    352352    {
    353353        /* Close the mutex for this application instance. */
    354354        CloseHandle(hMutexAppRunning);
    355355        hMutexAppRunning = NULL;
    356         return 1;
     356        return RTEXITCODE_FAILURE;
    357357    }
    358358
     
    360360    int vrc = RTR3InitExe(argc, &argv, 0);
    361361    if (RT_FAILURE(vrc))
    362         return vrc;
     362        return RTMsgInitFailure(vrc);
    363363
    364364    /*
     
    494494    }
    495495
     496    /** @todo The rest of this function should be done in smaller functions,
     497     *        we've lost the overview here! Too much state going around! */
     498
    496499    HRESULT hr = S_OK;
    497500
    498501    do /* break loop */
    499502    {
    500         /* Get/create our temp path (only if not already set). */
     503        /*
     504         * Determine and create our temp path (only if not already set).
     505         */
    501506        if (szExtractPath[0] == '\0')
    502507        {
     
    684689                                    if (hModule)
    685690                                        FreeLibrary(hModule);
     691                                    /** @todo program exit code needs to be set */
    686692                                    break;
    687693                                }
     
    690696                            vrc = VERR_NO_CHANGE; /* No change done to the system. */
    691697                        }
     698                        else
     699                            /** @todo program exit code needs to be for ERROR_INSTALL_USEREXIT. */
    692700                    }
    693701                    RTStrFree(pszTempFile);
     
    700708            && RT_SUCCESS(vrc))
    701709        {
    702             for (int i=0; i<5; i++)
     710            for (int i = 0; i < 5; i++)
    703711            {
    704712                vrc = RTDirRemoveRecursive(szExtractPath, 0 /*fFlags*/);
     
    729737    }
    730738
    731     /* Set final exit (return) code (error level). */
     739    /*
     740     * Figure the exit code (not very difficult at the moment).
     741     */
     742    RTEXITCODE rcExit = RTEXITCODE_SUCCESS;
    732743    if (RT_FAILURE(vrc))
    733     {
    734         switch(vrc)
    735         {
    736             case VERR_NO_CHANGE:
    737             default:
    738                 vrc = 1;
    739         }
    740     }
    741     else /* Always set to (VINF_SUCCESS), even if we got something else (like a VWRN etc). */
    742         vrc = VINF_SUCCESS;
    743     return vrc;
    744 }
    745 
     744        rcExit = RTEXITCODE_FAILURE;
     745    return rcExit;
     746}
     747
  • trunk/src/VBox/Installer/win/StubBld/VBoxStubBld.h

    r44529 r45317  
    1616 */
    1717
    18 #pragma once
     18#ifndef ___VBoxStubBld_h___
     19#define ___VBoxStubBld_h___
    1920
    2021#define VBOXSTUB_MAX_PACKAGES 128
    2122
    22 typedef struct
     23typedef struct VBOXSTUBPKGHEADER
    2324{
    24     char szMagic[9];
    25     DWORD dwVersion;
    26     BYTE byCntPkgs;
     25    /** Some magic string not defined by this header? Turns out it's a write only
     26     *  field... */
     27    char    szMagic[9];
     28    /* Inbetween szMagic and dwVersion there are 3 bytes of implicit padding. */
     29    /** Some version number not defined by this header? Also write only field.
     30     *  Should be a uint32_t, not DWORD. */
     31    DWORD   dwVersion;
     32    /** Number of packages following the header. byte is prefixed 'b', not 'by'!
     33     *  Use uint8_t instead of BYTE. */
     34    BYTE    byCntPkgs;
     35    /* There are 3 bytes of implicit padding here. */
     36} VBOXSTUBPKGHEADER;
     37typedef VBOXSTUBPKGHEADER *PVBOXSTUBPKGHEADER;
    2738
    28 } VBOXSTUBPKGHEADER, *PVBOXSTUBPKGHEADER;
    29 
    30 enum VBOXSTUBPKGARCH
     39typedef enum VBOXSTUBPKGARCH
    3140{
    3241    VBOXSTUBPKGARCH_ALL = 0,
    33     VBOXSTUBPKGARCH_X86 = 1,
    34     VBOXSTUBPKGARCH_AMD64 = 2
    35 };
     42    VBOXSTUBPKGARCH_X86
     43    VBOXSTUBPKGARCH_AMD64
     44} VBOXSTUBPKGARCH;
    3645
    37 typedef struct
     46typedef struct VBOXSTUBPKG
    3847{
    3948    BYTE byArch;
     49    /** Probably the name of the PE resource or something, read the source to
     50     *  find out for sure.  Don't use _MAX_PATH, define your own max lengths! */
    4051    char szResourceName[_MAX_PATH];
    4152    char szFileName[_MAX_PATH];
    42 } VBOXSTUBPKG, *PVBOXSTUBPKG;
     53} VBOXSTUBPKG;
     54typedef VBOXSTUBPKG *PVBOXSTUBPKG;
    4355
    4456/* Only for construction. */
     57/* Since it's only used by VBoxStubBld.cpp, why not just keep it there? */
    4558
    46 typedef struct
     59typedef struct VBOXSTUBBUILDPKG
    4760{
    4861    char szSourcePath[_MAX_PATH];
    4962    BYTE byArch;
    50 } VBOXSTUBBUILDPKG, *PVBOXSTUBBUILDPKG;
     63} VBOXSTUBBUILDPKG;
     64typedef VBOXSTUBBUILDPKG *PVBOXSTUBBUILDPKG;
    5165
     66#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette