Jump to content
Ketarin forum

Allow * as [any] executable name in Setup Instructions!


Tomorrow
 Share

Recommended Posts

Ok i´ll make this simpler to understand:

Currently i have to define specific exe name for installable executables extracted from zip files, so that Ketarin would recognize and execute them.

 

I would like to define executable names as a wildcard so even if the name changes the script would still work.Currently it works as long as the executable name inside the zip file stays same.

 

Current:

7z e -aoa -y "{file}" -o%temp%\OpenAL\
cd /D "%temp%\OpenAL"
%temp%\OpenAL\oalinst.exe /F /NU /S

 

What i want:

7z e -aoa -y "{file}" -o%temp%\OpenAL\
cd /D "%temp%\OpenAL"
%temp%\OpenAL\*.exe /F /NU /S

Link to comment
Share on other sites

for /F "tokens=*" %d in ('dir /b "%temp%\OpenAL\*.exe" ') do set exe=%d

 

That line of batch code will create such a variable for you that you call by doing

 

"%exe%"

 

So long as you know your program will be the only .exe in the folder that you extract it to but so long as you always extract it to a folder you know nothing else uses there isn't a clash. I use a global variable in my ketarin so all my setup instructions are carried out in a Ketatemp folder to {appname} variables (which are obviously unique) which gets deleted when i've finished all my setup.

 

In the end your code will look exactly like this

 

7z e -aoa -y "{file}" -o%temp%\OpenAL\

for /F "tokens=*" %d in ('dir /b "%temp%\OpenAL\*.exe" ') do set exe=%d

"%exe%" /F /NU /S

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.