Windows For Developers

Windows is commonly used by developers πŸƒ. While it is less convenient than Linux in some ways, there are some ways to make it suitable for developing software and everything else 🐊.

  • WSL is commonly used to get a Linux console environment
  • Cygwin or mingw are commonly used to get a Linux console environment or to get .exe versions of Linux commands.
  • VSCode or JetBrains are commonly used as editors to write code
  • WAMP is often used to emulate a web server for web development
  • Virtual Box or VMWare are often used to emulate Linux
  • ...

While not specific to Windows, these are often used instead of the Linux command:

➑️ For articles on Windows, check out the Windows Club.


Basic knowledge

Window Path

On Linux, when we write a command such as make, it will look for it in each folder in the PATH and execute the binary if found.

There is the same on Windows. The shortest way to find the menu we are looking for is by writing PATH in the search bar.

Write PATH in the search bar

From it, select environment variables then edit Path in User variables.


Windows Subsystem for Linux (WSL)

Windows Subsystem for Linux (WSL) is a system that allows us to access a Linux CLI interface. It's basically a docker.

Follow the installation instructions here. Basically, open a PowerShell or a CMD as an admin and install any WSL as follows:

PS> wsl -l -o
Ubuntu                                 Ubuntu
Debian                                 Debian GNU/Linux
...
PS> wsl --install Debian
PS> bash # pop a bash shell

You can start it as you would with any program too.

πŸ’‘ You can also download them from the Microsoft Store. Doing so will enable auto-updates for you.

❌ WSL doesn't natively support graphical apps and some commands.


Access WSL files from Windows

You can use the file explorer:

browse_wsl_files

You can also enter the PATH \\wsl.localhost\ or \\wsl$.

Graphical interfaces with XMing

XMing is a low-quality graphical tool. Install it and XMing fonts (scroll to "public domain" to find the download links). To run graphical apps, you will mostly use -c to the commands that support it.

$ subl -c          # sublime text
$ emacs -c         # emacs
$ ./idea.sh -c     # IntelliJ

Common usage of WSL

Most of the time, we integrate WSL within our code environment πŸš€. For instance, when pressing the compile/run button from your IDE, it will compile/run the code using the WSL.


Cygwin

Cygwin is a collection of Unix tools ported to Windows 🐲. It also includes a CLI such as WSL aside from the fact that it only allows us to run installed commands (e.g. there is no APT command...).

  1. Download Cygwin Installer/Updater
  2. Run it, press next
  3. Install from the internet, Next, Next, Next, Next
  4. Pick a mirror in the list, Next
  5. In view, select full
  6. From this point, select the commands that you want by replacing "Skip" (in the column "New") with a version of the command.
  7. Complete the installation

Commands are stored in C:/cygwin64/bin. It should have been added to your path so that you can call, for instance, make or make.exe from any Windows terminal.

$ make -v
# GNU Make 4.3
# ...

➑️ See also: apt-cyg (2.9k ⭐, 2017 πŸͺ¦).


Protocols

Secure Shell (SSH)

Some tools:

File Transfer Protocol (FTP)

FileZilla is commonly used. To add a target server, use the "Site Manager" menu. Drag/Drop files to upload/download them.


InnoSetup

InnoSetup is a tool for creating modern Windows installers. You can download it here 🍬. Simply install and run the software.

Use the Create a new file using the Script wizard wizard. It will generate a .iss with the configuration to generate the installer.

Target folder

Ex: All files will be stored in the app folder.

-Source: "a\path\to\app\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: "a\path\to\app\*"; DestDir: "{app}\app"; Flags: ignoreversion recursesubdirs createallsubdirs

CLI options

PS> file.exe /SILENT      # Only show the progress bar
PS> file.exe /VERYSILENT  # No installer visible
# Add custom options
PS> file.exe /VERYSILENT /MERGETASKS="desktopicon,postinstall"

πŸ‘» To-do πŸ‘»

Stuff that I found, but never read/used yet.

SysInternals

  • procmon (admin required, see _image)
  • strings: similar to Linux strings.
  • tpcView: Windows tcpdump
  • SysInternals Suite: tools. Can be installed or loaded remotely (\\live.sysinternals.com\tools\xxx.exe)
  • ProcMon > Process Monitor Filter > Process Name is xxx.exe then Include
  • Noriben wrapper to procmon but may miss some stuff
C:\> IEX((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
C:\> choco upgrade chocolatey
C:\> choco install docker-desktop
C:\> choco install python vscode git wsl2 openssh openvpn microsoft-windows-terminal WSL2
C:\> Add-MpPreference -ExclusionPath "C:\Users\xxx\AppData\Local\Temp\chocolatey\"