My Setup and Deployment project will copy both MyClient.exe, MyClient.Config files to the appropriate directories using the Setup.msi file.
I am trying to enhance the Setup.msi project so that user can enter the configuration values at run time and the setup program can update the file MyClient.Config. I have created a new project and added a windows Form in it with edit boxes. The project will create an application named Helper.exe
I followed the below link and implemented the Custom Actions functionality.
link
But the issue is Setup.msi is always starting the MyClient.exe instead of Helper.exe during the deployment.
Thanks in advance for your help
I'd suggest either using a different tool (this project type is removed from VS2012 and exposes very little of Windows Installer) or move the requirement from the installer to the application (first run configuration).
Related
I'm looking for a way to add new pages to installer with its own interface. Ultimately, I would like my installer to do many things in turn, enabling the user to go to the next pages and check or set subsequent configurations.
But at the moment I'm looking for how to add an additional page that would run before installation and check if the computer has the required programs to install the application. I would like to attach my ready code to c # to check if these programs are installed on the given computer.
By using this tutorial:
https://www.youtube.com/watch?v=6Yf-eDsRrnM&t=7195s
I created the basic version of the installer. In the tutorial we create installer by using WixUI_Minimal.
I have looked through the documentation and it is written that you can create your own pages, but I can't find anywhere. For example there
https://wixtoolset.org/documentation/manual/v3/wixui/
is Customizing Built-in WixUI Dialog Sets but they dont show how do that.
Update 21th April 2020
I have created a public GitHub Gist, which explains the steps and even include a customized Dialog PrerequisitesDlg.wxs with up to 5 Prerequisites, which can be configured as WiX Properties (text and condition). The whole sequence is wrapped in WixUI_KargWareFeatureTree.wxs.
Text before 20th April 2020
The element you need is UIRef Element, Wix Toolset v3 Documentation.
Wix Toolset is an open source project, so you can review it on GitHub, Wix Toolset v3.
The dialoges which are embed in Wix Toolset are listed here, Source Code of the Default UI-Dialoges of Wix ToolSet. I would use the WixUI_Advanced one, but you can pick all others or start even from scratch.
Download the WixUI_Advanced.wxs from GitHub
Copy the wxs file to the root of your msi-project (where the *.wixproj os placed) and name it to e.g. MyWixToolsetPages.wxs
Edit the name of the UI xml element inside MyWixToolsetPages.wxs (near to line 50)
Add the MyWixToolsetPages.wxs to your wixproject
Replace or add the UIRef reference element in the product.wxs to <UIRef Id="WixUI_MyWixToolsetPages"/>
Add your new dialog as <DialogRef Id="myNewPage" />
Customize the order of the pages with Control Next / Back and Event NewDialog
Be aware to test your sequence in both directions (next, next, next, end) and (end, back, back, back)
Change <UI Id="WixUI_Advanced"> to <UI Id="WixUI_MyWixToolsetPages"> inside your MyWixToolsetPages.wxs (copied from the original WixUI_Advanced.wxs)
...
<UI Id="WixUI_MyWixToolsetPages">
...
Replace the UIRef inside the product.wxs
...
<UIRef Id="WixUI_MyWixToolsetPages"/>
...
I maintain an open source wix authoring tool that enables you to do this by uncommenting one line of XML. The trick is to insert additional rows into the ControlEvent table causing existing paths to be overridden.
https://github.com/iswix-llc/iswix/blob/master/Application/IsWiXNewAddIn/MSISolutionTemplate/SetupProjectTemplate/UI.wxs
https://github.com/iswix-llc/iswix/blob/master/Application/IsWiXNewAddIn/MSISolutionTemplate/SetupProjectTemplate/UI-CustomDialog.wxs
Overall Advice: It is generally an anti-pattern - as of this IT-epoch - to do too much with your setup GUI. In particular it is
better to do per-user configuration as part of the application launch.
Rule of Thumb: You should limit setup-GUI to genuinely shared settings that need to be written with admin or elevated rights to
per-machine locations (inaccessible for normal users). Set everything else from application launch. This can also help QA personnel with their testing.
Burn: Burn is the WiX toolkit's setup.exe creator. It is a bootstrapper, chainer, downloader, installer, etc... construct. Hello-Burn sampler here. And about replacing Burn's default GUI.
WiX MSI GUI: I have a minimalistic sample here for how to change your MSI installer GUI: https://github.com/glytzhkof/WiXCustomDialog. This is the GUI embedded inside your actual MSI. There are other possibilities with GUI.
GUI: You can replace the GUI inside each MSI with a GUI from a Burn setup.exe. There are some details here. This GUI you can implement as a normal executable with all the bells and whistles that allows. The MSI GUI is rudimentary and old. There is another answer here on how to change installer GUI.
In building an installer for my application,i repeatedly getting an error:
Error -3204: Cannot extract icon with index 0 from file C:\Users\....
A quick google search got me here (where the issue isn't resolved) and following step by step procedure here enabled me to add C:\Windows\system32\shell32.dll everytime i build my project, then selecting icon:2 .A setup.exe is created despite an error
and installs app for me but with no trace in Add/Remove programs in Control Panel.
How to get that icon in Add/Remove Add/Remove programs in Control Panel.
EDIT: if there's any other software for windows installer for VS2013 such as SetupProject with the previous releases of VS 2xxx please suggest me
You should change the method of creating the setup file. See the link below :
Clike Here
Update :
Here are two other setup applications which can make setup of your application.
QSetup
and Centurion Setup
You can try them to make setup for your application.
<ISProductFolder>\redist\Language Independent\OS Independent\setupicon.ico
When I used the file path above in the project assistant --> application shortcuts section --> use alternate shortcut icon, the basic icon showed up and allowed me to select the icon. Now my project builds without this error. (the icon looks bad but it works.....)
IconShow
I have an application that needs to run at normal privileges. So it gets installed in Environment.SpecialFolder.ProgramFiles, but stores conf/logging/history details in Environment.SpecialFolder.LocalApplicationData.
The problem is that in the Setup/Deploy project, in the File System section I don't get to distinguish between ApplicationData (roaming) or LocalApplicationData, only "User's Application Data Folder," which could be either depending who installs it on what machine.
Is it possible to force "User's Application Data" to be one or the other?
MSI does support local application data folder. If you're talking about a Setup and Deployment project, maybe switching to another installer framework like WiX might be in order. (Setup and Deployment no longer exists in Visual Studio 2012 anyway). WiX has a tool called Dark that will convert an MSI to WiX XML files so you can simply edit them or add to them quickly and easily.
The Setup Project has made a comeback in visual Studio 2015.
The following works with VS 2015:
In file system view, add a special folder of type 'Custom'.
In the properties of this folder, set the following values:
Name : Local App data folder
AlwaysCreate : True
Condition : (leave empty)
DefaultLocation : [LocalAppDataFolder]
Property : SOMEPROPERTYNAME
The magic happen thanks to DefaultLocation property value: [LocalAppDataFolder].
I suppose any system folder variable as defined in the following link should work:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa370905(v=vs.85).aspx#system_folder_properties
Im using VS 2008 and I have created an application and Setup file using C#. The setup file contain only standard setup interfaces provide by visual studio 2008. I need to check windows registry and get some folder path and copy some files to my application folder while installation. Simply I need to add custom code while installation.
Standard interfaces.
Welcome
Installation Folder
Confirm Installation
Progress
Finished I need.
Welcome
Installation Folder
Confirm Installation
Progress
MY Custom ACTION INTERFACE
Finished
MY Custom Action performs the below action.
Ex: Get registry path.
object test= Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Kofax Image Products\\Ascent Capture\\3.0"
,"ExePath",null)
If(test!=null)
{
///Copy some files to my application folder from test path.
}
How can I do that?
You can always create your own custom action (based on existing panels for the UI)
Take a look at Scott's post entry on the subject
you can find there how to create a Setup project and add a custom action to it.
I hope it helps.
You could add a custom action, although you wouldn't have an interface in the setup for it. It is "just" code.
I have a Deployment Project for my VS2008 C# application. When installing a new version of my application I want to make sure that files are updated with the files contained in the installer.
I want my installer to automatically remove any old version of the installed application. To do that I follow this procedure (also described here):
Set RemovePreviousVersions to True
Set DetectNewerInstalledVersion to
True
Increment the Version of the
installer
Choose Yes to change the ProductCode
For the assemblies I make sure the AssemblyVersion is set to a higher version:
[assembly: AssemblyVersion("1.0.*")]
Everything is working as intended except for my configuration files (xml files). Since I cannot find a way to "version" these files I cannot make sure that the files are updated if they have been modified on the target machine.
Is there any way to do this and how?
UPDATE: I have tried the approach/solution/workaround found here
Include the file directly in a
project with the following
properties: "Build Action -> Content
file" and "Copy to Output Directory
-> Copy always"
Then add it to the deployment
project via Project
Output->Database->Content Files
Unfortunately it did not make any difference. The behavior is exactly the same.
Add the following property to the Property table of the MSI:
Property REINSTALLMODE with Value amus
Note: This will cause all the files in the MSI (versioned and nonversioned) to overwrite the files that are on the system.
If you're willing to use Orca (there may be another way to do this method, but it's the only one I know of) you may be able to set up RemoveFile directives.
See here for a typically light-weight MSDN document -- could be a starting point.
http://msdn.microsoft.com/en-us/library/aa371201.aspx
Alternatively you could always create a very simple bootstrapper executable that simply calls "msiexec /i REINSTALLMODE=oums" (or whichever command-line switches are needed). Call it setup.exe if you like...
Better option long-term may be to switch to InstallShield or similar -- VS2010 includes a light version of IS and I believe they're moving away from vdproj projects.
Have you tried the approach/solution/workaround found here?
Include the file directly in a
project with the following
properties: "Build Action -> Content
file" and "Copy to Output Directory
-> Copy always"
Then add it to the deployment
project via Project
Output->Database->Content Files
I may be incorrect here, and therefore I am exposing myself to down votes, but here goes anyway!
I believe it is on purpose that config files do not automatically get overwritten; the principle there being that you would not normally want your application's configuration overwritten when you install the new version of the program... at least not without numerous warnings and/or chances to merge configuration first.
Having your application configuration get overwritten by an updated version of a program could make for a very upset end user (in this case, web site admin).
Further, I know that sometimes, the developer may be the person doing the deployment. In such a case, this behavior might not seem so logical when deploying a single site to a single server; but when roles are split and/or you have multiple servers with different configurations, this can be a life saver.
You need to include the new version of your files in your custom installer and manually install these file during Custom Install routine is called
This must be applied to any file that does not have version that can be tracked by the installer.