Use HTTP in InnoSetup - http

I want to do some HTTP request during the installation of a software with InnoSetup.
Can I use the class TStream to open an URL as if it was a file or must I use the Exec function with curl.exe being attached in the installer, or is there an easier way ?

Have a look at ISTool and the distributed isxdl.dll. Also Inno Setup comes with the script setup.iss in the examples folder which utilizes the isxdl.dll for downloading additional setup files.

Related

Apigee - Java callout, Resource

Apigee java callout:
To execute java callout, I uploaded .jar file at org level in apigee. I made reference of the jar (and Execution class) in java-callout policy, but I get error during deployment of proxy - "Could not extract the java resource". Using curl command I verified that jar is loaded as java type, and name of resource is correct.
curl command used to upload the jar.
curl -v -H "Content-Type: application/octet-stream" -X POST -d#{JARfileName.jar} http://{HOST}/v1/organizations/{ORG}/resourcefiles?"name={JARfileName.jar}&type=java"
Any idea what is the issue?
As mentioned on the documentation page for JavaCallouts, this feature is only available on paid-for Apigee orgs. If you're a paying customer I'd suggest contacting Apigee Support directly to get help with this issue.
I further investigated, it has to do with java class loader - in built(fixed) java class loader sequence is to look for dependencies in proxy-level to Apigee platform level, not in other-direction. Example - you can not reference entry class from jar uploaded at platform level and look for its dependencies at proxy level. Anyway a work-around solution works for me.
Suggestion to Apigee team -
It would be helpful if there is way to define location of dependent jars in Api-proxy(explicit jar location in java callout), this way one can explicitly manage how dependent jar/class is being referenced. And also, will be able to upload common/shared class at platform level and bundle proxy specific configuration at Proxy-level.
Regards,
Kamesh

Where to put the normal PHP library (ex Google API library) in symphony2 system?

I am making application with symfony2
I want to use Google API library in this application.
Google API has
src/config.php
/Google_Client.php
/and so on..
I need to load this script from the DefaultController.php.
Where should I put the library,and how could I load the library from the DefaultController?
If it doesnt have framework like symfony2.
it is very simple though..
put library in the same directory and load
require_once 'src/config.php'
you simply can run
php composer.phar install google/api-client
in your projectfolder. It should install the api-client to your vendors.
As you mentioned, default the config resists in another file. A proper way around that would be to create a little bundle with a nice config, register the api as a client, and pass the config to your service.
I think, since you are using Symfony2, the best way is to use composer and that would install the library inside the vendors directory and be added to the autoloader.
Symfony2 and Google API integration

Unable to publish to Http Remote Repository

I think this might be an IIS7 permissions thing, but I'm tagging it with OpenWrap because I might be wrong. When I try to publish a wrap to an HTTP repository I get the following error:
PS C:\OpenWrapExamples\Ninject> o publish-wrap -Name Ninject -remote MyHttpRepo
# OpenWrap Shell 2.0.0.10
# Copyright © naughtyProd Limited 2009-2011
# Using C:\OpenWrapExamples\Ninject\wraps\_cache\openwrap-1.0.1.81349963\bin-net35\OpenWrap.dll (1.0.0.0)
Publishing package 'Ninject-2.2.0.85378492.wrap' to 'MyHttpRepo'
The repository OpenWrap.Repositories.Http.HttpRepositoryNavigator is read-only.
I've tried setting the permissions on the folder, but that doesn't work either.
If you just exposed an indexed-folder (one you added with file:///path/) as an IIS site, it will be read-only (as there's little we can do with that).
If you use OpenWrap 1.0, , you can simply add two remotes, one for the UNC path (so you can publish) and the other one for the http one (so you can read the content back).
If you use the upcoming OpenWrap 2.0.1, you can simply add both in one go
o add-remote http://server/ -publish file://server/path/to/share
If you want a repository writeable over HTTP, you can implement that feature yourself rather easily: have your index file at /index.wraplist, add an endpoint that support a POST with some content (that's the package), say at /upload, and add the following to your index.wraplist:
OpenWrap will then happily upload to an http endpoint.

Log4j in Websphere

I recently take over a web application project using websphere and log4j running under AIX. To create a development environment, I setup all the components in windows, using eclipse to compile a WAR file and deploy it.
All is working fine except that log file is not created.
I changed the log file in log4j.properties from something like in below and and give everyone full access permission to the directory:
log4j.appender.F1.File=/abc/def/logs/admin.log
to
log4j.appender.F1.File=c:/logs/admin.log
What else can I check?
I create a simple standalone testapp which use the same log4j.properties and it can create the log file, but when the servlet deployed to websphere, it doesn't work. Please help! Thanks!
Ok, I think this article should help you. It seems that WebSphere CE uses log4j by default and controls it with a global properties file. There is a section on how to use application-specific properties files.
Here is what I try and do to troubleshoot similar issues.
Turn on log4j debugging to see where it actually picks up the file from. You need evidence of which file is picked up (so turning the debug on is a worthwhile activity) This provides you information with what log4j is trying to do to locate the configuration file.
-Dlog4j.debug=true
I would not hardcode the log4j location in the code. Instead I
would use the log4j.configuration System property and state that in
the JVM arguments. This way even I don't need to touch my code.
-Dlog4j.configuration=file:///home/manglu/log4j.properties
I would use this approach irrespective of the runtime server that I use (be it Tomcat or WAS CE or WAS)
Hope this helps
I suggest you use environment variables set on your server like this :
You must access the admin console of your server.
Under custom properties
Server_path=/abc/def/logs
In your log4j, use this : {$server_path}/log.txt
Make sure the user running the app has access to that directory.

External classes/jar in OSGi

My application supports running on many dbms and it requires user to configure dbms connection setting and also provide the jdbc jar file.
Now the application is to be packaged as OSGi bundle. There will be another main jar which lanches OSGi server and starts the application as bundle.
Can you please suggest how can I package the application as bundle and let user provide the jdbc jar file.
Will it require something like the main launcher jar specifying JDBC driver classes as FRAMEWORK_SYSTEMPACKAGES property?
Thanks in advance,
Aman
There are two ways of doing this:
1) Adding the driver.jar to the classpath of the main launcher and, like you say, expose its packages via the framework by specifying that property (or actually you can use the FRAMEWORK_SYSTEMPACKAGES_EXTRA property to just specify additional packages, instead of specifying all of them).
2) Manually wrapping the driver.jar as a bundle, or doing it dynamically at runtime. For example, you could try to wrap bundles that are copied to a certain folder (similar to what Apache Felix File Install does) by using Pax URL or some other tool that can create a bundle out of an ordinary jar file for you (see http://team.ops4j.org/wiki/display/paxurl/Pax+URL).

Resources