Windows Application to automate software installs

Hello Everyone!

I am interested in making a windows application for work that would allow me to automate software installs. I want to be able to select software packages to install, hit next and be able to have the application streamline the whole process. Is it possible to do this creating a C++ windows application? I have already begun the process of creating it but figured I would ask in case I was wasting my time.

thanks!
Yes it is possible, and in addition to there being dozens of commercially available packages that do exactly this, I have actually written something like this myself.

For what you want to do, it's almost disappointingly easy. All you'd really do is use the "GetOpenFileName()" function along with the "CreateProcess()" function.

- GetOpenFileName(): http://msdn.microsoft.com/en-us/library/windows/desktop/ms646927(v=vs.85).aspx

- OPENFILENAME: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839(v=vs.85).aspx

- CreateProcess(): http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

The trick is the '-quiet' switch that most installer packages support for exactly this kind of thing. You'll run into the rare instance where some installer does NOT support it or where, more aggravatingly, that switch causes it to skip over critical settings or parts of the installation. But for the most part it really is as simple as that.
Thanks for the reply and info! Are you somehow able to automatically select settings within the installer through these commands? Example, if you were installing a program that you have to hit "next" on or deselect to install Yahoo Toolbar or something along that lines.
Or wait the create process would do just that wouldn't it?
The function "CreateProcess()" will allow you to pass arguments to the installer just as if it were installing from the command line. So anything you could tell it from the command line can be passed to it through this function.

The '-quiet' switch is supposed to tell the package to install the program with all of the default settings and not even pop-up with the GUI. But again, that switch is not always supported.
Awesome, thanks for the information!
Also, now that it has occurred to me what you were saying about the Yahoo toolbar; the lazy solution, as long as you know it isn't malware and so it will actually uninstall, would be to rip off any bundled installations after the fact. The correct way to do this, IMHO, is by using the COM API. But you may be able to get away with extracting the bundled MSI from the installer using 7-zip.

That's good to know, Thanks!
So I have started working on the code for this application and I seem to be running into an issue that I cannot seem to resolve. I know it is probably something stupid but when I check the adobe pro 11 box and hit the install but it deselects the checkbox. Every time you hit the button it either checks/unchecks it, do I have something silly going on with the code below?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
case WM_CREATE:           
                   /*  Create Checkbox  */
                   CreateWindowW(L"button", L"Adobe Professional 11",
                   WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
                   20, 50, 188, 35, 
                   hwnd, (HMENU) 1, NULL, NULL);
                   
                   CheckDlgButton(hwnd, 1, BST_UNCHECKED);
                   
                   /*  Create "Install" Button  */       
                   CreateWindow(TEXT("button"), TEXT("Install"),
                   WS_VISIBLE | WS_CHILD,
                   650, 500, 80, 25,
                   hwnd, (HMENU) 1, NULL, NULL);
                   
           break;
                      
    case WM_COMMAND:      
           
             checked = IsDlgButtonChecked(hwnd, 1);             
             if (checked) {                             
                CheckDlgButton(hwnd, 1, BST_UNCHECKED);                   
                } else {                       
                  CheckDlgButton(hwnd, 1, BST_CHECKED);                  
                 }
                 
           break;
Topic archived. No new replies allowed.