[wpkg-users] How to handle unknown uninstaller name?

Kevin Keane subscription at kkeane.com
Sun Sep 6 16:33:35 CEST 2009


Pendl Stefan wrote:
>> I'm trying to create a package.xml file for Aspell and a couple of
>> dictionaries.
>>
>> The problem I am having is how to create the <remove> entry.
>> Aspell uses
>> an uninstaller of the style
>>
>> "%PROGRAMFILES%\Aspell\uninsXXX.exe"
>>
>> where XXX is a number.
>>
>>     
>
> You can use FOR and %ComSpec%, but that will remove from 000 to x.
>
> You can count with FOR too, if you know the exact number of files:
>
> <remove cmd='%ComSpec% /c FOR /L %C in (9,-1,0) do "%PROGRAMFILES%\Aspell\unins00%C.exe"' />
>
> If the number exceeds 9 you need to add another line as follows:
>
> <remove cmd='%ComSpec% /c FOR /L %C in (99,-1,10) do "%PROGRAMFILES%\Aspell\unins0%C.exe"' />
>
> You need at least Windows XP to make this work, I think.
>
> The other solution is creating a file containing all the unins... file names, sorting it in reverse order and run each of the files.
>
> For batch scripting, you can find many hints at http://www.robvanderwoude.com/.
>
> You could create a JS script or batch file to do this too, so you could add more error checking there
Thank you and Tomasz for your suggestions! In the end, this is really 
only a partial solution because it doesn't allow removing only one of 
the packages involved and leaving the others intact. For my needs, it is 
sufficient, just feels inelegant...

There is a second scenario where the same issue also arises. Gimp, 
Gnucash, PDFCreator and quite a few other applications use the same 
installer, and if you reinstall them manually, you may also end up with 
such a non-000 uninstaller. In that case, the FOR loop should do the 
trick, I think.

In either case, do you by any chance know what happens to the return codes?

-- 
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About

Office: 866-642-7116
http://www.4nettech.com

This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.




More information about the wpkg-users mailing list