diff --git a/etc/Deployment/_deploy.bat b/etc/Deployment/_deploy.bat index d35a8147..a2070b1f 100644 --- a/etc/Deployment/_deploy.bat +++ b/etc/Deployment/_deploy.bat @@ -104,7 +104,9 @@ REM ------------------------------------------ if "%LAMEXP_REDIST%"=="1" ( copy "..\Redist\*.*" "%TMP_PATH%" ) +copy "..\..\ReadMe.txt" "%TMP_PATH%" copy "..\..\License.txt" "%TMP_PATH%" +copy "..\..\doc\Translate.html" "%TMP_PATH%" REM ------------------------------------------ REM :: CREATE PACKAGES :: REM ------------------------------------------ diff --git a/etc/NSIS/setup.nsi b/etc/NSIS/setup.nsi index f8a251ea..3cc63593 100644 --- a/etc/NSIS/setup.nsi +++ b/etc/NSIS/setup.nsi @@ -313,40 +313,84 @@ FunctionEnd ;-------------------------------- -;Macros +;Macros & Auxiliary Functions ;-------------------------------- !macro PrintProgress Text - SetDetailsPrint textonly - DetailPrint '${Text}' - SetDetailsPrint listonly - Sleep 1000 + SetDetailsPrint textonly + DetailPrint '${Text}' + SetDetailsPrint listonly + Sleep 1000 !macroend !macro CreateWebLink ShortcutFile TargetURL - Push $0 - Push $1 - StrCpy $0 "${ShortcutFile}" - StrCpy $1 "${TargetURL}" - Call _CreateWebLink - Pop $1 - Pop $0 + Push $0 + Push $1 + StrCpy $0 "${ShortcutFile}" + StrCpy $1 "${TargetURL}" + Call _CreateWebLink + Pop $1 + Pop $0 !macroend Function _CreateWebLink - FlushINI "$0" - SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL - DeleteINISec "$0" "DEFAULT" - DeleteINISec "$0" "InternetShortcut" - WriteINIStr "$0" "DEFAULT" "BASEURL" "$1" - WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1" - WriteINIStr "$0" "InternetShortcut" "URL" "$1" - WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll" - WriteINIStr "$0" "InternetShortcut" "IconIndex" "150" - FlushINI "$0" - SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY + FlushINI "$0" + SetFileAttributes "$0" FILE_ATTRIBUTE_NORMAL + DeleteINISec "$0" "DEFAULT" + DeleteINISec "$0" "InternetShortcut" + WriteINIStr "$0" "DEFAULT" "BASEURL" "$1" + WriteINIStr "$0" "InternetShortcut" "ORIGURL" "$1" + WriteINIStr "$0" "InternetShortcut" "URL" "$1" + WriteINIStr "$0" "InternetShortcut" "IconFile" "$SYSDIR\SHELL32.dll" + WriteINIStr "$0" "InternetShortcut" "IconIndex" "150" + FlushINI "$0" + SetFileAttributes "$0" FILE_ATTRIBUTE_READONLY FunctionEnd +!macro TrimStr VarName + Push ${VarName} + Call _TrimStr + Pop ${VarName} +!macroend + +Function _TrimStr + Exch $R1 + Push $R2 + + TrimLoop1: + StrCpy $R2 "$R1" 1 + StrCmp "$R2" " " TrimLeft + StrCmp "$R2" "$\r" TrimLeft + StrCmp "$R2" "$\n" TrimLeft + StrCmp "$R2" "$\t" TrimLeft + Goto TrimLoop2 + TrimLeft: + StrCpy $R1 "$R1" "" 1 + Goto TrimLoop1 + + TrimLoop2: + StrCpy $R2 "$R1" 1 -1 + StrCmp "$R2" " " TrimRight + StrCmp "$R2" "$\r" TrimRight + StrCmp "$R2" "$\n" TrimRight + StrCmp "$R2" "$\t" TrimRight + Goto TrimDone + TrimRight: + StrCpy $R1 "$R1" -1 + Goto TrimLoop2 + + TrimDone: + Pop $R2 + Exch $R1 +FunctionEnd + +!macro GetExecutableName OutVar + !insertmacro GetCommandlineParameter "Update" "LameXP.exe" ${OutVar} + !insertmacro TrimStr ${OutVar} + StrCmp ${OutVar} "" 0 +2 + StrCpy ${OutVar} "LameXP.exe" +!macroend + ;-------------------------------- ;Install Files @@ -358,7 +402,10 @@ SectionEnd Section "!Install Files" !insertmacro PrintProgress "$(LAMEXP_LANG_STATUS_INSTFILES)" - File /r `${LAMEXP_SOURCE_PATH}\*.*` + !insertmacro GetExecutableName $R0 + File `/oname=$R0` `${LAMEXP_SOURCE_PATH}\LameXP.exe` + File `${LAMEXP_SOURCE_PATH}\*.txt` + File `${LAMEXP_SOURCE_PATH}\*.html` SectionEnd Section "-Write Uinstaller" @@ -392,7 +439,7 @@ Section "-Update Registry" WriteRegStr HKLM "${MyRegPath}" "DisplayName" "LameXP" SectionEnd -Section +Section "-Finished" !insertmacro PrintProgress "$(MUI_TEXT_FINISH_TITLE)." SectionEnd @@ -436,18 +483,15 @@ SectionEnd ;-------------------------------- Function CheckForUpdate - !insertmacro GetCommandlineParameter "Update" "error" $R0 - StrCmp $R0 "error" 0 EnableUpdateMode + !insertmacro GetCommandlineParameter "Update" "?" $R0 + StrCmp $R0 "?" 0 EnableUpdateMode StrCmp "$INSTDIR" "" 0 +2 Return - IfFileExists "$INSTDIR\*.*" +2 Return - StrCmp "$EXEDIR" "$INSTDIR" 0 +2 Return - IfFileExists "$INSTDIR\LameXP.exe" +2 Return @@ -470,7 +514,8 @@ FunctionEnd Function LockedListShow !insertmacro MUI_HEADER_TEXT "$(LAMEXP_LANG_LOCKEDLIST_HEADER)" "$(LAMEXP_LANG_LOCKEDLIST_TEXT)" ${If} ${AtLeastWinXP} - LockedList::AddModule "\LameXP.exe" + !insertmacro GetExecutableName $R0 + LockedList::AddModule "\$R0" LockedList::AddModule "\Uninstall.exe" LockedList::AddModule "\Au_.exe" ${EndIf} @@ -494,8 +539,9 @@ FunctionEnd ;-------------------------------- Function RunAppFunction + !insertmacro GetExecutableName $R0 !insertmacro UAC_AsUser_ExecShell "explore" "$INSTDIR" "" "" SW_SHOWNORMAL - !insertmacro UAC_AsUser_ExecShell "open" "$INSTDIR\LameXP.exe" "" "$INSTDIR" SW_SHOWNORMAL + !insertmacro UAC_AsUser_ExecShell "open" "$INSTDIR\$R0" "" "$INSTDIR" SW_SHOWNORMAL FunctionEnd Function ShowReadmeFunction diff --git a/res/tools/wupdate.exe b/res/tools/wupdate.exe index d5622523..00c296b2 100644 Binary files a/res/tools/wupdate.exe and b/res/tools/wupdate.exe differ diff --git a/src/Config.h b/src/Config.h index c9f1a200..75bf2cb9 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 253 +#define VER_LAMEXP_BUILD 258 #define VER_LAMEXP_SUFFIX Beta-1 /* diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp index a768cf04..85765ff4 100644 --- a/src/Dialog_Update.cpp +++ b/src/Dialog_Update.cpp @@ -539,7 +539,8 @@ void UpdateDialog::applyUpdate(void) args << QString("/Location=%1").arg(m_updateInfo->m_downloadAddress); args << QString("/Filename=%1").arg(m_updateInfo->m_downloadFilename); args << QString("/TicketID=%1").arg(m_updateInfo->m_downloadFilecode); - args << QString("/ToFolder=%1").arg(QDir::toNativeSeparators(QApplication::applicationDirPath())); + args << QString("/ToFolder=%1").arg(QDir::toNativeSeparators(QDir(QApplication::applicationDirPath()).canonicalPath())); + args << QString("/ToExFile=%1.exe").arg(QFileInfo(QFileInfo(QApplication::applicationFilePath()).canonicalFilePath()).completeBaseName()); args << QString("/AppTitle=LameXP (Build #%1)").arg(QString::number(m_updateInfo->m_buildNo)); QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/src/Thread_Initialization.cpp b/src/Thread_Initialization.cpp index 100cff68..bab15b12 100644 --- a/src/Thread_Initialization.cpp +++ b/src/Thread_Initialization.cpp @@ -71,7 +71,7 @@ g_lamexp_tools[] = {"8c842eef65248b46fa6cb9a9e5714f575672d999", "valdec.exe", 31}, {"8159f4e824b3e343ece95ba6dbb5e16da9c4866e", "volumax.exe", UINT_MAX}, {"62e2805d1b2eb2a4d86a5ca6e6ea58010d05d2a7", "wget.exe", UINT_MAX}, - {"7380cb661ae7fbda82f3e8ecea6a2776101c9444", "wupdate.exe", UINT_MAX}, + {"f8293dcf0d21dcca2798afaa8e0d1b93b8ced720", "wupdate.exe", UINT_MAX}, {"b7d14b3540d24df13119a55d97623a61412de6e3", "wvunpack.exe", 4601}, {NULL, NULL, NULL} };