开发者

Is it OK to run an MSI from the Temp directory?

I ready in the book "The Definitive Guide to Windows Installer" (Phil Wilson - Chapter 14 - "Bootstrappers and Temp Folders") that a bootstrapper should not run an MSI from the temp directory, because the "Temp folder can be removed all too easily.. and then the file could be gone when you do repair or modification of the product.

Is this true? I thought that when MSIEXEC starts installing an MSI, it makes a copy somewhere in the C:.. So a modify/repair would not use the original MSI in the Temp directory. 开发者_Python百科Do you agree, or dissagree with me (or with Phil).


Well, yes it does make a copy... but any embedded CABs in the MSI are stripped before the MSI is cached. Otherwise every install you make, would require double the disk space - once for the installed files, once for the cached ones.

A number of bootstrappers will make a copy of the original MSI in "%Windir%\Downloaded Installations" (or similar) and run the installer from there - ensuring that any embedded CAB files are still available should you later need to run a repair, or embedded files are required by particular CA's during uninstall.

So while you might be able to get away with running the MSI from the temp folder, you can still run into problems. I've experienced this myself when downloading an MSI to the desktop and deleting it on completion of install.

The best way I find to think about it is in the context of network deployments, say you've got a really large compressed MSI file with embedded CAB files that is being deployed across your network - it doesn't make sense to cache both the MSI and the entire source files (doubling the disk space required for installation) when Windows Installer can strip the CAB files, leaving a much smaller amount of local data cached on each PC.

Depending on the way your install is authored, you might be able to uninstall without the original source, but you might not. Rather than assume the worst case Windows Installer only caches what is needed and assumes that it can access the original source (CD, network share, downloaded file, etc) if the original CABs are ever required for a repair or uninstall.

Basically, put the MSI somewhere, install it, delete it, and try to uninstall. If you succeed, you'll have no problems. If you get asked for the source file, then you've run into the issues that Phil is describing :)

Edit: As Michael points out in the comments below, it's also worth trying to repair with the MSI deleted/not available as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