Plugins used both in uninstaller and installer problems should be fixed now
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1817 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5abd9f0dde
commit
83b92fb6ea
3 changed files with 14 additions and 10 deletions
|
@ -134,23 +134,26 @@ void Plugins::GetExports(char* pathToDll,bool displayInfo)
|
||||||
|
|
||||||
bool Plugins::IsPluginCommand(char* token)
|
bool Plugins::IsPluginCommand(char* token)
|
||||||
{
|
{
|
||||||
return GetPluginDll(token, 0) ? true : false;
|
return GetPluginDll(0, token, 0) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* Plugins::GetPluginDll(char* command, int* dataHandle)
|
char* Plugins::GetPluginDll(int uninst, char* command, int* dataHandle)
|
||||||
{
|
{
|
||||||
char* ret = m_commands.find(command, dataHandle);
|
char* ret = m_commands.find(command, dataHandle);
|
||||||
if (dataHandle && ret)
|
if (dataHandle && ret) {
|
||||||
*dataHandle = ((int*)m_dataHandles.get())[*dataHandle];
|
if (uninst) *dataHandle = ((int*)m_uninstDataHandles.get())[*dataHandle];
|
||||||
|
else *dataHandle = ((int*)m_dataHandles.get())[*dataHandle];
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plugins::SetDllDataHandle(char* command, int dataHandle)
|
void Plugins::SetDllDataHandle(int uninst, char* command, int dataHandle)
|
||||||
{
|
{
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
m_commands.find(command, &idx);
|
m_commands.find(command, &idx);
|
||||||
if (idx == -1) return;
|
if (idx == -1) return;
|
||||||
((int*)m_dataHandles.get())[idx] = dataHandle;
|
if (uninst) ((int*)m_uninstDataHandles.get())[idx] = dataHandle;
|
||||||
|
else ((int*)m_dataHandles.get())[idx] = dataHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -14,12 +14,13 @@ class Plugins
|
||||||
public:
|
public:
|
||||||
void FindCommands(char*,bool);
|
void FindCommands(char*,bool);
|
||||||
bool IsPluginCommand(char*);
|
bool IsPluginCommand(char*);
|
||||||
char* GetPluginDll(char*, int*);
|
char* GetPluginDll(int, char*, int*);
|
||||||
void SetDllDataHandle(char*, int);
|
void SetDllDataHandle(int, char*, int);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DefineList m_commands;
|
DefineList m_commands;
|
||||||
GrowBuf m_dataHandles;
|
GrowBuf m_dataHandles;
|
||||||
|
GrowBuf m_uninstDataHandles;
|
||||||
int m_funcsCount;
|
int m_funcsCount;
|
||||||
|
|
||||||
void GetExports(char*,bool);
|
void GetExports(char*,bool);
|
||||||
|
|
|
@ -3741,7 +3741,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
{
|
{
|
||||||
int ret, data_handle;
|
int ret, data_handle;
|
||||||
|
|
||||||
char* dllPath = m_plugins.GetPluginDll(line.gettoken_str(0), &data_handle);
|
char* dllPath = m_plugins.GetPluginDll(uninstall_mode, line.gettoken_str(0), &data_handle);
|
||||||
if (dllPath)
|
if (dllPath)
|
||||||
{
|
{
|
||||||
if (uninstall_mode) uninst_plugin_used = true;
|
if (uninstall_mode) uninst_plugin_used = true;
|
||||||
|
@ -3767,7 +3767,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
||||||
build_datesave=0; // off
|
build_datesave=0; // off
|
||||||
ret=do_add_file(dllPath,0,0,linecnt,&files_added,tempDLL,2,&data_handle); // 2 means no size add
|
ret=do_add_file(dllPath,0,0,linecnt,&files_added,tempDLL,2,&data_handle); // 2 means no size add
|
||||||
if (ret != PS_OK) return ret;
|
if (ret != PS_OK) return ret;
|
||||||
m_plugins.SetDllDataHandle(line.gettoken_str(0),data_handle);
|
m_plugins.SetDllDataHandle(uninstall_mode, line.gettoken_str(0),data_handle);
|
||||||
build_overwrite=old_build_overwrite;
|
build_overwrite=old_build_overwrite;
|
||||||
build_datesave=old_build_datesave;
|
build_datesave=old_build_datesave;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue