winapps-org / winapps

The winapps main project, forked from https://github.com/Fmstrat/winapps/
Other
998 stars 45 forks source link

Add option to use a preexisting windows installation #204

Closed fbartels closed 1 month ago

fbartels commented 1 month ago

I made a quick test how to upgrade from my old version of winapps, while still using my existing windows vm.

Currently it fails however, and in windows I only get the popup to install an additional application.

image

Fixes https://github.com/winapps-org/winapps/issues/203

fbartels commented 1 month ago

The culprit seems to be https://github.com/fbartels/winapps/blob/2741dfd3a22a531e7c2ce4f2a4d98d9f6fd2cc9a/installer.sh#L950 the original project did not have the program: bit https://github.com/Fmstrat/winapps/blob/d9db13a10e26f0ab5de78af44dfc505540f44b4d/installer.sh#L44. The problem is if i remove program: I am getting errors from my xfreerdp

xfreerdp /cert:tofu /d: /u:my-user /p:my-password /scale:100 +auto-reconnect +home-drive -wallpaper +dynamic-resolution '/app:C:\Windows\System32\cmd.exe,cmd:/C type NUL > \\tsclient\home\.local\share\winapps\FreeRDP_Connection_Test && tsdiscon' /v:192.168.178.208
[14:04:06:747] [2536012:2536013] [WARN][com.freerdp.core.nego] - Error: SSL_NOT_ALLOWED_BY_SERVER
[14:04:06:766] [2536012:2536013] [WARN][com.freerdp.core.nego] - Error: SSL_NOT_ALLOWED_BY_SERVER
[14:04:08:983] [2536012:2536013] [INFO][com.freerdp.gdi] - Local framebuffer format  PIXEL_FORMAT_BGRX32
[14:04:08:983] [2536012:2536013] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_BGRA32
[14:04:08:989] [2536012:2536013] [INFO][com.freerdp.channels.rdpsnd.client] - [static] Loaded fake backend for rdpsnd
[14:04:08:990] [2536012:2536087] [INFO][com.freerdp.channels.rdpdr.client] - Loading device service drive [home] (static)
[14:04:08:990] [2536012:2536013] [INFO][com.freerdp.channels.drdynvc.client] - Loading Dynamic Virtual Channel rdpgfx
[14:04:08:990] [2536012:2536013] [INFO][com.freerdp.channels.drdynvc.client] - Loading Dynamic Virtual Channel disp
[14:04:08:095] [2536012:2536087] [INFO][com.freerdp.channels.rdpdr.client] - registered device #1: home (type=8 id=1)
[14:04:08:227] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:306] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:344] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:405] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:452] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:547] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:560] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:616] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:806] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:826] [2536012:2536013] [WARN][com.freerdp.client.x11] - xf_Pointer: Invalid appWindow
[14:04:08:856] [2536012:2536090] [ERROR][com.freerdp.client.x11] - RAIL exec error: execResult=RAIL_EXEC_E_FAIL NtError=0x2

[14:04:08:856] [2536012:2536090] [ERROR][com.freerdp.core] - freerdp_abort_connect:freerdp_set_last_error_ex ERRCONNECT_CONNECT_CANCELLED [0x0002000B]
[14:04:08:856] [2536012:2536013] [INFO][com.freerdp.client.common] - Network disconnect!
[14:04:08:856] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (1 of 20)
[14:04:09:363] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (2 of 20)
[14:04:09:870] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (3 of 20)
[14:04:10:378] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (4 of 20)
[14:04:10:885] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (5 of 20)
[14:04:11:392] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (6 of 20)
[14:04:11:900] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (7 of 20)
[14:04:12:408] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (8 of 20)
[14:04:13:915] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (9 of 20)
[14:04:13:422] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (10 of 20)
[14:04:14:930] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (11 of 20)
[14:04:14:437] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (12 of 20)
[14:04:15:944] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (13 of 20)
[14:04:15:451] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (14 of 20)
[14:04:16:958] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (15 of 20)
[14:04:16:466] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (16 of 20)
[14:04:17:973] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (17 of 20)
[14:04:17:480] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (18 of 20)
[14:04:18:988] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (19 of 20)
[14:04:18:495] [2536012:2536013] [INFO][com.freerdp.client.common] - Attempting reconnect (20 of 20)
oskardotglobal commented 1 month ago

Well that was quick.
The error probably comes from having FreeRDP2 still installed. You need FreeRDP3.

fbartels commented 1 month ago

You need FreeRDP3

Ah yes, that seems to have been it. I'm still on Ubuntu 22.04 so I still had version 2 installed. With the now pushed changes I can use winapps just like I could before. During the setup I am getting an error, but i had something similar already with the old version. I think it probably has something to do with the apps I have installed:

$ ./installer.sh --user
################################################################################
#                                                                              #
#                            WinApps Install Wizard                            #
#                                                                              #
################################################################################

Installing WinApps.
Checking for existing conflicting WinApps installations... Done!
Attempting to load WinApps configuration file... Done!
Checking whether dependencies are installed... Done!
Checking for an open RDP Port on Windows... Done!
Checking for an open RDP Port on Windows... Done!
Attempting to establish a Remote Desktop connection with Windows... Done!
Checking for installed Windows applications... Done!
Creating an application entry for Windows... Done!
Q) How would you like to handle officially supported applications? --> Set up all detected officially supported applications
Creating an application entry for access... Done!
Creating an application entry for cmd... Done!
Creating an application entry for excel-o365... Done!
Creating an application entry for explorer... Done!
Creating an application entry for iexplorer... Done!
Creating an application entry for onenote-o365... Done!
Creating an application entry for outlook-o365... Done!
Creating an application entry for powerpoint-o365... Done!
Creating an application entry for powershell... Done!
Creating an application entry for publisher-o365... Done!
Creating an application entry for word-o365... Done!
/home/felix/.local/share/winapps/detected: line 4: Get-Item: command not found
Exiting with status '127'.

The line in the "detected" file looks like this:

NAMES=()
EXES=()
ICONS=()
Get-Item : Cannot find path 'C:\Program 
Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.2.5.0_x64__8wekyb3d8bbwe\msrdc.exe' because it 
does not exist.
At \\tsclient\home\.local\share\winapps\ExtractPrograms.ps1:106 char:10
+     if ((Get-Item $exePath).VersionInfo.FileDescription) {
+          ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program File...8bbwe\msrdc.exe:String) [Get-Item], ItemNotFoundExcep 
   tion
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand

Get-Item : Cannot find path 'C:\Program 
Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemForLinux_1.2.5.0_x64__8wekyb3d8bbwe\wslg.exe' because it does 
not exist.
At \\tsclient\home\.local\share\winapps\ExtractPrograms.ps1:106 char:10
+     if ((Get-Item $exePath).VersionInfo.FileDescription) {
+          ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program File...d8bbwe\wslg.exe:String) [Get-Item], ItemNotFoundExcep 
   tion
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand

But that probably warrants its own ticket.