Post a reply to the thread: Create Folder and error codes
Click here to log in
What's the name of our main installation product (in uppercase letters), directly followed by the current year?
You may choose an icon for your message from this list
Will turn www.example.com into [URL]http://www.example.com[/URL].
Re: Create Folder and error codes Jimmy, No, there are only two possible return values: 1.) If the function succeeds, the return value is nonzero. 2.) If the function fails, the return value is zero. Friedrich
Re: Create Folder and error codes
Re: Create Folder and error codes Yes that was helpful. Is there a specific error returned for it cannot create the folder? Jimmy
Re: Create Folder and error codes Yes. It makes since now. Will we ever get an error if it just cannot create it, not because it already exists so it did not create it?
Re: Create Folder and error codes Jim, The "Create Folder" function returns "1" in %_SB_ERRORCODE% if the function succeeds (folder was created). It returns "0" if the folder creation failed (e.g. if the folder already existed). "An error occurs if the specified folder already exists" means the function returns "0" (= error) in %_SB_ERRORCODE%. BTW, "Create Folder" is a wrapper around the CreateDirectoryA Windows API. http://msdn.microsoft.com/en-us/libr...55(VS.85).aspx Does this help? Friedrich
Create Folder and error codes I want to check for an error code when I create a folder. I have been creating the folders with no problem, but thought it would wise to check for an error just in case. I get an error code of 0 in my test installer made with SB72 after the create folder function. The folder already exists. The help file says: If the function succeeds, the %_SB_ERRORCODE% return value is nonzero. If the function fails, the return value is zero. Remarks The Create Folder function can be used to create multiple nested directories at the same time. An error occurs if the specified folder already exists. Which one is it really? Maybe I do not need to check for an error when creating a folder in the CSIDL_COMMON_DOCUMENTS location. Or check for the creation of a share or grant access. Jim
Create Folder and error codes
Forum Rules