Removed LibraryLocal utility

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7061 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2018-12-07 22:06:47 +00:00
parent 42e1df24a4
commit 52ac543360
7 changed files with 14 additions and 175 deletions

View file

@ -1,103 +0,0 @@
/*
LibraryLocal - used by the Library.nsh macros
Get the version of local DLL and TLB files
Written by Joost Verburg
POSIX DLL version support by kichik -- 20070415
Unicode support by Jim Park -- 20070727
POSIX TLB version support by anders_k -- 20170929
*/
#include "../../../Source/Platform.h"
#include "../../../Source/tstring.h"
#include <stdio.h>
#include <iostream>
#include <fstream>
#include "../../../Source/BinInterop.h"
#include "../../../Source/util.h"
#include "../../../Source/winchar.h"
using namespace std;
int g_noconfig=0; // TODO: Not used?
NSISRT_DEFINEGLOBALS();
enum {
EC_SUCCESS = 0,
EC_NO_VERSION_PRESENT = 1,
EC_UNSUPPORTED_FORMAT = 10, // TODO: POSIX should return this for 16-bit NE files
EC_FILE_NOT_FOUND = 15,
EC_INVALID_PARAMETER = 20,
EC_FILE_IO_ERROR = 50,
EC_UNKNOWN_ERROR = 99
};
NSIS_ENTRYPOINT_TMAIN
int _tmain(int argc, TCHAR* argv[])
{
if (!NSISRT_Initialize()) return EC_UNKNOWN_ERROR;
tstring appmode;
const TCHAR *filename;
int filefound = 0, exitcode = EC_INVALID_PARAMETER;
if (argc != 4)
return EC_INVALID_PARAMETER;
appmode = argv[1];
filename = argv[2];
// Validate filename
FILE*fIn = FOPEN(filename, ("rb"));
filefound = !!fIn;
if (fIn)
fclose(fIn);
int versionfound = 0;
DWORD low = 0, high = 0;
if (filefound)
{
// DLL/EXE version
if (appmode.compare(_T("D")) == 0)
{
versionfound = GetDLLVersion(filename, high, low);
}
// TLB version
if (appmode.compare(_T("T")) == 0)
{
versionfound = GetTLBVersion(filename, high, low);
}
}
// Write the version to a NSIS header file
FILE*fHdr = FOPEN(argv[3], ("wt"));
if (!fHdr) return EC_FILE_IO_ERROR;
fputs("!warning \"LibraryLocal is deprecated, use !getdllversion /packed\"\n", fHdr);
// File content is always ASCII so we don't use TCHAR
if (!filefound)
{
fputs("!define LIBRARY_VERSION_FILENOTFOUND\n", fHdr);
exitcode = EC_FILE_NOT_FOUND;
}
else if (!versionfound)
{
fputs("!define LIBRARY_VERSION_NONE\n", fHdr);
exitcode = EC_NO_VERSION_PRESENT;
}
else
{
fprintf(fHdr, "!define LIBRARY_VERSION_HIGH %lu\n", static_cast<unsigned long>(high));
fprintf(fHdr, "!define LIBRARY_VERSION_LOW %lu\n", static_cast<unsigned long>(low));
exitcode = EC_SUCCESS;
}
fclose(fHdr);
return exitcode;
}

View file

@ -1,38 +0,0 @@
target = 'LibraryLocal'
files = Split("""
LibraryLocal.cpp
""")
required_files = Split("""
#Source/ResourceEditor.cpp
#Source/BinInterop.cpp
#Source/util.cpp
#Source/winchar.cpp
""")
libs = Split("""
oleaut32
version
""")
libs_posix = Split("""
iconv
""")
Import('BuildUtil BuildUtilEnv GetAvailableLibs')
env = BuildUtilEnv(flags = ['$EXCEPTION_FLAG'], cross_platform = True, cli = True)
import os.path
for s in required_files:
fn = os.path.split(s)[-1]
bn = os.path.splitext(fn)[0]
o = env.Object(bn, s)
files.append(o)
if env['PLATFORM'] != 'win32':
libs = GetAvailableLibs(env, libs_posix)
BuildUtil(target, files, libs, flags = ['$EXCEPTION_FLAG'], cross_platform = True, cli = True)

