micahmo / WgServerforWindows

Wg Server for Windows (WS4W) is a desktop application that allows running and managing a WireGuard server endpoint on Windows
MIT License
895 stars 87 forks source link

to run this application you must install .net core #116

Open heatsiphon opened 1 year ago

heatsiphon commented 1 year ago

Windows 11 latest patches. installed both .net 6 runtime and .net 7 runtime. When I try to run the application I get "to run this application you must install .net core". Every other program works fine on my computer. What is going on? yes, my account has full admin priviliges

micahmo commented 1 year ago

Hi @heatsiphon, sorry to hear about this issue! Let me clarify a couple things first.

  1. This application currently targets .NET Core 3.1, which is why installing 6 and 7 didn't help.
  2. However, the installer is supposed to automatically install the necessary dependencies (i.e., the 3.1 runtime).

Did you try to install the latest version (2.0.10)? If so, did you receive the following prompt and press install here? And if so, did that seem to succeed?

image

I just tested the installer on a clean Win 11 with all updates (as of today). The installer worked and the app ran fine.

heatsiphon commented 1 year ago

Hi Micah,

Thanks for your reply.

I just tried installing .net 3.1.32 runtime x64 on my Windows 11 (fully updated) and it still gives me the same error message.

When I click the download it now button, nothing happens at all. I am not having an issue with any other program on my windows 11 pc. (I am an IT guy and very versed in W11).

I still can’t get the program to run, because I can’t get past this message.

I am running my W11 pro in full administrator mode.

Here are my installed runtimes.

