CONTEXT: SciTE was installed using Chocolatey.
$ choco install -y autoit --version 188.8.131.52
$ choco install -y scite4autoit3 --version 19.102.1901.001
SciTE utilities look for an env variable called
SCITE_USERHOMEand when that is missing will assume a portable installation of SciTE:
Fix, Part 1: Create missing directory
If you are not running as a standard user and have a different account for administration, you might notice that a directory "C:\Users\Administrator\AppData\Local\AutoIt v3\SciTE" was created but not "C:\Users\StandardUser\AppData\Local\AutoIt v3\SciTE"... So the first thing to do is to fix that directory:
cmd /c "mkdir "%UserProfile%\AppData\Local\AutoIt v3\SciTE"
Fix, Part 2: Create user's environment variable
cmd /c "setx SCITE_USERHOME "%UserProfile%\AppData\Local\AutoIt v3\SciTE"
This command is the correct one, and we could stop right here. But out of curiosity, let's see how we could make a dynamic variable.
In order to use REG_EXPAND_SZ type variables, we'd have to use the REG.EXE utility. It takes a little bit of escaping to pass the "percent" characters to the command, but this is how it would look:
cmd /c "REG ADD HKCU\Environment /v SCITE_USERHOME /t REG_EXPAND_SZ /d ^%UserProfile^% & pause"
Missing a persistent environment variable ?
- SetX - Set environment variables - Windows CMD - SS64.com
- Reg - Edit Registry - Windows CMD - SS64.com
- In PowerShell, use the
Registry hives and paths
- User Variables:
- System Variables: