From e3ed7e2fac9c96c6c6b49a1b9085cdb4e290f72a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 18 Sep 2016 02:30:35 +1200 Subject: More changes to setup scripts --- setup/package.sh | 37 ++--- setup/traccar.iss | 51 ++++++ setup/traccar.xml | 403 ++++++++++++++++++++++++++++++++++++++++++++++ setup/unix/traccar.xml | 403 ---------------------------------------------- setup/windows/traccar.iss | 41 ----- 5 files changed, 473 insertions(+), 462 deletions(-) create mode 100644 setup/traccar.iss create mode 100644 setup/traccar.xml delete mode 100644 setup/unix/traccar.xml delete mode 100644 setup/windows/traccar.iss diff --git a/setup/package.sh b/setup/package.sh index 41393fa6b..5bbe4bbcf 100755 --- a/setup/package.sh +++ b/setup/package.sh @@ -49,26 +49,27 @@ cleanup () { } copy_wrapper () { - cp yajsw/$1/setenv* out/bin - cp yajsw/$1/wrapper* out/bin - cp yajsw/$1/install* out/bin - cp yajsw/$1/start* out/bin - cp yajsw/$1/stop* out/bin - cp yajsw/$1/uninstall* out/bin + cp yajsw/$1/setenv* out/$1 + cp yajsw/$1/wrapper* out/$1 + cp yajsw/$1/install* out/$1 + cp yajsw/$1/start* out/$1 + cp yajsw/$1/stop* out/$1 + cp yajsw/$1/uninstall* out/$1 - chmod +x out/bin/* + chmod +x out/$1/* cp yajsw/conf/wrapper.conf.default out/conf touch out/conf/wrapper.conf + echo "wrapper.java.command=java" >> out/conf/wrapper.conf echo "wrapper.java.app.jar=tracker-server.jar" >> out/conf/wrapper.conf echo "wrapper.app.parameter.1=./conf/traccar.xml" >> out/conf/wrapper.conf echo "wrapper.java.additional.1=-Dfile.encoding=UTF-8" >> out/conf/wrapper.conf echo "wrapper.logfile=logs/wrapper.log.YYYYMMDD" >> out/conf/wrapper.conf echo "wrapper.logfile.rollmode=DATE" >> out/conf/wrapper.conf - echo "wrapper.ntservice.name=traccar" >> out/conf/wrapper.conf - echo "wrapper.ntservice.displayname=traccar" >> out/conf/wrapper.conf - echo "wrapper.ntservice.description=traccar" >> out/conf/wrapper.conf + echo "wrapper.ntservice.name=Traccar" >> out/conf/wrapper.conf + echo "wrapper.ntservice.displayname=Traccar" >> out/conf/wrapper.conf + echo "wrapper.ntservice.description=Traccar" >> out/conf/wrapper.conf cp -r yajsw/lib/core out/lib rm out/lib/core/ReadMe.txt @@ -86,20 +87,20 @@ copy_files () { cp ../target/lib/* out/lib cp ../schema/* out/schema cp -r ../web/* out/web - cp unix/traccar.xml out/conf + cp traccar.xml out/conf } package_windows () { - mkdir -p out/{bin,conf,data,lib,logs,web,schema,templates} + mkdir -p out/{bat,conf,data,lib,logs,web,schema,templates} copy_wrapper "bat" copy_files - wine app/ISCC.exe windows/traccar.iss + wine app/ISCC.exe traccar.iss - zip -j traccar-windows-$VERSION.zip windows/Output/traccar-setup.exe README.txt + zip -j traccar-windows-$VERSION.zip Output/traccar-setup.exe README.txt - rm -r windows/Output + rm -r Output rm -r tmp rm -r out } @@ -113,9 +114,9 @@ package_unix () { makeself out traccar.run "traccar" "\ if which java &>/dev/null ; \ then \ -if [ $(java -version 2>&1 | grep -i version | sed 's/.*version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') -lt 17 ] ; \ +if [ \$(java -version 2>&1 | grep -i version | sed 's/.*version \"\(.*\)\.\(.*\)\..*\"/\1\2/; 1q') -lt 17 ] ; \ then \ -echo "Java 7 or higher required" ; \ +echo 'Java 7 or higher required' ; \ else \ mkdir -p /opt/traccar ; \ cp -r * /opt/traccar ; \ @@ -123,7 +124,7 @@ chmod -R go+rX /opt/traccar ; \ /opt/traccar/bin/installDaemon.sh ; \ fi ; \ else \ -echo "Java runtime is required" ; \ +echo 'Java runtime is required' ; \ fi" zip -j traccar-linux-$VERSION.zip traccar.run README.txt diff --git a/setup/traccar.iss b/setup/traccar.iss new file mode 100644 index 000000000..6858a1152 --- /dev/null +++ b/setup/traccar.iss @@ -0,0 +1,51 @@ +[Setup] +AppName=Traccar +AppVersion=3.7 +DefaultDirName={pf}\Traccar +AlwaysRestart=yes +OutputBaseFilename=traccar-setup + +[Dirs] +Name: "{app}\bat" +Name: "{app}\conf" +Name: "{app}\data" +Name: "{app}\lib" +Name: "{app}\logs" +Name: "{app}\web" +Name: "{app}\schema" +Name: "{app}\templates" + +[Files] +Source: "out\*"; DestDir: "{app}"; Flags: recursesubdirs + +[Run] +Filename: "{app}\bat\installService.bat" + +[UninstallRun] +Filename: "{app}\bat\uninstallService.bat" + +[Code] +function GetLocalMachine(): Integer; +begin + if IsWin64 then + begin + Result := HKLM64; + end + else + begin + Result := HKEY_LOCAL_MACHINE; + end; +end; + +function InitializeSetup(): Boolean; +begin + if RegKeyExists(GetLocalMachine(), 'SOFTWARE\JavaSoft\Java Runtime Environment') then + begin + Result := true; + end + else + begin + Result := false; + MsgBox('This application requires Java Runtime Environment version 7 or later. Please download and install the JRE and run this setup again. If you have Java installed and still get this error, you need to re-install it from offline installer (for more info see https://www.traccar.org/windows/).', mbCriticalError, MB_OK); + end; +end; diff --git a/setup/traccar.xml b/setup/traccar.xml new file mode 100644 index 000000000..ccdc5b745 --- /dev/null +++ b/setup/traccar.xml @@ -0,0 +1,403 @@ + + + + + + + + + true + 8082 + ./web + + true + google + + true + all + ./logs/tracker-server.log + + true + true + true + true + true + true + true + + + + org.h2.Driver + jdbc:h2:./data/database + sa + + + true + + ./schema/changelog-master.xml + + + SELECT * FROM server; + + + + UPDATE server SET + registration = :registration, + readonly = :readonly, + map = :map, + bingKey = :bingKey, + mapUrl = :mapUrl, + distanceUnit = :distanceUnit, + speedUnit = :speedUnit, + latitude = :latitude, + longitude = :longitude, + zoom = :zoom, + twelveHourFormat = :twelveHourFormat, + attributes = :attributes + WHERE id = :id; + + + + SELECT * FROM users + WHERE email = :email; + + + + SELECT * FROM users + WHERE id = :id; + + + + SELECT * FROM users; + + + + INSERT INTO users (name, email, hashedPassword, salt, admin, map, distanceUnit, speedUnit, latitude, longitude, zoom, twelveHourFormat, attributes) + VALUES (:name, :email, :hashedPassword, :salt, :admin, :map, :distanceUnit, :speedUnit, :latitude, :longitude, :zoom, :twelveHourFormat, :attributes); + + + + UPDATE users SET + name = :name, + email = :email, + admin = :admin, + map = :map, + distanceUnit = :distanceUnit, + speedUnit = :speedUnit, + latitude = :latitude, + longitude = :longitude, + zoom = :zoom, + twelveHourFormat = :twelveHourFormat, + attributes = :attributes + WHERE id = :id; + + + + UPDATE users SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id; + + + + DELETE FROM users WHERE id = :id; + + + + SELECT userId, deviceId FROM user_device; + + + + SELECT userId, groupId FROM user_group; + + + + SELECT * FROM devices; + + + + INSERT INTO devices (name, uniqueId, groupId, attributes) VALUES (:name, :uniqueId, :groupId, :attributes); + + + + UPDATE devices SET name = :name, uniqueId = :uniqueId, groupId = :groupId, attributes = :attributes WHERE id = :id; + + + + UPDATE devices SET lastUpdate = :lastUpdate WHERE id = :id; + + + + DELETE FROM devices WHERE id = :id; + + + + INSERT INTO user_device (userId, deviceId) VALUES (:userId, :deviceId); + + + + DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId; + + + + SELECT * FROM groups; + + + + INSERT INTO groups (name, groupId, attributes) VALUES (:name, :groupId, :attributes); + + + + UPDATE groups SET name = :name, groupId = :groupId, attributes = :attributes WHERE id = :id; + + + + DELETE FROM groups WHERE id = :id; + + + + INSERT INTO user_group (userId, groupId) VALUES (:userId, :groupId); + + + + DELETE FROM user_group WHERE userId = :userId AND groupId = :groupId; + + + + SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime; + + + + INSERT INTO positions (deviceId, protocol, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, attributes) + VALUES (:deviceId, :protocol, :now, :deviceTime, :fixTime, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes); + + + + SELECT * FROM positions WHERE id IN (SELECT positionId FROM devices); + + + + UPDATE devices SET positionId = :id WHERE id = :deviceId; + + + + SELECT * FROM events WHERE id = :id; + + + + INSERT INTO events (type, serverTime, deviceId, positionId, geofenceId, attributes) + VALUES (:type, :serverTime, :deviceId, :positionId, :geofenceId, :attributes); + + + + SELECT * FROM events WHERE deviceId = :deviceId AND type LIKE :type AND serverTime BETWEEN :from AND :to ORDER BY serverTime DESC; + + + + SELECT * FROM geofences + WHERE id = :id; + + + + SELECT * FROM geofences; + + + + INSERT INTO geofences (name, description, area, attributes) + VALUES (:name, :description, :area, :attributes); + + + + UPDATE geofences SET + name = :name, + description = :description, + area = :area, + attributes = :attributes + WHERE id = :id; + + + + DELETE FROM geofences WHERE id = :id; + + + + SELECT userId, geofenceId FROM user_geofence; + + + + INSERT INTO user_geofence (userId, geofenceId) VALUES (:userId, :geofenceId); + + + + DELETE FROM user_geofence WHERE userId = :userId AND geofenceId = :geofenceId; + + + + SELECT groupId, geofenceId FROM group_geofence; + + + + INSERT INTO group_geofence (groupId, geofenceId) VALUES (:groupId, :geofenceId); + + + + DELETE FROM group_geofence WHERE groupId = :groupId AND geofenceId = :geofenceId; + + + + SELECT deviceId, geofenceId FROM device_geofence; + + + + INSERT INTO device_geofence (deviceId, geofenceId) VALUES (:deviceId, :geofenceId); + + + + DELETE FROM device_geofence WHERE deviceId = :deviceId AND geofenceId = :geofenceId; + + + + SELECT * FROM notifications; + + + + INSERT INTO notifications (userId, type, attributes) + VALUES (:userId, :type, :attributes); + + + + UPDATE notifications SET + userId = :userId, + type = :type, + attributes = :attributes + WHERE id = :id; + + + + DELETE FROM notifications WHERE id = :id; + + + + DELETE FROM positions WHERE serverTime < :serverTime AND id NOT IN (SELECT positionId FROM devices); + + + + + 5001 + 5002 + 5003 + 5004 + 5005 + 5006 + false + 5007 + 5008 + 5009 + 5010 + 5011 + 5012 + 5013 + 5014 + 5015 + 5016 + 5017 + 5018 + 5019 + 5020 + 5021 + 5022 + 5023 + 5024 + 5025 + 5026 + 5027 + 5028 + 5029 + 5030 + 5031 + 5032 + 5033 + 5034 + 5035 + 5036 + 5037 + 5038 + 5039 + 5040 + 5041 + 5042 + 5043 + 5044 + 5045 + 5046 + 5047 + 5048 + 5049 + 5050 + 5051 + 5052 + 5053 + 5054 + 5055 + 5056 + 5057 + 5058 + 5059 + 5060 + 5061 + 5062 + 5063 + 5064 + 5065 + 5066 + 5067 + 5068 + 5069 + 5070 + 5071 + 5072 + 5073 + 5074 + 5075 + 5076 + 5077 + 5078 + 5079 + 5080 + 5081 + 5082 + 5083 + 5084 + 5085 + 5086 + 5087 + 5088 + 5089 + 5090 + 5091 + 5092 + 5093 + 5094 + 5095 + 5096 + 5097 + 5098 + 5099 + 5100 + 5101 + 5102 + 5103 + 5104 + 5105 + 5106 + 5107 + 5108 + 5109 + 5110 + 5111 + 5112 + 5113 + 5114 + 5115 + 5116 + 5117 + 5118 + + diff --git a/setup/unix/traccar.xml b/setup/unix/traccar.xml deleted file mode 100644 index a7ead50e5..000000000 --- a/setup/unix/traccar.xml +++ /dev/null @@ -1,403 +0,0 @@ - - - - - - - - - true - 8082 - /opt/traccar/web - - true - google - - true - all - ./logs/tracker-server.log - - true - true - true - true - true - true - true - - - - org.h2.Driver - jdbc:h2:./data/database - sa - - - true - - ./schema/changelog-master.xml - - - SELECT * FROM server; - - - - UPDATE server SET - registration = :registration, - readonly = :readonly, - map = :map, - bingKey = :bingKey, - mapUrl = :mapUrl, - distanceUnit = :distanceUnit, - speedUnit = :speedUnit, - latitude = :latitude, - longitude = :longitude, - zoom = :zoom, - twelveHourFormat = :twelveHourFormat, - attributes = :attributes - WHERE id = :id; - - - - SELECT * FROM users - WHERE email = :email; - - - - SELECT * FROM users - WHERE id = :id; - - - - SELECT * FROM users; - - - - INSERT INTO users (name, email, hashedPassword, salt, admin, map, distanceUnit, speedUnit, latitude, longitude, zoom, twelveHourFormat, attributes) - VALUES (:name, :email, :hashedPassword, :salt, :admin, :map, :distanceUnit, :speedUnit, :latitude, :longitude, :zoom, :twelveHourFormat, :attributes); - - - - UPDATE users SET - name = :name, - email = :email, - admin = :admin, - map = :map, - distanceUnit = :distanceUnit, - speedUnit = :speedUnit, - latitude = :latitude, - longitude = :longitude, - zoom = :zoom, - twelveHourFormat = :twelveHourFormat, - attributes = :attributes - WHERE id = :id; - - - - UPDATE users SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id; - - - - DELETE FROM users WHERE id = :id; - - - - SELECT userId, deviceId FROM user_device; - - - - SELECT userId, groupId FROM user_group; - - - - SELECT * FROM devices; - - - - INSERT INTO devices (name, uniqueId, groupId, attributes) VALUES (:name, :uniqueId, :groupId, :attributes); - - - - UPDATE devices SET name = :name, uniqueId = :uniqueId, groupId = :groupId, attributes = :attributes WHERE id = :id; - - - - UPDATE devices SET lastUpdate = :lastUpdate WHERE id = :id; - - - - DELETE FROM devices WHERE id = :id; - - - - INSERT INTO user_device (userId, deviceId) VALUES (:userId, :deviceId); - - - - DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId; - - - - SELECT * FROM groups; - - - - INSERT INTO groups (name, groupId, attributes) VALUES (:name, :groupId, :attributes); - - - - UPDATE groups SET name = :name, groupId = :groupId, attributes = :attributes WHERE id = :id; - - - - DELETE FROM groups WHERE id = :id; - - - - INSERT INTO user_group (userId, groupId) VALUES (:userId, :groupId); - - - - DELETE FROM user_group WHERE userId = :userId AND groupId = :groupId; - - - - SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime; - - - - INSERT INTO positions (deviceId, protocol, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, attributes) - VALUES (:deviceId, :protocol, :now, :deviceTime, :fixTime, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes); - - - - SELECT * FROM positions WHERE id IN (SELECT positionId FROM devices); - - - - UPDATE devices SET positionId = :id WHERE id = :deviceId; - - - - SELECT * FROM events WHERE id = :id; - - - - INSERT INTO events (type, serverTime, deviceId, positionId, geofenceId, attributes) - VALUES (:type, :serverTime, :deviceId, :positionId, :geofenceId, :attributes); - - - - SELECT * FROM events WHERE deviceId = :deviceId AND type LIKE :type AND serverTime BETWEEN :from AND :to ORDER BY serverTime DESC; - - - - SELECT * FROM geofences - WHERE id = :id; - - - - SELECT * FROM geofences; - - - - INSERT INTO geofences (name, description, area, attributes) - VALUES (:name, :description, :area, :attributes); - - - - UPDATE geofences SET - name = :name, - description = :description, - area = :area, - attributes = :attributes - WHERE id = :id; - - - - DELETE FROM geofences WHERE id = :id; - - - - SELECT userId, geofenceId FROM user_geofence; - - - - INSERT INTO user_geofence (userId, geofenceId) VALUES (:userId, :geofenceId); - - - - DELETE FROM user_geofence WHERE userId = :userId AND geofenceId = :geofenceId; - - - - SELECT groupId, geofenceId FROM group_geofence; - - - - INSERT INTO group_geofence (groupId, geofenceId) VALUES (:groupId, :geofenceId); - - - - DELETE FROM group_geofence WHERE groupId = :groupId AND geofenceId = :geofenceId; - - - - SELECT deviceId, geofenceId FROM device_geofence; - - - - INSERT INTO device_geofence (deviceId, geofenceId) VALUES (:deviceId, :geofenceId); - - - - DELETE FROM device_geofence WHERE deviceId = :deviceId AND geofenceId = :geofenceId; - - - - SELECT * FROM notifications; - - - - INSERT INTO notifications (userId, type, attributes) - VALUES (:userId, :type, :attributes); - - - - UPDATE notifications SET - userId = :userId, - type = :type, - attributes = :attributes - WHERE id = :id; - - - - DELETE FROM notifications WHERE id = :id; - - - - DELETE FROM positions WHERE serverTime < :serverTime AND id NOT IN (SELECT positionId FROM devices); - - - - - 5001 - 5002 - 5003 - 5004 - 5005 - 5006 - false - 5007 - 5008 - 5009 - 5010 - 5011 - 5012 - 5013 - 5014 - 5015 - 5016 - 5017 - 5018 - 5019 - 5020 - 5021 - 5022 - 5023 - 5024 - 5025 - 5026 - 5027 - 5028 - 5029 - 5030 - 5031 - 5032 - 5033 - 5034 - 5035 - 5036 - 5037 - 5038 - 5039 - 5040 - 5041 - 5042 - 5043 - 5044 - 5045 - 5046 - 5047 - 5048 - 5049 - 5050 - 5051 - 5052 - 5053 - 5054 - 5055 - 5056 - 5057 - 5058 - 5059 - 5060 - 5061 - 5062 - 5063 - 5064 - 5065 - 5066 - 5067 - 5068 - 5069 - 5070 - 5071 - 5072 - 5073 - 5074 - 5075 - 5076 - 5077 - 5078 - 5079 - 5080 - 5081 - 5082 - 5083 - 5084 - 5085 - 5086 - 5087 - 5088 - 5089 - 5090 - 5091 - 5092 - 5093 - 5094 - 5095 - 5096 - 5097 - 5098 - 5099 - 5100 - 5101 - 5102 - 5103 - 5104 - 5105 - 5106 - 5107 - 5108 - 5109 - 5110 - 5111 - 5112 - 5113 - 5114 - 5115 - 5116 - 5117 - 5118 - - diff --git a/setup/windows/traccar.iss b/setup/windows/traccar.iss deleted file mode 100644 index 76b176f71..000000000 --- a/setup/windows/traccar.iss +++ /dev/null @@ -1,41 +0,0 @@ -[Setup] -AppName=Traccar -AppVersion=3.7 -DefaultDirName={pf}\Traccar -AlwaysRestart=yes -OutputBaseFilename=traccar-setup - -[Files] -Source: "..\out\*"; DestDir: "{app}"; Flags: recursesubdirs - -[Run] -Filename: "{app}\bin\installService.bat" - -[UninstallRun] -Filename: "{app}\bin\uninstallService.bat" - -[Code] -function GetLocalMachine(): Integer; -begin - if IsWin64 then - begin - Result := HKLM64; - end - else - begin - Result := HKEY_LOCAL_MACHINE; - end; -end; - -function InitializeSetup(): Boolean; -begin - if RegKeyExists(GetLocalMachine(), 'SOFTWARE\JavaSoft\Java Runtime Environment') then - begin - Result := true; - end - else - begin - Result := false; - MsgBox('This application requires Java Runtime Environment version 7 or later. Please download and install the JRE and run this setup again. If you have Java installed and still get this error, you need to re-install it from offline installer (for more info see https://www.traccar.org/windows/).', mbCriticalError, MB_OK); - end; -end; -- cgit v1.2.3