diff --git a/Contrib/InstallOptions/InstallerOptions.cpp b/Contrib/InstallOptions/InstallerOptions.cpp index 26abfdd1..bd32b129 100644 --- a/Contrib/InstallOptions/InstallerOptions.cpp +++ b/Contrib/InstallOptions/InstallerOptions.cpp @@ -15,7 +15,20 @@ #include #include "resource.h" +#define popstring dontuseme #include "../exdll/exdll.h" +#undef popstring + +static int popstring(char *str) +{ + stack_t *th; + if (!g_stacktop || !*g_stacktop) return 1; + th=(*g_stacktop); + if (str) lstrcpy(str,th->text); + *g_stacktop = th->next; + GlobalFree((HGLOBAL)th); + return 0; +} #define strcpy(x,y) lstrcpy(x,y) #define strncpy(x,y,z) lstrcpyn(x,y,z) @@ -32,7 +45,6 @@ char *STRDUP(const char *c) return lstrcpy(t,c); } - #define FIELD_LABEL (1) #define FIELD_ICON (2) #define FIELD_BITMAP (3) diff --git a/Plugins/InstallOptions.dll b/Plugins/InstallOptions.dll index ccf44f4f..dcace2c0 100644 Binary files a/Plugins/InstallOptions.dll and b/Plugins/InstallOptions.dll differ diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index ad340adc..1ec4e790 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -1042,8 +1042,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar tv.hInsertAfter=TVI_LAST; tv.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_STATE; tv.item.lParam=x; - process_string_fromtab(0,sec->name_ptr); - tv.item.pszText=ps_tmpbuf; + tv.item.pszText=process_string_fromtab(0,sec->name_ptr); tv.item.stateMask=TVIS_STATEIMAGEMASK|TVIS_EXPANDED; { @@ -1098,8 +1097,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (tv.hItem=hTreeItems[x]) { tv.mask=TVIF_TEXT; - process_string_fromtab(0,ns); - tv.pszText=ps_tmpbuf; + tv.pszText=process_string_fromtab(0,ns); TreeView_SetItem(hwndTree1,&tv); } } @@ -1421,6 +1419,7 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa if (!(inst_flags&CH_FLAGS_DETAILS_NEVERSHOW)) ShowWindow(insthwnd,SW_SHOWNA); else insthwndbutton=NULL; } + progress_bar_pos=0; progress_bar_len=num; g_progresswnd=GetUIItem(IDC_PROGRESS); diff --git a/Source/exehead/util.c b/Source/exehead/util.c index d2f7efdb..00c976be 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -329,7 +329,9 @@ char ps_tmpbuf[NSIS_MAX_STRLEN*2]; char * NSISCALL process_string_fromtab(char *out, int offs) { - return lstrcpyn(out,process_string(GetStringFromStringTab(offs)),NSIS_MAX_STRLEN); + char *p=process_string(GetStringFromStringTab(offs)); + if (!out) return p; + return lstrcpyn(out,p,NSIS_MAX_STRLEN); } void NSISCALL myitoa(char *s, int d) { wsprintf(s,"%d",d); }