How to set application name and installation path while installing by AdminApp? - websphere

Just tried this thing for a day or two, able to do the installation using AdminApp command, but still got some problem about application name and installation path.
Reference I look from IBM said AppName is defined by display name, I think that mean it use the display name field from web.xml? But the result that I see is the application name will look like "Test_AP.war16dfd74ab1a", not exactly the same.
The installation path parameter part is also ambiguous, I don't think I see a thing looks like it.
https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.iseries.doc/ae/rxml_taskoptions.html?view=embed#rxml_taskoptions__cmd10
import time
AdminApp.install('C:/Users/Development/Desktop/Test_AP.war', '-cell WIN-9DAB2SINode01Cell')
AdminConfig.save()
result = AdminApp.isAppReady('Test_AP')
while (result == "false"):
### Wait 5 seconds before checking again
time.sleep(5)
result = AdminApp.isAppReady('Test_AP')
print("Starting application...")
What I try to achieve is to use this script to install my service onto WAS with exact application name(same as my WAR name or display name in web.xml) and designated installation path, then start the service. But now I'm stuck at com.ibm.ws.scripting.ScriptingException: WASX7280E: An application with name "Test_AP_WAR" does not exist. Can anyone tell me how to do this?

Simple Solution
You need to include an -appname argument such as:
AdminApp.install('C:/Users/Development/Desktop/Test_AP.war', ['-cell WIN-9DAB2SINode01Cell' -appname SimpleTestConnection5_war])
Otherwise WAS will generate an application name for you.
Ideal Solution
Create an AdminApp.install command using the Admin Console. Install an enterprise application using the WAS Admin Console. On the last page, you will see a help box in the upper right corner. Click on view administrative scripting and you will be provided with an AdminApp.install command. This command can be edited with a custom location and appname.

Related

xperf -providers doesn't show the name of TraceLoggingProvider defined by TRACELOGGING_DEFINE_PROVIDER

I follow the tutorial to set up a TraceLoggingProvider in my application.
During the application runs, I try to use xperf -providers to see if my user event provider is there:
I cannot see the name I defined in TRACELOGGING_DEFINE_PROVIDER but only the defined GUID is shown. Is it intended?
Instead following another tutorial with WPRP file, I just use xperf -start to capture events. And the same: I can only use GUID as parameter, not the defined name! is it also intended?
Anyway, at the end I can view the result properly in WPA and the defined name of my user event provider is visible.
are all my observaton intended?
The name you use in the C++ code is unrelated to the display name on your pc.
You'd have a displayed name (instead of GUID) if this was a manifested installed provider, but TraceLogging isn't manifested (at least, not in the classical sense - an impromptu manifest is embedded into the image, and sent in the messages).

How to open chrome app with specific URL through chrome_proxy.exe?

I have a Chrome app that I created with "Create Application Shortcut".
What I need is to open that app with specific url on the same domain.
Example:
chrome_proxy.exe --profile-directory=Default --app-id=xxxxxxxx "https://www.google.com"
Is that possible or any command that achive the same result?
I'm guessing you installed the Chrome app so that the website launches in a standalone window. If this is the case, you can achieve something similar by using the --app command line switch instead.
Eg: chrome_proxy.exe --profile-directory=Default --app="https://www.google.com"
This doesn't strictly open the URL in the existing app, but it does open that specific URL in a standalone window.
Here's the answer what you are looking for.
chrome_proxy.exe --profile-directory=Default --app-id=xxxxxxxx --app-launch-url-for-shortcuts-menu-item="https://youtu.be/dQw4w9WgXcQ"
Using this will work:
chrome_proxy.exe --profile-directory=Default --app-id=xxxxxxxx --app-launch-url-for-shortcuts-menu-item="https://youtu.be/dQw4w9WgXcQ"
It will launch in the special standalone window AND navigate to the specified URL.
Replace xxxxxxxx with the app id (this can be found if you look at the properties of the shortcut it created), but after you create the app this part should already be filled in.
At that point all you need to add is this part:
--app-launch-url-for-shortcuts-menu-item="https://youtu.be/dQw4w9WgXcQ"
Replacing the https:​//youtu.be/dQw4w9WgXcQ part with the full URL of where you would like to navigate to.
Documentation of the argument can be found here.
Credit due in part to 김보근.

