Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
581 views
in Technique[技术] by (71.8m points)

winforms - Check if prerequisites are installed before installing a windows installer package

I have a .Net WinForms application developed on .Net 4.0. (windows installer package). The application is dependent on SAP crystal report runtime and MS Access runtime. I need to check if these two prerequisites are installed on the user machine, if not then exit the installer with a dialog box saying installation failed due to missing prerequisites.

[Edit] The image below highlights the type of installer project that I'm working on. It is a old legacy application.

https://i.stack.imgur.com/6sbYe.png

[Edit 2] Here I have created "Search Target Machine" and created "Add Registry Search" - "Search for Crystal Report Runtime"

enter image description here

And created a new "Launch Conditions" under "Launch Conditions" called as "CrystalReportRuntimeInstalled". Somehow this condition is always evaluating to false even when the software is installed. What am i doing wrong?

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

So the way i had to check the registry value was to remove the name "CRRuntime32Version" from RegKey and add it to the "Value" section in the properties of Registry Search as shown in below image.

enter image description here Similarly i created two Registry Search for Microsoft Access Runtime 2013.

enter image description here Note: I created two different Registry Search based on bitness of a machine.

And modified the "Launch Condition" as shown below.

enter image description here Here is the complete "Condition" value set for Microsoft Access Runtime 2013. If there is a better way of checking then please let me know.

enter image description here After doing these changes i built the setup package. Uninstalled the prerequisites and the setup package from my target machine. And while trying to install the set up package got the prompt as shown below.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...