Sida otomaatig ah loogu cusboonaysiiyo Software-ka Bilaashka ah Chocolatey

Waxaad ku haysataa apps ka kombayutarka sida Spotify , Adobe Reader , Chrome , Firefox , 7-Zip , VLC Media Player…liisku(VLC Media Player…the) wuu socdaa dhamaantoodna waa bilaash. Maxaan samayn lahayn freeware la'aanteed ? Hase yeeshee, abkani waxay u baahan yihiin cusboonaysiin joogto ah si loo hagaajiyo godadka amniga oo loo soo bandhigo astaamo cusub oo faa'iido leh. Cusboonaysiinta waligood ma dhacaan waqti ku habboon.

Taasi waa meesha Chocolatey ka soo gasho ciyaarta. Isticmaal app-ka bilaashka ah ee Chocolatey si aad software-kaaga uga dhigto mid casri ah. Way fududahay, dhakhso badan tahay, fududdahay, oo miyaan sheegnay bilaash? Waxay u muuqataa(Seems) mid aad u wanaagsan inay run noqoto, haddana waa. Laakiin waa maxay Chocolatey ?

Waa maxay Chocolatey?

Haddii aadan wax ku qaban khadka taliska ee Windows(Windows command line) , PowerShell , ama khadka taliska Linux(Linux command line) , fikradda Chocolatey waxay noqon kartaa xoogaa la yaab leh. Chocolatey waa barnaamij heerka mashiinka ah kaas oo kaa caawinaya inaad maamusho software.

Heerka-mashiinka macnaheedu waa in aanu jirin is-dhexgal isticmaale garaaf ah oo kaa caawinaya inaad wax qabato. Dhammaan amarrada waa in la qoraa Ha(Don) u ogolaan in taasi kaa nixiso! Haddii aad qori kartid erayo, waad baran kartaa tan.

Sideen ku rakibaa Chocolatey?

Waxaa jira dhowr shay oo Chocolatey u baahan yahay si ay u shaqeyso. Marka barnaamijku u baahan yahay barnaamijyo kale oo sifooyinka Windows ah si uu u shaqeeyo, barnaamijyada loo baahan yahay waxaa loo tixraacaa ku tiirsanaanta. Ku tiirsanaanta Chocolatey(Chocolatey) waa inaad isticmaashaa ugu yaraan:

  • Windows 7 ama ka cusub
  • Nooca PowerShell 2 ama ka cusub
  • NET Framework 4 ama ka cusub
  • Intaa waxaa dheer, waa in aad leedahay maamulaha(administrator access) kombuyuutarkaaga

Haddii aad leedahay Windows 7 ama ka cusub, waxaad hore u haysatay nooca PowerShell 2 ama ka cusub. Haddii aadan hubin inaad haysatid .NET Framework 4 , ha welwelin. Markaad rakibayso Chocolatey , haddii aadan haysan .NET 4, Chocolatey ayaa kuu rakibi doonta.

Fur PowerShell(PowerShell) adiga oo ku qoraya sanduuqa raadinta ee Start Menu . Waa inaad aragto natiija soo baxaysa Windows PowerShell App .

Midig ku dhufo taas oo dooro Orod sida Maamule(Run as Administrator) . Samaynta tan waxaa loo yaqaanaa ku socodsiinta PowerShell tusaale sare(elevated instance) . Waxa la gaadhsiiyay mudnaanta maamulaha. Daaqada PowerShell ayaa furmi doonta.

Daaqadda PowerShell(PowerShell) , ku qor ama koobiy oo dheji amarka:

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))

Set - ExecutionPolicy Bypass -Scope Process -Force(Set-ExecutionPolicy Bypass -Scope Process -Force) Qaybta waxay u sheegaysaa PowerShell inaadan rabin inaad dhaqangeliso siyaasadda fulinta xaddidan ee tan xigta. PowerShell , sida caadiga ah, waxay kaliya u oggolaanaysaa hababka saxeexan inay socdaan. Waa goobta amniga ugu sareysa. Laakiin waxaan u baahanahay inaan socodsiino habkan aan la saxiixin ee ku rakibida Chocolatey .

Iex ((New - iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’)) ee qayb ka ah amarka ayaa u sheegaysa PowerShell inuu aado website-ka Chocolatey , soo dejiso rakibaadda .ps1 script, oo socodsii. Taasi waa qaybta runtii rakibta Chocolatey .

