WIX - Executing python file inside installer without moving to INSTALLDIR - windows

as the title says, is it possible to execute a python script inside the installer without having it copied to the installdir and then executing it throught a CustomAction?
I have a config script which is used during install and unninstall but currently i'm copying it to the installdir and then executing it, but I wish I could just execute it without copying...
Thanks

There is no current support for running a python script like there is for vbscript that I know of as Setin Asmul noted in his comment.
There are some convoluted ways of running a custom action and directly extracting a binary out of the MSI database and executing it but a simpler way would be to just make a custom action dll and include the script in the self-extracting package created during the build process.
You can use the CustomActionContents property to include your python script as a file needed by the custom action dll. When you run your custom action the CA.dll package is extracted into a temporary location and the custom action is run. Since the python script was added as a CustomActionContents file it will be in the same temporary dir as the custom action dll so you can run it from there.

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.

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)

Windows Bat file run from Autosys - Failed to load the sqljdbc_auth.dll

I have a question and wondering if you guys could help.. Here are the details -
Program Flow ->
Autosys Job -> Windows .bat job on network path-> Internally calls java program along with few other components
When the .bat runs through Autosys job, it gives below warning and does partial processing and exits out without any failure
(i guess the internal code might not have good error handling..but sadly I do not have access to view/modify the same). However, when I logon to that
windows box and run the .bat file from cmd prompt, it works like a charm and throws no error.
Warning in Logs - "WARNING: Failed to load the sqljdbc_auth.dll"
Things I tried-
I tried creating a wrapper bat file in windows C drive (not the netwrok path where the actual .bat is in) and placed sqljdbc_auth.dll in that custom folder.
Job went to SU , after partial processing.
Appreciate your help.
Many Thanks,
Raj
I'd suspect there is a path error. Try echo %path% just before calling your batch, even simply run
echo %path%>alogfile
call yourbatch
and if the displayed path doesn't include a directory in which your .dll resides, add it into the path before calling yourbatch.
It may very well be that your logon includes the required directory as part of your user-defined path and the username under which the job runs does not include the directory.
Or, you could try moving the dll into somewhere like system32 which should be common to everyone.
(Windows should use the standard path-scanning algorithm to locate any required dll that isn't invoked from a full pathname)

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