Skip to content

Conversation

@Tolfx
Copy link

@Tolfx Tolfx commented Aug 15, 2025

Description

Protocols is currently not working for Windows, since is missing the template in NSIS.

Linux desktop.tmpl is also broken, since it expects .Info.Protocols but Protocols is in top root.

  ERROR   template: desktop.tmpl:14:43: executing "desktop.tmpl" at <.Info.Protocols>: can't evaluate field Info in type commands.UpdateConfig
  ERROR   task: Failed to run task "common:update:build-assets": exit status 1 

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Created new test in build-assets.

  • Windows
  • macOS
  • Linux

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Windows installer now registers and unregisters custom URL protocols so apps can handle links (e.g., myapp://) with icons and proper launch commands.
  • Bug Fixes

    • Linux desktop generation corrected protocol handling so desktop entries list protocol MimeTypes from the proper field.
  • Tests

    • Added tests for generating and updating build assets across multiple configurations, validating generated files and error cases.
  • Documentation

    • Changelog updated with NSIS protocol entry and build-assets test notes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Walkthrough

Adds tests for build-assets generation and update, adjusts Linux desktop template to use top-level .Protocols, and introduces NSIS macros plus installer hooks to register/unregister custom URL protocols on Windows; updates the unreleased changelog.

Changes

Cohort / File(s) Change Summary
Build assets tests
v3/internal/commands/build-assets_test.go
Adds tests for GenerateBuildAssets and UpdateBuildAssets covering multiple option combinations, YAML config writing, success/error scenarios, creation of build/update directories, and basic file presence assertions.
Linux desktop template
v3/internal/commands/updatable_build_assets/linux/desktop.tmpl
Changes MimeType iteration to read protocols from top-level .Protocols instead of .Info.Protocols.
Windows NSIS protocol macros
v3/internal/commands/updatable_build_assets/windows/nsis/wails_tools.nsh.tmpl
Adds NSIS macros: CUSTOM_PROTOCOL_ASSOCIATE, CUSTOM_PROTOCOL_UNASSOCIATE, wails.associateCustomProtocols, wails.unassociateCustomProtocols to register/unregister URL protocol handlers (registry keys, default icon, open command).
Windows installer hooks
v3/internal/commands/build_assets/windows/nsis/project.nsi.tmpl
Invokes wails.associateCustomProtocols during install and wails.unassociateCustomProtocols during uninstall to apply protocol registration per .Protocols.
Changelog
v3/UNRELEASED_CHANGELOG.md
Adds entries for NSIS Protocol template and build-assets tests; documents linux desktop.tmpl protocol range fix.

Sequence Diagram(s)

sequenceDiagram
  participant NSIS as NSIS Installer Script
  participant REG as Windows Registry
  rect #F0F9FF
    NSIS->>REG: Delete HKCU\Software\Classes\{scheme} (cleanup)
    NSIS->>REG: Write HKCU\Software\Classes\{scheme}\(Default)=Description
    NSIS->>REG: Write HKCU\Software\Classes\{scheme}\URL Protocol=""
    NSIS->>REG: Write HKCU\Software\Classes\{scheme}\DefaultIcon=(exe,0)
    NSIS->>REG: Write HKCU\Software\Classes\{scheme}\shell\open\command="\"exe\" \"%1\""
  end
  Note over NSIS,REG: Repeat for each protocol in `.Protocols`
  NSIS->>REG: Delete HKCU\Software\Classes\{scheme} on uninstall
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

size:S

Poem

I nibble lines of YAML bright,
Protocols hop into the night.
Icons tucked and handlers sewn,
Installers teach the paths well-known.
A rabbit cheers — build-assets grown! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description includes a summary of the issue, the type of change, and testing notes but omits the required “Fixes #” reference under the Description section and does not include a Test Configuration section with environment or wails doctor output as mandated by the template. Please add the “Fixes #” line under the Description heading, include a Test Configuration section with relevant wails doctor output or environment details, and list any dependencies to fully comply with the repository’s PR description template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title succinctly identifies the two primary changes—fixing the Linux desktop template and adding the Windows NSIS template—directly matching the main modifications in the changeset without extraneous detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5df53c3 and f490768.

📒 Files selected for processing (1)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • v3/UNRELEASED_CHANGELOG.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 15, 2025
@dosubot dosubot bot added Bug Something isn't working Enhancement New feature or request Linux Windows labels Aug 15, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
v3/internal/commands/build-assets_test.go (4)

13-18: Prefer t.TempDir() over manual temp dir management

Use t.TempDir() for automatic cleanup and simpler code.

Apply this diff:

-	// Create a temporary directory for testing
-	tempDir, err := os.MkdirTemp("", "wails-build-assets-test-*")
-	if err != nil {
-		t.Fatalf("Failed to create temp directory: %v", err)
-	}
-	defer os.RemoveAll(tempDir)
+	// Create a temporary directory for testing
+	tempDir := t.TempDir()

119-131: Expected file names may be template-dependent; assert only invariant assets or introspect via fs

Hardcoding "config.yml" and "Taskfile.yml" can be brittle if templates change (e.g., YAML vs YML, or taskfile naming). Consider asserting a smaller invariant subset (e.g., appicon.png) and/or verifying presence using a contains-any approach.

If you want stronger verification, parse the generated config file (if present) to assert defaults (like ProductIdentifier) rather than asserting its exact filename.


133-139: Strengthen assertion: verify the derived ProductIdentifier from generated artifacts

You compute expectedIdentifier but don’t verify it. If the generator writes a config with ProductIdentifier, parse and assert it. Otherwise, factor out the defaulting logic so tests can assert without relying on file outputs.

I can propose a small refactor to expose/return the computed config for assertion—say, by returning the config from GenerateBuildAssets—or by adding a helper that applies defaults to BuildAssetsOptions for testing. Want me to draft that?


146-152: Use t.TempDir() here as well

Mirror the earlier suggestion in TestUpdateBuildAssets.

Apply this diff:

-	// Create a temporary directory for testing
-	tempDir, err := os.MkdirTemp("", "wails-update-assets-test-*")
-	if err != nil {
-		t.Fatalf("Failed to create temp directory: %v", err)
-	}
-	defer os.RemoveAll(tempDir)
+	// Create a temporary directory for testing
+	tempDir := t.TempDir()
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 15812b4 and 5d0a77a.

📒 Files selected for processing (3)
  • v3/internal/commands/build-assets_test.go (1 hunks)
  • v3/internal/commands/updatable_build_assets/linux/desktop.tmpl (1 hunks)
  • v3/internal/commands/updatable_build_assets/windows/nsis/wails_tools.nsh.tmpl (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
v3/internal/commands/build-assets_test.go (1)
v3/internal/commands/build-assets.go (6)
  • BuildAssetsOptions (33-52)
  • GenerateBuildAssets (78-158)
  • WailsConfig (178-190)
  • ProtocolConfig (25-30)
  • UpdateBuildAssetsOptions (62-75)
  • UpdateBuildAssets (193-264)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
v3/internal/commands/updatable_build_assets/linux/desktop.tmpl (1)

14-15: Correct fix: reference top-level .Protocols in desktop entry

Switching to .Protocols aligns with UpdateConfig/WailsConfig and resolves the reported template error during asset generation.

v3/internal/commands/build-assets_test.go (1)

207-245: Good coverage of config/no-config and error path

These cases validate both config-driven population and default-only updates, plus the error path for missing config files. Nice.

Comment on lines +220 to +233
!macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
!macroend

!macro CUSTOM_PROTOCOL_UNASSOCIATE PROTOCOL
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
!macroend

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use SHCTX for registry root (or define SHELL_CONTEXT) to ensure correct per-user/all-users context

NSIS supports the SHCTX root, which respects SetShellVarContext. Using unrecognized roots can break builds. This file’s earlier macros also use SHELL_CONTEXT; if that isn’t defined elsewhere, builds may fail. Two options:

  • Define SHELL_CONTEXT as SHCTX once near the top (preferred for consistency).
  • Or change these new macros to use SHCTX directly.

Minimal global alias (outside the selected range; add near the top after includes):

!ifndef SHELL_CONTEXT
  !define SHELL_CONTEXT SHCTX
!endif

Alternatively, change within this block:

-  DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
+  DeleteRegKey SHCTX "Software\Classes\${PROTOCOL}"
+  WriteRegStr SHCTX "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
+  WriteRegStr SHCTX "Software\Classes\${PROTOCOL}" "URL Protocol" ""
+  WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
+  WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\shell" "" ""
+  WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\shell\open" "" ""
+  WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
!macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
!macroend
!macro CUSTOM_PROTOCOL_UNASSOCIATE PROTOCOL
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
!macroend
!macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND
DeleteRegKey SHCTX "Software\Classes\${PROTOCOL}"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL}" "URL Protocol" ""
WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\shell" "" ""
WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\shell\open" "" ""
WriteRegStr SHCTX "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
!macroend
!macro CUSTOM_PROTOCOL_UNASSOCIATE PROTOCOL
DeleteRegKey SHCTX "Software\Classes\${PROTOCOL}"
!macroend
🤖 Prompt for AI Agents
v3/internal/commands/updatable_build_assets/windows/nsis/wails_tools.nsh.tmpl
around lines 220-233: the new CUSTOM_PROTOCOL_* macros use SHELL_CONTEXT which
may be undefined and NSIS expects SHCTX (or a defined alias) for correct
per-user/all-users registry root; fix by defining SHELL_CONTEXT as SHCTX near
the top of the file (after includes) using a conditional !ifndef/!define block,
or alternatively replace SHELL_CONTEXT in these macros with SHCTX directly so
the registry root respects SetShellVarContext.

Comment on lines +222 to +228
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
!macroend
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Quote macro parameters with backticks to safely handle spaces and special chars

The existing APP_ASSOCIATE macro uses backticks when writing ${DESCRIPTION}, ${ICON}, ${COMMAND}. Mirror that here to avoid issues with spaces/quotes in descriptions or paths.

Apply this diff:

-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
+  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" `${DESCRIPTION}`
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
+  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" `${ICON}`
-  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
+  WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" `${COMMAND}`

If you adopt SHCTX per the previous comment, replace SHELL_CONTEXT with SHCTX accordingly in the same diff.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
!macroend
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" `${DESCRIPTION}`
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" `${ICON}`
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" `${COMMAND}`
!macroend
🤖 Prompt for AI Agents
In v3/internal/commands/updatable_build_assets/windows/nsis/wails_tools.nsh.tmpl
around lines 222 to 228, the registry WriteRegStr calls use unquoted macro
parameters which can break on spaces/special characters; update each WriteRegStr
to quote the macro parameters with backticks (e.g. replace ${DESCRIPTION},
${ICON}, ${COMMAND} with `${DESCRIPTION}`, `${ICON}`, `${COMMAND}`) and, if you
adopted the SHCTX name from the previous comment, also replace SHELL_CONTEXT
with SHCTX consistently in these lines.

@leaanthony
Copy link
Member

Thanks 🙏 Please could you add an entry to the changelog located at v3/UNRELEASED_CHANGELOG.md? Thanks!

@github-actions github-actions bot added the Documentation Improvements or additions to documentation label Aug 17, 2025
@Tolfx
Copy link
Author

Tolfx commented Aug 17, 2025

Thanks 🙏 Please could you add an entry to the changelog located at v3/UNRELEASED_CHANGELOG.md? Thanks!

Absolutely, updated and pushed. Please let me know if is used correctly or not.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
v3/UNRELEASED_CHANGELOG.md (2)

19-20: Align with changelog guidelines: use present tense and clarify scope

Per the file’s own guidelines (Line 11), use present tense. Also, minor clarity/capitalization tweaks and optional PR reference.

Apply this diff:

- - Added NSIS Protocol template for Windows
- - Added tests for build-assets
+ - Add NSIS protocol template for Windows to restore custom protocol support (#4510)
+ - Add tests for build-assets

26-26: Fix capitalization and accurately describe the template change

Capitalize Linux, use present tense, and correct the field names from singular to plural. “Protocol range” is unclear—be explicit about changing the iteration target.

Apply this diff:

- - Fixed linux desktop.tmpl protocol range, by removing `<.Info.Protocol>` to `<.Protocol>`
+ - Fix Linux desktop.tmpl protocols iteration: change `<.Info.Protocols>` to `<.Protocols>` (#4510)
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5d0a77a and b2f289b.

📒 Files selected for processing (1)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
v3/UNRELEASED_CHANGELOG.md

[grammar] ~25-~25: There might be a mistake here.
Context: ... in existing functionality --> ## Fixed - Fixed linux desktop.tmpl protocol range, by r...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: semgrep-cloud-platform/scan

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
v3/internal/commands/build_assets/windows/nsis/project.nsi.tmpl (1)

100-112: Optional: unassociate protocols and file types before deleting files/shortcuts

Slightly safer uninstall order is to unassociate first, then remove shortcuts and files. If unassociation fails (permissions), you avoid removing the binaries before the operation that references them. Functional impact is minor, hence optional.

Apply this diff within the uninstall section:

 Section "uninstall" 
     !insertmacro wails.setShellContext
 
     RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
 
-    RMDir /r $INSTDIR
-
-    Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
-    Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
-
-    !insertmacro wails.unassociateFiles
-    !insertmacro wails.unassociateCustomProtocols
+    !insertmacro wails.unassociateCustomProtocols
+    !insertmacro wails.unassociateFiles
+
+    Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
+    Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
+
+    RMDir /r $INSTDIR
 
     !insertmacro wails.deleteUninstaller
 SectionEnd
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b2f289b and 6eba4b1.

📒 Files selected for processing (1)
  • v3/internal/commands/build_assets/windows/nsis/project.nsi.tmpl (2 hunks)
🔇 Additional comments (1)
v3/internal/commands/build_assets/windows/nsis/project.nsi.tmpl (1)

95-96: Protocol association macros verified — safe no-ops on empty .Protocols and correct %1 quoting

  • The wails.associateCustomProtocols and wails.unassociateCustomProtocols macros are defined in
    v3/internal/commands/updatable_build_assets/windows/nsis/wails_tools.nsh.tmpl.
  • They iterate over the top-level .Protocols field, so when no protocols are specified the macros produce no registration calls.
  • The protocol launch command is correctly wrapped as
    "$INSTDIR\${PRODUCT_EXECUTABLE} $\"%1$\""
    which ensures the %1 argument is properly quoted.

No further changes required.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 18, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 2, 2025

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
v3/UNRELEASED_CHANGELOG.md (2)

19-20: Use present tense and reference PR; clarify Windows NSIS entry.

Align with the guideline “Use present tense (‘Add’ not ‘Added’)” and add the PR reference. Also clarify what the NSIS template does.

- - Added NSIS Protocol template for Windows
- - Added tests for build-assets
+ - Add Windows NSIS template for protocol registration/unregistration (#4510)
+ - Add tests for build-assets (GenerateBuildAssets, UpdateBuildAssets) (#4510)

26-26: Fix capitalization/grammar and correct template identifiers.

Use “Linux,” present tense, and the correct template fields (.Protocols vs .Info.Protocols). “Removing X to Y” should be “use X instead of Y.”

- - Fixed linux desktop.tmpl protocol range, by removing `<.Info.Protocol>` to `<.Protocol>`
+ - Fix Linux desktop.tmpl to use top-level `.Protocols` instead of `.Info.Protocols` (#4510)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6eba4b1 and 5df53c3.

📒 Files selected for processing (1)
  • v3/UNRELEASED_CHANGELOG.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
v3/UNRELEASED_CHANGELOG.md

[grammar] ~25-~25: There might be a mistake here.
Context: ... in existing functionality --> ## Fixed - Fixed linux desktop.tmpl protocol range, by r...

(QB_NEW_EN)


[grammar] ~26-~26: There might be a mistake here.
Context: ...ange, by removing <.Info.Protocol> to <.Protocol> - Fixed redefinition error for liquid glas...

(QB_NEW_EN)

@leaanthony leaanthony enabled auto-merge (squash) October 5, 2025 10:49
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 5, 2025

@leaanthony leaanthony merged commit f1037c8 into wailsapp:v3-alpha Oct 5, 2025
50 checks passed
@leaanthony
Copy link
Member

Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working cli Documentation Improvements or additions to documentation Enhancement New feature or request lgtm This PR has been approved by a maintainer Linux size:L This PR changes 100-499 lines, ignoring generated files. v3-alpha Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants