当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript app.getVersion方法代码示例

本文整理汇总了TypeScript中electron.app.getVersion方法的典型用法代码示例。如果您正苦于以下问题:TypeScript app.getVersion方法的具体用法?TypeScript app.getVersion怎么用?TypeScript app.getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在electron.app的用法示例。


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

示例1: it

    it('overrides the version', () => {
      expect(app.getVersion()).to.equal('0.1.0')
      app.setVersion('test-version')

      expect(app.getVersion()).to.equal('test-version')
      app.setVersion('0.1.0')
    })
开发者ID:malept,项目名称:electron,代码行数:7,代码来源:api-app-spec.ts

示例2: getWebAppUrl

function getWebAppUrl() {
  const queryParams = new url.URLSearchParams();
  queryParams.set('version', electron.app.getVersion());

  // Set queryParams from environment variables.
  if (process.env.SB_IMAGE) {
    queryParams.set('image', process.env.SB_IMAGE);
    console.log(`Will install Shadowbox from ${process.env.SB_IMAGE} Docker image`);
  }
  if (process.env.SB_METRICS_URL) {
    queryParams.set('metricsUrl', process.env.SB_METRICS_URL);
    console.log(`Will use metrics url ${process.env.SB_METRICS_URL}`);
  }
  if (process.env.SENTRY_DSN) {
    queryParams.set('sentryDsn', process.env.SENTRY_DSN);
    console.log(`Will use sentryDsn url ${process.env.SENTRY_DSN}`);
  }
  if (debugMode) {
    queryParams.set('outlineDebugMode', 'true');
    console.log(`Enabling Outline debug mode`);
  }

  // Append arguments to URL if any.
  const webAppUrl = new url.URL('outline://web_app/index.html');
  webAppUrl.search = queryParams.toString();
  const webAppUrlString = webAppUrl.toString();
  console.log('Launching web app from ' + webAppUrlString);
  return webAppUrlString;
}
开发者ID:fang2x,项目名称:outline-server,代码行数:29,代码来源:index.ts

示例3: constructor

  constructor(window: BrowserWindow) {
    if (isDev()) {
      return
    }

    if (os.platform() !== "darwin") {
      return
    }

    const version = app.getVersion()
    autoUpdater.addListener("update-available", (event: any) => {
      log("A new update is available")
    })
    autoUpdater.addListener("update-downloaded", (event: any, releaseNotes: string, releaseName: string, releaseDate: string, updateURL: string) => {
      notify("A new update is ready to install", `Version ${releaseName} is downloaded and will be automatically installed on Quit`)
    })
    autoUpdater.addListener("error", (error: any) => {
      log(error)
    })
    autoUpdater.addListener("checking-for-update", (event: any) => {
      log("checking-for-update")
    })
    autoUpdater.addListener("update-not-available", () => {
      log("update-not-available")
    })
    autoUpdater.setFeedURL(`https://${UPDATE_SERVER_HOST}/update/${os.platform()}_${os.arch()}/${version}`)

    window.webContents.once("did-frame-finish-load", (event: any) => {
      autoUpdater.checkForUpdates()
    })
  }
开发者ID:agozie,项目名称:onshape-desktop-shell,代码行数:31,代码来源:AppUpdater.ts

示例4: reportIssue

export function reportIssue(opts: ReportIssueOpts) {
  if (typeof opts === "undefined") {
    opts = {};
  }

  const log = opts.log;
  let body = opts.body || "";
  let type = opts.type || "Issue";
  const repo = opts.repo || urls.itchRepo;
  const before = opts.before || "";

  if (typeof log !== "undefined") {
    type = "Feedback";
    body = `Event log:

\`\`\`
${log}
\`\`\`
`;
  }

  const platformEmoji = platformData[currentRuntime().platform].emoji;
  const query = querystring.stringify({
    title: `${platformEmoji} ${type} v${app.getVersion()}`,
    body: before + body,
  });
  let url = `${repo}/issues/new?${query}`;
  const maxLen = 2000;
  if (url.length > maxLen) {
    url = url.substring(0, maxLen);
  }
  shell.openExternal(url);
}
开发者ID:itchio,项目名称:itch,代码行数:33,代码来源:crash-reporter.ts

示例5: unpackBackend

 unpackBackend(executeable, function () {
     console.log("Spawning backend process");
     // Create the backend service, and tell it where to save data
     backend = spawn(executeable, [app.getPath("userData"), app.getVersion()]);
     backend.stdout.on("data", function (data:any) {
         console.log(data.toString());
     });
     backend.stderr.on("data", function (data:any) {
         console.log(data.toString());
     });
     backend.on('error', function(data:any) {
         console.log(data.toString());
     });
     console.log("Spawned backend process");
     cb();
 });
开发者ID:fcpwiz,项目名称:go-modpack-packer,代码行数:16,代码来源:main.ts

