appwiz.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 8k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. //
  2. //  APPWIZ.H -- App install wizard header file
  3. //
  4. //  Copyright (C) Microsoft, 1994,1995 All Rights Reserved.
  5. //
  6. //  History:
  7. //  ral 5/23/94 - Copied from INTL CPL
  8. //  3/20/95  [stevecat] - NT port & real clean up, unicode, etc.
  9. //  3/14/98  [scotth] - reworked into shell 5 project
  10. //
  11. #ifndef _APPWIZ_H_
  12. #define _APPWIZ_H_
  13. #include <pif.h>        // for PROPPRG
  14. #include <apwizhlp.h>
  15. #include "appwizid.h"
  16. #include <shsemip.h>    // for RestartDialog
  17. #define CPLMODE_NORMAL            0
  18. #define CPLMODE_AUTOMSDOS   1
  19. #define CPLMODE_PROPWIZ     2
  20. #define MAX_PAGES  15           // limit on number of pages we can have
  21. #define WDFLAG_NOBROWSEPAGE 0x00000001        // Don't let user pick exe name
  22. #define WDFLAG_APPKNOWN     0x00000002        // Finish after selecting folder
  23. #define WDFLAG_DOSAPP       0x00000004        // Exe is a DOS program
  24. #define WDFLAG_SINGLEAPP    0x00000008        // Single MS-DOS app mode
  25. #define WDFLAG_PIFPROP      0x00000010        // Called from PIF property sheet
  26. #define WDFLAG_LINKHEREWIZ  0x00000020        // Create empty link (NOT IMPLEMENTED!)
  27. #define WDFLAG_INEDITMODE   0x00000040        // Editing a folder label
  28. #define WDFLAG_DONTOPENFLDR 0x00000080        // Don't open folder when link made
  29. #define WDFLAG_REALMODEONLY 0x00000100        // Don't use any prot mode drivers
  30. #define WDFLAG_COPYLINK     0x00000200        // Copy link, don't create new one.
  31. #define WDFLAG_SETUPWIZ     0x00000400        // Setup from disk wizard
  32. #define WDFLAG_READOPTFLAGS 0x00000800        // Value in dwDosOptGlobalFlags is valid
  33. #define WDFLAG_NOAUTORUN    0x00001000        // Disable autorun while wizard is running
  34. #define WDFLAG_EXPSZ        0x10000000        // WizData contains expanded strings
  35. typedef struct _DOSOPT {
  36.     HKEY        hk;
  37.     DWORD        dwFlags;
  38.     UINT        uOrder;
  39.     DWORD        dwStdOpt;
  40. } DOSOPT, FAR * LPDOSOPT;
  41. //////////////////////////////////////////////////////////////////////////////
  42. //
  43. // UNINSTALL_ITEM -- more info kept in an array paralell to the listbox
  44. //
  45. //////////////////////////////////////////////////////////////////////////////
  46. typedef struct
  47. {
  48.     TCHAR command[ MAX_PATH ];  // command to run which will nuke the app
  49. } UNINSTALL_ITEM, FAR * LPUNINSTALL_ITEM;
  50. typedef struct _WIZDATA {
  51.     HWND        hwnd;
  52.     DWORD       dwFlags;
  53.     HANDLE      hProps;                 // handle to PIFMGR properties, 0 if none
  54.     TCHAR       szExeName[MAX_PATH];
  55.     TCHAR       szExpExeName[MAX_PATH];
  56.     TCHAR       szParams[MAX_PATH];
  57.     TCHAR       szIniFile[MAX_PATH];
  58.     TCHAR       szProgDesc[MAX_PATH];
  59.     TCHAR       szWorkingDir[MAX_PATH];
  60.     HBITMAP     hbmpWizard;
  61.     HIMAGELIST  himl;
  62.     LPTSTR      lpszFolder;
  63.     PROPPRG     PropPrg;
  64.     INT         NumOpts;
  65.     LPDOSOPT    DosOpt;
  66.     LPTSTR      lpszOriginalName;       // if non-null then link exists already
  67.     LPUNINSTALL_ITEM        lpUItem;
  68.     DWORD       dwDosOptGlobalFlags;    // Use function to access this field
  69. #ifndef NO_NEW_SHORTCUT_HOOK
  70.     INewShortcutHook *pnshhk;
  71.     TCHAR     szExt[MAX_PATH];
  72. #ifdef UNICODE
  73.     INewShortcutHookA *pnshhkA;
  74. #endif    
  75. #endif
  76. #ifndef DOWNLEVEL_PLATFORM
  77. #ifdef WINNT
  78.     BOOL        bTermSrvAndAdmin;
  79.     BOOL        bPrevMode;
  80. #endif // WINNT
  81. #endif // DOWNLEVEL_PLATFORM
  82. } WIZDATA, FAR * LPWIZDATA;
  83. //
  84. // Private messages
  85. //
  86. #define WMPRIV_POKEFOCUS    WM_APP+0
  87. //
  88. // Wizard entry points.
  89. //
  90. BOOL LinkWizard(LPWIZDATA);
  91. BOOL SetupWizard(LPWIZDATA);
  92. BOOL MSDOSPropOnlyWizard(LPWIZDATA);
  93. //
  94. //  Inserts a single column into the specified ListView.
  95. //
  96. void InitSingleColListView(HWND hLV);
  97. //
  98. // Main appwiz property sheet
  99. //
  100. BOOL_PTR CALLBACK AppListDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  101. BOOL_PTR CALLBACK InstallUninstallDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  102. //
  103. //  Pushes the "OK" button on a property sheet.
  104. //
  105. void DismissCPL(LPWIZDATA);
  106. //
  107. // Setup wizard pages
  108. //
  109. BOOL_PTR CALLBACK SetupDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  110. BOOL_PTR CALLBACK ChgusrDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  111. BOOL_PTR CALLBACK ChgusrFinishDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  112. BOOL_PTR CALLBACK ChgusrFinishPrevDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  113. //
  114. // Shortcut wizard pages
  115. //
  116. BOOL_PTR CALLBACK BrowseDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  117. BOOL_PTR CALLBACK SetupBrowseDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  118. BOOL_PTR CALLBACK PickFolderDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  119. BOOL_PTR CALLBACK GetTitleDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  120. BOOL_PTR CALLBACK PickIconDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  121. BOOL_PTR CALLBACK PickConfigDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  122. BOOL_PTR CALLBACK ConfigOptionsDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  123. //
  124. // Function in Folder.C that is used for removing folders from the task bar
  125. // property sheet.
  126. //
  127. BOOL RemoveItemsDialog(HWND hParent);
  128. //
  129. // Strips "@" characters from a string resource and replaces them with NULLs
  130. //
  131. EXTERN_C void LoadAndStrip(int id, LPTSTR lpsz, int cbstr);
  132. //
  133. //  Returns the path to the boot directory.
  134. //
  135. void GetBootDir(LPTSTR lpszBootDir, int cbBootDir);
  136. //
  137. // Exec the program.  Used by Setup and AppList
  138. //
  139. BOOL ExecSetupProg(LPWIZDATA lpwd, BOOL ForceWx86, BOOL bMinWiz);
  140. //
  141. // Skip to next string in doubly null terminated string
  142. //
  143. LPTSTR SkipStr(LPTSTR);
  144. //
  145. // Used by all wizard sheets at WM_INITDIALOG
  146. //
  147. LPWIZDATA InitWizSheet(HWND hDlg, LPARAM lParam, DWORD dwFlags);
  148. //
  149. // Used by all wizard sheets at PSN_RESET
  150. //
  151. void CleanUpWizData(LPWIZDATA lpwd);
  152. //
  153. // Thunked exports for 16-bit apps/dlls
  154. //
  155. void InstallCPL(HWND hwnd, UINT nStartPage);
  156. //
  157. // Functions for links
  158. //
  159. BOOL CreateLink(LPWIZDATA);
  160. BOOL GetLinkName(LPTSTR, LPWIZDATA);
  161. //
  162. // Created by the thunk scripts
  163. //
  164. BOOL WINAPI Pif3216_ThunkConnect32(LPCTSTR pszDll16, LPCTSTR pszDll32, HANDLE hIinst, DWORD dwReason);
  165. BOOL WINAPI Pif1632_ThunkConnect32(LPCTSTR pszDll16, LPCTSTR pszDll32, HANDLE hIinst, DWORD dwReason);
  166. BOOL GetSingleAppInfo(LPWIZDATA);
  167. //
  168. // Gets the INF name for install programs.  Returns false if none.
  169. //
  170. BOOL AppListGetInfName(LPWIZDATA);
  171. //
  172. //  Functions determine info about lpwd->szExeName
  173. //
  174. void DetermineExeType(LPWIZDATA);
  175. //
  176. //  Fills in the szProgDesc field of the wizdata structure.
  177. //
  178. BOOL DetermineDefaultTitle(LPWIZDATA);
  179. //
  180. //  Strip the extension off of a file name.
  181. //
  182. void StripExt(LPTSTR lpsz);
  183. //
  184. //  If hProp == 0 then creates a link, otherwise sets configuration for
  185. //  property handle.  If hwndOptList is NULL then auto-configures based on
  186. //  information in PropPrg.dwRealModeFlags.
  187. //
  188. PIFWIZERR ConfigRealModeOptions(LPWIZDATA lpwd, HWND hwndOptList, UINT uAction);
  189. #define CRMOACTION_DEFAULT      0        // Use appropriate default
  190. #define CRMOACTION_CLEAN        1        // Force it to be a clean config
  191. #define CRMOACTION_CURRENT      2        // Force it to use the current config
  192. //
  193. //  Returns the GlobalFlags setting from the registry for MS-DOS options.
  194. //
  195. DWORD GetMSDOSOptGlobalFlags(LPWIZDATA lpwd);
  196. //
  197. // Global data
  198. //
  199. extern int g_cxIcon;
  200. extern int g_cyIcon;
  201. extern TCHAR const c_szPIF[];
  202. extern TCHAR const c_szLNK[];
  203. //
  204. //  Debugging macros
  205. //
  206. #ifdef DEBUG
  207. // BUGBUG (scotth): these macros used to map to messagebox.  I changed
  208. // them to TraceMsg and Assert.  Someday when someone has more time on
  209. // their hands, they should change the actual code...
  210. #define WIZERROR(string)            TraceMsg(TF_ERROR, "%s", string)
  211. #define WIZERRORIF(cond, string)     { 
  212.     if (cond) WIZERROR(string); }
  213. #else
  214. #define WIZERROR(string)
  215. #define WIZERRORIF(cond, string)
  216. #endif
  217. #ifdef WX86
  218. //
  219. // from uninstal.c
  220. //
  221. extern BOOL bWx86Enabled;
  222. extern BOOL bForceX86Env;
  223. extern const WCHAR ProcArchName[];
  224. #endif
  225. #endif // _APPWIZ_H_