+ Reply to Thread
Results 1 to 4 of 4

Thread: more error information on Create File Association?

  1. #1
    Join Date
    Mar 2004
    Location
    Maarssen (The Netherlands)
    Posts
    6

    Default more error information on Create File Association?

    It seems the only error check I can do after Create File Association is to check if the value of %_SB_ERRORCODE% is non-zero (OK) or zero (not OK)

    When it is zero, however, I would like to get more details about why the Create File Association is failing (Insufficient rights? File type already registered? Something else?)

    In the Setup Builder documentation there are some references to the Windows API GetLastError, but not for Create File Association and also no details about how to obtain the getlasterror value

    How can I get more detailed error information when the Create File Association returns 0 ?

    Arie

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: more error information on Create File Association?

    Hi Arie,

    Hmm, I did a quick source code check and I "think" that this function always returns "0". I don't see any real return code that is passed to %_SB_ERRORCODE% at all. We'll fix this in the next maintenance build. Thank you for bringing this to our attention.

    Friedrich

  3. #3
    Join Date
    Mar 2004
    Location
    Maarssen (The Netherlands)
    Posts
    6

    Default Re: more error information on Create File Association?

    Hi Friedrich,

    will a return value of non-zero in %_SB_ERRROCODE% still mean OK and a value of zero still mean not OK?
    If so, how will I be able to get more info about the cause of the failure?

    Enquiring minds...

    My preference would be (as obviously no-one has paid attention to the value returned into %_SB_ERRORCODE% until now ) that zero would mean OK and non-zero a failure whose meaning can be looked up somewhere.

    Best regards,

    Arie

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: more error information on Create File Association?

    Hi Arie,

    In most cases, we follow the Microsoft return codes. I think that quite a few developers are using the %_SB_ERRORCODE% variable to see if a function succeeded or not. Where possible, the value returns a system error code.

    For example, in the "Edit Service" function:

    - If the function succeeds, the %_SB_ERRORCODE% return value is zero.
    - If the function fails, the return value is a system error code.

    We'll do the same in the "Create File Association" function where the error code is always "0" (not handled at all) at the moment.

    In SetupBuilder 8, we'll introduce a new %_SB_LASTERRORCODE% variable for some functions to retrieve the last returned system error code.

    Friedrich

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •