Automated script to change default storage path in LibreOffice - path

Hi Stackoverflow people,
LibreOffice's default storage path is located in $USER/My Documents.
It is easy to change this path in LibreOffice.
However, my employer has assigned me to reinstall 30 pc's with a linux distro. :))
All installations should include LibreOffice.
That is why I would like to run a automated post-install script which will change the default storage location in LibreOffice to a custom location on our company's document server.
e.g. "LO_STORAGE_PATH = /mnt/documents"
Reason: I think it is too time-consuming to change the storage path manually in LibreOffice on 30 pc's.
I tried searching with:
"Change storage path command LibreOffice"
"Script cli storage path LibreOffice"
"Bash change storage path LibreOffice"
Can anyone of you give me a hint?
Thanks!
Kees

If you want to change the default save directory, you must edit Paths in LibreOffice. Usually, from the main menu Tools > Options > LibreOffice > Paths, then edit the My Documents path value.
When doing that, the new value is saved in the file ~/.config/libreoffice/4/user/registrymodifications.xcu
And a new entry appears in this file like below :
<item oor:path="/org.openoffice.Office.Paths/Paths/org.openoffice.Office.Paths:NamedPath['Work']"><prop oor:name="WritePath" oor:op="fuse"><value>$(work)/mynewpath</value></prop></item>
After some tests, this entry seams to allow only value starting with $(work), the user home directory. By googlize, it may be a known bug.
With that you could be able to automate it with a sed expression.
If you search a more precise response, you can try to post your question to the dedicated forum http://ask.libreoffice.org/
Good luck

Related

A non version controlled file or writable file by the same name already exists locally

Trying to get latest version of the project and tfs and always get te same warning without the way of resolving conflict:
When i click the file to resolve it gives me no options to choose
Is there any way to get this around without resorting to cloning whole solution again?
Thanks for help in advance
For this kind error usually due to the file is writable. Take a look at #Buck Hodges (Director of Engineering at Microsoft)'s reply in this case:
The file is writable. When there's a writable file, get will not
overwrite it unless the /overwrite option is used. However, you would
need to figure out how the file is becoming writable. You may want to
go back to the default option of creating a new workspace, and see what is making the file writable.
By default, the system does not retrieve an item if it is writable (that is, if its read-only attribute is cleared) on the client machine. This option overrides the default behavior and overwrites a writable item, unless the item is checked out.
Instead get files directly through Visual Studio. You could try to get files through tf get command line and with /overwrite option. This should do the trick.

Installshield skip custom action if an application is already installed

I have created a basic MSI project which will install few applications on the machine. My first step is to copy few folders and files to the destination machine. Then I have created two custom actions to run the exe files. I would like to skip custom action if that particular application is already installed on the machine. Also while copying the folders and files, I would like to skip if the folder or file already exists on the machine. I tried using install conditions, condition builder, system search but i am unable to resolve it.
Please provide any ideas to resolve these issues. Your answers would be greatly appreciated.
All this can be resolved by using System Search.Refer (http://helpnet.flexerasoftware.com/isxhelp22/helplibrary/NewLaunchCondition.htm)
1) To check if file exists select (File path, by searching folders),enter file name, select directory and assign depth depending on the directory mentioned.
Suppose A.txt is present inside \B\C folder and you are selecting B while searching then depth should be >=2. The property mentioned in this process will get set with the file path if file exists.
2) To check if folder exists select (Folder path, by searching in a specific folder), follow the above procedure and mention folder name instead of filename.
3) To check if application is installed you can check by following one the above processes and find application specific folders/files.
Lastly use the public properties as a condition for your custom actions and components. Suppose you are checking for a file and setting a property ASONFILEFOUND, just mention this in component/custom action condition and those wont run if file exists.
If you still face issues enable windows logging and view the log to check whether properties used in System Search are getting set or not.
Execute-MSI -Action Install -Path 'AcroRead.msi' -Transform 'Settings.mst' -Parameters '/q /norestart' -SkipMSIAlreadyInstalledCheck
use this command. if you are using Powershell for installation.
This will skip the MSI file check.

Neo4j Default Database Location (Windows)

