Launching my exe after installation (Setup Project)

Icyculyr

Active member
Joined
Feb 26, 2008
Messages
25
Programming Experience
1-3
Hi, I need to have either one of two things happen...
(I am using a setup project)

When my installation finishes, my program is launched..

The way I am doing this now, is passing the install directory to a dll which gets that value (via custom actions), and then launch that process, that works great... except for one thing, it starts under the account SYSTEM, which my program does not work as it should (under the SYSTEM account), I need it to launch under the user installing it...


I thought about trying to launch my application somehow directly from the custom actions? but I don't see how...

Can anyone help me solve this problem?

Thanks
 
See this post from thread Auto Launch Application After Installation.
It's likely you would have found this very quickly using the keywords of your thread title for a forum search :)

ClickOnce deployment also does auto launch after installation by default.
 
Can I put that code into my installer class?

EDIT:
I don't understand what this is, VBSCRIPT?

How can I convert this into Visual Basic .NET code?

Cheers
 
Last edited:
I have gotten it working, but it still starts under the SYSTEM account, just like Process.Start, and ShellExecute, perhaps I am trying to start my application in the wrong way? I have an installer class, which in the FileSystem part of my setup project (installer), it has the primary output, now, I have in CustomActions of my installer, at (install, commit, and uninstall) the primary output for that installer class (dll) and InstallerClass is set to true, now in that installer class I have (dll) it launches my application on the OnCommited() event, is there another way I should be doing this?

Cheers
 
I have attached a project which you can look at if you don't mind, I'd really appreciate it, the project just installs, and launches itself after installation, but the problem (if you press ctrl alt delete, and look at processes) the account for that application is SYSTEM, but it should be your current user (in my case Icyculyr)..

(It's a VB project created in Visual Studio 2008)

I have tried for nearly 8 months now, to get this solved..

So once again please have a look at it, I appreciate any help I get!

Cheers
Icyculyr
 

Attachments

  • Auto Launch After Install.zip
    74.5 KB · Views: 35
Can I put that code into my installer class?
No.
I don't understand what this is, VBSCRIPT?
Yes.
How can I convert this into Visual Basic .NET code?
No. You have to do exactly as that article explains, when I do that it start the app as current user.
I have gotten it working, but it still starts under the SYSTEM account, just like Process.Start, and ShellExecute, perhaps I am trying to start my application in the wrong way?
Likely.
I have an installer class, which in the FileSystem part of my setup project (installer), it has the primary output, now, I have in CustomActions of my installer, at (install, commit, and uninstall) the primary output for that installer class (dll) and InstallerClass is set to true, now in that installer class I have (dll) it launches my application on the OnCommited() event, is there another way I should be doing this?
That sound confusing, and not that way that article explains.
 
I see,
Well I tried it the way I did first, and in custom actions, saw that I could add a .VBS file and I realized that is what it meant,

So I clicked Project - New Item, and I tried to find the option for the .VBS file but I couldn't find it, so what I did was created a .vb file, and renamed it .vbs, so then I put that code that you had in there (after removing the default text the .vb file made),

I went to custom actions, and tried to add it, but I couldn't, it wouldn't let me, I could only add the primary output of something, etc..

Can you explain how I add that .vbs file to the custom actions, so it launches it?

Thanks
 
Hey, Thanks for your help, I got it so the script is running, what I did:

I right clicked desktop, selected txt document and named it WScript.vbs

I opened it with notepad, and added the text in the article...

I then added it to FileSystem, so it's in my project

Now, I added the custom action data [TARGETDIR]\auto.exe under the commit node for WScript.vbs

I built the project, and then clicked install, now at the commit phase of the installation, I get this error:

VB.NET:
There is a problem with this Windows Installer package.
A script requred for this install to complete
could not be run, Contact your support personnel or package vendor.

I assume it is because the code in my script is wrong..

Can you have a look at my project (attached, Visual Studio 2008 Solution)

I'd appreciate to know if I've done something wrong, I copied the text in the article exactly.

Cheers
 

Attachments

  • Auto Launch After Install.zip
    30.4 KB · Views: 34
"[TARGETDIR]\auto.exe" could be a problem, the article says "[TARGETDIR]auto.exe".
 
I tried that, no success, I am not sure why it's not working..

ugh I'll never get a good app now -.-

Thanks for trying guys
 
Thanks again for your help guys, I solved it...

Some reason when the InstallAllUsers property is set to true, it launches under SYSTEM, but when set to false, it launches under the current user
 
Strange, when I installed for all users the app still started under current user account. They must have changed the internals of the installer, my test was with an older version.
 
Yeah, I thought something like that, because someone using 05 tested it for me, and it started under Current User for him with InstallAllUsers, set to true...

Cheers
Icyculyr
 
Back
Top