Updated.
function getSoFeatures() {
const soFeat = {gecko: true, clipboard: true, dpi: true, recycle: true, gdiplus: true, segoe: true, bio: true}
const WshShell = new ActiveXObject('WScript.Shell');
const app = new ActiveXObject('Shell.Application');
let doc;
// Internals
try {doc = new ActiveXObject('htmlfile');} catch (e) {soFeat.gecko = false;}
if (typeof doc !== 'undefined' && soFeat.gecko) {
let clText = 'test';
try {doc.parentWindow.clipboardData.setData('Text', clText); clText = doc.parentWindow.clipboardData.getData('Text');} catch (e) {soFeat.clipboard = false;}
if (clText !== 'test') {soFeat.clipboard = false;}
} else {soFeat.clipboard = false;}
// File system
if (typeof app !== 'undefined') {
try {app.NameSpace(10).MoveHere(null);} catch (e) {soFeat.recycle = false;}
} else {soFeat.recycle = false;}
// Scripting
if (utils.IsFile && utils.IsFile(fb.ProfilePath + 'yttm\\foo_lastfm_img.vbs')) {
try {
new ActiveXObject("Scripting.FileSystemObject");
new ActiveXObject("MSXML2.XMLHTTP");
new ActiveXObject("ADODB.Stream");
} catch (e) {soFeat.bio = false;}
}
// UI
if (typeof WshShell !== 'undefined') {
try {WshShell.RegRead('HKCU\\Control Panel\\Desktop\\WindowMetrics\\AppliedDPI');} catch (e) {soFeat.dpi = false;}
} else {soFeat.dpi = false;}
if (!utils.CheckFont('Arial')) {
soFeat.gdiplus = false;
}
if (!utils.CheckFont('Segoe UI')) {
soFeat.segoe = false;
}
return soFeat;
}
function CheckSoFeatures(soFeat) {
let bPass = true;
// Internals
if (!soFeat.gecko) {
fb.ShowPopupMessage('Found an issue on current installation:\nActiveXObject_Constructor failed:\nFailed to create ActiveXObject object via CLSID: htmlfile.\n\nFix: install \'Gecko\' package.\n' + 'https://wiki.winehq.org/Gecko', 'SO features');
bPass = false;
} else if (!soFeat.clipboard) {
fb.ShowPopupMessage('Found an issue on current installation:\nclipboardData failed.\n\nFix: Install IE8 with Winetricks.\n' + 'https://wiki.winehq.org/Winetricks' + '\n' + 'https://askubuntu.com/questions/1194126/problem-in-installing-internet-explorer-8' + '\n\nWARNING:\nApplying this fix will break internet connection on current profile.\ni.e. Bio Script config popup will work but image downloading will be broken. It\'s therefore recommended to don\'t apply this fix on online systems.', 'SO features');
bPass = false;
}
// File system
if (!soFeat.recycle) {
// Not sure if there is an alternative (?)
bPass = false;
}
// Scripting
if (!soFeat.bio) {
fb.ShowPopupMessage('Found an issue on current installation:\nMissing scripting components for vbs integration (BIO panel).\n\nFix: Install \'wsh57\' and \'mdac28\' with Winetricks.\n' + 'https://wiki.winehq.org/Winetricks' + '\n\nTerminal command:\n' + 'sh winetricks wsh57 mdac28' + '\n\nFix: Also msado15 needs to be aded to the dll overrides in Winecfg:\n' + 'https://hydrogenaud.io/index.php?topic=121786.msg1005447#msg1005447' +'\n' + 'https://itectec.com/ubuntu/ubuntu-how-to-override-a-dll-without-using-the-winecfg-gui-in-wine/' + '\n' + 'https://wiki.winehq.org/Wine_User%27s_Guide#WINEDLLOVERRIDES.3DDLL_Overrides', 'SO features');
bPass = false;
}
// UI
if (!soFeat.dpi) {
fb.ShowPopupMessage('Found an issue on current installation:\nRegistry entry not found:\nHKCU\\Control Panel\\Desktop\\WindowMetrics\\AppliedDPI\n\nFix: add entry to registry.\n' + 'HKCU\\Control Panel\\Desktop\\WindowMetrics\\AppliedDPI ---> 96\n\nCMD command:\n' + 'reg.exe ADD "HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics" /v AppliedDPI /t REG_DWORD /d 96', 'SO features');
bPass = false;
}
if (!soFeat.gdiplus) {
fb.ShowPopupMessage('Found an issue on current installation:\nFonts are not found via utils.CheckFont() and gdi.Font().\n\nFix: install install \'gdiplus\' package with winetricks.\n' + 'https://wiki.winehq.org/Winetricks' + '\n\nTerminal command:\n' + 'sh winetricks gdiplus', 'SO features');
bPass = false;
} else if (!soFeat.segoe) {
fb.ShowPopupMessage('Found an issue on current installation:\nSegoe UI font is missing.\n\nFix: install missing font.\n' + 'https://github.com/mrbvrz/segoe-ui-linux', 'SO features');
bPass = false;
}
return bPass;
}