Changeset 208 in Main
- Timestamp:
- Oct 2, 2024, 11:59:59 AM (6 weeks ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/install.nsi
r206 r208 23 23 LangString WAIT_STOP ${LANG_JAPANESE} "サービスが止まるのを待っています" 24 24 25 !include "x64.nsh" 25 26 !include "LogicLib.nsh" 26 27 !include "Sections.nsh" … … 58 59 CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Uninstall Tewi HTTPd.lnk" "$INSTDIR\uninstall.exe" "" 59 60 61 ${If} ${RunningX64} 62 SetRegView 64 63 ${Else} 64 SetRegView 32 65 ${EndIf} 60 66 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "DisplayName" "Tewi HTTPd" 61 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "InstallDir" '"$INSTDIR"'67 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "InstallDir" "$INSTDIR" 62 68 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "UninstallString" '"$INSTDIR\uninstall.exe"' 63 69 … … 126 132 RMDir /r "$SMPROGRAMS\Tewi HTTPd" 127 133 134 ${If} ${RunningX64} 135 SetRegView 64 136 ${Else} 137 SetRegView 32 138 ${EndIf} 128 139 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" 129 140 SectionEnd -
trunk/Server/main.c
r206 r208 74 74 #ifdef __MINGW32__ 75 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); 76 DWORD bufsize = 512; 77 HKEY handle; 78 char* value = malloc(513); 79 int err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, main, 0, KEY_QUERY_VALUE, &handle); 79 80 if(err == ERROR_SUCCESS) { 81 err = RegQueryValueEx(handle, sub, NULL, NULL, value, &bufsize); 82 if(err != ERROR_SUCCESS) { 83 free(value); 84 RegCloseKey(handle); 85 return NULL; 86 } 87 RegCloseKey(handle); 80 88 return value; 81 89 } else { … … 503 511 504 512 int main(int argc, char** argv) { 513 printf("%s\n", get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir")); 505 514 logfile = stderr; 506 515 #ifdef SERVICE -
trunk/installer.sh
r206 r208 23 23 24 24 make clean || fail 25 make PLATFORM=$1 PREFIX=C:/ srv/Tewi -j4 || fail25 make PLATFORM=$1 PREFIX=C:/Tewi -j4 || fail 26 26 cp Server/tewi.exe tewi.exe 27 27 make clean || fail 28 make PLATFORM=$1-service -j4 PREFIX=C:/ srv/Tewi || fail28 make PLATFORM=$1-service -j4 PREFIX=C:/Tewi || fail 29 29 cp Server/tewi.exe tewi-service.exe 30 30 cd Server 31 ../Tool/genconf "C:/ srv/Tewi" modules dll > ../generated.conf31 ../Tool/genconf "C:/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 PREFIX=C:/ srv/Tewi|| fail41 make PLATFORM=$1 -j4 PREFIX=C:/Tewi|| fail 42 42 cp Server/tewi.exe tewi.exe 43 43 make clean || fail 44 make PLATFORM=$1-service -j4 PREFIX=C:/ srv/Tewi || fail44 make PLATFORM=$1-service -j4 PREFIX=C:/Tewi || fail 45 45 cp Server/tewi.exe tewi-service.exe 46 46 cd Server 47 ../Tool/genconf "C:/ srv/Tewi" modules dll > ../generated.conf47 ../Tool/genconf "C:/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.