I'm using AI 7.6 build 27499
I am experiencing inconsistent / incorrect handling of arguments when my settings are inside the INI versus inside the native launcher EXE.
==================== . Configuration 1 . ====================
Java Products > Virtual Machine
Code: Select all
Command Line: "%APPDATA%\[Manufacturer]\[ProductName]\data"
Output Stream to: "[logs_DIR]%USERNAME%-output.log"
Error Stream to: "[logs_DIR]%USERNAME%-error.log"
After I build and install the product, the relevant part of the INI file looks like this:
Code: Select all
[Application]
Cmd=""%APPDATA%\MyCompany\My New Product\data""
Application Type=gui
Failure Check=yes
Single Instance=yes
Output File="C:\Documents and Settings\All Users\Application Data\MyCompany\My New Product\logs\%USERNAME%-output.log"
Error File="C:\Documents and Settings\All Users\Application Data\MyCompany\My New Product\logs\%USERNAME%-error.log"
Code: Select all
public static void main (String[] args)
During install, I create the path [logs_DIR] for the stream redirection logs. When the app runs, the out/err streams are correctly redirected to the files inside [logs_DIR].
==================== . Configuration 2 . ====================
Java Products > Settings > select the "Hide Settings" checkbox
After I rebuild and install, I see that the INI file does not contain an "Application" section any more; this is expected, as those settings should now be contained within the EXE native launcher.
Now when I run my application,
*** Cmd ***
- I receive the value of the "Cmd" argument as a String array with multiple elements - the path is not properly quoted, so java treats each whitespace char as a new command-line argument.
- Additionally, the values of [Manufacturer] and [ProductName] have not been replaced with the appropriate string - they are passed as the string literals "[Manufacturer]" and "[ProductName]".
- The String array that is given to my application is:
- C:\Documents
- and
- Settings\toddpatt\Application
- Data\[Manufacturer]\[ProductName]\data""
*** Logs ***
- The redirect logs are not written to the [logs_DIR]. I cannot find them anywhere on the file-system, so presumable they are not being created because of path-related problems.
- If I remove the enclosing quotes from around the out / err paths, rebuild and install, the logs are then created.
==================== . Summary . ====================
*** Logs ***
The handling of enclosing quotes around the out / err paths is inconsistent.
- If the settings are contained in the INI file, the presence or absence of enclosing quotes does not matter - both ways will succeed.
- If the settings are contained in the EXE file, the presence of enclosing quotes prevents the creation of the logs. The logs will only be created if the enclosing quotes are removed.
It would be cleaner if the behavior were consistent.
*** Cmd ***
- Enclosing quotes are not handled properly when settings are stored in the EXE file.
- Properties / variables in the "Command Line" field are only resolved if the settings are stored in the INI file. When the settings are stored in the EXE, the properties / variables are never resolved.
Thanks for your help,
-Todd
FOLLOW US
Get the latest news in Application Packaging