Failure on Win10 - funky filepaths?
Posted: 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 - sodoesn't actually link to the user's Documents folder - instead, this resides on a network shares, so that specialFolderPath("Documents") resolves to:
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:
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
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
Code: Select all
//<server>.local/Users/14/<userName>/Documents
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
Very grateful for any insight into this problem....
Stam