Failure on Win10 - funky filepaths?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
stam
Posts: 2680
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Failure on Win10 - funky filepaths?

Post by stam » Tue Jul 13, 2021 10:09 pm

Hi all,
struggling with an unforeseen issue with a standalone on Windows 10 - works fine on Mac.

One of my apps has a splash stack (which is made into the standalone) and the mainStack and libraries reside in a folder in the user's Documents folder (writeable location). This folder is included in the standalone.

When the splash runs, it checks to see if the mainstack exists and if it doesn't it copies the folder from specialFolderPath("resources") the the user's documents. This works perfectly on Mac.

On the target Windows 10 machine it correctly detects the mainStack is missing from the user's documents folder and correctly copies across the folder from the specialfolderpath("resources") directory.
However when trying to start using the mainStack, it says stack not found :-/

The windows machine i'm using is not straightforward; it's set up in a corporate IT with roaming profiles - so

Code: Select all

c:\Users\<user>\Documents 
doesn't actually link to the user's Documents folder - instead, this resides on a network shares, so that specialFolderPath("Documents") resolves to:

Code: Select all

//<server>.local/Users/14/<userName>/Documents
I'm at a loss on how to fix this - i can't understand how it correctly identifies the Documents directory even with this weird setup, but fails to start using or open the mainStack that resides there... I wonder if it's an issue with the filepaths resolving to network shares?


Here is my code:

Code: Select all

global gUserDirectory
on openStack
    local tFilePath, tFolder
        put specialFolderPath("documents") & "/<appDirectory>" into gUserDirectory
        put gUserDirectory & "/<appStack>.liveCode" into tFilePath
        if there is not a file tFilePath then
            answer warning "Some files need to be installed on first run. Click OK to proceed, or Quit." with "Quit" and "OK"
            if it is "Quit" then quit
            put specialFolderPath("resources") & "/<appDirectory>" into tFolder
            try 
                revCopyFolder tFolder, specialFolderPath("documents") --> SUCCEEDS
            catch tError
                answer error "Error installing necessary library files:" && tError
                quit
            end try
            send "openStack" to this stack // recursion on windows doesn't work if just calling 'openStack'
        end if
        
        start using stack tFilePath --> FAILS

        // more initialiation code below

end openStack
Is this an issue with the way the filepaths are resolved on windows 10? something silly I've done?

Very grateful for any insight into this problem....
Stam

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: Failure on Win10 - funky filepaths?

Post by Bernard » Wed Jul 14, 2021 12:23 am

Just to add to the mix, a windows netbios/smb share should begin with \\ not //

https://www.howtogeek.com/school/window ... g/lesson8/

maybe try

replace "/" with "\" in tFilePath

Alternatively what if you set the defaultFolder to the network share, then "start using" with the stack without the path.

If none of those work I'd map a network drive on my home network and play around with starting the stack from a network share. Probably a registry key to move the location of the User documents folder.

stam
Posts: 2680
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Failure on Win10 - funky filepaths?

Post by stam » Wed Jul 14, 2021 1:59 am

Bernard wrote:
Wed Jul 14, 2021 12:23 am
Just to add to the mix, a windows netbios/smb share should begin with \\ not //
Thanks Bernard - i already tried \\ instead of // - no joy (interestingly powershell doesn't mind, it just translates it to \\ anyway)

I'll try your suggestion with the defaultFolder when i'm back at work tomorrow. Ideally the solution would not require mapping drives, it has to be a simple process for computer-troglodytes to use ;)

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Failure on Win10 - funky filepaths?

Post by SparkOut » Wed Jul 14, 2021 7:28 am

Maybe hopefully it is something simple like giving a bit of time for the copy to complete across the network before trying to start using the destination stack.
Hopefully it is not more complicated where 'start using' can't follow the redirect and needs a hard coded drive letter.
I will try and test a bit today but I am not going to be in front of my computer until later tonight.

SteveFI
Posts: 30
Joined: Tue Mar 16, 2021 6:15 pm

Re: Failure on Win10 - funky filepaths?

Post by SteveFI » Wed Jul 14, 2021 10:05 am

I've encountered this before, not with LiveCode, but with Excel. It seems that resolving paths where a remote desktop is being used causes a lot of trouble. Some other software I use cannot be run from any remotely hosted folder for the same reason and, because it writes files to its own directory, has to be installed onto the root of the C drive.

I don't know what the solution is, other than finding another directory that isn't hosted, but I don't think the issue is peculiar to LiveCode.

Steve

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”