Greetings,
I'm using AI 7.6 build 27499
I have a Java product which accepts one argument from the command line - the absolute path to the working directory. On the "Virtual Machine" tab, I am setting the Command Line as: "%APPDATA%\[Manufacturer]\[ProductName]"
I am specifically not referencing the [AppDataFolder] property because that property is resolved at install-time. I need to resolve the path at run-time, so I am using the built-in Windows environment variable %APPDATA%. I realize that this type of configuration can leave behind garbage on the machine after the app is uninstalled, but that is acceptable behavior for us (I know, it violates installer "best practice").
What I would like to do is the following:
(a) If the Windows version is 2000 or XP, use %APPDATA% on the Java command line
(b) If the Windows version is Vista or 7, use %LOCALAPPDATA% on the Java command line
The reason I want to do this is because on Vista and 7, %APPDATA% resolves to "C:\Users\<user>\AppData\Roaming". My app is creating data which is specific to the current machine and should not be included in the user's roaming folder.
Is there a way to use either %APPDATA% or %LOCALAPPDATA% depending on the Windows OS? I assume I would need to create a public property and then set it using a Custom Action. I have read the Custom Action faq and the How do I install resources based on the Operating System version how-to, but neither answers my question. I created a "Property Set With Formatted" Custom Action, but then realized that is the wrong approach...
I am trying to build a command-line argument that looks like:
"[MY_CUSTOM_PROPERTY]\[Manufacturer]\[ProductName]"
The value of [MY_CUSTOM_PROPERTY] should resolve to either the literal string %APPDATA% or the literal string %LOCALAPPDATA%, as appropriate to the OS version.
Any help or guidance you could provide would be much appreciated.
thanks,
-Todd
FOLLOW US
Get the latest news in Application Packaging