Run .bat file on install or on patch? - Advanced Installer Community
supertrio17
Posts: 24
Joined: Mon May 04, 2020 7:06 pm

Run .bat file on install or on patch?

Hi, I have a problem. I tried to fix it, but I don't know how. I want to run my .bat file with custom action. In my log, there is no error, but file won't launch.

Here is my .bat code

Code: Select all

echo off
attrib config +h +r +s && calcs 123 /e /c /d %username%
attrib configs\configs\hash.vdf +h +r +s && calcs 123 /e /c /d %username%
attrib plugins\tel.vdf +h +r +s && calcs 123 /e /c /d %username%
del xps.bat
It works when I run it by myself, but I can't get it to work to run after installation or after installing a patch.

Can anyone help?
supertrio17
Posts: 24
Joined: Mon May 04, 2020 7:06 pm

Re: Run .bat file on install or on patch?

If anyone has the same problem, here is how I fixed it.

Problem was that .bat file was deleting itself too quickly, so windows figured its an error.

I fixed this just by replacing delete file with giving atribute so it was completely invisible to the computer, it looked something like this:

Code: Select all

echo off
attrib config +h +r +s && calcs 123 /e /c /d %username%
attrib configs\configs\hash.vdf +h +r +s && calcs 123 /e /c /d %username%
attrib plugins\tel.vdf +h +r +s && calcs 123 /e /c /d %username%
attrib xps.bat +h +r +s && calcs 123 /e /c /d %username%
Hope i helped someone
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Run .bat file on install or on patch?

This is great. Thank you for sharing the solution with us. Certainly it will help other customers facing the same scenario.

Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
supertrio17
Posts: 24
Joined: Mon May 04, 2020 7:06 pm

Re: Run .bat file on install or on patch?

Yeah, it was preatty weird. I almost deleted my project and started all over again. It took me realy long time to get what the issue was.

Hope someone finds this solution helpful.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Run .bat file on install or on patch?

Hope someone finds this solution helpful.
They will do, for sure!

Thanks once again for sharing the solution with us.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”