Source code of Windows XP (NT5)
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.

264 lines
7.6 KiB

  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_AUTOTSINSTALLUI 0x00002000 // Automate Install Mode (For people double clicking or calling ShellExecute() on setup programs)
  35. #define WDFLAG_EXPSZ 0x10000000 // WizData contains expanded strings
  36. typedef struct _DOSOPT {
  37. HKEY hk;
  38. DWORD dwFlags;
  39. UINT uOrder;
  40. DWORD dwStdOpt;
  41. } DOSOPT, FAR * LPDOSOPT;
  42. //////////////////////////////////////////////////////////////////////////////
  43. //
  44. // UNINSTALL_ITEM -- more info kept in an array paralell to the listbox
  45. //
  46. //////////////////////////////////////////////////////////////////////////////
  47. typedef struct
  48. {
  49. TCHAR command[ MAX_PATH ]; // command to run which will nuke the app
  50. } UNINSTALL_ITEM, FAR * LPUNINSTALL_ITEM;
  51. typedef struct _WIZDATA {
  52. HWND hwnd;
  53. DWORD dwFlags;
  54. HANDLE hProps; // handle to PIFMGR properties, 0 if none
  55. TCHAR szExeName[MAX_PATH];
  56. TCHAR szExpExeName[MAX_PATH];
  57. TCHAR szParams[MAX_PATH];
  58. TCHAR szIniFile[MAX_PATH];
  59. TCHAR szProgDesc[MAX_PATH];
  60. TCHAR szWorkingDir[MAX_PATH];
  61. HBITMAP hbmpWizard;
  62. HIMAGELIST himl;
  63. LPTSTR lpszFolder;
  64. PROPPRG PropPrg;
  65. INT NumOpts;
  66. LPDOSOPT DosOpt;
  67. LPTSTR lpszOriginalName; // if non-null then link exists already
  68. LPUNINSTALL_ITEM lpUItem;
  69. DWORD dwDosOptGlobalFlags; // Use function to access this field
  70. #ifndef NO_NEW_SHORTCUT_HOOK
  71. INewShortcutHook *pnshhk;
  72. TCHAR szExt[MAX_PATH];
  73. #ifdef UNICODE
  74. INewShortcutHookA *pnshhkA;
  75. #endif
  76. #endif
  77. #ifndef DOWNLEVEL_PLATFORM
  78. #ifdef WINNT
  79. BOOL bTermSrvAndAdmin;
  80. BOOL bPrevMode;
  81. #endif // WINNT
  82. #endif // DOWNLEVEL_PLATFORM
  83. } WIZDATA, FAR * LPWIZDATA;
  84. //
  85. // Private messages
  86. //
  87. #define WMPRIV_POKEFOCUS WM_APP+0
  88. //
  89. // Wizard entry points.
  90. //
  91. BOOL LinkWizard(LPWIZDATA);
  92. BOOL SetupWizard(LPWIZDATA);
  93. BOOL MSDOSPropOnlyWizard(LPWIZDATA);
  94. //
  95. // Inserts a single column into the specified ListView.
  96. //
  97. void InitSingleColListView(HWND hLV);
  98. //
  99. // Main appwiz property sheet
  100. //
  101. BOOL_PTR CALLBACK AppListDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  102. BOOL_PTR CALLBACK InstallUninstallDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  103. //
  104. // Pushes the "OK" button on a property sheet.
  105. //
  106. void DismissCPL(LPWIZDATA);
  107. //
  108. // Setup wizard pages
  109. //
  110. BOOL_PTR CALLBACK SetupDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  111. BOOL_PTR CALLBACK ChgusrDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  112. BOOL_PTR CALLBACK ChgusrFinishDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  113. BOOL_PTR CALLBACK ChgusrFinishPrevDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  114. //
  115. // Shortcut wizard pages
  116. //
  117. BOOL_PTR CALLBACK BrowseDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  118. BOOL_PTR CALLBACK SetupBrowseDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  119. BOOL_PTR CALLBACK PickFolderDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  120. BOOL_PTR CALLBACK GetTitleDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  121. BOOL_PTR CALLBACK PickIconDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  122. BOOL_PTR CALLBACK PickConfigDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  123. BOOL_PTR CALLBACK ConfigOptionsDlgProc(HWND hDlg, UINT message , WPARAM wParam, LPARAM lParam);
  124. //
  125. // Function in Folder.C that is used for removing folders from the task bar
  126. // property sheet.
  127. //
  128. BOOL RemoveItemsDialog(HWND hParent);
  129. //
  130. // Strips "@" characters from a string resource and replaces them with NULLs
  131. // Returns TRUE if succeeded
  132. //
  133. EXTERN_C BOOL LoadAndStrip(int id, LPTSTR lpsz, int cbstr);
  134. //
  135. // Returns the path to the boot directory.
  136. //
  137. void GetBootDir(LPTSTR lpszBootDir, int cbBootDir);
  138. //
  139. // Exec the program. Used by Setup and AppList
  140. //
  141. BOOL ExecSetupProg(LPWIZDATA lpwd, BOOL ForceWx86, BOOL bMinWiz);
  142. //
  143. // Skip to next string in doubly null terminated string
  144. //
  145. LPTSTR SkipStr(LPTSTR);
  146. //
  147. // Used by all wizard sheets at WM_INITDIALOG
  148. //
  149. LPWIZDATA InitWizSheet(HWND hDlg, LPARAM lParam, DWORD dwFlags);
  150. //
  151. // Used by all wizard sheets at PSN_RESET
  152. //
  153. void CleanUpWizData(LPWIZDATA lpwd);
  154. //
  155. // Thunked exports for 16-bit apps/dlls
  156. //
  157. void InstallCPL(HWND hwnd, UINT nStartPage);
  158. //
  159. // Functions for links
  160. //
  161. BOOL CreateLink(LPWIZDATA);
  162. BOOL GetLinkName(LPTSTR, LPWIZDATA);
  163. //
  164. // Created by the thunk scripts
  165. //
  166. BOOL WINAPI Pif3216_ThunkConnect32(LPCTSTR pszDll16, LPCTSTR pszDll32, HANDLE hIinst, DWORD dwReason);
  167. BOOL WINAPI Pif1632_ThunkConnect32(LPCTSTR pszDll16, LPCTSTR pszDll32, HANDLE hIinst, DWORD dwReason);
  168. BOOL GetSingleAppInfo(LPWIZDATA);
  169. //
  170. // Gets the INF name for install programs. Returns false if none.
  171. //
  172. BOOL AppListGetInfName(LPWIZDATA);
  173. //
  174. // Functions determine info about lpwd->szExeName
  175. //
  176. void DetermineExeType(LPWIZDATA);
  177. //
  178. // Fills in the szProgDesc field of the wizdata structure.
  179. //
  180. BOOL DetermineDefaultTitle(LPWIZDATA);
  181. //
  182. // Strip the extension off of a file name.
  183. //
  184. void StripExt(LPTSTR lpsz);
  185. //
  186. // If hProp == 0 then creates a link, otherwise sets configuration for
  187. // property handle. If hwndOptList is NULL then auto-configures based on
  188. // information in PropPrg.dwRealModeFlags.
  189. //
  190. PIFWIZERR ConfigRealModeOptions(LPWIZDATA lpwd, HWND hwndOptList, UINT uAction);
  191. #define CRMOACTION_DEFAULT 0 // Use appropriate default
  192. #define CRMOACTION_CLEAN 1 // Force it to be a clean config
  193. #define CRMOACTION_CURRENT 2 // Force it to use the current config
  194. //
  195. // Returns the GlobalFlags setting from the registry for MS-DOS options.
  196. //
  197. DWORD GetMSDOSOptGlobalFlags(LPWIZDATA lpwd);
  198. //
  199. // Global data
  200. //
  201. extern int g_cxIcon;
  202. extern int g_cyIcon;
  203. extern TCHAR const c_szPIF[];
  204. extern TCHAR const c_szLNK[];
  205. #ifdef WX86
  206. //
  207. // from uninstal.c
  208. //
  209. extern BOOL bWx86Enabled;
  210. extern BOOL bForceX86Env;
  211. extern const WCHAR ProcArchName[];
  212. #endif
  213. #endif // _APPWIZ_H_