Roger Daley Well-Known Member Licensed User Longtime User Jan 3, 2016 #1 Hi All, Another one. When I compile in release mode the helpfile.htm is happily displayed in the browser. When the jar is "Packaged" with the B4JPackager and the sub/file is called Firefox responds with: "Firefox can't find the file at /C:/Program Files/Antenna Bearing Tool/app/helpfile.htm." When I use the File Explorer the app dir contents show only the jar and a cfg file. When I use a button on the App that opens a sub directory of /app/ and go up a level, file explorer shows the jar, cfg, the sub dir and helpfile.htm. The htm file is there but in hidding. It may be some windows 10 trick??? Any idea's? Regards Roger
Hi All, Another one. When I compile in release mode the helpfile.htm is happily displayed in the browser. When the jar is "Packaged" with the B4JPackager and the sub/file is called Firefox responds with: "Firefox can't find the file at /C:/Program Files/Antenna Bearing Tool/app/helpfile.htm." When I use the File Explorer the app dir contents show only the jar and a cfg file. When I use a button on the App that opens a sub directory of /app/ and go up a level, file explorer shows the jar, cfg, the sub dir and helpfile.htm. The htm file is there but in hidding. It may be some windows 10 trick??? Any idea's? Regards Roger
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2016 #2 Are you writing it to File.DirApp at runtime? Upvote 0
Roger Daley Well-Known Member Licensed User Longtime User Jan 3, 2016 #3 Hi Erel, Yes, I copy the htm file from DirAssets at AppStart. Code: Copy If File.Exists(File.DirApp, "helpfile.htm") = False Then File.Copy(File.DirAssets, "helpfile.htm", File.DirApp, "helpfile.htm") The Sub Help_action is called by the use. Plenty of time for the copy to complete. Regards Roger Last edited: Jan 3, 2016 Upvote 0
Hi Erel, Yes, I copy the htm file from DirAssets at AppStart. Code: Copy If File.Exists(File.DirApp, "helpfile.htm") = False Then File.Copy(File.DirAssets, "helpfile.htm", File.DirApp, "helpfile.htm") The Sub Help_action is called by the use. Plenty of time for the copy to complete. Regards Roger
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2016 #4 You should use File.DirData: https://www.b4x.com/android/forum/threads/data-folder.56874/ Upvote 0
Roger Daley Well-Known Member Licensed User Longtime User Jan 3, 2016 #5 Erel Changing to File.DirData produces the warning "Cannot assign void value". Does this mean I can't test to see if the file exists? Code: Copy If File.Exists(File.DirData, "helpfile.htm") = False Then File.Copy(File.DirAssets, "helpfile.htm", File.DirApp, "helpfile.htm") If I only use the following it works OK. [Release mode only so far] Code: Copy File.Copy(File.DirAssets, "helpfile.htm", File.DirApp, "helpfile.htm") Roger Upvote 0
Erel Changing to File.DirData produces the warning "Cannot assign void value". Does this mean I can't test to see if the file exists? Code: Copy If File.Exists(File.DirData, "helpfile.htm") = False Then File.Copy(File.DirAssets, "helpfile.htm", File.DirApp, "helpfile.htm") If I only use the following it works OK. [Release mode only so far] Code: Copy File.Copy(File.DirAssets, "helpfile.htm", File.DirApp, "helpfile.htm") Roger
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2016 #6 You are not using it correctly. It is a method that expects a single parameter: The best way is to declare a process global variable: Code: Copy Sub Process_Globals Public DataFolder As String End Sub 'in AppStart DataFolder = File.DirData("YourAppName") Upvote 0
You are not using it correctly. It is a method that expects a single parameter: The best way is to declare a process global variable: Code: Copy Sub Process_Globals Public DataFolder As String End Sub 'in AppStart DataFolder = File.DirData("YourAppName")
Roger Daley Well-Known Member Licensed User Longtime User Jan 3, 2016 #7 Thanks Erel, All working as a Windows App, Help file included. Regards Roger Upvote 0