Renaming the existing files during MSI installation WIX - wix

I have a WIX Installer and in the installer i also copy a tutorial project created in VS 2012. What i want is if user has changed the tutorial project by adding new files in it then i just want to rename the existing tutorial and and copy the new tutorail and if user has not changed the existing tutorial then i just want to replace the existing tutorial with the new tutorial.
Is the first question is, Is it really possible using WIX? (Does WIx gives us some functionality like that)
if its possible can some will guide me how to do that?

It should be possible using the MoveFile element but it's going to be really tricky. I worked for a company that created a .NET SDK and we build custom project types for VS that allowed the user to say File | New | SomeTypeOfApp and then use that for training. We also kept our "tutorial" apps in ZIP files and an application that acted as a front end asking the developer where they would like to extract the sample app to. This greatly simplified the installer requirements.

Related

Update and retain web.config file during upgrade in wix installer

What is the standard way to handle web.config files during major upgrade.I'm aware how the unversioned files are handled during upgrade,the file will not be replaced if the file has been modified by the user.
Is there a way to deal with the scenario where in there are new entries added to config file bundled with the latest installer that needs to be installed,and also retain the existing entries modified by the user during major upgrade in Wix.
The simple solution that a lot of my customers have liked is to not put user data in the web.config. Instead we use the AppSettings#file and ConnectionStrings#ConfigSource elements to specify an override file and keep the user data there. What MSI doesn't know about it won't tamper with. Now you don't have to be an MSI component rules wizard.
https://msdn.microsoft.com/en-us/library/ms228154(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource(v=vs.100).aspx
I know the question is for Wix, but just wanted to point out how much time commercial tools can save in such scenarios.
For example, using Advanced Installer you can read and load into an MSI property any XML values and then use the XML Files updater to write dynamic content in the files, at install(upgrade) time. (check the videos at the end of each article for a quicker overview)
Disclaimer: I work on the team building Advanced Installer.
Set the component to always overwrite and write a custom action to add the needed information to the config file.
The only way that seems possible is a custom action to merge the entries in the new file into the existing file, because you want data from the existing a new files. You would also need the upgrade scheduled late (after InstallExecute) so that the upgrade isn't an uninstall of the old product followed by an install of the new product.
If you are doing an upgrade (the WIX_UPGRADE_DETECTED property will be set by a MajorUpgrade element), so update the existing file, otherwise install the new one.
There might be a way to express the updates as an Xml transform, so something in the WiX util:xml tools might help do an update.

TFS 2015 won't upload custom process template

We have a customized version of the Agile template that we've been using since TFS 2013. I have upgraded the template for 2015, which was no big deal. But when I go to upload it I get error "VS402479: You can't overwrite the Agile process template, because it's locked".
I have followed the instructions from MSDN to upload an updated process template. I have changed the name, description, and minor version strings as described in the documentation.
Here are the values from the metadata node in my ProcessTemplate.xml file:
<name>Custom Agile</name>
<description>Custom Template based on MSF Agile</description>
<version type="ADCC42AB-9882-485E-A3ED-7678F01F66BC" major="14" minor="20" />
I have tried changing the major version and the minor versions to different, higher increments, and receive the same error.
If I change the type to a different Guid, the template loads just fine. The instructions imply that the Guid should be the same. I'm assuming this is so TFS knows the relationship between the built-in templates and custom templates they are based on.
I have a bunch of team projects to update the features on once the upgrade is complete and do not want to break the relationship to the built-in Agile process template if I can help it.
You can no longer edit or delete the built in templates in TFS 2015 so you'll have to change the Guid if you want to upload your template.
Process Template changes to TFS 2015 RTM
In TFS 2015, the system templates are locked and cannot be changed. That change allowed us to overwrite the templates we ship, and with that we were able to rename the templates to Scrum, Agile and CMMI.
To create a custom process template based on a shipped template, simply export an existing template, give it a new name and version, and then reimport it by using the Process Template Manager. Existing projects are unaffected by this change, which means that they can continue to have their process customized by using witadmin.
We have determined that this issue is not a bug. To upload a custom process template, not only the Process template name needed to change, but the version id also needed to change.
In the ProcessTemplate.xml file, find the following settings:
<version type="ADCC42AB-9882-485E-A3ED-7678F01F66BC" major="15" minor="10" />.
Change GUID string to another value. Then try to upload the custom template again.
You can generate a new Guid by using this C# code:
Guid g = Guid.NewGuid();
string s = g.ToString();

Prevent copy of app from overwriting the original

I'm working on a windows phone application for an event. The event has an last year's event already had a windows phone application and all I really need to do are some updates. So I made a copy of the old application and started modifying it instead of creating a new solution from scratch.
Now here's my issue: when I deploy the new event application with Visual Studio to my phone it overwrites the old application. This is something I don't want, as I want to be able to compare the two on my phone. I also suspect that this might give me some issues when I upload the application to the store.
I suspect that this has something to do with copying files that are supposed to be unique for each application.
Any help would be appreciated!
The way I fixed this was by generating a GUID id using the GUID generator in Visual Studio ( as suggested by #Robert ). And changing the GUID in the WMAppManifest.xml and Package.appxmanifest files.

BURN (WIX bootstrapper) - files in use dialog not being shown

I have created a WIX msi for one of our products which works really well. The product is a Word addin and at upgrade/uninstall the msi automatically checks if Word is open (ie. my assemblies are currently locked in execution) and if it is, then it comes up with the Files In Use dialog.
The only improvement I would like to make is at installation time. I would like to check whether word is open and force close before install. It would be great to do so, using the same Files In Use UI. Is there an easy way to do this?
I have also created a custom bootstrapper (unmanaged), using the sample code from the toolset. Overall this is really good too, however I have real problems when upgrading/uninstalling. Ideally, I don’t want to DisplayInternalUI but I would like the Files In Use to pop up when necessary. Is this possible?
The feature request 4382 was implemented and is available in v3.10.0.1726. Set ShowFilesInUse to yes in the WixStandardBootstrapperApplication element.

DTF: Update a File within an Archive Without Extracting It

I am using the Deployment Tools Foundation bundled with WiX 3.5. There is an archive that contains a file that I want to update without having to extract it first - the edits are based on user inputs during setup.
How do I obtain a reference to this file, perform the updates, and save the changes to the file without needing to extract it from the archive? The custom action is being written in C#.
I am using Wix v3.5.2415, which is the same version for the DTF assemblies.
Try using one of the free c# libraries to interact with a zip file.
For example:
SharpZipLib
SevenZipSharp
I'm not sure exactly why you are trying to avoid unzipping. Is this a silverlight xap file by chance? If so, I recommend a different approach like using initParams.