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

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.

Related

Install Shield doesn't create new folder

I am new to installshield. However, I'm trying to apply the simplest of commands, but ran into an issue.
I have an installation that needs to be installed in c:\program files(x86) (Tried other locations as well). We want to make it automated, so we applied the following command to record the installation.
(Location of the setup)\Setup.exe -r -f1(Full path)\SetupAnswer.iss
and run the setup smoothly.
which installed in c:\program files(x86)(Program name) and created an answerfile
Next when I try to run (Location of the setup)\Setup.exe -S -f(Full path)\SetupAnswer.iss On a new PC it doesn't work.
After some testing. I found that if I create the folder name in c:\program files(x86)(Folder name) before I run the command above, it works like a charm.
I can create a short script to create a folder before running the setup command. But it doesn't look "clean". Checking the .ISS file reveals that at the location it wants to create the folder it looks like this -
szDir=(installation path)\(Folder name)
Result = 1
Not sure if this szDir means create or just use the following path.
Let me know if I'm missing something.
Regards,
Nik
There was an issue with the installation sequence, found it after following yossiz74 advice. There was a missing line due to the folder already existing in c:
Reinstalled it on a clean PC with the record method - Problem solved.

Silent installation of git through use of .bat file on 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"

custom action fails to execute

During the installation that I made I run in custom action file called ConfigurationUtility.exe witch should create a SQL database with some parameters. It should run some scripts in directory \scripts where the utility is copied. But I have this error in event log: "Action ConfigurationUtility.exe, location: C:\Windows\Installer\MSI4724.tmp, command: -dbname NewDB -username sa -password .....
I think it's happens because the installer trying to run it from C:\Windows\Installer\MSI4724.tmp but not from the Installation folder.
Setup package is built with Advanced Installer.
How can I fix it?
Thanks.
You have not configured the custom action correctly.
If you want it to run some scripts from the installation folder where it is placed you should call the EXE using the custom action "Launch installed file". You should not launch it as an attached file custom action (only this type of custom actions get extracted as temp files and launched as in your example)
Also, since this is an EXE I recommend you give it full admin rights to run, otherwise the system might stop it from running. To do this configure the custom action to "When the system is being modified" and "Run under the LocalSystem account with full privileges", and make sure it is scheduled to run after "Add Resources" group (where Advanced Installer ads it by default)

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

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.

Resources