NSIS/Source/exehead/state.h

68 lines
2.1 KiB
C
Raw Permalink Normal View History

/*
* state.h
*
* This file is a part of NSIS.
*
* Copyright (C) 1999-2021 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
*
* Licence details can be found in the file COPYING.
*
* This software is provided 'as-is', without any express or implied
* warranty.
*
* Unicode support by Jim Park -- 08/22/2007
*/
#ifndef NSIS_EXEHEAD_STATE_H
#define NSIS_EXEHEAD_STATE_H
#include "fileform.h"
#include "api.h"
#ifdef __GNUC__
// GCC warns about array bounds when accessing g_usrvarssection[2] because it is only [1] at compile time,
// the other part of this hack is in util.c where g_usrvarsstart is initialized.
extern const NSIS_STRING*const g_usrvarsstart;
#define g_usrvars ( (NSIS_STRING*) (g_usrvarsstart) )
#else
extern NSIS_STRING g_usrvarssection[1];
#define g_usrvars g_usrvarssection
#endif
* PageEx - every page can be used everywhere and as many times as needed * DirVar - easy way to add another dir page * default strings in the language file (Page directory is enough, no need for DirText) * strings from the language file are now LangStrings that can be used in the script * no more /LANG - one string for all languages * any lang strings can be used everywhere, installer or uninstaller (no un.) * no more unprocessed strings - variables can be used almost everywhere (except in licenseData and InstallDirRegKey) * DirText parm for browse dialog text * SetBkColor -> SetCtlColors - can now set text color too * fixed SetOutPath and File /r bug * fixed File /a /oname bug * added $_CLICK for pages * added quotes support in lang files (patch #752620) * extraction progress * separate RTL dialogs for RTL langs (improved RTL too) * InstallOptions RTL * StartMenu RTL * fixed RegDLL? * added IfSilent and SetSilent (SetSilent only works from .onInit) * fixed verify window (it never showed) (bug #792494) * fixed ifnewer readonly file problem (patch #783782) * fixed wininit.ini manipulation when there is another section after [rename] * fixed some ClearType issues * fixed a minor bug in the resource editor * fixed !ifdef/!endif stuff, rewritten * lots of code and comments clean ups * got rid of some useless exceptions handling and STL classes (still much more to go) * lots of optimizations, of course ;) * updated system.dll with support for GUID, WCHAR, and fast VTable calling (i.e. COM ready) * minor bug fixes git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2823 212acab6-be3b-0410-9dea-997c60f758d6
2003-09-04 18:25:57 +00:00
#define state_command_line (((NSIS_STRING *) g_usrvars)[20])
#define state_install_directory (((NSIS_STRING *) g_usrvars)[21])
#define state_output_directory (((NSIS_STRING *) g_usrvars)[22])
#define state_exe_directory (((NSIS_STRING *) g_usrvars)[23])
#define state_language (((NSIS_STRING *) g_usrvars)[24])
#define state_temp_dir (((NSIS_STRING *) g_usrvars)[25])
* PageEx - every page can be used everywhere and as many times as needed * DirVar - easy way to add another dir page * default strings in the language file (Page directory is enough, no need for DirText) * strings from the language file are now LangStrings that can be used in the script * no more /LANG - one string for all languages * any lang strings can be used everywhere, installer or uninstaller (no un.) * no more unprocessed strings - variables can be used almost everywhere (except in licenseData and InstallDirRegKey) * DirText parm for browse dialog text * SetBkColor -> SetCtlColors - can now set text color too * fixed SetOutPath and File /r bug * fixed File /a /oname bug * added $_CLICK for pages * added quotes support in lang files (patch #752620) * extraction progress * separate RTL dialogs for RTL langs (improved RTL too) * InstallOptions RTL * StartMenu RTL * fixed RegDLL? * added IfSilent and SetSilent (SetSilent only works from .onInit) * fixed verify window (it never showed) (bug #792494) * fixed ifnewer readonly file problem (patch #783782) * fixed wininit.ini manipulation when there is another section after [rename] * fixed some ClearType issues * fixed a minor bug in the resource editor * fixed !ifdef/!endif stuff, rewritten * lots of code and comments clean ups * got rid of some useless exceptions handling and STL classes (still much more to go) * lots of optimizations, of course ;) * updated system.dll with support for GUID, WCHAR, and fast VTable calling (i.e. COM ready) * minor bug fixes git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2823 212acab6-be3b-0410-9dea-997c60f758d6
2003-09-04 18:25:57 +00:00
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
# define state_plugins_dir (((NSIS_STRING *) g_usrvars)[26])
#endif
#define state_exe_path (((NSIS_STRING *) g_usrvars)[27])
#define state_exe_file (((NSIS_STRING *) g_usrvars)[28])
#define state_click_next (((NSIS_STRING *) g_usrvars)[30])
extern TCHAR g_caption[NSIS_MAX_STRLEN*2];
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
extern HWND g_hwnd;
extern HANDLE g_hInstance;
extern HWND insthwnd,insthwndbutton;
#else
#define g_hwnd 0
#define g_hInstance 0
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
typedef struct {
exec_flags_t exec_flags;
osinfo osi;
} execflags_and_osinfo;
extern execflags_and_osinfo g_execflags_and_osinfo;
#define g_exec_flags (g_execflags_and_osinfo.exec_flags)
#define g_osinfo (g_execflags_and_osinfo.osi)
#endif //~ Include guard