From 530f6fbcc3e64c14c837ee71f61c31d91693846f Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 9 Jun 2008 10:21:09 +0000 Subject: [PATCH] support both gui and console flag --- installer/makegui.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/installer/makegui.c b/installer/makegui.c index 6056dff..667ee78 100644 --- a/installer/makegui.c +++ b/installer/makegui.c @@ -23,20 +23,30 @@ int main(int argn, char*argv[]) { + char flag = 2; if(argn<2) { printf("Usage:\n"); - printf("\t%s program.exe\n", argv[0]); + printf("\t%s program.exe [console]\n", argv[0]); return 0; } + if(argn==3) { + if(!strcmp(argv[2], "console")) { + flag = 3; + } + } + FILE*fi = fopen(argv[1], "rb+"); if(!fi) { perror(argv[1]); exit(1); } fseek(fi,220,SEEK_SET); - char two=2; - printf("Setting Win32 GUI flag in %s\n", argv[1]); - fwrite(&two, 1, 1, fi); + if(flag == 2) + printf("Setting Win32 GUI flag in %s\n", argv[1]); + else if(flag == 3) + printf("Setting Win32 Console flag in %s\n", argv[1]); + + fwrite(&flag, 1, 1, fi); fclose(fi); return 0; } -- 1.7.10.4