Redcar Install Direct Options - usb

Is there a way to direct the install of redcar to a user defined location other than a user home directory?
I have a jruby install on a USB drive, E:\jruby-1.6.2. Redcar installs the gems to the E:\jruby sub directory but then installs the user files to ~/ on c:.
Is there a way to direct it to e:\fakehome. I want to keep all installation files on my USB drive.

I do not have a Redcar-specific solution, but here is a general solution that may work for you.
PROBLEM:
The user has an application that installs application data files to a fixed location, but the user wants the files in a different location (such as a removable drive or a standardized app data directory).
SOLUTION:
Use a Junction Point or Symlink to simulate the presence of the pre-configured directory.
STEPS:
install the application normally
locate the pre-configured directory that you wish to have relocated (e.g. c:\users\foouser\appdata\fooapp)
create an empty directory with the same name in your alternate desired location (e.g., e:\myusbdrive\appdata\fooapp)
terminate the application you just installed if it is still running
move all of the files out of the pre-configured directory and put them in the desired directory
delete the toplevel pre-configured directory
create a junction that points to the toplevel pre-configured directory you just deleted from the alternate desired location
restart the application and use it normally, making sure that it still behaves normally.
If all goes well you should be finished.
Here i a link to a junction creator (for older versions of Windows (TM))
http://technet.microsoft.com/en-us/sysinternals/bb896768
HTH

This response from Matthew Scharley directly answers how this can be done for redcar.
For the moment it is hard coded. Thankfully it is easy to change:
https://github.com/redcar/redcar/blob/master/lib/redcar.rb#L211

Related

Proper way of installing per-user files during a per-machine installation

I have a per-machine WiX installer (InstallScope="perMachine" InstallPrivileges="elevated") and I need to create a folder and copy a few files to the Documents folder of each user running the application. At the moment I install the files to a personal folder of the current user, but that's wrong and I get the ICE91 verification warning:
ICE91: The file 'SomeFile' will be installed to the per user directory 'SomeDir'
that doesn't vary based on ALLUSERS value. This file won't be copied to each
user's profile even if a per machine installation is desired.
I want the files to be automatically copied to the Documents folder of each user. Could someone post the step-by-step instructions how to do that?
UPDATE: I will be on holiday until September, during that time I will not be able to respond to any comments.
Windows Installer will do this - it's what advertised shortcuts will do. If you install a file to a user specific folder location and a different user logs on, then that file will be missing for that user and repair mechanism of the advertised shortcut repair will install it from the original MSI file. In your case the PersonalFolder property is the user's Documents folder.
To arrange this, the file must be the keypath of a component, and that component must be in a feature with an advertised shortcut. When the shortcut is used the component and containing feature are checked for "self healing" and the missing file installed. This works for users that don't yet exist. Older Office installers once did this to install user-specific items such as templates.
The MSI must obviously be available for this to work, and there is no mechanism to remove the files at uninstall time.
An alternative (or if there are no advertised shortcuts) is to add code to the app that calls MsiProvideComponment (or equivalent p/invoke) passing the ProductCode, feature name, Component id (of that documents file) and use INSTALLMODE_DEFAULT, which will install the file if it's missing as documented here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa370356(v=vs.85).aspx
and it will be missing and therefore will be installed for a user who has not run the app before.
Why would you want to do this this way? What if there are 10000 (just for example) users on the machine? You want to copy the files to all 10000 documents folders taking up potentially GBs of space (depending on the size if the files copied)? If these are configuration options needed by your app, the app itself should create default files in the user's documents location on the first run if they are not present otherwise load the settings from these files. You should not put the default files there for every single user on the machine at install time.
This approach also fails for new users added after you install. How will they get the files in their documents folder? Do they have to reinstall the product?
Consider a per machine install of per user installers with shortcuts that interested users could launch. For example, templates.msi, examples.msi.

Delete files from hidden folder during uninstall (WiX, Pyinstaller)

I would like to delete file (that was created by pyinstaller in C:\Users\User\AppData\Local\VirtualStore\Program Files (x86)\App\tmp )
during Uninstall (using WiX). Any idea on how to do that?
Does anybody know why pyinstaller creates that file and if I can control that?
A partial answer: That virtual store location is where Windows redirects file output when the program is not privileged enough to write to a location, and does not have an elevation-type manifest that shows it is UAC-aware. This might help:
http://sourcedaddy.com/windows-7/uac-virtualization.html
So it appears that pyinstaller assumes it is being run as administrator, but it isn't, and is writing to a location that's virtualised. Instead of trying to remove those files I'd look at that installer and how you are running it and (since it seems to require admin privilege) how to have it run with admin privilege. I assume it's old technology because an updated version would presumably include an elevation manifest saying that it requires admin privilege.

How can I bundle a command line utility in os x application on Mac App Store (using sandbox entitlement)

