热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

电子电子-winstaller为Msi设置安装路径。-Electronelectron-winstallerSetInstallationPathforMsi

ImusingElectronandAngular2tocreateadesktopapplicationforWindows,andcansuccessfullyge

I'm using Electron and Angular2 to create a desktop application for Windows, and can successfully generate the .exe and .msi files for installation. I use electron-packager to package my electron app packaged electron app

我使用电子和Angular2为Windows创建一个桌面应用程序,并且可以成功地生成.exe和.msi文件来安装。我用电子包装器包装我的电子应用程序包装电子应用。

After packaging the app I use electron-winstaller to generate an msi from the package

在打包后,我使用电子winstaller从包中生成msi。

When I run the .msi file though, It automatically installs my project to C:\Users\Username\AppData\Local\ApplicationName . The only thing when double clicking on the msi is this short dialog: dialog

但是,当我运行.msi文件时,它会自动地将我的项目安装到c:) usersusernamelocal\ ApplicationName。当双击msi时,唯一的事情就是这个简短的对话框:对话框。

What I would like though, is for the installer to prompt me to where it should install the application. I want to be able to set the installation path when installing.

但是,我希望安装程序能够提示我在哪里安装应用程序。我希望在安装时能够设置安装路径。

I should also mention that I tried using electron-builder, and could also generate the msi file. But here I could also not set the installation path. I found this Electron create MSI installer using electron-builder issue where someone else had the same problem with electron-builder, but there was no answer to his question.

我还应该提到,我尝试使用电子构建器,也可以生成msi文件。但这里我也不能设置安装路径。我发现这个电子制造了MSI安装程序,它使用的是电子制造的问题,在这个问题上,其他人也有同样的问题,但他的问题没有答案。

Here is my configuration for electron-winstaller. The winstaller.js file is located at the root of my project:

这是我的电子winstaller的配置。winstaller。js文件位于我项目的根目录:

var electrOnInstaller= require('electron-winstaller');
var resultPromise = electronInstaller.createWindowsInstaller(
  {
    appDirectory: '../installer/sda-win32-x64',
    outputDirectory: '../installer',
    authors: 'SORA Desktop Application',
    exe: 'sda.exe',
    setupExe: 'SDASetup.exe',
    setupMsi: 'SDASetup.msi',
    iconUrl: 'file:///d/dev/sda/client/src/app/assets/images/icon.ico',
    setupIcon: 'src/app/assets/images/icon.ico'
  });

resultPromise.then(() => console.log('It worked!'), e => console.log(`No dice: ${e.message}`));

Here is my package.json configuration. This is also located at the root of my project

这是我的包。json配置。这也是我项目的根。

{
  "name": "sda",
  "description": "SDA 3.0",
  "version": "0.0.1",
  "main": "gulpfile.js",
  "keywords": [
    "Angular",
    "Angular2",
    "Electron",
    "Typescript"
  ],
  "author": "Vic",
  "license": "MIT",
  "scripts": {
    "build": "gulp build",
    "start": "npm run build && electron ./dist/index.js",
    "package": "npm run build && gulp electron:package",
    "postinstall": "concurrently \"bower install\" \"typings install\"",
    "appstart": "electron ./dist/index.js",
    "test": "gulp test",
    "deploy": "rm -rf ../installer && gulp setInDevelopmentFlagToFalse && cp src/app/environment/environment.prod.ts src/app/environment/environment.ts && npm run build && cd dist && electron-packager . --platform=win32 --arch=x64 --overwrite=true --out=../../installer --icon=assets/images/icon.ico && cd ../ && gulp setInDevelopmentFlagToTrue && cp src/app/environment/environment.dev.ts src/app/environment/environment.ts && node winstaller.js"
  },
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "@angular/upgrade": "2.0.0",
    "@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.8",
    "@types/hammerjs": "2.0.33",
    "@types/sjcl": "1.0.27",
    "angular2-jwt": "0.1.23",
    "angular2-moment": "1.0.0-beta.5",
    "angular2localization": "1.0.2",
    "bootstrap": "4.0.0-alpha.4",
    "core-js": "2.4.1",
    "file-saver": "1.3.3",
    "font-awesome": "4.6.3",
    "jquery": "3.1.1",
    "moment": "2.15.2",
    "normalize.css": "5.0.0",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.12",
    "sjcl": "1.0.6",
    "systemjs": "0.19.27",
    "tether": "1.3.7",
    "zone.js": "0.6.23"
  },
  "devDependencies": {
    "bower": "1.7.9",
    "concurrently": "2.2.0",
    "del": "2.2.0",
    "electron": "1.3.5",
    "electron-connect": "0.6.0",
    "electron-packager": "8.1.0",
    "electron-prebuilt": "1.3.8",
    "electron-winstaller": "2.3.4",
    "eslint": "3.6.0",
    "eslint-config-google": "0.6.0",
    "eslint-plugin-html": "1.5.3",
    "gulp": "3.9.1",
    "gulp-atom-electron": "1.9.0",
    "gulp-concat": "2.6.0",
    "gulp-replace": "^0.5.4",
    "gulp-sass": "2.3.1",
    "gulp-shell": "0.5.2",
    "gulp-symdest": "1.0.0",
    "gulp-typescript": "3.0.2",
    "hammerjs": "2.0.8",
    "jasmine-core": "2.5.2",
    "karma": "1.3.0",
    "karma-chrome-launcher": "2.0.0",
    "karma-cli": "1.0.1",
    "karma-htmlfile-reporter": "0.3.4",
    "karma-jasmine": "1.0.2",
    "karma-jasmine-html-reporter": "0.2.2",
    "karma-sourcemap-loader": "0.3.7",
    "karma-typescript-preprocessor": "0.3.0",
    "run-sequence": "1.1.5",
    "typescript": "2.0.2",
    "typings": "1.3.2"
  }
}

