I've got a batch script that I want to run as part of the uninstall process, I've added the script itself as a distributionFile as part of the default component, and call it from within the preUninstallationActionList like so:

<runProgram program="${installdir}/cleanup_config.bat" programArguments="" />

However the script isn't getting run, I can't see any reference to it within the Uninstall log. Is it because of the ${installdir} reference? If so, what is the usual way to reference a file placed in the installation directory during uninstall?

asked 31 May '13, 03:18

A%20Jefferiss's gravatar image

A Jefferiss
56151621
accept rate: 100%


The problem with this was that a previous preuninstall action was failing; I've cleaned that up and it's now running as expected.

link

answered 13 Jun '13, 03:19

A%20Jefferiss's gravatar image

A Jefferiss
56151621
accept rate: 100%

The installer expects the installdir to be defined (the location where the application is installed). This is also the place where the uninstaller is created by default. How are you defining the location in which the files are unpacked? If possible, I would recommend you renaming your parameter to installdir. You could aso define it based on your current variable name but it would involve some more work.

link

answered 31 May '13, 09:33

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Apologies, there is a installdir set within the parameterList, I've put the XML on pastebin: http://pastebin.com/jFy1ZZbj

(31 May '13, 09:55) A Jefferiss

Could you also share your <preUninstallationActionList>?

(31 May '13, 09:59) juanjo ♦♦

Sorry for the delay, I didn't have access to the file over the weekend. I've got two parts to my pre-uninstall, a Windows and Mac, since this is a Windows only script I've just included that part. If you need to see the whole file I'll drop it online.

    <actiongroup>
        <actionlist>
            <runprogram program="taskkill" programarguments="/IM CSRemote*"/>
            <runprogram program="${installdir}/cleanup_config.bat" programarguments=""/>
         </actionlist>
         <rulelist>
             <platformtest type="windows"/>
         </rulelist>
    </actiongroup>

(03 Jun '13, 02:29) A Jefferiss

Does anyone have any ideas?

(07 Jun '13, 03:15) A Jefferiss

Are you defining the installdir as a parameter (directoryParameter)? Are there any other actions before the script is called? Does the file exist?

link

answered 31 May '13, 08:07

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

I'm not defining the installdir anywhere, I thought it was a install variable that gets set to the location of the installation? There's a couple of runProgram calls before to kill off my application if it's running. Yes the file does get copied into the installation directory.

(31 May '13, 08:56) A Jefferiss
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×54
×17

Asked: 31 May '13, 03:18

Seen: 1,418 times

Last updated: 13 Jun '13, 03:19