mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
[windows] get InstallDir from registry, working
This commit is contained in:
parent
35a3b1184d
commit
70bfd825d7
@ -9,15 +9,24 @@
|
||||
#include <stdio.h>
|
||||
|
||||
char* notcurses_data_dir(void){
|
||||
const char key[] = "Software\\Notcurses\\InstallDir";
|
||||
DWORD plen = 0;
|
||||
LSTATUS r = RegGetValueA(HKEY_CURRENT_USER,
|
||||
"Software\\Notcurses"
|
||||
"InstallDir",
|
||||
RRF_RT_REG_SZ, NULL,
|
||||
LSTATUS r = RegGetValueA(HKEY_CURRENT_USER, key,
|
||||
NULL, RRF_RT_REG_SZ, NULL,
|
||||
NULL, &plen);
|
||||
fprintf(stderr, "PLEN: %u\n", plen);
|
||||
// FIXME
|
||||
return NULL;
|
||||
if(r){
|
||||
return NULL;
|
||||
}
|
||||
char* val = malloc(plen + 1);
|
||||
if(val == NULL){
|
||||
return NULL;
|
||||
}
|
||||
r = RegGetValueA(HKEY_CURRENT_USER, key, NULL, RRF_RT_REG_SZ, NULL, val, &plen);
|
||||
if(r){
|
||||
free(val);
|
||||
return NULL;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
char* strndup(const char* str, size_t size){
|
||||
|
@ -25,7 +25,7 @@ Header image = C:\msys64\home\niblack\src\notcurses\doc\icon.png
|
||||
Show Label = 1
|
||||
VisualStylesEnabled = 1
|
||||
[Files]
|
||||
Installation path = <ProgramFiles>\DSSCAW\<AppName>\
|
||||
Installation path = <ProgramFiles>\<AppName>\
|
||||
Autcip = 1
|
||||
[Uninstall]
|
||||
Vwau = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user