2017-02-18 18:05:08 +00:00
# Windows Setup
2016-12-12 05:03:56 +00:00
2017-09-12 15:26:17 +00:00
* Turn off hibernation
2018-10-05 22:48:22 +00:00
* Open admin cmd prompt: `powercfg.exe /hibernate off`
2017-09-12 15:26:17 +00:00
2020-01-25 07:48:35 +00:00
* Map caps to left-ctrl using sharpkeys
2020-01-25 07:21:42 +00:00
2020-04-20 16:40:45 +00:00
* Run photo_viewer.reg from this folder to restore access to the Windows Photo Viewer app.
The default Win10 photos app is fucking awful.
* You'll need to change the default app for the various image extensions. Don't change gif types
though because photo viewer doesn't support animations.
* Now run disable-are-you-sure-you-want-to-open-with-the-default-program-dialog.reg to stop it
from occasionally asking if you still want to use photo viewer.
2020-02-28 19:11:21 +00:00
* Add custom hosts file
* Run notepad as administrator
* Open C:/Windows/System32/Drivers/etc/hosts
* Add contents of the hosts file from this directory
* Restart PC
2018-03-15 18:37:01 +00:00
2019-09-30 20:49:31 +00:00
* Disable the WinSAT task which is used to figure out your Windows performance score. It eats up
processor time and is generally useless.
* Open task scheduler.
* **note** If you see an error about a selected task {0} no longer existing then you'll need
to repair the task scheduler. See
https://www.thewindowsclub.com/the-selected-task-0-no-longer-exists-error-in-task-scheduler
* Go to `Local` -> `Microsoft` -> `Maintenance` and disable the WinSAT task.
2019-04-02 15:57:58 +00:00
2019-05-13 19:49:58 +00:00
* Setup a symbol server:
* Right-click My Computer -> Properties -> Advanced Tab -> Environment Variables
* Add a new System Variable called `_NT_SYMBOL_PATH`
* Set the value to `SRV*c:\symbols*http://msdl.microsoft.com/download/symbols` , replacing the
first path to where you want the symbols to live.
2019-05-24 17:24:38 +00:00
* Configure crash dump storage location for projects via the registry.
2019-09-30 20:49:31 +00:00
* Enable security updates
*this may no longer be an issue*
* If you don't have an antivirus program, or you do but it's not verified by Microsoft, then you
will not receive security updates unless you set a key in the registry. Note that Windows
Defender counts as a valid antivirus program.
* Add the following registry key:
2018-03-15 18:37:01 +00:00
2019-09-30 20:49:31 +00:00
Key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\QualityCompat"
Value="cadca5fe-87d3-4b96-b7fb-a231484277cc" Type="REG_DWORD”
Data="0x00000000”
2018-03-15 18:37:01 +00:00
2019-11-12 20:07:50 +00:00
* Increase TDR setting for GPU Driver
* TDR determines the length of time that a GPU can hang on a computation until the OS restarts
the driver. By default this is set to a few seconds so you can experience app crashes when
using GPU intensive software, like 3D modeling or texturing. To increase the duration, follow
this guide: https://web.archive.org/web/20191107173337/https://docs.substance3d.com/spdoc/gpu-drivers-crash-with-long-computations-128745489.html
2019-09-30 20:49:31 +00:00
## Windows 7 Stuff
2018-03-15 18:37:01 +00:00
2019-09-30 20:49:31 +00:00
* Enable clear text
* Disable Win 7 Fault Tolerant Heap
* I don't see why you want to spend large amounts of CPU time to hide application instability.
* https://docs.microsoft.com/en-us/windows/desktop/Win7AppQual/fault-tolerant-heap
2020-02-03 23:03:43 +00:00
* Disable on system via regedit: set the REG_DWORD value `HKLM\\Software\\Microsoft\\FTH\\Enabled` to `0` .
## Windows 10 Stuff
* Disable the Windows Customer Experience Improvement program via group policy
https://www.ghacks.net/2016/10/26/turn-off-the-windows-customer-experience-program/
* Install the Windows SDK https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
2019-05-13 19:49:58 +00:00
2020-01-25 07:48:35 +00:00
## Setting up Visual Studio
2020-04-20 16:40:45 +00:00
* Use an install path with no spaces in it `/x/programs/vs15`
* Select custom install and check off the C++ language support.
* Once installed, open Visual Studio and go to `Tools` -> `Options` . Open `Debugging` -> `Symbols`
and add the path to the cached symbols directory that you set up above under `Setup a symbol server` .
* Open the `Visual Studio Layout` folder in this directory and copy the file to `%LOCALAPPDATA%/Microsoft/VisualStudio/{VisualStudioInstanceID}` .
You can now apply the custom layout in VS: `Window -> Apply Window Layout -> Campo`
2020-01-25 07:48:35 +00:00
2019-06-06 16:40:36 +00:00
## Setup up Unix-like Shell
2017-06-09 20:10:25 +00:00
* Install [MSYS2 w/ MinGW-w64 ](http://www.msys2.org/ ) to `C:\msys64`
* Open `C:\msys64\mingw64.exe`
2019-08-03 06:12:51 +00:00
* Run `pacman -Syu` , then restart the terminal and run `pacman -Su` .
2017-08-26 01:45:44 +00:00
* Run `pacman -S base-devel mingw-w64-x86_64-toolchain git bc`
2020-01-06 18:07:39 +00:00
* Use `C:\Users\<user>` as the terminal $HOME by editing `C:\msys64\etc\nsswitch.conf` and
2017-06-09 20:10:25 +00:00
changing the `db_home` value to `windows` .
2017-06-09 23:29:40 +00:00
* You may need to work around an issue with envsubst.exe - you'll know there's a bug if git
2019-06-06 16:40:36 +00:00
displays `not a valid identifier line 89: export: dashless` or rebase complains about `new_count` .
2017-06-09 23:29:40 +00:00
* To patch, cd into `/mingw64/bin` and run `mv envsubst.exe envsubst.exe_backup` . Now run `pacman -S gettext`
and verify that `which envsubst` reports back `/usr/bin/envsubst` .
* Bug report is at https://github.com/Alexpux/MSYS2-packages/issues/735
2020-01-25 07:21:42 +00:00
* Switch to the shell `C:\msys64\msys2.exe` going forward.
2020-01-25 07:48:35 +00:00
* You can also load the shell with a batch file. This allows you to do some setup work, like run `vcvarsall.bat` , eg.
```batch
REM saved as shell-64.bat
@echo off
2020-04-20 16:40:45 +00:00
REM For VS2015:
call "drive:\path-to-vs2015\VC\vcvarsall.bat" x64
REM For VS2017:
REM call "drive:\path-to-vs2017\VC\Auxiliary\Build\vcvarsall.bat" x64
REM For VS2019:
REM call "drive:\path-to-vs2019\VC\Auxiliary\Build\vcvarsall.bat" x64
REM Disable CRT heap debug stuff. See https://preshing.com/20110717/the-windows-heap-is-slow-when-launched-from-the-debugger/
2020-01-25 07:48:35 +00:00
set _NO_DEBUG_HEAP=1
2020-04-20 16:40:45 +00:00
2020-01-25 07:48:35 +00:00
call C:\msys64\msys2_shell.cmd -mingw64 -use-full-path
exit
```
2020-04-20 16:40:45 +00:00
* This will launch a 64-bit env. If you need 32-bit then replace x64 above with x86.
2020-01-25 07:48:35 +00:00
* Now you can make a system32 cmd line shortcut that will be used to launch the batch file. e.g.
2020-04-20 16:40:45 +00:00
* `target:` `%windir%\System32\cmd.exe /k drive:\path-to-bat-file\shell-64.bat`
* `start in:` `drive:\some-path`
2020-05-14 04:36:01 +00:00
* Setup git completions for bash (note: shouldn't have to do this if you ran the install script):
2019-12-31 05:38:46 +00:00
* `curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash`
2017-01-14 03:35:09 +00:00
2020-03-15 18:44:36 +00:00
### 32-bit dev tools
* Load a 32-bit shell
* Install toolchain: `pacman -S mingw-w64-i686-toolchain`
2019-06-06 16:40:36 +00:00
## Setting up dev tools
2017-08-25 04:55:11 +00:00
* Download the Windows 2003 Resource Kit in order to get tools like `list.exe` (command line hex
editor)
* URL: https://www.microsoft.com/en-us/download/details.aspx?id=17657
* Installer will display a compatibility warning. Ignore it.
* Full list of tools can be found here
https://www.technlg.net/windows/download-windows-resource-kit-tools/
2019-09-07 00:18:17 +00:00
## Setting up Vim
### Compiling on Windows (optional)
* Open the shell with `C:\msys64\msys2_shell.cmd` -- If you don't do this then vim will not compile.
* Run `pacman -S --needed base-devel msys2-devel gawk perl python2 python3 ruby libiconv ncurses-devel libcrypt-devel`
2019-09-09 18:10:11 +00:00
* Clone MSYS2 packages: `https://github.com/msys2/MSYS2-packages`
2019-09-07 00:18:17 +00:00
* cd into the vim package
2019-09-09 18:10:11 +00:00
* Edit `PKGBUILD` and change the version number to the one you want to build. You can see the available versions at `https://github.com/vim/vim`
2019-09-07 00:18:17 +00:00
* Run `makepkg`
* If checksums fail then generate new ones: `makepkg -g -f -p PKGBUILD` , copy the output, edit `PKGBUILD` and replace the checksums array with the new values.
2019-09-09 18:10:11 +00:00
* Run `makepkg` again
* If it fails to apply a patch then you'll need to make the fixes yourself:
* Clone vim (`https://github.com/vim/vim`), cd into `vim/src` .
* Modify the file(s) that they failed patch was changing and make the correct fixes.
* Commit the change.
* Generate a patch file with `git diff commitid1 commitid2 > newpatch.patch`
* Copy the patch to `MSYS2-packages/vim` and use the same name as the original patch that failed.
* Regen the pkg checksums and add them to `PKGBUILD` .
* Run `makepkg` again.
2019-11-12 20:07:50 +00:00
2019-09-07 00:18:17 +00:00
* Once built, install it with `pacman -U ${package-name}*.pkg.tar.xz`
2017-01-14 03:35:09 +00:00
2019-03-28 19:27:59 +00:00
### Configuring
2017-04-27 22:40:15 +00:00
2019-08-03 16:47:07 +00:00
1. Open Vim and run `:PlugInstall` to fetch all plugins.
2020-01-06 18:07:39 +00:00
2. Create a tmp folder for swap files (i.e. `set directory` and `set backupdir` ). Place these
at `~/.vimrc.private` so that the main vimrc file can source it. We do it this way so that you
can have a tmp folder path that is specific to your setup.
2017-06-09 20:10:25 +00:00
2019-06-06 16:40:36 +00:00
### Setting up Custom Search
2019-03-28 00:12:43 +00:00
* First install Rusto. See `Setting up Rust` below.
* Setup `ripgrep` :
2020-02-03 23:03:43 +00:00
* Open an `msvc x64` shell and run `cargo install ripgrep` . **Note** the last time I did this
I got linker errors saying that it was trying to link an x86 exe in a 64-bit env. I had to run
the `msvc x86` shell instead.
2019-03-28 00:12:43 +00:00
* Verify it works by running `rg` in a shell.
2017-06-09 20:10:25 +00:00
2019-06-06 16:40:36 +00:00
### Setting up ctags
2019-03-28 19:27:59 +00:00
* Install the latest Universal ctags build: https://github.com/universal-ctags/ctags-win32/releases
* Place it in `~/bin` .
2017-06-09 20:10:25 +00:00
## Setting up Cygwin
* Can create symlinks to dotfiles using the git bash shell. The cygwin home directory
is likely going to be `C:\cygwin\home\<username>` .
* Build [rlwrap ](https://github.com/hanslub42/rlwrap )
2019-03-28 00:12:43 +00:00
## Setting up Rust
* Install `rustup` : https://win.rustup.rs/
## Setting up Go
* Installer: https://golang.org/doc/install
2017-06-09 20:10:25 +00:00
## Setting up Clojure
* Install Lein: https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat
2019-06-06 16:40:36 +00:00
## Setting up Xbox stuff
2017-11-15 16:30:09 +00:00
* Install the xbox controller drivers
* Turn off stats collection
* cmd-r, msconfig.exe, startup tab, uncheck `Microsoft Xbox 360 Accessories` .
## Turn off various startup processes
2019-03-28 19:27:59 +00:00
* cmd-r -> msconfig.exe -> startup tab
2017-06-09 20:10:25 +00:00
2019-11-12 20:07:50 +00:00
## Setting up Wacom tablet
* Install the shitty Wacom driver.
2020-04-20 16:40:45 +00:00
* Preemptively deal with future issues in Photoshop by saving the `PSUserConfig.txt` file
in this directory to `%APPDATA%\Adobe\Adobe Photoshop XX\Adobe Photoshop XX Settings` (should take you to AppData/Roaming)
* In Wacom tablet settings disable anything having to do with Windows Ink.
* These steps are from [FlippedNormals - Fixing All Issues with Your Wacom Tablet and Photoshop ](https://www.youtube.com/watch?v=sGi47EWEkuY )
2019-11-12 20:07:50 +00:00
2019-04-02 15:57:58 +00:00
## Software
2019-12-31 05:38:46 +00:00
* Install `tree` : `pacman -S tree`
2019-11-12 20:07:50 +00:00
* Install [Desktop Restore ](http://www.midiox.com/index.htm?http://midiox.com/desktoprestore.htm )
2019-12-31 05:38:46 +00:00
2019-04-27 15:43:06 +00:00
* Install Android platform tools to get adb.exe:
2019-11-12 20:07:50 +00:00
* Download [Android commandline tools ](https://developer.android.com/studio/#downloads )
2019-04-27 15:43:06 +00:00
* Unzip to some location.
* Inside the sdk dir, run `$ tools/bin/sdkmanager.bat platform-tools` .
* You can now add the platform-tools dir to your path if you want, or just symlink `adb` to `~/bin` .
2019-04-02 15:57:58 +00:00
2019-09-09 18:10:11 +00:00
### Youtube-DL
* In order to combine audio and video files you need ffmpeg. Download from https://ffmpeg.zeranoe.com/builds/
and place the exe's in `~/bin` .
2019-06-06 16:40:36 +00:00
### Firefox
2019-04-02 15:57:58 +00:00
* If you see jaggy fonts then about `about:config` and check the value of
`gfx.font_rendering.cleartype_params.rendering_mode` . Mine was -1 by default. Setting it to 5
removed the bad font rendering.
2019-04-27 15:43:06 +00:00
2020-01-06 18:07:39 +00:00
### Spotify
2020-01-25 07:48:35 +00:00
* If you install an older version then you'll need to block the auto updater:
* Go to `%APPDATA%\Spotify` and create `Spotify_new.exe` and `Spotify_new.exe.sig`
* Set both as read-only. I did this by denying all permissions to the active user account.
2020-01-25 06:12:24 +00:00
* Spotify caches song data in `C:\Users\<user>\AppData\Local\Spotify\Data` and this path cannot be
2020-01-06 18:07:39 +00:00
modified within the app settings. This is an issue if your main drive is an SSD, as you want to
limit the amount of writes to it and you may not have a lot of free space. The simplest way I
found to stop this is to change the `Data` folder's permissions (under the Security tab) and deny
all properties for the user account.