Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Crash on failed write when updating. #981

Open
Labels
topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project
Milestone
@Reginald-Gillespie

Description

@Reginald-Gillespie

Describe the problem

On windows when the code checks for updates, it always attempts to clone itself to the file "arduino-cloud-agent.exe-temp". However, if the ACA is inside a location such asC:\Program Files, it requires administrator perms to write new files or modify existing ones. This causes it to crash when it is not run as administrator under these conditions.

To reproduce

Compile the exe, create a folder insideC:\Program Files, move the exe to that folder, attempt to run it without adminstrator permissions (I suggest doing this from powershell so that you can see the printed output saying access was denied to write to the .exe-temp file). Run it as admin, it creates the file and then runs perfectly.

I found the issue originates in the update code, and I commented out these lines ofmain.go:

... } else if restartPath := updater.Start(src); restartPath != "" { Systray.RestartWith(restartPath)...

After compiling it like this, it starts as a non-admin perfectly (not to say it shouldn't update, just to show that is where the issue lies).

Expected behavior

There are a few things that should be changed, imo. First, this issue still happens if you comment out theupdateUrl in the config file. In general just as a matter of optimization, it should skip the update code entirely if this is not defined.

The second thing I would do is before attempting an update, request administrator privileges. Some sort of modal popup that says it would like to update is ideal so users know why it needs admin perms, but not necessary. If these perms are denied, catch this and skip the update.

Arduino Create Agent version

Compiled from source 10 minutes ago

Operating system

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp