Run a batch file during installation - visual-studio-2010

I want to run a batch file – say driver.bat – after the application installation is completed. This has to be done using the Visual Studio setup and deployment while creating package. This question has been asked before, but the solution is giving me a problem: once the installation is done, it’s throwing an error message like:
'cmd.exe' should be excluded because its source file is under Windows File Protection

This issue comes when the file is marked as a protected file on the Windows operating system. You need to exclude the file from this protection to execute successfully. The following link would help you do so -
http://msdn.microsoft.com/en-us/library/x97ae5d9(v=vs.80).aspx

Related

Unable to save output from Rscripts in system directory using Devops Pipeline

I am running Rscripts on a self hosted Devops agent. My Windows agent is able to access the system's directory where its hosted. Below is the directory structure for my code
Agent loc. : F:/agent
Source Code : F:/agent/deployment/projects/project1/sourcecode
DWH _dump : F:/agent/deployment/DWH_dump/2021/
Output loca. : F:/agent/deployment/projects/project1/output_data/2021
The agent is using CMD in the devops pipeline to trigger R from the system and use the libraries from the system directory.
Problem statement: I am unable to save the output from my Rscript in to the Output Loca. directory. It give an error as Probable reason: permission denied error by pointing to that directory.
Output File Format: file_name.rds but same issue happens even for a csv file.
Command leading to failure: saverds(paste0(Output loca.,"/",file_name.rds))
Workaround : However I found a workaround, tried to save the scripts at the Source Code directory and then save the same files at the Output Loca. directory. This works perfectly fine but costs me 2 extra hours of run time because I have to save all intermediatory files and delete them in the end. Keeping the intermediatory files in memory eats up my RAM.
I have not opened that directory anywhere in the machine. Only open application in my explorer is my browser where the pipeline is running. I spent hours to figure out the reason but no success. Even I checked the system Path to see whether I have mentioned that directory over there and its not present.
When I run the same script directly, on the machine using Rstudio, I do not have any issues with saving the file at any directory.
Spent 2 full days already. Any pointers to figure out the root cause can save me few hours of runtime.
Solution was to set the Azure Pipeline Agent services in Windows to run with Admin Credentials. The agent was not configured as an admin during creation and so after enabling it with my userid which has admin access on the VM, the pipelines were able to save files without any troubles.
Feels great, saved few hours of run time!
I was able to achieve this by following this post.

"msadox28.tlb File is under windows system file protection" error while attempting to build an installer

I am trying to build an installer for my project. The problem is that i am unable to successfully build the installer with the following error:
ERROR: 'msadox28.tlb' should be excluded because its source file
'C:\Program Files (x86)\Common Files\System\ado\msadox28.tlb' is under
Windows System File Protection.
From what i can gather, this file has to do with ADOX and ADODB that i use to create, read and write data from a local access database. Excluding this file causes the program to not work at all when it has been installed, because it attempts to create a fresh database from scratch at first launch.
The program works fine and there is no errors with it, but i want to build an installer so that i can send the program to a few users to test it and the database component is the most important part of my project.
Can somebody please assist me with solving this problem?

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.

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)

Uninstalling IBM WebSphere

I am uninstalling WebSphere from my drive E by using IBM installation Manager, during uninstallation it gives me the following error:
"E:\Program Files\IBM\WebSphere\AppServer\bin\clearClassCache.bat" not found"
I have searched and found that the location of clearClassCache.bat file is:
"E:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\bin"
Should i copy the file from AppSrv01\bin to AppServer\bin and retry uninstallation? Or is there any other solution to this problem?
Scripts under AppServer\profiles\AppSrv01\bin should also be under AppServer\bin, but the copy under profiles is often (always?) modified to be profile-specific. So I doubt that copying it will work for you.
That specific script is under my AppServer\bin, so it seems it's been removed in your case. Possibly from the earlier part of the uninstallation.
Kinda an old question but here it goes.
Uninstall script is in <application_server>\uninstall folder. Not sure what is called under Windows but on Linux it is <application_server>\uninstall\uninstall ( yes script has the same name as folder)

Resources