Posted by stig_o_n in SWF Studio V3 on Aug 02 2008, 10:29 am

Hi

To make my program Vista compatible I'm relocating users files to the "C:\\Documents and Settings\\All Users\\Programdata\\xxxx". Hardcoding the files works fine, but using the moniker "allusersappdata" or "appdata" does not work:

ssCore.FileSys.copyFolder({from:ssGlobals.ssStartDir+"\\programdata", to:"allusersappdata://test", failIfExists:true}, {callback:"sjekkDataPlassering", scope:_root});

Other monikers like "windows" or "programfiles" does work!

I'm currently working in Xp.

Stig


Posted by AGo in SWF Studio V3 on Aug 02 2008, 01:47 pm

what error do you get back?


Posted by stig_o_n in SWF Studio V3 on Aug 02 2008, 05:03 pm

Just "Operation failed."


Posted by northcode in SWF Studio V3 on Aug 03 2008, 12:12 am

The from location should probably be "C:\Documents and Settings\All Users\ Application Data\Xxx" but then you should be getting a different error like "not found" instead of the generic "operation failed".

Can you try calling ssCore.Shell.resolveMoniker on the paths you're passing to see what SWF Studio is trying to do? The resolveMoniker function will replace any monikers it finds and return the full path so you can see how it will be expanded by other functioons. You can just trace out ssGlobals.ssStartDir+"\\programdata" thoough.


r = ssCore.Shell.resolveMoniker({path:"allusersappdata://test"});
ssDebug.trace(r.result);
ssDebug.trace(ssGlobals.ssStartDir+"\\programdata");


You might want to try calling ssCore.FileSys.dirExists those paths too, just to make sure they exist.


r = ssCore.FileSys.dirExists({path:"allusersappdata://test"});
ssDebug.trace(r.result);

r = ssCore.FileSys.dirExists({path:ssGlobals.ssStartDir+"\\programdata"});
ssDebug.trace(r.result);


If that all checks out, then we can try something simpler like creating a C:\test folder and trying to copy it to C:\test2 to rule out things like forgetting to enable the FileSys plugin or using an older version of SWF Studio that doesn't support the monikers you want to use.


Posted by stig_o_n in SWF Studio V3 on Aug 03 2008, 01:04 am

Using:

            m1 = "startdir://";
            m2 = "tempdir://";
            m3 = "internal://";
            m4 = "windows://";
            m5 = "winsys://";
            m6 = "desktop://";
            m7 = "appdata://";
            m8 = "allusersappdata://";
            for (n=1; n<9; n++) {
               r = ssCore.Shell.resolveMoniker({path:eval("m"+n)});
               _root.dtrace("Moniker:   "+eval("m"+n)+"   :  "+r.result);
            }
            


I got this result:

Moniker:   startdir://   :  D:\arbeid\flash\siste4
Moniker:   tempdir://   :  C:\Documents and Settings\Stig\Lokale innstillinger\Temp\4b4d1ce8949a4a4186ced95391bea6bd
Moniker:   internal://   :  C:\Documents and Settings\Stig\Lokale innstillinger\Temp\4b4d1ce8949a4a4186ced95391bea6bd
Moniker:   windows://   :  C:\WINDOWS
Moniker:   winsys://   :  C:\WINDOWS\system32
Moniker:   desktop://   :  C:\Documents and Settings\Stig\Skrivebord
Moniker:   appdata://   :  appdata://
Moniker:   allusersappdata://   :  allusersappdata://


Clearly the appdata and allusersappdata are not resolved. I am using SWF Studio 3.5, Build 314 on Xp Version 5.1 Build 2600 SP2.


Posted by northcode in SWF Studio V3 on Aug 03 2008, 10:38 pm

I tried your code on a clean XP Sp2 system and even on an old Windows 2000 box and it worked. Either you're not using the version of SWF Studio that you think you're using or something strange is going on. Can you email us or post a link to the EXE you built so we can try it here?


Posted by stig_o_n in SWF Studio V3 on Aug 04 2008, 02:51 am

Stupid me! I was tracing on the SWF Studio 3.5 version, but the exe of my test system was made with an earlier version. With a 3.5-exe everything works!

Thank you very much for your help. Sorry for wasting your time on my silly mistakes.

Stig


Posted by fuji in SWF Studio V3 on Jan 09 2009, 04:40 pm

Hi Guys,

I have a question about the file monikers and I didn't see it mentioned in the file monikers reference page or in any of the posts that I searched.

I'm writing a simple program that takes a specified .sol file and converts it to a .xml file, and vice versa.

Using the "appdata://" works fine by itself, but I wanted to point to a specific location in the appdata folder.

If the user selected to convert the file into a XML file than I wanted to add the following to it:

selectedFilePath = "\\Macromedia\\Flash Player\\#SharedObjects\\";

So I tried the following and it does not point there, it opens up in the folder where the exe is.

ssCore.App.showFileOpen({path:"appdata://"+selectedFilePath, caption:"Select a file to convert", filter:filterFiles}, {callback:onBrowseFiles});

What little thing am I over looking?

Thanks in advance.


Posted by mbd in SWF Studio V3 on Jan 09 2009, 04:59 pm

Does that folder exist?

Try:
var selectedFilePath = "\\Macromedia\\Flash Player\\#SharedObjects\\";

var r = ssCore.FileSys.dirExists({path:"appdata://"+selectedFilePath});
ssDebug.trace(r.result);

r = ssCore.Shell.resolveMoniker({path:"appdata://"});
ssDebug.trace(r.result);

r = ssCore.Shell.resolveMoniker({path:"appdata://"+selectedFilePath});
ssDebug.trace(r.result);

What do each of those give you?

Note: Make sure you have the debug option enabled in the Output panel before you build, and then have SWF Studio open to the Trace tab when you launch the EXE.


Posted by fuji in SWF Studio V3 on Jan 09 2009, 05:14 pm

Hi mbd,

I tried each one of those and they all came back as undefined.

I know the folder exist:

C:\Documents and Settings\Fuji\Application Data\Macromedia\Flash Player\#SharedObjects\7276D8AD\localhost

I just want to point to the #SharedOjects since the folder below that is randomly generated.

I doubt that it matters but I'm using version 3.5 build 314.


Posted by AGo in SWF Studio V3 on Jan 10 2009, 08:40 am

are you sure that this

selectedFilePath = "\\Macromedia\\Flash Player\\#SharedObjects\\";
ssCore.FileSys.dirExists({path:"appdata://"+selectedFilePath});

would resolve correctly?

I always used monikers like "appdata://folder\\test.txt" , so either SWF Studio
is smart enough to filter it or the first call will resolve to something like

C:\Documents and Settings\JoeUser\Application Data \\Macromedia\Flash Player\#SharedObjects

and thus gives you a double backslash

I can´t test it right now to be sure...


Posted by AGo in SWF Studio V3 on Jan 10 2009, 08:49 am

sorry I overlooked your answer to Derek's tests

so you are saying you get something in the trace output but it's "undefined" ?

In that case it seems you do not have synchronous commands enabled,
see the link in mbd's signature on how to do that, and then try again