none
make a setup file without need framework

    Question

  • Hi

    My problem is :
    when i make a setup project , when i want to install it on every pc , i need to install framework too.
    how to make a setup project without need to  install framework on target pc (integrating framework in a setup project) ?
    can you explain me step to step pls?

    thanks in advanced

    Jadoogar,

    • Moved by OmegaManMVP Tuesday, June 02, 2009 7:37 PM (From:Visual C# Language)
    Tuesday, June 02, 2009 1:25 AM

Answers

  • Hi,

    You are correct when you say that all programs written with Visual Studio, need .Net Framework. However, you can use Visual Studio to build setup packages that are used just for deploying some 3rd party application files (e.g. EXE or DLL files). These application files need not be created using .Net or Visual Studio in order to package them in your Visual Studio setup.

    If you have a database file (Microsoft Access 2007) and you want your application to connect to it, you will need to install Microsoft Access 2007 on your computer.

    I hope it clears your doubts,
    Sumit

    [Please do not forget to mark as answer for a correct reply.]


    • Proposed as answer by sumitlathwal Wednesday, June 03, 2009 3:07 AM
    • Marked as answer by Jadoogar Wednesday, June 03, 2009 3:10 AM
    Wednesday, June 03, 2009 3:05 AM

All replies

  • Hi,

    You can build your setup to contain a bootstrapper (Setup.exe) file along with the MSI (that contains your application files). The bootstrapper file can be configured to check for prerequisites and also install them. You can follow the steps given below to include a "Setup.exe" bootstrapper file (it will check if .NET Framework is installed and also install it, if needed).

    1. Right click on Setup Project in Solution Explorer of Visual Studio.
    2. Click on Properties.
    3. Click on Prerequisites tab in Properties dialog.
    4. Select the checkbox which says "Create setup program to install prerequisite components".
    5. Select the checkbox for .NET Framework 2.0 in Prerequisites dialog.
    6. Click the radio button which says "Download prerequisites from the same location as my application".
    7. Click OK on both Prerequisites as well as Properties window.

    Now, when you build your project, a "dotnetfx" folder will be created in debug/release directory of your setup project. The "dotnetfx" folder contains the setup for .NET Framework 2.0 and your application will check and install it from the same folder when it finds that .NET Framework is not installed. Please remember to invoke the installation using "Setup.exe" file instead of "MSI" file because "Setup.exe" acts as a bootstrapper which checks prerequisites and also installs them.

    I hope it helps,

    Thanks,
    Sumit

    [ Please do not forget to mark as answer for a correct reply.]

    • Proposed as answer by sumitlathwal Tuesday, June 02, 2009 8:25 AM
    Tuesday, June 02, 2009 4:19 AM
  • thanks for your reply

    i added a Setup project to my solution and i did exactly as you explained but when i build the setup project , it makes a folder with 194 MB size and many subfolders and files.

    If i want to give my installation program to others , whitch file i should give them?

    thanks in advanced


    Jadoogar,
    Tuesday, June 02, 2009 8:29 AM
  • Hi,

    Which version of .Net Framework are you targeting? The example I gave was for creating a setup using Visual Studio 2005 (targeting .Net Framework 2.0).

    However, if you are using Visual Studio 2008 targeting (.Net framework 3.5), it will create a folder named "DotNetFX35 " in debug/release directory of your setup project. This folder (DotNetFX35 ) is bigger in size (around 194 MB) because it also contains the setups for .Net Framework 2.0 and 3.0 along with the setup for .Net Framework 3.5.

    When you want to redistribute your setup file, you will have to include the DotNetFX35 folder with it if you are selecting the option "Download prerequisites from the same location as my application ". Alternatively, you can configure the setup so that it directs the users to install prerequisites from the vendor's site or from another URL where you can keep the DotNetFX35 folder.

    All the above options can easily be configured from the Prerequisites Dialog as explained previously.

    I hope it helps to clear your doubts,
    Sumit

    [Please do not forget to mark as answer for a correct reply.]
    Tuesday, June 02, 2009 8:58 AM
  • thanks for reply

    yes , im using visual studio 2008 and i selected framwork 3.5 , i found what you saied
    so i should distribute my application with DotNetFX35 folder ,

    BUT its not  proper.
    there is no solution to integrate it in setup file? as same as all applications that there is in the world ? if no , so what do  they do to have a little setup file without need to install framework ?


    thanks again for your time.


    Jadoogar,
    Tuesday, June 02, 2009 9:15 AM
  • Hi,

    This is how .Net based setups work. If you are installing an application that is not dependent on .Net Framework, you do not need to check it as a prerequisite or install it while installing your application. However, if your application is dependent on a version of .Net Framework, you must add .Net framework as a prerequisite to your setup project so that the setup bootstrapper file can check and install it if it is missing.

    You cannot integrate the .Net Framework in your setup file. There is no other option but to separately install it from a configurable location specified while building the setup project. All applications built using .Net Framework work this way. Other applications (those which are not built using .Net) might not need similar prerequisites either because they are dependent on some OS file/dll which is assumed to be already present OR because the runtime execution engine is contained within their deployment module.

    If you still have any doubts, please feel free to reply.

    Thanks,
    Sumit

    [Please do not forget to mark as answer for a correct reply.]
    Tuesday, June 02, 2009 9:49 AM
  • If its ur .net 2.0 application than it wont increase above 100mb.
    Just select .net 2.0 and windows installer 3.1 it will b ok.

    If u want to make it in a single file you need to use some advance installer like installsheild,installware,etc.
    There is another u can do is by creating SFX(self extracting archive) and launching setup.exe.
    Tuesday, June 02, 2009 2:17 PM
  • If you know that your clients are connected to the internet then you can use the Prerequisites features to generate a setup.exe that will download the .NET Framework from the internet.   If you are shipping your app and setup on a CD (which is very normal) it's no big deal to have the framework on the CD image. Most "real" products that are MSI-based (like Visual Studio) assume an install from a CD image because that's a common situation.  As far as I know you are not completely correct in saying that all applications in the world incorporate the framework into the setup file. What they actually do is give you that small executable that downloads everything and does the installs. Think about it - a tiny setup program cannot possibly *include* a .NET Framework that occupies 100s of MB.  So to get back to the beginning, if you want a setup that does downloads, use the prerequsite choice that downloads the framework from Microsoft - "the vendor's web site" is the way they describe that, I think.
    Phil Wilson
    Tuesday, June 02, 2009 9:10 PM
    Moderator
  • thanks for your times.

    i have a last question

    "If you are installing an application that is not dependent on .Net Framework, you do not need to check it as a prerequisite or install it while installing your application"

    i thought all programs that are writen with visual studio , they need .Net framework
    am i wrong?
    what kind of programs do not need Framework to run?

    and if i have a database file (microsoft access 2007 ) and i want that my application connect to it without installing microsoft access 2007, is it possible?



    thanks in advanced


    Jadoogar,
    Tuesday, June 02, 2009 9:41 PM
  • Hi,

    You are correct when you say that all programs written with Visual Studio, need .Net Framework. However, you can use Visual Studio to build setup packages that are used just for deploying some 3rd party application files (e.g. EXE or DLL files). These application files need not be created using .Net or Visual Studio in order to package them in your Visual Studio setup.

    If you have a database file (Microsoft Access 2007) and you want your application to connect to it, you will need to install Microsoft Access 2007 on your computer.

    I hope it clears your doubts,
    Sumit

    [Please do not forget to mark as answer for a correct reply.]


    • Proposed as answer by sumitlathwal Wednesday, June 03, 2009 3:07 AM
    • Marked as answer by Jadoogar Wednesday, June 03, 2009 3:10 AM
    Wednesday, June 03, 2009 3:05 AM
  • Hi

    thanks for your time


    Best regards.




    Jadoogar,
    Wednesday, June 03, 2009 3:11 AM
  • HI again
    i have really problem with installation file

    i dont underestand , there are many programs in the world in small size withoud any  prerequisite such as framework.
    so how they do that?
    if there is not possible , so how they make a small setup file?
    there are many softwares , less than 3 MB of size .
    really no body knows how to make a setup file?
    i used advanced installer and some other programs , but they are null.
    its really a joke.
    no body wrote a serious program?
    Monday, June 29, 2009 4:48 AM