Thursday, April 26, 2012

Executing VB Scripts within Inno Setup

While InnoSetup comes with its own programming language and you can use COM or build your own DLLs to do custom tasks, one of the easiest and versatile methods that I have come across is to invoke VB Scripts from within the installer. VB Scripts provide a much more richer set of programming constructs, error handling and are much more documented than Pascal Script (Inno Setups own programming language). While VB Scripts dont come close to what can be achieved by C# or C++ program, then can be a very powerful tool given they are around on all windows systems.

Here is an example of how you can invoke VB Scripts from within Inno Setup:

CommandWithParams := ExpandConstant('{app}\validate.vbs') + ' /Ovalidate.out /D'+ ExpandConstant('{app}') + ' /P"' + DBType; Exec(ExpandConstant('{sys}\cscript.exe'), CommandWithParams, ExpandConstant('{app}'), SW_HIDE, ewWaitUntilTerminated, ResultCode);

No comments:

About Tukeys

Tukeys provides consulting and software services to companies in healthcare and communications that are dealing with technical or scaling challenges. Please reach out to me on LinkedIn.

An interesting quote from John Tukey, who was an American mathematician (1915-2000) -

An approximate answer to the right problem is worth a good deal more than an exact answer to an approximate problem.

Today maths and statistics form the basis of how software is developed and used around us.

About Me

I have over 20 years of experience in healthcare, communications and AI.

I have a passion for defining innovative applications, creating product/technology strategy and solving challenging problems. My product mindset is helpful to any company to find patterns, reduce costs, and gain efficiencies.

I was the VP of Engineering at Vibrent Health, where I led the web, mobile, API and data products that supported one of the largest NIH programs - All of Us Research Program. Our system enrolled almost a million users and collected data from EHRs, surveys and wearables. Before that, I worked at hCentive, a pioneer in health exchanges.

As the CTO of 3CLogic, I helped create the first PC and web-only contact center solution that implemented PBX and CRM functionality as an affordable SaaS solution. As the Chief Architect of NexTone, I was instrumental in the development of SIP and SIP based products. SIP and associated protocols form the basis of modern WebRTC APIs.

If you are a growth company or invest in growing companies that are facing technical or scaling challenges, I can be a tremendous help. Contact me on LinkedIn.

View my complete profile

Featured Post

Random Forest Analysis of U.S. National Epidemiological Survey on Alcohol and Related Conditions (NESARC) data

In 2001/2002, the National Institute on Alcohol Abuse and Alcoholism (NIAAA) conducted the National Epidemiologic Survey on Alcohol and Re...

Blog Archive

Labels