INFINST.H
Upload User: bangxh
Upload Date: 2007-01-31
Package Size: 42235k
Code Size: 3k
Category:

Windows Develop

Development Platform:

Visual C++

  1. /******************************************************************************
  2. *       This is a part of the Microsoft Source Code Samples. 
  3. *       Copyright (C) 1995-1997 Microsoft Corporation.
  4. *       All rights reserved. 
  5. *       This source code is only intended as a supplement to 
  6. *       Microsoft Development Tools and/or WinHelp documentation.
  7. *       See these sources for detailed information regarding the 
  8. *       Microsoft samples programs.
  9. ******************************************************************************/
  10. //
  11. // commands
  12. //
  13. #define ID_INSTALL     100
  14. //
  15. // icons
  16. //
  17. #define EXE_ICON        300
  18. //
  19. // typedefs
  20. //
  21. typedef struct tagINSTALLINFO
  22. {
  23.     HINSTANCE hInst;        // current instance
  24.     int iWelcome;
  25.     int iLicense;
  26.     int iInstall_Type;
  27.     int iCustom_Options1;
  28.     int iCustom_Options2;
  29.     int iCustom_Options3;
  30.     int iCustom_Options4;
  31.     int iInstall;
  32.     char pszUserName[MAX_PATH];
  33.     char pszCompany[MAX_PATH];
  34.     char pszProductIdString[MAX_PATH];
  35.     char pszEmailAddress[MAX_PATH];
  36.     char pszDestPath[MAX_PATH];
  37. } INSTALLINFO;
  38. //
  39. // globals
  40. //
  41. extern INSTALLINFO setupInfo;   // a structure containing the review information
  42. extern HWND hwndEdit;           // handle to the main MLE
  43. extern TCHAR lpReview[MAX_BUF]; // Buffer for the review
  44. extern BOOL bCreated;           // Keep us minimized once we are created
  45. extern BOOL bUninstallCommand;  // Is it an uninstall
  46. //
  47. // Function prototypes
  48. //
  49. long APIENTRY MainWndProc(HWND, UINT, UINT, LONG);
  50. BOOL InitApplication(HANDLE);
  51. BOOL InitInstance(HANDLE, int);
  52. void RuntimeRegistration(INSTALLINFO*);
  53. //
  54. // simple win32 registry api wrappers
  55. //
  56. BOOL RegisterString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData);
  57. BOOL GetRegString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData);
  58. //
  59. // Context for data needed in my callback routine
  60. // This needs to include the context for the default callback
  61. // since my callback calls the default
  62. //
  63. typedef struct tagMY_INSTALL_DATA{
  64.    // TODO: Add other data here that you want to have 
  65.    //       available to your callback function.
  66.    //       For example, you may keep a counter that indicates
  67.    //       your bill board if you are doing your own progress dialog
  68.    PVOID pDefaultContext;
  69. } MY_INSTALL_DATA;
  70. //
  71. // call back routine for setup api uses for
  72. // progress and error messages
  73. //
  74. LRESULT WINAPI MyQueueCallback (
  75.     IN MY_INSTALL_DATA* pMyInstallData,
  76.     IN UINT Notification,
  77.     IN UINT Param1,
  78.     IN UINT Param2
  79.     );
  80. //
  81. // Product Registry keys
  82. // set by exe and not inf since these are runtime 
  83. // values.  All registry information that is not determined at 
  84. // runtime is in the inf file
  85. //
  86. #define USER_NAME_KEY       TEXT("UserName")
  87. #define COMPANY_KEY         TEXT("CompanyName")
  88. #define PRODUCT_ID_KEY      TEXT("ProductId")
  89. #define EMAIL_KEY           TEXT("EmailAddress")
  90. #define UNINSTALL_KEY       TEXT("SoftWare\Microsoft\Windows\CurrentVersion\Uninstall\MyProduct")
  91. #define MYPRODUCT_KEY       TEXT("Software\MyCompany\MyProduct\UserInfo\")