The hosts on my network are a mix of 7-Zip (various versions) .exe and .msi based installs. If i do a .msi based install without first uninstalling the .exe version it will leave some files from the .exe based install intact as well as an entry in "Add/Remove Programs".

I want create *.msi package that uninstall existing .exe based installs of 7-Zip before install new version 7-Zip.

I get *.msi installer from 7z465.msi
and i need execute this *.bat-command before install:
%PROGRAMFILES%\7-Zip\Uninstall.exe" /S
how to change the default *.msi 7zip-installer to add the desired functional?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
If the most up-to-date version you want to install is in MSI format already, you should create a transform to apply against the MSI. In that transform, you would run the uninstall for the previous version via a Custom Action (CA). That CA should be conditioned so that it only runs if the product is currently not installed. If the MSI is of your creation, then simply add the CA directly to the MSI.

Presumably, the ARP entries which are being left behind are ones which don't use Windows Installer GUIDs in the 'HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall' registry branch but which instead use proper names? If so, add the offending entries to the RemoveRegistry table.
Answered 02/13/2010 by: VBScab
Red Belt

Please log in to comment
0
VBScab, thanks for reply!
I want use already existing .msi package
What software for trasform that msi and add (CA) you can recomend?
Answered 02/16/2010 by: karapetyan
Senior Yellow Belt

Please log in to comment
0
There are, to all intents and purposes, only two players in MSI authoring: the Wise family of products (Altiris/Symantec) and the InstallShield family (Flexera Software). These are not free: in fact, there are quite expensive. You *can* create transforms using a direct editor like Orca (free and part of the Windows Installer SDK) and InstEdit but, given - no offence intended - what I suspect is your low level of proficiency with Windows Installer, I wouldn't recommend that route: they are really tools for those who know their way around an MSI.
Answered 02/16/2010 by: VBScab
Red Belt

Please log in to comment
0
thanks
i chose InstallShield open 7-zip.msi installer and create CA that execute VBS

Set oWsh = CreateObject("Wscript.Shell")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
If fso.FileExists(oWsh.ExpandEnvironmentStrings("%ProgramFiles%")&"\7-Zip\Uninstall.exe") Then
pathtopf = oWsh.ExpandEnvironmentStrings("%ProgramFiles%")
pathtosevenkey = chr(34) & pathtopf & "\7-Zip\Uninstall.exe" & chr(34) & " /S"
MsgBox pathtosevenkey
oWsh.Run pathtosevenkey,1,True
End If
Answered 03/18/2010 by: karapetyan
Senior Yellow Belt

Please log in to comment
0
But if i create CA (Execute VBS placed in installer)
executes only first command in VBS...
why?
Answered 03/18/2010 by: karapetyan
Senior Yellow Belt

Please log in to comment
0
ORIGINAL: karapetyan


Set fso = WScript.CreateObject("Scripting.FileSystemObject")



should be

set fso = CreateObject("Scripting.Filesystemobject")

do a search on this forum to find out why wscript object will not run in a custom action
Answered 03/18/2010 by: cygan
Fifth Degree Brown Belt

Please log in to comment
0
Cygan,
thank you very much!
Answered 03/18/2010 by: karapetyan
Senior Yellow Belt

Please log in to comment
0
Guys!
how to make the CA execution only then installing product?
not uninstalling.
Answered 03/18/2010 by: karapetyan
Senior Yellow Belt

Please log in to comment
0
add a condition to your CA that says Not Installed

There's more info on CA's, including a section on commonly used conditions in this AppDeploy article.

Hope this helps

PJ
Answered 03/19/2010 by: pjgeutjens
Red Belt

Please log in to comment
0
ok, thanks!

Set oWsh = CreateObject("Wscript.Shell")
Set fso = CreateObject("Scripting.Filesystemobject")
ver = fso.GetFileVersion(oWsh.ExpandEnvironmentStrings("%ProgramFiles%")&"\7-Zip\7z.exe")
exist = fso.FileExists(oWsh.ExpandEnvironmentStrings("%ProgramFiles%")&"\7-Zip\Uninstall.exe")
if (ver <> "4.65.0.0" and exist) then
pathtopf = oWsh.ExpandEnvironmentStrings("%ProgramFiles%")
pathtosevenkey = chr(34) & pathtopf & "\7-Zip\Uninstall.exe" & chr(34) & " /S"
oWsh.Run pathtosevenkey,1,True
end if
Answered 03/20/2010 by: karapetyan
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity