I´m tring to instal an app that I create with wpf (.NET 4.8), I used Microssoft Visual Studio Installer Projects and these are the steps that I follow:
I add a new proyect to the solution.
In Aplication Folder/Add/Project Output...
Primary output and Localized resorces.
Finally i Build the solution
I loock for the exe in the folder instalation but only there is a .ddl and a .josn.
Thanks.
In sted of Primary outPut, I have used PublishItemsOutputGroup.
# michu. According to your description, there may be a problem with your steps. Please check if the following steps are same with you .
1.Download and install Microsoft Visual Studio Installer Projects.
【Click Extensions in Visual Studio to search for Microssoft Visual Studio Installer Projects to download and install】
2.Create a Setup Project named Setup.
3.Add WPF software primary output DLL file into installer.
【Right-click Setup and select Add/**Project Output...**and modify the "Add Project Output Group" page as follows:】
4.Add installer setup icon file.
【Right-click Setup and select Add/File... and add the APP.ico file as application icon: (I did not add an application icon here.)】
5.Create WPF software shortcut for Desktop.
【Right-click on the generated file and rename it to apptest and drag it to User's Desktop. Then right-click apptest in User's Desktop and select Properties Window…:】
6.Configure the details of WPF software properties.
7.Build Setup Installer.
【Click Build and select Batch Build and modify as follows:】
8.Install.
After the installation is complete, you can see the exe in the installation path.
Related
i've already searched and seen almost all in the web and in the forum, but i can't deal with that.
What I'm trying to do is to obtain an installer and then an exe of my form application by using c# in visual studio 2019.
So, i've followed that tutorial:
https://www.youtube.com/watch?v=fehVTLNQorQ&ab_channel=FoxLearn
so i correctly obtain the setup file. Then, when i launch it, it installs and if i try to run it i get that error: "You're trying to open a file type system .dll"
What i'm doing wrong?
I also structured my main class as in that response:
Changing a source file to compile Main() method in a project, in VS c# console application
I also used that suggested setting (sorry for non english language but it's quite understandable):
Is there somebody that can help me? thanks a lot
Some things you may want to check:
If you have more than one project in your solution, make sure that the main project is marked as Start-up project. On the solution explorer, right- click on the main project and select "Set as start-up project".
If you only have one project in your solution, check that no .exe is being produced in the corresponding bin folder. If it is, go to your project properties, inside Debug, and make sure that the option "Start project" is selected. You can also try to select the option "Start external program" and browse to the .exe in your bin folder (although the result should be the same).
If no .exe is produced, you may want to have a look at this post. It is similar to you problem I think but the other way round. I looks that the UseAppHost should be True for your case
You have to choose "Publish Items" and not "Primary Output" when you add a "Project Output" in "Application Folder" for .Net Core 3.1 in the setup project created by Visual Studio Installer Projects Extension.
# Alessio Orlando.
Based on my test, there is a different step between adding different project to the installer.
For WPF App(.NET Framework) project and Windows Forms App(.NET Framework) project: You could choose Primary output when you add a "Project output" in "Application Folder" in the setup project.
For WPF Application(.NET Core) project and Windows Forms App: As gigiabbrescia said, you have to choose Publish Items when you add a "Project Output" in "Application Folder" in the setup project.
Finally, there will be an .exe file in your installation directory after installing your Setup (Like the picture below). And you could click on your .exe file to run the program.
I have created an installer that takes the primary output from a selection of sub-projects, one of the sub-projects that make up my application is a Windows Service. This service needs to be installed as part of the main application.
So far I have tried adding an installer to the Service project, publishing this separately and installing the resultant Setup.exe as a custom action for the project installer but have not had any success with this method. I would install the thing from the command line, however I'd need to then package in the Visual Studio CMD Tool to get access to the installutil command.
My question is, can I install a Windows Service from a "Visual Studio Installer - Setup Project" as part of a larger project and if so how? As the process has eluded me thus-far.
I suppose I could try having the custom action trigger a script that executes the ServiceInstaller as part of the process, so I'll be trying that.
Thanks in advance
Since VS2013 does not contain the old (VS2010) Visual Studio installer project, I have these suggestions:
Use WiX installer: https://wix.codeplex.com
There is even a service installer template (not tested):
https://visualstudiogallery.msdn.microsoft.com/7f35c8ce-1763-4340-b720-ab2d359009c5
Use VS 2013 install extension
There were many complaints that MS abandoned the old setup project, so they brought it back as an extension:
http://blogs.msdn.com/b/visualstudio/archive/2014/04/17/visual-studio-installer-projects-extension.aspx
I have not yet tested this, but as I understand it, it will bring back the old capabilities of the internal VS setup project type.
I have written some Windows services using VS2010 setup project and even wrote a step-by-step instruction how to do this. Some steps are not self-explanatory, so I use this myself as a guide for service projects.
I did some first tests with WiX, which seems a good solution, however I had not yet used that for service installation.
Another link regarding this topic:
https://superuser.com/questions/727643/installing-a-windows-service-without-visual-studios-installutil-exe
I plan to check my step-by-step instructions regarding service installation with VS2013 soon and probably compare this to WiX, if you are interested, please tell me, I can make this publicly available.
Here are my step-by-step instructions for creating a Windows service.
(you can find this also on http://www.rsprog.de/samplewindowsservice)
File => New => Project...
Visual C# => Windows Desktop => Windows Service
Name: SampleService
"Create directory for solution" checked
In Solution Explorer, select Service1.cs, right-click => Rename
Rename file to SampleService.cs
Select Yes for "... Would you also like to perform a rename ..."
SampleService.cs should be shown in Design View now
Click in the background of the designer view
right-click => Add Installer
(serviceProcessInstaller1 and serviceInstaller1 have been added)
open SampleService.cs in design view
in Properties, set ServiceName to SampleService
open ProjectInstaller.cs in Design View
Click serviceInstaller1
In the Properties window, set the ServiceName property to SampleService.
Set the DisplayName property to Sample Service or something else
(This will be shown later in services console as service name)
Here you can also optionlly set StartType from Manual to Automatic
click serviceProcessInstaller1
Edit Account:
Here you can change if the service will run under a technical account (User)
or e.g. as LocalSystem
If you set it as User, a popup during setup will allow user / password to be set
At Solution right-click => Add => New Project...
Other Project Types => Visual Studio Installer => Setup Project
Name: SampleServiceSetup
Select SampleServiceSetup project, right-click => Add => Project Output...
As Project "SampleService => Primary output" should be already selected,
as Configuration "(Active)" should be already selected.
Press OK
Select SampleServiceSetup project, in properties view:
change InstallAllUsers to True
change ProductName to SampleService (remove Setup at the end)
change Title to SampleService (remove Setup at the end)
By default, the target platform of the setup project is x86.
You can change it here to x64 (TargetPlatform)
Right-click the setup project in Solution Explorer => View => Custom Actions
In the Custom Actions view, right-click the Custom Actions node => Add Custom Action...
Double-click the Application Folder in the list to open it,
select Primary Output from SampleService (Active), and click OK.
("Primary output from SampleService (Active)" was added to the four nodes)
Select SampleServiceSetup project, right-click => View => User Interface
Start => Installation Folder => Properties => InstallAllUsersVisible: change to False
Build solution
Windows Installer has a mutex that prevents multiple installations from running at the same time. For this reason one installer can't call another installer. There's an exception to this but the resulting pattern can't be installed silently and is not a best practice.
You need to research the concepts of a bootstrapper / chainer. InstallShield has one they call suite installers and Windows Installer XML (WiX) has one called Burn.
Also Visual Studio Installer projects are well known by Windows Installer experts for their low quality. I'd consider rewriting that installer using another tool such WiX. I maintain an open source project called Industrial Strength Windows Installer XML (IsWiX - CodePlex) that provides project templates (scaffolding) and graphical designers that make it possible to author an MSI that installs a service without writing a single line of XML by hand. The resulting project is then built by WiX to create an MSI.
Let's say A.exe is the my exe project which runs fine at windows system.
Let's say B.exe is the external third party driver which is required for A.exe. Currently I am installing both projects separately. Now, I want to include the driver into my A.exeinstallation, s that when the user installs A.exe, B.exe automatically gets installed first.
How should I do that?
See the documentation:
From the Project menu, select Add and click File.
Find the folder that contains MyApplication.exe and MyLibrary.DLL and select them both.
In the File System window, right-click on Application Folder, point to Add and click Create to create a new folder. Call it MyLibrary.
Click on Application Folder again, select MyLibrary.DLL and drag it to the MyLibrary folder.In Solution Explorer, under your project in Detect Dependencies you should see that the Visual Studio detects dependencies on MFC90.dll and MSVCR90.dll. You must add the corresponding Merge Modules for these DLLs.
From the Project menu, point to Add and click Merge Module. Select Microsoft_VC90_CRT_x86.msm and Microsoft_VC90_MFC_x86.msm, and click OK. For the debug versions of these merge modules, select Microsoft_VC90_DebugCRT_x86.msm and Microsoft_VC90_DebugMFC_x86.msm.
For VS2010 deployent examples take a look here.
I'm writing a windows application in c#,FW3.5 & Visual Studio 2008. I need to attach one or more datafiles to the installation.
The requirement is that when the end user installs the application, a folder will be created and the datafile will be put in this folder.
Is there a way to do this by amending the publish settings in Visual Studio or perhaps even do it programmatically?
Thanks for any advice.
Just thought I'd add that it's for a software package shipped to users on a 3,6 or 12 month licence. The company employee(non-programmer) needs to be able to specify the duration of the licence and which datafiles to ship with it before sending. I had tried unsuccessfully to persuade him to do away with the datafiles and just link directly to a database and now i'm stuck.
Thanks again.
You can create a setup project .Please refer to http://www.c-sharpcorner.com/UploadFile/vishnuprasad2005/SetupProjects12022005022406AM/SetupProjects.aspx
And then choose the application folder, create your directory and add your files to that folder.
Take a look at creating a Visual Studio Installer project. You can use the wizard to create one based on your current C# project. In the VSI project, you can adjust all sorts of things, including creating folders and publishing files to said folders.
just right-click in your project-view your main-project, select add folder, name that folder like you want, right-click it, select add existing element and choose the file you want to add.
Remember to deliver it with your release!
P.S.: This is for VS2008 and 2010! The labels might be namned other, cause I'm using the german language here!
I have developed a wpf application and created setup for that. I am using windows installer for creating setup package. Now I want to include uninstall MyProgram.exe in start menu after installing my package.
I am able to add the exe to run my program after installation. I want to include uninstall MyProgram.exe, ReadMe file, Help File in start menu.
Any suggestions plz help me regarding this.
Thanks in advance,
Ibrahim.
did you have a look at this post?
How to add uninstall option in .NET Setup Project?
You can create an uninstall shortcut and then add this shortcut to your start menu. the post below explains how to add a shortcut to user's desktop, you can get the idea and apply the same things for the start menu.
desktop shortcut icon not showing in web setup project
When you create installation package, it is assigned unique id (Product Code, if i'm not forgetting). You can create a batch file with following line:
#echo off
start /b /l msiexec.exe /x {Product Code}
Now right click on file system tree (in files view of project) and include this batch file. Assign it a nice icon and create entry "Uninstall " to start menu folder for your application.
ps:- just type msiexec.exe in run or cmd window to get more options.
pps:- Product Code is available in properties of your setup project. Select Setup Project in solution tree and open properties tab.