I'm trying to use the log file viewer in my install4j installation, and no matter what I do the text box is empty. The log file doesn't exist when the form is shown. When the user clicks next, a batch executable runs that calls a java process and that creates and writes out to this log file. I've successfully redirected stdout to a variable, and used the text display to show the updating variable contents but I can't get the log viewer to work for the actual log file.
I've tried several combinations of pointing to the file. No errors are ever present in the installation log.
I've used
${installer:sys.installationDir}/logs/logfile.log
logs/logfile.log
c:\program files\my app\logs\logfile.log
The problem was that relative files in the log file viewer form component were not resolved relative to the installation directory. This will be fixed in 8.0.3. In the meantime, you can prepend
${installer:sys.installationDir}/
to the "Log file" property or the "Log file viewer" form component, then it will work.
Related
I configured install4j to redirect log files :
stderrFile="${installer:sys.appdataDir}/myApp/logs/error.log" redirectStdout="true" stdoutFile="${i${installer:sys.appdataDir}/myApp/logs/output.log"
Problem is that recently I have reports that my app is not functioning properly because for some Windows users, the folder ${installer:sys.appdataDir}/myApp/ is not created. I am not sure what is happening here and the problem is that I don't have access to my log files that were supposed to be dumped in that folder. Is there anywhere else on the system those logs files can be seen?
If the directory for the redirection file cannot be created, a FileNotFoundException will be thrown by the launcher. If the directory exists, but the redirection file cannot be written, no redirection will be performed, but the launcher will start.
I would suggest to create an additional launcher without redirection and set it to console mode. In that way the output will be displayed on the terminal.
I have a scheduled script that outputs bunch of HTML files with static names to a remote location. I noticed, that if I have one of those files selected in Windows Explorer so that its contents are shown in Preview Pane, then Powershell cannot overwrite that file and skips updating it.
This only happens if output files are in remote location. Works just fine if files are local.
How do I force PowerShell to overwrite remote files in this situation? Lots of users work with those reports and if one of them leaves Windows Explorer window with one of those files highlighted overnight when the script runs, the file is not going to be updated.
Move HTML files to webserver. You will solve your problem entirely. IIS Setup on windows server is Next, Next, Next. You can leave link to a new file location (https://....) in old place, so users can easily navigate to a new place. Possibly this link can be automated (not sure because of modern security standards)
Try [System.IO.File]::Delete($path) just before writing this file. This removes file entry from filesystem, but leaves file open for those who have it open for now. This makes your script to write to a new file with the same name. Old file exists without name (deleted) but leaves open until everyone close it. Check it actually deleted with resresh!
Try [System.IO.File]::Move($path, $someTrashFullName) just before writing this file. $someTrashFullName probably must be on same drive. Same as Delete, but renames file. Some self-updating software use this strategy. File is renamed, but it's still kept open under new name.
Try replace file with shortcut to some file. You can generate files with different names and change shortcut programmatically
HTML files that change location using js ? They read nearby JSON (generated by export script) and lookup there for a new filename. So user opens static unchanged A.html, JS inside lookups at A.json for new name and redirects user to A-2020-08-11.html. I'm not sure browsers allow reading JSON files from JS for files that opened from network drive.
Only way left is to stop network share or\and close open files server-side.
Maybe some fun with to disable preview in this folder \ completely?
Try with -Force. But to me, it seems to be more a permission issue.
Remove-Item -Path '\\server\share\file' -Force
Problem
"Windows Archive" generates log file and "Windows" not.
Setup
I'm using install4j to generate a windows gui application. I only have one launcher and redirected stderr and stdout.
Then I create two media files: "Windows" and "Windows Archive".
If I use the "windows archive" type the log files are created and filed with content.
If I use the "windows" type the log files are not created.
I know that in both cases the same error happened, so there should be the same output in both cases.
Thanks in advance
If the redirection files are not writable, you have to specify a location where they can be written such as
${installer:sys.localAppdataDir}\mystderr.log
Redirection files for generated launchers are configured on the "Executable info->Redirection" step of the launcher wizard.
I am in the process of updating our currently existing Chrome distribution so that when a user downloads a .pdf file, the file is opened automatically.
As a first step, I was able to prevent Chrome from opening the pdf in its internal pdf viewer and could do a registry entry by using AlwaysOpenPdfExternally. This way it was downloading the file immediately and not opening it in the Chrome viewer.
I'd like to use Adobe to view the file automatically after download.
Unfortunately I was not able to find a registry entry. Nor was I able to find a GPO entry to be changed for Chrome.
I had found the following PowerShell script to be started upon logon of the user. However, testing it did not give me the result I was looking for.
The given entry extensions_to_open was not existing even after starting the script.
The current version of Chrome used is 66.255.
I would be happy for any help.
Edit: I am able to get the file to be opened automatically by inserting the given line here:
Is there any way to programatically force "Always open files of this type" for a specific file type in Chrome?
however, I am unsure of how to distribute the line of code into every PC in my network.
Edit: Chrome offers Group Policy Templates which should be importet into the active directory of your Windows Server. Once imported into your GPO, Chrome offers the setting: "Always open Pdf files externally". Once you check this feature, file should not automatically open in the internal PDF viewer.
See second edit: import the latest group policy templates into the GPO (will be stored on the active directory). After that, go into the GPO policies for "Google Chrome" and check the feature "Always open PDF files externally".
I'm trying to pass a .txt file as a paramater into my java program.
My program is titled SetTest and the file I'm trying to read is Ted.txt. From a Windows 7 command prompt I create a temp folder and compile my program there creating SetTest.class. Also in that folder is Ted.txt. From that temp directory I then issue the command:
java SetTest < Ted.txt
Everything works as expected. The program reads in the file and outputs what I'm looking for. All good.
My question is how do I duplicate this using Eclipse? I believe my text file is in the proper location, listed under JRE System Library as seen in the Package Explorer. I've been trying the following from Eclipse: Run -> Run Configurations... Then in the (x)= Arguments section, in the Program arguments field I enter Ted.txt then click on Run. Unfortunately nothing seems to happen. No error message, but I don't see the console output I'm looking for either.
To rephrase your question - you want to send a file to your application's standard input, while it is running in Eclipse.
You can write (copy & paste) data into console (that's where the standard input is taken from). However I am not aware of any possibility how you can redirect file contents directly to the standard input.
UPDATE with correct keywords you might be able to find more resources:
Eclipse reading stdin (System.in) from a file
https://bugs.eclipse.org/bugs/show_bug.cgi?id=155411