diff --git a/Examples/makensis.nsi b/Examples/makensis.nsi index 664993c8..6ea0ff25 100644 --- a/Examples/makensis.nsi +++ b/Examples/makensis.nsi @@ -11,7 +11,7 @@ ;-------------------------------- ;Configuration -!ifdef NSIS_MAKENSIS64 +!if ${NSIS_PTR_SIZE} > 4 !define BITS 64 !define NAMESUFFIX " (64 bit)" !else @@ -124,7 +124,7 @@ VIAddVersionKey "LegalCopyright" "http://nsis.sf.net/License" ;Installer Sections !macro InstallPlugin pi - !ifdef NSIS_MAKENSIS64 + !if ${BITS} >= 64 File "/oname=$InstDir\Plugins\amd64-unicode\${pi}.dll" ..\Plugins\amd64-unicode\${pi}.dll !else File "/oname=$InstDir\Plugins\x86-ansi\${pi}.dll" ..\Plugins\x86-ansi\${pi}.dll @@ -133,7 +133,7 @@ VIAddVersionKey "LegalCopyright" "http://nsis.sf.net/License" !macroend !macro InstallStub stub - !ifdef NSIS_MAKENSIS64 + !if ${BITS} >= 64 File ..\Stubs\${stub}-amd64-unicode !else File ..\Stubs\${stub}-x86-ansi @@ -237,12 +237,19 @@ ${MementoSection} "NSIS Core Files (required)" SecCore SetOutPath $INSTDIR\Bin File ..\Bin\LibraryLocal.exe - File ..\Bin\RegTool-x86.bin - File /nonfatal ..\Bin\RegTool-amd64.bin + !if ${BITS} >= 64 + File /NonFatal ..\Bin\RegTool-x86.bin + File ..\Bin\RegTool-amd64.bin + !else + File ..\Bin\RegTool-x86.bin + !if /FileExists ..\Bin\RegTool-amd64.bin ; It is unlikely that this exists, avoid the /NonFatal warning. + File ..\Bin\RegTool-amd64.bin + !endif + !endif CreateDirectory $INSTDIR\Plugins\x86-ansi CreateDirectory $INSTDIR\Plugins\x86-unicode - !ifdef NSIS_MAKENSIS64 + !if ${BITS} >= 64 CreateDirectory $INSTDIR\Plugins\amd64-unicode !endif !insertmacro InstallPlugin TypeLib diff --git a/Source/scriptpp.cpp b/Source/scriptpp.cpp index f8eafe95..76742948 100644 --- a/Source/scriptpp.cpp +++ b/Source/scriptpp.cpp @@ -214,14 +214,14 @@ void CEXEBuild::set_date_time_predefines() st.wHour = ltime->tm_hour, st.wMinute = ltime->tm_min, st.wSecond = ltime->tm_sec; st.wMilliseconds = 0; GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, datebuf, sizeof(datebuf)); - definedlist.add(_T("__DATE__"), (TCHAR *)datebuf); + definedlist.add(_T("__DATE__"), datebuf); GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, timebuf, sizeof(timebuf)); - definedlist.add(_T("__TIME__"), (TCHAR *)timebuf); + definedlist.add(_T("__TIME__"), timebuf); #else my_strftime(datebuf, sizeof(datebuf), _T("%x"), ltime); - definedlist.add(_T("__DATE__"), (TCHAR *)datebuf); + definedlist.add(_T("__DATE__"), datebuf); my_strftime(timebuf, sizeof(timebuf), _T("%X"), ltime); - definedlist.add(_T("__TIME__"), (TCHAR *)timebuf); + definedlist.add(_T("__TIME__"), timebuf); #endif } void CEXEBuild::del_date_time_predefines()