Skip to content

feat: add desktop build icon embedding and release download entry#1720

Closed
alanbulan wants to merge 5 commits intorouter-for-me:mainfrom
alanbulan:feat/desktop-icon-packaging-and-release
Closed

feat: add desktop build icon embedding and release download entry#1720
alanbulan wants to merge 5 commits intorouter-for-me:mainfrom
alanbulan:feat/desktop-icon-packaging-and-release

Conversation

@alanbulan
Copy link

Summary

  • add desktop build/upgrade scripts that sync root CLIProxyAPI.png into cmd/desktop/build/appicon.png before wails build, and regenerate windows/icon.ico to keep exe/taskbar/window icon source consistent
  • extend release workflow to build and upload a Windows desktop executable asset (CLIProxyAPI-desktop-windows-amd64-<tag>.exe) on tag releases
  • add desktop download entries in README/README_CN and Management Center System quick links for user discoverability
  • include desktop runtime scaffolding under cmd/desktop required for desktop packaging flow

Test plan

  • run npm --prefix management-center run type-check
  • verify modified scripts are syntactically valid and committed
  • create a test tag in fork and verify release contains desktop asset
  • run local build-desktop.ps1 in a clean Windows environment and confirm icon consistency (desktop shortcut + app window icon)
  • smoke test desktop auto-upgrade flow end-to-end

Use CLIProxyAPI.png as the desktop icon source during desktop build/upgrade, publish a Windows desktop executable in release workflow, and expose desktop download links in docs and system quick links.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @alanbulan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the CLIProxyAPI project by introducing a fully functional desktop version for Windows. It streamlines the development and distribution process by automating builds, ensuring proper branding with embedded icons, and integrating the desktop executable into the existing release pipeline. Furthermore, it improves user experience by making the desktop application easily discoverable through updated documentation and management interfaces, providing a more accessible way to interact with the API.

Highlights

  • Desktop Build System: Introduced new PowerShell scripts (build-desktop.ps1, upgrade-desktop.ps1) to automate the build and upgrade process for the Windows desktop application, ensuring consistent icon embedding and versioning.
  • Release Workflow Integration: Extended the release workflow to automatically build and upload a Windows desktop executable (CLIProxyAPI-desktop-windows-amd64-<tag>.exe) as an asset for tag releases.
  • User Discoverability: Added download entries and instructions for the desktop version in both English (README.md) and Chinese (README_CN.md) documentation, as well as quick links in the Management Center System.
  • Wails Application Scaffolding: Included the necessary Go and frontend (Vite/JavaScript) scaffolding under cmd/desktop to support the desktop packaging flow using the Wails framework, complete with application logic and update mechanisms.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • README.md
    • Added a new section for the Desktop Version (Windows) with download instructions and links to GitHub Releases.
  • README_CN.md
    • Added a new section for the Desktop Version (Windows) in Chinese, including download instructions and links to GitHub Releases.
  • build-desktop.ps1
    • Added a PowerShell script to automate the desktop application build process, including icon synchronization, version information embedding, and Wails build commands.
  • cmd/desktop/app.go
    • Added the main Go application logic for the Wails desktop app, handling configuration loading, service startup/shutdown, and integration with internal CLIProxyAPI components.
    • Implemented getConfigDir to define the desktop-specific configuration directory.
    • Implemented ensureConfigFile to create a default configuration file if one does not exist.
    • Integrated update checking functionality (checkForUpdates) into the application startup.
  • cmd/desktop/build/windows/info.json
    • Added a JSON file defining Windows executable metadata, such as product version, company name, and product name.
  • cmd/desktop/build/windows/wails.exe.manifest
    • Added a Windows manifest file to configure DPI awareness settings for the executable.
  • cmd/desktop/frontend/index.html
    • Added the basic HTML entry point for the Wails frontend, displaying a loading message and redirecting to the management panel.
  • cmd/desktop/frontend/package-lock.json
    • Added the Node.js package-lock.json file, locking dependencies for the frontend project.
  • cmd/desktop/frontend/package.json
    • Added the package.json file, defining frontend project metadata and development scripts (dev, build, preview) using Vite.
  • cmd/desktop/frontend/package.json.md5
    • Added an MD5 checksum file for package.json.
  • cmd/desktop/frontend/src/main.js
    • Added JavaScript code for the frontend entry point, which displays a loading message and redirects the browser to the local management panel URL.
  • cmd/desktop/frontend/wailsjs/runtime/package.json
    • Added Wails runtime package metadata for the frontend.
  • cmd/desktop/frontend/wailsjs/runtime/runtime.d.ts
    • Added TypeScript declaration file for the Wails runtime API, providing type definitions for various runtime functions.
  • cmd/desktop/frontend/wailsjs/runtime/runtime.js
    • Added JavaScript implementation of the Wails runtime API, exposing functions for logging, events, window management, and more.
  • cmd/desktop/main.go
    • Added the main Go entry point for the Wails desktop application, initializing build information and configuring Wails app options like title, size, asset server, and lifecycle hooks.
  • cmd/desktop/updater.go
    • Added Go code for the desktop application's update mechanism, including functions to find the project root, execute Git commands, check for new backend versions, and perform a self-upgrade and restart using detached processes.
  • cmd/desktop/wails.json
    • Added the Wails configuration file, specifying project name, output filename, frontend build commands, and author information.
  • go.mod
    • Updated Go module dependencies to include github.com/wailsapp/wails/v2 and several new indirect dependencies required by Wails.
  • go.sum
    • Updated Go module checksums to reflect the new and updated dependencies.
  • upgrade-desktop.ps1
    • Added a PowerShell script for performing in-place upgrades of the desktop application, including fetching the latest backend code, rebuilding the executable, and restarting the application.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/release.yaml