View file

@ -112,9 +112,6 @@ If no cross-compiler is available, use the following:
\c scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all
\c NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/path/to/extracted/zip
\c install-compiler
\c
\c scons NSIS_CONFIG_CONST_DATA_PATH=no PREFIX=/path/to/extracted/zip
\c /path/to/extracted/zip/LibraryLocal
This should only build makensis and install it to the directory where a precompiled package, such as the \R{build_nightly}{nightly build} or a \W{http://sourceforge.net/project/showfiles.php?group_id=22049}{zipped release version} (nsis-x.xx.zip), is extracted. Note that the in order for this to work, the precompiled package must be compiled using the exact same sources as makensis. In particular, \c{Source\\exehead\\config.h}, the options passed to scons and \c{Source\\exehead\\fileform.h} must be identical. Nightly builds and zipped release versions are built with the default options.

View file

@ -32,6 +32,8 @@ Released on ??? ??th, 20??
\b MakeNSIS prints -CMDHELP to stdout (\W{http://sf.net/p/nsis/bugs/1203}{bug #1203})
\b Removed LibraryLocal utility
\S2{} Translations
\b Added Hind\u012b{i} (\W{http://sf.net/p/nsis/patches/289}{patch #289})

View file

@ -247,7 +247,6 @@ ${MementoSection} "NSIS Core Files (required)" SecCore
RMDir $INSTDIR\Docs
SetOutPath $INSTDIR\Bin
File ..\Bin\LibraryLocal.exe
!if ${BITS} >= 64
File /NonFatal ..\Bin\RegTool-x86.bin
File ..\Bin\RegTool-amd64.bin

View file

@ -156,36 +156,19 @@
### Get library version
!macro __InstallLib_Helper_GetVersion TYPE FILE
!ifdef LIBRARY_USELIBRARYLOCALHELPER
!tempfile LIBRARY_TEMP_NSH
!ifdef NSIS_WIN32_MAKENSIS
!execute '"${NSISDIR}\Bin\LibraryLocal.exe" "${TYPE}" "${FILE}" "${LIBRARY_TEMP_NSH}"'
!else
!execute 'LibraryLocal "${TYPE}" "${FILE}" "${LIBRARY_TEMP_NSH}"'
!endif
!include "${LIBRARY_TEMP_NSH}"
!delfile "${LIBRARY_TEMP_NSH}"
!undef LIBRARY_TEMP_NSH
!else
!if "${TYPE}" == "D"
!getdllversion /NoErrors /Packed "${FILE}" LIBRARY_VERSION_
!else if "${TYPE}" == "T"
!gettlbversion /NoErrors /Packed "${FILE}" LIBRARY_VERSION_
!endif
; Emulate the old LibraryLocal defines
!ifndef LIBRARY_VERSION_HIGH
!define LIBRARY_VERSION_FILENOTFOUND
!else if "${LIBRARY_VERSION_HIGH}" == ""
!define LIBRARY_VERSION_NONE
!undef LIBRARY_VERSION_HIGH
!undef LIBRARY_VERSION_LOW
!endif
!if "${TYPE}" == "D"
!getdllversion /NoErrors /Packed "${FILE}" LIBRARY_VERSION_
!else if "${TYPE}" == "T"
!gettlbversion /NoErrors /Packed "${FILE}" LIBRARY_VERSION_
!endif
; Emulate the old LibraryLocal defines
!ifndef LIBRARY_VERSION_HIGH
!define LIBRARY_VERSION_FILENOTFOUND
!else if "${LIBRARY_VERSION_HIGH}" == ""
!define LIBRARY_VERSION_NONE
!undef LIBRARY_VERSION_HIGH
!undef LIBRARY_VERSION_LOW
!endif
!macroend

View file

@ -30,7 +30,6 @@ plugins = [
]
utils = [
'Library/LibraryLocal',
'Library/RegTool',
'MakeLangId',
'Makensisw',