Waxaad arki doontaa qoraallo badan oo duulaya. Dareen(Feel) xoriyada dib ugu noqo oo akhri si aad u ogaato waxa hadda dhacay. Dhamaadka, waxay soo jeedinaysaa in aad maamusho choco /? si aad u aragto liiska hawlaha. Taasi waa hab wanaagsan oo lagu hubinayo in rakibaaddaadu shaqaynaysay. Horey u soco oo socodsii amarkaas.

Tusmada qoraalka kale ayaa duuli doona, kaas oo sidoo kale wanaagsan in la akhriyo lana fahmo. Dhammaadka, haddii rakibidda Chocolatey ay shaqeyso, waxaad arki doontaa wax la mid ah kuwan soo socda, halkaasoo qaybta cagaaran ay ku qoran tahay nooca aad hadda rakibtay.

Ku rakibida Software-ka Chocolatey

Aynu si degdeg ah u eegno ku rakibidda software- ka Chocolatey ka hor inta aanaan u helin casriyeynta software-ka.

Tag bogga https://chocolatey.org/packages si aad uga dhex baadho software-ka laga heli karo Chocolatey . Waxaad arki doontaa in loogu yeero xirmo.

Soo hel xirmo aad jeceshahay inaad ku rakibto. Tusaalahan, waxaanu isticmaali doonaa Malwarebytes Anti-Malware(Malwarebytes Anti-Malware) . Had iyo jeer way wanaagsan tahay in Malwarebytes ku jiro kombayutarkaaga(good to have Malwarebytes on your computer) .

Tusaale sare oo PowerShell ah , adeegso amarka choco install malwarebytes . Taasi waa. Rakibaadda ayaa bilaaban doonta Waxay ku joogsan doontaa qoraalkan soo socda:

Haddii aad ku qanacsan tahay inaad u ogolaato Chocolatey inuu maareeyo software-kaaga, markaa marka rakibiddan la dhammeeyo, waa inaan isticmaalnaa astaamaha choco karti -n allowGlobalConfirmation(choco feature enable -n allowGlobalConfirmation) amarka si aan u habayn karno rakibaadda iyo cusboonaysiinta mustaqbalka. Hadda, aan isticmaalno A si aan u dhammaystirno rakibidda.

Waxaad arki doontaa in Malwarebytes uu soo dejinayo oo uu bilaabo rakibidda.

Qiyaastii hal daqiiqo gudaheed, Malwarebytes waa la soo dejin doonaa oo lagu rakibi doonaa adiga oo aan wax shaqo ah kuu dheerayn.

Cusbooneysii Software-ka Chocolatey

Hadda oo aanu helnay xoogaa software ah, waxaan isku dayi karnaa in aan ku cusboonaysiinno Chocolatey . Mar labaad(Again) , waxaad u baahan tahay PowerShell inuu u furmo maamule(Administrator) ahaan . Markaa waxaad samayn kartaa amarka choco cusboonaysii malwarebytes(choco upgrade malwarebytes) .

Taasi waxay ka dhigi doontaa Chocolatey inuu baxo oo arko haddii ay jiraan wax cusboonaysiin ah ka dibna cusboonaysii. Hadda waxaan rakibnay Malwarebytes, markaa waxay tusi doontaa in eber ka baxsan hal xidhmo la cusboonaysiiyay. Taasi waa caadi.

Haddii aad ku rakibtay baakado badan Chocolatey , waxaad ku cusboonaysiin kartaa dhamaantood amar hal-line ah: choco update all -y(choco upgrade all -y) .

Taasi waa sida ay u adag tahay. Hadda waxa ay tahay inaan sameyno si aan si toos ah ugu cusbooneysiino software-ka Chocolatey waa inaan si uun uga dhigno amarkaas inuu ku shaqeeyo jadwal.

Si Toos ah Ugu Cusbooneysii Software(Update Software) -ka Chocolatey

Talaabada xigta ee aad samayn karto adigoo isticmaalaya Notepad engegan(Notepad) ama PowerShell ISE ( Integrated Scripting Environment ). Waxaanu ku samayn doonaa tusaalahan anagoo adeegsanayna Notepad maadaama dhammaan noocyada Windows aanay lahayn (Windows)PowerShell ISE .

Fur notepad. Koobiyi amarka choco cusboonaysii dhammaan -y(choco upgrade all -y ) galay Notepad.

Keyd taas sidii qoraalka PowerShell adiga oo u magacaabaya wax la mid ah cusboonaysiinta-ChocoPackages.ps1(upgrade-ChocoPackages.ps1) . Kordhinta .ps1 waxay u sheegaysaa Windows in kani yahay   script PowerShell .

