WiX/Windows Installer: Re-install to a new folder - installation

1.
I am using WiX for creating installer and would like to implement the following behaviour:
If a user launches msi installer for the product and the product already installed, then wizard works similar to pure (first time) installation with exception of some things (e.g. license aggrement screen is omitted). The wizard should allow for example to change installation folder, select whether to place desktop shortcut,...
I tried to do:
<Publish Event="ReinstallMode" Value="amus"><![CDATA[INSTALL_MODE = "Change"]]></Publish>
<Publish Event="Reinstall" Value="ALL"><![CDATA[INSTALL_MODE = "Change"]]></Publish>
But after installation completes: the product is in the same folder, where it was installed first time; desktop icon in the same state as it was after first time install.
MSDN says: "Do not attempt to change the target directory path if some components that use the path are already installed for the current user or for a different user".
Is there a way to re-install in another forlder and add/remove desktop icon in re-install?
2.
Is this normal to use the same KeyPath for some components?
For example the same registry values for DeskTop and Programs menu shortcuts? MSDN says: "Two components cannot share the same key path value". But compiling and verifying goes OK. And I did not discover problems using the same keypaths.

I'm not sure I understood your requirements correctly, but it seems the Major Upgrades cover the functionality you need.
Take a look at this ancient ;-), but still valuable blog entry by Rob Mensching. The KeyPath concept is clearly explained on an example there.
Hope this helps.

Related

InstallShield add custom action to check for anti-virus

