Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Problem with basic SfX script

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Alystinn

Alystinn
  • Member
  • 2 posts
  • Joined 18-December 11
  • OS:Windows 7 x64
  • Country: Country Flag

Hi eveybody,

First sorry for my English, I'm French

I just try to create a basic SFX archive with software like 7zip SFX Maker or WinRAR. This script just run the following Windows batch (install.cmd) :

@echo off
:: Install.cmd
echo.
echo ========================
echo  Get oracle Homes:
echo ========================
echo.
set KEY_NAME1=HKLM\SOFTWARE\ORACLE\KEY_OraDb11g_home1
set VALUE_NAME1=ORACLE_HOME
::
FOR /F "tokens=3" %%a IN ('REG QUERY %KEY_NAME1% /v %VALUE_NAME1%') DO (set O-HOME=%%a)
echo %O-HOME%
::
pause
::
::
exit

The SFX parameters are :

;Le commentaire ci-dessous contient des commandes pour script SFX

Setup=Install.cmd
TempMode
Silent=1
Overwrite=1
Title=DG Setup

And when I run the SfX file, the batch did not run properly and I have an error message, but if I run the batch manually it works like a charm!

Think something is wrong in my SFX setup but I have no idea, could you please help !! :)

 

 




How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,013 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

 

And when I run the SfX file, the batch did not run properly and I have an error message, but if I run the batch manually it works like a charm!

Think something is wrong in my SFX setup but I have no idea, could you please help !! :)

Which "error message"?

Does it come from the SFX engine or from the batch/command processor?

 

jaclaz



#3
Alystinn

Alystinn
  • Member
  • 2 posts
  • Joined 18-December 11
  • OS:Windows 7 x64
  • Country: Country Flag

From the reg query in the batch ("ERROR: The system was unable to find te specified registry key or value")

But the reg key actually exists !



#4
jaclaz

jaclaz

    The Finder

  • Developer
  • 15,013 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

It's not that you have to explicit SETLOCAL ENABLEEXTENSIONS ? :unsure:

http://www.robvander...e.com/local.php

http://www.robvander...e.com/ntfor.php

 

jaclaz



#5
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,588 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

How about also providing us with the full batch file!

 

…echoing the data value of a registry key isn't an installation routine, is it?

 

Additionally, I would make sure that you have no additional spaces in your variables and to be safe I'd make sure that the unknown data value is not broken by unexpected spaces to.

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION
SET "KEY_NAME1=HKLM\SOFTWARE\ORACLE\KEY_OraDb11g_home1"
SET "VALUE_NAME1=ORACLE_HOME"
SET "O-HOME="
FOR /F "TOKENS=2*" %%a IN ('REG QUERY %KEY_NAME1% /V %VALUE_NAME1% 2^>NUL') DO SET "O-HOME=%%b"
IF DEFINED O-HOME (ECHO=%O-HOME%) ELSE (ECHO=ERROR RETURNING REGISTRY KEY VALUE)
PAUSE





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users