* Legacy Backup and Restore FH Settings plugin does not run in Linux/WINE

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
Mark1834
Megastar
Posts: 2564
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Legacy Backup and Restore FH Settings plugin does not run in Linux/WINE

Post by Mark1834 »

This is spun off from Testing plugin compatibility with Mac/Linux, posted as a new thread as it is about an issue with an existing plugin, not general compatibility issues.

The legacy backup and restore plugin loads normally in FH7 under Linux Mint/WINE, but when starting the actual backup, stops with the following error message:

Code: Select all

[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:655: COM exception:(d:\my\lua\luacom-master\src\library\tluacom.cpp,382):
stack traceback:
	[C]: in metamethod '__index'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:655: in upvalue 'attributes'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:673: in local 'getFileList'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:685: in field 'GetFolderContents'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:4766: in upvalue 'intCopyFiles'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:5756: in function <[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:5719>
	(...tail calls...)
	[C]: in function 'iuplua.MainLoop'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:2696: in field 'ShowDialogue'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:6154: in function 'GUI_MainDialogue'
	[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:6185: in main chunk
Selecting Continue returns to the main plugin menu, but both the large backup button and Close Plugin buttons are greyed out and the entire menu is unresponsive. Clicking on the window Close (X) closes the plugin normally. The Family Historian, Application and Program Data folders have been created, but no files have been copied.

I strongly suspect that the FileSystemObject used to manage files and folders is the culprit. Unix-derived file systems (Mac OS, Linux, etc) have never been bound by the historic 8.3 limitation of 16-bit DOS, so file attributes do not support SHORTNAME, SHORTPATH, or TYPE, which are all Windows-only concepts. This causes issues for emulators (exactly the type of scenario that the proposed KB page is designed to alert to).

fhFileUtils() has exactly the same issue, but the next release of FH should include an updated library with support for these ancient features removed. This only fixes FH7, so if the plugin requires using FileSystemObject directly to support Unicode file paths in legacy versions of FH, the plugin author has to manage the issue directly.

It should be a simple hypothesis to test. Are there any other Store plugins that use FSO to get the attributes of existing files? They may display similar behavior.
Mark Draper
User avatar
tatewise
Megastar
Posts: 28594
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Legacy Backup and Restore FH Settings plugin does not run in Linux/WINE

Post by tatewise »

Thank you Mark, I'll investigate, but it won't be for a day or two...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2564
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Legacy Backup and Restore FH Settings plugin does not run in Linux/WINE

Post by Mark1834 »

This simple script illustrates the FSO issue. In Windows, it pops up a message box with the short path description of the active GEDCOM file, as expected. Run it in WINE, and WINE (and therefore FH) crashes completely.

Code: Select all

require('luacom')
FSO = luacom.CreateObject("Scripting.FileSystemObject")
File = fhGetContextInfo('CI_GEDCOM_FILE')
fileObj = FSO:GetFile(File)
fhMessageBox(fileObj.ShortPath, 'MB_OK', 'MB_ICONINFORMATION')
Calling the ShortName, ShortPath, or Type properties of the File object is being removed from fhFileUtils() getFileFolderDetails(...) for FH7 as it makes the function incompatible with WINE.

It may not be exact issue here, but I suspect it is at least related.
Mark Draper
User avatar
Ron Melby
Megastar
Posts: 929
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Legacy Backup and Restore FH Settings plugin does not run in Linux/WINE

Post by Ron Melby »

its a pain, but I suppose one could do the command dir /X > sfn8_3.txt and cut it into a table of longfile name and shortfilename (8.3)
FH V.6.2.7 Win 10 64 bit
Post Reply