How to put Rule(check) on installation of certain set of files/folders? - install4j

Like in InstallWhere we put rule over the installation step of files and folders. How could we achieve the same in Install4j. Like it should check the value of some installer variable before installing the file. Please help in this regard.
Thanks!

You can create different file sets in the Files->Define Distribution Tree step. Each file set has an ID. IDs can be shown by toggling the "Show IDs" tool bar button.
In the installer, you can then call
context.getFileSetById("[ID]").setSelected(false)
on order to not install the files in the file set, where [ID] is replaced by the actual ID of the file set.

Related

How to keep Folder/Files of extension in the uninstall process

I want to keep the all the file structure of extension when we uninstall any extension from the site.
In the uninstall process I want to remove DB tables only and want to keep all Files/Folders.
Can you please guide me if there is any solution.
Thanks
The manifest file for the extension includes a list of the relevant files that are installed for the extension. These can be copied from the website and zipped to recreate the install file for the extension.
Some extensions may also create associated data which you can back up by exporting relevant database tables and/or files (e.g. in the media or images folders).
A normal uninstall process (via Joomla! manage form) removes everything unless the extension has bug in its uninstall schedule. So, if you need to keep the files, uninstalling the extension won't be a good idea. I suggest you drop tables via phpMyAdmin instead.
To do that, go to your web hosting control panel (cPanel, DirectAdmin etc.) and look for the link to phpMyAdmin. Then select the database that contains your website data (if you got multiple databases and are not sure which one is the right one, you can check it via Joomla! admin > Global Configuration). When you found the database in phpMyAdmin, click on its name to go to its tables. Then select the table(s) of that specific extension by checking the checkbox(es) beside them. Then at the bottom of the all tables click "Drop". In the popup window click "OK" and the table(s) will be removed without effecting your folders/files.
I suggest you get a backup of your whole website first, if you're new to phpMyAdmin.
Be careful!

How to dynamically limit folders of media file to be installed ?

My media file contains three folders, of which, I want to have only one of those to be installed on user’s machine based on his selection. 
One quick and dirty fix for this is to install all the three folders onto the user machine and then delete two of the unwanted ones. This is additional work and users might not like this. Is there a better way?
That's what installation components are for. You can select them programmatically like this:
context.getInstallationComponentById("123").setSelected(true)
You can configure installation components on the Files->Installation components step.

Mwe2 Workflow - modify variables at runtime

I'm trying to make a tool in which the users can choose a model for the mwe2 file and then the generated file to be placed where the user wanted (directory etc..)
My question is if the following can be done:
to dynamically change the model path and the output outlet path (at
runtime)
to run the mwe2 file at runtime (to don't need to go to press right
click and run as ..stuff)
Thanks in advance!
In the end I found that this cannot be done, but is another way to achieve the same result.
Found the solution here: create context-menu generator

what would correct "User Header Search Path" be for this scenario (use of 3rd party library)

What would correct "User Header Search Path" be for this scenario (use of 3rd party library):
Notes:
directory structure: MyApp directory is at same level as the ALibrary directory. That is I've put the source code project for the 3rd party library not within my app directory, but at the same level
there is one main header file which brings together all other headers from the library in the directory: "LibraryAppPath/src/core/headers".
Query Points - would be good if in the answer you could clarify the following items (which I'm a bit confused about)
I see usage of $(BUILT_PRODUCTS_DIR) a lot. What does $(BUILT_PRODUCTS_DIR) actually resolve to? i.e. which directory
do I need to use "$(BUILT_PRODUCTS_DIR)” as a starting point and then use multiple "../" entries to back out to a subdirectory above my app?
I was assuming I should probably set a search path to somewhere high up in the library and then enable "Always Search User Paths"...would this be a good way to go?
I have read using "User Header Search Path" currently may be better than using "Header Search Paths" as the former is currently ensuring code completion works. Is this ok / are there any negatives to using "User Header Search Path"?
Is there a quick way to check in XCode that I've got the right search path in place? A way to tell it's picking up the header files I expect.
Of course the main question is - What would correct "User Header Search Path" be for my scenario.
thanks
For Xcode 4.x, you can check the value of $(BUILT_PRODUCTS_DIR) easily by adding a custom build phase and having it add the environments to the build log.
Go to "Target", and "Build Phases";
Down at the lower right, click "Add Build Phase";
Select "Add Run Script"; the script itself is empty, so it won't actually do anything;
Make sure the "Show environment variable in build log" option is checked;
Build the project
Now, when you check the build log, the environment variables will all be there (if you expand the build log stage's detail).
After noting that the build process directories are different now in XCode 4, and with help from the three20 doco at http://three20.info/article/2011-03-10-Xcode4-Support I have noted that what has worked is as follows. Hence I assume this approach would work for other libraries.
"$(BUILT_PRODUCTS_DIR)/../three20"
"$(BUILT_PRODUCTS_DIR)/../../three20"
Feel free to comment / supply a better answer if there is one.

Is it possible to specify in Eclipse managed projects the path of a library independent of configuration

Within Properties/Settings/Tool Settings, one can specify a Library search path (-L).
For a specific build configuration one can enter
${workspace_loc:/SomeLib/Debug} or ${workspace_loc:/SomeLib/Release}
depending on the configuration.
Is there a variable, like ${workspace_loc} that can be used specify a 'universal' search path. This path would then be correct regardless of the configuration.
Such as:
${workspace_loc:/SomeLib/${config}}
BTW, Is the Eclipse documentation showing a list of all the workspace/project variables?
One thing you can do is create you own string substitution. "You can create and configure simple launch variables which you can reference in launch configurations that support variables".This is done under "Preferences">"Run/Debug">"String Substitution".
As far as list of possible variables goes, I found that if you go to "Run Configurations" and select "Arguments" tab then click on "Variables..." button - you'll get a window with all variables and their descriptions. You can even edit string substitutions from there.
Hope it helped.