Mscorefonts easy automated installer (( Solved.))

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
motoryzen
Level 10
Level 10
Posts: 3474
Joined: Sun Dec 08, 2019 12:25 am

Mscorefonts easy automated installer (( Solved.))

Post by motoryzen »

Here is the installation command I'm trying to accomplish without any input from me, and I don't know the correct key for tab or enter key simulations.

( during the install of ttf-mscorefonts-installer....within 10 seconds or less..I must manually press the tab keyboard key, press enter to execute on the <ok> button , then again same tab and enter key presses to execute on the <yes> button and ..then ..it finishes installing. )

I want to automated all of this within the same long one line command

This one ( or i can be a two line command if needs be) command is one of many items I have set up to auto install in my auto install much stuff.sh script.

Code: Select all

apt install ttf-mscorefonts-installer -y ; sleep 10 \v ; sleep 2 \t ; sleep 2 \r
I've looked over all four links of bash script pages found here viewtopic.php?f=213&t=77062 but with doing " ctrl f " search for "tab" or " enter" I don't find anything coherent to what I'm looking for in finding which stuff to put into the command that makes it simulate pressing tab and enter keys and at what specific time.

LM 20.3 cinnamon using #!/bin/bash as the shell deal.
Last edited by LockBot on Mon Mar 13, 2023 10:00 pm, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
motoryzen
Level 10
Level 10
Posts: 3474
Joined: Sun Dec 08, 2019 12:25 am

Re: Mscorefonts easy automated installer (( Solved-))

Post by motoryzen »

_ update__

easy peasy

Code: Select all

echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer
Put these into a bash script document like below

Code: Select all

#!/bin/bash

echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer
save it. ensure it's executable

I haven't yet figured out how to create a gui button launcher that when launched..autoexecutes these commands one right after another, but the bash script works

I'd like to know how to create that launcher. I figured pkexec /path/to/theinstall.sh would do it. also tried with ' on each end and " ...nothing.
Last edited by motoryzen on Fri Sep 16, 2022 11:58 pm, edited 1 time in total.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
1000
Level 6
Level 6
Posts: 1039
Joined: Wed Jul 29, 2020 2:14 am

Re: Mscorefonts easy automated installer (( Solved..mostly))

Post by 1000 »

pkexec will open your script with "sudo" only.
Should work. Which version of Linux Mint do you have ?
Maybe you can test with example script

Code: Select all

#!/bin/bash
echo "Hello World."
bash error handling
https://duckduckgo.com/?q=bash+error+ha ... fsb&ia=web

In your case, it might be helpful in script
set -e
It will immediately stop your script if a simple command fails.
This is cool if the script is as simple as yours.
1000
Level 6
Level 6
Posts: 1039
Joined: Wed Jul 29, 2020 2:14 am

Re: Mscorefonts easy automated installer (( Solved..mostly))

Post by 1000 »

From terminal working,
but maybe you want have " launcher " on Desktop
and there it does not work?
motoryzen
Level 10
Level 10
Posts: 3474
Joined: Sun Dec 08, 2019 12:25 am

Re: Mscorefonts easy automated installer (( Solved..))

Post by motoryzen »

That Echo world deal always works

LM 20.3 Cinnamon here ( mentioned at the end.of my first post)

on kernel 5.15.whatever-whatever.
Last edited by motoryzen on Fri Sep 16, 2022 11:59 pm, edited 3 times in total.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
motoryzen
Level 10
Level 10
Posts: 3474
Joined: Sun Dec 08, 2019 12:25 am

Re: Mscorefonts easy automated installer (( Solved))

Post by motoryzen »

1000 wrote: Wed Sep 14, 2022 6:56 am From terminal working,
but maybe you want have " launcher " on Desktop
and there it does not work?
Not my way or ways I mentioned above..I'll try your suggestion when I get back home from work
Last edited by motoryzen on Fri Sep 16, 2022 11:59 pm, edited 1 time in total.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
motoryzen
Level 10
Level 10
Posts: 3474
Joined: Sun Dec 08, 2019 12:25 am

Re: Mscorefonts easy automated installer (( Solved.100% ))

Post by motoryzen »

I think I figured it out.

The installer.sh bash script file that contains the two lines of commands must be in the Home/NameofPc folder ...for it to work

It doesn't matter where the launcher is.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
Locked

Return to “Scripts & Bash”