Activity
  • The pull request introduces a new desktop build target for Windows, significantly expanding the application's reach.
  • New build and upgrade scripts have been added to automate the maintenance of the desktop version.
  • The core application logic for the desktop environment has been implemented using the Wails framework.
  • Documentation has been updated to guide users to the new desktop releases.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@alanbulan
Copy link
Author

alanbulan commented Feb 26, 2026 via email

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a desktop version of the application using Wails, which is a significant new feature. The changes include build scripts, the desktop application's Go source code, and an auto-update mechanism. The implementation is comprehensive, but I have identified a few areas for improvement, particularly concerning the design of the auto-updater, a hardcoded port in the frontend, and hardcoded UI strings. My review includes a critical comment on the update mechanism's design, which is not suitable for end-users.

Comment on lines +66 to +71
func (a *App) checkForUpdates() {
root := findProjectRoot()
if root == "" {
log.Debug("updater: project root not found, skip update check")
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The current auto-update mechanism, which uses findProjectRoot to locate a .git directory and then runs git pull to rebuild the application from source, is designed for a development environment. This approach is not suitable for a distributable desktop application released to end-users, as they are not expected to have git, go, and the full toolchain installed.

A more standard and user-friendly approach for desktop application updates would be to:

  1. Check for a new version tag on GitHub Releases.
  2. If a new version is available, download the pre-compiled .exe asset for Windows.
  3. Replace the current executable with the new one.

This would provide a seamless update experience for all users, not just developers who have cloned the repository.

Comment on lines 5 to 6
const port = 8317;
window.location.href = `http://127.0.0.1:${port}/management.html`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The port 8317 is hardcoded in the frontend JavaScript. The backend allows users to configure a different port in config.yaml. If a user changes the port, the frontend will fail to redirect to the management panel because it will still be trying to connect to 127.0.0.1:8317.

The port should be dynamically provided by the Go backend to the frontend. You can achieve this by binding a Go method to the frontend.

For example:

  1. In cmd/desktop/app.go, add the configured port to your App struct and expose it via a new method:
    type App struct {
        // ...
        serverPort int
    }
    
    func (a *App) GetServerPort() int {
        return a.serverPort
    }
    
    func (a *App) startup(ctx context.Context) {
        // ...
        a.serverPort = cfg.Port
        // ...
    }
  2. In cmd/desktop/frontend/src/main.js, call this new method to get the port:
    import { GetServerPort } from '../wailsjs/go/main/App';
    
    GetServerPort().then(port => {
      window.location.href = `http://127.0.0.1:${port}/management.html`;
    });

This will make your desktop app respect the user's configuration.

Comment on lines 110 to 121
result, err := wailsRuntime.MessageDialog(a.ctx, wailsRuntime.MessageDialogOptions{
Type: wailsRuntime.QuestionDialog,
Title: "CLIProxyAPI 更新",
Message: msg,
Buttons: []string{"立即升级", "跳过"},
DefaultButton: "立即升级",
CancelButton: "跳过",
})
if err != nil || (result != "Yes" && result != "立即升级") {
log.Infof("updater: user skipped update (result=%q)", result)
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The update confirmation dialog uses hardcoded Chinese strings for the title and buttons ("CLIProxyAPI 更新", "立即升级", "跳过"). This is not ideal for non-Chinese speaking users. For better internationalization, consider using English strings as a default or implementing a localization mechanism.

Suggested change
result, err := wailsRuntime.MessageDialog(a.ctx, wailsRuntime.MessageDialogOptions{
Type: wailsRuntime.QuestionDialog,
Title: "CLIProxyAPI 更新",
Message: msg,
Buttons: []string{"立即升级", "跳过"},
DefaultButton: "立即升级",
CancelButton: "跳过",
})
if err != nil || (result != "Yes" && result != "立即升级") {
log.Infof("updater: user skipped update (result=%q)", result)
return
}
result, err := wailsRuntime.MessageDialog(a.ctx, wailsRuntime.MessageDialogOptions{
Type: wailsRuntime.QuestionDialog,
Title: "CLIProxyAPI Update",
Message: msg,
Buttons: []string{"Upgrade Now", "Skip"},
DefaultButton: "Upgrade Now",
CancelButton: "Skip",
})
if err != nil || result != "Upgrade Now" {
log.Infof("updater: user skipped update (result=%q)", result)
return
}

xilan666 added 4 commits February 26, 2026 16:18
Use neutral English update dialog strings and harden the update flow guards while keeping the current developer-oriented update path. Keep desktop launcher redirect behavior explicit and avoid introducing broken dynamic bindings in this patch.
Add toolchain presence checks before desktop source updates and make the update dialog explicit that upgrade requires git/go/wails on the local machine.
Rewrite upgrade-desktop.ps1 with UTF-8 BOM so Windows PowerShell parses Chinese strings and regex literals correctly during in-app upgrade execution.
Support quoted/unquoted proxy-url values with optional inline comments and keep localized log messages while preserving PowerShell parser compatibility.
@luispater luispater closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants