[wpkg-users] How to handle unknown uninstaller name?
Pendl Stefan
stefan.pendl at haidlmair.at
Sun Sep 6 16:01:55 CEST 2009
>
> 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.
---
Stefan
More information about the wpkg-users
mailing list