in the custom installer i want to differentiate between if the windows installer run by command prompt or by GUI.

i can check for custom parameter but my command line is already long, i want to use something built-in(parameter).


7 Years
Discussion Span
Last Post by sknake

Why does it matter? You can call the win32 ShellExecute() or C# Process.Start() with parameters the same way you can on the command line or from the run dialog box. It just fires up the installer...

Votes + Comments
this is for day 2(8 left)

what i try to understand is the users interaction with the program. let say you have something.exe, i want to understand if the user clicks on this file with the mouse or runs it using command prompt typing the name of the executable and some parameters.

got it?


But you can create a shortcut with parameters, use the run with parameters, etc etc. Its all just starting a process. What impact does the source of execution potentially have on your application? ie if they opened the application from DOS instead of Explorer you would do __ instead of ___ ?


it is a long story but let say you want to get some statistics about user conventions and want to know how many people run notepad by double clicking notepad.exe or typing notepad in the run prompt in start menu or opening cmd and typing notepad. all runs the same notepad.exe via different ways. tell me how would you gather statistics for that?


In the .msi file you create different shortcuts for the desktop, start menu, etc. and you could add a different parameter to each shortcut.

Start Menu: AppName.Exe -source "StartMenu"
Desktop: AppName.Exe -source "Desktop"

As far as if someone navigates to C:\Progra~1\App\AppName.exe or executes it from DOS .. I don't believe you would be able to tell. Aside from developers I bet 99% of applications are started by start menu or desktop icons. I guess you could scan running processes if no parameters are found to see if they have cmd.exe, dos*.exe, command.com, etc running but then you wouldn't know if they navigated to it with the run dialog box, double clicked by manual navigation in internet explorer, or did "File -- Open" in notepad.exe, change the filter to *.exe, right clicked on a file, and selected run.

You can invoke a new process 999999 different ways so i'm afraid it is impossible to tell


>You can invoke a new process 999999 different ways so i'm afraid it is impossible to tell

so dont expect to have this thread as increase in your solved threads :)


if this works i will add additional 5 days to your reputation(today i made a mistake to repeat day 2, tomorrow i will continue from 4, you cant fool me :) )


Please forgive me for my inaccurate answers earlier!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.