Create Share question

Got a problem you cannot solve? Try here.
jvinton
Posts: 4
Joined: Wed Feb 06, 2013 6:42 pm

Create Share question

Postby jvinton » Tue Mar 19, 2013 11:47 am

I'd like some help understanding the correct way to use Create Share.

If I give it a variable, such as $TARGETDIR$, it works as expected.

If I give it a string for a non-existent folder, such as "c:\xxx\xxx", it seems to run but nothing happens. No error, the folder isn't created, etc,

How is this supposed to work? How do I trap an error? I need to be able to tell the user that "a share has been created..." or "an error occurred creating a share..."

Is it better to call my own DLL that wraps NetShareAdd() and can return an error code?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Create Share question

Postby FrancescoT » Tue Mar 19, 2013 12:52 pm

Dear User,

Unfortunately, the "Create Share" command doesn't return a result value.

As possible alternative, you can try to verify if that particular folder exist using "Does File/Folder Exist" and then if TRUE, you could use "Create Share" command.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

jvinton
Posts: 4
Joined: Wed Feb 06, 2013 6:42 pm

Re: Create Share question

Postby jvinton » Tue Mar 19, 2013 1:13 pm

FrancescoT wrote:Unfortunately...


Thanks Francesco. I'll make a workaround now that I know how IA handles this.

On one side, I think "IA should be smart enough to return a value from this type of call." But on the other side, I like the way IA works. It requires some extra effort but I prefer software that doesn't try to do everything for everyone.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 168 guests