I add an application to the …\Windows\CurrentVersion\Run\ folder in the registry during an install, and would like to start the application immediately. The first solution would be to start the application manually from within a Visual Basic Script Custom Action, and the second solution would be to force a system reboot. Either would be acceptable. But I can’t seem to figure out how to set the “REBOOT” property to “Force” or to run an application in my Visual Basic script. Any help would be good. Thank you in advance.
paul4
Posts
-
MSI VB Custom Action -
USB notificationI am looking for a way to get Windows to notify my application when a new USB device is attached or detached from the system. The ideal solution would be a callback method of some kind, but a small low overhead polling loop could also work. Thank you.
-
Memory leak detection... the best solution?Oh, and ck_memsize(PTR) should be replaced with _msize(PTR).
-
Memory leak detection... the best solution?I use macros as a wrapper to the malloc, realloc and free functions. This way I can log all my memory allocations to a file, the following is a bit complicated, but works: #define realloc(PTR, SIZE) \ logReallocPtr(PTR, realloc(PTR, SIZE), ck_memsize(PTR), SIZE, __FILE__, #PTR, __LINE__, NULL) #define malloc(SIZE) \ logReallocPtr(NULL, malloc(SIZE), 0, SIZE, __FILE__, #SIZE, __LINE__, NULL) #define free(PTR) \ logReallocPtr(PTR, NULL, ck_memsize(PTR), 0, __FILE__, #PTR, __LINE__, free) // This function gets called for every malloc, realloc and free void *logReallocPtr(void *oldPtr, void *newPtr, size_t oldSize, size_t newSize, const char *file, const char *func, size_t line, void(*_free)(void*)){ char modFile[MAX_PATH]; int i=strlen(file)-1; FILE *out=NULL; if(!oldPtr && !newPtr) return NULL; while(out==NULL) out=fopen("\\debug_alloc.txt", "ab"); strcpy(modFile, file); while(i>=0){ if(modFile[i]==':') modFile[i] = '_'; i--; } if(out){ fprintf(out, "%d:%s:%s:%d:%d:%.8x:%.8x:%d:%d:\r\n", (int)time(NULL), modFile, func, line, getpid(), (size_t)oldPtr, (size_t)newPtr, oldSize, newSize); fclose(out); }else{ fprintf(stderr, "%d:%s:%s:%d:%d:%.8x:%.8x:%d:%d:\r\n", (int)time(NULL), modFile, func, line, getpid(), (size_t)oldPtr, (size_t)newPtr, oldSize, newSize); } if(_free && oldPtr) _free(oldPtr); return newPtr; }