classic asp create text file on webserver: error 800a0034 Bad_file_name_or_number

I have a classic asp page in VBS and I am trying to create a file on the web server with the following code.
Set fso = CreateObject("Scripting.FileSystemObject")
Set file1 = fso.CreateTextFile("\\localhost\inetpub\wwwroot\cs\batch\123456dirs.bat", true)
This returns the following error:
|666|800a0034|Bad_file_name_or_number
Line 666 is the CreateTextFile line.
According to the Microsoft docs, this means that I'm trying to create a file with an invalid filename. Then it explains the rules for filenames and mine appears to be perfectly valid.
Any suggestions or ideas on how I can further troubleshoot this?
first thing to check to make sure your users have access to the folder. Assuming you're not using windows authentication, make sure IUSR account has write access to the folder.
second, unless inetpub is set up as a share to folder, you're syntax won't work. if the root of your website is located in the CS folder, you can do something like:
Set file1 = fso.CreateTextFile(Server.MapPath( "/cs/batch/123456dirs.bat" ), true)
The createtextfile() function runs on the web server but in the context of the local server itself. Simply put, any path you give it must resolve as if you were logged on to a windows desktop on the server and tried to CD to that path.
The format \localhost... is a UNC path. See this question for a discussion about UNC paths and windows. Unless you know for sure that there is a UNC path mapped for \localhost then that is probably your issue. You may be making the assumption the \localhost will be a reasonable path to use, but as I said unless you know for sure it is available then this is an invalid choice.
Lastly, if you decide to set up a share for \localhost, you will be getting in to some interesting territory around the user context that the web server operates in. You see you will have to set up the share for the IIS user that is configured as the run-as identity for IIS, so you will need to know that and create the required config to give that user the share.
If it were me, I would switch to using a standard windows path, although even then you need to appreciate the run-as user context and security config, etc.

TPath.GetTempFileName replies "The directory name is invalid"

TPath.GetTempFileName (which wraps the WinAPI GetTempFileName) replies "The directory name is invalid" when called from an application run by a user who is logged into a domain.
if they use a login that isn't using the domain, it works.
The customer having a problem is in another country and I am also not familiar with how a domain controller's configuration could be changed to avoid this problem.
I assume that since my application is the one that isn't working correctly, I should be getting a temporary file name in a different way.
"run as administrator" doesn't help.
I have directed them to ensure they have full control over the folders mentioned in the TEMP & TMP system environment variables and apparently they do but it still gives the same error.
My application as a Win32 Delphi desktop application but since Windows is the source of the error, I assume this information to be of limited usefulness.
Windows 10 is the OS.
TPath.GetTempFileName calls TPath.GetTempPath at the very beginning but does not check it before calling Winapi.Windows.GetTempFileName using the returned path.
It is very likely that the call to TPath.GetTempPath returns an empty or invalid path.
MSDN says:
The GetTempPath function checks for the existence of environment variables in the following order and uses the first path found:
The path specified by the TMP environment variable.
The path specified by the TEMP environment variable.
The path specified by the USERPROFILE environment variable.
The Windows directory.
If it would return the Windows directory, the call wouldn't fail with the said message. So, probably, there is a wrong path in one of those three environment variables.
Your customer should check these variables and validate them, in terms of existence.
You say, that the paths are "apparently" okay.
Experience taught me to doubt what customers say they checked... You could make a call to TPath.GetTempPath on your own before calling TPath.GetTempFileName to check if it exists. Alternatively you can call it in case of failure as part of handling the raised exception and add the path to the error message.

WSAdmin - Admin App Install: Random string is appended to the Application name

I am working on automation script to install a WAR in the Websphere using WSADMIN console. It leaves random string at the end of the application name.
If the application name is 'test.war', name appears as 'test.war1525e76b1cb'. Has anyone come across this issue before? Any solutions worked. I need the application name to match the artifact to use isAppReady and start the application.
I believe not providing specific app name appends random string to the artifact name and sets as application display name. This line of code with -appname option did the trick.
AdminApp.install(appPath,['-appname '+app_name+'','-MapWebModToVH', [['.*', '.*', 'default_host']]])

Resources