fixed bug #2697027 - error from add/remove when uninstaller is canceled and uac is disabled
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5953 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
edc558b987
commit
c75dac3e32
2 changed files with 20 additions and 1 deletions
|
@ -2237,7 +2237,22 @@ int CEXEBuild::SetManifest()
|
|||
res_editor->UpdateResourceA(MAKEINTRESOURCE(24), MAKEINTRESOURCE(1), NSIS_DEFAULT_LANG, (LPBYTE) manifest.c_str(), manifest.length());
|
||||
}
|
||||
catch (exception& err) {
|
||||
ERROR_MSG("Error while setting manifest: %s\n", err.what());
|
||||
ERROR_MSG("Error setting manifest: %s\n", err.what());
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
return PS_OK;
|
||||
}
|
||||
|
||||
int CEXEBuild::UpdatePEHeader()
|
||||
{
|
||||
try {
|
||||
PIMAGE_NT_HEADERS headers = CResourceEditor::GetNTHeaders(m_exehead);
|
||||
// workaround for bug #2697027
|
||||
headers->OptionalHeader.MajorImageVersion = 6;
|
||||
headers->OptionalHeader.MinorImageVersion = 0;
|
||||
} catch (std::runtime_error& err) {
|
||||
ERROR_MSG("Error updating PE headers: %s\n", err.what());
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2436,6 +2451,9 @@ int CEXEBuild::write_output(void)
|
|||
return PS_ERROR;
|
||||
}
|
||||
|
||||
// Final PE touch-ups
|
||||
RET_UNLESS_OK( UpdatePEHeader() );
|
||||
|
||||
RET_UNLESS_OK( pack_exe_header() );
|
||||
|
||||
|
||||
|
|
|
@ -247,6 +247,7 @@ class CEXEBuild {
|
|||
void PrepareHeaders(IGrowBuf *hdrbuf);
|
||||
int SetVarsSection();
|
||||
int SetManifest();
|
||||
int UpdatePEHeader();
|
||||
|
||||
int resolve_jump_int(const char *fn, int *a, int offs, int start, int end);
|
||||
int resolve_call_int(const char *fn, const char *str, int fptr, int *ofs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue