I have developed an MSI setup with WiX, which includes a windows form application in c# .Net 2.0 framework and a windows service. I have to run my win form exe at windows start-up with User Account and for doing this I have used WTSQueryUserToken at my windows service project. I have written below codes at the OnStart() method of my windows service and followed the link1 and link2 and link3
    protected override void OnStart(string[] args)
    {
        base.OnStart(args);
        //TODO: place your start code here
        ThreadStart starter = new ThreadStart(bw_DoWork);
        Thread t = new Thread(starter);
        t.Start();
    }
    private void bw_DoWork()
    {
        string getSystem32Path = "";
        getSystem32Path = System32_SysWOW64_Folder();
        getSystem32Path = @getSystem32Path + "\\filename.exe";
        try
        {
                 CreateProcessAsUserWrapper.LaunchChildProcess(getSystem32Path);
        }
    }
I have run my set up at win-xp and win-7 with 32 bit and 64 bit machines and it gets installed successfully at all machines but fails to start my win form exe after machine restart.
I want to dump a file at User Profile, but while running my win app is dumping the file at system profile instead of user profile.
I want to run my win form at user account so that it dumps a file at user profile. How to do this? I have used WTSQueryUserToken to accomplish the same but unfortunately it is not working as I want.
Moreover, I have to set .Net Fraqmework 4.0 for my windows service project but all other project like win form project is running at .net Framework 2.0. I want to run my set up at .Net framework 2.0 and my win form should run at User Account. How can I do this?
Any kind of help in this regard will be highly appreciable.