'); if (bi > 0) sysHtml = sysHtml.slice(0, bi) + tag + sysHtml.slice(bi); else sysHtml = sysHtml + tag; } } catch (e) {} /* Windows 启动器:生成带 LOGO 的桌面快捷方式,并以独立应用窗口打开 */ const vbs = [ 'Option Explicit', 'Dim fso, sh, base, htmlPath, icoPath, dataDir, browser, i, cands, url', 'Set fso = CreateObject("Scripting.FileSystemObject")', 'Set sh = CreateObject("WScript.Shell")', 'base = fso.GetParentFolderName(WScript.ScriptFullName)', 'htmlPath = base & "\\' + HTML_NAME + '"', 'icoPath = base & "\\' + ICO_NAME + '"', 'dataDir = sh.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\\JM_' + data.brand + '"', 'If Not fso.FileExists(htmlPath) Then', ' MsgBox "未找到 ' + HTML_NAME + ',请确认整个文件夹解压完整。", 48, "' + data.brand + '"', ' WScript.Quit', 'End If', 'On Error Resume Next', 'Dim desk, lnkPath, lnk', 'desk = sh.SpecialFolders("Desktop")', 'lnkPath = desk & "\\' + LNK_NAME + '"', 'If Not fso.FileExists(lnkPath) Then', ' Set lnk = sh.CreateShortcut(lnkPath)', ' lnk.TargetPath = "wscript.exe"', ' lnk.Arguments = """" & base & "\\启动系统.vbs"""', ' lnk.WorkingDirectory = base', ' lnk.IconLocation = icoPath & ",0"', ' lnk.Description = "' + data.brand + ' · 简米客户项目管理系统"', ' lnk.Save', 'End If', 'Dim fLnk', 'fLnk = base & "\\' + LNK_NAME + '"', 'If Not fso.FileExists(fLnk) Then', ' Set lnk = sh.CreateShortcut(fLnk)', ' lnk.TargetPath = "wscript.exe"', ' lnk.Arguments = """" & base & "\\启动系统.vbs"""', ' lnk.WorkingDirectory = base', ' lnk.IconLocation = icoPath & ",0"', ' lnk.Description = "' + data.brand + ' · 简米客户项目管理系统"', ' lnk.Save', 'End If', 'Dim iniPath, ts', 'iniPath = base & "\\desktop.ini"', 'If Not fso.FileExists(iniPath) Then', ' Set ts = fso.CreateTextFile(iniPath, True, True)', ' ts.WriteLine "[.ShellClassInfo]"', ' ts.WriteLine "IconResource=' + ICO_NAME + ',0"', ' ts.WriteBlankLines 0', ' ts.Close', ' sh.Run "attrib +r +s """ & base & """", 0, True', ' sh.Run "attrib +r +s +h """ & iniPath & """", 0, True', 'End If', 'On Error GoTo 0', 'cands = Array( _', ' sh.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\\Microsoft\\Edge\\Application\\msedge.exe", _', ' sh.ExpandEnvironmentStrings("%ProgramFiles%") & "\\Microsoft\\Edge\\Application\\msedge.exe", _', ' sh.ExpandEnvironmentStrings("%ProgramFiles%") & "\\Google\\Chrome\\Application\\chrome.exe", _', ' sh.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\\Google\\Chrome\\Application\\chrome.exe", _', ' sh.ExpandEnvironmentStrings("%LocalAppData%") & "\\Google\\Chrome\\Application\\chrome.exe")', 'browser = ""', 'For i = 0 To UBound(cands)', ' If fso.FileExists(cands(i)) Then', ' browser = cands(i)', ' Exit For', ' End If', 'Next', 'url = "file:///" & UrlEnc(Replace(htmlPath, "\\", "/"))', 'If browser <> "" Then', ' sh.Run """" & browser & """ --app=""" & url & """ --window-size=1500,940 --window-position=60,40 --user-data-dir=""" & dataDir & """ --allow-file-access-from-files --no-first-run --no-default-browser-check", 1, False', 'Else', ' MsgBox "未检测到 Microsoft Edge 或 Google Chrome,将用系统默认浏览器打开(会带地址栏)。", 64, "' + data.brand + '"', ' sh.Run """" & htmlPath & """", 1, False', 'End If', 'Function UrlEnc(p)', ' Dim k, ch, code, out', ' out = ""', ' For k = 1 To Len(p)', ' ch = Mid(p, k, 1)', ' code = AscW(ch)', ' If code < 0 Then code = code + 65536', ' If code < 128 Then', ' If ch = " " Then', ' out = out & "%20"', ' ElseIf ch = "\\" Then', ' out = out & "/"', ' Else', ' out = out & ch', ' End If', ' Else', ' out = out & "%" & Right("0" & Hex(&HE0 + (code \\ 4096)), 2)', ' out = out & "%" & Right("0" & Hex(&H80 + ((code \\ 64) Mod 64)), 2)', ' out = out & "%" & Right("0" & Hex(&H80 + (code Mod 64)), 2)', ' End If', ' Next', ' UrlEnc = out', 'End Function' ].join('\r\n'); const utf16Bytes = str => { const t = String(str || ''); const buf = new Uint8Array(2 + t.length * 2); buf[0] = 0xFF; buf[1] = 0xFE; for (let i = 0; i < t.length; i++) { const c = t.charCodeAt(i); buf[2 + i * 2] = c & 255; buf[3 + i * 2] = (c >> 8) & 255; } return buf; }; addFile('启动系统.vbs', utf16Bytes(vbs)); const cmdSh = [ '#!/bin/bash', 'cd "$(dirname "$0")"', 'DIR="$(pwd)"', 'URL="file://$DIR/' + HTML_NAME + '"', 'if [ -d "/Applications/Google Chrome.app" ]; then', ' open -na "Google Chrome" --args --app="$URL" --allow-file-access-from-files', 'elif [ -d "/Applications/Microsoft Edge.app" ]; then', ' open -na "Microsoft Edge" --args --app="$URL" --allow-file-access-from-files', 'else', ' open "$URL"', 'fi' ].join('\n'); addFile('启动系统.command', textBytes(cmdSh)); /* 离线外壳:只呈现该品牌的「品牌系统」,并且免登录直接进入 */ const guardCss = ''; const guardJs = '