Tomorrow Posted November 27, 2010 Report Share Posted November 27, 2010 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 More sharing options...
Omniferum Posted November 27, 2010 Report Share Posted November 27, 2010 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 More sharing options...
Tomorrow Posted November 27, 2010 Author Report Share Posted November 27, 2010 Thanks.For now i have opted for simpler workaround: if exist *.exe ren *.exe Setup.exe Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now