PDA

View Full Version : Create Folder part deaux



NewsArchive
06-02-2009, 01:17 AM
Friedrich,

If use Create Folder function for the case where a user enters a new folder
that does not exist how does this function work? For example, none of the
following folders exists (except the drive):

M:\ProgramData\RFI\CoolApp\Data

Is there an issue with creating this? Assume that %DATADIR% is set to the
above folder, then what happens with the following code:

Create Folder "%DATADIR%"
If %_SB_ERRORCODE% Equals "0" Then
Display Message Box "The install was not able to create the data
folder..." -- "Creating the data folder failed"
End

Will the entire folder structure above be created? Or do I need to do
something else?
--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/dev.htm

NewsArchive
06-02-2009, 01:18 AM
Russ,

> Will the entire folder structure above be created? Or do I need to do
> something else?

Yes, this is the correct way to handle this.

Note: %_SB_ERRORCODE% will return "0" (failed) if the folder already exists!
To handle this scenario, use:

If %DATADIR% File or Folder doesn't exist Then
Create Folder "%DATADIR%"
If %_SB_ERRORCODE% Equals "0" Then
Display Message Box "Creating the data folder failed yada"
End
End

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
06-03-2009, 01:34 AM
Thank you! Worked a treat. ;-)

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/dev.htm

NewsArchive
06-03-2009, 01:34 AM
>
> Thank you! Worked a treat. ;-)
>

Cool :-)

Friedrich

NewsArchive
06-03-2009, 01:35 AM
I like the simple solutions <G>

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/dev.htm