moved manifest generation to a seprate file and added made it support vista's access level extensions
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4751 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f4bfa52981
commit
2f15840257
6 changed files with 108 additions and 8 deletions
|
@ -9,6 +9,7 @@
|
|||
#include "fileform.h"
|
||||
#include "writer.h"
|
||||
#include "crc32.h"
|
||||
#include "manifest.h"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
|
@ -226,6 +227,9 @@ CEXEBuild::CEXEBuild() :
|
|||
|
||||
res_editor=0;
|
||||
|
||||
manifest_comctl = manifest::comctl_old;
|
||||
manifest_exec_level = manifest::exec_level_none;
|
||||
|
||||
enable_last_page_cancel=0;
|
||||
uenable_last_page_cancel=0;
|
||||
|
||||
|
@ -2113,6 +2117,26 @@ int CEXEBuild::SetVarsSection()
|
|||
return PS_OK;
|
||||
}
|
||||
|
||||
int CEXEBuild::SetManifest()
|
||||
{
|
||||
try {
|
||||
init_res_editor();
|
||||
|
||||
string manifest = manifest::generate(manifest_comctl, manifest_exec_level);
|
||||
|
||||
if (manifest == "")
|
||||
return PS_OK;
|
||||
|
||||
res_editor->UpdateResource(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());
|
||||
return PS_ERROR;
|
||||
}
|
||||
|
||||
return PS_OK;
|
||||
}
|
||||
|
||||
int CEXEBuild::check_write_output_errors() const
|
||||
{
|
||||
if (has_called_write_output)
|
||||
|
@ -2273,6 +2297,9 @@ int CEXEBuild::write_output(void)
|
|||
// Setup user variables PE section
|
||||
RET_UNLESS_OK( SetVarsSection() );
|
||||
|
||||
// Set XML manifest
|
||||
RET_UNLESS_OK( SetManifest() );
|
||||
|
||||
try {
|
||||
// Save all changes to the exe header
|
||||
close_res_editor();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue