• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript electron-packager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中electron-packager的典型用法代码示例。如果您正苦于以下问题:TypeScript electron-packager类的具体用法?TypeScript electron-packager怎么用?TypeScript electron-packager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了electron-packager类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: packageApp

function packageApp() {
  // not sure if this is needed anywhere, so I'm just going to inline it here
  // for now and see what the future brings...
  const toPackagePlatform = (platform: NodeJS.Platform) => {
    if (platform === 'win32' || platform === 'darwin' || platform === 'linux') {
      return platform
    }
    throw new Error(
      `Unable to convert to platform for electron-packager: '${
        process.platform
      }`
    )
  }

  const toPackageArch = (targetArch: string | undefined): packager.arch => {
    if (targetArch === undefined) {
      return 'x64'
    }

    if (targetArch === 'arm64' || targetArch === 'x64') {
      return targetArch
    }

    throw new Error(
      `Building Desktop for architecture '${targetArch}'  is not supported`
    )
  }

  const options: packager.Options & IPackageAdditionalOptions = {
    name: getExecutableName(),
    platform: toPackagePlatform(process.platform),
    arch: toPackageArch(process.env.TARGET_ARCH),
    asar: false, // TODO: Probably wanna enable this down the road.
    out: getDistRoot(),
    icon: path.join(projectRoot, 'app', 'static', 'logos', 'icon-logo'),
    dir: outRoot,
    overwrite: true,
    tmpdir: false,
    derefSymlinks: false,
    prune: false, // We'll prune them ourselves below.
    ignore: [
      new RegExp('/node_modules/electron($|/)'),
      new RegExp('/node_modules/electron-packager($|/)'),
      new RegExp('/\\.git($|/)'),
      new RegExp('/node_modules/\\.bin($|/)'),
    ],
    appCopyright: 'Copyright Š 2017 GitHub, Inc.',

    // macOS
    appBundleId: getBundleID(),
    appCategoryType: 'public.app-category.developer-tools',
    osxSign: true,
    protocols: [
      {
        name: getBundleID(),
        schemes: [
          isPublishableBuild
            ? 'x-github-desktop-auth'
            : 'x-github-desktop-dev-auth',
          'x-github-client',
          'github-mac',
        ],
      },
    ],

    // Windows
    win32metadata: {
      CompanyName: getCompanyName(),
      FileDescription: '',
      OriginalFilename: '',
      ProductName: getProductName(),
      InternalName: getProductName(),
    },
  }

  return packager(options)
}
开发者ID:soslanashkhotov,项目名称:desktop,代码行数:77,代码来源:build.ts


示例2: callback

import * as packager from "electron-packager";

function callback(err: Error, appPath: string) {
	const msg = err.message;
	const	index = appPath.indexOf("test");
}

packager({
	dir: ".",
	name: "myapplication",
	platform: "win32",
	arch: "all",
	electronVersion: "0.34.0"
}, callback);

packager({
	dir: ".",
	name: "myapplication",
	electronVersion: "0.34.0",
	all: true
}, callback);

packager({
	dir: ".",
	name: "myapplication",
	platform: "win32",
	arch: "all",
	electronVersion: "0.34.0"
}, callback);

packager({
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:31,代码来源:electron-packager-tests.ts


示例3: getExtraResource

(async () => {
    try {
        const options: packager.Options = {
            arch: "x64",
            asar: true,
            dir: ".",
            extraResource: await getExtraResource(),
            icon,
            ignore: getIgnore(),
            overwrite: true,
            platform: os.platform(),
            prune: true,

            appCopyright: "Copyright Š 2018-present Envox d.o.o.",
            appVersion: packageJson.version
        };

        const appPaths = await packager(options);

        fs.copyFileSync("./LICENSE.TXT", appPaths[0] + "/LICENSE.EEZSTUDIO.TXT");
    } catch (err) {
        console.error(err);
    }

    process.exit();
})();
开发者ID:eez-open,项目名称:studio,代码行数:26,代码来源:build-installation.ts


示例4: init

    protected init(cb: any) {

        packager(paths.electron.packager, (err: any, appPaths: any) => {
            console.log(appPaths)

            cb()
        })
    }
开发者ID:ifedu,项目名称:speedseed-multi-tic-tac-toe,代码行数:8,代码来源:electron.packager.ts


示例5: packager

gulp.task('package-app', () =>
    packager({
        dir: './dist',
        out: '_package',
        overwrite: true,
        icon: './dist/assets/icon/favicon',
    }, (error, appPaths) => {
        console.log('===========================================================');
        console.log('================ Electron Packager Results ================');
        console.log('===========================================================');
        if (error) {
            console.log(error);
        } else if (appPaths) {
            console.log(appPaths.join('\n'));
        }
    })
开发者ID:acaprojects,项目名称:a2-composer,代码行数:16,代码来源:cli.ts


示例6: completeFunction

function completeFunction(buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) {
	callbackFn();
}

function ignoreFunction(path: string) {
	return true;
}

packager({
	dir: ".",
	name: "myapplication",
	platform: "win32",
	arch: "all",
	electronVersion: "0.34.0",
	win32metadata: {
		CompanyName: "Acme CO",
		FileDescription: "My application",
		OriginalFilename: "myapp.exe",
		ProductName: "Application",
		InternalName: "roadrunner",
		"requested-execution-level": "highestAvailable",
		"application-manifest": "manifest.xml"
	}
}, callback);

packager({
	dir: ".",
	name: "myapplication",
	electronVersion: "0.34.0",
	all: true,
	win32metadata: {
		CompanyName: "Acme CO",
开发者ID:Silver-Connection,项目名称:DefinitelyTyped,代码行数:32,代码来源:electron-packager-tests.ts



注:本文中的electron-packager类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript errorhandler类代码示例发布时间:2022-05-28
下一篇:
TypeScript dragula类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap