]> git.sesse.net Git - vlc/commitdiff
msi: remove older (nsis) version before install
authorLudovic Fauvet <etix@videolan.org>
Fri, 21 Jun 2013 18:27:58 +0000 (20:27 +0200)
committerLudovic Fauvet <etix@videolan.org>
Fri, 21 Jun 2013 18:37:23 +0000 (20:37 +0200)
If a pre-2.1 version is detected it will be uninstalled silently before
proceeding.

extras/package/win32/msi/product.wxs

index 7cde3241c4b35231533862238e57ee5d5f646cee..6cb97f4a9b97949834f73e0f8ea3b499fa705bd8 100644 (file)
@@ -43,6 +43,9 @@
         </Condition>
 
         <MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
+        <Property Id="NSISLOCATION">
+            <RegistrySearch Id="NSISLOCATION" Type="raw" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\VLC media player" Name="UninstallString" />
+        </Property>
 
         <Icon Id="vlc.ico" SourceFile="$(var.SourceDir)/vlc.ico"/>
 
 
         <InstallExecuteSequence>
             <!-- <RemoveExistingProducts After="InstallValidate" /> -->
+            <Custom Action="ExecVLCNSISUninstall" Before="InstallValidate">NSISLOCATION AND NOT Installed</Custom>
             <Custom Action="ExecVLCCacheGen" Before="InstallFinalize">REINSTALL OR NOT Installed</Custom>
             <Custom Action="SetExecVLCCacheGen" Before="ExecVLCCacheGen">REINSTALL OR NOT Installed</Custom>
         </InstallExecuteSequence>
 
+        <!-- Uninstall an older version of VLC (using NSIS) -->
+        <CustomAction Id            = "ExecVLCNSISUninstall"
+                      Directory     = "APPLICATIONFOLDER"
+                      ExeCommand    = "[NSISLOCATION] /S"
+                      Execute       = "immediate"
+                      Impersonate   = "no"
+                      Return        = "check" />
         <!-- Launch silently vlc-cache-gen.exe during install -->
         <CustomAction Id            = "SetExecVLCCacheGen"
                       Property      = "ExecVLCCacheGen"