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:
kichik 2002-10-17 17:45:09 +00:00
parent 9e8f4914b2
commit e1bbb2bbaa

View file

@ -1032,14 +1032,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
int k=line.gettoken_enum(1,"on\0off\0");
if (k == -1) PRINTHELP()
SCRIPT_MSG("XPStyle: %s\n", line.gettoken_str(1));
if (k == 0) {
build_compressor_set=true;
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>";
re.UpdateResource(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (unsigned char*)szXPManifest, lstrlen(szXPManifest));
free(header_data_new);
header_data_new = re.Save((DWORD&)exeheader_size_new);
}
build_compressor_set=true;
CResourceEditor re(header_data_new, exeheader_size_new);
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, k ? 0 : lstrlen(szXPManifest));
free(header_data_new);
header_data_new = re.Save((DWORD&)exeheader_size_new);
}
catch (exception& err) {
ERROR_MSG("Error while adding XP style: %s\n", err.what());