Click here to Skip to main content
16,004,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am beginner to create windows application setup. and i have requirement to add dot net framework 4.0 or sql express 2008 in my setup.to done this task i am using custom action. but when i run my setup getting a error msg "Another installation process is running". because of mid of my setup process custom action lunch automatically but on that time my main setup is also in running mode. so plz help me.

thanks in adv.
Posted

1 solution

You don't have to rely on custom actions for those.
In Visual Studio 2008 Standard there is a dialogue available using
Setup Project - Properties - Required Components
that, among other possibilities, exposes various versions of the .NET framework and (on my machine) SQL Server Compact 3.5 and SQL Server 2005 Express SP2 (x86).

So I guess, you will find what you need there.

Keep in mind to select "From same location as application" instead of "From distributor's website" or "From here: ..." in the radio button section. Otherwise there will be no data for that stuff packed in your setup package, but just links instead.

[Edit]
Here is code for the discussed possibility to wrap a setup package in another applications resources. Actually this is to unwrap it. This is executed during the wrapper applicaiton's runtime.
C#
// Create a temporary directory to "extract" your setup stuff to
string tempPath = System.IO.Path.GetTempPath();
for (int tempIndex = 0; tempIndex < int.MaxValue; tempIndex++)
{
    string myTempPath = System.IO.Path.Combine(tempPath, tempIndex.ToString());
    if (
        System.IO.Directory.Exists(myTempPath)
        || System.IO.File.Exists(myTempPath)
    )
    {
        continue;
    }
    tempPath = myTempPath;
    break;
}

string setupExePath = null;

// Repeat what is in these braces
//   for all files and directories
//   that are necessary for your setup to work
{
    string fileName = System.IO.Path.Combine(tempPath, "Setup.exe");
    
    // Only for Setup.exe
    setupExePath = fileName;

    using (System.IO.MemoryStream stream = new System.IO.MemoryStream(Properties.Resources.WhatYouCalledYourSetupFileResource))
    {
        System.IO.File.WriteAllBytes(fileName, stream.ToArray());
    }
}

// Execute the original Setup.exe file.
System.Diagnostics.Process.Start(setupExePath);

// Delete the temporary stuff
System.IO.Directory.Delete(tempPath, true);

[/Edit]
 
Share this answer
 
v2
Comments
Shambhoo kumar 31-Jul-13 5:17am    
Thanks for quick reply sir.
i also used this sir, and it's work fine . but it's create a new folder on my setup>debuge location , actually i want only single setup file but in these case that folder must be in my setup>debug folder location . so help me
lukeer 31-Jul-13 7:37am    
Same here. And I have no idea how to prevent it.

But you could build another application. Call it "Something Whatever Setup" so it looks like a setup to the user. Wrap all of the original setup stuff in its resources so it becomes only one executable file.

All that application has to do is running the setup that is wrapped in it along with the other resources.
Shambhoo kumar 31-Jul-13 7:55am    
i can't understand ,plz can u elaborate step by step..
lukeer 31-Jul-13 8:33am    
1) Create the setup package as you already have. With several subdirectories and all.
2) Create a new application. I'd use Windows Forms. Since you don't need the form, you could hide it.
3) Place the complete original setup package in the "Resoures" section of your new application. There are several sub-sections for images, icons and so on including files. So you can store anything in there.
4) When executing your new application, copy everything from the resources to a temporary folder and start the original setup package. Everything should be in place when you start it.
Shambhoo kumar 1-Aug-13 0:33am    
Thanks a lot sir.. for teach me step by step.
i have done all step , but i have no idea, how to call my previous setup in new application setup. and i don't understand your 4th step.

but really it's nice work sir thanks again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900