Ka beddel nooca faylka ee Text Documents (*.txt) una beddel All Files (*.*).Haddii aadan samayn, Windows ayaa ka dhigi doonta cusboonaysiinta-ChocoPackages.ps1.txt(upgrade-ChocoPackages.ps1.txt) oo waxay u malaynaysaa inay tahay kaliya faylka Notepad .

Daaqadaha waxay la socotaa sifo weyn oo loo yaqaan Jadwalka Hawsha(Task Scheduler) . Celceliska isticmaalaha guriga malaha ma oga, laakiin Jadwalka Hawshu(Task Scheduler) waa sifada ka dhigaysa in wax badan ay si joogto ah u socdaan.

Gudaha Start Menu ka raadi Jadwalka Hawsha(Task Scheduler) . Guji(Click) marka ay soo baxdo natiijada.

Marka Jadwalka Hawshu(Task Scheduler) furmo, dhagsii Maktabadda Jadwalka Hawsha(Task Scheduler Library) oo ku taal aagga bidix ee sare ee daaqadda. Tani waxay ku tusi doontaa dhammaan hawlaha la qorsheeyay ee hadda lagu rakibay kombiyuutarkaaga.

Shaxda ficilka ee aagga sare ee midig, dhagsii Abuur Hawshaâ (Actions)€¦(Create Task…) . Abuur Hawsha Aasaasiga ah(Create Basic Task) kuma habboona xaaladdan, maadaama aan adeegsan doono weedho dood hadhow.

Daaqadda furan, ee tabka Guud(General) , waxaad siisaa hawsha magac sida Choco Upgrade All ka dibna Sharaxa(Description ) sida Cusbooneysii dhammaan software-ka ay ku rakibtay Chocolatey( Updates all software installed by Chocolatey) . Haddii koontada isticmaale ee hadda aanu ahayn koontada maamulka ee kumbuyuutarkaaga, isticmaal badhanka Isticmaalaha ama Kooxda beddelka(Change User or Group) si aad u doorato koontada maamulaha(Administrator) .

Waxaad sidoo kale u baahan doontaa inaad ogaato erayga sirta ah ee koontada Maamulka . (Administrator)Hubi(Make) in uu ordo in isticmaaluhu uu xidhan yahay iyo in kale(Run whether the user is logged on or not) . Tani waxay u oggolaanaysaa qoraalka inuu shaqeeyo xitaa haddii aadan ku jirin kumbuyuutarkaaga waxayna yeelan doontaa dhammaan mudnaanta ay u baahan tahay si ay u qabato shaqada.

Kiciyeyaasha tab(Triggers) waa meesha aad u sheegto hawsha marka aad rabto inay socoto. Taas awgeed, toddobaadkii hal mar waa inay ahaataa mid badan. Tusaalahayaga, waxa lagu wadaa inuu socdo Axad(Sunday) kasta saacadu markay tahay 1:00 subaxnimo Dooro wakhti aanad u badnayn inaad u isticmaasho kombiyuutarkaaga, si aad u hesho waxqabadka ugu fiican.

Waxaa lagu talinayaa in sidoo kale la hubiyo Jooji hawsha haddii ay socoto wax ka badan:(Stop the task if it runs longer than:) oo u beddel muddada 2 saacadood. Waxaad u hagaajin kartaa taas sidaad rabto. Si aad ugu ogolaato in kiciyuhu uu codsado, waa inaad calaamee sanduuqa la kartiy(Enabled) ee xagga hoose ku yaal.

U gudub tabka Actions -ka, waxaanan u sheegi doonaa hawsha waxa aanu doonayno inay qabato. (Actions)Ficilku waxa(Action) uu noqon doonaa mid aan la bilaabin barnaamijka(Start a program) . Taasi waa waxa aan rabno ee iska daa taas. Goobta Program/script , ku qor powershell.exe. Tani waxay u ogolaanaysaa Windows inuu ogaado inaad ku soconayso qoraalka PowerShell .

Goobta doodaha ku dar(Add arguments) , geli doodaha soo socda.

-noprofile – Tani waxay ka hortagtaa qoraalada profile PowerShell inay socdaan oo waxay u sheegaysaa inaad socodsiiso qoraalka aad rabto.

-ExecutionPolicy Bypass – Haddii aadan hubin in fulinta qoraalka la kartiyeeyay, way fiican tahay inaad tan ku haysato doodaha. Waxay hubin doontaa in qoraalka uu socdo.

