NSIS is very common project for building installer packages. It requires less time to work with NSIS than using WiX or MSI.
It has also certain drawbacks like very weird programming language which resembles assembler mixed with Postscript. Quite scary at first glance. There is remedy for this glitch.
NSIS is good for building installer “container” and it could hand over more complex logic to its plugins like Python plugin.
Original NSIS has another one glitch: no support for unicode. Luckily guys took NSIS and they fixed the issue by creating Unicode NSIS.
Unfortunately unicode version was not able to work with former Python plugin.
It required some effort to fix Python calls from NSIS and voilà Unicode Python plugin is available at github – nsPythonUnicode.
It’s possible to redirect output of PowerShell command into file. E.g.:
Get-ChildItem -Recurse | Select-Object -ExpandProperty FullName >file-list.txt
If you want to open this file-list.txt by vim you may be little bit surprised by unreadable text:
If you open the same file in notepad, then everything is perfectly readable.
There is simple fix for vim suggested by Tony Mechelynck. Just open .vimrc in your home directory and add following lines:
if has('multi_byte') " multibyte features compiled-in
if &encoding !~? '^u' " the OS locale is not Unicode
if &termencoding == '' " empty means 'use &enc'
let &termencoding = &encoding " avoid clobbering keyboard codes
set encoding=utf-8 " we can do it, now that the kb is taken care of
set fileencodings=ucs-bom,utf-8,latin1 " heuristics for existing files
setglobal bomb fileencoding=latin1 " defaults for new files
" 'bomb' doesn't apply to latin1
" it applies when 'fenc' is manually set to Unicode
Deploying Django app to Heroku from Windows machine is little bit tricky.
You can follow instructions in Heroku manual. The first problem that you may encounter is with Postgres support in Python. There is problem with this command:
pip install Django psycopg2 dj-database-url
If you do not have Visual Studio installed on your machine, you’ll receive error that vcvarsall.bat is missing.
Solution is quite easy. You don’t need to install Visaul Studio. Just download binary version of psycopg2 module from http://www.stickpeople.com/projects/python/win-psycopg/
Then you can exclude psycopg2 from pip install command, because it is installed in system directory of Python.
Another tricky issue is with command:
pip freeze >requirements.txt
If you type this command in PowerShell then it will automatically create Unicode file with extra bytes. When you try to deploy project with messed requirements.txt to Herou then you’ll see self explanatory error
TypeError: must be encoded string without NULL bytes, not str
Just open requirements.txt file with notepad and select Save as. In Save as dialog choose ANSI.
Commit file and push project to Heroku. It will work