You can't really do that search/set TARGETDIR thing with VS setups. The way
I've done something similar this is to use a custom folder that has the
property value discovered by the registry search, defaulting to TARGETDIR.
Having another level of default if one registry search fails might be
p9ossible with another custom folder, but I don't think so. The short
answer is that you get VS setups free with Visual Studio, and there's a
reason that tools from InstallShield, Wise etc are not free - you can do
more with them, like what you are trying to do. Wix would let you do that
too with some custom actions in the right place.
ProductName is a case-sensitive Windows Installer property. It's not often
clear in a Visual Studio setup project, but the property list is documented
here, and yes they are case-sensitive.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/properties.asp
Something else that might not be obvious, but VS upgrades using
RemovePreviousVersions are Windows Installer major upgrades, and yes, that
means that the old product is uninstalled then the new one is installed.
Apart from that, I think the problem you're seeing is that I think maybe
DeleteAtUninstall applies to data values under the key, not the key itself
(despite what the VS IDE implies) so you might find that they stay behind if
you mark each data item DeleteAtUninstall = False.
These may help in general:
http://www.simple-talk.com/2005/04/25/getting-started-with-setup-projects/ http://www.simple-talk.com/2005/06/07/visual-studio-setup/ http://www.simple-talk.com/2005/07/18/updates-to-setup-projects/ --
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view] "docschnipp" <docschnipp@newsgroup.nospam> wrote in message
news:7EC770AB-C0BB-4D80-B296-F4F86B6787F8@microsoft.com...
> Hello,
>
> thanks for the answer, this at helped a bit, but there are still confusing
> things going on:
>
> ""Gary Chang[MSFT]"" wrote:
>
>> Please refer to the following MSDN example on how to use a registry
>> search
>> to determine the target directory for a file.
>>
>> Using a Registry Launch Condition to Specify a Target Directory
>>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/ht
>> ml/vxtskusingregistrysearchtospecifytargetdirectory.asp
>
> I've checked for that, but it is not exactly the thing I need. The logic
> should be:
>
> A) check for regkey A and if existent copy the value to TARGETDIR
> B) check for regkey B and if existent copy the value to TARGETDIR
>
> B is more important as A (A is a legacy key from another product, B is the
> last install path from THIS product)
>
> How can I determine the order in which these are executed, so B can
> override
> A?
>
>> All the registry searches should be performed in the installation
>> progress,
>> but you may need to specify an item under the target registry key which
>> you
>> concerned, by the way the property name should be uppercase.
>
> There is also some confusion, things like "[ProductName]" do not work
> uppercase, only in the way they're defined in the property table, right?
>
> There is also showing up another problem:
> I create a registry value during installation, but when I install the
> upgrade, it deinstalls the previous version and deletes the registry key
> despite I marked it "DeleteAtUninstall = false". Is this a bug or do I
> have
> to tweak with the "Transient" property (I understood it that "Transient"
> is
> only neccessary when there is a CONDITION given, right?)?
>
> thanks
>
> doc
>