From dfb549d324939fa70a74808b35e5d53627f141c7 Mon Sep 17 00:00:00 2001 From: justin1014 Date: Sat, 21 Sep 2002 18:49:49 +0000 Subject: [PATCH] updated to new exdll interface. note that /TIMEOUT must come before command now. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1122 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/nsExec/nsExec.dsp | 10 +-------- Contrib/nsExec/nsExec.txt | 4 ++-- Contrib/nsExec/nsexec.c | 10 +++------ Contrib/nsExec/nsexec.h | 4 ---- Contrib/nsExec/nsis.c | 26 ---------------------- Contrib/nsExec/nsis.h | 46 --------------------------------------- 6 files changed, 6 insertions(+), 94 deletions(-) delete mode 100644 Contrib/nsExec/nsexec.h delete mode 100644 Contrib/nsExec/nsis.c delete mode 100644 Contrib/nsExec/nsis.h diff --git a/Contrib/nsExec/nsExec.dsp b/Contrib/nsExec/nsExec.dsp index 793b4c4e..81ed9f42 100644 --- a/Contrib/nsExec/nsExec.dsp +++ b/Contrib/nsExec/nsExec.dsp @@ -61,21 +61,13 @@ LINK32=link.exe SOURCE=.\nsexec.c # End Source File -# Begin Source File - -SOURCE=.\nsis.c -# End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File -SOURCE=.\nsexec.h -# End Source File -# Begin Source File - -SOURCE=.\nsis.h +SOURCE=..\ExDLL\exdll.h # End Source File # End Group # Begin Group "Resource Files" diff --git a/Contrib/nsExec/nsExec.txt b/Contrib/nsExec/nsExec.txt index b3acfffe..5cb9b950 100644 --- a/Contrib/nsExec/nsExec.txt +++ b/Contrib/nsExec/nsExec.txt @@ -5,11 +5,11 @@ without opening a dos box. Usage ----- -nsExec::Exec path [/TIMEOUT=x] +nsExec::Exec [/TIMEOUT=x] path -or- -nsExec::ExecToLog path [/TIMEOUT=x] +nsExec::ExecToLog [/TIMEOUT=x] path Both functions are the same except ExecToLog will print the output to the logwindow. diff --git a/Contrib/nsExec/nsexec.c b/Contrib/nsExec/nsexec.c index f6565c22..4dde5f06 100644 --- a/Contrib/nsExec/nsexec.c +++ b/Contrib/nsExec/nsexec.c @@ -1,6 +1,6 @@ #include #include -#include "nsexec.h" +#include "../exdll/exdll.h" #ifndef true #define true TRUE @@ -29,9 +29,7 @@ int my_atoi(char *s); void __declspec(dllexport) Exec(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { g_hwndParent=hwndParent; - g_stringsize=string_size; - g_stacktop=stacktop; - g_variables=variables; + EXDLL_INIT(); { ExecScript(false); } @@ -39,9 +37,7 @@ void __declspec(dllexport) Exec(HWND hwndParent, int string_size, char *variable void __declspec(dllexport) ExecToLog(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { g_hwndParent=hwndParent; - g_stringsize=string_size; - g_stacktop=stacktop; - g_variables=variables; + EXDLL_INIT(); { ExecScript(true); } diff --git a/Contrib/nsExec/nsexec.h b/Contrib/nsExec/nsexec.h deleted file mode 100644 index 25b7cc54..00000000 --- a/Contrib/nsExec/nsexec.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef nsexec_h -#define nsexec_h -#include "nsis.h" -#endif \ No newline at end of file diff --git a/Contrib/nsExec/nsis.c b/Contrib/nsExec/nsis.c deleted file mode 100644 index 9cbb3d65..00000000 --- a/Contrib/nsExec/nsis.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include "nsis.h" - -int popstring(char *str) { - stack_t *th; - if (!g_stacktop||!*g_stacktop) return 1; - th=(*g_stacktop); - lstrcpy(str,th->text); - *g_stacktop = th->next; - GlobalFree((HGLOBAL)th); - return 0; -} - -void pushstring(char *str) { - stack_t *th; - if (!g_stacktop) return; - th=(stack_t*)GlobalAlloc(GPTR,sizeof(stack_t)+g_stringsize); - lstrcpyn(th->text,str,g_stringsize); - th->next=*g_stacktop; - *g_stacktop=th; -} - -char *getuservariable(int varnum) { - if (varnum<0||varnum >= __INST_LAST) return NULL; - return g_variables+varnum*g_stringsize; -} diff --git a/Contrib/nsExec/nsis.h b/Contrib/nsExec/nsis.h deleted file mode 100644 index 83e0b380..00000000 --- a/Contrib/nsExec/nsis.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef nsis_h -#define nsis_h - -typedef struct _stack_t { - struct _stack_t *next; - char text[1]; -} stack_t; - -enum { - INST_0, // $0 - INST_1, // $1 - INST_2, // $2 - INST_3, // $3 - INST_4, // $4 - INST_5, // $5 - INST_6, // $6 - INST_7, // $7 - INST_8, // $8 - INST_9, // $9 - INST_R0, // $R0 - INST_R1, // $R1 - INST_R2, // $R2 - INST_R3, // $R3 - INST_R4, // $R4 - INST_R5, // $R5 - INST_R6, // $R6 - INST_R7, // $R7 - INST_R8, // $R8 - INST_R9, // $R9 - INST_CMDLINE, // $CMDLINE - INST_INSTDIR, // $INSTDIR - INST_OUTDIR, // $OUTDIR - INST_EXEDIR, // $EXEDIR - INST_LANG, // $LANGUAGE - __INST_LAST -}; - -int g_stringsize; -stack_t ** g_stacktop; -char * g_variables; - -int popstring(char *str); -void pushstring(char *str); -char * getuservariable(int varnum); - -#endif \ No newline at end of file