summaryrefslogtreecommitdiff
path: root/scripts/granger/main.lua
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2020-02-16 03:40:06 +0000
committerIronClawTrem <louie.nutman@gmail.com>2020-02-16 03:40:06 +0000
commit425decdf7e9284d15aa726e3ae96b9942fb0e3ea (patch)
tree6c0dd7edfefff1be7b9e75fe0b3a0a85fe1595f3 /scripts/granger/main.lua
parentccb0b2e4d6674a7a00c9bf491f08fc73b6898c54 (diff)
create tremded branch
Diffstat (limited to 'scripts/granger/main.lua')
-rw-r--r--scripts/granger/main.lua63
1 files changed, 63 insertions, 0 deletions
diff --git a/scripts/granger/main.lua b/scripts/granger/main.lua
new file mode 100644
index 0000000..304f45a
--- /dev/null
+++ b/scripts/granger/main.lua
@@ -0,0 +1,63 @@
+--
+-- main.lua
+-- Granger main
+-- Copyright (c) 2016 Jeff Kent <jeff@jkent.net>
+--
+
+require 'scripts/granger/lib'
+
+local install_files = {}
+
+if os.is('windows') then
+ install_files = {
+ "tremulous.exe"
+ "tremded.exe"
+ "granger.exe"
+ "SDL264.dll"
+ "renderer_opengl1.dll"
+ "renderer_opengl2.dll"
+ }
+elseif os.is('linux') then
+ install_files = {
+ "tremulous"
+ "tremded"
+ "granger"
+ "renderer_opengl1.so"
+ "renderer_opengl2.so"
+ }
+elseif os.is('macosx') then
+ install_files = {
+ "tremulous"
+ "tremded"
+ "granger"
+ "libSDL2-2.0.0.dylib"
+ "renderer_opengl1.dylib"
+ "renderer_opengl2.dylib"
+ }
+else
+ os.exit(1)
+end
+
+local dst_dir = path.getdirectory('.')
+local dst_dir = path.getdirectory(_EXE_PATH)
+
+local privs = false
+for file in ipairs(install_files) do
+ local src = path.join(src_dir, file)
+ local dst = path.join(dst_dir, file)
+ if not os.access(dst, 'w') then
+ privs = true
+ end
+end
+
+if privs then
+ os.elevate()
+end
+
+for file in ipairs(install_files) do
+ local src = path.join(src_dir, file)
+ local dst = path.join(dst_dir, file)
+ os.rename(src, dst)
+end
+
+--- Copyright (C) 2015-2019 GrangerHub