XPStyle off now reomves the XP manifest instead of assuming it wasn't added before and doing nothing
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1442 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9e8f4914b2
commit
e1bbb2bbaa
1 changed files with 6 additions and 8 deletions
|
@ -1032,15 +1032,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
int k=line.gettoken_enum(1,"on\0off\0");
|
int k=line.gettoken_enum(1,"on\0off\0");
|
||||||
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));
|
||||||
if (k == 0) {
|
|
||||||
build_compressor_set=true;
|
build_compressor_set=true;
|
||||||
CResourceEditor re(header_data_new, exeheader_size_new);
|
CResourceEditor re(header_data_new, exeheader_size_new);
|
||||||
char* szXPManifest = "<?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.</description><dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"Microsoft.Windows.Common-Controls\" version=\"6.0.0.0\" processorArchitecture=\"X86\" publicKeyToken=\"6595b64144ccf1df\" language=\"*\" /></dependentAssembly></dependency></assembly>";
|
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.0b0</description><dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"Microsoft.Windows.Common-Controls\" version=\"6.0.0.0\" processorArchitecture=\"X86\" publicKeyToken=\"6595b64144ccf1df\" language=\"*\" /></dependentAssembly></dependency></assembly>";
|
||||||
re.UpdateResource(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (unsigned char*)szXPManifest, lstrlen(szXPManifest));
|
re.UpdateResource(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (unsigned char*)szXPManifest, k ? 0 : lstrlen(szXPManifest));
|
||||||
free(header_data_new);
|
free(header_data_new);
|
||||||
header_data_new = re.Save((DWORD&)exeheader_size_new);
|
header_data_new = re.Save((DWORD&)exeheader_size_new);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (exception& err) {
|
catch (exception& err) {
|
||||||
ERROR_MSG("Error while adding XP style: %s\n", err.what());
|
ERROR_MSG("Error while adding XP style: %s\n", err.what());
|
||||||
return PS_ERROR;
|
return PS_ERROR;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue