nfdi4plants / Swate

Excel Add-In for annotation of experimental data and computational workflows.
https://swate-alpha.nfdi4plants.org
MIT License
31 stars 6 forks source link

[BUG] install.cmd causes strange cmd window jumping behaviour - installation fails #220

Closed SchmChris closed 1 year ago

SchmChris commented 2 years ago

Describe the bug Dear swate team, since I was curious to explore the swate tool, I downloaded the swate installer and followed the installation guide as described in the Readme. I tried two ways to use the install.cmd

Both ways the result is that the command prompt window starts opening and closing in less than a second, repeating this behaviour in infinity, while the shortly opened cmd window is shifting position across the screen each time. So what I see is the cmd window jumping across the screen indefinately. Since it pops up like a flip book, I can read it contains the line "requesting administrative privileges..." Each time this happens, my computer is essentially not accessible any more and I have to make a hard shut-down and reboot. The installation is hence unsuccessful, no swate appearing unter My add-ins in Excel. There is no error log appearing or anything I could share. It just crashes my system like that. Any ideas what is going on? I ran a computer scan for any non-related malware, nothing suspicious found.

To Reproduce as described above

Expected behavior This process is supposed to install Swate for Excel.

Screenshots Unfortunately, no screenshot possible. I hope my description gives an idea of this behaviour.

OS and framework information (please complete the following information):

Additional context Add any other context about the problem here, like ideas for a solution.

Freymaurer commented 2 years ago

Hey Christian, I am very sorry for the poor experience you are having with our tool. Sadly the installation is still quite unstable.

Are you trying to install Swate on your private computer or on a network account? Maybe this could help us identify the root of the issue.

If this is time sensitive for you, you could use the online version until we identified the issue.

Thanks for reporting this bug!

Edit: Does your username maybe contain whitespace? Like "Users/John Doe/..."?

SchmChris commented 2 years ago

Dear Kevin, thank you for the very quick answer. No worries, this issue is not pressing for me, I just wanted to let you know. I tried this on my work laptop where I log-in directly via the AD account at our institution. Neither my account name nor any other part of the path contains whitespace.

Freymaurer commented 2 years ago

I might have an idea on how to fix this. Would it be possible to send you a new install.cmd you could try? I think i'll have it ready on Monday.

SchmChris commented 2 years ago

Absolutely, happy to give it a try! Thank you for looking into this.

Freymaurer commented 2 years ago

Hey, so i tested this one on my local machine, but i did not see your issue before, so i hope this might work for you.

I'll share the file with you via a onedrive link that will be up until end of week: https://1drv.ms/u/s!AqQ_0TXqsACwhrhascG8f48h4hFXVw?e=mDYWVG

SchmChris commented 2 years ago

Hi Kevin, thank you for sharing the file. Unfortunately, the same problem occurs as with the original file :-/

kMutagene commented 2 years ago

This and many other issues underline the importance of #50

Freymaurer commented 2 years ago

@kMutagene is 100% right about this, as we are already trying to navigate the legal issues about adding Swate to the addin store.

Until then, we could try to narrow down the issue. So here is a file which requests admin access as Swate does and then just prints some stuff into the console. Would be very kind of you to run this @SchmChris: https://1drv.ms/u/s!AqQ_0TXqsACwhrhcuekQikgIlN3FLg?e=C7tgWW

SchmChris commented 2 years ago

Thank you both for your answers and action in this manner. Happy to try out files in the meantime. The last version requesting admin rights only, causes the same problem, only with the line popping up changed to "Requesting elevation..."

Freymaurer commented 2 years ago

Okay, so the root of the issue definitely lies within the admin access rights.

My colleague @omaus had the idea to install Swate without admin access, via: Rightclick --> Run as administrator.

Maybe this circumvents the loop: https://1drv.ms/u/s!AqQ_0TXqsACwhrhd7ipeUfnf3IahIQ?e=rx8Alc

SchmChris commented 2 years ago

Thank you. No looping anymore with the install_noAdmin.cmd. Here is the resultind cmd window dialog (however, with shifted formatting):

START Created folder for Swate manifest @"C:\Users\USERACCOUNT\AppData\Local\nfdi_manifests". Download Swate manifest to folder.. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:01:24 --:--:-- 0 curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 84149 ms: Timed out % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:01:24 --:--:-- 0 curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 84154 ms: Timed out Share folder with Excel network.. Systemfehler 5 aufgetreten.

Zugriff verweigert

Create registry file for Excel.. Execute registry file for Excel.. (Comment: Here a pop-up window appeared, warning me not to proceed, if I do not trust the source... Confirming this, another pop-up window confirms that the Keys and Values were successfully entered into the registry.) Done! Drücken Sie eine beliebige Taste . . . END

The folder nfdi_manifests was created with TrustNetworkShareCatalog.reg and I also find the created entries in the Windows Registry Editor. But no swate tool is available in Excel. Consider me an ordinary user without particular computer science knowledge. Do I get it right that while the folder where swate should be located was successfully created and the registry works in principle, the actual swate tool itself failed to be added to this folder?

