aboutsummaryrefslogtreecommitdiff
path: root/articles
diff options
context:
space:
mode:
authorFuwn <[email protected]>2020-11-07 13:46:26 -0800
committerFuwn <[email protected]>2020-11-07 13:46:26 -0800
commitcd80fefdba1309a5af31cf15b861422c6fd58a4e (patch)
treefa9ef18858f5c9be811fc800dd4401e1e221bed9 /articles
parentfix: readme site link (diff)
downloadblog-cd80fefdba1309a5af31cf15b861422c6fd58a4e.tar.xz
blog-cd80fefdba1309a5af31cf15b861422c6fd58a4e.zip
article: dubugging the installer
Diffstat (limited to 'articles')
-rw-r--r--articles/2020-05-15-debugging-the-installer.md55
1 files changed, 55 insertions, 0 deletions
diff --git a/articles/2020-05-15-debugging-the-installer.md b/articles/2020-05-15-debugging-the-installer.md
new file mode 100644
index 0000000..1f1c1e7
--- /dev/null
+++ b/articles/2020-05-15-debugging-the-installer.md
@@ -0,0 +1,55 @@
+---
+title: Debugging the installer...
+route: /debugging-the-installer
+date: 2020-05-15
+description: Join me, in my <em>long</em> journey of trying to install Luvit.
+---
+
+The backstory; I was bored and at the time I had little experience with Lua besides making plugins for various CS:GO cheats, so, naturally, I thought making a bot for Discord would be a fun exercise. This story includes minor gramatical fixes and changes from the original README, for the full context and GitHub repository visit [here](https://github.com/fuwn/lua-discord-bot-example).
+
+Paraphrasing from the repository's README;
+
+"Usage
+1. Clone repository.
+2. Install Luvit."
+
+Personally, I had some issues during the process of <em>attempting</em> to install Luvit. For whatever reason, when trying to install it via CMD, Powershell, or Bash, all had their fair share of problems. Eventually, the way I ended up installing it is opening the Powershell script which handles the installation process, inspecting what was going on, and manually stepping through it.
+
+First, when looking into the `get-lit.ps1` script which in itself, is the installer, the versions of Luvi and Lit look to be declared in variables, at the time, the versions were **2.10.1** and **3.8.1** respectively, this will come in handy later.
+```ps
+if (test-path env:LUVI_ARCH) {
+ $LUVI_ARCH = $env:LUVI_ARCH
+} else {
+ if ([System.Environment]::Is64BitProcess) {
+ $LUVI_ARCH = "Windows-amd64"
+ } else {
+ $LUVI_ARCH = "Windows-ia32"
+ }
+}
+```
+
+Basically, this is checking for the correct attributable version depending on your operating system. I knew that my system uses the amd46 architecture so I noted that the `$LUVI_ARCH` variable should be equal to `Windows-amd64`.
+
+Then, it looks like a variable is set for Luvi's download URI, it being https://github.com/luvit/luvi/releases/v$LUVI_VERSION/luvi-regular-$LUVI_ARCH.exe. This is where the previously obtained architecture come in handy, so, I just go ahead and replace those and I get the correct download URI which comes out to be https://github.com/luvit/luvi/releases/v2.10.1/luvi/luvi-regular-Windows-amd64.exe. As for the `$LUVI_VERSION`, I just checked the latest release of Luvi on their GitHub
+releases which
+happened to be **2.10.1**.
+
+Directly after that, a variable refereed to as `$LIT_VERSION` is declared, we can get this value from the file name of the latest Lit package, located in the Lit packages web-directory which can be found at https://lit.luvit.io/packages/luvit/lit/ (I got this from some relatively <em>simple</em> snooping around). Now that we know the latest version, which in my case was **3.8.1**, I download the Zip archive of that version; https://lit.luvit.io/packages/luvit/lit/v3.8.1.zip, and unpacked it.
+
+Next a function is created and executed which looks to rename the downloaded Luvi executable and Lit archive, we can just do this manually, here is the order which it was done in;
+1. `luvi-regular-Windows-amd64.exe` is renamed to `luvi.exe`.
+2. `lit-3.8.1.zip` is renamed to `lit.zip`.
+
+Finally, some of the last few steps seem to be performing a couple of Powershell processes, these can be executed manually as well, below is the order they and I performed them in;
+1. `Start-Process ".\luvi.exe" -ArgumentList "lit.zip -- make lit.zip lit.exe luvi.exe" -Wait -NoNewWindow`
+2. `Remove-Item "lit.zip"`
+3. `Start-Process ".\lit.exe" -ArgumentList "make lit://luvit/luvit luvit.exe luvi.exe" -Wait -NoNewWindow`
+
+I only can assume that by now, they have managed to fix this error, as I can't be the only one getting it, on that note, if you would like to install Luvit as well, please visit https://luvit.io/install.html and complete the installation process according to your operating system.
+
+<em>Continuing on the usage steps...;</em>
+3. Add the installed Luvit's binary directory to your PATH
+4. Install the [Discordia]() library via `lit install SinisterRectus/discordia` inside the cloned repository's directory...
+5. Replace the `PUT_TOKEN_HERE` field at the end of the file with your Discord application's bot token.
+6. Run the bot via `luvit bot.lua`.
+7. Have more fun that I did...