made NSIS_VERSION a define set by the scons script
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4024 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0b5ea752a9
commit
f85a88852c
7 changed files with 16 additions and 14 deletions
|
@ -55,6 +55,8 @@ defenv = Environment()
|
||||||
defenv.SConsignFile()
|
defenv.SConsignFile()
|
||||||
Export('defenv')
|
Export('defenv')
|
||||||
|
|
||||||
|
defenv.Append(NSIS_VERSION = VERSION)
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
####### Options ###
|
####### Options ###
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
@ -72,7 +72,11 @@ conf.Finish()
|
||||||
#env['PCH'] = env.PCH(pch)[0]
|
#env['PCH'] = env.PCH(pch)[0]
|
||||||
#env['PCHSTOP'] = pch
|
#env['PCHSTOP'] = pch
|
||||||
|
|
||||||
##### Compile LZMA
|
##### Defines
|
||||||
|
|
||||||
|
env.Append(CPPDEFINES = ['NSIS_VERSION=v$NSIS_VERSION'])
|
||||||
|
|
||||||
|
##### LZMA specific defines
|
||||||
|
|
||||||
lzma_env = env.Copy()
|
lzma_env = env.Copy()
|
||||||
lzma_env.Append(CPPDEFINES = ['COMPRESS_MF_BT'])
|
lzma_env.Append(CPPDEFINES = ['COMPRESS_MF_BT'])
|
||||||
|
|
|
@ -84,8 +84,7 @@ CEXEBuild::CEXEBuild() :
|
||||||
ns_func.add("",0); // make sure offset 0 is special on these (i.e. never used by a label)
|
ns_func.add("",0); // make sure offset 0 is special on these (i.e. never used by a label)
|
||||||
ns_label.add("",0);
|
ns_label.add("",0);
|
||||||
|
|
||||||
extern const char *NSIS_VERSION;
|
definedlist.add("NSIS_VERSION", CONST_STR(NSIS_VERSION));
|
||||||
definedlist.add("NSIS_VERSION", NSIS_VERSION);
|
|
||||||
|
|
||||||
#define intdef2str_(x) #x
|
#define intdef2str_(x) #x
|
||||||
#define intdef2str(x) intdef2str_(x)
|
#define intdef2str(x) intdef2str_(x)
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include "DialogTemplate.h"
|
#include "DialogTemplate.h"
|
||||||
#include "exehead/resource.h"
|
#include "exehead/resource.h"
|
||||||
|
|
||||||
extern const char *NSIS_VERSION;
|
|
||||||
|
|
||||||
// Default English strings. Should match NSIS_DEFAULT_LANG
|
// Default English strings. Should match NSIS_DEFAULT_LANG
|
||||||
// Do not change the first string in every item, it's the LangString
|
// Do not change the first string in every item, it's the LangString
|
||||||
// name for usage in scripts.
|
// name for usage in scripts.
|
||||||
|
@ -830,8 +828,8 @@ void CEXEBuild::FillLanguageTable(LanguageTable *table) {
|
||||||
if (!dstr)
|
if (!dstr)
|
||||||
continue;
|
continue;
|
||||||
if (i == NLF_BRANDING) {
|
if (i == NLF_BRANDING) {
|
||||||
char temp[NSIS_MAX_STRLEN + sizeof(NSIS_VERSION)];
|
char temp[NSIS_MAX_STRLEN + sizeof(CONST_STR(NSIS_VERSION))];
|
||||||
sprintf(temp, dstr, NSIS_VERSION);
|
sprintf(temp, dstr, CONST_STR(NSIS_VERSION));
|
||||||
table->lang_strings->set(sn, temp);
|
table->lang_strings->set(sn, temp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
const char *NSIS_VERSION="v2.06";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Nullsoft Scriptable Install System (NSIS)
|
Nullsoft Scriptable Install System (NSIS)
|
||||||
|
@ -108,7 +106,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
if (argc > 1 && !stricmp(argv[1], OPT_STR "VERSION"))
|
if (argc > 1 && !stricmp(argv[1], OPT_STR "VERSION"))
|
||||||
{
|
{
|
||||||
fprintf(g_output,NSIS_VERSION);
|
fprintf(g_output,CONST_STR(NSIS_VERSION));
|
||||||
fflush(g_output);
|
fflush(g_output);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +137,7 @@ int main(int argc, char **argv)
|
||||||
"Portions Copyright (C) 1996-2002 Julian R Seward (bzip2).\n"
|
"Portions Copyright (C) 1996-2002 Julian R Seward (bzip2).\n"
|
||||||
"Portions Copyright (C) 1999-2003 Igor Pavlov (lzma).\n"
|
"Portions Copyright (C) 1999-2003 Igor Pavlov (lzma).\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, Robert Rainwater, Yaroslav Faybishenko, Jeff Doozan, Amir Szekely, Ximon Eighteen, et al.\n\n",NSIS_VERSION);
|
"Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, Robert Rainwater, Yaroslav Faybishenko, Jeff Doozan, Amir Szekely, Ximon Eighteen, et al.\n\n",CONST_STR(NSIS_VERSION));
|
||||||
fflush(g_output);
|
fflush(g_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2191,7 +2191,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
if (k == -1) PRINTHELP()
|
if (k == -1) PRINTHELP()
|
||||||
SCRIPT_MSG("XPStyle: %s\n", line.gettoken_str(1));
|
SCRIPT_MSG("XPStyle: %s\n", line.gettoken_str(1));
|
||||||
init_res_editor();
|
init_res_editor();
|
||||||
const char *szXPManifest = k ? 0 : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\"><assemblyIdentity version=\"1.0.0.0\" processorArchitecture=\"X86\" name=\"Nullsoft.NSIS.exehead\" type=\"win32\"/><description>Nullsoft Install System v2.06</description><dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"Microsoft.Windows.Common-Controls\" version=\"6.0.0.0\" processorArchitecture=\"X86\" publicKeyToken=\"6595b64144ccf1df\" language=\"*\" /></dependentAssembly></dependency></assembly>";
|
const char *szXPManifest = k ? 0 : "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\"><assemblyIdentity version=\"1.0.0.0\" processorArchitecture=\"X86\" name=\"Nullsoft.NSIS.exehead\" type=\"win32\"/><description>Nullsoft Install System " CONST_STR(NSIS_VERSION) "</description><dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"Microsoft.Windows.Common-Controls\" version=\"6.0.0.0\" processorArchitecture=\"X86\" publicKeyToken=\"6595b64144ccf1df\" language=\"*\" /></dependentAssembly></dependency></assembly>";
|
||||||
res_editor->UpdateResource(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), NSIS_DEFAULT_LANG, (unsigned char*)szXPManifest, k ? 0 : strlen(szXPManifest));
|
res_editor->UpdateResource(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), NSIS_DEFAULT_LANG, (unsigned char*)szXPManifest, k ? 0 : strlen(szXPManifest));
|
||||||
}
|
}
|
||||||
catch (exception& err) {
|
catch (exception& err) {
|
||||||
|
@ -3188,11 +3188,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
|
|
||||||
if (trim) {
|
if (trim) {
|
||||||
char str[512];
|
char str[512];
|
||||||
extern const char *NSIS_VERSION;
|
|
||||||
if (line.getnumtokens()==a+1 && line.gettoken_str(a)[0])
|
if (line.getnumtokens()==a+1 && line.gettoken_str(a)[0])
|
||||||
strcpy(str, line.gettoken_str(a));
|
strcpy(str, line.gettoken_str(a));
|
||||||
else
|
else
|
||||||
wsprintf(str, "Nullsoft Install System %s", NSIS_VERSION);
|
wsprintf(str, "Nullsoft Install System %s", CONST_STR(NSIS_VERSION));
|
||||||
|
|
||||||
switch (trim) {
|
switch (trim) {
|
||||||
case 1: td.LTrimToString(IDC_VERSTR, str, 4); break;
|
case 1: td.LTrimToString(IDC_VERSTR, str, 4); break;
|
||||||
|
|
|
@ -35,6 +35,8 @@ size_t WCStrLen(const WCHAR* szwStr);
|
||||||
|
|
||||||
size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm);
|
size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm);
|
||||||
|
|
||||||
|
#define CONST_STR(x) #x
|
||||||
|
|
||||||
#ifndef __BIG_ENDIAN__
|
#ifndef __BIG_ENDIAN__
|
||||||
# define FIX_ENDIAN_INT32_INPLACE(x) (x)
|
# define FIX_ENDIAN_INT32_INPLACE(x) (x)
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue