On Tue, Jul 1, 2008 at 11:29 AM, Frédéric Viollet
<[EMAIL PROTECTED]> wrote:
> Johan Appelgren a écrit :
>> On Tue, Jul 1, 2008 at 10:07 AM, Frédéric Viollet
>> <[EMAIL PROTECTED]> wrote:
>>
>>> Hi everyone,
>>>
>>> I've got a real big problem here on applying minor upgrades to my
>>> product. I really need your help here :)
>>> During the first install, I ask the user where the product should be
>>> installed (by using the wix standard Gui)
>>> But on minor upgrades, I do not ask him again. I just re-install the
>>> files to the previously selected location (well, that's what I'd like to do)
>>> I seem to have some problems with the property that points to my
>>> installation directory.
>>> Here's an extraction of the code I'm using:
>>>
>>> <Directory Id="TARGETDIR" Name="SourceDir">
>>>  <Directory Id='ProgramFilesFolder' Name='PFiles'>
>>>    <Directory Id="MyCompany" Name="MyCompany">
>>>      <Directory Id="MyProduct" Name="MyProduct">
>>>        <Directory Id="SUITEINSTALLDIR" Name="MySuite">
>>>          <Component Id="MY_REGISTRY_ACTIONS" Guid="a guid">
>>>            <RegistryKey Root="HKLM"
>>> Key="Software\MyCompany\MyProduct\MySuite\MyModule">
>>>              <RegistryValue KeyPath="yes"  Name="InstallDir"
>>> Value="[SUITEINSTALLDIR]MyModule" Type="string" Action="write" />
>>>            </RegistryKey>
>>>            ..... Install a bunch of files ....
>>>          </Component>
>>>        </Directory>
>>>      </Directory>
>>>    </Directory>
>>>  </Directory>
>>> </Directory>
>>> <Property Id="WIXUI_INSTALLDIR" Value="SUITEINSTALLDIR" />
>>> <UIRef Id="MyProduct_UI" />
>>> <UIRef Id="WixUI_ErrorProgressText" />
>>>
>>> Now, let's say that the default ProgramFilesFolder is C:\Program Files\
>>> On the first installation, the installdir is ask for. I enter F:\Program
>>> Files\MyCompany\MyProduct\MySuite *(and not C:)*. Everything works well :
>>> -the files are installed in F:\Program Files\MyCompany\MyProduct\MySuite
>>> -the registry value "InstallDir" is set to F:\Program
>>> Files\MyCompany\MyProduct\MySuite\MyModule
>>>
>>> On a minor upgrade, no installation dir is ask for (this is ok), and the
>>> new files are correctly copied to F:\Program
>>> Files\MyCompany\MyProduct\MySuite, but :
>>> -the registry value "InstallDir" is set to *C::\Program
>>> Files\MyCompany\MyProduct\MySuite\MyModule*
>>>
>>> Any idea of how I could fix this?
>>>
>>> Thanks a lot for your patience for reading all way down here :)
>>>
>>> Fred
>>>
>>
>> I think you must set the SUITEINSTALLDIR property using a RegistrySearch.
>> http://wix.sourceforge.net/manual-wix2/wix_xsd_registrysearch.htm
>>
> Ok. I will try this.
> The code should look like this then I guess:
>
> |<Property Id="SUITEINSTALLDIR">
>  <RegistrySearch Id="SUITEINSTALLDIR" Type="directory" Root"HKLM" 
> Key="|Software\MyCompany\MyProduct\MySuite\MyModule|" Name="InstallDir" />
> </Property>
> <Directory Id="TARGETDIR" Name="SourceDir">
>   snip ....
>     <Directory Id="SUITEINSTALLDIR" Name="MySuite">
>     </Directory>
>   snip ....
> </Directory>
> <Property Id="WIXUI_INSTALLDIR" Value="SUITEINSTALLDIR" />
> <UIRef Id="MyProduct_UI" />
> <UIRef Id="WixUI_ErrorProgressText" />|
>
> But, will this work on first install (the registry key will not be
> found)? Will the SUITEINSTALLDIR Property have a default value?

Yes, in that case the registry search will not set the property.
SUITEINSTALLDIR will then be set as before based on the Directory
structure.

>> Why is the InstallDir registry value the KeyPath for all your files?
>> Normally you have one component per .exe, .dll, .ocx and so on with
>> the file as KeyPath.
>>
> My fault. The extracted code was incomplete. There was a missing
> </Component> after the Registry entries :)

Okey. :)

/Johan

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to