Jump to content

Easy RunOnceEx.cmd


eagle00789

Do you want it to be easy to create RunOnceEx.cmd  

2,055 members have voted

  1. 1. Do you want it to be easy to create RunOnceEx.cmd

    • Yes
      1676
    • No
      33
    • What whould be the function?
      60
    • Maybe
      61


Recommended Posts

you can't at the moment, i'm stil developing it, but i'm wrapping it up right now. i'm working on the loading of existing RunOnceEx.cmd files. it's almost finished

Good news. Is it a matter of few days?

Link to comment
Share on other sites


Good news. Is it a matter of few days?

yes, it is. i'm having some small troubles with the recognition of a few special lines.

Also, i'm already planning a new version. The new version wil contain a database of known programs, and is self-extendable (you can add your own programs), it also is updateable via the net.

Link to comment
Share on other sites

In response to gresh

@ECHO OFF
   (
       ECHO @ECHO OFF
       ECHO CMDOW @ /HID
       ECHO.
       ECHO SET INSTALLDIR=%%SYSTEMDRIVE%%\install
       ECHO SET RUNONCE=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
       ECHO SET /A COUNTER=1
       ECHO.
       ECHO REG ADD %%RUNONCE%% /V TITLE /D "Installing Applications" /f
       ECHO REG ADD %%RUNONCE%% /V FLAGS /T REG_DWORD /D 0x00000030 /f
   ) > $OEM$\RunOnceEx.cmd

   CALL :RUNONCE_PARSE >> $OEM$\RunOnceEx.cmd

   (
       ECHO GOTO :EOF
       ECHO.
       ECHO :SET_INSTALL
       ECHO     SET COUNTER2=%%COUNTER%%
       ECHO     IF %%COUNTER%% LSS 10 SET COUNTER2=0%%COUNTER%%
       ECHO     IF NOT "%%~1"=="" REG ADD %%RUNONCE%%\%%COUNTER2%% /VE /D %%1 /f
       ECHO.
       ECHO     SET /A J=1
       ECHO     :LOOP
       ECHO         SHIFT /1
       ECHO         IF "%%~1"=="" GOTO :END_INSTALL
       ECHO         SET A=%%1
       ECHO         SET A=%%A:'="%%
       ECHO.
       ECHO         REG ADD %%RUNONCE%%\%%COUNTER2%% /V %%J%% /D %%A%% /f
       ECHO         SET /A J+=1
       ECHO     GOTO :LOOP
       ECHO     :END_INSTALL
       ECHO     SET /A COUNTER+=1
       ECHO GOTO :EOF
   ) >> $OEM$\RunOnceEx.cmd
GOTO :EOF

:RUNONCE_PARSE
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION & PUSHD $OEM$\$1\INSTALL
   FOR /D %%D IN (*) DO (
       SET LINE=CALL :SET_INSTALL

       PUSHD %%D
       IF EXIST CMD.INSTALL (
           FOR /F "EOL=; DELIMS=" %%I IN (CMD.INSTALL) DO (
               SET TEMP_I=%%I
               SET TEMP_I=!TEMP_I:\=\\!
               IF "!TEMP_I!"==" " (
                   SET LINE=!LINE! ""
               ) ELSE (
                   SET LINE=!LINE! "!TEMP_I:"=\'!"
               )
           )
           ECHO !LINE!
       )
       POPD
   )
POPD & ENDLOCAL
GOTO :EOF

I pulled this from my script that makes my cd image. I didn't test it. It should be run on the same level as $OEM$. It will parse through $OEM$\$1\INSTALL, going 1 directory deep, looking for cmd.install.

A sample cmd.install in $OEM$\$1\INSTALL\winamp\cmd.install

Winamp 5.04
%INSTALLDIR%\Winamp\winamp504_full.exe /S /install=SFQR
TASKKILL /F /IM WINAMP.EXE
CMD.EXE /Q /C XCOPY %INSTALLDIR%\Winamp\Skins\*.* "%PROGRAMFILES%\winamp\skins"
;copy over config stuff
CMD.EXE /Q /C COPY %INSTALLDIR%\Winamp\winamp.ini "%PROGRAMFILES%\winamp"
CMD.EXE /Q /C COPY %SYSTEMDRIVE%\install\Winamp\winamp2.ini %SYSTEMROOT%\winamp.ini

First line is title, a space represents an empty line, which won't show anything in the menu on runonceex, all following lines are commands, except those starting with ;

And before anyone asks why do I have a SET_INSTALL procedure in my runonceex.cmd; Its because thats how I originally had it, till I decided to parse the directories. If I had to rewrite this, I would probably integrate it all together.

::added ECHO OFF for people who can't get it to work properly

Link to comment
Share on other sites

I'm releasing a first beta version of this program.

To download. follow this link: Click this link

To add multiple commands under 1 program name, just leave the field Program Name blank.

Deleteing or editing of commands is not jet supported

Loading is only supported by 2 lines (no commands yet)

Saving is fully supported

A website is being created for this

Link to comment
Share on other sites

I just resumed the work on it, and am taking the following points:

Todo:

  • the main window isn't resizable (done)
  • "Add Command" dialog box doesn't have a "Cancel" button (done)
  • the main window isn't centered on screen by default (done)
  • Finish the saving (done)
  • Add the ability to edit a command (done)
  • Ask to overwrite an existing RunOnceEx.cmd file (done)
  • Create an installer (done)

Thanks for some of those tips mazin

I will be editing this post to see the progress.

Link to comment
Share on other sites

I just resumed the work on it, and am taking the following points:

Todo:

  • the main window isn't resizable (done)
  • "Add Command" dialog box doesn't have a "Cancel" button (done)
  • the main window isn't centered on screen by default (done)
  • Finish the saving (done)
  • Add the ability to edit a command
  • Ask to overwrite an existing RunOnceEx.cmd file (done)

Thanks for some of those tips mazin

I will be editing this post to see the progress.

Good work!

This would save some time (again!)!!!

I would really really really like it! ;):D

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...