As per the title, I create a msi installer and then run it and it claims to have successfully installed and if I look in the control panel to add/remove program it appears there. However, when I look in the directory I specified, there is no change made to it. Nothing is copied into it.
When I run the installer and click the button to create a new directory and choose that new directory to install into, I get no errors. It all runs fine, but after exiting the installer, this new directory is not created.
I follow these steps to create my msi installer:
Open Visual Studio and open the project I wish to create installer for
File-> Add -> New Project -> Setup Wizard
Select "Create a setup for Windows Application"
Select "Primary output from (project)"
Add additional file -> path to txt file
Finish setup wizard
Look at Application Folder for setup
Right click primary output from (project)
Click outputs and verify it is correct
Build the setup project
This outputs the .msi file along with the .exe file. There is no problems/errors running either of these. It just doesn't install/copy the files.
Ok, so it was a privileges issue when double clicking the .msi file.
It would run fine and claim to install successfully but it didn't create folders/copy stuff in etc. It needed admin privileges to install.
So, to give it the privileges I edited the .vdproj file that created the .msi file (edited in notepad). I went to the MsiBootstrapper section and changed "RequiresElevation" = "11:FALSE" to "RequiresElevation" = "11:TRUE".
More information can be found here: http://msdn.microsoft.com/en-us/library/2kt85ked.aspx
I'm still not completely happy with this, it requires double clicking the .exe file which gives the UAC prompt to get the .msi file to run with the required privileges. It seems very easy for a user to just double click the .msi file and believe things to have installed...
Related
When I create .msi file for C# windows application, the file <myexename>.exe.config automatically comes in the installation path after installing the .msi setup file.
How to exclude .exe.config file?
I think it is to be done during the Set up creation process itself.
Please advice.
<myexename>.exe.config is a config file (App.config) of your application.
when you create installer for any windows application, it will autometically include it.
it is necessary, for example you stored your application database connection string in that or may be other settings also
so when you execute your application then your application myexename will look into <myexename>.exe.config for some settings as well for some necessary data required.
still, if you want to exclude it, perform the following steps:
1)Right click on installer project -> View -> File System
2)In Application Folder, Right Click on Primary Output of your application and select Properties Window
3)In Properties, Select Exclude Files
4)Click on Add Filter
5)Enter app.config in text and press ok
now rebuild your project and install the .msi
<myexename>.exe.config will be removed from your installation directory
How can I run an embedded .exe file (installer) in C# Windows Forms applications the easiest way?
I just want to click a button and an installer should open. My .exe file's name is setup.
If I try Process.Start(setup.exe); I get an error:
The name 'setup' does not exist in the current context
And if I try
System.Diagnostics.Process.Start("setup");
it will open folder C:\Windows\System32\setup.
If what you expect is the easiest way, then don't embed setup.exe as a resource, but as Content.
(Add setup.exe to your project, and right click on setup.exe in Solution Explorer to edit properties, set as content, and select Copy if newer.)
Another option if setup.exe is a project of your Visual Studio solution, is to automatically copy setup.exe in the output directory of the launcher project: Add a reference to setup.exe if it belongs to the solution, so it is automatically copied every time you compile and there was a change.
Last is the code that is pretty easy - you already have it, actually:
System.Diagnostics.Process.Start("HelloWorld.exe");
If needed, you can change the current directory:
Environment.CurrentDirectory = #"c:\someSetupExeDir";
But better, you can use Path.Combine:
String fullPath = Path.Combine(directoryPath, fileName);
I have created the installer exe file using BA using wix.I want to force the user to open the exe as RUN as Administrator.To do this,I want to show a MessageBox with OK button to user if user double-click or right click and hit->Open.On clicking OK button on MessageBox should Exit the installation.I don't want to open the installer until the user open the file as Run as Administrator.
I want to know
1.Is the above behaviour is possible in wix using custom action or something.
2.Is it possible to detect exe double-click and right-click->Open in c#.
Update:
I have bundled all my two .msi using Wix bootstraper application into single EXE file.
One msi is with per user context which uninstall a application with per user context and install own.
second one is with per machine context and this also installs the files in windows drive.I have bundled both MSI as single EXE.
Now if i open the EXE as Run as Administrator,the EXE is uninstalling the per user package and installation happens successfully. If i directly double click the EXE package, during the removal of per user package i am getting the following exception "Error 1001.An exception occured during uninstalling....->Requested registry access is not allowed". and installation failed.
I tried adding a manifest file in Post Build of BA to include in to EXE package to prompt the administrator privilege during double click. After doing this and building in VS2010, all other two package are not included in EXE file and if i double click the EXE it is showing the UAC and close without installing.
Is any way there to include the two msi and manifest file in bundle.wxs
Thanks
When I publish a program for ftp server (for example ftp://site.com/www/myprog/) and indicates that the user will download from the address http://site.com/myprog/). At first all goes well: in the folder "myprog" lies files of my program and setup.exe. But when the user launch setup.exe there is a error, because it tries to load myprog.application from site.com NOT from site.com/myprog.
The problem is that you actually have to specify in the ClickOnce manifest where the file is located. ClickOnce doesn't assume that the deploy location is where the app should be pulled from. Try verifying the locations in the "Publish" tab of the project's properties screen. Is everything kosher?
I want to deploy my application. i followed this step but i can't get the .exe file. steps:
Step I:
Create one Windows based application in VS.Net using any of the Languages i.e. C# or VB.Net.
Step II:
After your program is running and you are ready for the setup. To add setup to your existing application go to Go to File > Add Project > New Project.
After your program is running and you are ready for the setup. To add setup to your existing application go to Go to File > Add Project > New Project.
The window appears like below and you select the Project as Setup Project and give a Name and its Location.
Step III:
After creating setup project right click on project and than select view, it will show different possible operations, which you can perform with this setup project.
The options available are
File System
Registry
File Types
User interfaces
Custom Actions
Launch conditions
Step IV:
Click on File system, it is used to create file system on the target machine. Through this you can specify what details you want to provide at the target machine.
Step V:
Now in the new window, its time to add the files & folder’s used by the application.
First we add the Project Output file. Click on Project Output and a new popup appears. Select the appropriate choice. For a normal project we select as Primary Output File & Content Files.
it is used to create file system on the target machine. Through this you can specify what details you want to provide at the target machine.
To add Icons/Any specific folders, click on Add > Folder and Folder is added. Rename the folder as per your project requirements
After the Folder is create then add the files to the setup. These will be installed in the same fashion on the target machine
Step VI:
Now we are about to create the setup before that we will setup the program icon. To do it we will do this process :
When you click on Browse, a window gets popup. Now as the icons are already added into the application setup, just click on Browse to pint to that icon and click on ok.
Step VII:
Now final step is compile the setup project. After compilation you will notice that it has generated Setup.msi in the same location which you provided when you initially created the setup project.
You can supply this msi the target machine, when you run this msi at target machine it will create a virtual directory as well as create same folder structure, which you have specified in File System. This installer will also install the specified those libraries in the registry which are specified in the Registry.
Now you can browse that application at the target machine in same way as you have done at your own machine.
What I could understand is, you have got some problem with deploying the EXE file.
This is the best tutorial I have ever seen for creating EXE or MSI files:
http://balanagaraj.wordpress.com/2007/05/29/create-exe-or-setup-file-in-net-windows-application/