I haven't used Winbatch to do this in a while but here is what I have. Pretty simple script but I'm doing something wrong:
SoftKey=("Software\Wow6432Node\Vendor\Microedit\[Photoedit]")
ThisDir=DirScript()
If RegExistValue(@REGMACHINE, SoftKey) Then
PEVersion = RegQueryStr(@REGMACHINE, SoftKey)
Else
PEVersion = ("0")
EndIf
If PEVersion == "06.08.0065" Then GOSUB Uninstall
PESoft=StrCat("/i", " ", ThisDir, "PEdit.msi", " ", '"', "TRANSFORMS=PEdit.mst", '"', " ", "/qb")
RunWait('MSIEXEC.EXE', PESoft)
:Uninstall
RunWait('MSIEXEC.EXE', '/x "{009CD0FF-5C2C-4A0B-AFD9-362DA573492A}" /qn')
RunWait('MSIEXEC.EXE', '/x "{1E680FB1-CF68-4A9F-B21E-AE20885CF64D}" /qn')
RunWait('MSIEXEC.EXE', '/x "{7F49943A-3DFF-49CC-B33D-608BFAC58AE6}" /qn')
RunWait('MSIEXEC.EXE', '/x "{E0D5B3AE-FA0A-4794-98C1-67809BE29EDE}" /qn')
Return
I'm pretty sure this is not formatted properly.
RunWait('MSIEXEC.EXE', PESoft)
Thanks
There are a few issues:
1. No need for parentheses when defining strings.
2. You should also remove the backslash before the dataitem.
For Example:
SoftKey="Software\Wow6432Node\Vendor\Microedit[Photoedit]"
3. You should include double quotes around any filenames that contain a space. Since your MSI file could be placed in a directory that contains a space I recommend adding double quotes around the MSI file path.
4. It appears that the msiexec command line expects the /t switch when specifying a transform list: http://technet.microsoft.com/en-us/library/cc759262(v=ws.10).aspx#BKMK_InstallAdvertise
The code should maybe look something like this:
SoftKey='Software\Wow6432Node\Vendor\Microedit[Photoedit]'
ThisDir=DirScript()
If RegExistValue(@REGMACHINE, SoftKey)
PEVersion = RegQueryStr(@REGMACHINE, SoftKey)
Else
PEVersion = '0'
EndIf
If PEVersion == '06.08.0065' Then GOSUB Uninstall
PESoft = StrCat('/i "', ThisDir, 'PEdit.msi" /t"PEdit.mst" /qb')
Pause('Debugging Parameters', PESoft)
RunWait('MSIEXEC.EXE', PESoft)
Exit
:Uninstall
Pause('','Add uninstall code here')
Return
Perhaps,
PESoft = StrCat('/i "', ThisDir, 'PEdit.msi" TRANSFORMS=PEdit.mst /qb')
as the '/t' switch is looking for a semicolon delimited list of paths.