Răsfoiți Sursa

added way to install on windows

Noah Vogt 4 ani în urmă
părinte
comite
ae0e4e100d
2 a modificat fișierele cu 66 adăugiri și 2 ștergeri
  1. 10 2
      README.md
  2. 56 0
      win-installer.bat

+ 10 - 2
README.md

@@ -6,7 +6,8 @@ Being able to type your programs on a real keyboard instead of the calculator's
 *Note:* This project is a fork from [pcmattman/tibasic](https://sourceforge.net/projects/tibasic/).
 
 ## Installation
-If you are using Arch Linux, you can just install my [AUR Package](https://aur.archlinux.org/packages/tibasicc-git/) with your prefered aur helper (yay, pacaur, yaourt, etc.):
+#### Unix (GNU/Linux, MacOS, FreeBSD, etc.)
+If you are using Arch, you can just install my [AUR Package](https://aur.archlinux.org/packages/tibasicc-git/) with your prefered aur helper (yay, pacaur, yaourt, etc.):
 
     yay -S tibasicc-git
 
@@ -16,7 +17,14 @@ For other systems, here is my also fairly easy general approach. I have only tes
     cd tibasicc
     sudo make clean install
 
-*Note:* If you are a Windows User, I would recommend using WSL or you can make your own fork of this project, because I haven't made/released a Windows-compatible version yet.
+#### Windows
+If you are a Windows User,  you have to install [git](https://git-scm.com/) (don't forget to add it to your *Path variable* during the setup process) and [MinGW](http://mingw.org/) first. Now open `cmd.exe` with administrator privileges and enter these commands:
+	
+	git clone https://github.com/noahvogt/tibasicc.git
+	cd tibasicc
+	win-installer.bat
+
+Now you have to add the directories specified in the output of the install-script to your *Path variable*. To do this, press the *'Windows Key'* and search for "path". In the window that popped up, click "Environment Variables...". In this window you have to select a *path variable* (you can choose on your own between the system-wide variable and the user-wide variable), click "Edit..." and add them. Now you can open a new terminal window and it should work.
 
 ## Usage
 After installing, this program should be in your `path`. This means, you can call it from the terminal like this:

+ 56 - 0
win-installer.bat

@@ -0,0 +1,56 @@
+@echo off
+
+:: create binary directory if needed
+if not exist "%HOMEDRIVE%\Program Files (x86)\tibasicc\bin" (
+	mkdir "%HOMEDRIVE%\Program Files (x86)\tibasicc\bin" || goto adminError
+	echo folder "%HOMEDRIVE%\Program Files (x86)\tibasicc\bin" has been created.
+)
+:: add g++ to path (only in this session)
+set PATH=%PATH%;C:\MinGW\bin\
+
+
+:: compiling
+echo g++ -g -Wall -pedantic  -c -o src/main.o src/main.cpp
+g++ -g -Wall -pedantic  -c -o src/main.o src/main.cpp || goto compileError
+echo g++ -g -Wall -pedantic   -c -o src/tokens.o src/tokens.cpp
+g++ -g -Wall -pedantic   -c -o src/tokens.o src/tokens.cpp || goto compileError
+echo g++ -g -Wall -pedantic   -c -o src/tibasic.o src/tibasic.cpp
+g++ -g -Wall -pedantic   -c -o src/tibasic.o src/tibasic.cpp || goto compileError
+echo g++ -o tibasicc src/main.o src/tibasic.o src/tokens.o
+g++ -o tibasicc src/main.o src/tibasic.o src/tokens.o
+
+:: move executable to the final directory
+copy tibasicc.exe "%HOMEDRIVE%\Program Files (x86)\tibasicc\bin" || goto unknownError
+
+goto success
+
+:adminError
+echo.
+echo Error: 	TI-Basic could'nt be installed. 
+echo        	Make sure to run this programm with admin privileges.
+echo.
+exit
+
+:compileError
+echo.
+echo Error:		TI-Basic could'nt be installed.
+echo			Compiling with g++ failed. Make sure that it is installed correctly.
+echo.
+exit
+
+:unknownError
+echo.
+echo Error:		TI-Basic could'nt be installed.
+echo			Compiling with g++ failed. Make sure that it is installed correctly.
+echo.
+exit
+
+:success
+echo.
+echo.
+echo.
+echo 	tibasicc has been successfully installed.
+echo 	But now you need to add "%HOMEDRIVE%\MinGW\bin" and "%HOMEDRIVE%\Program Files (x86)\tibasicc\bin"
+echo	........to your Path variable manually (sorry, but this just is how Windows works).
+echo.
+pause