Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- cls
- goto :begin
- :ArchInstall
- powershell -noprofile -command "wget "https://raw.githubusercontent.com/alwsl/alwsl/master/alwsl.bat" -o C:\alwsl.bat"
- if %ERRORLEVEL%=0 goto :SkipPasterrorwget
- echo ERROR, reattempting to download in 10 seconds
- timeout /t 10
- goto :ArchInstall
- @cmd
- cd C:\
- C:\alwsl.bat install
- C:\alwsl.bat snapshot create
- C:\alwsl.bat snapshot list > C:\ALWSL.snapshots
- bash -c "rm -f /etc/sudoers"
- (
- echo ## sudoers file.
- echo ##
- echo ## This file MUST be edited with the 'visudo' command as root.
- echo ## Failure to use 'visudo' may result in syntax or file permission errors
- echo ## that prevent sudo from running.
- echo ##
- echo ## See the sudoers man page for the details on how to write a sudoers file.
- echo ##
- echo
- echo ##
- echo ## Host alias specification
- echo ##
- echo ## Groups of machines. These may include host names (optionally with wildcards),
- echo ## IP addresses, network numbers or netgroups.
- echo # Host_Alias WEBSERVERS = www1, www2, www3
- echo
- echo ##
- echo ## User alias specification
- echo ##
- echo ## Groups of users. These may consist of user names, uids, Unix groups,
- echo ## or netgroups.
- echo # User_Alias ADMINS = millert, dowdy, mikef
- echo
- echo ##
- echo ## Cmnd alias specification
- echo ##
- echo ## Groups of commands. Often used to group related commands together.
- echo # Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
- echo # /usr/bin/pkill, /usr/bin/top
- echo # Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff
- echo
- echo ##
- echo ## Defaults specification
- echo ##
- echo ## You may wish to keep some of the following environment variables
- echo ## when running commands via sudo.
- echo ##
- echo ## Locale settings
- echo # Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
- echo ##
- echo ## Run X applications through sudo; HOME is used to find the
- echo ## .Xauthority file. Note that other programs use HOME to find
- echo ## configuration files and this may lead to privilege escalation!
- echo # Defaults env_keep += "HOME"
- echo ##
- echo ## X11 resource path settings
- echo # Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
- echo ##
- echo ## Desktop path settings
- echo # Defaults env_keep += "QTDIR KDEDIR"
- echo ##
- echo ## Allow sudo-run commands to inherit the callers' ConsoleKit session
- echo # Defaults env_keep += "XDG_SESSION_COOKIE"
- echo ##
- echo ## Uncomment to enable special input methods. Care should be taken as
- echo ## this may allow users to subvert the command being run via sudo.
- echo # Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
- echo ##
- echo ## Uncomment to use a hard-coded PATH instead of the user's to find commands
- echo # Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- echo ##
- echo ## Uncomment to send mail if the user does not enter the correct password.
- echo # Defaults mail_badpass
- echo ##
- echo ## Uncomment to enable logging of a command's output, except for
- echo ## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
- echo # Defaults log_output
- echo # Defaults!/usr/bin/sudoreplay !log_output
- echo # Defaults!/usr/local/bin/sudoreplay !log_output
- echo # Defaults!REBOOT !log_output
- echo
- echo ##
- echo ## Runas alias specification
- echo ##
- echo
- echo ##
- echo ## User privilege specification
- echo ##
- echo root ALL=(ALL) ALL
- echo
- echo ## Uncomment to allow members of group wheel to execute any command
- echo wheel ALL=(ALL) ALL
- echo
- echo ## Same thing without a password
- echo # %wheel ALL=(ALL) NOPASSWD: ALL
- echo
- echo ## Uncomment to allow members of group sudo to execute any command
- echo # %sudo ALL=(ALL) ALL
- echo
- echo ## Uncomment to allow any user to run sudo if they know the password
- echo ## of the user they are running the command as (root by default).
- echo # Defaults targetpw # Ask for the password of the target user
- echo # ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
- echo
- echo ## Read drop-in files from /etc/sudoers.d
- echo ## (the '#' here does not indicate a comment)
- echo #includedir /etc/sudoers.d
- ) > %localappdata%\Lxss\rootfs\etc\sudoers
- :UbuntuInstall
- :begin
- echo Beginning installer
- echo
- timeout /t 1 > nul
- color 0C
- echo /* This program is free software. It comes without any warranty, to
- echo * the extent permitted by applicable law. You can redistribute it
- echo * and/or modify it under the terms of the Do What The Fuck You Want
- echo * To Public License, Version 2, as published by Sam Hocevar. See
- echo * http://sam.zoy.org/wtfpl/COPYING for more details. */
- echo
- echo This batch script
- echo
- echo This program should only work on 64bit Operating Systems,
- echo for a 32bit version contact me on Discord @Adrian#9492
- echo Press a key to continue or (Ctrl + C) to exit
- timeout /t 99999 > nul
- cls
- color 0F
- timeout /t 2 > nul
- echo Hello! Welcome to the installer for the Windows/WSL desktop
- timeout /t 4 > nul
- echo Before you start, I'd like to ask you a few questions...
- echo
- echo
- :choice6
- set /P choice6=Do you just need to configure settings?
- if %choice6%=Y goto :settings
- :choice1
- set /P choice1=Do you want the Arch WSL over the Ubuntu WSL? (Y/N/H) (H means SKIP install of WSL)
- :choice2
- set /P choice2=Have you already downloaded and installed Dexpot? (Y/N)
- :choice3
- set /P choice3=Do you have VcXsrv installed? (Y/N)
- :choice4
- set /P choice4=Do you have a system restore point? (Y/N)
- :choice5
- set /P choice5=Do you have the WSL enabled? (Y/N)
- :installbegin
- if %chocie4%=N
- echo Please make one, I'm not responsible for any losses that might occur
- goto :begin
- if %choice5%=N start https://stackoverflow.com/questions/36352627/how-to-enable-bash-in-windows-10-developer-preview
- echo Please follow the guide opened in your browser. When you're done press any key.
- timeout /t 99999 > nul
- if %choice4%=Y goto :choices
- goto :begin
- :choices
- if %choice2%=N goto :DexpotInstall
- if %choice3%=N goto :VcXsrvInstall
- if %choice1%=Y goto :ArchInstall
- if %choice1%=N goto :UbuntuInstall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement