diff --git a/Makefile b/Makefile index 3f3e129..4d33653 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -include config.mak -APP_NAME=mlinstall -HOME?=/home/$(USER) -DOWNLOADS?=$(HOME)/Downloads +APP_NAME := mlinstall +#HOME ?= /home/$(USER) +#DOWNLOADS ?= $(HOME)/Downloads -CAMLIB_SRC?=camlib/src +CAMLIB_SRC ?= camlib/src ifndef TARGET $(warning TARGET not defined, assuming Linux) @@ -12,10 +12,10 @@ endif convert_target=$(patsubst %.o,%.$(TARGET).o,$1) -APP_CORE=$(addprefix src/,main.o drive.o installer.o model.o platform.o ptp.o data.o) -CAMLIB_CORE=operations.o packet.o enums.o canon_adv.o data.o enum_dump.o lib.o canon.o ml.o liveview.o bind.o generic.o no_ip.o conv.o +APP_CORE := $(addprefix src/,main.o drive.o installer.o model.o platform.o ptp.o data.o) +CAMLIB_CORE := transport.o operations.o packet.o enums.o data.o enum_dump.o lib.o canon.o liveview.o bind.o ml.o conv.o generic.o canon_adv.o no_ip.o -CFLAGS=-Wall -Wpedantic -I$(CAMLIB_SRC) -I../libui-cross/ -O2 -g +CFLAGS := -Wall -Wpedantic -I$(CAMLIB_SRC) -I../libui-cross/ -O2 -g ifeq ($(TARGET),l) $(info Running Linux build) diff --git a/assets/libui.manifest b/assets/libui.manifest index 3be5a98..4790d06 100644 --- a/assets/libui.manifest +++ b/assets/libui.manifest @@ -1,53 +1,37 @@ - - - - true - - - true - - - UTF-8 - - - + + +Your application description here. + + - + - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/assets/win.rc b/assets/win.rc index 6804f49..ca3bdc7 100644 --- a/assets/win.rc +++ b/assets/win.rc @@ -1,69 +1,5 @@ ID ICON "favicon2.ico" -1 VERSIONINFO -FILEVERSION 1,0,0,0 -PRODUCTVERSION 1,0,0,0 -BEGIN -BLOCK "StringFileInfo" -BEGIN -BLOCK "080904E4" -BEGIN -VALUE "CompanyName", "Daniel Cook" -VALUE "FileDescription", "Utility to help install Magic Lantern" -VALUE "FileVersion", "" -VALUE "InternalName", "mlinstall" -VALUE "LegalCopyright", "GNU General Public License v2.0" -VALUE "OriginalFilename", "mlinstall.exe" -VALUE "ProductName", "ML Install" -VALUE "ProductVersion", "" -END -END -BLOCK "VarFileInfo" -BEGIN -VALUE "Translation", 0x809, 1252 -END -END - -#define UNICODE -#define _UNICODE -#define STRICT -#define STRICT_TYPED_ITEMIDS - -// see https://github.com/golang/go/issues/9916#issuecomment-74812211 -// TODO get rid of this -#define INITGUID - -// for the manifest -#ifndef _UI_STATIC -#define ISOLATION_AWARE_ENABLED 1 -#endif - -// get Windows version right; right now Windows Vista -// unless otherwise stated, all values from Microsoft's sdkddkver.h -// TODO is all of this necessary? how is NTDDI_VERSION used? -// TODO platform update sp2 -#define WINVER 0x0600 /* from Microsoft's winnls.h */ -#define _WIN32_WINNT 0x0600 -#define _WIN32_WINDOWS 0x0600 /* from Microsoft's pdh.h */ -#define _WIN32_IE 0x0700 -#define NTDDI_VERSION 0x06000000 - -// The MinGW-w64 header has an unverified IDWriteTypography definition. -// TODO I can confirm this myself, but I don't know how long it will take for them to note my adjustments... Either way, I have to confirm this myself. -// TODO change the check from _MSC_VER to a MinGW-w64-specific check -// TODO keep track of what else is guarded by this -#ifndef _MSC_VER -#define __MINGW_USE_BROKEN_INTERFACE -#endif - -#include - // this is a UTF-8 file #pragma code_page(65001) - -// this is the Common Controls 6 manifest -// we only define it in a shared build; static builds have to include the appropriate parts of the manifest in the output executable -// LONGTERM set up the string values here -#ifndef _UI_STATIC -ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST "libui.manifest" -#endif +1 24 "libui.manifest" diff --git a/camlib b/camlib index 6b95532..5d19935 160000 --- a/camlib +++ b/camlib @@ -1 +1 @@ -Subproject commit 6b955328173fde1532ca11c017703a94a2b4f4d0 +Subproject commit 5d199352417dc8a7a14c458c9242342efa029f46 diff --git a/src/libui.c b/src/libui.c index b77e9b2..27dcf47 100644 --- a/src/libui.c +++ b/src/libui.c @@ -361,7 +361,7 @@ static void *app_disconnect(void *arg) { int on_closing(uiWindow *w, void *data) { - // TODO: close down threads + // TODO: close down threads and connection uiQuit(); return 1; } diff --git a/src/main.c b/src/main.c index e75e76f..7bba6ab 100644 --- a/src/main.c +++ b/src/main.c @@ -108,7 +108,7 @@ int ptp_connect_init() { return PTP_NO_DEVICE; } #else - // TODO: libWPD doesn't have this yet + // TODO: libWPD doesn't have ptpusb_device_list yet ptp_comm_init(&ptp_runtime); struct PtpDeviceEntry *list = ptpusb_device_list(&ptp_runtime); diff --git a/src/ptp.c b/src/ptp.c index 76e78d0..c3a5024 100644 --- a/src/ptp.c +++ b/src/ptp.c @@ -4,10 +4,10 @@ #include void ptp_verbose_log(char *fmt, ...) { - // va_list args; - // va_start(args, fmt); - // vprintf(fmt, args); - // va_end(args); + //va_list args; + //va_start(args, fmt); + //vprintf(fmt, args); + //va_end(args); } void ptp_panic(char *fmt, ...) { diff --git a/win.mak b/win.mak index fff3aeb..17723f0 100644 --- a/win.mak +++ b/win.mak @@ -16,8 +16,7 @@ win.res: assets/win.rc $(MINGW)-windres assets/win.rc -O coff -o win.res LIBS=-luser32 -lkernel32 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -LIBS+=-lstdc++ -lgcc -static -s -lpthread -lssp -LIBS+=-lurlmon +LIBS+=-lstdc++ -lgcc -static -lpthread -lssp -lurlmon -luuid # Remove cmd window from startup LIBS+=-Wl,-subsystem,windows @@ -25,7 +24,7 @@ LIBS+=-Wl,-subsystem,windows windows: mlinstall.exe mlinstall.exe: $(WIN_FILES) win.res win.mak $(LIBWPD_A) $(LIBUI_A) - $(CC) $(WIN_FILES) $(LIBUI_A) $(LIBWPD_A) win.res $(LIBS) -o $(APP_NAME).exe + $(CC) $(WIN_FILES) $(LIBUI_A) $(LIBWPD_A) win.res $(LIBS) -s -o $(APP_NAME).exe mlinstall_x86_64.exe: mlinstall.exe cp mlinstall.exe mlinstall_x86_64.exe