Do I maybe need a certificate ? Is it not a default setting for the windows installer to ask where to install?

我需要证书吗?它不是windows安装程序要求安装在哪里的默认设置吗?

1 个解决方案

#1


0  

electron-winstaller uses squirrel to generate the setup files. According to their documentation, the install path is "effectively immutable" and hard set to \%LocalAppData%\AppName :

电子winstaller使用squirrel来生成安装文件。根据他们的文档,安装路径是“有效不可变的”,并且很难设置为\%LocalAppData%\AppName:

Install Location

安装位置

The Setup.exe, and later the UpdateManager in MyApp must have the ability to write files to and execute files from the application install location. To ensure permission for all types of users, the user's application data directory is selected as the install location (i.e., %LocalAppData%\MyApp).

的设置。exe,然后MyApp中的UpdateManager必须能够从应用程序安装位置写入文件并执行文件。为了确保对所有类型的用户的权限,用户的应用程序数据目录被选择为安装位置(即:,% LocalAppData % \ MyApp)。

The installation root really only needs to consist of two types of folders:

安装根实际上只需要包含两种类型的文件夹:

Packages - folder used to download and assemble the update package files. App Folders - the "installed" application files for a given version of MyApp. \%LocalAppData%\MyApp \packages MyApp-1.0.0.nupkg MyApp-1.0.1-delta.nupkg MyApp-1.0.1.nupkg \app-1.0.0 MyApp.exe \app-1.0.1 MyApp.exe The packages directory is effectively immutable, it simply consists of the packages we've downloaded. Using the user's local application data directory means that we the needed write-access to the install directory on a per-user basis.

软件包-用于下载和组装更新包文件的文件夹。App文件夹-为某一版本的MyApp“安装”的应用程序文件。MyApp-1.0.0 \ % LocalAppData % \ MyApp \包。nupkg MyApp-1.0.1-delta。nupkg MyApp-1.0.1。nupkg \ app-1.0.0 MyApp。exe \ app-1.0.1 MyApp。exe包目录实际上是不可变的,它只包含我们下载的包。使用用户的本地应用程序数据目录意味着我们需要在每个用户基础上对安装目录进行写访问。

Tip: See Machine-wide Installs for more information on ensuring your application pushed to all users in an enterprise environment.

提示:请参阅机器广泛的安装,以获得关于确保您的应用程序在企业环境中向所有用户推送的更多信息。

The method for installing machine wide is to use the MSI which only triggers installation on the next user login:

安装机器宽的方法是使用MSI,它只会在下一次用户登录时触发安装:

Machine-wide Installs

改变机器安装

Squirrel's Releasify command generates an MSI file suitable for installation via Group Policy. This MSI isn't a general-purpose installer, this means that once you run the MSI, users from now on will get the app installed, on next Login.

Squirrel的Releasify命令生成一个MSI文件,适合通过组策略安装。这个MSI不是一个通用的安装程序,这意味着一旦你运行MSI,从现在开始的用户将会在下次登录时安装应用程序。

So, most normal users should continue to run the Setup.exe's generated by Releasify, but if you want to have an IT Admin Friendly version, you can hand off the MSI

因此,大多数正常用户应该继续运行安装程序。exe是由Releasify生成的,但是如果您想要一个IT管理友好的版本,您可以手动关闭MSI。

