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.

180 lines
4.8 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. Main.h
  5. Abstract:
  6. Contains constants, function prototypes,
  7. structures, and other items used by
  8. the application.
  9. Notes:
  10. Unicode only - Windows 2000, XP & .NET Server
  11. History:
  12. 01/02/2002 rparsons Created
  13. --*/
  14. #ifndef _AVRFINST_H
  15. #define _AVRFINST_H
  16. #include <nt.h>
  17. #include <ntrtl.h>
  18. #include <nturtl.h>
  19. #include <windows.h>
  20. #include <commctrl.h>
  21. #include <capi.h> // Crypto API functions
  22. #include <wincrypt.h> // Crypto API functions
  23. #include <mscat.h> // Catalog functions
  24. #include <mssip.h> // Catalog functions
  25. #include <stdio.h>
  26. #include <strsafe.h>
  27. #include "resource.h"
  28. //
  29. // Macro to calculate the size of a buffer.
  30. //
  31. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  32. //
  33. // Number of progress bar steps.
  34. //
  35. #define NUM_PB_STEPS 3
  36. //
  37. // Custom message for installation.
  38. //
  39. #define WM_CUSTOM_INSTALL WM_APP + 0x500
  40. //
  41. // General constants.
  42. //
  43. #define APP_CLASS L"AVRFINST"
  44. #define APP_NAME L"Application Verifier Installer"
  45. //
  46. // Catalog related filenames.
  47. //
  48. #define FILENAME_DELTA_CDF_DOTNET L"delta_net.cdf"
  49. #define FILENAME_DELTA_CAT_DOTNET L"delta_net.cat"
  50. #define FILENAME_DELTA_CDF_XP L"delta_xp.cdf"
  51. #define FILENAME_DELTA_CAT_XP L"delta_xp.cat"
  52. //
  53. // The number of files that we'll be installing.
  54. //
  55. #define NUM_FILES 9
  56. //
  57. // Source and destination filenames.
  58. //
  59. #define FILENAME_APPVERIF_EXE L"appverif.exe"
  60. #define FILENAME_APPVERIF_EXE_PDB L"appverif.pdb"
  61. #define FILENAME_APPVERIF_CHM L"appverif.chm"
  62. #define FILENAME_ACVERFYR_DLL L"acverfyr.dll"
  63. #define FILENAME_ACVERFYR_DLL_PDB L"acverfyr.pdb"
  64. #define FILENAME_ACVERFYR_DLL_W2K L"acverfyr_w2K.dll"
  65. #define FILENAME_ACVERFYR_DLL_W2K_PDB L"acverfyr_w2K.pdb"
  66. #define FILENAME_MSVCP60_DLL L"msvcp60.dll"
  67. #define FILENAME_SDBINST_EXE L"sdbinst.exe"
  68. //
  69. // Command to execute to install the certificate file.
  70. //
  71. #define CERTMGR_EXE L"certmgr.exe"
  72. #define CERTMGR_CMD L"-add testroot.cer -r localMachine -s root"
  73. typedef enum {
  74. dlNone = 0,
  75. dlPrint,
  76. dlError,
  77. dlWarning,
  78. dlInfo
  79. } DEBUGLEVEL;
  80. void
  81. __cdecl
  82. DebugPrintfEx(
  83. IN DEBUGLEVEL dwDetail,
  84. IN LPSTR pszFmt,
  85. ...
  86. );
  87. #define DPF DebugPrintfEx
  88. //
  89. // Contains information about the files that will be installed/uninstalled
  90. // by the application.
  91. //
  92. typedef struct _FILEINFO {
  93. BOOL bInstall; // indicates that this file should be installed
  94. BOOL bWin2KOnly; // indicates that the file should be installed on W2K only
  95. WCHAR wszFileName[MAX_PATH]; // the name of the file (no path)
  96. WCHAR wszSrcFileName[MAX_PATH]; // the full path and name of the source file
  97. WCHAR wszDestFileName[MAX_PATH]; // the full path and name of the destination file
  98. DWORDLONG dwlSrcFileVersion; // the version information of the source file
  99. DWORDLONG dwlDestFileVersion; // the version information of the destination file
  100. } FILEINFO, *LPFILEINFO;
  101. typedef enum {
  102. osWindows2000 = 0,
  103. osWindowsXP,
  104. osWindowsDotNet
  105. } PLATFORM;
  106. //
  107. // Contains all the information that we'll need to access throughout
  108. // the application.
  109. //
  110. typedef struct _APPINFO {
  111. BOOL bQuiet; // if TRUE the install should run quietly
  112. BOOL bInstallSuccess; // if TRUE the install was successful; if FALSE it was not
  113. HWND hMainDlg; // main dialog handle
  114. HWND hWndProgress; // progress bar handle
  115. HINSTANCE hInstance; // main instance handle
  116. WCHAR wszModuleName[MAX_PATH]; // directory that we're running from (includes module name)
  117. WCHAR wszCurrentDir[MAX_PATH]; // directory that we're running from (no module name)
  118. WCHAR wszWinDir[MAX_PATH]; // path to the Windows directory
  119. WCHAR wszSysDir[MAX_PATH]; // path to the (terminal server aware) Windows\System32 directory
  120. FILEINFO rgFileInfo[NUM_FILES]; // array of FILEINFO structs that describe files to install
  121. PLATFORM ePlatform; // indicates that platform we're running on
  122. } APPINFO, *LPAPPINFO;
  123. int
  124. InitializeInstaller(
  125. void
  126. );
  127. BOOL
  128. InitializeFileInfo(
  129. void
  130. );
  131. void
  132. PerformInstallation(
  133. IN HWND hWndParent
  134. );
  135. BOOL
  136. StringToGuid(
  137. IN LPCWSTR pwszIn,
  138. OUT GUID* pgOut
  139. );
  140. void
  141. InstallLaunchExe(
  142. void
  143. );
  144. BOOL
  145. IsPkgAppVerifNewer(
  146. void
  147. );
  148. #endif // _AVRFINST_H