With the Neo4j 2.0.0 Community edition, is there a way to change the default database location?
Seems like every time I start the program it points back to the default location (in the user's documents directory).
I tried editing the neo4j-server.properties file and adding a line to specify the desired directory there, but this didn't seem to work:
org.neo4j.server.database.location=C:\MyGraphDatabaseDirectory
Changing the default location seems to be limitation of the community edition. What you can do is a "junction point" using the mklink command:
mklink /j C:\Users\<USER>\Documents\Neo4j\default.graphdb D:\Data\Neo4j\default.graphdb
That way you don't need to change the path of the database. The default path will point to the desired location.
When starting Neo4j 2.0 Community edition on Windows you will see a dialog UI with a data folder location that you can browse to. To change your data location, browse to a different folder and then click the start button.
Closest thing you can get to is to add a shortcut (to your app's neo4j database) in the default neo4j database folder (or in the parent folder),
I.E.:
In C:\Users\YOURUSER\Documents\Neo4j create a Windows Shortcut (browse to the folder in windows explorer, right click-> create shortcut), --> Create the shortcut to your app's neo4j db location.
Then when you open Neo4j's Window gui, you can go to browse -> click your shortcut and be directly into the folder you want.
It's far from a perfect solution, but it saves a lot of clicking!
In windows, you create a new folder and the you choose it when you want to start your server

Attachment using Editable Email Extension in Jenkins

I am using Editable Email plugin in Jenkins to attach a file with the email. The problem is that the plugin is unable to find the file to attach.
My file structure is like this -
ReportDirectory
workspace
ReportDirectory contains the report which I want to attach. I believe that the base directory for the plugin is the workspace. So I am giving the attachment location as
../ReportDirectory/DemoReport.html.
I have also tried
ReportDirectory/DemoReport.html
and many more options.
Am I doing something wrong?
I figured it out.
The Editable Email plugin uses the Ant File Syntax for locating the attachment. When I took at the documentation for Ant File Syntax ( http://ant.apache.org/manual/dirtasks.html ), it says that
In general, patterns are considered relative paths, relative to a task dependent base directory (the dir attribute in the case of ). Only files found below that base directory are considered. So while a pattern like ../foo.java is possible, it will not match anything when applied since the base directory's parent is never scanned for files.
Since the base directory in this case is the "workspace" and my directory "ReportDirectory" is not located in it so the Ant is not able to access it.
Two solutions exist:
Move the "Report Directory" somewhere in "workspace". I did not prefer this because I did not want to mess up the workspace.
Once the report has been created in "ReportDirectory", use your Ant\MSBuild script to copy it temporarily in the "workspace" and then the Email plugin shall be able to access it by something like **/Report.html or something.
#Amey - thanks for your efforts though :)
Another solution is create a symbolic link from $JENKINS_HOME/jobs/workspace/$workspace_name to the path with your $workspace_name. This way worked for me.
ReportDirectory/DemoReport.html
is the correct way to do it.
Please keep in mind that the path to the file and the file name is case sensitive so I assume your entering the correct name.
One more thing is to check is that the report is actually created and is located at the path mentioned by you.
Another thing you could try
ReportDirectory/*
Jenkins will use the directory available in its workspace.
You can send multiple attachments as below.
reportFolder/html/index.html, screenShotsFolder/screenShots/*.jpg
Simple answer:
Copy your file into the workspace(into your job directory), then under Attachment, just give the file name without any quotation or anything. This will automatically tell Jenkins to pick up your file. That's it!
Pls don't confuse yourself after seeing all the configurations.

Importing file into maple on a mac, correct filepath or default directory

I want to import a (text) file into maple on a mac.
According to all available information, the command should be of the form
read "MacIntosh HD/Programme/myfile"
but I did not succeed.
I tried various variations, slash/backslash, slash at the beginning, with and without Mac HD at the beginning, local language and English language name for the system directories.
I always get
Error, unable to read pathname I entered.
I would be content with any solution, either the syntax, or the default maple directory where I can put the file without worrying about the path or the existence of a menu item with the same effect.
Found the answer myself in the meantime:
For the above example
read "/Applications/myfile";
would succeed, so in particular, one has to use the English names for the systems directories even though in finder they are only ever given in the language you chose for your account.
Also, currentdir() and currentdir("Applications/Maple 15") allows you to see the current directory and to change it, respectively.

Resources