Most users of Squirrel won't have to do anything new to enable this behavior, though certain NuGet package IDs / names might cause problems with MSI.

大多数Squirrel用户不需要做任何新的操作来启用这种行为,尽管某些NuGet包id /名称可能会导致MSI出现问题。


推荐阅读
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • CentOS 6.5安装VMware Tools及共享文件夹显示问题解决方法
    本文介绍了在CentOS 6.5上安装VMware Tools及解决共享文件夹显示问题的方法。包括清空CD/DVD使用的ISO镜像文件、创建挂载目录、改变光驱设备的读写权限等步骤。最后给出了拷贝解压VMware Tools的操作。 ... [详细]
  • 本文讨论了在openwrt-17.01版本中,mt7628设备上初始化启动时eth0的mac地址总是随机生成的问题。每次随机生成的eth0的mac地址都会写到/sys/class/net/eth0/address目录下,而openwrt-17.01原版的SDK会根据随机生成的eth0的mac地址再生成eth0.1、eth0.2等,生成后的mac地址会保存在/etc/config/network下。 ... [详细]
  • r2dbc配置多数据源
    R2dbc配置多数据源问题根据官网配置r2dbc连接mysql多数据源所遇到的问题pom配置可以参考官网,不过我这样配置会报错我并没有这样配置将以下内容添加到pom.xml文件d ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • Mac OS 升级到11.2.2 Eclipse打不开了,报错Failed to create the Java Virtual Machine
    本文介绍了在Mac OS升级到11.2.2版本后,使用Eclipse打开时出现报错Failed to create the Java Virtual Machine的问题,并提供了解决方法。 ... [详细]
  • 本文介绍了Hyperledger Fabric外部链码构建与运行的相关知识,包括在Hyperledger Fabric 2.0版本之前链码构建和运行的困难性,外部构建模式的实现原理以及外部构建和运行API的使用方法。通过本文的介绍,读者可以了解到如何利用外部构建和运行的方式来实现链码的构建和运行,并且不再受限于特定的语言和部署环境。 ... [详细]
  • 本文介绍了高校天文共享平台的开发过程中的思考和规划。该平台旨在为高校学生提供天象预报、科普知识、观测活动、图片分享等功能。文章分析了项目的技术栈选择、网站前端布局、业务流程、数据库结构等方面,并总结了项目存在的问题,如前后端未分离、代码混乱等。作者表示希望通过记录和规划,能够理清思路,进一步完善该平台。 ... [详细]
  • Android系统移植与调试之如何修改Android设备状态条上音量加减键在横竖屏切换的时候的显示于隐藏
    本文介绍了如何修改Android设备状态条上音量加减键在横竖屏切换时的显示与隐藏。通过修改系统文件system_bar.xml实现了该功能,并分享了解决思路和经验。 ... [详细]
  • 本文介绍了Android 7的学习笔记总结,包括最新的移动架构视频、大厂安卓面试真题和项目实战源码讲义。同时还分享了开源的完整内容,并提醒读者在使用FileProvider适配时要注意不同模块的AndroidManfiest.xml中配置的xml文件名必须不同,否则会出现问题。 ... [详细]
  • 本文介绍了如何使用Express App提供静态文件,同时提到了一些不需要使用的文件,如package.json和/.ssh/known_hosts,并解释了为什么app.get('*')无法捕获所有请求以及为什么app.use(express.static(__dirname))可能会提供不需要的文件。 ... [详细]
  • 本文介绍了前端人员必须知道的三个问题,即前端都做哪些事、前端都需要哪些技术,以及前端的发展阶段。初级阶段包括HTML、CSS、JavaScript和jQuery的基础知识。进阶阶段涵盖了面向对象编程、响应式设计、Ajax、HTML5等新兴技术。高级阶段包括架构基础、模块化开发、预编译和前沿规范等内容。此外,还介绍了一些后端服务,如Node.js。 ... [详细]
  • 网络请求模块选择——axios框架的基本使用和封装
    本文介绍了选择网络请求模块axios的原因,以及axios框架的基本使用和封装方法。包括发送并发请求的演示,全局配置的设置,创建axios实例的方法,拦截器的使用,以及如何封装和请求响应劫持等内容。 ... [详细]
  • Spring常用注解(绝对经典),全靠这份Java知识点PDF大全
    本文介绍了Spring常用注解和注入bean的注解,包括@Bean、@Autowired、@Inject等,同时提供了一个Java知识点PDF大全的资源链接。其中详细介绍了ColorFactoryBean的使用,以及@Autowired和@Inject的区别和用法。此外,还提到了@Required属性的配置和使用。 ... [详细]
author-avatar
中国有程序猿
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有