From: Micah Morrison @.> Sent: Thursday, May 18, 2023 11:03 AM To: micahmo/WgServerforWindows @.> Cc: OG Coder @.>; Mention @.> Subject: Re: [micahmo/WgServerforWindows] to run this application you must install .net core (Issue #116)

Hi @heatsiphon https://github.com/heatsiphon , sorry to hear about this issue! Let me clarify a couple things first.

  1. This application currently targets .NET Core 3.1, which is why installing 6 and 7 didn't help.
  2. However, the installer is supposed to automatically install the necessary dependencies (i.e., the 3.1 runtime).

Did you try to install the latest version (2.0.10)? If so, did you receive the following prompt and press install here? And if so, did that seem to succeed?

https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fuser-images.githubusercontent.com%2f7417301%2f239268892-5d49062f-3a21-4cc1-9718-a454134f0457.png&c=E,1,Yt6xWw8Vnv2qVf-bv6MYTIb7Wd1Ed0SWtzOutV-WIrrDxFMKhswYi9BC2ipbVLxkpbfQWAgUbC9wWHV_6q4-Ym9p7vJ54XcLL5jz5dOruPCL5A,,&typo=1

I just tested the installer on a clean Win 11 with all updates (as of today). The installer worked and the app ran fine.

— Reply to this email directly, view it on GitHub https://github.com/micahmo/WgServerforWindows/issues/116#issuecomment-1553198105 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHR3LKTZ3SK4GB25G4QJL63XGY2ZLANCNFSM6AAAAAAYFHZLHM . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AHR3LKTAG2KAQRR7NFX2R7DXGY2ZLA5CNFSM6AAAAAAYFHZLHOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS4SPWBS.gif Message ID: @. @.> >

micahmo commented 1 year ago

@heatsiphon, you didn't answer my question about whether the WS4W installer prompted you to install .NET Core, and if so, whether it worked? If you're intentionally trying to install it manually, that's 100% fine, I'm just curious because this is supposed to all be automatic.

When I click the download it now button, nothing happens at all.

What are you downloading?

Here are my installed runtimes.

If there was supposed to be a screenshot here, I don't think it came through. 😞

heatsiphon commented 1 year ago

When the dialog box comes up and tells me I don’t have the correct version of .net installed it gives me 2 choices. Install the missing .net core, yes or no.

If I click no, I get dropped back out to the desktop.

If I click Yes (install it), nothing happens at all.

The screenshots were of these boxes and a list of the .NET runtimes on my system.

From: Micah Morrison @.> Sent: Thursday, May 18, 2023 12:28 PM To: micahmo/WgServerforWindows @.> Cc: OG Coder @.>; Mention @.> Subject: Re: [micahmo/WgServerforWindows] to run this application you must install .net core (Issue #116)

@heatsiphon https://github.com/heatsiphon , you didn't answer my question about whether the WS4W installer prompted you to install .NET Core, and if so, whether it worked? If you're intentionally trying to install it manually, that's 100% fine, I'm just curious because this is supposed to all be automatic.

When I click the download it now button, nothing happens at all.

What are you downloading?

Here are my installed runtimes.

If there was supposed to be a screenshot here, I don't think it came through. 😞

— Reply to this email directly, view it on GitHub https://github.com/micahmo/WgServerforWindows/issues/116#issuecomment-1553311478 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHR3LKSKMT5QL2I5TWDDS4LXGZEZLANCNFSM6AAAAAAYFHZLHM . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AHR3LKWHURTC37FAVJTRAEDXGZEZLA5CNFSM6AAAAAAYFHZLHOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS4SWTPM.gif Message ID: @. @.> >

micahmo commented 1 year ago

@heatsiphon You still have not answered my original question. 😊 Maybe I'm asking the wrong question, and you're welcome to tell me that, but otherwise it's a key piece of information that I'm missing. The WS4W installer should prompt you to install .NET Core 3.1. Did it do so? Did it work?

If you don't want to use the installer or you don't want to install .NET Core this way, that's totally fine. I just need to know that to help you troubleshoot.

heatsiphon commented 1 year ago

Hello –

I have tried to answer your question several times---

The dialog box comes up and says “to run this application, you must install .net core.” Would you like to download it now.

If I click YES, nothing happens.

if I click NO, the dialog box closes and the program quits.

I have installed .net core 6 x64, .net core 7 x64, .net core 3.1.32 x64 and x86

Doesn’t make a difference, I still can’t launch the program.

Read this link:

https://stackoverflow.com/questions/59367037/published-net-core-app-warns-to-install-net-core-but-its-already-installed

look at your Program’s PUBLISH settings.

Make sure target runtime is x64

Also make sure MY_PROGRAM_NAME.runtimeconfig.json is included in the installer package

From: Micah Morrison @.> Sent: Thursday, May 18, 2023 3:20 PM To: micahmo/WgServerforWindows @.> Cc: OG Coder @.>; Mention @.> Subject: Re: [micahmo/WgServerforWindows] to run this application you must install .net core (Issue #116)

@heatsiphon https://github.com/heatsiphon You still have not answered my original question. 😊 Maybe I'm asking the wrong question, and you're welcome to tell me that, but otherwise it's a key piece of information that I'm missing. The WS4W installer should prompt you to install .NET Core 3.1. Did it do so? Did it work?

If you don't want to use the installer or you don't want to install .NET Core this way, that's totally fine. I just need to know that to help you troubleshoot.

— Reply to this email directly, view it on GitHub https://github.com/micahmo/WgServerforWindows/issues/116#issuecomment-1553527168 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHR3LKUVJAVC47S2UYXZ6B3XGZY5LANCNFSM6AAAAAAYFHZLHM . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AHR3LKUQHKJZIT4Y44ZNUV3XGZY5LA5CNFSM6AAAAAAYFHZLHOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS4TDYYA.gif Message ID: @. @.> >

micahmo commented 1 year ago

When the dialog box appears, what are you launching? The installer (named something like WS4WSetup-2.0.10.exe) or the application itself (WgServerforWindows.exe)?

heatsiphon commented 1 year ago

Wg Server for Windows which is

"C:\Program Files (x86)\WS4W\WgServerforWindows.exe"

I think that is the problem – what I sent you.

This looks like it was compiled for x86 because it installs into the x86 directory, not targeted / compiled for x64

From: Micah Morrison @.> Sent: Thursday, May 18, 2023 3:29 PM To: micahmo/WgServerforWindows @.> Cc: OG Coder @.>; Mention @.> Subject: Re: [micahmo/WgServerforWindows] to run this application you must install .net core (Issue #116)

When the dialog box appears, what are you launching? The installer (named something like WS4WSetup-2.0.10.exe) or the application itself (WgServerforWindows.exe)?

— Reply to this email directly, view it on GitHub https://github.com/micahmo/WgServerforWindows/issues/116#issuecomment-1553538809 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHR3LKRYCR3AQNKCNTUR73TXGZ2AXANCNFSM6AAAAAAYFHZLHM . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AHR3LKWTLDYM73FSL2MQSATXGZ2AXA5CNFSM6AAAAAAYFHZLHOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS4TEPPS.gif Message ID: @. @.> >

micahmo commented 1 year ago

Thanks, I see you're launching the app itself, which is what I suspected. It is built to use the AnyCPU target, which can work on 32- or 64-bit operating systems. It prefers 64-bit. The placement in Program Files (x86) is for legacy reasons and is very common. (Many apps you launch from that directory are 64-bit.)

image

You also confirmed that still haven't answered my original question about the installer (WS4WSetup-2.0.10.exe). When you launch that executable to install the application, it is supposed to prompt you to install .NET Core 3.1. Have you run the installer? Does it give you that prompt? Does it appear to work?

heatsiphon commented 1 year ago

This is the installer that I am running

WS4WSetup-2.0.10.exe

I ran the installer and it completed.

When I run the application, that’s where it asks me the .net core question. Not the installer.

At no time when I click “YES” to install .net core does anything happen or open up on my computer. it just quits.

From: Micah Morrison @.> Sent: Thursday, May 18, 2023 3:36 PM To: micahmo/WgServerforWindows @.> Cc: OG Coder @.>; Mention @.> Subject: Re: [micahmo/WgServerforWindows] to run this application you must install .net core (Issue #116)

Thanks, I see you're launching the app itself, which is what I suspected. It is built use the AnyCPU target, which can work on 32- or 64-bit operating systems. It prefers 64-bit. The placement in Program Files (x86) is for legacy reasons and is very common. (Many apps you launch from that directory are 64-bit.)

https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fuser-images.githubusercontent.com%2f7417301%2f239362746-96a5f773-fd8e-4577-b946-f4bb55ea52f2.png&c=E,1,GgDajdWiNuaD81EVDDI9xDxP9Wp48tLBVe259vBE3xlnb-zcRqX4AG3lv33F8Lqmr45TLb8yU-3Yart475LiBT9sMUMzhy_lEea9LxUH7FCY05cxBL115VQsSHw,&typo=1

You also confirmed that still haven't answered my original question about the installer (WS4WSetup-2.0.10.exe). When you launch that executable to install the application, it is supposed to prompt you to install .NET Core 3.1. Have you run the installer? Does it give you that prompt? Does it appear to work?

— Reply to this email directly, view it on GitHub https://github.com/micahmo/WgServerforWindows/issues/116#issuecomment-1553551127 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHR3LKVEC3OC3QRHNZEWOFTXGZ2YTANCNFSM6AAAAAAYFHZLHM . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AHR3LKSGJV5RUWPLH2ZZLFDXGZ2YTA5CNFSM6AAAAAAYFHZLHOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTS4TFHRO.gif Message ID: @. @.> >

micahmo commented 1 year ago

When I run the application, that’s where it asks me the .net core question. Not the installer.

Whew, ok great, this is what I was looking for. The installer never prompted you to install .NET Core as shown in the original response, right?

It makes that determination by checking the installed runtimes in the registry. Can you check this registry key and let me know what you have?

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x64\sharedfx\Microsoft.NETCore.App

image

micahmo commented 1 year ago

Hi @heatsiphon, I recently experienced this issue with another app, so I have a new suggestion. Can you check Event Viewer > Windows Logs > Application (after trying to start WS4W)? In my case, it said it there was an issue loading a DLL for .NET 7.0.5 (C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\7.0.5). However, that folder was empty for me! I deleted it, and the app reverted to a previous, good install of .NET 7.0.2 and ran fine.

Long story short, that error message is not always indicative that the correct runtime isn't installed, but maybe that another corrupt one is.

cbailes commented 1 year ago

This issue is also present on one of my systems. Installing both .NET Core 3.1 and the latest SDK has had no effect. 'Yes' in response to the automatic download prompt just exits the application.

micahmo commented 1 year ago

@cbailes, sorry to hear that! Can you try the suggestion in my comment prior to yours (checking Event Viewer) and let me know if you find anything interesting?

cbailes commented 1 year ago

@micahmo Thanks for the quick reply. Here's the system log entry:

Description: A .NET Core application failed.
Application: WgServerforWindows.exe
Path: C:\Program Files (x86)\WS4W\WgServerforWindows.exe
Message: You must install or update .NET to run this application.

App: C:\Program Files (x86)\WS4W\WgServerforWindows.exe
Architecture: x64
Framework: 'Microsoft.WindowsDesktop.App', version '3.1.0' (x64)
.NET location: C:\Program Files\dotnet\

The following frameworks were found:
  5.0.17 at [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  6.0.6 at [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  7.0.8 at [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Installing the .NET desktop 3.1.32 runtime appears to have fixed it.

micahmo commented 1 year ago

Hey @cbailes, thanks for the update! Based on the error message, it does seem like .NET Core 3.1 was not installed prior to your manual step. I'm glad the manual step worked, but I'm not sure why it didn't get installed by the setup wizard. Just out of curiosity, did the setup run fine? Do you recall if it prompted to install .NET at all?

Anyway, thanks again, and hopefully this can help others.

cbailes commented 1 year ago

Everything worked perfect until the app was launched post-install, after which the option to get .NET pops up. Answering either Yes or No has the same result: the app is immediately closed.

It would probably be ideal to implement a different or redundant method of installing this dependency, but hopefully this helps!

JackMBurch commented 3 months ago

Agreed, or at least state which .NET version to install.