Flyctl can't update on windows

Using an admin powershell:

Remove-Item : Cannot remove item C:\Users\Austin Pena\.fly\bin\flyctl.exe: Access to the path 'C:\Users\Austin
Pena\.fly\bin\flyctl.exe' is denied.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:1029
char:29
+ ...             Remove-Item -LiteralPath $currentArchiveEntryFileInfo.Ful ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Users\Austin Pena\.fly\bin\flyctl.exe:FileInfo) [Remove-Item], Unautho
   rizedAccessException
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand

I added a bug for this here: flyctl version update fails on Windows · Issue #395 · superfly/flyctl · GitHub

As a workaround, you can just delete C:\Users\Austin Pena\.fly\bin\flyctl.exe and install flyctl from scratch.

That’s what I did, glad to know you’ve already got the bug report filed. Thanks for the awesome service!

@austincollinpena how did you install and update flyctl?

@austincollinpena I just fixed an issue, could you try again?

I installed it many months ago so I can’t remember exactly but it must have been through powershell though. I think I’ve been with Fly for 6 months now?

There aren’t any updates available, I followed the advice from above. If you @ me here when you release an update I can test again.

@austincollinpena just released a new version

New issue from running flyctl version update in an administrator Powershell.

PS C:\Users\Austin Pena> flyctl version update                                                                          Update available 0.0.204 -> 0.0.205
Update with flyctl.exe version update

powershell.exe -Command
Running automatic update [iwr https://fly.io/install.ps1 | iex]
iex : Cannot convert 'System.Byte[]' to the type 'System.Uri' required by parameter 'Uri'. Specified method is not
supported.
At line:1 char:34
+ iwr https://fly.io/install.ps1 | iex
+                                  ~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-Expression], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.InvokeExpressionCommand

exit status 1
PS C:\Users\Austin Pena>

@austincollinpena could you try again now?

@michael Want to just remote access my machine? :wink: (Made double sure it was from an administrator Powershell)

PS C:\Users\Austin Pena> flyctl version update
Update available 0.0.204 -> 0.0.205
Update with flyctl.exe version update

powershell.exe -Command
Running automatic update [iwr https://fly.io/install.ps1 | iex]
Remove-Item : Cannot remove item C:\Users\Austin Pena\.fly\bin\wintun.dll: Access to the path
'C:\Users\Austin Pena\.fly\bin\wintun.dll' is denied.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShe
ll.Archive.psm1:1029 char:29
+ ...             Remove-Item -LiteralPath $currentArchiveEntryFileInfo.Ful ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Users\Austin Pena\.fly\bin\wintun.dll:FileInfo)
   [Remove-Item], UnauthorizedAccessException
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.R
   emoveItemCommand
exit status 1
PS C:\Users\Austin Pena>

I was finally able to reproduce this after testing on a bunch of physical and virtual windows machines :smiley: The error is misleading, it’s caused by wintun.dll still being used by the process that spawned the update script (flyctl) so it can’t be removed. We’ll fix that later, until then update using the normal install script: iwr https://fly.io/install.ps1 -useb | iex

If that fails, it’s an actual permission issue, so delete C:\Users\Austin Pena\.fly\bin and try again.

Thanks for working through this with me. Check your account, I added some credits.

I have the same issue, also can’t update due to wintun access error while using PS in admin mode:

Remove-Item : Cannot remove item C:\Users\***\.fly\bin\wintun.dll: Access to the path 'C:\Users\\***\.\.fly\bin\wintun.dll' is denied.
At C:\program files\powershell\7\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:1071 char:29
+ ...             Remove-Item -LiteralPath $currentArchiveEntryFileInfo.Ful ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Users\\***\.\bin\wintun.dll:FileInfo) [Remove-Item], Unauthoriz
   edAccessException
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand

Using iwr https://fly.io/install.ps1 -useb | iex I was able to update to version 0.0.216 just now

What was the full command you ran that failed to update?

Hi Micheal, it was flyctl version update

This is fixed as of v0.0.219