├── .github └── FUNDING.yml ├── .gitignore ├── Debug install.lnk ├── Debug uninstall.lnk ├── Debug.bat ├── DeskBand Media Controls.sln ├── Directory.Build.props ├── Install guide.txt ├── LICENSE ├── MediaControls.DeskBand ├── CSDeskBand.cs ├── Deskband.cs ├── Logo.ico ├── MediaControls.DeskBand.csproj ├── MediaControls.DeskBand_knm24ohz_wpftmp.csproj ├── MediaSelector.xaml ├── MediaSelector.xaml.cs ├── MediaSession.cs ├── PlaceHolder Album Cover Spotify.png ├── PlaceHolder Album Cover long.png ├── PlaceHolder Album Cover.png ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.fr.Designer.cs │ ├── Resources.fr.resx │ ├── Resources.resx │ ├── Settings.Designer.cs │ ├── Settings.settings │ └── app.manifest ├── UserControl1.Designer.cs ├── UserControl1.cs ├── ViewModels │ └── MediaSelectorViewModels.cs └── packages.config ├── MediaControls.Installer ├── App.config ├── App.xaml ├── App.xaml.cs ├── DeskBand Register.cs ├── ExplorerManager.cs ├── FodyWeavers.xsd ├── Installer.cs ├── Logo.ico ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── MediaControls.DeskBand.dll ├── MediaControls.Installer.csproj ├── MediaControls.Installer_TemporaryKey.pfx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.fr.Designer.cs │ ├── Resources.fr.resx │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── MediaControls.DeskBand.dll │ └── Octokit.dll └── app.manifest ├── MediaControls.Test ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── MediaControls.Test.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── TestWindow.xaml └── TestWindow.xaml.cs ├── MediaControls.UWP ├── App.xaml ├── App.xaml.cs ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ └── Wide310x150Logo.scale-200.png ├── MainPage.xaml ├── MainPage.xaml.cs ├── MediaControls.UWP.csproj ├── PachageFinder.xaml ├── PachageFinder.xaml.cs ├── Package.appxmanifest ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── SegoeIcons.cs ├── SessionMonitoring.xaml └── SessionMonitoring.xaml.cs ├── MediaControls.WPF ├── App.config ├── App.xaml ├── App.xaml.cs ├── FocusMe.cs ├── Logo.ico ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── MediaControls.WPF.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── WindowManagement.cs ├── MediaControls ├── DefinitionExtension.cs ├── GitHubHelper.cs ├── IconUtilities.cs ├── LightDarkModeGetter.cs ├── Logo.ico ├── MediaControls.csproj ├── Modeles │ ├── Player.cs │ ├── PlayerModel.cs │ └── PlayerShortcut.cs ├── PlayerUtilities.cs ├── Properties │ └── AssemblyInfo.cs ├── SegoeIcons.cs ├── SessionManager.cs ├── TargetInput.cs ├── Taskbar.cs └── View │ ├── MediaSelectorWindow.xaml │ ├── MediaSelectorWindow.xaml.cs │ ├── PlayersShorcutUserControl.xaml │ ├── PlayersShorcutUserControl.xaml.cs │ ├── UserControl1.xaml │ └── UserControl1.xaml.cs ├── README.md ├── Sans titre.png └── Store ├── Intro.gif ├── Logo 256.ico ├── Logo 48.ico ├── Logo.ico ├── Logo.pfi ├── Logo.png ├── Media control.png ├── Media controls Resize.png ├── OneClick Install Resize.png ├── OneClick Install.png ├── Player selector resize.png ├── Player selector.png ├── Simple 2.png └── Simple.png /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | #github: Tom60chat 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: tom60 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | #custom: https://www.paypal.com/donate?hosted_button_id=EA39WRQB9H28G 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /Debug install.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/Debug install.lnk -------------------------------------------------------------------------------- /Debug uninstall.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/Debug uninstall.lnk -------------------------------------------------------------------------------- /Debug.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe" /nologo %~1 "C:\Users\Tom60\OneDrive\Documents_\Projects\C#\DeskBand Media Controls\MediaControls.DeskBand\bin\Debug\MediaControls.DeskBand.dll" 3 | pause -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | latest 5 | enable 6 | 7 | -------------------------------------------------------------------------------- /Install guide.txt: -------------------------------------------------------------------------------- 1 | cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 2 | regasm /codebase "C:\Users\Tom60\OneDrive\Documents\Projects\C#\DeskBand Media Controls\MediaControls.DeskBand\bin\Debug\MediaControls.DeskBand.dll" 3 | 4 | regasm /nologo /u "C:\Users\Tom60\OneDrive\Documents\Projects\C#\DeskBand Media Controls\MediaControls.DeskBand\bin\Debug\MediaControls.DeskBand.dll" -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2021, Tom OLIVIER 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Deskband.cs: -------------------------------------------------------------------------------- 1 | using CSDeskBand; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | using System.Windows; 5 | 6 | namespace MediaControls.DeskBand 7 | { 8 | [ComVisible(true)] 9 | [Guid("77D175B4-0A80-4581-A28E-D17150AAE027")] 10 | [CSDeskBandRegistration(Name = "Media Controls", ShowDeskBand = true)] 11 | public class Deskband : CSDeskBandWpf 12 | { 13 | public Deskband() 14 | { 15 | Options.Title = Properties.Resources.Name; 16 | 17 | Options.HorizontalSize = new Size(180, 40); 18 | Options.MinHorizontalSize = new Size(150, 0); 19 | 20 | Options.MinVerticalSize = new Size(0, 150); 21 | Options.VerticalSize = new Size(40, 180); 22 | 23 | Options.HeightCanChange = true; 24 | Options.IsFixed = false; 25 | Options.PropertyChanged += Options_PropertyChanged; 26 | 27 | TaskbarInfo.TaskbarEdgeChanged += TaskbarInfo_TaskbarEdgeChanged; 28 | TaskbarInfo.TaskbarOrientationChanged += TaskbarInfo_TaskbarOrientationChanged; 29 | TaskbarInfo.TaskbarSizeChanged += TaskbarInfo_TaskbarSizeChanged; 30 | } 31 | 32 | private void TaskbarInfo_TaskbarSizeChanged(object sender, TaskbarSizeChangedEventArgs e) 33 | { 34 | } 35 | 36 | private void TaskbarInfo_TaskbarOrientationChanged(object sender, TaskbarOrientationChangedEventArgs e) 37 | { 38 | } 39 | 40 | private void TaskbarInfo_TaskbarEdgeChanged(object sender, TaskbarEdgeChangedEventArgs e) 41 | { 42 | if (UserControl1.Singleton != null) 43 | { 44 | UserControl1.Singleton.CurrentEdge = (System.Windows.Forms.TaskbarPosition)e.Edge; 45 | } 46 | } 47 | 48 | private void Options_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) 49 | { 50 | 51 | } 52 | 53 | protected override UIElement UIElement => new UserControl1(); // Return the main wpf control 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/MediaControls.DeskBand/Logo.ico -------------------------------------------------------------------------------- /MediaControls.DeskBand/MediaControls.DeskBand.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F83F0981-9881-4442-9708-B94962854C22} 8 | library 9 | MediaControls.DeskBand 10 | MediaControls.DeskBand 11 | v4.8 12 | 10.0.17763 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | 18 | 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | TRACE;DEBUG;DESKBAND_WPF 27 | prompt 28 | 4 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE;DESKBAND_WPF 35 | prompt 36 | 4 37 | 38 | 39 | 40 | 41 | Logo.ico 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 4.0 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Code 68 | 69 | 70 | True 71 | True 72 | Resources.resx 73 | 74 | 75 | True 76 | Settings.settings 77 | True 78 | 79 | 80 | PublicResXFileCodeGenerator 81 | Resources.Designer.cs 82 | 83 | 84 | 85 | SettingsSingleFileGenerator 86 | Settings.Designer.cs 87 | 88 | 89 | 90 | 91 | 10.0.19041.1 92 | 93 | 94 | 0.50.0 95 | 96 | 97 | 98 | 99 | {50A7E9B0-70EF-11D1-B75A-00A0C90564FE} 100 | 1 101 | 0 102 | 0 103 | tlbimp 104 | False 105 | True 106 | 107 | 108 | 109 | 110 | {d31c5efd-96e2-4e28-a169-0e42a55ffce5} 111 | MediaControls 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | %(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension) 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/MediaSelector.xaml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/MediaSelector.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using Xamarin.Forms; 8 | using Xamarin.Forms.Xaml; 9 | 10 | namespace MediaControls.DeskBand 11 | { 12 | [XamlCompilation(XamlCompilationOptions.Compile)] 13 | public partial class MediaSelector : ContentPage 14 | { 15 | public MediaSelector() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /MediaControls.DeskBand/MediaSession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace MediaControls.DeskBand 8 | { 9 | class MediaSession 10 | { 11 | public MediaSession() 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/PlaceHolder Album Cover Spotify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/MediaControls.DeskBand/PlaceHolder Album Cover Spotify.png -------------------------------------------------------------------------------- /MediaControls.DeskBand/PlaceHolder Album Cover long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/MediaControls.DeskBand/PlaceHolder Album Cover long.png -------------------------------------------------------------------------------- /MediaControls.DeskBand/PlaceHolder Album Cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/MediaControls.DeskBand/PlaceHolder Album Cover.png -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // Les informations générales relatives à un assembly dépendent de 8 | // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations 9 | // associées à un assembly. 10 | [assembly: AssemblyTitle("DeskBand Media Controls")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("TaskBar Media Controls")] 15 | [assembly: AssemblyCopyright("Tom OLIVIER 2022")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 20 | // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 21 | // COM, affectez la valeur true à l'attribut ComVisible sur ce type. 22 | [assembly: ComVisible(false)] 23 | 24 | //Pour commencer à générer des applications localisables, définissez 25 | //CultureUtiliséePourCoder dans votre fichier .csproj 26 | //dans . Par exemple, si vous utilisez le français 27 | //dans vos fichiers sources, définissez à fr-FR. Puis, supprimez les marques de commentaire de 28 | //l'attribut NeutralResourceLanguage ci-dessous. Mettez à jour "fr-FR" dans 29 | //la ligne ci-après pour qu'elle corresponde au paramètre UICulture du fichier projet. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly:ThemeInfo( 35 | ResourceDictionaryLocation.None, //où se trouvent les dictionnaires de ressources spécifiques à un thème 36 | //(utilisé si une ressource est introuvable dans la page, 37 | // ou dictionnaires de ressources de l'application) 38 | ResourceDictionaryLocation.SourceAssembly //où se trouve le dictionnaire de ressources générique 39 | //(utilisé si une ressource est introuvable dans la page, 40 | // dans l'application ou dans l'un des dictionnaires de ressources spécifiques à un thème) 41 | )] 42 | 43 | 44 | // Les informations de version pour un assembly se composent des quatre valeurs suivantes : 45 | // 46 | // Version principale 47 | // Version secondaire 48 | // Numéro de build 49 | // Révision 50 | // 51 | // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 52 | // en utilisant '*', comme indiqué ci-dessous : 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.3.0.0")] 55 | [assembly: AssemblyFileVersion("1.3.0.0")] 56 | [assembly: NeutralResourcesLanguage("")] 57 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.42000 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MediaControls.DeskBand.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. 17 | /// 18 | // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder 19 | // à l'aide d'un outil, tel que ResGen ou Visual Studio. 20 | // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen 21 | // avec l'option /str ou régénérez votre projet VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MediaControls.DeskBand.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Remplace la propriété CurrentUICulture du thread actuel pour toutes 51 | /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Recherche une chaîne localisée semblable à Media Controls. 65 | /// 66 | public static string Name { 67 | get { 68 | return ResourceManager.GetString("Name", resourceCulture); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/Resources.fr.Designer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/MediaControls.DeskBand/Properties/Resources.fr.Designer.cs -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/Resources.fr.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Contrôles multimédias 122 | 123 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Media Controls 122 | 123 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Ce code a été généré par un outil. 4 | // Version du runtime :4.0.30319.42000 5 | // 6 | // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si 7 | // le code est régénéré. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MediaControls.DeskBand.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/Properties/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 55 | 61 | 62 | 63 | 64 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/UserControl1.Designer.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace MediaControls.DeskBand2 3 | { 4 | partial class UserControl1 5 | { 6 | /// 7 | /// Variable nécessaire au concepteur. 8 | /// 9 | private System.ComponentModel.IContainer components = null; 10 | 11 | /// 12 | /// Nettoyage des ressources utilisées. 13 | /// 14 | /// true si les ressources managées doivent être supprimées ; sinon, false. 15 | protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Code généré par le Concepteur de composants 25 | 26 | /// 27 | /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas 28 | /// le contenu de cette méthode avec l'éditeur de code. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | components = new System.ComponentModel.Container(); 33 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 34 | } 35 | 36 | #endregion 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/UserControl1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace MediaControls.DeskBand2 12 | { 13 | public partial class UserControl1 : UserControl 14 | { 15 | public UserControl1() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/ViewModels/MediaSelectorViewModels.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Runtime.CompilerServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows.Media; 9 | using Windows.UI.ViewManagement; 10 | 11 | namespace MediaControls.DeskBand.ViewModels 12 | { 13 | class MediaSelectorViewModels : INotifyPropertyChanged 14 | { 15 | public event PropertyChangedEventHandler PropertyChanged; 16 | 17 | // This method is called by the Set accessor of each property. 18 | // The CallerMemberName attribute that is applied to the optional propertyName 19 | // parameter causes the property name of the caller to be substituted as an argument. 20 | private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") 21 | { 22 | if (PropertyChanged != null) 23 | { 24 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 25 | } 26 | } 27 | 28 | 29 | public MediaSelectorViewModels() 30 | { 31 | UISettings settings = new UISettings(); 32 | var foreground = settings.GetColorValue(UIColorType.Foreground); 33 | var background = settings.GetColorValue(UIColorType.Background); 34 | Color myforeColor = Color.FromArgb(foreground.A, foreground.R, foreground.G, foreground.B); 35 | ForeBrush = new SolidColorBrush(myforeColor); 36 | 37 | Color mybackColor = Color.FromArgb(background.A, background.R, background.G, background.B); 38 | BackBrush = new SolidColorBrush(mybackColor); 39 | } 40 | 41 | private SolidColorBrush foreBrush = new SolidColorBrush(Colors.Black); 42 | public SolidColorBrush ForeBrush 43 | { 44 | get 45 | { 46 | return foreBrush; 47 | } 48 | set 49 | { 50 | foreBrush = value; 51 | NotifyPropertyChanged(); 52 | } 53 | } 54 | 55 | 56 | private SolidColorBrush backBrush = new SolidColorBrush(Colors.White); 57 | public SolidColorBrush BackBrush 58 | { 59 | get 60 | { 61 | return backBrush; 62 | } 63 | set 64 | { 65 | backBrush = value; 66 | NotifyPropertyChanged(); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /MediaControls.DeskBand/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MediaControls.Installer/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MediaControls.Installer/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /MediaControls.Installer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Globalization; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Reflection; 9 | using System.Threading.Tasks; 10 | using System.Windows; 11 | 12 | namespace MediaControls.Installer 13 | { 14 | /// 15 | /// Logique d'interaction pour App.xaml 16 | /// 17 | public partial class App : Application 18 | { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MediaControls.Installer/DeskBand Register.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Reflection; 6 | using System.Runtime.InteropServices; 7 | using System.Windows; 8 | 9 | namespace MediaControls.Installer 10 | { 11 | public class DeskbandRegister : MarshalByRefObject 12 | { 13 | public bool Register(string dllPath) 14 | { 15 | var asm = Assembly.LoadFile(dllPath); 16 | return Register(asm); 17 | } 18 | 19 | public bool Unregister(string dllPath) 20 | { 21 | var asm = Assembly.LoadFile(dllPath); 22 | return Unregister(asm); 23 | } 24 | 25 | public static bool Register(Assembly asm) 26 | { 27 | var regAsm = new RegistrationServices(); 28 | 29 | try 30 | { 31 | return regAsm.RegisterAssembly(asm, AssemblyRegistrationFlags.SetCodeBase); 32 | } 33 | catch (Exception e) 34 | { 35 | MessageBox.Show(e.Message, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); 36 | Console.WriteLine(e.ToString()); 37 | return false; 38 | } 39 | } 40 | 41 | public static bool Unregister(Assembly asm) 42 | { 43 | var regAsm = new RegistrationServices(); 44 | 45 | try 46 | { 47 | return regAsm.UnregisterAssembly(asm); 48 | } 49 | catch (Exception e) 50 | { 51 | MessageBox.Show(e.Message, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); 52 | Console.WriteLine(e.ToString()); 53 | return false; 54 | } 55 | } 56 | 57 | /*public static string GetRegisteredDllPath(Guid guid) 58 | { 59 | var key = Registry.ClassesRoot.OpenSubKey(@"CLSID\{" + guid.ToString().ToUpper() + "}"); 60 | 61 | return string.Empty; 62 | }*/ 63 | 64 | /// 65 | /// Check if the DLL is regitered. 66 | /// 67 | /// DLL file name. 68 | /// If the DLL is regitered. 69 | public static bool IsRegistered(string dllName) => Registry.ClassesRoot.OpenSubKey(Path.GetFileNameWithoutExtension(dllName)) != null; 70 | 71 | /// 72 | /// Check if the DLL is regsitered. 73 | /// If the key is not found uncheck "Prefered 32bits" in build option. 74 | /// 75 | /// GUID of the dll. 76 | /// If the DLL is regitered. 77 | public static bool IsRegistered(Guid guid) => Registry.ClassesRoot.OpenSubKey(@"CLSID\{" + guid.ToString().ToUpper() + "}") != null; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /MediaControls.Installer/ExplorerManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace MediaControls.Installer 10 | { 11 | class ExplorerManager 12 | { 13 | [DllImport("user32.dll", SetLastError = true)] 14 | public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); 15 | 16 | [DllImport("user32.dll")] 17 | static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); 18 | 19 | /// 20 | /// Kill the explorer 21 | /// 22 | public static bool Kill() 23 | { 24 | IntPtr hWndTray = FindWindow("Shell_TrayWnd", null); 25 | return PostMessage(hWndTray, 0x5B4, 0, 0); 26 | } 27 | 28 | /// 29 | /// Start the explorer 30 | /// 31 | public static void Start() 32 | { 33 | Process.Start("explorer.exe"); 34 | } 35 | 36 | /// 37 | /// Restart the explorer 38 | /// 39 | public static void RestartExplorer() 40 | { 41 | Kill(); 42 | Start(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /MediaControls.Installer/Installer.cs: -------------------------------------------------------------------------------- 1 | using MediaControls.Installer.Properties; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Windows; 9 | 10 | namespace MediaControls.Installer 11 | { 12 | public class Installer 13 | { 14 | public readonly static string InstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "DeskBand Media Controls"); 15 | 16 | public static DirectoryInfo InstallDirectory => new DirectoryInfo(InstallPath); 17 | 18 | public static Dictionary DLLs = new Dictionary() 19 | { 20 | {"MediaControls.DeskBand.dll", Resources.MediaControls_DLL}, 21 | {"Octokit.dll", Resources.Octokit_DLL}, 22 | }; 23 | 24 | // https://stackoverflow.com/questions/54151880/using-c-sharp-to-check-if-a-file-is-in-use 25 | public static bool IsFileBusy 26 | { 27 | get 28 | { 29 | try 30 | { 31 | foreach (var DLL in DLLs) 32 | { 33 | using Stream stream = new FileStream(Path.Combine(InstallPath, DLL.Key), FileMode.Open, FileAccess.ReadWrite, FileShare.None); 34 | stream.Close(); 35 | stream.Dispose(); 36 | } 37 | return false; 38 | } 39 | catch (IOException) 40 | { 41 | // File is in use 42 | return true; 43 | } 44 | catch (Exception) 45 | { 46 | return false; 47 | } 48 | } 49 | } 50 | 51 | public static bool CanUpdate() 52 | { 53 | try 54 | { 55 | var DLL = DLLs.Keys.First(); 56 | FileVersionInfo CurrentDll = FileVersionInfo.GetVersionInfo(Path.Combine(InstallPath, DLL)); 57 | 58 | //Setup the versions 59 | if (Version.TryParse(CurrentDll.FileVersion, out Version CurrentDLLversion)) 60 | { 61 | Version thisVersion = Assembly.GetExecutingAssembly().GetName().Version; 62 | int versionComparison = CurrentDLLversion.CompareTo(thisVersion); 63 | 64 | return versionComparison < 0; 65 | } 66 | } 67 | catch { } 68 | 69 | return false; 70 | } 71 | 72 | public static bool Install() 73 | { 74 | var installDirectory = InstallDirectory; 75 | 76 | try 77 | { 78 | // Create directory if he doesn't exist 79 | if (!installDirectory.Exists) 80 | installDirectory.Create(); 81 | 82 | foreach(var DLL in DLLs) 83 | File.WriteAllBytes(Path.Combine(InstallPath, DLL.Key), DLL.Value); 84 | 85 | return true; 86 | } 87 | catch (Exception e) 88 | { 89 | MessageBox.Show(e.Message, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); 90 | Console.WriteLine(e.ToString()); 91 | return false; 92 | } 93 | } 94 | 95 | public static bool Uninstall() 96 | { 97 | var installDirectory = InstallDirectory; 98 | 99 | try 100 | { 101 | // Delete the file and delete the folder if empty (We don't want to delete user file) 102 | if (installDirectory.Exists) 103 | { 104 | 105 | foreach (var DLL in DLLs) 106 | { 107 | var dllFile = new FileInfo(Path.Combine(InstallPath, DLL.Key)); 108 | if (dllFile.Exists) 109 | dllFile.Delete(); 110 | } 111 | 112 | // https://stackoverflow.com/questions/755574/how-to-quickly-check-if-folder-is-empty-net 113 | if (!Directory.EnumerateFileSystemEntries(installDirectory.FullName).Any()) 114 | installDirectory.Delete(); 115 | } 116 | 117 | return true; 118 | } 119 | catch (Exception e) 120 | { 121 | MessageBox.Show(e.Message, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); 122 | Console.WriteLine(e.ToString()); 123 | return false; 124 | } 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /MediaControls.Installer/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tom60chat/DeskBand-Media-Controls/25bbd4014af4a21294b19f45bb8dad68814da95d/MediaControls.Installer/Logo.ico -------------------------------------------------------------------------------- /MediaControls.Installer/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |