From: Manu <ma...@wa...> - 2004-03-27 17:23:42
|
Earnie Boyd wrote: > The downfall of MinGW Developer Studio is that it is not Open Source!!!! Maybe more cooperation could be done between MinGW and Visual-MinGW. For example, what would you think of a post-install "mingw.bat" generator. <main.c> #include <stdio.h> #include <stdlib.h> #include <io.h> int main() { const char *fname = "mingw.bat"; char dir[_MAX_PATH]; FILE *file; if (!_getcwd(dir, _MAX_PATH)){ perror("Cannot change directory.\n"); return -1; } if (_access("gcc.exe", 0) == -1){ perror("gcc.exe"); return -1; } file = fopen(fname,"w\n"); if (!file){ perror("Cannot open output file.\n"); fclose(file); return -1; } fprintf(file, "@echo off\n"); fprintf(file, "echo --------------------------------------------------------------------------------\n"); fprintf(file, "echo MinGW Box v1.0\n"); fprintf(file, "rem **************************************************************************** \n"); fprintf(file, "rem * Set path environment variable and makefile mode.\n"); fprintf(file, "rem *\n"); fprintf(file, "set PATH=%%PATH%%;\"%s\"\n", dir); fprintf(file, "set DOS=1\n"); fprintf(file, "echo Path variable: %%PATH%%\n"); fprintf(file, "echo Makefile mode: (normal=0, dos=1) %%DOS%%\n"); fprintf(file, "rem ****************************************************************************\n"); fprintf(file, "rem * Find the shell to run.\n"); fprintf(file, "rem *\n"); fprintf(file, "if EXIST Win95Cmd.exe goto WIN95CMD\n"); fprintf(file, "if EXIST cmd.exe goto CMD\n"); fprintf(file, "goto DEFAULT\n"); fprintf(file, ":WIN95CMD\n"); fprintf(file, "set SHELLCMD=Win95Cmd.exe\n"); fprintf(file, "echo Shell: %%SHELLCMD%%\n"); fprintf(file, "echo --------------------------------------------------------------------------------\n"); fprintf(file, "echo Running %%SHELLCMD%%...\n"); fprintf(file, "Win95Cmd.exe /K\n"); fprintf(file, "goto EOF\n"); fprintf(file, ":CMD\n"); fprintf(file, "set SHELLCMD=Running cmd.exe...\n"); fprintf(file, "echo Shell: %%SHELLCMD%%\n"); fprintf(file, "echo\n"); fprintf(file, "echo --------------------------------------------------------------------------------\n"); fprintf(file, "echo %%SHELLCMD%%\n"); fprintf(file, "cmd.exe /K\n"); fprintf(file, "goto EOF\n"); fprintf(file, ":DEFAULT\n"); fprintf(file, "set SHELLCMD=Running default %%COMSPEC%%...\n"); fprintf(file, "echo Shell: %%SHELLCMD%%\n"); fprintf(file, "echo \n"); fprintf(file, "echo --------------------------------------------------------------------------------\n"); fprintf(file, "echo %%SHELLCMD%%\n"); fprintf(file, "%%COMSPEC%% /K\n"); fprintf(file, "goto EOF\n"); fprintf(file, ":EOF\n"); fprintf(file, "echo Terminated\n"); fclose(file); return 0; } </main.c> <setup.iss> ; Inno Setup Script for batch.exe. [Setup] AppName=Test AppVerName=Test 1.0 DefaultDirName={pf}\MinGW OutputBaseFilename=test OutputDir=. UninstallFilesDir={app}\uninstall [Files] Source: "bin\batch.exe"; DestDir: "{app}\bin"; Flags: ignoreversion [Run] Filename: "{app}\bin\batch.exe"; Flags: nowait runhidden skipifsilent [UninstallDelete] Type: dirifempty; Name: "{app}" </setup.iss> Other things: I have ported xfree86 makedepend program to MinGW. What do you think? Manu. |