示例6: constructor

    constructor(window: Electron.BrowserWindow) {
        if (isDev()) {
            log.info(`isDev() true, auto-updater disabled`);
            return;
        }

        const version = app.getVersion();
        const feedUrl = `https://${UPDATE_SERVER_HOST}/update/${os.platform()}/${version}`;

        try {
            autoUpdater.setFeedURL(feedUrl);
        } catch (err) {
            log.info(`autoUpdater.setFeedURL failed: ${err}`);
            return;
        }

        autoUpdater.addListener("update-available", (event: any) => {
            log.info("A new update is available");
        });
        autoUpdater.addListener(
            "update-downloaded",
            (event: any, releaseNotes: string, releaseName: string, releaseDate: string, updateURL: string) => {
                notify(
                    window,
                    "A new update is ready to install",
                    `Version ${releaseName} is downloaded and will be automatically installed on Quit`
                );
            }
        );
        autoUpdater.addListener("error", (error: any) => {
            // auto-updater fails a lot because builds are not being signed yet, just ignore
            //
            // if (error.message === "Can not find Squirrel") {
            //     return;
            // }
            // log.error(error.stack ? error.stack : error.toString());
        });
        autoUpdater.addListener("checking-for-update", (event: any) => {
            log.info("checking-for-update");
        });
        autoUpdater.addListener("update-not-available", () => {
            log.info("update-not-available");
        });
        ipcMain.on("brackets-app-ready", () => {
            autoUpdater.checkForUpdates();
        });
    }
开发者ID:Real-Currents,项目名称:brackets,代码行数:47,代码来源:auto-updater.ts

示例7: callback

    return GitHubClient.getReleases().then((result: Array<any>) => {

        let hasUpdate = null;

        if (result && result.length) {
            result.sort((a, b) => semver.gt(b.tag_name, a.tag_name));

            const latestRelease = result[0];

            const appVersion = app.getVersion();
            const latestTag  = latestRelease.tag_name;

            if (semver.gt(latestTag, appVersion)) {
                hasUpdate = latestRelease;
            }
        }

        callback(null, hasUpdate);

    }, callback);
开发者ID:hmenager,项目名称:composer,代码行数:20,代码来源:routes.ts

示例8: setupAutoUpdater

    function setupAutoUpdater():void {
        // Don't even attempt to write the auto update unless we are on a system that supports it. 
        // Which as of the time of this comment only is windows. 
        if (!canAutoupdate()) return;
        autoUpdater.addListener("update-available", function () {
            win.webContents.send("update-info", "UPDATE.AVAILABLE");
        });
        autoUpdater.addListener("update-downloaded", function () {
            win.webContents.send("update-info", "UPDATE.DOWNLOADED");
        });
        autoUpdater.addListener("error", function (error:any) {
            console.log(error);
            win.webContents.send("update-error", error);
        });
        autoUpdater.addListener("checking-for-update", function () {
            win.webContents.send("update-info", "UPDATE.CHECKING_FOR_UPDATE");
        });
        autoUpdater.addListener("update-not-available", function () {
            win.webContents.send("update-info", "UPDATE.NOT_AVAILABLE");
        });

        var feedUrl:string = "";
        if (platform() == "win32") {
            feedUrl = "http://zlepper.dk:3215/update/win";
            if (arch() == "x64") {
                console.log("64x windows detected.");
                feedUrl += "64"
            } else {
                feedUrl += "32"
            }
        }

        feedUrl += "/" + app.getVersion();

        // The feed url was not set for some reason, so we'll not attempt to get any update package.
        if (feedUrl == "") {
            return;
        }
        autoUpdater.setFeedURL(feedUrl);
        autoUpdater.checkForUpdates();
    }
开发者ID:fcpwiz,项目名称:go-modpack-packer,代码行数:41,代码来源:main.ts

示例9:

 click: () => {
   shell.openExternal(
     `https://github.com/nteract/nteract/releases/tag/v${app.getVersion()}`
   );
 }
开发者ID:nteract,项目名称:nteract,代码行数:5,代码来源:menu.ts

示例10: Notes

      }
    },
    {
      label: "Keyboard Shortcuts",
      click: () => {
        shell.openExternal("https://docs.nteract.io/#/desktop/shortcut-keys");
      }
    },
    {
      label: "View nteract on GitHub",
      click: () => {
        shell.openExternal("http://github.com/nteract/nteract");
      }
    },
    {
      label: `Release Notes (${app.getVersion()})`,
      click: () => {
        shell.openExternal(
          `https://github.com/nteract/nteract/releases/tag/v${app.getVersion()}`
        );
      }
    },
    {
      label: "Install Additional Kernels",
      click: () => {
        shell.openExternal("https://nteract.io/kernels");
      }
    }
  ] as any[]
};
开发者ID:nteract,项目名称:nteract,代码行数:30,代码来源:menu.ts


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