I have a c++ command line application that I have already compiled into an executable and have added it into my Xcode project. I have also added the "Copy Files" section to the Build Phases tab of the project properties and added my executable with the "Executables" destination. When I build my application I see it in the test.app/Contents/MacOS folder when I View package contents on the test.app that is built.
I also have App Sandbox enabled on the Capabilities tab of the project (so that I can distribute my application through the mac app store.
How can I expose this command line executable that is bundled with my application to the user so that they can run it from the command line (terminal)? I have not been able to find anything on search engines or on StackOverflow about how to get this file (or a symlink to this file) into the users PATH. I tried using an NSTask to create a symlink, but that only works if I disable the App Sandbox (which makes sense). Has anyone done this before? How did you get it to work? Or can these executables only be executed by code within your application?
I don't see a good way to do this. First, a clarification: the PATH is a list of directories that contain executables, not a list of executables; there's no way to add a single executable to the PATH. Instead, what you'd need to do is either put your executable into one of the directories in the user's PATH, or add the directory your executable is in into the PATH.
On OS X, the default PATH is /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin. The first 4 directories shouldn't be modified from the system default, so only /usr/local/bin is a possibility. But creating it (it doesn't exist by default) would require admin (actually root) rights, which isn't allowed by App Store policies. So that's out.
That leaves modifying the user's PATH. The "right" way to do that system-wide is by placing a file in /etc/paths.d, which requires admin (/root) rights, so that's out too. Technically modifying the /etc/paths file would work, but that has the same permissions problem plus it's the wrong way to do customization.
The next possibility is to modify (/create) the user's shell initialization script(s). This'll work, but doing it at all right is going to be messy, because there are several shells the user might use, each with several different possible initialization scripts that the user might or might not have created...
Let's take a very simple case: a user who only ever uses bash, and who doesn't already have any initialization scripts. When a "login" instance of bash starts, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile (in that order), and runs the first one it finds. But your app doesn't know which shell he uses, so you'd better create ~/.profile so zsh and ksh will use it as well. So, your app creates ~/.profile, and puts this in it:
PATH="$PATH:/Applications/MyApp.app/Contents/Helpers"
Great, right? Yup, great, until the user runs something else that wants to set their PATH, it creates ~/.bash_profile, and this overrides your setup. After that, your executable will be in the PATH of zsh and ksh, but not bash. Whee.
And then one day the user decides to use tcsh instead, and it (and csh) have a completely different but equally messy pile of possible init files...

can I install wamp twice in different folders?

I'm facing a problem due to the folder name "Program Files" in which my wamp is installed.
I'm using Yii Framework to create a web app.
While running a command
yiic webapp c:\Program Files\wamp\www\YiiApp
it gives error due to the white space in the folder name.
The error is as below:
C:\Program Files\wamp\www\yii-1.1.13.e9e4a0\framework>yiic webapp c:\Program Fil
es\wamp\www\YiiApp
Error: Unsupported VCS specified. Currently only git and hg supported.
USAGE
yiic webapp <app-path> [<vcs>]
DESCRIPTION
This command generates an Yii Web Application at the specified location.
PARAMETERS
* app-path: required, the directory where the new application will be created.
If the directory does not exist, it will be created. After the application
is created, please make sure the directory can be accessed by Web users.
* vcs: optional, version control system you're going to use in the new project.
Application generator will create all needed files to the specified VCS
(such as .gitignore, .gitkeep, etc.). Possible values: git, hg. Do not
use this argument if you're going to create VCS files yourself.
What should I do? Please suggest me something.
The second install will have superceeded the first. In other words Wampmanager and Apache and MySQL will be being started out of the new folder.
As per your question on wamp forum, copy wwww/subfolders into the new location and then copy ONLY YOUR databases from mysqlx.y.z/data into the same place in the new location.
Then delete the folders from program files.
You only need one wamp ( Apache/MySQL) per system.
I tried something else:
Without moving the previously installed wamp's content just read the
"uninstall_services.bat" file
just uninstall these services from that wamp directory which you want to disable.
Still the another wamp's services won't start. So install those services mentioned in "uninstall_services.bat" file manually from respective directories.
Now Restart All Services from the tray icon. The required wamp will be enabled.
If won't, try it again. No need to reinstall wamp.

What is stored in Packages/User directory?

How to save/restore Sublime Text 2 configs/plugins to migrate to another computer? states that, to backup a Sublime Text 2 installation, a user should preserve the ~/Packages/User directory (from the user's local data folder on whatever OS they're using).
However, http://andrew.hedges.name/blog/2012/01/19/sublime-text-2-more-sublime-with-a-drop-of-dropbox and most other walkthroughs for using Dropbox to sync Sublime's settings specify three directories: ~/Packages, ~/Installed Packages and ~/Pristine Packages.
What is the functional difference between backing up just ~/Packages/User, and the other 3 directories?
I think that Packages/User is the one in which you are supposed to put settings (according to Sublime's official and unofficial documentation). However, some people put them in the other folders from time to time.
The Dropbox advice may be a hedge against poor practice.
From here:
Installed Packages is:
You will find this directory in the data directory. It contains a copy
of every sublime-package installed. Used to restore Packages.
These are the packages installed as sublime-packages. I don't think package control uses this, but if you install something as a sublime-package maybe you want to keep it?
Pristine Packages is:
You will find this directoy in the data directory. It contains a copy
of every shipped and core package. Used to restore Packages.
So essentially a list of .sublime-package files used to restore if you break something.
Packages is:
The packages used by Sublime Text, either installed as part of sublime, or the plugins.
User is:
The user directory is your personal directory, containing configurations, additional snippets, etc.
Below are my personal views on what to save, so feel free to ignore it if you would like.
I would have to agree with the post saying just save the User directory, as Package Control will grab all of the plugins in the list if they aren't already installed. I didn't see this mentioned in that post, but you can also add repositories (by specifying a URL) to Package Control, which allows you to install Packages outside of those submitted to Package Control, but still hosted somewhere. One of the arguments I can see to saving the Packages directory completely is if you are using plugins that aren't hosted anywhere (though these could probably be moved to the Packages directory without any problems).
The Installed Packages and Pristine Packages are used to restore packages, so I wouldn't think these would be needed, but I'm sure there is some use case where it is.
Anyways, realize I got off topic a bit at the end there, but hope everything before that helps clarify.