Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.0 KiB

  1. #include <fusenetincludes.h>
  2. HRESULT ProcessOrphanedJobs();
  3. #include "cstrings.h"
  4. #include <versionmanagement.h>
  5. #include "dbglog.h"
  6. void CALLBACK
  7. StartW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow);
  8. void CALLBACK
  9. UninstallW(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow);
  10. HRESULT CreateVersionManagement(
  11. LPVERSION_MANAGEMENT *ppVersionManagement,
  12. DWORD dwFlags);
  13. int __cdecl wmain(int argc, LPWSTR *argv)
  14. {
  15. HRESULT hr = S_OK;
  16. MAKE_ERROR_MACROS_STATIC(hr);
  17. hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
  18. CVersionManagement *pVerMan = NULL;
  19. // hr = ProcessOrphanedJobs();
  20. /*
  21. StartW( NULL, 0, argv[1], 0);
  22. goto exit;
  23. */
  24. /*
  25. CString sCmdLine;
  26. sCmdLine.Assign(L"\"");
  27. sCmdLine.Append(argv[1]); // L"\"\" \"");
  28. sCmdLine.Append(L"\"");
  29. if (FAILED(hr = CreateVersionManagement(&pVerMan, 0)))
  30. goto exit;
  31. if (FAILED(hr = pVerMan->Uninstall(argv[1], argv[2]))) // example input x86_Microsoft.Fusion.ClickOnceTest.URT.SimplePad_144CC461D95B64FF_*_en "C:\Documents and Settings\shyampa\Start Menu\Programs\SimplePad.manifest"
  32. goto exit;
  33. // UninstallW( NULL, 0, sCmdLine._pwz, 0);
  34. goto exit;
  35. */
  36. IAssemblyDownload *pDownload = NULL;
  37. CDebugLog *pDbgLog = NULL;
  38. hr = CreateLogObject(&pDbgLog, NULL);
  39. hr = CreateAssemblyDownload(&pDownload, pDbgLog, 0);
  40. hr = pDownload->DownloadManifestAndDependencies(argv[1], NULL, DOWNLOAD_FLAGS_PROGRESS_UI);
  41. if(FAILED(hr) && (hr != E_ABORT))
  42. {
  43. CString sErrMsg;
  44. hr = pDbgLog->GetLoggedMsgs(0, sErrMsg);
  45. IF_FAILED_EXIT(sErrMsg.Append(L"\r\n Error in file download during TEST. Cannot continue."));
  46. MessageBox(NULL, sErrMsg._pwz, L"Test CliclOnce", 0);
  47. }
  48. DUMPDEBUGLOG(pDbgLog, -1, hr);
  49. SAFERELEASE(pDownload);
  50. goto exit;
  51. exit :
  52. return 0;
  53. }