diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..f5b4dc3c --- /dev/null +++ b/.npmrc @@ -0,0 +1,4 @@ +registry=https://registry.npm.taobao.org/ +disturl=https://npm.taobao.org/mirrors/node/ +ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/ +sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ \ No newline at end of file diff --git a/README.md b/README.md index 63e1274b..f952bf5b 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ This boilerplate was built as a template for [vue-cli](https://github.com/vuejs/ ```bash # Install vue-cli and scaffold boilerplate npm install -g vue-cli -vue init simulatedgreg/electron-vue my-project +vue init lowleung/electron-vue my-project # Install dependencies and run your app cd my-project diff --git a/template/.electron-vue/build-win-setup.js b/template/.electron-vue/build-win-setup.js new file mode 100644 index 00000000..c2bc8792 --- /dev/null +++ b/template/.electron-vue/build-win-setup.js @@ -0,0 +1,94 @@ +var innosetupCompiler = require('innosetup-compiler') +var path = require('path') +var fs = require('fs') +var iconv = require('iconv-lite') + +var rootPath = path.resolve(__dirname, '../') + +function resolve() { + return path.resolve.apply(path, [__dirname, '..'].concat(...arguments)) +} +// `./package.json` +var tmpJson = require(path.resolve(rootPath, './package.json')) + + +var setupOptions = { + issPath: resolve('./.electron-vue/setup_resources/setup.iss'), + files: [resolve('./build/win-unpacked/')], + resourcesPath: resolve('./.electron-vue/setup_resources'), + iconPath: resolve('./.electron-vue/icons/icon.ico'), + appPublisher: '姊佷箰', + appURL: 'https://zzdmt.cn', + setupID: '{{840AE126-934D-4BBE-8E8F-9E984A68B6F8}}', + outputPath: resolve("./build"), + outputFileName: function () { + return tmpJson.description + '-' + tmpJson.version + } +} + +function buildWinSetup() { + const res = [] + + const options = Object.assign({}, setupOptions, { + files: setupOptions.files, + }) + + res.push(makeExeSetup(options)) + return Promise.all(res) +} + +function makeExeSetup(opt) { + const { + issPath, + files, + iconPath, + outputPath, + outputFileName, + resourcesPath, + appPublisher, + appURL, + setupID + } = opt + const { + name, + description, + version + } = tmpJson + const tmpIssPath = resolve("./build", '_tmp_' + '.iss') + + return new Promise(function (resolve, reject) { + // rewrite name, version to iss + fs.readFile(issPath, null, function (err, text) { + if (err) return reject(err) + + let str = iconv.decode(text, 'gbk') + .replace(/_name_/g, name) + .replace(/_appName_/g, description) + .replace(/_version_/g, version) + .replace(/_outputPath_/g, outputPath) + .replace(/_icon_/g, iconPath) + .replace(/_outputFileName_/g, outputFileName) + .replace(/_filesPath_/g, files) + .replace(/_resourcesPath_/g, resourcesPath) + .replace(/_appPublisher_/g, appPublisher) + .replace(/_appURL_/g, appURL) + .replace(/_appId_/g, setupID) + + fs.writeFile(tmpIssPath, iconv.encode(str, 'gbk'), null, function (err) { + if (err) return reject(err) + + // inno setup start + innosetupCompiler(tmpIssPath, { + gui: false, + verbose: true + }, function (err) { + fs.unlinkSync(tmpIssPath) + if (err) return reject(err) + resolve(opt) + }) + }) + }) + }) +} + +buildWinSetup() \ No newline at end of file diff --git a/template/.electron-vue/icons/256x256.png b/template/.electron-vue/icons/256x256.png new file mode 100644 index 00000000..9673dbd7 Binary files /dev/null and b/template/.electron-vue/icons/256x256.png differ diff --git a/template/.electron-vue/icons/icon.icns b/template/.electron-vue/icons/icon.icns new file mode 100644 index 00000000..732ebd1e Binary files /dev/null and b/template/.electron-vue/icons/icon.icns differ diff --git a/template/.electron-vue/icons/icon.ico b/template/.electron-vue/icons/icon.ico new file mode 100644 index 00000000..fee79a2b Binary files /dev/null and b/template/.electron-vue/icons/icon.ico differ diff --git a/template/.electron-vue/setup_resources/ChineseSimp.isl b/template/.electron-vue/setup_resources/ChineseSimp.isl new file mode 100644 index 00000000..5fa3d9b8 --- /dev/null +++ b/template/.electron-vue/setup_resources/ChineseSimp.isl @@ -0,0 +1,337 @@ +; *** Inno Setup version 5.5.0+ Chinese (Simplified) messages *** +; by Mack Zhang (hua_wuxin@21cn.com) +; +; To download user-contributed translations of this file, go to: +; http://www.jrsoftware.org/files/istrans/ +; +; Note: When translating this text, do not add periods (.) to the end of +; messages that didn't have them already, because on those messages Inno +; Setup adds the periods automatically (appending a period would result in +; two periods being displayed). + +[LangOptions] +; The following three entries are very important. Be sure to read and +; understand the '[LangOptions] section' topic in the help file. +LanguageName=<4E2D><6587><7B80><4F53> +LanguageID=$0804 +LanguageCodePage=936 +; If the language you are translating to requires special font faces or +; sizes, uncomment any of the following entries and change them accordingly. +DialogFontName=宋体 +DialogFontSize=9 +;WelcomeFontName=Verdana +;WelcomeFontSize=12 +;TitleFontName=Arial +;TitleFontSize=29 +;CopyrightFontName=Arial +;CopyrightFontSize=8 + +[Messages] + +; *** Application titles +SetupAppTitle=安装向导 +SetupWindowTitle=安装向导 - %1 +UninstallAppTitle=卸载向导 +UninstallAppFullTitle=%1 卸载向导 + +; *** Misc. common +InformationTitle=信息 +ConfirmTitle=确认 +ErrorTitle=错误 + +; *** SetupLdr messages +SetupLdrStartupMessage=安装向导将在你的电脑上安装 %1。你确定要继续吗? +LdrCannotCreateTemp=无法创建临时文件。安装中止 +LdrCannotExecTemp=无法运行临时文件夹中的文件。安装中止 + +; *** Startup error messages +LastErrorMessage=%1.%n%n错误 %2:%3 +SetupFileMissing=安装文件夹缺少文件 %1。请纠正此问题或者索取软件的新版本。 +SetupFileCorrupt=安装文件已损坏。请索取软件的新版本。 +SetupFileCorruptOrWrongVer=安装文件已损坏,或者与本安装向导的版本不兼容。请纠正此问题或者索取软件的新版本。 +InvalidParameter=一个错误的参数被传递到了命令行:%n%n%1 +SetupAlreadyRunning=安装已经运行。 +WindowsVersionNotSupported=本程序不支持您的电脑上运行的 Windows 版本。 +WindowsServicePackRequired=本程序需要 %1 Service Pack %2 或更新的版本。 +NotOnThisPlatform=本程序不能在 %1 上运行。 +OnlyOnThisPlatform=本程序必须在 %1 上运行。 +OnlyOnTheseArchitectures=本程序只能安装在为下列处理器架构设计的 Windows 版本中:%n%n%1 +MissingWOW64APIs=当前的 Windows 版本没有包含执行 64 位安装向导所需的函数。若要纠正此问题,请安装 Service Pack %1。 +WinVersionTooLowError=本程序需要 %1 v%2 或更高版本。 +WinVersionTooHighError=本程序不能安装在 %1 v%2 或更高版本上。 +AdminPrivilegesRequired=安装本程序时你必须以管理员身份登录。 +PowerUserPrivilegesRequired=安装本程序时你必须以管理员或 Power Users 组成员的身份登录。 +SetupAppRunningError=安装向导发现 %1 正在运行。%n%n请关闭其所有实例,然后单击“确定”继续,或单击“取消”退出。 +UninstallAppRunningError=卸载向导发现 %1 正在运行。%n%n请关闭其所有实例,然后单击“确定”继续,或单击“取消”退出。 + +; *** Misc. errors +ErrorCreatingDir=安装向导无法创建文件夹“%1” +ErrorTooManyFilesInDir=无法在文件夹“%1”中创建文件,因为它包含了太多文件 + +; *** Setup common messages +ExitSetupTitle=退出安装 +ExitSetupMessage=安装尚未完成。如果你现在退出,软件将不会安装。%n%n你可以在其它时间重新运行安装向导来完成安装。%n%n现在退出安装吗? +AboutSetupMenuItem=关于安装向导(&A)… +AboutSetupTitle=关于安装向导 +AboutSetupMessage=%1 版本 %2%n%3%n%n%1 主页:%n%4 +AboutSetupNote= +TranslatorNote= + +; *** Buttons +ButtonBack=< 上一步(&B) +ButtonNext=下一步(&N) > +ButtonInstall=安装(&I) +ButtonOK=确定 +ButtonCancel=取消 +ButtonYes=是(&Y) +ButtonYesToAll=全是(&A) +ButtonNo=否(&N) +ButtonNoToAll=全否(&O) +ButtonFinish=完成(&F) +ButtonBrowse=浏览(&B)… +ButtonWizardBrowse=浏览(&R)… +ButtonNewFolder=创建文件夹(&M) + +; *** "Select Language" dialog messages +SelectLanguageTitle=选择安装语言 +SelectLanguageLabel=选择安装期间要使用的语言: + +; *** Common wizard text +ClickNext=单击“下一步”继续,或单击“取消”退出安装。 +BeveledLabel= +BrowseDialogTitle=浏览文件夹 +BrowseDialogLabel=选择一个文件夹,然后单击“确定”。 +NewFolderName=新建文件夹 + +; *** "Welcome" wizard page +WelcomeLabel1=欢迎使用 [name] 安装向导 +WelcomeLabel2=安装向导将在你的电脑上安装 [name/ver]。%n%n建议你在继续之前关闭所有其它应用程序。 + +; *** "Password" wizard page +WizardPassword=密码 +PasswordLabel1=本安装有密码保护。 +PasswordLabel3=请输入密码,然后单击“下一步”进入下一步。密码区分大小写。 +PasswordEditLabel=密码(&P): +IncorrectPassword=你输入的密码不正确。请重试。 + +; *** "License Agreement" wizard page +WizardLicense=许可协议 +LicenseLabel=请在继续之前阅读以下重要信息。 +LicenseLabel3=请阅读以下许可协议。在继续安装之前,你必须接受此协议的条款。 +LicenseAccepted=我接受协议(&A) +LicenseNotAccepted=我不接受协议(&D) + +; *** "Information" wizard pages +WizardInfoBefore=信息 +InfoBeforeLabel=请在继续之前阅读以下重要信息。 +InfoBeforeClickLabel=当你准备好继续安装后,请单击“下一步”。 +WizardInfoAfter=信息 +InfoAfterLabel=请在继续之前阅读以下重要信息。 +InfoAfterClickLabel=当你准备好继续安装后,请单击“下一步”。 + +; *** "User Information" wizard page +WizardUserInfo=用户信息 +UserInfoDesc=请输入你的信息。 +UserInfoName=用户名(&U): +UserInfoOrg=组织(&O): +UserInfoSerial=序列号(&S): +UserInfoNameRequired=必须输入用户名。 + +; *** "Select Destination Location" wizard page +WizardSelectDir=选择目标位置 +SelectDirDesc=将 [name] 安装到哪里? +SelectDirLabel3=安装向导将把 [name] 安装到以下文件夹中。 +SelectDirBrowseLabel=若要继续,单击“下一步”。如果你要选择不同的文件夹,请单击“浏览”。 +DiskSpaceMBLabel=至少需要 [mb] MB 的空闲磁盘空间。 +CannotInstallToNetworkDrive=无法安装到网络驱动器。 +CannotInstallToUNCPath=无法安装到 UNC 路径。 +InvalidPath=你必须输入带有盘符的完整路径。例如:%n%nC:\APP%n%n或者 UNC 路径格式:%n%n\\server\share +InvalidDrive=你选择的驱动器或 UNC 共享不存在或不可访问。请重新选择。 +DiskSpaceWarningTitle=没有足够的磁盘空间 +DiskSpaceWarning=安装需要至少 %1 KB 的剩余空间,但是所选驱动器只有 %2 KB 可用。%n%n你仍然要继续吗? +DirNameTooLong=文件夹名称或路径太长。 +InvalidDirName=文件夹名称无效。 +BadDirName32=文件夹名称不能包含下列字符:%n%n%1 +DirExistsTitle=文件夹已存在 +DirExists=文件夹:%n%n%1%n%n已存在。你确定要安装到该文件夹吗? +DirDoesntExistTitle=文件夹不存在 +DirDoesntExist=文件夹:%n%n%1%n%n不存在。创建该文件夹吗? + +; *** "Select Components" wizard page +WizardSelectComponents=选择组件 +SelectComponentsDesc=要安装哪些组件? +SelectComponentsLabel2=请选择你要安装的组件,清除你不想安装的组件。准备好后点击“下一步”。 +FullInstallation=完整安装 +; if possible don't translate 'Compact' as 'Minimal' (I mean 'Minimal' in your language) +CompactInstallation=简洁安装 +CustomInstallation=定制安装 +NoUninstallWarningTitle=组件已存在 +NoUninstallWarning=安装向导发现下列组件已经安装:%n%n%1%n%n取消选定不会卸载这些组件。%n%n继续安装吗? +ComponentSize1=%1 KB +ComponentSize2=%1 MB +ComponentsDiskSpaceMBLabel=当前的选择至少需要 [mb] MB 磁盘空间。 + +; *** "Select Additional Tasks" wizard page +WizardSelectTasks=选择附加任务 +SelectTasksDesc=要执行哪些附加任务? +SelectTasksLabel2=请选择在安装 [name] 期间安装向导要执行的附加任务,然后点击“下一步”。 + +; *** "Select Start Menu Folder" wizard page +WizardSelectProgramGroup=选择开始菜单文件夹 +SelectStartMenuFolderDesc=把程序快捷方式放到哪里? +SelectStartMenuFolderLabel3=安装向导将在以下开始菜单文件夹中创建程序快捷方式。 +SelectStartMenuFolderBrowseLabel=点击“下一步”进入下一步。如果你要选择不同的文件夹,请点击“浏览”。 +MustEnterGroupName=你必须输入文件夹名称 +GroupNameTooLong=文件夹名称或路径太长 +InvalidGroupName=文件夹名称无效 +BadGroupName=文件夹名称不能包含下列字符:%n%n%1 +NoProgramGroupCheck2=不创建开始菜单文件夹(&D) + +; *** "Ready to Install" wizard page +WizardReady=准备安装 +ReadyLabel1=安装向导现在准备开始安装 [name]。 +ReadyLabel2a=点击“安装”继续安装,如果你想要查看或者更改设置请点击“上一步”。 +ReadyLabel2b=点击“安装”继续安装。 +ReadyMemoUserInfo=用户信息: +ReadyMemoDir=目标位置: +ReadyMemoType=安装类型: +ReadyMemoComponents=所选组件: +ReadyMemoGroup=开始菜单文件夹: +ReadyMemoTasks=附加任务: + +; *** "Preparing to Install" wizard page +WizardPreparing=正在准备安装 +PreparingDesc=安装向导正在准备安装 [name]。 +PreviousInstallNotCompleted=先前程序的安装/卸载尚未完成。你需要重启电脑来完成安装。%n%n电脑重启之后,请重新运行安装向导来完成 [name] 的安装。 +CannotContinue=安装不能继续。请点击“取消”退出。 +ApplicationsFound=安装向导需要更新被下列应用程序占用的文件。建议你允许自动关闭这些应用程序。 +ApplicationsFound2=安装向导需要更新被下列应用程序占用的文件。建议你允许自动关闭这些应用程序。安装完成后,安装向导会尝试重新启动这些应用程序。 +CloseApplications=自动关闭应用程序(&A) +DontCloseApplications=不自动关闭应用程序(&D) +ErrorCloseApplications=安装程序无法自动关闭已打开的应用程序,建议您在继续安装之前先关闭相关应用程序。 + +; *** "Installing" wizard page +WizardInstalling=正在安装 +InstallingLabel=正在你的计算机中安装 [name],请稍等… + +; *** "Setup Completed" wizard page +FinishedHeadingLabel=完成 [name] 安装 +FinishedLabelNoIcons=安装向导已完成 [name] 的安装。 +FinishedLabel=安装向导已完成 [name] 的安装。可以通过选择已安装的图标来运行应用程序。 +ClickFinish=点击“完成”退出安装。 +FinishedRestartLabel=为了完成 [name] 的安装,安装向导必须重启电脑。你要立即重启吗? +FinishedRestartMessage=为了完成 [name] 的安装,安装向导必须重启电脑。%n%n你要立即重启吗? +ShowReadmeCheck=是,我要查看自述文件 +YesRadio=是,立即重启电脑(&Y) +NoRadio=否,稍后重启电脑(&N) +; used for example as 'Run MyProg.exe' +RunEntryExec=运行 %1 +; used for example as 'View Readme.txt' +RunEntryShellExec=查看 %1 + +; *** "Setup Needs the Next Disk" stuff +ChangeDiskTitle=安装向导需要下一个磁盘 +SelectDiskLabel2=请插入磁盘 %1 并点击“确定”。%n%n如果在除了下面显示的文件夹以外的文件夹中找不到该磁盘上的文件,就请输入正确的路径或点击“浏览”。 +PathLabel=路径(&P): +FileNotInDir2=文件“%1”不在“%2”中。请插入正确的磁盘或选择其他文件夹。 +SelectDirectoryLabel=请指定下一个磁盘的位置。 + +; *** Installation phase messages +SetupAborted=安装尚未完成。%n%n请纠正问题并重新运行安装向导。 +EntryAbortRetryIgnore=点击“重试”重新尝试,点击“忽略”继续安装,或点击“中止”取消安装。 + +; *** Installation status messages +StatusClosingApplications=正在关闭应用程序… +StatusCreateDirs=正在创建文件夹… +StatusExtractFiles=正在提取文件… +StatusCreateIcons=正在创建快捷方式… +StatusCreateIniEntries=正在创建 INI 项目… +StatusCreateRegistryEntries=正在创建注册表项目… +StatusRegisterFiles=正在注册文件… +StatusSavingUninstall=正在保存卸载信息… +StatusRunProgram=正在完成安装… +StatusRestartingApplications=正在重启应用程序… +StatusRollback=正在回滚更改… + +; *** Misc. errors +ErrorInternal2=内部错误:%1 +ErrorFunctionFailedNoCode=%1 失败 +ErrorFunctionFailed=%1 失败。代码 %2 +ErrorFunctionFailedWithMessage=%1 失败。代码 %2。%n%3 +ErrorExecutingProgram=无法执行文件:%n%1 + +; *** Registry errors +ErrorRegOpenKey=打开注册表键时出错:%n%1\%2 +ErrorRegCreateKey=创建注册表键时出错:%n%1\%2 +ErrorRegWriteKey=写入注册表键时出错:%n%1\%2 + +; *** INI errors +ErrorIniEntry=在文件“%1”中创建 INI 项目时出错。 + +; *** File copying errors +FileAbortRetryIgnore=点击“重试”重新尝试,点击“忽略”跳过此文件(不推荐),或点击“中止”取消安装。 +FileAbortRetryIgnore2=点击“重试”重新尝试,点击“忽略”继续安装(不推荐),或点击“中止”取消安装。 +SourceIsCorrupted=源文件已损坏 +SourceDoesntExist=源文件“%1”不存在 +ExistingFileReadOnly=现有文件为只读。%n%n点击“重试”移除只读属性并重试,点击“忽略”跳过此文件,或点击“中止”取消安装。 +ErrorReadingExistingDest=读取现有文件时发生错误: +FileExists=文件已存在。%n%n你要覆盖它吗? +ExistingFileNewer=现有文件比安装向导要安装的还新。建议你保留现有文件。%n%n保留现有文件吗? +ErrorChangingAttr=更改现有文件的属性时发生错误: +ErrorCreatingTemp=在目标文件夹中创建文件时发生错误: +ErrorReadingSource=读取源文件时发生错误: +ErrorCopying=复制文件时发生错误: +ErrorReplacingExistingFile=替换现有文件时发生错误: +ErrorRestartReplace=重启后替换失败: +ErrorRenamingTemp=重命名目标文件夹中的文件时发生错误: +ErrorRegisterServer=无法注册 DLL/OCX:%1 +ErrorRegSvr32Failed=RegSvr32 失败。返回值:%1 +ErrorRegisterTypeLib=无法注册类型库:%1 + +; *** Post-installation errors +ErrorOpeningReadme=打开自述文件时发生错误。 +ErrorRestartingComputer=安装向导无法重启电脑。请手动重启。 + +; *** Uninstaller messages +UninstallNotFound=文件“%1”不存在。不能卸载。 +UninstallOpenError=文件“%1”不能打开。不能卸载 +UninstallUnsupportedVer=卸载日志文件“%1”的格式不能被此版本的卸载向导识别。不能卸载 +UninstallUnknownEntry=卸载日志中遇到一个未知的项目 (%1) +ConfirmUninstall=卸载前请先确保 %1 客户端已被关闭。%n%n你是否确定要完全删除 %1 及其所有组件? +UninstallOnlyOnWin64=此安装只能在 64 位 Windows 上卸载。 +OnlyAdminCanUninstall=此安装只能由具备管理员权限的用户卸载。 +UninstallStatusLabel=正在删除 %1,请稍等… +UninstalledAll=%1 已成功删除。 +UninstalledMost=%1 卸载完成。%n%n某些项目不能删除,可以手动删除。 +UninstalledAndNeedsRestart=若要完成 %1 的卸载,必须重启电脑。%n%n你要立即重启吗? +UninstallDataCorrupted=文件“%1”已损坏。不能卸载 + +; *** Uninstallation phase messages +ConfirmDeleteSharedFileTitle=删除共享文件吗? +ConfirmDeleteSharedFile2=下列共享文件不再被任何程序使用。你要删除该共享文件吗?%n%n如果还有程序使用该文件而它已被删除,这些程序可能无法正常运行。如果你不确定,就请选择“否”。留下该文件不会对系统造成任何危害。 +SharedFileNameLabel=文件名: +SharedFileLocationLabel=位置: +WizardUninstalling=卸载状态 +StatusUninstalling=正在卸载 %1… + +; *** Shutdown block reasons +ShutdownBlockReasonInstallingApp=正在安装 %1。 +ShutdownBlockReasonUninstallingApp=正在卸载 %1。 + +; The custom messages below aren't used by Setup itself, but if you make +; use of them in your scripts, you'll want to translate them. + +[CustomMessages] + +NameAndVersion=%1 版本 %2 +AdditionalIcons=附加图标: +CreateDesktopIcon=创建桌面图标(&D) +CreateQuickLaunchIcon=创建快速启动栏图标(&Q) +ProgramOnTheWeb=%1 网站 +UninstallProgram=卸载 %1 +LaunchProgram=运行 %1 +AssocFileExtension=将 %1 与 %2 文件扩展名关联(&A) +AssocingFileExtension=正在将 %1 与 %2 文件扩展名关联… +AutoStartProgramGroupDescription=启动: +AutoStartProgram=自动启动 %1 +AddonHostProgramNotFound=在你选择的文件夹中找不到 %1。%n%n是否仍然继续? diff --git a/template/.electron-vue/setup_resources/license.txt b/template/.electron-vue/setup_resources/license.txt new file mode 100644 index 00000000..797a3a5a --- /dev/null +++ b/template/.electron-vue/setup_resources/license.txt @@ -0,0 +1 @@ +all rights reserved diff --git a/template/.electron-vue/setup_resources/setup.iss b/template/.electron-vue/setup_resources/setup.iss new file mode 100644 index 00000000..a65c5ef7 --- /dev/null +++ b/template/.electron-vue/setup_resources/setup.iss @@ -0,0 +1,80 @@ +#define MyAppName "_name_" +#define MyAppAliasName "_appName_" +#define MyAppVersion "_version_" +#define MyAppPublisher "_appPublisher_" +#define MyAppURL "_appURL_" +#define MyAppExeName "_name_.exe" +#define OutputPath "_outputPath_" +#define OutputFileName "_outputFileName_" +#define SourceMain "_filesPath_\_name_.exe" +#define SourceFolder "_filesPath_\*" +#define LicenseFilePath "_resourcesPath_\license.txt" +#define SetupIconFilePath "_icon_" +#define MyAppId "_appId_" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={#MyAppId} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +AppVerName={#MyAppAliasName} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={localappdata}\{#MyAppAliasName} +;LicenseFile={#LicenseFilePath} +OutputDir={#OutputPath} +OutputBaseFilename={#OutputFileName} +SetupIconFile={#SetupIconFilePath} +Compression=lzma +SolidCompression=yes +PrivilegesRequired=admin +Uninstallable=yes +UninstallDisplayName={#MyAppAliasName} +DefaultGroupName={#MyAppAliasName} + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce +Name: "startupicon"; Description: "{cm:AutoStartProgram}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce; + +[Files] +Source: {#SourceMain}; DestDir: "{app}"; Flags: ignoreversion +Source: {#SourceFolder}; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs + +[Messages] +SetupAppTitle={#MyAppAliasName} setup wizard +SetupWindowTitle={#MyAppAliasName} setup wizard + +[Icons] +Name: "{commondesktop}\{#MyAppAliasName}"; Filename: "{app}\{#MyAppExeName}"; Parameters:"--disable-pinch";Tasks: desktopicon +Name: "{commonstartup}\{#MyAppAliasName}"; Filename: "{app}\{#MyAppExeName}";Parameters:"--disable-pinch"; Tasks: startupicon +Name: "{group}\{#MyAppAliasName}"; Filename: "{app}\{#MyAppExeName}"; Parameters:"--disable-pinch" +Name: "{group}\uninstall {#MyAppAliasName}"; Filename: "{uninstallexe}" + + +[Languages] +Name: "chinese"; MessagesFile: "_resourcesPath_\ChineseSimp.isl" + +[Run] + +[Code] +// Kill the process before installation +function InitializeSetup(): Boolean; + var ErrorCode: Integer; + begin + ShellExec('open','taskkill.exe','/f /im {#MyAppExeName}','',SW_HIDE,ewNoWait,ErrorCode); + ShellExec('open','tskill.exe',' {#MyAppAliasName}','',SW_HIDE,ewNoWait,ErrorCode); + result := True; + end; + +// Kill the process before uninstall +function InitializeUninstall(): Boolean; + var ErrorCode: Integer; + begin + ShellExec('open','taskkill.exe','/f /im {#MyAppExeName}','',SW_HIDE,ewNoWait,ErrorCode); + ShellExec('open','tskill.exe',' {#MyAppAliasName}','',SW_HIDE,ewNoWait,ErrorCode); + result := True; + end; diff --git a/template/.electron-vue/webpack.renderer.config.js b/template/.electron-vue/webpack.renderer.config.js index 35f5870d..896307bb 100644 --- a/template/.electron-vue/webpack.renderer.config.js +++ b/template/.electron-vue/webpack.renderer.config.js @@ -129,6 +129,18 @@ let rendererConfig = { new HtmlWebpackPlugin({ filename: 'index.html', template: path.resolve(__dirname, '../src/index.ejs'), + templateParameters(compilation, assets, options) { + return { + compilation: compilation, + webpack: compilation.getStats().toJson(), + webpackConfig: compilation.options, + htmlWebpackPlugin: { + files: assets, + options: options + }, + process, + }; + }, minify: { collapseWhitespace: true, removeAttributeQuotes: true, diff --git a/template/.electron-vue/webpack.web.config.js b/template/.electron-vue/webpack.web.config.js index 3b3b2ca8..520ac049 100644 --- a/template/.electron-vue/webpack.web.config.js +++ b/template/.electron-vue/webpack.web.config.js @@ -101,6 +101,18 @@ let webConfig = { new HtmlWebpackPlugin({ filename: 'index.html', template: path.resolve(__dirname, '../src/index.ejs'), + templateParameters(compilation, assets, options) { + return { + compilation: compilation, + webpack: compilation.getStats().toJson(), + webpackConfig: compilation.options, + htmlWebpackPlugin: { + files: assets, + options: options + }, + process, + }; + }, minify: { collapseWhitespace: true, removeAttributeQuotes: true, diff --git a/template/.eslintrc.js b/template/.eslintrc.js index 77eeefe9..35650198 100644 --- a/template/.eslintrc.js +++ b/template/.eslintrc.js @@ -21,6 +21,7 @@ module.exports = { 'html' ], 'rules': { + 'space-before-function-paren': ['error', 'never'], {{#if_eq eslintConfig 'standard'}} // allow paren-less arrow functions 'arrow-parens': 0, diff --git a/template/.prettierrc.json b/template/.prettierrc.json new file mode 100644 index 00000000..b2095be8 --- /dev/null +++ b/template/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/template/build/icons/256x256.png b/template/build/icons/256x256.png deleted file mode 100644 index 3d67e9d6..00000000 Binary files a/template/build/icons/256x256.png and /dev/null differ diff --git a/template/build/icons/icon.icns b/template/build/icons/icon.icns deleted file mode 100644 index a65f91bc..00000000 Binary files a/template/build/icons/icon.icns and /dev/null differ diff --git a/template/build/icons/icon.ico b/template/build/icons/icon.ico deleted file mode 100644 index 87027290..00000000 Binary files a/template/build/icons/icon.ico and /dev/null differ diff --git a/template/package.json b/template/package.json index 3c5472f3..09175235 100644 --- a/template/package.json +++ b/template/package.json @@ -66,17 +66,21 @@ ] }, "mac": { - "icon": "build/icons/icon.icns" + "icon": ".electron-vue/icons/icon.icns" }, "win": { - "icon": "build/icons/icon.ico" + "icon": ".electron-vue/icons/icon.ico" }, "linux": { - "icon": "build/icons" + "icon": ".electron-vue/icons" } }, {{/if_eq}} "dependencies": { + "element-ui": "^2.13.2", + "v-viewer": "^1.5.1", + "vue-awesome-swiper": "^3.1.3", + "vue-video-player": "^5.0.2", "vue": "^2.5.16"{{deps plugins}} }, "devDependencies": { @@ -126,6 +130,8 @@ "mini-css-extract-plugin": "0.4.0", "file-loader": "^1.1.11", "html-webpack-plugin": "^3.2.0", + "iconv-lite": "^0.5.0", + "innosetup-compiler": "^5.6.1", {{#if unit}} "inject-loader": "^4.0.1", "karma": "^2.0.2", diff --git a/template/src/index.ejs b/template/src/index.ejs index d84b1c87..afed6443 100644 --- a/template/src/index.ejs +++ b/template/src/index.ejs @@ -3,6 +3,31 @@ {{ name }} + <% if (htmlWebpackPlugin.options.nodeModules) { %> + + diff --git a/template/src/renderer/components/LandingPage.vue b/template/src/renderer/components/LandingPage.vue deleted file mode 100644 index 3ea4ebea..00000000 --- a/template/src/renderer/components/LandingPage.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - - diff --git a/template/src/renderer/components/LandingPage/SystemInformation.vue b/template/src/renderer/components/LandingPage/SystemInformation.vue deleted file mode 100644 index 5dcb8e12..00000000 --- a/template/src/renderer/components/LandingPage/SystemInformation.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/template/src/renderer/main.js b/template/src/renderer/main.js index a90d6f79..701ca497 100644 --- a/template/src/renderer/main.js +++ b/template/src/renderer/main.js @@ -10,7 +10,19 @@ import router from './router' {{#isEnabled plugins 'vuex'}} import store from './store' {{/isEnabled}} - +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import VideoPlayer from 'vue-video-player' +require('video.js/dist/video-js.css') +require('vue-video-player/src/custom-theme.css') +import VueAwesomeSwiper from 'vue-awesome-swiper' +import 'swiper/dist/css/swiper.css' +import Viewer from 'v-viewer' +import 'viewerjs/dist/viewer.css' +Vue.use(ElementUI) +Vue.use(VideoPlayer) +Vue.use(VueAwesomeSwiper) +Vue.use(Viewer) {{#isEnabled plugins 'vue-electron'}} if (!process.env.IS_WEB) Vue.use(require('vue-electron')) {{/isEnabled}} @@ -18,7 +30,22 @@ if (!process.env.IS_WEB) Vue.use(require('vue-electron')) Vue.http = Vue.prototype.$http = axios {{/isEnabled}} Vue.config.productionTip = false - +Viewer.setDefaults({ + inline: false, + button: true, + navbar: false, + title: false, + toolbar: false, + tooltip: false, + movable: true, + zoomable: true, + rotatable: true, + scalable: true, + transition: true, + fullscreen: true, + keyboard: true, + url: 'data-source' +}) /* eslint-disable no-new */ new Vue({ components: { App }, diff --git a/template/src/renderer/router/index.js b/template/src/renderer/router/index.js index 3c9e078f..8a7a4f56 100644 --- a/template/src/renderer/router/index.js +++ b/template/src/renderer/router/index.js @@ -7,8 +7,8 @@ export default new Router({ routes: [ { path: '/', - name: 'landing-page', - component: require('@/components/LandingPage').default + name: 'index', + component: require('@/components/Index').default }, { path: '*',