OSDN Git Service

Un-installer: Also remove the shell integration.
authorLoRd_MuldeR <mulder2@gmx.de>
Tue, 20 Oct 2015 20:01:39 +0000 (22:01 +0200)
committerLoRd_MuldeR <mulder2@gmx.de>
Tue, 20 Oct 2015 20:01:39 +0000 (22:01 +0200)
etc/NSIS/setup.nsi
src/Config.h
src/Main.cpp

index af5f55f..1d089a8 100644 (file)
@@ -701,11 +701,12 @@ Section "Uninstall"
 
        ReadRegStr $R0 HKLM "${MyRegPath}" "ExecutableName"
        ${IfThen} "$R0" == "" ${|} StrCpy $R0 "LameXP.exe" ${|}
+       ExecWait '"$INSTDIR\$R0" --uninstall'
 
        Delete /REBOOTOK "$INSTDIR\$R0"
        !insertmacro CleanUpFiles /REBOOTOK
        RMDir "$INSTDIR"
-       
+
        ; --------------
        ; Registry
        ; --------------
index 5e6dd31..7adcdfe 100644 (file)
@@ -35,7 +35,7 @@
 #define VER_LAMEXP_MINOR_LO                                    2
 #define VER_LAMEXP_TYPE                                                RC
 #define VER_LAMEXP_PATCH                                       4
-#define VER_LAMEXP_BUILD                                       1812
+#define VER_LAMEXP_BUILD                                       1815
 #define VER_LAMEXP_CONFG                                       1700
 
 ///////////////////////////////////////////////////////////////////////////////
index 2e81ccc..4f87b2d 100644 (file)
@@ -31,6 +31,7 @@
 #include "Model_FileList.h"
 #include "Model_AudioFile.h"
 #include "Encoder_Abstract.h"
+#include "ShellIntegration.h"
 
 //MUitls
 #include <MUtils/Global.h>
@@ -196,6 +197,14 @@ static int lamexp_main(int &argc, char **argv)
                qDebug(" ");
        }
 
+       //Uninstall?
+       if(arguments.contains("uninstall"))
+       {
+               qWarning("Un-install: Removing LameXP shell integration...");
+               ShellIntegration::remove(false);
+               return EXIT_SUCCESS;
+       }
+
        //Detect CPU capabilities
        const MUtils::CPUFetaures::cpu_info_t cpuFeatures = MUtils::CPUFetaures::detect();
        qDebug("   CPU vendor id  :  %s (Intel=%s)", cpuFeatures.vendor, MUTILS_BOOL2STR(cpuFeatures.intel));
@@ -234,12 +243,9 @@ static int lamexp_main(int &argc, char **argv)
        }
 
        //Kill application?
-       for(int i = 0; i < argc; i++)
+       if(arguments.contains("kill") || arguments.contains("force-kill"))
        {
-               if(arguments.contains("kill") || arguments.contains("force-kill"))
-               {
-                       return EXIT_SUCCESS;
-               }
+               return EXIT_SUCCESS;
        }
        
        //Self-test