installer.o: installer.c installer.h depack.h archive.h ../lib/os.h
$(CC) -c installer.c -o installer.o
-os.o: ../lib/os.c ../lib/os.h
- $(CC) -c ../lib/os.c -o os.o
-
installer.coff: installer.rc swftools.ico installer.h
$(WINDRES) installer.rc -O coff -F pe-i386 -o installer.coff
-%.exe: %.c installer.o license.o depack.o archive.o depack.h os.o installer.coff Makefile
- $(CC) installer.o depack.o license.o archive.o os.o installer.coff $< -o $@ $(LIBS)
+%.exe: %.c installer.o license.o depack.o archive.o depack.h installer.coff Makefile
+ $(CC) installer.o depack.o license.o archive.o installer.coff $< -o $@ $(LIBS)
$(STRIP) $@
./makegui $@
#upx -9 --best $@ 2>/dev/null || true
-#installer.exe: installer.c depack.o archive.o depack.h crnfiles.o os.o installer.coff Makefile
-# $(CC) installer.c depack.o archive.o crnfiles.o os.o installer.coff -o installer.exe $(LIBS)
+#installer.exe: installer.c depack.o archive.o depack.h crnfiles.o installer.coff Makefile
+# $(CC) installer.c depack.o archive.o crnfiles.o installer.coff -o installer.exe $(LIBS)
# $(STRIP) installer.exe
# #./makegui installer.exe
# #upx -9 --best installer.exe 2>/dev/null || true
#define USER_SETMESSAGE 0x7f01
-void tball(HDC hdc, double px, double py, double sx, double sy)
+static void tball(HDC hdc, double px, double py, double sx, double sy)
{
MoveToEx(hdc, 75.25*sx+px, -32.50*sy+py, 0);
LineTo(hdc, 74.75*sx+px, -24.80*sy+py); LineTo(hdc, 74.95*sx+px, -3.45*sy+py); LineTo(hdc, 75.25*sx+px, -32.50*sy+py);
LineTo(hdc, -25.70*sx+px, 128.45*sy+py); LineTo(hdc, -118.85*sx+px, 143.85*sy+py);
}
+static char* concatPaths(const char*base, const char*add)
+{
+ int l1 = strlen(base);
+ int l2 = strlen(add);
+ int pos = 0;
+ char*n = 0;
+ while(l1 && base[l1-1] == '\\')
+ l1--;
+ while(pos < l2 && add[pos] == '\\')
+ pos++;
+
+ n = (char*)malloc(l1 + (l2-pos) + 2);
+ memcpy(n,base,l1);
+ n[l1]='\\';
+ strcpy(&n[l1+1],&add[pos]);
+ return n;
+}
+
+static int setRegistryEntry(char*key,char*value)
+{
+ HKEY hkey1;
+ HKEY hkey2;
+ int ret1 = -1, ret2= -1;
+ ret1 = RegCreateKey(HKEY_CURRENT_USER, key, &hkey1);
+ if(config_forAllUsers) {
+ ret2 = RegCreateKey(HKEY_LOCAL_MACHINE, key, &hkey2);
+ }
+
+ if(ret1 && ret2) {
+ fprintf(stderr, "registry: CreateKey %s failed\n", key);
+ return 0;
+ }
+ if(!ret1)
+ ret1 = RegSetValue(hkey1, NULL, REG_SZ, value, strlen(value)+1);
+ if(!ret2)
+ ret2 = RegSetValue(hkey2, NULL, REG_SZ, value, strlen(value)+1);
+ if(ret1 && ret2) {
+ fprintf(stderr, "registry: SetValue %s failed\n", key);
+ return 0;
+ }
+ return 1;
+}
+
static HWND wnd_background = 0;
LRESULT CALLBACK WindowFunc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{