Getting the current Home directory in PackageMaker

Hi all,
My package works fine to install a folder in /Library and then set two keys in Loginwindow's defaults file. Even internet-enabled disk image works great.
My problem is, and I've tried now for 2 days to read everything on this, is that I want my install to place an "uninstaller" script on the user's Desktop so the user can easily reverse what the installer did (remove 2 keys and remove the folder in /Library). No problem, this script works fine when run by itself.
But I can't figure out for the life of me how to specify to PackageMaker "home directory of the current user/Desktop" as the install location of this "uninstaller" file. I tried "~/Desktop" and "$HOME/Desktop" in the PackageMaker "destination" field, and also tried making a hierarchy of "~" and "Desktop" folders, and also tried setting the destination to "." and blank. All of these resulted in the Installer making a new directory called "~" at the root of the volume, or one named "$HOME", or just placing the script on the root of the volume. I want it on the user's Desktop, so they will see it. (NOTE: when trying these Unix terms, I was making a separate .pkg for the uninstaller; I know you can't have 2 different install locations in the same package.)
Is this (getting the path to the user's Desktop) possible with PackageMaker, or do I have to have my "postinstall" script for the main install literally create the uninstall script at the user's Desktop (because the "~" notation should be recognized in a shell script)?
I can't figure out why PackageMaker does not recognize the "~" as being the user's home directory - it uses "/" and ".." as defaults sometimes, so it is using the Unix notation.
Also, since the uninstall script is a shell script, if the user double-clicks it, it opens Terminal, which is un-elegant to say the least. Is there a flag that can be set in a shell script which tells it NOT to open Terminal, just to run? I know this is what happens if I wrap it in AppleScript, but I hate using kludges like that.
Thanks in advance to anyone who can help! Happy Holidays
Johnny
Dual 2.0 rev A G5   Mac OS X (10.4.3)  

I have a tech support incident ongoing with ADC about this. People are away for the holidays, but so far I have been able to confirm that PackageMaker itself can't do this, as the name of the current user isn't available, nor do paths to the current Home directory work.
The only way is to have PackageMaker launch a preinstall shell or Applescript that does the "mv <item1> <item2>" or similar (the argument $1 that gets passed to these preinstall scripts IS the name of the user doing the install, so you can get the path to his home directory).
The problem THEN becomes, PackageMaker will not build a package that contains only scripts - it HAS to have some "payload" or you will get a build error. So the ultimate kludge would be to have it run the preinstall script, give it a bogus payload (empty file, etc) to install in e.g., /Library or /Applications, then have the postinstall script delete that bogus payload. I have not tried this so I do not know if it would work.
I am thinking now, with the extremely confusing and apparently contradictory rules that PackageMaker has, that the best way to install software is just to wrap a shell script in an Applescript Application Bundle wrapper (because you can't double-click a shell script without launching Terminal, so to have the user run a shell script you need to wrap it in Automator or AppleScript or a Cocoa app wrapper) and have the shell script do the copying of the files that you need. This still might result in the shell script trying to get some sort of permission (either sudo or that "Override user/group for xxx?" message).
I have read the rules on permissions for Packages about 1,017 times and they still make absolutely no sense to me, and I understand Unix permissions completely. All they would have to do is give some examples, but they don't.

Similar Messages

  • How to get the current path/directory

    Hey,
    I was wondering how to figure out the current path or directory where my Application is running (stored) in! I know there is a statement like getCodebase() for Applets to get the actual path, but I couldn't find anything similar for regular Applications. I think I can not just use a absolute path, since it might run on different os with different file seperator (like /root or c:\). Any help is welcome!
    Thank you very much,
    Marc

    Try this ...
            System.out.println("current directory = " + System.getProperty("user.dir"));
    [/code}                                                                                                                                                                                                                               

  • How to get the current directory as File object

    Hi guys,
    i want to get the current working directory as a file object.
    plz help me on that if there are any standard methods present for this.

    new File(".");

  • Populate the current os directory in a SQL variable

    Hello, I need to populate a SQL variable in a script with the current OS directory I am working from. This is a windows environment and I am using oracle version 9.2.0.1. I know if you do SQL>$cd it will execute a cd like you are at the dos prompt. Is there a way to put this into a SQL variable? This is a SQL*Plus script.
    Thank you.

    I have a tech support incident ongoing with ADC about this. People are away for the holidays, but so far I have been able to confirm that PackageMaker itself can't do this, as the name of the current user isn't available, nor do paths to the current Home directory work.
    The only way is to have PackageMaker launch a preinstall shell or Applescript that does the "mv <item1> <item2>" or similar (the argument $1 that gets passed to these preinstall scripts IS the name of the user doing the install, so you can get the path to his home directory).
    The problem THEN becomes, PackageMaker will not build a package that contains only scripts - it HAS to have some "payload" or you will get a build error. So the ultimate kludge would be to have it run the preinstall script, give it a bogus payload (empty file, etc) to install in e.g., /Library or /Applications, then have the postinstall script delete that bogus payload. I have not tried this so I do not know if it would work.
    I am thinking now, with the extremely confusing and apparently contradictory rules that PackageMaker has, that the best way to install software is just to wrap a shell script in an Applescript Application Bundle wrapper (because you can't double-click a shell script without launching Terminal, so to have the user run a shell script you need to wrap it in Automator or AppleScript or a Cocoa app wrapper) and have the shell script do the copying of the files that you need. This still might result in the shell script trying to get some sort of permission (either sudo or that "Override user/group for xxx?" message).
    I have read the rules on permissions for Packages about 1,017 times and they still make absolutely no sense to me, and I understand Unix permissions completely. All they would have to do is give some examples, but they don't.

  • How to get the current FILE PATH?

    I want to get the File Path on my Java Programming, which class / method can get a File Path on the windows?
    thanks!

    I want to get the current working directory(e.g.
    c:\Tomcat5.0\webapps\)
    If this is a web application you're talking about and you want the directory where that application is installed, that's almost certainly not the CWD. It might be one of the context or whatever variables that's available to servlets. Look in the servlet API and see what's there.

  • How to get the current executing file/itself absolute directory?

    hellooo,
              gentlemen/lady, how to get the current executing file/itself absolute directory?
              thanks
              

              Hello,
              you can get the real path information of the JSP through the servlet context:
              http://java.sun.com/products/servlet/2.2/javadoc/index.html
              javax.servlet
              Interface ServletContext
              Method getRealPath
              Christian Plenagl
              Developer Relations Engineer
              BEA Support
              [email protected] (alex mok) wrote:
              >hellooo,
              >
              >gentlemen/lady, how to get the current executing file/itself absolute
              >directory?
              >
              >thanks
              

  • How to get the Current Directory

    Hi,
    I need to tell the system to read a file in my current directory. How do I tell the system what the current Directory Path is
    Thankx in advance...

    It depends on the current working directory from which you start your JVM.
    From DOS or UNIX shell this is the directory where you have come by "cd".
    On Windows you can do the same from Explorer or other file managers: the directory where you are when starting JVM.exe.
    If you define shortcuts - e.g. on the desktop -, you specify it there as the "working directory".
    You can retrieve this directory by
    System.getProperty( "user.dir" )
    Now with File classes:
    Each file name without path will be interpreted as being in this directory.
    Absolute paths are clear.
    But you can't mix this:
    If you specify "test/debug.ini" or "test\\debug.ini" from debug directory: false!
    If you specify "../debug.ini" or "..\\debug.ini" from debug/test directory: false!
    Do it this way:
    Start from debug directory.
    So you can access file debug/test/debug.ini as
    System.getProperty( "user.dir" ) + "/test/debug.ini"
    Works?

  • How to list the top 10 largest files in the current working directory ?

    How can I list the top 10 largest files in the current working directory in Solaris ?

    execute below....to get the large files in order.. change the <FS>
    find /<FS> -type f -size +1024 -ls | awk '{print $11, $7}' | sort -rn +1 | awk '{print $1, $2/1024/1024 "MB"}' | /bin/more

  • Trouble getting the default  user directory under Windows XP

    I m trying to get the default user directory under windows XP SP3.
    To do so, I'm using
    System.getProperty("user.home");
    I was expecting to get a path like "C:\Documents and Settings\user", nstead of that I get "C:\Documents and Settings\user\Destop".
    I checked the %USERPROFILE% and %HOMEPATH% window's environment variables and both of them are correctly set ( set to "C:\Documents and Settings\user").
    Is there any way to get the right path other than using : System.setProperty("user.home", "C:\\Documents and Settings\\user"); ?

    Thanks WalterLaan,
    The System.getenv("USERPROFILE") method will, at least, fix the problem under win XP.
    I guess i'll have to write a more refined method to be able to deploy my application under differents OSes.
    Regards.

  • I am trying to change the liferay home directory

    I followed the installation document for our version of Studio (version 3.0) which says to edit the portal-ext.properties file in the WEB_INF/classes directory of the endeca-portal.3.0.x.war.  This doesn't seem to work though.  If I add the liferay.home={path} in my standard portal-ext.properties file from the current liferay.home  and then cut-n-paste the entire into the endeca-portal.3.0.x.war file, it will start writing the files into the new home directory but I really don't want to have all that stuff in there if I don't have to.  Has anyone else tried to change the liferay.home path?
    Thanks,
    Sandy

    For Studio installed using Weblogic, you need to copy porta-ext.properties to:
    $WEBLOGIC_HOME/user_projects/domains/endeca_studio_domain/eid/studio/
    Remember that you need to restart Studio Weblogic domain after any change on the properties file.

  • Where can I find the Oracle Home Directory

    hi,
    When i try to setup SALT g10R3, I will have to specifiy the oracle home directory. I have a global variable $ORACLE_HOME which contains this path : /produits/oracle/product/10.2.0 !
    I try to validate but this message appears :
    =========================================================================
    Choose Oracle Home Directory
    1- Specify an Oracle Home
    Enter a number: 1
    Specify an Oracle Home directory: /produits/weblogic
    Path must be absolute and have write permission!
    Specify an Oracle Home directory: /produits/oracle/product/10.2.0
    =========================================================================
    Check Prerequisite
    Cannot get registry information from the given Oracle Home Directory:
    /produits/oracle/product/10.2.0
    Tuxedo has not been installed in this directory, or the registry.xml file has
    been manually removed or corrupted.
    Type 'back' to select another Oracle Home Directory
    Type 'quit' to cancel this installation
    [back | quit]: /produits/tuxedo
    Type 'back' to select another Oracle Home Directory
    Type 'quit' to cancel this installation
    [back | quit]: /produits/tuxedo/tuxedo9.1
    Type 'back' to select another Oracle Home Directory
    Type 'quit' to cancel this installation
    [back | quit]: quit
    =========================================================================
    I don't know how can I solve this problem, someone can help me ?
    Thanks

    Hi Todd,
    I see a similar error while installiing TSAM 10gR3. Please find the error below. I have Tuxedo 8.1 installed on a Linux base, where i am trying to also install TSAM 10gR3. But when i give the PATH/Location, where Tuxedo 8.1 is installed, it throws the following error. Can you please advise?
    ===============================================================================
    Choose Tomcat Feature
    Do you want to install the bundled Tomcat Server?
    ->1- Install Tomcat
    2- Do not install Tomcat
    ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:
    ===============================================================================
    Oracle Home directory selection
    Specify Oracle Home directory: /opt/tuxhome/tuxdom2
    registry.xml does not exist in Folder: /opt/tuxhome/tuxdom2
    Specify Oracle Home directory: /opt/tuxedo/v81
    Error:TUXEDO 10gR3 is not found in the specified directory.
    Specify Oracle Home directory:

  • How to get the current filename and & or path

    How can I get the current path or filename?
    I didn't really find any answers in the net. this.path or app.path were suggested but I couldn't get it to work.
    Thanks in advance for your answer!
    Livecycle Designer ES 8.2.1.3144.1.471865

    Hi,
    event.target.path.toString();  will give the full path including the filename.
    event.target.documentFileName.toString();  will give the filename only.
    Good luck,
    Niall

  • How to get the current path of my application in java ?

    how to get the current path of my application in java ?
    thanks

    To get the path where your application has been installed you have to do the following:
    have a class called "what_ever" in the folder.
    then you do a litte:
    String path=
    what_ever.class.getRessource("what_ever.class").toString()
    That get you a string like:
    file:/C:/Program Files/Cool_program/what_ever.class
    Then you process the result a little to remove anything you don't want:
    path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
    //Might be a little error here but you should find out //quickly if it's the case
    And here you go, you have a nice
    C:/Program Files/Cool_program
    which is the path to your application.
    Hooray

  • Oracle 11i release 2 error "Unable to get the current group"

    Hi oracle gurus,
         I have been trying to install oracle 11g rel 2 on HPUX 11.31 and i am getting the following error
    # more installActions2010-01-06_10-27-37AM.log
    oracle.install.ivw.db.driver.DBInstaller
    -scratchPath
    /u01/tmp/OraInstall2010-01-06_10-27-37AM
    -sourceLoc
    /u01/install/database/install/../stage/products.xml
    -sourceType
    network
    -timestamp
    2010-01-06_10-27-37AM
    INFO: Loading data from: jar:file:/u01/tmp/OraInstall2010-01-06_10-27-37AM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigComma
    ndMappings.xml
    INFO: Loading beanstore from jar:file:/u01/tmp/OraInstall2010-01-06_10-27-37AM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigC
    ommandMappings.xml
    INFO: Restoring class oracle.install.driver.oui.ConfigCmdMappings from jar:file:/u01/tmp/OraInstall2010-01-06_10-27-37AM/ext/jlib/installcommons_1.0.0b.jar!/
    oracle/install/driver/oui/resource/ConfigCommandMappings.xml
    SEVERE: [FATAL] An internal error occurred within cluster verification framework
    Unable to get the current group.
    Refer associated stacktrace #oracle.install.commons.util.exception.DefaultErrorAdvisor:11
    INFO: Advice is ABORT
    SEVERE: Unconditional Exit
    INFO: Adding ExitStatus FAILURE to the exit status set
    INFO: Finding the most appropriate exit status for the current application
    INFO: Exit Status is -1
    INFO: Shutdown Oracle Database 11g Release 2 Installer
    $
    >>
    # more oraInstall2010-01-06_10-27-37AM.err
    ---# Begin Stacktrace #---------------------------
    ID: oracle.install.commons.util.exception.DefaultErrorAdvisor:11
    oracle.cluster.verification.VerificationException: An internal error occurred within cluster verification framework
    Unable to get the current group
    at oracle.cluster.verification.ClusterVerification.<init>(ClusterVerification.java:200)
    at oracle.cluster.verification.ClusterVerification.getInstance(ClusterVerification.java:294)
    at oracle.install.driver.oui.OUISetupDriver.load(OUISetupDriver.java:407)
    at oracle.install.ivw.db.driver.DBSetupDriver.load(DBSetupDriver.java:161)
    at oracle.install.commons.base.driver.common.Installer.run(Installer.java:216)
    at oracle.install.ivw.db.driver.DBInstaller.run(DBInstaller.java:126)
    at oracle.install.commons.util.Application.startup(Application.java:869)
    at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:164)
    at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181)
    at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:265)
    at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:114)
    at oracle.install.ivw.db.driver.DBInstaller.main(DBInstaller.java:132)
    ---# End Stacktrace #-----------------------------
    <<
    $ uname -a
    HP-UX rx2600 B.11.31 U ia64 <XXXXXXXX> unlimited-user license
    # swlist | grep -i oe
    HP-Caliper-PERF C.11.31.04 HP Caliper OE Bundle
    HP-WDB-DEBUGGER C.11.31.04 HP DEBUGGER OE Bundle
    HPUX11i-DC-OE B.11.31.0903 HP-UX Data Center Operating Environment
    # swlist | grep -i qpk
    QPKBASE B.11.31.0903.334a Base Quality Pack Bundle for HP-UX 11i v3, March 2009
    # swlist -l product | grep -i c++
    ACXX C.06.20 HP C/aC++ Compiler
    C-ANSI-C C.06.20 HP C/aC++ Compiler
    PHSS_37501 1.0 aC++ Runtime (IA: A.06.16, PA: A.03.76)
    PHSS_39824 1.0 HP C/aC++ Compiler (A.06.23)
    i start the installation as oracle and my group and user id is
    $ id
    uid=109(oracle) gid=102(oinstall) groups=101(dba),104(asmdba)
    Please let me know what else do i need, we might have to use the hardware for testing another application so i am limited in terms of time constraints
    any help is much appreciated, Thank you!!
    Regards,
    Dasjith
    Edited by: user10247524 on Jan 6, 2010 7:52 AM

    Hi Stig Sundqvist
    Where can i find MOS Doc 983713.1 ??You have to login https://support.oracle.com/CSP/ui/flash.html and you have to CSI account. This site is oracle site for tech. documents for can rise SR etc.. for more details please check
    What is CSI:
    Re: Installing Oracle Database 10.2.0.4
    And how do i do to fix this problem ????Login metalink then find upper note and follow document
    Hope it helps
    Regard
    Helios

  • How to get the current user name of the host who is occupying a specific VM?

    I'm developing a winform app with c# code to manage Hyper-V. I need to remind someone if he/she would take a VM which has already been occupied by others.
    Is there any powershell cmd or WMI interface to get the current user of a specific VM?
    Thanks!

    Hiya,
    from cmd there are quser(Query user) and qwinsta(Query Session)
    which should give you that. Don't know how you can incoorperate that in C#, but that should give you something to work with :)
    https://technet.microsoft.com/en-us/library/cc785434.aspx
    https://technet.microsoft.com/en-us/library/cc788125.aspx

Maybe you are looking for

  • How to edit a line in a file using a batch file??????

    Basically i want to edit one line in a properties file, using a batch file, Here is what it says #Minecraft server properties #Tue Feb 22 15:58:36 PST 2011 level-name=world2 hellworld=false spawn-monsters=true online-mode=false spawn-animals=true max

  • FM for splitting the date

    Hi Everyone, I need an FM to split the Date into days , month and year... can anyone help me out. Points will be rewarded. Regards, Syed

  • Quicktime crashed while recording, where's the file now?

    Hi all, Quicktime crashed when I was saving a long speech I had just recorded. I can't find the file anywhere. Does anyone know where the file might be stored so I can attempt to find it and not have to re-record this thing again? I don't see it in u

  • Query key figures calculation issue

    Dear Sap Gurus, I would like to calculate the sum of one key figure on the month m-3 m-2 and m-1 I have created 3 restricted key figures filtered by month m-3, m-2 and m-1 i have created a key figures one which one I sum these 3 key figures but the r

  • Printing from applet hangs

    I'm trying to create an applet that can print a graphic. I have a single button and the event seems to fire when clicked. I get the security warning asking me if I want to print. I click yes and it usually pops up again and I hit yes again and then i