cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
coJeff
Level 6

Download cached msi and rollback

I was using the code I found in this thread:
http://community.installshield.com/showthread.php?t=163237&highlight=cached+msi

However for some reason I can't get the rollback to delete the download cache folder. I can't retrieve it in my CA nor will it work with a global variable even if I retrieved the package code in the beginning. I placed the custom action after the MoveFiles event and after the RemoveIniValues event. The happy path works fine if the user installs it and uninstalls it. I would love to get this rollback to work as well. I'm not too worried about getting it to remove old cached installs.

Thanks!
Labels (1)
0 Kudos
(4) Replies
Sairen
Level 7

Part of it may have to do with when your installer is rolling back - I assume you're canceling the install to test the rollback?

Placing the action after MoveFiles seems like a pretty late time. If your rollback occurs before that point, then the action would never be written into the script and does not execute. I think I put my rollback action as quick after InstallInitialize as I could.

If you have a log file, that might be helpful, too - I can't tell from your question if the action isn't being run, if the package code isn't being retrieved, or exactly what might be going on.

- it's a start. 🙂
0 Kudos
coJeff
Level 6

Thanks for responding and thanks for posting the code in the 11.5 forum!

Yes I'm testing the install rollback. I've canceled the install during the OnFirstUIBefore and while it was moving files. Both times when the RemoveCurrentPackage_Rollback runs it doesn't have nor can it retrieve the package code. So the cached msi file still remains. The function is running but the value of the package code is missing. I could input it in the registry but I'm trying to avoid doing that.

Return Process: Ignores Exit code
In Script Execute: Rollback Execution
Install UI Sequence: absent
Install Exec Sequ: After CostFinalize
Install Exec cond: NOT Installed

Like I said the code was executing just fine but it didn't have the package code. I'll admit to not having the best success with custom actions.

Thanks for your help!!
0 Kudos
Sairen
Level 7

What kind of project did you say you were using? I'm guessing an InstallScript MSI since you said something about OnFirstUIBefore...

If it's pure InstallScript, I wouldn't expect these functions to work since they make such heavy use of MSI calls

MsiGetProperty(hMSI, "ProductCode", sProductCode, nBuff);
//MessageBox("Product Code: " + sProductCode, INFORMATION);

nBuffer = MAX_PATH + 1;
MsiGetProductInfo(sProductCode, INSTALLPROPERTY_PACKAGECODE, svOldPkgCode, nBuffer);


In fact, that may be the problem even with an InstallScript MSI...I really have no idea what parts of which beast THAT chimera inherits... Yeah, I'd start researching other ways of fetching a package code and hope someone who knows something about installscript chimes in. 🙂

Best wishes!
0 Kudos
coJeff
Level 6

Thanks again. Yes its Installscript-MSI.

I'll try and come up with something as well.
0 Kudos