- Timestamp:
- Oct 2, 2024, 11:33:40 AM (6 weeks ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/install.nsi
r128 r206 27 27 28 28 Page license 29 Page directory 29 30 Page components 30 31 Page instfiles … … 58 59 59 60 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "DisplayName" "Tewi HTTPd" 61 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "InstallDir" '"$INSTDIR"' 60 62 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "UninstallString" '"$INSTDIR\uninstall.exe"' 61 63 -
trunk/Server/main.c
r200 r206 72 72 int startup(int argc, char** argv); 73 73 74 #ifdef __MINGW32__ 75 char* get_registry(const char* main, const char* sub) { 76 DWORD bufsize = 255; 77 char* value = malloc(256); 78 int err = RegGetValue(HKEY_LOCAL_MACHINE, main, sub, RRF_RT_ANY, NULL, (void*)value, &bufsize); 79 if(err == ERROR_SUCCESS) { 80 return value; 81 } else { 82 free(value); 83 return NULL; 84 } 85 } 86 #endif 87 74 88 #ifdef SERVICE 75 89 SERVICE_STATUS status; … … 87 101 88 102 void WINAPI servmain(DWORD argc, LPSTR* argv) { 89 logfile = fopen(PREFIX "/logs/tewi.log", "a"); 103 char* path = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir"); 104 if(path != NULL) { 105 char* lpath = cm_strcat(path, "/logs/tewi.log"); 106 logfile = fopen(lpath, "a"); 107 free(lpath); 108 free(path); 109 } else { 110 logfile = fopen(PREFIX "/logs/tewi.log", "a"); 111 } 90 112 if(logfile == NULL) logfile = stderr; 91 113 status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; … … 662 684 int startup(int argc, char** argv) { 663 685 int i; 686 #ifdef __MINGW32__ 687 char* confpath = cm_strdup(PREFIX "/etc/tewi.conf"); 688 char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir"); 689 if(regpath != NULL) { 690 free(confpath); 691 confpath = cm_strcat(regpath, "/etc/tewi.conf"); 692 free(regpath); 693 } 694 #else 664 695 const char* confpath = PREFIX "/etc/tewi.conf"; 696 #endif 665 697 if(argv != NULL) { 666 698 for(i = 1; i < argc; i++) { -
trunk/Server/tw_version.h
r205 r206 8 8 #endif 9 9 10 #define TW_VERSION "2.03 B\0"10 #define TW_VERSION "2.03C\0" 11 11 12 12 const char* tw_get_version(void); -
trunk/installer.sh
r153 r206 23 23 24 24 make clean || fail 25 make PLATFORM=$1 -j4 || fail25 make PLATFORM=$1 PREFIX=C:/srv/Tewi -j4 || fail 26 26 cp Server/tewi.exe tewi.exe 27 27 make clean || fail 28 make PLATFORM=$1-service -j4 || fail28 make PLATFORM=$1-service -j4 PREFIX=C:/srv/Tewi || fail 29 29 cp Server/tewi.exe tewi-service.exe 30 30 cd Server 31 ../Tool/genconf "C:/ Tewi" modules dll > ../generated.conf31 ../Tool/genconf "C:/srv/Tewi" modules dll > ../generated.conf 32 32 ../Tool/itworks > ../itworks.html 33 33 makensis -DVERSION=$VERSION install.nsi … … 39 39 40 40 make clean || fail 41 make PLATFORM=$1 -j4 || fail41 make PLATFORM=$1 -j4 PREFIX=C:/srv/Tewi|| fail 42 42 cp Server/tewi.exe tewi.exe 43 43 make clean || fail 44 make PLATFORM=$1-service -j4 || fail44 make PLATFORM=$1-service -j4 PREFIX=C:/srv/Tewi || fail 45 45 cp Server/tewi.exe tewi-service.exe 46 46 cd Server 47 ../Tool/genconf "C:/ Tewi" modules dll > ../generated.conf47 ../Tool/genconf "C:/srv/Tewi" modules dll > ../generated.conf 48 48 ../Tool/itworks > ../itworks.html 49 49 makensis -DVERSION=$VERSION install.nsi
Note:
See TracChangeset
for help on using the changeset viewer.