Click here to Skip to main content
Click here to Skip to main content

How to add prerequisites in visual studio .net 2005 setup

By , 7 Apr 2007
 

Introduction

Before A few days I got a solution how to build customize setup in visual studio.net 2005 and 2003 that I am posting here for all my friends.

Adding Setup project to main project

Every one is knowing that when we create project or application in .net finally in deployment there are certain dependences that needs to be added in setup of that project or application

Now all knows how to add new setup project let me explain that also

Select File > Add > New Project

Then you will get one selection dialog box from that select

other project type > Setup and deployment > Setup Project or Web setup project

as per your application of project

now this newly added project will be added in your solution explorer tree select that

Setup project right click on it and add project out put and all necessary merge modules as

you have used in your project

now main thing adding perquisites to deployment

Right click on your setup project select properties

You will get following fig1

Screenshot - fig1.jpg

Select Prerequisites as shown in fig and you will ger second fig as shown below

Screenshot - fig2.jpg

Select prerequisite that you need to Select all then and one more thing

Select second option button that

"Download prerequisite from same location as my application "

This will add all prerequisites with your setup and notice that bydefault setting is

download from specified location so dont forget to change it


License

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

About the Author

Patel Vinay
Web Developer
India India
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 1memberafaz28 Jun '11 - 18:19 
x
Generali didn't get the prerequesitsmember07aneesh9 May '10 - 23:38 
Hi i got the following error.Pls help.
 
Error 1 The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX35SP1\dotNetFX20\aspnet.msp' in item '.NET Framework 3.5 SP1' can not be located on disk. See Help for more information.
 
ok Thanks
Aneesh A.S
GeneralMy vote of 1memberUKCodeMonkey15 Jul '09 - 0:25 
Nothing more than what's already in the MSDN!
QuestionHi! Can you help me with prerequisites from my website?membercre8810 Jul '09 - 4:04 
I want my application setup to download prerequisites from my website.
I use this URL http://www.mywebsite.com/support/ where I put that folders DotNetFX and WindowsInstaller3_1.
The problem is that when I try to install my application it goes for prerequisites on Microsoft site not on my website.
Can you help me please?
Thanks! Smile | :)
AnswerRe: Hi! Can you help me with prerequisites from my website?memberPatel Vinay10 Jul '09 - 4:37 
in installation url supply http://www.mywebsite.com/support/[^]
 
and select option says download the prerequisites from following location
 
and in textbox give the same URL
Questioncan u explain for framework 3.5 please?memberNarendra Reddy Vajrala29 Apr '09 - 8:59 
Hi,
Please explain how to add framework in 3.5.
 
i tried but to my project y prerequiries button was in disabled mode.
AnswerRe: can u explain for framework 3.5 please?memberPatel Vinay24 May '09 - 5:03 
where you trying to add that ??
 
which type of project ??
 
please elaborate more
 
Thanks
 
Sorry for too late reply
GeneralRe: can u explain for framework 3.5 please?memberNarendra Reddy Vajrala26 May '09 - 17:30 
hi,
sorry
i finished that project, i made a small research and i got the necessary things.
 
Thanks for reply
Generaluninstallation problemmemberwaquasalig13 Nov '08 - 5:05 
Hi
i have installed software but when trying to uninstall it fron add/remove then it is not removing those folders in which i add some files manually..I want to delete thes folder also after uninstallation.how can i do it using package
 
thanx
AnswerRe: uninstallation problemmemberPatel Vinay14 Nov '08 - 7:56 
hi
 
as you know how to create installation path entry to registry
 
we will utilize that here
 
or you can make one more entry for custom folder
 
than you need to create 2 script files that do work of creating folder and deleting folder
 
this is vbscript to create folder
 

 
strDirectory = readfromRegistry("HKEY_CURRENT_USER\Software\MIS\MEDIAPATH", "")
Dim objFSO, objFolder, strDirectory
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder(strDirectory)
 

function readFromRegistry (strRegistryKey, strDefault )
Dim WSHShell, value
 
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
value = WSHShell.RegRead( strRegistryKey )
if err.number <> 0 then
readFromRegistry= strDefault
else
readFromRegistry=value
end if
set WSHShell = nothing
end function
 
 

 
and following is the code to delete the folder
 
 
strFolderPath = readfromRegistry("HKEY_CURRENT_USER\Software\MIS\MEDIAPATH", "")
dim filesys, demofolder
set filesys = CreateObject ("Scripting.FileSystemObject")
set demofolder = filesys.GetFolder(strFolderPath)
demofolder.Delete
 
function readFromRegistry (strRegistryKey, strDefault )
Dim WSHShell, value
 
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
value = WSHShell.RegRead( strRegistryKey )
if err.number <> 0 then
readFromRegistry= strDefault
else
readFromRegistry=value
end if
set WSHShell = nothing
end function
 

 

now step 2
 
open custom action editor in setup project
 
than in rollback and uninstall add the script that delete the folder !!!
 
and in install add the script to create folder
 
you can add the script to copy files also !!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 7 Apr 2007
Article Copyright 2007 by Patel Vinay
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid