I am making a setup of my application with WiX. I want to copy/paste an .ini file in the current user folder on Windows (C:\Users\{username})
I saw on this post that I should use the tag [%USERPROFILE].
I use it this way :
<Directory Id="UserFolder" Name="[%USERPROFILE]">
<Directory/>
As a result, a folder [%USERPROFILE] is created in C:\ containing the .ini file. This is not what I want.
Does anyone have an idea how to make it work ?
[%USERPROFILE] is a valid environment variable reference, but I don't think it can be used in this context, as this context isn't formatted. See the Directory Table for details.
Note that, as mentioned in the comments, %USERPROFILE% is likely the wrong place for any files you may want to install. Consider using another predefined folder, such as AppDataFolder, LocalAppDataFolder, or PersonalFolder.
If you go with PersonalFolder, I believe you can just use that instead:
<Directory Id="PersonalFolder"> ... </Directory>
If there is no satisfactory predefined folder property, you can use either a type 51 or a type 35 custom action (depending on whether you schedule it before or after CostFinalize to set the run time value of your folder to [%USERPROFILE]. Those custom actions will format the value they use. Make sure to use an ALL-CAPS name so that it can be set at run time. For example, if the directory is called USERPROFILEFOLDER:
<SetDirectory Id="USERPROFILEFOLDER" Value="[%USERPROFILE]"/>
<!-- or -->
<SetProperty Id="USERPROFILEFOLDER" Value="[%USERPROFILE]"/>
(And don't forget to schedule the action somewhere.)
Related
I am trying to make a windows application. In this application, some files get modified as a user add or delete an entry. I saved these files on the application folder itself.
But After making binary file I installed it, As I try to add a entry it get crashed.
So, I figured out the issue. The windows doesn't allow to modified files inside C:\Program Files.
So, I installed it in other drive and it works. It solved my issue temporarily but I want to know how other application works in windows.
Where do those applications save their data?
I am not talking about some data which get saved in "Documents" but something which is essential need to modified every time user makes change like theme, formates.
No user access is allowed to the "program folder", and that's for good: it is a system folder, and it should only be accessed for system related operations (like installing or uninstalling a program).
There are many places where "program data" can be stored depending on the situation, and QStandardPaths provides access to their paths, according to the category location. What you might be interested in are:
ConfigLocation: Returns a directory location where user-specific configuration files should be written. This may be either a generic value or application-specific, and the returned path is never empty.
AppDataLocation: Returns a directory location where persistent application data can be stored. This is an application-specific directory.
AppLocalDataLocation: As the previous one, but Windows specific.
AppConfigLocation: Returns a directory location where user-specific configuration files should be written. This is an application-specific directory, and the returned path is never empty.
Those paths (along with the others listed in the documentation) can be accessed using the following static methods:
standardLocations(locationType): returns a list of paths for the requested location type, in order of priority (the first is usually the preferred one);
writableLocation(locationType): returns the preferred path for which write access is allowed (usually the first of the standardLocations());
If you need to store the user configuration, you can use QStandardPaths.writableLocation(AppConfigLocation), while if you have some user-specific internal data that is used by the application (email database, document templates, etc) QStandardPaths.writableLocation(AppLocalDataLocation) should be a good choice.
In both cases, those paths may not exist, so you need to ensure that and eventually create them, possibly by using QDir(path):
dataPath = QtCore.QStandardPaths.writableLocation(AppLocalDataLocation)
dataPathDir = QtCore.QDir(dataPath)
if not dataPathDir.exists():
# create the directory (including parent directories if they don't exist);
# that the argument of mkpath is relative to the QDir's object path, so
# using '.' means that it will create the actual dataPath
dataPathDir.mkpath('.')
Note that for all of the above (especially the last 3) it's required that you correctly set both the organizationName and the applicationName.
WebStorm (and I assume IntelliJ), caches a lot of information in a directory called .WebstormXX under the user directory in Windows.
The documentation states that the data is saved here :
<SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\.<PRODUCT><VERSION>
I would like to NOT have this data stored here because my network user space is miniscule compared to what is required for the cache directory.
Can I define my .WebstormXX to be for example directly on my C drive?
In <WebstormLocation>/bin/idea.properties you can find the properties:
idea.config.path=${user.home}/.WebStorm/config
idea.system.path=${user.home}/.WebStorm/system
These are commented out by default and are found at the top of idea.properties; Uncommenting and redefining them is all you need to do.
Ensure you use forward slashes when defining a new directory.
Is there a way to see TeamCity configurations that override parameter defined in template?
I don't think so. What's worked for me in the past was to search through the project files on the filesystem. If you have many build configs, this will be faster than opening each of them in the GUI.
Search for something like this:
<param name="myParamInheritedFromTemplate" value="myOverrideValue" />
in <TeamCity data directory>/config/projects/**/*.xml. If it's absent in an XML file, that build config just inherits the value. If it's present, it overrides it.
It's hacky but it's quick.
There is a feature request https://youtrack.jetbrains.com/issue/TW-21212, please vote. Current workaround are to either search the raw XML files with the settings stored under TeamCity Data Directory on the server as #sferencik suggested, or use REST API to get settings of all the build configurations and search for the parameter there. Let me know if you need help on any of these.
The trouble is, while PL/SQL procedures do generate HTML, I cannot make image folder work. That is, when I try to insert an IMG tag, it shows that it can't find that file in /xxx/img folder.
I tried to redefine DocumentRoot in httpd.conf - it works only on that folder itself, not recursively.
I tried to change DOCUMENT_ROOT in dads.conf - it doesn't work at all.
So the question is, how can I make images deep inside that root folder show up?
At last I have found an answer and a reason of this behavior.
The reason is Oracle's hand-made handler, pls_handler, used for any DADs, made up as Apache Locations.
Trying to create folders for storing images like $ORACLE_HOME/htdocs/myapp/img, I interfered with that directive:
<Location /myapp>
SetHandler pls_handler
# lots of stuff
</Location>
And thus, anything under $ORACLE_HOME/htdocs/myapp folder was processed as PL/SQL procedures.
This is a plain Apache configuration issue. You simply must define an alias in your Apache configuration file.
Assume that your image resources are in a directory /middleware/project/img. Then just add the following line to your httpd.conf or (that's where I configure it) dads.conf:
Alias /i/ "/middleware/project/img/"
If you now have a file alert.png in your /middleware/project/img directory you can access it with an /i/alert.png url.
I'm using JMeter to test concurrent downloads, and need to store it into specific folder.
I'm working on windows and using "Save response to a file". If I use the absolute path it all works exactly as I want it to work.
Now, I need to share this with a group (will be stored in repo) and want to change my obviously wrong absolute path to relative.
Now:
"~" - stores download in project root folder, where .JMX file is, but I want it in: "~/downloads/" so, in subfolder.
None of "regular" things work and yes I tried all possible combinations even those I know it should not work at all.
~/downloads/
./downloads/
~./downloads/
\downloads\
\downloads\
...
It or fails, and I can see in log error like:
~\downloads\1.x-gzip (The system cannot find the path specified)
Or It get's store in root with the filename "downloads" instead 1.x-gzip
Is there a way to do it, maybe using beanshell?
Most important, why is that behavior in JMeter so different, I mean if it works for "home" and "~/../" why it does not recognize subfolders?
Thanks
JMeter seems to be removing trailing slash so there is no way to bypass it apart from providing full path to the folder.
If you need to do it dynamically, relevant Beanshell script will look like:
${__BeanShell(import org.apache.jmeter.services.FileServer;FileServer.getFileServer().getBaseDir() + System.getProperty("file.separator") + "downloads" + System.getProperty("file.separator"),)}
You need to have "downloads" folder at the same level with your .jmx test script.
References:
__Beanshell() - function
FileServer class JavaDoc
How to Use BeanShell: JMeter's Favorite Built-in Component