Skip to content

Latest commit

 

History

History
154 lines (115 loc) · 3.2 KB

File metadata and controls

154 lines (115 loc) · 3.2 KB

Setuply
GitHub Stars License: MIT Built with Tauri Node.js version

中文 | English

快速创建美观高效的windows应用安装程序,基于Tauri2


🧩 使用前准备

安装NodeJs

访问NodeJs官方网站,安装版本需大于22.12.0。

安装Rust

访问Rust官方网站,按照提示进行安装。

配置国内镜像

参照Rust配置国内源


🔨 使用方法

Npx

npx create-setuply

Git Fork

  1. Fork create-setuply 仓库

  2. 增加上游远程地址

git remote add upstream https://github.com/phaoer/create-setuply
  1. 创建自己的分支
git checkout -b your-branch
  1. 执行脚手架
npm run create-setuply
  1. 开始开发 🚀

🧱 模板

支持React和Vue开发界面

组件

<Header />

实现可拖拽导航栏

Hooks

function useInstallProgress ():{progress:number; reset: () => void} 

返回实时安装进度和重置安装进度函数

function useInstallError ():{error:string; reset: () => void} 

返回安装错误信息和重置安装错误函数

Api

export function appQuit(): Promise<any>

程序退出

export function openUrl(url: string): Promise<any>

执行本机shell

export function changePath(): Promise<string | null>

更改安装路径

type InstallationParams = {
	packageDownloadUrl: string;     // 安装包链接,目前仅支持线上包安装
	packageFilename: string;        // 下载的安装包保存名称
	installPath: string;            // 安装路径
	setting?: {
		reg?: {     				// 注册表相关设置
			displayName: string;
			displayVersion: string;
			publisher: string;
			installLocation: string;
			uninstallString: string;
		};
		shortCut?: {        		// 桌面快捷方式相关设置
			targetPath: string;
			shortcutName: string;
			workingDir: string;
			description: string;
		};
	};
}
export function installation(params: InstallationParams): Promise<string>

开始安装

type LaunchParams = {
	exePath: string;        //可执行文件的地址
}
export function launch(params: LaunchParams): Promise<string>

启动安装后的应用程序


📜 License

MIT