SchmChris commented 2 years ago

Okay, as far as I understand the cmd installer file, the missing parts are that the core_manifest and expert_manifest were not downloaded (so I copied them manually to the folder and renamed to swateCore_manifest and swateExpert_manifest), but the net share command still failed?

Freymaurer commented 2 years ago

Share folder with Excel network.. Systemfehler 5 aufgetreten. Zugriff verweigert

This implies that the file was not executed as administrator. Because this is the step we are normally doing the request admin access for.

What the install.cmd tries to do is automatically do all the steps listed here: https://docs.microsoft.com/en-us/office/dev/add-ins/testing/create-a-network-shared-folder-catalog-for-task-pane-and-content-add-ins

So like:

  1. Create some folder to store the files in
  2. Download the swate manifest.xml files into that folder
  3. Share the folder with yourself (needs admin access)
  4. Create the registry file
  5. execute the registry file (which registers the folder as trusted add-in catalogue in excel)
  6. Then swate should be registered and ready to use.

Normally this set up is used to test Excel add-ins, but as university based workgroup we have some trouble getting Swate into the official add-in store. So we need to stick with this set up for now.

curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 84149 ms: Timed out

I am wondering why you cannot download files from github via curl.

omaus commented 2 years ago

I am wondering why you cannot download files from github via curl.

Timeout maybe due to downtime? Does it work if done at a later timepoint?

Freymaurer commented 2 years ago

Timeout maybe due to downtime? Does it work if done at a later timepoint?

I am afraid i don't understand what you mean 😅

omaus commented 2 years ago

I am afraid i don't understand what you mean 😅

Could have been that the GitHub server was down at the moment he tried to download which led to a timeout error. Or his internet connection didn't work.

SchmChris commented 2 years ago

Share folder with Excel network.. Systemfehler 5 aufgetreten. Zugriff verweigert

This implies that the file was not executed as administrator. Because this is the step we are normally doing the request admin access for.

Maybe I found out what happened here. My apologies that I might have misunderstood or overlooked things. Thumbling around like this is new for me. What I did was to "run as admin", entered my USERpassword and the cmd script started running. No message about missing admin rights or anything. Yet the net share command obviously failed implying I don't have the admin rights.

However, there is another account associated with my user, explicitly termed .\admUSERNAME. I did get another password for that one and so I tried running with this user. Still, the download from Github would not work (though in parallel I am able to load the locations on Github in the browser, so it is not my internet nor Github downtime). Then I copied the files manually to the newly created folder in C:\Users\admUSER\AppData\Local\nfdi_manifests, renaimed them as stated above and changed the cmd script by simply erasing the lines for downloading those two files. The result is a successfull net share command, BUT: The swate tool is now available in Excel ONLY when I log off from windows and log in with the admUSER account. That is not an account I use to work. So now I need to find out how I can share the registry entry also for my normal USER account, that obviously does not have the necessary admin rights as it seems.

Freymaurer commented 2 years ago
@REM Share folder with user
net share %nfdiShareName%=%nfdiFolder% /grant:%user%,FULL

ECHO Create registry file for Excel..

@REM Network path always contains computer name as first parameter. Create registry file according to Excel/Office docs.
(
    ECHO Windows Registry Editor Version 5.00
    ECHO ""
    ECHO [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\WEF\TrustedCatalogs\{aa2b5cf8-00a8-4d2e-9781-8c00ac234d73}]
    ECHO "Id"="{aa2b5cf8-00a8-4d2e-9781-8c00ac234d73}"
    ECHO "Url"="\\\\%computer%\\%nfdiShareName%"
    ECHO "Flags"=dword:00000001 
) > %nfdiFolder%/TrustNetworkShareCatalog.reg

You might need to write your username directly into the install cmd, replacing %user% in the above shown net share %nfdiShareName%=%nfdiFolder% /grant:%user%,FULL. but the user registering swate could also be determined by HKEY_CURRENT_USER. I am not sure if we'll manage to find a general solution to this. You might actually save yourself a lot of time to follow the set up steps by hand. Again i am very sorry about this inconvinience we are trying our best to improve the install situation 😞

SchmChris commented 1 year ago

Dear Kevin, sorry for the very late reply. After consulting with the institute's IT service center, it turned out that the rights to install the Add-In cannot be granted. The institute adheres to the standards of the Bundesamt für Sicherheit in der Informationstechnik. This is implemented via group policies at the whole institute. Rules could only be changed for the whole institute, but not for single users. My local admin account has no rights to white-list external Add-Ins for users on this computer and this right cannot be granted. Therefore, it was not possible to install SWATE for my normal user account. This is no problem for me right now, because I can try the functions with the admin account itself and with my private laptop, but I wanted to let you know, in case other users might experience similar issues in the future. Thank you again for all your efforts to help with this issue. Best, Chris

Freymaurer commented 1 year ago

All tries to create a robust Swate installer will be stopped for now. We instead focus on providing a Swate option without installation and getting Swate into the official microsoft add-in store.

You can have a look at the standalone version of Swate here: https://swate-alpha.nfdi4plants.org/.