cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peterbi
Level 7

Copied file removed at uninstall - I don't want

Hi

InstallScript MSI project with IS2008, on Vista.

I changed the project from 'small' upgrade to 'major' upgrade. The database file used to be remained after uninstall now is removed, so I added code at OnMaintUIBefore to copy the file to somewhere (eg. C:\Users\MyTemp), then at the end of OnMaintUIAfter, I will copy it back. It's not working because between OnMoving and OnMoved, the copied file is wiped out! I set msgbox at OnMoving and OnMoved, when msgbox showed up at OnMoving, the copied file is still there, but at OnMoved, it's gone! How could that happens? How does the installer know the copied file? Can I block it?

Log file was created but not much help (nothing mentioned on the copied file, either deleting or creating).

Thanks,
Peter
Labels (1)
0 Kudos
(3) Replies
peterbi
Level 7

Here is the log file (with /v"/l*v"). The file I tried to keep is 'gm_invce.mdb', I really didn't see any explicit clue on it at all (just one case about DSN reg key remove, but it's ok since the deletion of the installed file is expected).

Now I have stuck so long (about a day), I have tried many ways I could think of, i.e. copying the file to different path/location; using Disalbe/Enable(LOGGING); renaming the file, setting folder/file attributes, etc.

The key issue I feel is that between OnMoving() and OnMoved(), the file is deleted by installer (or something else) which it shouldn't. Here is how I do the copying:

=> starting Uninstall
OnMaintUIBefore()
-- Copy the file
OnMoving()
-- Confirmed that the file copying is good (almost all the tried locations are fine)

OnMoved()
-- the copied file disappears!!!!

OnMaintUIAfter()
-- trying to copy the file back, but not existing now.


Can anybody provide a 'rude' program to escape the catch of OnMoving()/OnMoved(), so that the file can surely exists after OnMoved() (or at OnMaintUIAfter())? I don't care where you put the file, and what attributes you set to the folder/file.

It's so bad that the step seems so simple, but I just couldn't make it:mad: It's only one of many user cases that is being affected, but I have to fix it, and it held my process from moving on!!!


Thanks,
Peter
0 Kudos
peterbi
Level 7

Ooops, log file is here
0 Kudos
cnpitroda
Level 5

Do one thing at time of install copy the file you want to your destination. Before this Disable(Logging). So while uninstall, your file will remain at your desired location. If you want to delete the file,you can do it by writing code.
0 Kudos