garrasco
Flexera beginner

FeatureSetTarget in Maintenance mode

Hello,

it seems that FeatureSetTarget(...) doesn't function in Maintenance mode within an InstallScript: how can I change the destination folder of certain features that the user may have moved after first setup so that a following update will copy them in the right folder?

Thanks.

Labels (1)
0 Kudos
8 Replies
Revenera_Ian
Revenera
Revenera

Re: FeatureSetTarget in Maintenance mode

Hello @garrasco,

Thank you for your post.

Could you please clarify? Does your FeatureSetTarget function call look like this?

FeatureSetTarget(MEDIA, "<svTarget1>", svTarget1);

Please let us know if you have any questions or concerns. Thank you for your patience and cooperation.

0 Kudos
garrasco
Flexera beginner

Re: FeatureSetTarget in Maintenance mode

Yes, my code is:

 

function OnMaintUIBefore()

...

FeatureSetTarget(MEDIA, "<TARGETDIRDATA>", TARGETDIRDATA);

...

return 0;

end;

TARGETDIRDATA is a script-defined variable (I tested it and it contains the right value).

I tried also FeatureSetTarget(MEDIA, "TARGETDIRDATA", TARGETDIRDATA); without <> but same result.

This project is an Update setup package that contains only updated files and has the same ID of the main setup used to install the application so it acts in maintenance mode.

I use the FeatureSetTarget(..) function in the main setup project  (the one that installs the application) and it function properly but it's in the OnFirstUIBefore(...) event.

0 Kudos
Revenera_Ian
Revenera
Revenera

Re: FeatureSetTarget in Maintenance mode

Hi @garrasco,

Thank you for your reply.

You could try this possible workaround:

After FeatureSetTarget is called, the files are transferred to the expected directory, but it only saves the text substitution once, the first time. So you could try, as a possible workaround, saving the text substitution manually as a custom string then calling FeatureSetTarget every time with the text substitution.

Please give that a try. Does that work for you?

Please let us know if you have any questions or concerns. Thank you for your patience and cooperation.

0 Kudos
garrasco
Flexera beginner

Re: FeatureSetTarget in Maintenance mode

NO FILE is transferred to the new TARGETDIRDATA folder set in the update-setup (maintenance mode) : all the files are transferred to the original TARGETDIRDATA folder defined during the original setup (normal mode).

Example:

-In the original installation TARGETDIRDATA was set to c:\MyData and there the data was installed
- I want that the maintenance setup install the update data to x:\MyDataI so I call FeatureSetTarget("<TARGETDIRDATA>,"x:\\MyData") in my update setup in OnMaintUiBefore event 
- The updated data is installed in c:\MyData

 

 

0 Kudos
Revenera_Ian
Revenera
Revenera

Re: FeatureSetTarget in Maintenance mode

Hi @garrasco,

Thank you for your reply.

I understand that no file is transferred, but could you please give this possible workaround a try just in case?

Save the text substitution manually as a custom string then call FeatureSetTarget every time with the text substitution.

Please give that a try. Does that work for you?

I understand that I'm not referring to the same exact scenario but we still need to see whether the workaround happens to still apply.

If it is not possible for you to even try the workaround, please let us know.

Please let us know if you have any questions or concerns. Thank you for your patience and cooperation.

0 Kudos
varul
Revenera
Revenera

Re: FeatureSetTarget in Maintenance mode

Hi garrasco,

 

 Please correct if my understanding is wrong, 

So you are installing your setup in a machine in a drive  EX: C:\Test data folder and it install successfully (installed all feature and components completely o pending feature to install)

Now you are running the setup.exe again and in maintenance dialog you are selecting modify.

After selecting modify you need to change the installdir(targetdir) to new location instead of C:\Test Data you are changing it to E:\ Test folder, 

But the files are updating in C:\Test Data folder instead of your new path E:\Test 

Is this your scenario, you need files to install in E:\Folder ?

What is your project type? installscript or installscript MSI?

Could you please explain how this step performed, Installed in C:\test data folder and then moved manually to E:\Test folder? May i know the reason for moving this files to different location manually(here im trying to understand the use case)

"that the user may have moved after first setup"

0 Kudos
garrasco
Flexera beginner

Re: FeatureSetTarget in Maintenance mode

Yes you understood the scenario.

Our project is and InstallScript.

Our main setup installs the program in a folder (ie c:\Program files... etc) and the data (that may be shared with other user on the network) in another folder (ie f:\MyData usually on the network) choosen by the user with a proper dialog.

The data folder could  be moved by the user manually for any reason (directives from the IT office and so on) for example to x:\MyData or f:\MyNewData.

Periodically we puplish on our website an update setup (a self-extracting .exe) that runs in maintenance mode to update libraries and data so we want to be able to copy the new files to the right folder even if the user changed the location manually: the setup opens a dialog  box that asks for the location of the data folder, proposing the one choosen during setup but letting the user specifying the one he changed to.

 

0 Kudos
varul
Revenera
Revenera

Re: FeatureSetTarget in Maintenance mode

Thanks for your clarification,

Better try to change your Targetdir function used in other place on begin to run only in clean installation,  which will set the featuretarget only on fresh installation, in this case your OnMaintUIBefore() defined featuresettarget wont override

Refer this below help link

https://docs.revenera.com/installshield19helplib/Subsystems/installshield19langref/helplibrary/Langr...

 

function OnBegin( )

 

begin

// change values of directory properties INSTALLDIR and OTHERLOC for a first-time

// installation

if (!MAINTENANCE) then

    FeatureSetTarget(MEDIA, "<INSTALLDIR>", "C:\\RightHere");

    FeatureSetTarget(MEDIA, "<OTHERLOC>", "C:\\SomewhereElse");

endif;

 

end;

0 Kudos