Adding User License Agreement in Solaris package

前端 未结 2 1089
攒了一身酷
攒了一身酷 2021-01-16 19:22

I have asked similar question for Linux RPM (Adding License Agreement in RPM package). Now i have same query for Solaris package. I could not get any helpful link / details

相关标签:
2条回答
  • 2021-01-16 19:55

    I would implement that using the checkinstall script.

    "exit 3" in that script gracefully ends the package installation.

    That's not trivial as you need to create a request script and reference it in the checkinstall one.

    http://docs.oracle.com/cd/E18752_01/html/817-0406/ch1designpkg-24309.html#ch1designpkg-4

    0 讨论(0)
  • 2021-01-16 20:09

    I have found a way to solve it.

    The self-extracting binary is the way to do it.

    Create a shell script which will first dipslay the end user license and take user input whether user agrees or not.

    Once user agrees, extract the binary (solaris package file) embed in the shell script and install it.

    To embed installer pacakge, first add a marker lets say PKG_DATA:

    shell script contents
    exit 0   
    PKG_DATA   
    

    Append the package file:
    cat pkg_file_name >> your_shell_script

    Extract the package and install it:

    ARCHIVE=awk '/^__PKG_DATA__/ {print NR + 1; exit 0; }' $0   
    outname=install.$$   
    tail -n+$ARCHIVE $0 > $outname   
    
    echo "Extracting..."   
    pkgadd -d $outname   
    rm -f $outname #we dont need it anymore   
    
    exit 0   
    
    PKG_DATA   
    <pkg file data here>   
    
    0 讨论(0)
提交回复
热议问题