I am a bit of a beginner at InstallShield (in the sense that this is the first time I've used it!).
I have some code that I am packaging up in a .net DLL to check for the existence of anti-virus. The installer I am attempting to create must check for anti-virus (by calling a custom action using my DLL?) and cancel the install if none has been found.
The way I seen it working, was the user would see a dialog that is informational ("about to check for anti-virus"), the user would press "Next" it would call the custom action and then show a success screen with a "Next" button, or a failure screen with "Finish" button.
Is this sort of thing possible with InstallShield? Are there any good tutorials out there for doing this sort of thing?
Do you really need a custom action? Do you have more detailed requirements with regards to what products and versions you are looking for?
InstallShield / Windows Installer has a built in search pattern that can look for registry entries, files, et al.
If you really do need a custom action, how long do you expect the execution to take? If it's only a couple seconds, just schedule it to run after AppSearch. You don't need a UI to say "now doing blah" just do it.
Since you want to do this in .NET, you need to look at Windows Installer XML (WiX) Deployment Tools Foundation (DTF). You can use this to author/compile custom action DLL's that InstallShield can then consume. Generally the custom action should do it's search and then set a property based on it's result. Then use that property in evaluating whatever business rule you are trying to implement.

Why is InstallShield wizard not displaying last uninstall page?

I have a trial version of the InstallSheild. It works perfectly fine on my Windows 7 machine. However uninstalling on other machine it fails to display the Final complete page(The last uninstall page)
To be clear it uninstall correctly but it just fails to show the completed page.
Are the other machine missing a component I need to package with the installer or is this a permissions problem?
You're question leaves out a few key details:
How are you invoking the uninstall?
What UI are you seeing?
Can we see the contents of your log?
In general, most people uninstall via Add Remove Programs aka Programs and Features. In this scenario Windows Installer only displays a progress bar and then exits as the UI sequence is bypassed per best practices.

My Visual Studio program is "Copyright © Hewlett-Packard Company"

I have a C# program which I made in Visual Studio. When I right click on my program executable in Explorer and click Properties>Details it says "Copyright © Hewlett-Packard Company". To troubleshoot I then created an empty Console Application, and it has the same copyright message.
Does anyone know how to fix this? I have tried some tutorials about regedit but they did not work.
Check out the Assembly Information dialog in your project properties.
In Solution Explorer you can right click on your project and select Properties. An Assembly Information button is in the Application tab.
I haven't tried this, but to change the default value, use regedit to modify
HKLM\Software\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization
HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization (x64 systems)
The answer by #Louis is correct. I'm just posting this to add some background information, and to vent my frustration at Hewlett-Packard for creating this stupid situation.
If you buy a Hewlett-Packard PC with Windows pre-installed (which is typical, unless you're in the IT dept. of a company that wipes the hard disk and installs a preconfigured disk image) then Hewlett-Packard has stupidly installed Windows with their name as the owner and owning organization.
Here are some links. I'm surprised there aren't even more frustrated customers complaining about this.
https://www.besttechie.com/forums/topic/11774-change-the-name-of-the-registered-owner-on-an-oem-machine/
https://www.groovypost.com/howto/howto/change-the-registered-owner-and-company-name-in-windows/
- see the comments
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/12fdb09b-472b-4634-991c-670e5f775365/upon-new-project-hewlettpackard-is-always-placed-in-the-assembly-company-name-field?forum=visualstudiogeneral
https://support.hp.com/in-en/document/bph05548
- is obsolete, doesn't include x64 registry entry
So the solution is to do this, as soon as you power up the new HP machine (otherwise this owner information will "pollute" all the programs you install):
Fix the RegisteredOrganization and RegisteredOwner registry information at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
If it's an x64 machine (and all machines are now), also fix the RegisteredOrganization and RegisteredOwner registry information at HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion
I'd imagine you're looking for the AssemblyInfo.Copyright Property. In order to modify this simply find the assembly.info class and modify it appropriately.
If you can't find it you can also use the Assembly Information Dialog as suggested by #Louis, which modifies the file for you.

VS2005 Setup project - program asks for installation media when started for the first time by another user

I have a very simple VS2005 deployment project that aims to install for all users on a PC.
All the application files are written to %Program Files%\MyProg. A shortcut is created in the start menu and the startup folder. No registry settings or anything else are created. I have set
'InstallAllUsers' to true.
The created MSI runs fine and installs the software. It works without any problems when running under the user account from which it was installed.
When logging in as another user, the start menu and startup icons are present. It attempts to launch the application however an installation window pops up and states that 'the feature you are trying to use is on a network resource that is unavailable.' The installer will only proceed if pointed to the original MSI file.
Why does this happen? I want my application to be installed completely for all users when it is installed by a single user.
edit: Solution
I was getting similar event log messages as shown on this page. In my case it turned out to be as simple as ensuring that the User's Program Menu had its 'AlwaysCreate' attribute turned to false. If it was true, windows would try and recreate the folder when a new user logged in. This somehow required the invocation of the installer and thus resulted in the 'please insert the installation media' prompts.
It is actually kind of hard to say without some more information. I would recommend checking on the rights in the installed folder (seeing if only the one who installed it has rights) and also checking the file list for the directory (to make sure VS didn't automatically place some files in the user profile). Let me know what comes out from those two steps and we can try to keep digging if that didn't shed any light on it.
Keep in mind chances are this is most def not specific to Visual Studio, look at this MS support article here where the same message is coming back for office.
I know this is an old post but I thought I'd add another cause and solution in case the above didn't work for you.
There is a bug in VS Setup and Deployment Projects which results in registry values being entered into HKCU instead of HKLM irrespective of the InstallAllUsers property being set to true.
You must use Orca msi editor to change the registry root for "DesktopFolder" and "ProgramMenuFolder" from either 1 or 2 to -1. The issue cannot be resolved via VS.
http://www.qa.downappz.com/questions/vs-2010-deploys-per-user-features-during-install-which-require-access-to-install-media.html

How to show files being copied, moved,etc. on installer screen using WIX

I have my installer and is working fine.
What I want to add more is that I want to show the work done by installer on installer screen (Example, installing Microsoft SQL Server 2005, we get the files being copied, moved, registry entry created,......)
Similarly I want to show this on my installer.
So can anyone help me on this to how to show all these at runtime on installer screen.
Thanks,
Sunil
Just copying my answer to the same question on wix-users list:
Use ProgressText element.
The 'Template' attribute is the place to put tokens to reflect the progress. See the standard InstallFiles action for example.
The table "ActionData messages" lists the possible tokens for this action.
Sample:
<ProgressText Action="InstallFiles" Template="File: [9][1]">!(loc.InstallFilesActionText)</ProgressText>
Outputs:
File: C:\Program Files\MyApp\bin\my.dll
etc.
Hope this helps,

Resources