AlBundy33
Content Type
Profiles
Forums
Events
Posts posted by AlBundy33
-
-
If your batch-file is also on the stick you can get the drive with %~d0
drive: %~d0
path to script %~f0 (= %~dpnx0)
path to script-dir %~dp0have a look at the help for "for".
Zusätzlich wurde die Ersetzung von Verweisen auf FOR-Variablen erweitert.
Sie können jetzt folgende Syntax verwenden:
%~I - Expandiert %I und entfernt alle umschließenden
Anführungszeichen (").
%~fI - Expandiert %I zu einem vollständigen Dateinamen.
%~dI - Erzeugt nur den Laufwerkbuchstaben von %I.
%~pI - Erzeugt nur den Pfad von %I.
%~nI - Erzeugt nur den Dateinamen von %I.
%~xI - Erzeugt nur die Dateierweiterung von %I.
%~sI - Erzeugter Pfad enthält nur kurze Dateinamen.
%~aI - Erzeugt die Dateiattribute von %I.
%~tI - Erzeugt Datum und Zeit von %I.
%~zI - Erzeugt die Dateigröße von %I.
%~$PATH:I - Durchsucht die in der PATH-Umgebungsvariablen
angegebenen Verzeichnisse und expandiert die erste
gefundene Datei %I zu dem vollständigen Dateinamen.
Wenn der Name der Umgebungsvariablen nicht definiert
ist oder diese Datei bei der Suche nicht gefunden wurde,
wird dieser Parameter zu einer leeren Zeichenkette
expandiert.Al
0 -
Try this...
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
SET TARGETFILE=%~dp0targets.txt
SET LOG=%~dpn0.log
IF EXIST "!LOG!" DEL /Q "!LOG!"
CALL :TEE %DATE: =0%, %TIME: =0%
CALL :TEE ~~~~~~~~~~~~~~~~~~~~~~~
IF EXIST "%TARGETFILE%" FOR /F "tokens=*" %%C IN ('type "%TARGETFILE%"') DO (
IF "%%~C"=="" GOTO :EOF
SET COMMAND=PSEXEC %%~C -c "C:\deployment tool\dummy.bat" dummy.bat
CALL :TEE running !COMMAND!
CALL !COMMAND!
IF NOT !ERRORLEVEL! EQU 0 (
CALL :TEE %%C reported errorlevel: !ERRORLEVEL!
)
CALL :TEE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)
PAUSE
GOTO :EOF
:TEE
ECHO %*
ECHO %* 2>&1 1>>"%LOG%"
GOTO :EOFAl
0 -
I'm happy with the way I have it now. All the reg keys get flushed out after quit or after install complete.
Using a temp file would cause the same problems if WPI crashed, hit the X close button on the window (WPI can't catch this and doesn't quit properly. mshta quits but doesn't tell the program to shut down). Either way the same problems can happen, just in a different way.
Thats fine. But in my opinian a portable app should not write to registry because in many cases it will not be used anymore.
For example: I have WPI and some apps on my USB-stick to install them on every machine I want - and in nearly all cases I don't run WPI on such a machine again.
So it would be nicer to have such data in a temp file instead in the registry.
Al
When will all the new patches included in the download-archive? Is there a possibility to download the latest dev-version?
0 -
I really don't like the registy-way.
Why not use a temporary-config-file in Temp-Folder which can be deleted after WPI-install was done (like that file which is created in SystemDrive during install)?
Al
0 -
Happy new Year!!!
I think this is a good idea. :-)
Some options are really necessary - some maybe not.
So we could vote for options we want to have also available on commandline.
But: Maybe there is a user which needs an option for a very specific case which is not in the list. So why not implement something like a Map (or Dictionary in JS?) which holds all config-settings (key = config-key, value = config-value) and is initialized with default-values and can be overwritten with command-line-arguments.
e.g. settings['options'] = './WPIScripts/config.js';
if [command_line_has_options_argument] settings['options'] = get_argument_from_command_line
So you have
- all settings at one place
- can easily extend it
- can easily overwrite all settings with command-line-arguments
Al
0 -
Started a new thread on reg keys paths.
Ok
Args:options="options.js"
config="config.js"
check="default"
timer=30
theme="Windows"
resolution=1200
Thanks
Quotes are only needed if there is a space. There was a quotes bug, it is fixed but not uploaded yet.Sure - but in my batch file I call wpi.hta with
"%WINDIR%\system32\mshta.exe" "!CD!\wpi.hta" config="!CD!\WPIScripts\config.js" options="!CD!\WPIScripts\useroptions.js" %*
and therefore I need the quotes because I don't know where WPI is started from.
0 -
@AlBundy33: Saving the paths in a reg key is required because when leave Options/Config editor, it does document.reload(). If you specified a command line arg, it wouldn't remember it, and load the default files. It has become a pain.
Someone else made a DVD and ran it from there. Then needed to make some changes so copied to their harddrive. Made the changes, hit save, error. WPI tried to save it do the DVD since that was what was saved in the reg key.
I suppose I could erase the reg keys when really quit and after an install. I posted a message on the forum about this a while back. Not many responses, so I left it as is.
There was a problem with quotes in the command line args. I fixed it.
But I have different WPI-instances on my pc and after I started an instance the path to config and useroptions will be used for all instances.
I also tried to run WPI with
"C:\WINDOWS\system32\mshta.exe" "D:\System\WPI\wpi.hta" config="D:\System\WPI\WPIScripts\config.js" options="D:\System\WPI\WPIScripts\useroptions.js"
but the config and options from my first instance are used.
As I asked before: Where can I find an overview of all command line arguments?
Just another question: How do you debug WPI?
Al
0 -
command-line-arguments "options" and "config" does not override registry settings.
Is it really neccessary to store them in registry?
Default should be options=./WPIScripts/useroptions.js and config=./WPIScripts/config.js - so there is no need for a registry key.
Also quoted paths should be possible e.g. config="C:\my folder with a space\wpi\my config.js"
Do you have an overview of all possible command-line arguments?
Thanks
Al
0 -
Kel is on the right way. :-)
--> the Sucess and failure after the command should not be displayed if icons are used.
With "return-codes" I meant only to display the return-status of the commands (success or not) - thats all.
Why not show the real commands instead of "command 1".
In an unattended environment it doesn't matter what is displayed - but if you have a look at the installer window it would be nice to see a more usefull information about the current command.
--> Maybe the commandline or the start-time or the execution time (new - start-time) or something else.
For example
You will get much more information if you display something like this
Microsoft Viewer 2007
success_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\wordview_de-de.exe" /quiet
success_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\WordViewer2003SP3-KB934736-FullFile-DEU.exe" /Q
success_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\office2003-KB934041-FullFile-DEU.exe" /Q
failure_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\PowerPointViewer.exe" /quiet
running_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\powerpointviewer2007sp1-kb937158-fullfile-de-de.exe" /quiet
waiting_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\visioviewer.exe" /quiet
waiting_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\visioviewer2007sp1-kb937160-fullfile-de-de.exe" /quiet
waiting_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\Microsoft Excel Viewer 2003 1.0.exe" /Q /C:"msiexec -i xlview.msi /passive /norestart /qb ADDLOCAL=ALL REBOOT=ReallySuppress"
waiting_icon "%ROOT%\Anwendungen\Microsoft\Microsoft Viewer 2007\ExcelViewer2003SP3-KB934737-FullFile-DEU.exe" /Qinstead of this
Microsoft Viewer 2007
Command1 success
Command2 success
Command3 success
Command4 failure
Command5My idea was to display all commands of the current application (there is no need to see also the next app and der commands) to know where I am and how many commands are left for the current install.
If you can modifiy the list you can also remove the displayed commands of application that are done and set the success/failure-icon before the application-name.
--> so you have above the current applicaion only a list of installed application und below the current application the commands,
These are just ideas and nice-to-haves - WPI also runs without that really good. :-)
0 -
@ZileXa: I don't want to replace the file in XP-source. I will install the patch on demand.
@x-Shadow-x: Is the line really necessary: "xCACLS "C:\windows\system32\uxtheme.dll" /E /G shadow:F /Y"? As far as I know I should have all rights on this files (but i'm currently not sure).
0 -
But I think that the lines with the name "command X" are not really usefull because currently they are used to display the exit-status of the command.
Instead of display
Applicationname
command1
command2
...It would bebetter to display something like this
Applicationname
status_image the_command_to_execute
status_image the_command_to_execute
status_image the_command_to_execute
Another_Applicationname
...Where always all commands of the current application should be displayed - with the status_image you can display if the are "running", "successfully exited", "exit with failure" or even wait to be executed.
Al
0 -
But how you will do this?
Only copy does not work - at least the themes-service must be terminated (no problem) but if the service is terminated some application can have a reference to the dll - so it is not possible to copy the new one.
Next problem: this method does only work with one version (e.g. XP SP3) - I wouldn't work on other XP-Versions (maybe SP1).
--> I integrate WPI into my XP-Install CD but have the possibility to run WPI on every machine.
0 -
As the topic says - i'm looking for a tool that patches the uxtheme.dll to use unsigned themes in windows xp.
I know that I can integrate the patched uxtheme.dll in windows-cd or use n-lite or something else.
But I really need a tool what I can integrate with WPI in my CD which is fully unattended and don't shows any dialogs like windows file protection or something else.
Can anybody help me?
Thanks
Al
0 -
Installer should display all commands (at least all commands for the current application) - so we know when the current install-process is done.
Al
0 -
The pause-button in installer-window should pauses the process before next command starts instead to halt an the next application to install.
0 -
Little change for install-window
Instead of
command1 success
command2 failure
...
you can display
a status-image (running, install sucess, install failure) followed by the executed command line
If there was an error you can set a tooltip on the error-image to display the error-message.
I think this looks better and with a horizontal-scrollbar it is possible to see the complete command line.
Al
0 -
An option to hide command-line-windows would be very nice.
--> Their should be an option in option-wizard to set a default-value and there should be a button in install-window to set this value again and to show the hidden windows (maybe they need some user-input).
0 -
Post it again in the bug-list.
0 -
By default I don't check any applications and disable the timer - but when I start WPI after XP-Install I set the command-line arguments check=default timer=300.
If I use this commands an my hdd-WPI it works - if I use them on CD they will be ignored. :-(
Al
0 -
By default I don't check any applications and disable the timer - but when I start WPI after XP-Install I set the command-line arguments check=default timer=300.
If I use this commands an my hdd-WPI it works - if I use them on CD they will be ignored. :-(
Al
0 -
I need special "cleanup" commands.
For me cleanup-commands are command to delete shortcuts and move shortcuts or folders inside the startmenu.
I want to enable/disable this feature in wpi before starting the installation.
For example install of WinRAR:
===================================================================
=== Programmnummer: 23
=== Kategorie : Toolz
=== Programm : WinRAR 3.62
=== Größe : 12 MB
=== Standard : ja
=== Freeware : nein
=== Reihenfolge : 5
===================================================================
INSTALL: "%ROOT%\Anwendungen\Toolz\WinRAR 3.62\wrar362d.exe" -s
INSTALL: "%ROOT%\Tools\7z.exe" x -y -o"%PROGRAMFILES%\WinRAR" "%ROOT%\Anwendungen\Toolz\WinRAR 3.62\rarkey.rar"
CLEANUP: "%ROOT%\Tools\eMove.cmd" "WinRAR" "Toolz"I can have more cleanup-commands but only need one for WinRAR.
I manage all my commands per application in a file named unattended_*.inf, parse it and create config.js.
The result for winrar looks like this:
prog[pn]=['WinRAR 3.62'];
uid[pn]=['PRG23'];
desc[pn]=['<div style="padding:5px;"><b style="white-space:nowrap;">kommerziell/Registrierung erforderlich</b><br/><table style="color:black;font-family:\'Courier New\', monospace;font-size:1em;border:none;"><tr><th align="left" nowrap><u>Registrierungungsdaten</u></th></tr><tr><td style="white-space:nowrap;">WinRAR 3.62 Serial: *</td></tr><tr><td style="white-space:nowrap;">* Um WinRAR zu registrieren, muss nur eine der Dateien rarkey.rar</td></tr><tr><td style="white-space:nowrap;">in das WinRAR-Verzeichnis entpackt werden</td></tr></table></div>'];
ordr[pn]=[23];
dflt[pn]=['yes'];
bit64[pn]=['no'];
forc[pn]=['no'];
cat[pn]=['Toolz'];
picf[pn]=['%ROOT%\\Anwendungen\\Toolz\\WinRAR 3.62\\wpi_image.png'];
picw[pn]=['128'];
pich[pn]=['128'];
textl[pn]=['Left'];
cmds[pn]=['"%ROOT%\\Anwendungen\\Toolz\\WinRAR 3.62\\wrar362d.exe" -s','"%ROOT%\\Tools\\7z.exe" x -y -o"%PROGRAMFILES%\\WinRAR" "%ROOT%\\Anwendungen\\Toolz\\WinRAR 3.62\\rarkey.rar"','"%ROOT%\\Tools\\parsecommands.cmd" "%ROOT%\\Anwendungen\\Toolz\\WinRAR 3.62\\unattended_150.inf"'];
pn++;As you can see the cleanup-commands are executed by the script parsecommands (which parses the unattended*.inf again) as last command during install.
To enable/disable this feature I create a script setWPIenv.cmd at WPI-start where I store the state.
parsecommands.cmd start setWPIenv.cmd and checks if the cleanup-commands should be executed.
Maybe there is a way to integrate such cleanup-commands in WPI and enabled/disable them global in main-WPI-window.
Al
0 -
Thanks - this works for me.
Btw: How do you debug your code?
To find out what was wrong I used a lot of alerts. :-/
Al
0 -
With this from code.js no batch-files with arguments (e.g. "drive:\a\folder\test.cmd" MyArgument) will be found:
if (cmd.toUpperCase().indexOf(".CMD") != -1 || cmd.toUpperCase().indexOf(".BAT") != -1)
{
if (!FileExists(cmdLine))
{
NumFailed++;
result=getText(InstallFail);
SuccessFail=false;
WriteLogLine(cmdName+' '+getText(FailFileDoesNotExist)+': '+cmdLine);
return false;
}
}Al
0 -
In core.js defaultWPI() you get the ROOT with
// %root%
root=fso.GetParentFolderName(wpipath);
if (root.indexOf(":")==1)
root=root.substr(0,2);But ROOT should be used to get the WPI-parentfolder.
My folder-structure looks like this
Drive:\any\directory
- WPI (only with contents from the download-package)
- Tools (my additional Tools)
- Applications
- Common
- Multimedia
- Microsoft
- ...And my commands look like this:
%ROOT%\Applications\Multimedia\...
But with the Bug above my commands does not work. :-(
Only with
root=fso.GetParentFolderName(wpipath);
all works fine.
Al
0
What self extractor won't stop batch file execution?
in Application Installs
Posted
Why you need a self-extractor which won't stop batch-file execution?
This is really necessary because you need to delete the files after they where extracted.
It sound very strange what you are doing (e.g. same archives for different drive-letters) - can you explain more?
--> I'm sure that there are better ways.
Here are some hints:
Simply use
Why do you copy shortcuts? There are a lot of scripts an tool which can create them.
Why not use 7-zip (7za.exe as standalone-version), create a simple zip-file instead of an sfx-archive and call something like this in your batch-file
Try this
Al