Silent installation of git through use of .bat file on Windows - windows

I am currently working on a Windows batch file that will allow me to silently install git (the executable for which will be placed in the folder that the .bat file will be running from) in a pre-specified location on the file system.
I've found this article which seems to provide some suitable advice:
https://github.com/msysgit/msysgit/wiki/Silent-or-Unattended-Installation
However, I'm not entirely sure what parameters I would need to mention in my LOADINF file. I would like to pre-define the options that the user would manually select throughout the various stages of installation, so that it can run through from start to finish without prompting anything from the user.
Can anyone help or point me to a place where I can find these parameters and their available values?

Create a file, for eg. my-config.cnf (or my-config.ini) with the following content:
[Setup]
Lang=default
Dir=C:\Program Files (x86)\Git
Group=Git
NoIcons=0
SetupType=default
...
<other options as shown in the msysgit wiki>
Now, in the batch file, when you execute the installation file (say msysgit-install.exe), use /LOADINF as follows:
msysgit-install.exe /SILENT /LOADINF="my-config.cnf"

Related

izpack without run-privileged cannot write to C:\MyDirName

I have a custom Java app and an IzPack installer. For years, in my izpack build file I had the following:
<run-privileged condition="izpack.windowsinstall.vista|izpack.windowsinstall.7"/>
The problem is that some of the users do not have admin privilege on their PCs, but they still want to be able to install the package. If I remove the above, they can run the installer but then it complains "This directory cannot be written!", when they try to install in the default location, which is C:\OPENDCS.
Yet the same user can create this directory either from a CMD or an Explorer window.
Is there a way to allow the izpack installer to create a directory directly under C:\ without running as an administrator?
Please check the behavior with izpack v5.0.7. The problem you mentioned should be fixed with this issue: https://izpack.atlassian.net/browse/IZPACK-1355
You could package your directory create operations in a create-dirs.bat batch file, which you would mark <executable> and execute stage="postinstall". This way the directory creation will be executed with the given user's permissions, which (according to your post) should work just fine.
EDIT 29/02/2016: You would put this file into a first "dummy" <pack>, mark it <executable> and execute stage="postinstall" as stated above, which would execute it after this first dummy pack was installed. At the installation of the next pack (i.e. your first useful pack) you will already have the folder created.
Note that postinstall will not run the batch file after the installation, but after the <pack>'s installation.

Where is the location on the extracted .msi file?

