View Full Version : more error information on Create File Association?
Arie Rens
09-28-2011, 03:06 AM
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
linder
09-28-2011, 03:59 AM
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
Arie Rens
09-28-2011, 07:56 AM
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
linder
09-29-2011, 12:16 AM
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
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.