mingw C program with setup in its name won't run (windows 7)

若如初见. 提交于 2019-12-11 01:27:04

问题


I've written the classic 3 line "Hello World" in C:

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>

int main(int argc, char **argv)
{
  printf("Hello World!\r\n");
  exit(0);
}

Compile on linux targeting win32:

i686-w64-mingw32-gcc -o helloWorld.exe -g -march=i586 helloWorld.c

Move the hellowWorld.exe to windows 7 machine, runs fine ... Now, I rename it to anything with 'setup' in the name, like hellosetupWorld.exe and UAC fires when I try to run it, and it fails to run even if I answer the UAC popup 'yes it's ok, run it'. Later I get a popup asking if my program installed properly.

This seems to be new behavior. Has anyone else seen this? I've tested this on a virgin windows 7 from MSDN in a virtual machine with almost nothing else installed. Same problem.

Heh ... not just mingw. This happens if I compile with visual studio at the command line, like cl Hello.c

I get exactly the same behavior. Put 'setup' somewhere in the name, and the program won't run.

Thanks in advance.

来源:https://stackoverflow.com/questions/23020626/mingw-c-program-with-setup-in-its-name-wont-run-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!