I have a setup exe, and I want its .msi file for administrative installation (see https://superuser.com/questions/307678/how-to-extract-files-from-msi-package)
But, although I see at the beginning the extraction of .msi, I can't find it.
Where is the location of this file?
Usually MSI file(s) might be extracted in different temp locations depends from who was launched (User\System\etc) and how configured setup.exe. Sometimes you can extract it with help of different command-line switches for setup.exe.
The simple way to check - launch it under user account, go to %temp% folder, most likely there should be created folder with {GUID_view_name}. Inside this folder you will find MSI file.
User's %temp% folder has different location in different Windows versions:
Windows XP\2000\2003:
"C:\Documents and settings\{user name}\Local settings\Temp" or "%userprofile%\local settings\temp"
Windows Vista\7\8\2008\2012
"C:\Users\{user name}\AppData\Local\Temp" or "%userprofile%\appdata\local\temp"
P.S. Also you can check this SO question-answer.
Snapshot a clean VM and use a program such as Install Watcher or InCntrl to record the current state of the file system. Run the setup.exe until you are on the first dialog of the MSI and take another recording. Diff and look for where the MSI and related support files appear.
I found a much better solution, Igor, gave me the idea.
I used ProcessMonitor and filtered with Process is "msiexec.exe" and Path ends with ".msi".
I found the msi in:
C:\ProgramData\Downloaded Installations\{41A70E83-DA5D-4CA6-9779-73C9330E3D13}\IQProtector64.msi

Jekyll private deployment?

I have created jekyll site. Regarding the deployment I don't want to host on github pages. To host private domain I came know from documentation to copy the all files from _site folder. That's all wicked.
Question:
Each time I add new blog post, I am running cmd>jekyll build then I am copying newly created html to hosted domain. Is there any easy way to update without compiling each time ?
The reason, Why I am asking is because it will updated by non technical person
Thanks for the help!!
If you don't want to use GitHub Pages, AFAIK there's no other way than to compile your site each time you make a change.
But of course you can script/automate as much as possible.
That's what I do with my own blog as well. I'm hosting it on my own webspace instead of GitHub Pages, so I need to do these steps for each update:
Compile on local machine
Upload via FTP
I can do this with a single click (okay, a single double-click).
Note: I'm on Windows, so the following solution is for Windows.
But if you're using Linux/MacOS/whatever, of course you can use the tools given there to build something similar.
I'm using a batch file (the Windows equivalent to a shell script) to compile my site and then call WinSCP, a free command-line FTP client.
WinSCP allows me to store session configurations, so I saved the connection to my server there once.
Because of this, I didn't want to commit WinSCP to my (public) repository, so my script expects WinSCP in the parent folder.
The batch file looks like this:
call jekyll build
echo If the build succeeded, press RETURN to upload!
pause
set uploadpath=%~dp0\_site
%~dp0\..\winscp.com /script=build-upload.txt /xmllog=build-upload.log
pause
The first parameter in the WinSCP call (/script=build-upload.txt) specifies the script file which contains the actual WinSCP commands
This is in the script file:
option batch abort
option confirm off
open blog
synchronize remote -delete "%uploadpath%"
close
exit
Some explanations:
%~dp0 (in the batch file) is the folder where the current batch file is
The set uploadpath=... line (in the batch file) saves the complete path to the generated site into an environment variable
The open blog line (in the script file) opens a connection to the pre-saved session configuration (which I named blog)
The synchronize remote ... line (in the script file) uses the synchronize command to sync from the local folder (saved in %uploadpath%, the environment variable from step 2) to the server.
IMO this solution is suitable for non-technical persons as well.
If the technical person in your case doesn't know how to use source control, you could even script committing & pushing, too.
There are a number of options available which are mentioned in the documentation: http://jekyllrb.com/docs/deployment-methods/
If you are using Git, I would recommend the Git Post-Receive Hook approach. It simply builds the site after the new code is received:
GIT_REPO=$HOME/myrepo.git
TMP_GIT_CLONE=$HOME/tmp/myrepo
PUBLIC_WWW=/var/www/myrepo
git clone $GIT_REPO $TMP_GIT_CLONE
jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
Since you mentioned that it will be updated by a non-technical person, you might try something like rack-jekyll to automatically rebuild when new files are FTP'd.

Pack setup files to single executable setup

I have an old setup of the old program written on c++ which contains multiple installation files files.
_SETUP.1
_SETUP.DLL
_INST32I.EX_
_ISDEL.EXE
SETUP.EXE
DISK1.ID
SETUP.INI
SETUP.INS
_SETUP.LIB
SETUP.PKG
I want to combine all that in to single executable file and i want to execute SETUP.EXE when user would run that single executable. Is it possible to achieve somehow?
The easiest way is simple create archive and say to user to to unpack that and to run SETUP.EXE but i am just wondering may be i can create setup like i describe above.
IExpress.exe is ideal for your job. Google for samples. It is included in your Windows installation. Just open a Command Prompt and type iexpress.exe - this starts a wizard that helps you getting started.

error when i want to save java file in jdk/bin

when i save java file error is you dont have permission to save in this location contact the administrator to obtain permission on window7
Don't store application data in the "Program Files" directory.
It is very bad design and regular users don't have write access to that directory (for a very good reason).
So even if you changed your settings locally to open up the door for viruses your application won't run on other computers.
Besides: storing a Java file in the JDK directory serves no purpose at all.
Btw: your uppercase letters are broken, as well as the dot or the comma...
That's normal - jdk/bin is the installation directory of the JDK, regular users cannot (and should not) write files there. You'll have the same problem on Linux/Unix and on Mac OS X, where installation directories are off-limits to regular users.
Write your files to the users home directory (System property "user.home", works across platforms), or let the user choose where you save stuff.
Bin directory do not allow directly to save program in it.
it is so simple, just save your .java file on desktop and then copy paste it in Bin. done ;)
If the file can't save directly to c:\program files\java\jdk1.8.0\bin\
Solution:-
Click start Menu type Notepad command in run run as administrator
Right click the Notepad run as Administrator, then type the program file can save directly to c:\program files\java\jdk1.8.0\bin\
Just try it......

Resources