PDA

View Full Version : Extending uninstallation (v2.13)



castaway
11-05-2001, 07:41 AM
Hi,

I've just written a nice IsUn32ex.exe to remove several files and registry entries created by my program.

However I've just noticed that the custom uninstaller executes my code even if the user chooses not to uninstall the program, this doesn't seem very logical to me. Is there any way to change this?

(My code is in the PreInstall function at the moment)

(No, we do not want to upgrade to v3 at the moment..)

C.

castaway
11-06-2001, 03:24 AM
Since nobody seems to know this..

How does it work in the newest version ?

Jess

Chandima
11-06-2001, 10:51 AM
I am not too familiar with Express 2.X so I can't give any usefull answers. However I can tell you whether this can be done with Express 3.X.

I am not quite sure what you are trying to accomplish though. When do you want to launch this Exe of yours? You just want to launch this exe but NOT uninstall your application?

castaway
11-06-2001, 11:03 AM
Hi,

What I am trying to do is delete some files which are not created by the install procedure, but need to be deleted when uninstalling my programm.

With 2.13 it is possible to recompile the IsUn32.exe (the uninstallshield), and add code to a PreInstall or PostInstall function to do this.
The problem there is, that the code is executed even if the user clicks 'no' in the dialog box 'Do you really want to remove this programm' (Or whatever it says :)

So, I am trying to remove files, but only if the rest of the programm is removed!

Does that help?

Jess

Chandima
11-06-2001, 11:11 AM
Oh I see. With Express 3.X you can use this exe you created as a Custom Action that is launched during uininstallation. In Express 3.X when you choose the entry in Add/Remove Programs it launches a dialog we call the "Maintenance Dialog". This gives the user the options to Modify, repair or remove the application. So if the user selects "Remove" the application is uninstalled. Further these Custom Actions are scheduled to work on dialogs. So you can schedule this to run after the "Install Complete" dialog (during uninstall). So that means if the uninstall was complete, only then will this dialog be launched. And your Custom Action will launch only of this dialog shows. So, your exe will be triggered only if successfully installed. Does that cover you requirements?

If so try it with the Express Eval and then make up your mind. The Express 3.X (technically) should co-exist with Express 2.X.

castaway
11-07-2001, 02:07 AM
That sounds like an improvement :)

Then I have another 2 questions:

1. Can I also launch my Custom Action before the actual uninstall? (It removes files which then allows the uninstall programm to properly remove the rest of the directory structure)

2. We looked at 3.X, and decided not to use it yet, because we are currently editing the .iwz file in the course of the build process, so that it is not dependent on a specific root directory..

(E.g. in the standard .iwz file, the directory of the included files is set to %PROJECT%\blah, our build has a script which replaces this with the actual project directory)

The .iwz files in version 3.X aren't text any more, so how would I do this?

Thanks,

Jess

Chandima
11-07-2001, 09:51 AM
1. Yes. During uninstallation you can launch a Custom Action after the "Ready to Remove" dialog. This means the action will launch only if the user decided to uninstall, but before any System Changes take place (You can even launch it "Before System Changes" which is pretty much the same thing)

2. I am not sure how this will work. Express 2.x was based on InstallScript, but Express 3.x is based on the Microsoft Windows Installer technology. That's why the 3.x project really isn't in a text format. To be honest I didn't know you could actually write/edit script in 2.X :) I don't see why you cannot implement you project in 3.x though. Maybe the Windows Installer actually does some of the things you are writing script for. Also Express 3.X does a fairly good migration of 2.x projects.

FYI - However if you really want to continue scripting as well as use the Windows Installer, your best bet would be to try InstallShield Developer 7.01. This is what most of our Professional users are switching to because it supports both Script as well as Windows Installer. I know this might not be an option now but I have to let you know about it :)

castaway
11-07-2001, 10:41 AM
Hmm.. I'm not sure if you understood me correctly..
We're not using ISX scripts, but an external one (its perl :) which just changes some paths in the .iwz file before it is compiled.

If these could be chosen relative instead of absolute to the current directory, that would also solve the problem..

I could take a look at the developer edition..

Jess

Chandima
11-07-2001, 03:30 PM
So you mean you are using Perl scripts to alter the iwz file BEFORE you build? I am not sure whether these scripts will work with the 3.X ism files though...

Do you think you can achieve the same thing through VBScript at runtime? Express 3.5x can run VBScripts along with the install.

castaway
11-08-2001, 02:41 AM
Correct, that is what we are doing.

Like I said, the paths to the files needed for the build are variable, at least the root path to the files is, so we have a script to change them so that we don't have to have the same file structure on every machine we build on.

The 3.X files are not text but binary, so this won't work there.

I've no idea if it will work with VBScripts.. I just need to be able to change the paths of the files that ISX puts in the build...

Jess

Chandima
11-08-2001, 09:18 AM
I see. I have one last suggestion. InstallShield Developer 7 comes with a fully supported Automation Layer. This lets you interact with the ism (project file) through VB or VBScript on the COM level. You can do almost anything, from adding files, features, shortcuts, merge modules, and Custom Actions (and of course deleting them) to creating and configuring releases and building them without even opening the IDE. So you can get your script to add the files from wherver you want, and even build the project without launching the IDE. I am sure that should meet your requirements. If you have any questions regarding the Automation Layer of Developer 7, just feel free to ask.

castaway
11-09-2001, 03:48 AM
Thanks for the help..

I just looked at the prices tho, and its not really feasible.. We need two copies, and just for this one missing feature, we wouldn't get it past the boss.. I'll stick with ISX 2.13

I managed to solve my other problem, through kind of cheating.. (Putting my custom uninstall stuff in the PostUninst function, and checking there if certain things have been removed, before running my own code..)

Jess

Chandima
11-09-2001, 09:32 AM
Glad you found a workaround :)