install4J: where can I see application logs when redirection is not working - install4j

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.

Related

File selected in WindowsExplorer with Preview Pane locks the file so powershell cannot output to that file

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

Vidyo - how to set logFileName to write in local file

I want to set the logFileName parameter in CreateVidyoConnector (in a JS project), to write logs in a local file.
I read that logs are stored in (Windows) C:\Users\%USERNAME%\AppData\Local\Vidyo\Data\User, but I don't have a Vidyo folder there...
How can I see my logs?
If you are using WebRTC browsers like Chrome or Firefox, you will not find any log files being created. You can see only console logs. This could be the reason why you can't find any.
Log files will only be created if you are using web plugin (Safari or IE10+). In this case, the log files are located in (Windows) C:\Users\%USERNAME%\AppData\Local\Temp
The file names will be like VidyoClient.log, VidyoClient-0.log etc.

when hosted a website shows system cannot find the file specified but work fine in debug mode

When publish a site in local IIS it shows an exception system cannot find the file specified. But same code work fine in debug mode is there any solution for this.
Read the path from web config file.
Check if the missing file is part of your project in the project explorer. If it is not part of your project, then it will not be published, but it nevertheless may work in debug mode, because the file(s) are locally available.

Jar file packaged in install4J has restrictive permissions

I'm testing out Install4J 5.1.5 and am running into a little issue. My original jar file I would like to distribute has full permissions-- anyone can open it (with something like 7zip)-- and modify/delete any entries in that jar. However this same jar-- when installed by install4j-- the permissions become essentially read-only. I can't modify/delete anything in the jar after installation-- gives me permissions issue.
The reason why I want to modify/delete is that there are a few properties files in the jar that get defined by the user during installation so I want to modify / delete whats already in there with the user's new files...
The only thing I can think of is that I set the default unix file and directory modes to 777. But this doesn't seem to work. Any ideas?
The installer has a helper process that runs with elevated permissions. This helper process is started by the "Request privileges" action that is by default added to the "Startup" node of the installer.
All actions whose "Action elevation type" property is set to "Elevate to maximum available privileges" are executed in the helper process.
If you want to modify the file in your application (i.e. not in the installer), you can use a "Add Windows file rights" action to make the file writable for everybody.

How to get the Log File Viewer working in install4j?

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.