Single File Deploy on Windows?
Paul Dupuis
paul at researchware.com
Tue Apr 4 18:12:19 EDT 2017
Hi Dan,
That look to me like it should work. Here is my code below which does
work. That said, it works under 6.7.x and earlier. I have not tested my
code under LC7+. In my case I have only 1 external but I want to load
the correct one for OSX or Window.
The whole "put (there is a folder tExtFile) into tExtExists" is just a
safety check on someone removing the external or a failure of my
installer to install it.
on preOpenStack
-- so substacks do not execute the code after this when opened
if the owner of the target is not me then
exit preOpenStack
end if
-- Load the XPDF Externals by loading an external stack, updating its
externals list, saving that stack and loading the stack
put AppPath() into tExtPath
switch the platform
case "MacOS"
put tExtPath & "XPDF.bundle" into tExtFile
put (there is a folder tExtFile) into tExtExists
break
case "Win32"
put tExtPath & "XPDF.dll" into tExtFile
put (there is a file tExtFile) into tExtExists
break
end switch
if (tExtExists is true) then
set the externals of the templateStack to tExtFile
create invisible stack "XPDFViewer External Library"
start using "XPDFViewer External Library"
end if
end preOpenStack
function AppPath
put the fileName of me into tPath -- on OSX, file is report inside the
bundle <path>/MyApp.app/Contents/MacOS/MyApp
set the itemDel to slash
if (the platform is "MacOS") AND ("dev" is not in the environment) then
get offset(".app/Contents/MacOS/",tPath)
if it > 0 then -- 'filename' returned path to executable in package
delete char it to len(tPath) of tPath
end if
end if
delete last item of tPath
if last char of tPath is not slash then put slash after tPath
return tPath
end AppPath
On 4/4/2017 5:54 PM, Dan Friedman via use-livecode wrote:
> Paul,
>
> Thank you for the advice. But, either it didnt work, or Im doing it wrong. Heres what I did:
>
> on startUp
> new inv stack "myExternals"
> set the mainStack of stack "myExternals" to "myGreatApp"
> set the externals of stack "myExternals" to pExternals
>
> -- pExternals is a list of all the dlls that LC created when the app was built with all extensions selected:
> -- C:/Users/MyPC/aFolder/revpdfprinter.dll
> -- C:/Users/MyPC/aFolder/revsecurity.dll
> -- C:/Users/MyPC/aFolder/Externals/revbrowser.dll
> -- C:/Users/MyPC/aFolder/Externals/revzip.dll
> -- C:/Users/MyPC/aFolder/Externals/tsNet.dll
> -- C:/Users/MyPC/aFolder/Externals/CEF/dedcompiler_43.dll
> -- C:/Users/MyPC/aFolder/Externals/CEF/dedcompiler_47.dll
> -- C:/Users/MyPC/aFolder/Externals/CEF/libcef.dll
> -- C:/Users/MyPC/aFolder/Externals/CEF/libEGL.dll
> -- C:/Users/MyPC/aFolder/Externals/CEF/libEGLSv2.dll
>
> start using stack "myExternals"
> end startUp
>
> I checked the externals of stack myExternals and they are set correctly.
> I checked that myExternals is in the stacksInUse
>
> However, a simple put url doesnt work.
>
> Sorry if Im being stupid.
>
> -Dan
>
>
> Externals (.dll files that an a LC external) can be added to a created
> substack on startup by setting the externals of that new sustack to the
> approriate names and paths and then the substack started as a Library
> stack via 'start using' which will load the externals.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list