Page 3 of 4

Re: Headless installation and configuration on Windows10

Posted: Tue Mar 31, 2020 2:02 pm
by wuerfelfreak
CaptainStarbuck wrote:It would be a huge service to the globe if this thread concluded with a final script and instructions for use.
There you are: https://gitlab.com/nilslennart.bruns/cm ... er-wrapper
I wrote another NSIS installer that does all the difficult work.
You only need to put the original installer and this one in the same directory. (must be namend "fah-installer_7.5.1_x86.exe") (Download the orginal one from http://foldingathome.org! Because of licensing i can't redistribute it on Gitlab.)

Example

Code: Select all

.\cmd-fah-installer-wrapper.exe /S /user=wuerfelfreak /team=233518 /passkey=000000000yourPasskey00000000 /allow=0.0.0.0/0 /password=yourPassword
Direkt Download: https://gitlab.com/nilslennart.bruns/cm ... line=false


1. It runs the FAH-Installer in silent mode
2. It adds the missing Registry key for the service to work
3. It adds the config
4. It adds the system service
5. Profit

After installing FAH will start at boot without user intervention.

But! When you just want to install this on your friends PC over RDP i would strongly recommend to use the graphical installer.
Also I don't really know what I am doing as I normally only work with Linux so please check anything before executing!

Re: Headless installation and configuration on Windows10

Posted: Tue Mar 31, 2020 2:33 pm
by CaptainStarbuck
@wuerfelfreak - I will try this on a couple systems as time permits and hope that others do the same.
With some confirmations of success, the next step I would recommend for the F@H team would be for a press release and tweets about how easy it is to do this = Marketing for something really useful.
Thanks!

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 3:05 pm
by js2010
My install script is on the bottom of page one. The trick is the data directory location is stored in the uninstall part of the registry. The data folder has to be created, but can be empty at first (unless you want all the themes). Then you can copy your config.xml to the data directory. Thanks for the sqlite tip. The stats are on the web too: https://stats.foldingathome.org. Yes, Folding@Home should document a silent install.

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 3:13 pm
by Anicube
@wuerfelfreak

I tried your installer and it works good.
There is just a little problem: While installing it shows a Popup Window "registry". As long as the OK Button is not pressed it will not continue installing. I checked your sourcecode, removed the popup message and compiled it localy. After that it worked.

Another thing to mention:
When you uninstall the Client it cant erase the Windows Service so I had to do it manually.

I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.

Thanks for your work ^^

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 3:55 pm
by fowie
Anicube wrote:@wuerfelfreak

I tried your installer and it works good.
There is just a little problem: While installing it shows a Popup Window "registry". As long as the OK Button is not pressed it will not continue installing. I checked your sourcecode, removed the popup message and compiled it localy. After that it worked.

Another thing to mention:
When you uninstall the Client it cant erase the Windows Service so I had to do it manually.

I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.

Thanks for your work ^^
I think erasing the windows service can be accomplished by running

Code: Select all

FAHClient.exe --uninstall-serivce 
before you uninstall FAHClient

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 4:30 pm
by wuerfelfreak
Anicube wrote: I tried your installer and it works good.
[..]
I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.
Thank you for the great feedback! I fixed both your complaints immeately.
The uninstalling was easily automated by also setting the registry key "InstalledService" as REG_DWORD 0x00000001
Then the uninstaller knows that it has to remove the service.

130 Clients are quite an impressive amount for me as a student. Way more than the 40 PCs I could convince my school to provide.

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 4:45 pm
by js2010
Anyone else notice the config.xml has mixed unix and windows line endings, some with carriage returns and some without? But all lines with linefeeds. It's obvious in emacs. It still works anyway.

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 6:10 pm
by Anicube
wuerfelfreak wrote:
Anicube wrote: I tried your installer and it works good.
[..]
I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.
Thank you for the great feedback! I fixed both your complaints immeately.
The uninstalling was easily automated by also setting the registry key "InstalledService" as REG_DWORD 0x00000001
Then the uninstaller knows that it has to remove the service.

130 Clients are quite an impressive amount for me as a student. Way more than the 40 PCs I could convince my school to provide.
Well, every PC uses power and schools usually have no money anyway.. as sad as it is. We are using the Point of Sale PCs in the Soccer Stadium now for the Folding. They are a bit weak and are only passive cooled but kinda get the job done :lol:
And there are no games or visitors now anyway ^^

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 6:44 pm
by olliecampbell
js2010 wrote:

Code: Select all

start /wait fah-installer_7.5.1_x86.exe /S
"C:\Program Files (x86)\FAHClient\FAHClient.exe" --install-service
reg add HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FAHClient /v DataDirectory /f /d C:\Users\user\AppData\Roaming\FAHClient
mkdir c:\users\user\appdata\roaming\fahclient
copy /y config.xml c:\users\user\roaming\fahclient
net start "Folding@home Client"

Just a thought, you could replace the "user" in those paths with %username% and assuming the script is run as the intended user it will replace the variable with their username.

Re: Headless installation and configuration on Windows10

Posted: Wed Apr 01, 2020 7:13 pm
by js2010
It's actually running as system, but it's using a permanent admin's profile for the data. It's probably better to have a %user% or %datadir% variable at the top. The data directory could really be anywhere.

Re: Headless installation and configuration on Windows10

Posted: Thu Apr 02, 2020 1:24 am
by js2010
Trying out modifying the sqlite database, using the sqlite3 shell, to script the connection tab in the gui (take away the doublequotes in cmd):

Code: Select all

echo "INSERT INTO clients ( name, address, port, password ) VALUES ( 'comp001','comp001','36330','' )" | sqlite3 fahcontrol.db
echo "select * from clients" | sqlite3 fahcontrol.db

local|127.0.0.1|36330|
comp001|comp001|36330|

Re: Headless installation and configuration on Windows10

Posted: Thu Apr 02, 2020 6:46 pm
by js2010
What's better, 10 computers running at 100% cpu or 100 computers running at 10% cpu?

Re: Headless installation and configuration on Windows10

Posted: Thu Apr 02, 2020 7:20 pm
by Neil-B
On the basis all100 computers same spec/setup/etc. … 10 computers at 100% as WUs completed quicker

Re: Headless installation and configuration on Windows10

Posted: Sat Apr 04, 2020 10:28 am
by LancasterUni
In case it's of use, in the last week I've rolled out an installation to 272 Windows 10 PCs (with the permission of the institution, in fact I was asked to pick this up as a project). I have gone for running as service so if you need GPU folding this isn't for you. I used EMCO packager to capture an install of the client and create an msi, with the client set to run as a service. Any msi creator would do. I edited the msi to drop in a custom config.xml file with my team, user and passkey, and remove desktop and menu shortcuts. I added this application to a group policy in our AD, and also added firewall rules to control which machines could talk to FAHclient, and what it can talk to. I got sign off for the configuration from our Security Manager. I also added the service to the policy so that I could configure it for Delayed Automatic startup (I saw some issues with FAHclient service not starting on the first reboot after installation), and to startup (if not already running) at GP refresh.

I can now attached that policy to a lab OU and reboot the lab remotely using Powershell (it does still sometimes take two reboots to get going) and the clients are then up and running. I have a management server that I have FAHControl installed on, and I use DB Browser for SQLite to bulk import new machines from a CSV file. FAHControl, not surprisingly, has to be closed while you edit the DB.

Once the labs are needed again for students I will remove the group policy, reboot the machines and they will be back to normal.

On the subject of FAHControl, I do seem to have reached some kind of limit for the number of clients it can handle. Although it is still able to show me which clients are online (which is the main thing), it doesn't seem to be able to give me a live update of what each client is doing in terms of work, which is a shame. Has anyone else seen this problem? The server is fine in terms of CPU and network bandwidth and FAHControl doesn't seem to be using much resource.

Re: Headless installation and configuration on Windows10

Posted: Sat Apr 04, 2020 12:05 pm
by wuerfelfreak
I did have the same problems with FAHControl, which is why I am currently working on a similar Program which is geared more to managing hundreds of clients. Maybe i can complete it in the next week. The FAHClient-API is not good, but gets the job done.

I am also working on a second installer which uses auto login to use the GPU as well. Currently I am stuck on the windows account creation dialog which pops up, the first time a newly created user logs in.