-file – Tani waa doodda u sheegaysa Jadwalka Hawsha in wax kasta oo soo socdaa uu yahay dariiqa faylka aan rabno in PowerShell uu ku shaqeeyo. Tusaalahayaga, qoraalka waxa loo kaydiyay C:\Scripts\upgrade-ChocoPackages.ps1 . Waxa laga yaabaa inay ku kala duwanaato kombayutarkaga, markaa u hagaaji sida saxda ah. Haddii dariiqa faylkaagu leeyahay magacyo bannaan oo ku yaal, waxaad u baahan doontaa inaad jidka oo dhan geliso xigashooyinka.

Doodda buuxda waxay u ekaan doontaa -noprofile -executionpolicy bypass -file C:\Scripts\upgrade-ChocoPackages.ps1

Shaxda Shuruudaha(Conditions ) , waxaa jira doorashooyin badan oo aan dejin karno sida qoraalku u shaqeeyo. U fiirso iyaga si aad u aragto kuwa aad jeceshahay inaad codsato. Tusaalahan, waxa loo dejiyay inuu bilaabo hawsha kaliya haddii kumbiyuutarku ku jiro awoodda AC(Start the task only if the computer is on AC power) oo Jooji haddii kumbiyuutarku u wareego awoodda batteriga(Stop if the computer switches to battery power ) si loo hubiyo inaanan hoos u dhicin batteriga.

Kac kombiyuutarka si uu u socodsiiyo hawshan(Wake the computer to run this task) ayaa loo doortay si loo hubiyo in hawshu socoto, haddii kumbiyuutarku ku jiro qaab hurdo iyo in kale.

Gudaha tabka Settings , waxa lagu talinayaa in aad hubiso (Settings )Hawsha Oggolow in lagu socodsiiyo sanduuqa dalabka(Allow task to be run on demand) , si aanu gacanta ugu tijaabino hawsha marka aanu dhammayno. Xulashada caadiga ah ee inta soo hartay waa fiicantahay.

Guji OK si aad u dhameysato abuurista hawsha la qorsheeyay. Daaqada waa in uu ka soo baxaa magaca isticmaalaha aad dib ugu dooratay tabka Guud . (General)Waa inaad gelisaa erayga sirta ah ee isticmaalaha oo guji OK . Tani waxay u sheegaysaa Daaqadaha inaad adigu leedahay, runtii, aad awood u leedahay inaad socodsiiso hawsha.

Hadda waxaad ku soo noqotay daaqaddii Jadwalka Hawsha ugu weyn. (Task Scheduler)Hel hawshaada cusub. Midig ku dhufo hawsha oo dooro Run si aad u tijaabiso.

Ma arki doontid wax muhiim ah oo dhacaya, marka laga reebo heerka hawshu waxay isu beddeshaa orod(Running) . Hal daqiiqo ama wax ka badan gudaheed, waa in aad aragto orodkii ugu dambeeyay(Last Run Time ) sidoo kale waxa uu isku badalayaa timestamp markii aad bilawday socodsiinta hawsha.

Haddii aanad helin wax farriimo khalad ah, hawshu waa inay fiicnaataa. Xidh daaqada Hawsha(Task Scheduler) oo ha werwerin inaad gacanta ku cusboonaysiiso mid ka mid ah software-ka aad ku rakibtay Chocolatey mar kale.

Dhammaan Waa La Sameeyay!

Waxay u ekaan kartaa shaqo badan in tan la dejiyo. Tixgeli tan: waxay ku qaadatay meel u dhaxaysa 10 iyo 30 daqiiqo inaad tan dejiso. Haddii aad tan u isticmaalayso inaad cusboonaysiiso 10 barnaamij, barnaamij walbana uu qaadanayo ilaa 6 daqiiqo si uu u socodsiiyo habraaca cusboonaysiinta bil kasta, waxaad badbaadisay naftaada inta u dhaxaysa 30 iyo 50 daqiiqo.

Horay ayaad uga hormartay wakhtiga la badbaadiyay. Muddada sanadka ah, taasi waxay noqon kartaa 6 ilaa 10 saacadood oo wakhti la badbaadiyay. Taas kuma jiraan wakhtiga la badbaadiyay adiga oo garanaya sida loo isticmaalo Chocolatey si loogu rakibo barnaamijyada hal daqiiqo ama laba halkii 10 ama 15 daqiiqo.



About the author

Waxaan ahay barnaamij kombuyuutar oo ku takhasusay horumarinta software-ka MacOS. Waxaan u adeegsadaa xirfadahayga si aan u qoro faallooyin xirfadeed oo aan ku siiyo talooyin ku saabsan sida loo horumariyo xirfadahaaga barnaamij ee Mac-ka. Waxa kale oo aan haystaa shabakad bixisa tifaftiran, tilmaamo tallaabo-tallaabo ah oo lagu abuurayo degel guul leh.



Related posts