npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qzhddr-installer

v3.4.8

Published

Qzhddr software installer utility

Downloads

306

Readme

Qzhddr 安装器

npm version

一个用于在 Electron 应用程序中安装和管理 Qzhddr 软件的实用工具包。

功能特点

  • 软件安装管理
  • 安装状态检查
  • 员工信息配置
  • 进度跟踪和事件处理
  • 敏感数据加密
  • 平台支持(仅支持 Windows)

安装

npm install qzhddr-installer

使用方法

NodeJS 调用示例

const { SoftwareInstaller, ConfigManager } = require('qzhddr-installer');

const testAsync = async () => {
  try {
    const installer = new SoftwareInstaller();

    // 检查是否已安装
    const isInstalled = await installer.checkInstallation();
    console.log('isInstalled', isInstalled);
    if (isInstalled) {
      return { status: 'already-installed' };
    }

    // 执行安装
    const res = await SoftwareInstaller.install('安装包地址', {
      requireAdmin: true,
    });

    // 安装完成后设置员工信息
    const configManager = new ConfigManager();
    const result = await configManager.writeStaffInfo({
      category: 'xxx', // 同步方式
      field: 'mobile', // 绑定字段: 手机号或工号
      staffCode: '+18026xxxxxxx', //工号
    });

    console.log('staffInfo', result);

    return { status: 'success' };
  } catch (error) {
    return { status: 'error', message: error.message };
  }
};

testAsync();

Electron 调用示例

const { app, BrowserWindow, ipcMain } = require('electron');
const { SoftwareInstaller, ConfigManager } = require('qzh-installer');

let mainWindow;

async function createWindow() {
  mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
    },
  });

  mainWindow.loadFile('index.html');

  // 处理安装请求
  ipcMain.handle('install-software', async (event, downloadUrl) => {
    try {
      const installer = new SoftwareInstaller();

      // 检查是否已安装
      const isInstalled = await installer.checkInstallation();
      if (isInstalled) {
        // 安装完成后设置员工信息
        const configManager = new ConfigManager();
        const setReuslt = await configManager.writeStaffInfo({
          category: 'xxx', // 同步方式
          field: 'mobile', // 绑定字段: 手机号或工号
          staffCode: '+18026xxxxxxx', //工号
        });
        return { status: 'success' };
      }

      // 执行安装
      const installResult = await SoftwareInstaller.install(downloadUrl, {
        requireAdmin: true,
      });

      if (!installResult) {
        return { status: 'Installed failed!' };
      }

      // 安装完成后设置员工信息
      const configManager = new ConfigManager();
      const setReuslt = await configManager.writeStaffInfo({
        category: 'xxx', // 同步方式
        field: 'mobile', // 绑定字段: 手机号或工号
        staffCode: '+18026xxxxxxx', //工号
      });

      if (!setReuslt) {
        return { status: 'WriteInfo failed!' };
      }

      return { status: 'success' };
    } catch (error) {
      return { status: 'error', message: error.message };
    }
  });
}

app.whenReady().then(createWindow);