| Index: Help/Help.vcxproj |
| — | — | @@ -45,6 +45,12 @@ |
| 46 | 46 | <Link>
|
| 47 | 47 | <GenerateDebugInformation>true</GenerateDebugInformation>
|
| 48 | 48 | </Link>
|
| | 49 | + <PostBuildEvent>
|
| | 50 | + <Command>$(OutDir)buildtool.exe makehelp $(ProjectDir)dxgl.hhp</Command>
|
| | 51 | + </PostBuildEvent>
|
| | 52 | + <PostBuildEvent>
|
| | 53 | + <Message>Building help...</Message>
|
| | 54 | + </PostBuildEvent>
|
| 49 | 55 | </ItemDefinitionGroup>
|
| 50 | 56 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
| 51 | 57 | <ClCompile>
|
| Index: buildtool/buildtool.cpp |
| — | — | @@ -66,7 +66,7 @@ |
| 67 | 67 | MB_YESNO|MB_ICONWARNING);
|
| 68 | 68 | if(result == IDYES)
|
| 69 | 69 | {
|
| 70 | | - MessageBoxA(NULL,"Please try again after installing TortoiseSVN.","TortoiseSVN not found",MB_OK|MB_ICONINFORMATION);
|
| | 70 | + cout << "ERROR: Please try again after installing TortoiseSVN." << endl;
|
| 71 | 71 | ShellExecuteA(NULL,"open","http://tortoisesvn.net/",NULL,NULL,SW_SHOWNORMAL);
|
| 72 | 72 | exit(-1);
|
| 73 | 73 | }
|
| — | — | @@ -180,6 +180,51 @@ |
| 181 | 181 | return 0;
|
| 182 | 182 | }
|
| 183 | 183 |
|
| | 184 | +int MakeHelp(char *path)
|
| | 185 | +{
|
| | 186 | + HKEY hKey;
|
| | 187 | + bool foundhhc = false;
|
| | 188 | + char hhcpath[(MAX_PATH+1)*2];
|
| | 189 | + DWORD buffersize = MAX_PATH+1;
|
| | 190 | + if(RegOpenKeyExA(HKEY_CURRENT_USER,"Software\\Microsoft\\HTML Help Workshop",0,KEY_READ,&hKey) == ERROR_SUCCESS)
|
| | 191 | + {
|
| | 192 | + if(RegQueryValueExA(hKey,"InstallDir",NULL,NULL,(LPBYTE)hhcpath,&buffersize) == ERROR_SUCCESS)
|
| | 193 | + {
|
| | 194 | + strcat(hhcpath,"\\hhc.exe");
|
| | 195 | + PROCESS_INFORMATION process;
|
| | 196 | + STARTUPINFOA startinfo;
|
| | 197 | + ZeroMemory(&startinfo,sizeof(STARTUPINFOA));
|
| | 198 | + startinfo.cb = sizeof(STARTUPINFOA);
|
| | 199 | + strcat(hhcpath," ");
|
| | 200 | + strcat(hhcpath,path);
|
| | 201 | + if(CreateProcessA(NULL,hhcpath,NULL,NULL,FALSE,0,NULL,NULL,&startinfo,&process))
|
| | 202 | + {
|
| | 203 | + foundhhc = true;
|
| | 204 | + WaitForSingleObject(process.hProcess,INFINITE);
|
| | 205 | + CloseHandle(process.hProcess);
|
| | 206 | + CloseHandle(process.hThread);
|
| | 207 | + }
|
| | 208 | + }
|
| | 209 | + RegCloseKey(hKey);
|
| | 210 | + }
|
| | 211 | + if(!foundhhc)
|
| | 212 | + {
|
| | 213 | + int result = MessageBoxA(NULL,"Could not find HTML Help Workshop, would you like to download it?","HTML Help Workshop not found",
|
| | 214 | + MB_YESNO|MB_ICONERROR);
|
| | 215 | + if(result == IDYES) ShellExecuteA(NULL,"open","http://tortoisesvn.net/",NULL,NULL,SW_SHOWNORMAL);
|
| | 216 | + cout << "ERROR: HTML Help Compiler not found." << endl;
|
| | 217 | + return -1;
|
| | 218 | + }
|
| | 219 | + return 0;
|
| | 220 | +}
|
| | 221 | +
|
| | 222 | +int MakeInstaller(char *path)
|
| | 223 | +{
|
| | 224 | + // Registry path: HKEY_LOCAL_MACHINE\SOFTWARE\NSIS\(Default)
|
| | 225 | + return 0;
|
| | 226 | +}
|
| | 227 | +
|
| | 228 | +
|
| 184 | 229 | int main(int argc, char *argv[])
|
| 185 | 230 | {
|
| 186 | 231 |
|
| — | — | @@ -196,9 +241,26 @@ |
| 197 | 242 | cout << "ERROR: No working directory specified." << endl;
|
| 198 | 243 | return 1;
|
| 199 | 244 | }
|
| 200 | | - ProcessHeaders(argv[2]);
|
| 201 | | - return 0;
|
| | 245 | + return ProcessHeaders(argv[2]);
|
| 202 | 246 | }
|
| | 247 | + if(!strcmp(argv[1],"makehelp"))
|
| | 248 | + {
|
| | 249 | + if(argc < 3)
|
| | 250 | + {
|
| | 251 | + cout << "ERROR: No working directory specified." << endl;
|
| | 252 | + return 1;
|
| | 253 | + }
|
| | 254 | + return MakeHelp(argv[2]);
|
| | 255 | + }
|
| | 256 | + if(!strcmp(argv[1],"makeinstaller"))
|
| | 257 | + {
|
| | 258 | + if(argc < 3)
|
| | 259 | + {
|
| | 260 | + cout << "ERROR: No working directory specified." << endl;
|
| | 261 | + return 1;
|
| | 262 | + }
|
| | 263 | + return MakeInstaller(argv[2]);
|
| | 264 | + }
|
| 203 | 265 | }
|
| 204 | 266 | else
|
| 205 | 267 | {
|