├── .gitignore ├── DistroLauncher-Appx ├── Arch.appxmanifest ├── Assets │ ├── LargeTile.scale-100.png │ ├── LargeTile.scale-125.png │ ├── LargeTile.scale-150.png │ ├── LargeTile.scale-200.png │ ├── LargeTile.scale-400.png │ ├── SmallTile.scale-100.png │ ├── SmallTile.scale-125.png │ ├── SmallTile.scale-150.png │ ├── SmallTile.scale-200.png │ ├── SmallTile.scale-400.png │ ├── SplashScreen.scale-100.png │ ├── SplashScreen.scale-125.png │ ├── SplashScreen.scale-150.png │ ├── SplashScreen.scale-200.png │ ├── SplashScreen.scale-400.png │ ├── Square150x150Logo.scale-100.png │ ├── Square150x150Logo.scale-125.png │ ├── Square150x150Logo.scale-150.png │ ├── Square150x150Logo.scale-200.png │ ├── Square150x150Logo.scale-400.png │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ ├── Square44x44Logo.scale-100.png │ ├── Square44x44Logo.scale-125.png │ ├── Square44x44Logo.scale-150.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.scale-400.png │ ├── Square44x44Logo.targetsize-16.png │ ├── Square44x44Logo.targetsize-24.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── Square44x44Logo.targetsize-256.png │ ├── Square44x44Logo.targetsize-32.png │ ├── Square44x44Logo.targetsize-48.png │ ├── StoreLogo.scale-100.png │ ├── StoreLogo.scale-125.png │ ├── StoreLogo.scale-150.png │ ├── StoreLogo.scale-200.png │ ├── StoreLogo.scale-400.png │ ├── Wide310x150Logo.scale-100.png │ ├── Wide310x150Logo.scale-125.png │ ├── Wide310x150Logo.scale-150.png │ ├── Wide310x150Logo.scale-200.png │ └── Wide310x150Logo.scale-400.png ├── DistroLauncher-Appx.vcxproj └── DistroLauncher-Appx.vcxproj.filters ├── DistroLauncher.sln ├── DistroLauncher ├── DistributionInfo.cpp ├── DistributionInfo.h ├── DistroLauncher.cpp ├── DistroLauncher.rc ├── DistroLauncher.vcxproj ├── DistroLauncher.vcxproj.filters ├── Helpers.cpp ├── Helpers.h ├── WslApiLoader.cpp ├── WslApiLoader.h ├── images │ ├── icon.ico │ └── icon.png ├── messages.mc ├── resource.h ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── LICENSE ├── README.md └── build.bat /.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 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | 290 | 291 | 292 | DistroLauncher/MSG*.bin 293 | DistroLauncher/messages.rc 294 | DistroLauncher/messages.h 295 | *.lib 296 | *.dll 297 | *.exe 298 | *.tar.gz -------------------------------------------------------------------------------- /DistroLauncher-Appx/Arch.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Arch Linux 7 | Bilguun 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/LargeTile.scale-100.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/LargeTile.scale-125.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/LargeTile.scale-150.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/LargeTile.scale-200.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/LargeTile.scale-400.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SmallTile.scale-100.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SmallTile.scale-125.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SmallTile.scale-150.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SmallTile.scale-200.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SmallTile.scale-400.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/StoreLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/StoreLogo.scale-125.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/StoreLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/StoreLogo.scale-150.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/StoreLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/StoreLogo.scale-200.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/StoreLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/StoreLogo.scale-400.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher-Appx/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /DistroLauncher-Appx/DistroLauncher-Appx.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {f63472f9-d0a0-412e-aa3d-a4e822970486} 5 | DistroLauncher_Appx 6 | en-US 7 | 14.0 8 | true 9 | Windows Store 10 | 10.0.18362.0 11 | 10.0.18362.0 12 | 10.0 13 | arch 14 | DistroLauncher-Appx 15 | 16 | 17 | 18 | 19 | Debug 20 | ARM64 21 | 22 | 23 | Debug 24 | x64 25 | 26 | 27 | Release 28 | ARM64 29 | 30 | 31 | Release 32 | x64 33 | 34 | 35 | 36 | Application 37 | true 38 | v142 39 | 40 | 41 | Application 42 | true 43 | v141 44 | true 45 | 46 | 47 | Application 48 | false 49 | true 50 | v142 51 | true 52 | 53 | 54 | Application 55 | false 56 | true 57 | v141 58 | true 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | True 78 | Never 79 | x64 80 | False 81 | 0 82 | OnApplicationRun 83 | True 84 | SHA256 85 | True 86 | 0 87 | A249CC32C5D12F48AA6B6419F26516217C2DEA80 88 | 89 | 90 | 91 | false 92 | 93 | 94 | 95 | 96 | 97 | Designer 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | true 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | true 146 | 147 | 148 | 149 | 150 | true 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | Document 165 | false 166 | Copy $(SolutionDir)\$(platform)\$(Configuration)\launcher.exe into $(SolutionDir)\$(platform)\$(Configuration)\$(ProjectName)\$(targetname).exe 167 | copy $(SolutionDir)\$(platform)\$(Configuration)\launcher.exe $(SolutionDir)\$(platform)\$(Configuration)\$(ProjectName)\$(targetname).exe 168 | $(targetname).exe 169 | 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /DistroLauncher-Appx/DistroLauncher-Appx.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | f63472f9-d0a0-412e-aa3d-a4e822970486 6 | 7 | 8 | 3cd39ea5-301d-4878-9d47-b5dbb30f6c95 9 | bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png 10 | 11 | 12 | 13 | 14 | Assets 15 | 16 | 17 | Assets 18 | 19 | 20 | Assets 21 | 22 | 23 | Assets 24 | 25 | 26 | Assets 27 | 28 | 29 | Assets 30 | 31 | 32 | Assets 33 | 34 | 35 | Assets 36 | 37 | 38 | Assets 39 | 40 | 41 | Assets 42 | 43 | 44 | Assets 45 | 46 | 47 | Assets 48 | 49 | 50 | Assets 51 | 52 | 53 | Assets 54 | 55 | 56 | Assets 57 | 58 | 59 | Assets 60 | 61 | 62 | Assets 63 | 64 | 65 | Assets 66 | 67 | 68 | Assets 69 | 70 | 71 | Assets 72 | 73 | 74 | Assets 75 | 76 | 77 | Assets 78 | 79 | 80 | Assets 81 | 82 | 83 | Assets 84 | 85 | 86 | Assets 87 | 88 | 89 | Assets 90 | 91 | 92 | Assets 93 | 94 | 95 | Assets 96 | 97 | 98 | Assets 99 | 100 | 101 | Assets 102 | 103 | 104 | Assets 105 | 106 | 107 | Assets 108 | 109 | 110 | Assets 111 | 112 | 113 | Assets 114 | 115 | 116 | Assets 117 | 118 | 119 | Assets 120 | 121 | 122 | Assets 123 | 124 | 125 | Assets 126 | 127 | 128 | Assets 129 | 130 | 131 | Assets 132 | 133 | 134 | Assets 135 | 136 | 137 | Assets 138 | 139 | 140 | Assets 141 | 142 | 143 | Assets 144 | 145 | 146 | Assets 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /DistroLauncher.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "launcher", "DistroLauncher\DistroLauncher.vcxproj", "{BA627106-E5F7-46EE-B8D7-2D5A760F2FB2}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DistroLauncher-Appx", "DistroLauncher-Appx\DistroLauncher-Appx.vcxproj", "{F63472F9-D0A0-412E-AA3D-A4E822970486}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {BA627106-E5F7-46EE-B8D7-2D5A760F2FB2} = {BA627106-E5F7-46EE-B8D7-2D5A760F2FB2} 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|x64 = Debug|x64 16 | Release|x64 = Release|x64 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {BA627106-E5F7-46EE-B8D7-2D5A760F2FB2}.Debug|x64.ActiveCfg = Debug|x64 20 | {BA627106-E5F7-46EE-B8D7-2D5A760F2FB2}.Debug|x64.Build.0 = Debug|x64 21 | {BA627106-E5F7-46EE-B8D7-2D5A760F2FB2}.Release|x64.ActiveCfg = Release|x64 22 | {BA627106-E5F7-46EE-B8D7-2D5A760F2FB2}.Release|x64.Build.0 = Release|x64 23 | {F63472F9-D0A0-412E-AA3D-A4E822970486}.Debug|x64.ActiveCfg = Debug|x64 24 | {F63472F9-D0A0-412E-AA3D-A4E822970486}.Debug|x64.Build.0 = Debug|x64 25 | {F63472F9-D0A0-412E-AA3D-A4E822970486}.Debug|x64.Deploy.0 = Debug|x64 26 | {F63472F9-D0A0-412E-AA3D-A4E822970486}.Release|x64.ActiveCfg = Release|x64 27 | {F63472F9-D0A0-412E-AA3D-A4E822970486}.Release|x64.Build.0 = Release|x64 28 | {F63472F9-D0A0-412E-AA3D-A4E822970486}.Release|x64.Deploy.0 = Release|x64 29 | EndGlobalSection 30 | GlobalSection(SolutionProperties) = preSolution 31 | HideSolutionNode = FALSE 32 | EndGlobalSection 33 | GlobalSection(ExtensibilityGlobals) = postSolution 34 | SolutionGuid = {1CBEEAE2-D963-465A-A538-A30F8D615037} 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /DistroLauncher/DistributionInfo.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | 6 | #include "stdafx.h" 7 | 8 | bool DistributionInfo::CreateUser(std::wstring_view userName) 9 | { 10 | // Create the user account. 11 | DWORD exitCode; 12 | std::wstring commandLine = L"useradd -m -g users -s /bin/bash "; 13 | commandLine += userName; 14 | HRESULT hr = g_wslApi.WslLaunchInteractive(commandLine.c_str(), true, &exitCode); 15 | if ((FAILED(hr)) || (exitCode != 0)) { 16 | return false; 17 | } 18 | 19 | // Add the user account to any relevant groups. 20 | commandLine = L"usermod -aG wheel,storage,power "; 21 | commandLine += userName; 22 | hr = g_wslApi.WslLaunchInteractive(commandLine.c_str(), true, &exitCode); 23 | if ((FAILED(hr)) || (exitCode != 0)) { 24 | 25 | // Delete the user if the group add command failed. 26 | commandLine = L"/usr/sbin/deluser "; 27 | commandLine += userName; 28 | g_wslApi.WslLaunchInteractive(commandLine.c_str(), true, &exitCode); 29 | return false; 30 | } 31 | 32 | return true; 33 | } 34 | 35 | ULONG DistributionInfo::QueryUid(std::wstring_view userName) 36 | { 37 | // Create a pipe to read the output of the launched process. 38 | HANDLE readPipe; 39 | HANDLE writePipe; 40 | SECURITY_ATTRIBUTES sa{sizeof(sa), nullptr, true}; 41 | ULONG uid = UID_INVALID; 42 | if (CreatePipe(&readPipe, &writePipe, &sa, 0)) { 43 | // Query the UID of the supplied username. 44 | std::wstring command = L"/usr/bin/id -u "; 45 | command += userName; 46 | int returnValue = 0; 47 | HANDLE child; 48 | HRESULT hr = g_wslApi.WslLaunch(command.c_str(), true, GetStdHandle(STD_INPUT_HANDLE), writePipe, GetStdHandle(STD_ERROR_HANDLE), &child); 49 | if (SUCCEEDED(hr)) { 50 | // Wait for the child to exit and ensure process exited successfully. 51 | WaitForSingleObject(child, INFINITE); 52 | DWORD exitCode; 53 | if ((GetExitCodeProcess(child, &exitCode) == false) || (exitCode != 0)) { 54 | hr = E_INVALIDARG; 55 | } 56 | 57 | CloseHandle(child); 58 | if (SUCCEEDED(hr)) { 59 | char buffer[64]; 60 | DWORD bytesRead; 61 | 62 | // Read the output of the command from the pipe and convert to a UID. 63 | if (ReadFile(readPipe, buffer, (sizeof(buffer) - 1), &bytesRead, nullptr)) { 64 | buffer[bytesRead] = ANSI_NULL; 65 | try { 66 | uid = std::stoul(buffer, nullptr, 10); 67 | 68 | } catch( ... ) { } 69 | } 70 | } 71 | } 72 | 73 | CloseHandle(readPipe); 74 | CloseHandle(writePipe); 75 | } 76 | 77 | return uid; 78 | } 79 | -------------------------------------------------------------------------------- /DistroLauncher/DistributionInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | 6 | #pragma once 7 | 8 | namespace DistributionInfo 9 | { 10 | // The name of the distribution. This will be displayed to the user via 11 | // wslconfig.exe and in other places. It must conform to the following 12 | // regular expression: ^[a-zA-Z0-9._-]+$ 13 | // 14 | // WARNING: This value must not change between versions of your app, 15 | // otherwise users upgrading from older versions will see launch failures. 16 | const std::wstring Name = L"Arch_Linux"; 17 | 18 | // The title bar for the console window while the distribution is installing. 19 | const std::wstring WindowTitle = L"Arch Linux"; 20 | 21 | // Create and configure a user account. 22 | bool CreateUser(std::wstring_view userName); 23 | 24 | // Query the UID of the user account. 25 | ULONG QueryUid(std::wstring_view userName); 26 | } -------------------------------------------------------------------------------- /DistroLauncher/DistroLauncher.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | 6 | #include "stdafx.h" 7 | 8 | // Commandline arguments: 9 | #define ARG_CONFIG L"config" 10 | #define ARG_CONFIG_DEFAULT_USER L"--default-user" 11 | #define ARG_INSTALL L"install" 12 | #define ARG_INSTALL_ROOT L"--root" 13 | #define ARG_RUN L"run" 14 | #define ARG_RUN_C L"-c" 15 | 16 | // Helper class for calling WSL Functions: 17 | // https://msdn.microsoft.com/en-us/library/windows/desktop/mt826874(v=vs.85).aspx 18 | WslApiLoader g_wslApi(DistributionInfo::Name); 19 | 20 | static HRESULT InstallDistribution(bool createUser); 21 | static HRESULT SetDefaultUser(std::wstring_view userName); 22 | 23 | HRESULT InstallDistribution(bool createUser) 24 | { 25 | // Register the distribution. 26 | Helpers::PrintMessage(MSG_STATUS_INSTALLING); 27 | HRESULT hr = g_wslApi.WslRegisterDistribution(); 28 | if (FAILED(hr)) { 29 | return hr; 30 | } 31 | 32 | // Delete /etc/resolv.conf to allow WSL to generate a version based on Windows networking information. 33 | DWORD exitCode; 34 | hr = g_wslApi.WslLaunchInteractive(L"/bin/rm /etc/resolv.conf", true, &exitCode); 35 | if (FAILED(hr)) { 36 | return hr; 37 | } 38 | 39 | // Create a user account. 40 | if (createUser) { 41 | Helpers::PrintMessage(MSG_CREATE_USER_PROMPT); 42 | std::wstring userName; 43 | 44 | do { 45 | userName = Helpers::GetUserInput(MSG_ENTER_USERNAME, 32); 46 | 47 | } while (!DistributionInfo::CreateUser(userName)); 48 | 49 | // Set this user account as the default. 50 | hr = SetDefaultUser(userName); 51 | if (FAILED(hr)) { 52 | return hr; 53 | } 54 | } 55 | 56 | return hr; 57 | } 58 | 59 | HRESULT SetDefaultUser(std::wstring_view userName) 60 | { 61 | // Query the UID of the given user name and configure the distribution 62 | // to use this UID as the default. 63 | ULONG uid = DistributionInfo::QueryUid(userName); 64 | if (uid == UID_INVALID) { 65 | return E_INVALIDARG; 66 | } 67 | 68 | HRESULT hr = g_wslApi.WslConfigureDistribution(uid, WSL_DISTRIBUTION_FLAGS_DEFAULT); 69 | if (FAILED(hr)) { 70 | return hr; 71 | } 72 | 73 | return hr; 74 | } 75 | 76 | int wmain(int argc, wchar_t const *argv[]) 77 | { 78 | // Update the title bar of the console window. 79 | SetConsoleTitleW(DistributionInfo::WindowTitle.c_str()); 80 | 81 | // Initialize a vector of arguments. 82 | std::vector arguments; 83 | for (int index = 1; index < argc; index += 1) { 84 | arguments.push_back(argv[index]); 85 | } 86 | 87 | // Ensure that the Windows Subsystem for Linux optional component is installed. 88 | DWORD exitCode = 1; 89 | if (!g_wslApi.WslIsOptionalComponentInstalled()) { 90 | Helpers::PrintMessage(MSG_MISSING_OPTIONAL_COMPONENT); 91 | if (arguments.empty()) { 92 | Helpers::PromptForInput(); 93 | } 94 | 95 | return exitCode; 96 | } 97 | 98 | // Install the distribution if it is not already. 99 | bool installOnly = ((arguments.size() > 0) && (arguments[0] == ARG_INSTALL)); 100 | HRESULT hr = S_OK; 101 | if (!g_wslApi.WslIsDistributionRegistered()) { 102 | 103 | // If the "--root" option is specified, do not create a user account. 104 | bool useRoot = ((installOnly) && (arguments.size() > 1) && (arguments[1] == ARG_INSTALL_ROOT)); 105 | hr = InstallDistribution(!useRoot); 106 | if (FAILED(hr)) { 107 | if (hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)) { 108 | Helpers::PrintMessage(MSG_INSTALL_ALREADY_EXISTS); 109 | } 110 | 111 | } else { 112 | Helpers::PrintMessage(MSG_INSTALL_SUCCESS); 113 | } 114 | 115 | exitCode = SUCCEEDED(hr) ? 0 : 1; 116 | } 117 | 118 | // Parse the command line arguments. 119 | if ((SUCCEEDED(hr)) && (!installOnly)) { 120 | if (arguments.empty()) { 121 | hr = g_wslApi.WslLaunchInteractive(L"", false, &exitCode); 122 | 123 | // Check exitCode to see if wsl.exe returned that it could not start the Linux process 124 | // then prompt users for input so they can view the error message. 125 | if (SUCCEEDED(hr) && exitCode == UINT_MAX) { 126 | Helpers::PromptForInput(); 127 | } 128 | 129 | } else if ((arguments[0] == ARG_RUN) || 130 | (arguments[0] == ARG_RUN_C)) { 131 | 132 | std::wstring command; 133 | for (size_t index = 1; index < arguments.size(); index += 1) { 134 | command += L" "; 135 | command += arguments[index]; 136 | } 137 | 138 | hr = g_wslApi.WslLaunchInteractive(command.c_str(), true, &exitCode); 139 | 140 | } else if (arguments[0] == ARG_CONFIG) { 141 | hr = E_INVALIDARG; 142 | if (arguments.size() == 3) { 143 | if (arguments[1] == ARG_CONFIG_DEFAULT_USER) { 144 | hr = SetDefaultUser(arguments[2]); 145 | } 146 | } 147 | 148 | if (SUCCEEDED(hr)) { 149 | exitCode = 0; 150 | } 151 | 152 | } else { 153 | Helpers::PrintMessage(MSG_USAGE); 154 | return exitCode; 155 | } 156 | } 157 | 158 | // If an error was encountered, print an error message. 159 | if (FAILED(hr)) { 160 | if (hr == HRESULT_FROM_WIN32(ERROR_LINUX_SUBSYSTEM_NOT_PRESENT)) { 161 | Helpers::PrintMessage(MSG_MISSING_OPTIONAL_COMPONENT); 162 | 163 | } else { 164 | Helpers::PrintErrorMessage(hr); 165 | } 166 | 167 | if (arguments.empty()) { 168 | Helpers::PromptForInput(); 169 | } 170 | } 171 | 172 | return SUCCEEDED(hr) ? exitCode : 1; 173 | } 174 | -------------------------------------------------------------------------------- /DistroLauncher/DistroLauncher.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | 21 | #ifdef APSTUDIO_INVOKED 22 | ///////////////////////////////////////////////////////////////////////////// 23 | // 24 | // TEXTINCLUDE 25 | // 26 | 27 | 1 TEXTINCLUDE 28 | BEGIN 29 | "resource.h\0" 30 | END 31 | 32 | 2 TEXTINCLUDE 33 | BEGIN 34 | "#include ""winres.h""\r\n" 35 | "\0" 36 | END 37 | 38 | 3 TEXTINCLUDE 39 | BEGIN 40 | "\r\n" 41 | "\0" 42 | END 43 | 44 | #endif // APSTUDIO_INVOKED 45 | 46 | 47 | ///////////////////////////////////////////////////////////////////////////// 48 | // 49 | // Icon 50 | // 51 | 52 | // Icon with lowest ID value placed first to ensure application icon 53 | // remains consistent on all systems. 54 | IDI_ICON1 ICON ".\images\icon.ico" 55 | 56 | #endif // English (United States) resources 57 | ///////////////////////////////////////////////////////////////////////////// 58 | 59 | 60 | 61 | #ifndef APSTUDIO_INVOKED 62 | ///////////////////////////////////////////////////////////////////////////// 63 | // 64 | // Generated from the TEXTINCLUDE 3 resource. 65 | // 66 | 67 | 68 | ///////////////////////////////////////////////////////////////////////////// 69 | #endif // not APSTUDIO_INVOKED 70 | 71 | #include "messages.rc" 72 | 73 | -------------------------------------------------------------------------------- /DistroLauncher/DistroLauncher.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | ARM64 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | ARM64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {BA627106-E5F7-46EE-B8D7-2D5A760F2FB2} 23 | Win32Proj 24 | DistroLauncher 25 | 10.0.18362.0 26 | launcher 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | true 38 | v141 39 | Unicode 40 | true 41 | 42 | 43 | Application 44 | false 45 | v142 46 | true 47 | Unicode 48 | 49 | 50 | Application 51 | false 52 | v141 53 | true 54 | Unicode 55 | true 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | true 68 | ClCompile 69 | 70 | 71 | 72 | Use 73 | Level3 74 | Disabled 75 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 76 | true 77 | stdcpp17 78 | 79 | 80 | Console 81 | true 82 | onecore.lib; 83 | 84 | 85 | 86 | 87 | Use 88 | Level3 89 | Disabled 90 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 91 | true 92 | stdcpp17 93 | 94 | 95 | Console 96 | true 97 | onecore.lib; 98 | 99 | 100 | 101 | 102 | Level3 103 | Use 104 | MaxSpeed 105 | true 106 | true 107 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 108 | true 109 | stdcpp17 110 | MultiThreaded 111 | --add /std:c++latest %(AdditionalOptions) 112 | 113 | 114 | Console 115 | true 116 | true 117 | true 118 | onecore.lib; 119 | 120 | 121 | 122 | 123 | Level3 124 | Use 125 | MaxSpeed 126 | true 127 | true 128 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 129 | true 130 | stdcpp17 131 | MultiThreaded 132 | 133 | 134 | Console 135 | true 136 | true 137 | true 138 | onecore.lib; 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | Create 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | Document 167 | false 168 | mc %(FullPath) 169 | Compiling Messages... 170 | %(Filename).rc;%(Filename).h;MSG0409.bin 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /DistroLauncher/DistroLauncher.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | 55 | 56 | Resource Files 57 | 58 | 59 | 60 | 61 | Resource Files 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /DistroLauncher/Helpers.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | 6 | #include "stdafx.h" 7 | 8 | namespace { 9 | HRESULT FormatMessageHelperVa(DWORD messageId, va_list vaList, std::wstring* message); 10 | HRESULT PrintMessageVa(DWORD messageId, va_list vaList); 11 | } 12 | 13 | std::wstring Helpers::GetUserInput(DWORD promptMsg, DWORD maxCharacters) 14 | { 15 | Helpers::PrintMessage(promptMsg); 16 | size_t bufferSize = maxCharacters + 1; 17 | std::unique_ptr inputBuffer(new wchar_t[bufferSize]); 18 | std::wstring input; 19 | if (wscanf_s(L"%s", inputBuffer.get(), (unsigned int)bufferSize) == 1) { 20 | input = inputBuffer.get(); 21 | } 22 | 23 | // Throw away any additional chracters that did not fit in the buffer. 24 | wchar_t wch; 25 | do { 26 | wch = getwchar(); 27 | 28 | } while ((wch != L'\n') && (wch != WEOF)); 29 | 30 | return input; 31 | } 32 | 33 | void Helpers::PrintErrorMessage(HRESULT error) 34 | { 35 | PWSTR buffer = nullptr; 36 | ::FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, 37 | nullptr, 38 | error, 39 | 0, 40 | (PWSTR)&buffer, 41 | 0, 42 | nullptr); 43 | 44 | Helpers::PrintMessage(MSG_ERROR_CODE, error, buffer); 45 | if (buffer != nullptr) { 46 | HeapFree(GetProcessHeap(), 0, buffer); 47 | } 48 | 49 | return; 50 | } 51 | 52 | HRESULT Helpers::PrintMessage(DWORD messageId, ...) 53 | { 54 | va_list argList; 55 | va_start(argList, messageId); 56 | HRESULT hr = PrintMessageVa(messageId, argList); 57 | va_end(argList); 58 | return hr; 59 | } 60 | 61 | void Helpers::PromptForInput() 62 | { 63 | Helpers::PrintMessage(MSG_PRESS_A_KEY); 64 | _getwch(); 65 | return; 66 | } 67 | 68 | namespace { 69 | HRESULT FormatMessageHelperVa(DWORD messageId, va_list vaList, std::wstring* message) 70 | { 71 | PWSTR buffer = nullptr; 72 | DWORD written = ::FormatMessageW(FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ALLOCATE_BUFFER, 73 | nullptr, 74 | messageId, 75 | 0, 76 | (PWSTR)&buffer, 77 | 10, 78 | &vaList); 79 | *message = buffer; 80 | if (buffer != nullptr) { 81 | HeapFree(GetProcessHeap(), 0, buffer); 82 | } 83 | 84 | return (written > 0) ? S_OK : HRESULT_FROM_WIN32(GetLastError()); 85 | } 86 | 87 | HRESULT PrintMessageVa(DWORD messageId, va_list vaList) 88 | { 89 | std::wstring message; 90 | HRESULT hr = FormatMessageHelperVa(messageId, vaList, &message); 91 | if (SUCCEEDED(hr)) { 92 | wprintf(L"%ls", message.c_str()); 93 | } 94 | 95 | return hr; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /DistroLauncher/Helpers.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | 6 | #pragma once 7 | 8 | #define UID_INVALID ((ULONG)-1) 9 | 10 | namespace Helpers 11 | { 12 | std::wstring GetUserInput(DWORD promptMsg, DWORD maxCharacters); 13 | void PrintErrorMessage(HRESULT hr); 14 | HRESULT PrintMessage(DWORD messageId, ...); 15 | void PromptForInput(); 16 | } -------------------------------------------------------------------------------- /DistroLauncher/WslApiLoader.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | 6 | #include "stdafx.h" 7 | #include "WslApiLoader.h" 8 | 9 | WslApiLoader::WslApiLoader(const std::wstring& distributionName) : 10 | _distributionName(distributionName) 11 | { 12 | _wslApiDll = LoadLibraryEx(L"wslapi.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); 13 | if (_wslApiDll != nullptr) { 14 | _isDistributionRegistered = (WSL_IS_DISTRIBUTION_REGISTERED)GetProcAddress(_wslApiDll, "WslIsDistributionRegistered"); 15 | _registerDistribution = (WSL_REGISTER_DISTRIBUTION)GetProcAddress(_wslApiDll, "WslRegisterDistribution"); 16 | _configureDistribution = (WSL_CONFIGURE_DISTRIBUTION)GetProcAddress(_wslApiDll, "WslConfigureDistribution"); 17 | _launchInteractive = (WSL_LAUNCH_INTERACTIVE)GetProcAddress(_wslApiDll, "WslLaunchInteractive"); 18 | _launch = (WSL_LAUNCH)GetProcAddress(_wslApiDll, "WslLaunch"); 19 | } 20 | } 21 | 22 | WslApiLoader::~WslApiLoader() 23 | { 24 | if (_wslApiDll != nullptr) { 25 | FreeLibrary(_wslApiDll); 26 | } 27 | } 28 | 29 | BOOL WslApiLoader::WslIsOptionalComponentInstalled() 30 | { 31 | return ((_wslApiDll != nullptr) && 32 | (_isDistributionRegistered != nullptr) && 33 | (_registerDistribution != nullptr) && 34 | (_configureDistribution != nullptr) && 35 | (_launchInteractive != nullptr) && 36 | (_launch != nullptr)); 37 | } 38 | 39 | BOOL WslApiLoader::WslIsDistributionRegistered() 40 | { 41 | return _isDistributionRegistered(_distributionName.c_str()); 42 | } 43 | 44 | HRESULT WslApiLoader::WslRegisterDistribution() 45 | { 46 | HRESULT hr = _registerDistribution(_distributionName.c_str(), L"install.tar.gz"); 47 | if (FAILED(hr)) { 48 | Helpers::PrintMessage(MSG_WSL_REGISTER_DISTRIBUTION_FAILED, hr); 49 | } 50 | 51 | return hr; 52 | } 53 | 54 | HRESULT WslApiLoader::WslConfigureDistribution(ULONG defaultUID, WSL_DISTRIBUTION_FLAGS wslDistributionFlags) 55 | { 56 | HRESULT hr = _configureDistribution(_distributionName.c_str(), defaultUID, wslDistributionFlags); 57 | if (FAILED(hr)) { 58 | Helpers::PrintMessage(MSG_WSL_CONFIGURE_DISTRIBUTION_FAILED, hr); 59 | } 60 | 61 | return hr; 62 | } 63 | 64 | HRESULT WslApiLoader::WslLaunchInteractive(PCWSTR command, BOOL useCurrentWorkingDirectory, DWORD *exitCode) 65 | { 66 | HRESULT hr = _launchInteractive(_distributionName.c_str(), command, useCurrentWorkingDirectory, exitCode); 67 | if (FAILED(hr)) { 68 | Helpers::PrintMessage(MSG_WSL_LAUNCH_INTERACTIVE_FAILED, command, hr); 69 | } 70 | 71 | return hr; 72 | } 73 | 74 | HRESULT WslApiLoader::WslLaunch(PCWSTR command, BOOL useCurrentWorkingDirectory, HANDLE stdIn, HANDLE stdOut, HANDLE stdErr, HANDLE *process) 75 | { 76 | HRESULT hr = _launch(_distributionName.c_str(), command, useCurrentWorkingDirectory, stdIn, stdOut, stdErr, process); 77 | if (FAILED(hr)) { 78 | Helpers::PrintMessage(MSG_WSL_LAUNCH_FAILED, command, hr); 79 | } 80 | 81 | return hr; 82 | } 83 | -------------------------------------------------------------------------------- /DistroLauncher/WslApiLoader.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | 6 | #pragma once 7 | #include 8 | 9 | // This error definition is present in the Spring Creators Update SDK. 10 | #ifndef ERROR_LINUX_SUBSYSTEM_NOT_PRESENT 11 | #define ERROR_LINUX_SUBSYSTEM_NOT_PRESENT 414L 12 | #endif // !ERROR_LINUX_SUBSYSTEM_NOT_PRESENT 13 | 14 | typedef BOOL (STDAPICALLTYPE* WSL_IS_DISTRIBUTION_REGISTERED)(PCWSTR); 15 | typedef HRESULT (STDAPICALLTYPE* WSL_REGISTER_DISTRIBUTION)(PCWSTR, PCWSTR); 16 | typedef HRESULT (STDAPICALLTYPE* WSL_CONFIGURE_DISTRIBUTION)(PCWSTR, ULONG, WSL_DISTRIBUTION_FLAGS); 17 | typedef HRESULT (STDAPICALLTYPE* WSL_GET_DISTRIBUTION_CONFIGURATION)(PCWSTR, ULONG *, ULONG *, WSL_DISTRIBUTION_FLAGS *, PSTR **, ULONG *); 18 | typedef HRESULT (STDAPICALLTYPE* WSL_LAUNCH_INTERACTIVE)(PCWSTR, PCWSTR, BOOL, DWORD *); 19 | typedef HRESULT (STDAPICALLTYPE* WSL_LAUNCH)(PCWSTR, PCWSTR, BOOL, HANDLE, HANDLE, HANDLE, HANDLE *); 20 | 21 | class WslApiLoader 22 | { 23 | public: 24 | WslApiLoader(const std::wstring& distributionName); 25 | ~WslApiLoader(); 26 | 27 | BOOL WslIsOptionalComponentInstalled(); 28 | 29 | BOOL WslIsDistributionRegistered(); 30 | 31 | HRESULT WslRegisterDistribution(); 32 | 33 | HRESULT WslConfigureDistribution(ULONG defaultUID, 34 | WSL_DISTRIBUTION_FLAGS wslDistributionFlags); 35 | 36 | HRESULT WslLaunchInteractive(PCWSTR command, 37 | BOOL useCurrentWorkingDirectory, 38 | DWORD *exitCode); 39 | 40 | HRESULT WslLaunch(PCWSTR command, 41 | BOOL useCurrentWorkingDirectory, 42 | HANDLE stdIn, 43 | HANDLE stdOut, 44 | HANDLE stdErr, 45 | HANDLE *process); 46 | 47 | private: 48 | std::wstring _distributionName; 49 | HMODULE _wslApiDll; 50 | WSL_IS_DISTRIBUTION_REGISTERED _isDistributionRegistered; 51 | WSL_REGISTER_DISTRIBUTION _registerDistribution; 52 | WSL_CONFIGURE_DISTRIBUTION _configureDistribution; 53 | WSL_LAUNCH_INTERACTIVE _launchInteractive; 54 | WSL_LAUNCH _launch; 55 | }; 56 | 57 | extern WslApiLoader g_wslApi; 58 | -------------------------------------------------------------------------------- /DistroLauncher/images/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher/images/icon.ico -------------------------------------------------------------------------------- /DistroLauncher/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bilguun0203/WSL-ArchLinux/0dcdf1a0687175861ec8ed7755fa1fef6fb8619f/DistroLauncher/images/icon.png -------------------------------------------------------------------------------- /DistroLauncher/messages.mc: -------------------------------------------------------------------------------- 1 | LanguageNames = (English=0x409:MSG00409) 2 | 3 | MessageId=1001 SymbolicName=MSG_WSL_REGISTER_DISTRIBUTION_FAILED 4 | Language=English 5 | WslRegisterDistribution failed with error: 0x%1!x! 6 | . 7 | 8 | MessageId=1002 SymbolicName=MSG_WSL_CONFIGURE_DISTRIBUTION_FAILED 9 | Language=English 10 | WslGetDistributionConfiguration failed with error: 0x%1!x! 11 | . 12 | 13 | MessageId=1003 SymbolicName=MSG_WSL_LAUNCH_INTERACTIVE_FAILED 14 | Language=English 15 | WslLaunchInteractive %1 failed with error: 0x%2!x! 16 | . 17 | 18 | MessageId=1004 SymbolicName=MSG_WSL_LAUNCH_FAILED 19 | Language=English 20 | WslLaunch %1 failed with error: 0x%2!x! 21 | . 22 | 23 | MessageId=1005 SymbolicName=MSG_USAGE 24 | Language=English 25 | Launches or configures a Linux distribution. 26 | 27 | Usage: 28 | 29 | Launches the user's default shell in the user's home directory. 30 | 31 | install [--root] 32 | Install the distribuiton and do not launch the shell when complete. 33 | --root 34 | Do not create a user account and leave the default user set to root. 35 | 36 | run 37 | Run the provided command line in the current working directory. If no 38 | command line is provided, the default shell is launched. 39 | 40 | config [setting [value]] 41 | Configure settings for this distribution. 42 | Settings: 43 | --default-user 44 | Sets the default user to . This must be an existing user. 45 | 46 | help 47 | Print usage information. 48 | . 49 | 50 | MessageId=1006 SymbolicName=MSG_STATUS_INSTALLING 51 | Language=English 52 | Installing, this may take a few minutes... 53 | . 54 | 55 | MessageId=1007 SymbolicName=MSG_INSTALL_SUCCESS 56 | Language=English 57 | Installation successful! 58 | . 59 | 60 | MessageId=1008 SymbolicName=MSG_ERROR_CODE 61 | Language=English 62 | Error: 0x%1!x! %2 63 | . 64 | 65 | MessageId=1009 SymbolicName=MSG_ENTER_USERNAME 66 | Language=English 67 | Enter new UNIX username: %0 68 | . 69 | 70 | MessageId=1010 SymbolicName=MSG_CREATE_USER_PROMPT 71 | Language=English 72 | Please create a default UNIX user account. The username does not need to match your Windows username. 73 | For more information visit: https://aka.ms/wslusers 74 | . 75 | 76 | MessageId=1011 SymbolicName=MSG_PRESS_A_KEY 77 | Language=English 78 | Press any key to continue... 79 | . 80 | 81 | MessageId=1012 SymbolicName=MSG_MISSING_OPTIONAL_COMPONENT 82 | Language=English 83 | The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again. 84 | See https://aka.ms/wslinstall for details. 85 | . 86 | 87 | MessageId=1013 SymbolicName=MSG_INSTALL_ALREADY_EXISTS 88 | Language=English 89 | The distribution installation has become corrupted. 90 | Please select Reset from App Settings or uninstall and reinstall the app. 91 | . 92 | -------------------------------------------------------------------------------- /DistroLauncher/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by DistroInstaller.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 103 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /DistroLauncher/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | // stdafx.cpp : source file that includes just the standard includes 6 | // DistroInstaller.pch will be the pre-compiled header 7 | // stdafx.obj will contain the pre-compiled type information 8 | // 9 | 10 | #include "stdafx.h" 11 | 12 | // Reference any additional headers you need in stdafx.h and not in this file. 13 | 14 | -------------------------------------------------------------------------------- /DistroLauncher/stdafx.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) Microsoft. All rights reserved. 3 | // Licensed under the terms described in the LICENSE file in the root of this project. 4 | // 5 | // stdafx.h : include file for standard system include files, 6 | // or project specific include files that are used frequently, but 7 | // are changed infrequently 8 | // 9 | 10 | #pragma once 11 | 12 | #include "targetver.h" 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include "WslApiLoader.h" 29 | #include "Helpers.h" 30 | #include "DistributionInfo.h" 31 | 32 | // Message strings compiled from .MC file. 33 | #include "messages.h" 34 | -------------------------------------------------------------------------------- /DistroLauncher/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WSL ArchLinux 2 | 3 | ## Table of Contents 4 | 1. [Introduction](#introduction) 5 | 2. [Requirements](#requirements) 6 | 3. [Installation](#installation) 7 | 4. [Build and Test](#build-and-test) 8 | 5. [Issues](#issues) 9 | 6. [Contributing](#contributing) 10 | 11 | ## Introduction 12 | This is clone of [WSL-DistroLauncher](https://github.com/Microsoft/WSL-DistroLauncher) and modified to use Arch Linux as a Windows Subsystem for Linux (WSL). You can use this project to create Arch Linux application that can be submitted to the Microsoft Store or sideloaded on your dev machine. Or if you don't want to build it yourself, you can download created package (See [installation](#installation)). 13 | 14 | Read more about WSL-DistroLauncher: [WSL-DistroLauncher](https://github.com/Microsoft/WSL-DistroLauncher). 15 | 16 | Note: This project is written in C++. 17 | 18 | ### Contents 19 | This provides the following functionality: 20 | 21 | * `arch` 22 | - Launch default login shell. 23 | 24 | * `arch run ` 25 | - Run the given command line in that distro, using the default configuration. 26 | - Everything after `run ` is passed to the Linux LaunchProcess call. 27 | 28 | * `arch config [setting [value]]` 29 | - Configure certain settings for this distro. 30 | - Settings are any of the following (by default) 31 | - `--default-user `: Set the default user for this distro 32 | 33 | * `arch help` 34 | - Print the usage. 35 | 36 | ## Requirements 37 | 38 | ### For running and building 39 | 40 | - Windows build 16215 or later 41 | - Enable Windows Subsystem for Linux in Windows Features and Developer Mode in the Settings app. 42 | 43 | ### For building 44 | 45 | - You must have `install.tar.gz` in your root of the project. Download [latest release](https://github.com/bilguun0203/ArchLinuxFS/releases/latest) from [bilguun0203/ArchLinuxFS](https://github.com/bilguun0203/ArchLinuxFS). 46 | 47 | ## Installation 48 | 49 | 0. Check [requirements](#requirements) 50 | 1. Download latest `ArchLinux-Appx_1.0.x.0_x64.zip` from releases. 51 | 2. Extract zip file and run `Add-AppDevPackage.ps1` with powershell 52 | 3. Accept all 53 | 4. When finished select Arch Linux from Start menu or type `arch` on cmd to start 54 | 5. After Installation finished you should enter your username (it can be different from your windows username). 55 | 6. Before use pacman, initialize pacman keyring with following two commands 56 | ``` 57 | $ sudo pacman-key --init 58 | $ sudo pacman-key --populate archlinux 59 | ``` 60 | or if you changed your user to root, use this 61 | ``` 62 | # pacman-key --init 63 | # pacman-key --populate archlinux 64 | ``` 65 | 66 | ## Build and Test 67 | _This section from Microsoft/WSL-DistroLauncher_ 68 | 69 | To help building and testing the DistroLauncher project, we've included the following scripts to automate some tasks. You can either choose to use these scripts from the command line, or work directly in Visual Studio, whatever your preference is. 70 | 71 | So, if I wanted to instead call my distro "TheBestDistroEver", I'd change this to: 72 | ``` xml 73 | 74 | ... 75 | TheBestDistroEver 76 | 77 | ``` 78 | 79 | > Note: **DO NOT** change the ProjectName of the `DistroLauncher/DistroLauncher.vcxproj` from the value `launcher`. Doing so will break the build, as the DistroLauncher-Appx project is looking for the output of this project as `launcher.exe`. 80 | 81 | 6. Update `MyDistro.appxmanifest`. There are several properties that are in the manifest that will need to be updated with your specific values: 82 | 1. Note the `Identity Publisher` value (by default, `"CN=DistroOwner"`). We'll need that for testing the application. 83 | 1. Ensure `` ends in ".exe". This is the command that will be used to launch your distro from the command line and should match the executable name we picked in step 4. 84 | 1. Make sure each of the `Executable` values matches the executable name we picked in step 4. 85 | 86 | 7. Copy your tar.gz containing your distro into the root of the project and rename it to `install.tar.gz`. 87 | 88 | ## Setting up your Windows Environment 89 | You will need a Windows environment to test that your app installs and works as expected. To set up a Windows environment for testing you can follow the steps from the [Windows Dev Center](https://developer.microsoft.com/en-us/windows/downloads/virtual-machines). 90 | 91 | > Note: If you are using Hyper-V you can use the new VM gallery to easily spin up a Windows instance. 92 | 93 | Also, to allow your locally built distro package to be manually side-loaded, ensure you've enabled Developer Mode in the Settings app (sideloading won't work without it). 94 | 95 | ## Build and Test 96 | 97 | To help building and testing the DistroLauncher project, we've included several scripts to automate some tasks. You can either choose to use these scripts from the command line, or work directly in Visual Studio, whatever your preference is. 98 | 99 | > **Note**: some sideloading/deployment steps don't work if you mix and match Visual Studio and the command line for development. If you run into errors while trying to deploy your app after already deploying it once, the easiest step is usually just to uninstall the previously sideloaded version and try again. 100 | 101 | ### Building the Project (Command line): 102 | To compile the project, you can simply type `build` in the root of the project to use MSBuild to build the solution. This is useful for verifying that your application compiles. It will also build an appx for you to sideload on your dev machine for testing. 103 | 104 | > Note: We recommend that you build your launcher from the "Developer Command Prompt for Visual Studio" which can be launched from the start menu. This command-prompt sets up several path and environment variables to make building easier and smoother. 105 | 106 | `build.bat` assumes that MSBuild is installed at one of the following paths: 107 | `%ProgramFiles*%\MSBuild\14.0\bin\msbuild.exe` or 108 | `%ProgramFiles*%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe` or 109 | `%ProgramFiles*%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe`. 110 | 111 | If that's not the case, then you will need to modify that script. 112 | 113 | Once you've completed the build, the packaged appx should be placed in a directory like `WSL-DistroLauncher\x64\Release\DistroLauncher-Appx` and should be named something like `DistroLauncher-Appx_1.0.0.0_x64.appx`. Simply double click that appx file to open the sideloading dialog. 114 | 115 | You can also use the PowerShell cmdlet `Add-AppxPackage` to register your appx: 116 | ``` powershell 117 | powershell Add-AppxPackage x64\Debug\DistroLauncher-Appx\DistroLauncher-Appx_1.0.0.0_x64_Debug.appx 118 | ``` 119 | 120 | ### Building Project (Visual Studio): 121 | 122 | You can also easily build and deploy the distro launcher from Visual Studio. To sideload your appx on your machine for testing, all you need to do is right-click on the "Solution (DistroLauncher)" in the Solution Explorer and click "Deploy Solution". This should build the project and sideload it automatically for testing. 123 | 124 | In order run your solution under the Visual Studio debugger, you will need to copy your install.tar.gz file into your output folder, for example: `x64\Debug`. **NOTE: If you have registered your distribution by this method, you will need to manually unregister it via wslconfig.exe /unregister** 125 | 126 | ### Installing & Testing 127 | You should now have a finished appx sideloaded on your machine for testing. 128 | 129 | To install your distro package, double click on the signed appx and click "Install". Note that this only installs the appx on your system - it doesn't unzip the tar.gz or register the distro yet. 130 | 131 | You should now find your distro in the Start menu, and you can launch your distro by clicking its Start menu tile or executing your distro from the command line by entering its name into a Cmd/PowerShell Console. 132 | 133 | When you first run your newly installed distro, it is unpacked and registered with WSL. This can take a couple of minutes while all your distro files are unpacked and copied to your drive. 134 | 135 | Once complete, you should see a Console window with your distro running inside it. 136 | 137 | ### Publishing 138 | If you are a distro vendor and want to publish your distro to the Windows store, you will need to complete some pre-requisite steps to ensure the quality and integrity of the WSL distro ecosystem, and to safeguard our users: 139 | 140 | #### Publishing Pre-Requisites 141 | 1. Reach out to the WSL team to introduce your distro, yourself, and your team 142 | 1. Agree with the WSL team on a testing and publishing plan 143 | 1. Complete any required paperwork 144 | 1. Sign up for an "Company" Windows Developer Account https://developer.microsoft.com/en-us/store/register. 145 | > Note: This can take a week or more since you'll be required to confirm your organization's identity with an independent verification service via email and/or telephone. 146 | 147 | #### Publishing Code changes 148 | You'll also need to change a few small things in your project to prepare your distro for publishing to the Windows store 149 | 150 | 1. In your appxmanifest, you will need to change the values of the Identity field to match your identity in your Windows Store account: 151 | 152 | ``` xml 153 | 157 | ``` 158 | 159 | > **NOTE**: Visual Studio can update this for you! You can do that by right-clicking on "DistroLauncher-Appx (Universal Windows)" in the solution explorer and clicking on "Store... Associate App with the Store..." and following the wizard. 160 | 161 | ## Issues 162 | Any bugs or problems discovered with the Launcher should be filed in this project's Issues list. If you discovered bugs or problems with ArchLinuxFS, that should be filed in [bilguun0203/ArchLinuxFS](https://github.com/bilguun0203/ArchLinuxFS)'s Issues list. 163 | 164 | ## Contributing 165 | Your are free to contribute. 166 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem Add path to MSBuild Binaries 4 | set MSBUILD=() 5 | if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" ( 6 | set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" 7 | goto :FOUND_MSBUILD 8 | ) 9 | if exist "%ProgramFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" ( 10 | set MSBUILD="%ProgramFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" 11 | goto :FOUND_MSBUILD 12 | ) 13 | if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" ( 14 | set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" 15 | goto :FOUND_MSBUILD 16 | ) 17 | if exist "%ProgramFiles%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" ( 18 | set MSBUILD="%ProgramFiles%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" 19 | goto :FOUND_MSBUILD 20 | ) 21 | if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" ( 22 | set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" 23 | goto :FOUND_MSBUILD 24 | ) 25 | if exist "%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" ( 26 | set MSBUILD="%ProgramFiles%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" 27 | goto :FOUND_MSBUILD 28 | ) 29 | if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\MSBuild.exe" ( 30 | set MSBUILD="%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\MSBuild.exe" 31 | goto :FOUND_MSBUILD 32 | ) 33 | if exist "%ProgramFiles(x86)%\MSBuild\14.0\bin" ( 34 | set MSBUILD="%ProgramFiles(x86)%\MSBuild\14.0\bin\msbuild.exe" 35 | goto :FOUND_MSBUILD 36 | ) 37 | if exist "%ProgramFiles%\MSBuild\14.0\bin" ( 38 | set MSBUILD="%ProgramFiles%\MSBuild\14.0\bin\msbuild.exe" 39 | goto :FOUND_MSBUILD 40 | ) 41 | 42 | if %MSBUILD%==() ( 43 | echo "I couldn't find MSBuild on your PC. Make sure it's installed somewhere, and if it's not in the above if statements (in build.bat), add it." 44 | goto :EXIT 45 | ) 46 | :FOUND_MSBUILD 47 | set _MSBUILD_TARGET=Build 48 | set _MSBUILD_CONFIG=Debug 49 | 50 | :ARGS_LOOP 51 | if (%1) == () goto :POST_ARGS_LOOP 52 | if (%1) == (clean) ( 53 | set _MSBUILD_TARGET=Clean,Build 54 | ) 55 | if (%1) == (rel) ( 56 | set _MSBUILD_CONFIG=Release 57 | ) 58 | shift 59 | goto :ARGS_LOOP 60 | 61 | :POST_ARGS_LOOP 62 | %MSBUILD% %~dp0\DistroLauncher.sln /t:%_MSBUILD_TARGET% /m /nr:true /p:Configuration=%_MSBUILD_CONFIG%;Platform=x64 63 | 64 | if (%ERRORLEVEL%) == (0) ( 65 | echo. 66 | echo Created appx in %~dp0x64\%_MSBUILD_CONFIG%\DistroLauncher-Appx\ 67 | echo. 68 | ) 69 | 70 | :EXIT 71 | --------------------------------------------------------------------------------