Solved

how to set environmental variable through Install Script ?

Posted on 2000-05-12
9
286 Views
Last Modified: 2013-11-20
hi all,
     I am using installShield professional2000 for preparing installshield of our project.
      there we need to set the environmental variables(like LOG_LEVEL=2);
On the dos prompt we can set using "set  LOG_LEVEL=2".

How can we do it through installShield script.

As far I know we can run any .exe file  through InstallShield by using windows API LanchApp (".exe","");

Please let me know if at all any way to set the LOG_LEVEL using IS.


regards,
Adinarayana,K
0
Comment
Question by:adinarayanak
  • 5
  • 4
9 Comments
 

Author Comment

by:adinarayanak
ID: 2804380
one more addition to that is

      While creating the installscript  through project wizard,I missed out the uninstall option somewhere.Now I added so many thing to the setup.rul file. At the end I tested my script.

     I could not able to  our project name in the add/remove programs after installation.There is one black line appearing.If I activate and click on the add/remove button on that panel then everything getting installed again.I could not able to uninstall that.
What may be the possible cause for that and How add unistall option for the existing installscript.It is urgent,please do it.

I will de thankfull to you.

regards,
AdinarayanaK
0
 
LVL 3

Expert Comment

by:V_Bapat
ID: 2804695
Hi Adi
For the first problem, use BatchAdd() or EzBatchAddString(). This will add the environment variable to "autoexec.bat" by default. You can specify the batch file.

If you are using BatchAdd() you have to open and close the batch file using BatchFileLoad() and BatchFileSave().

If you are using EzBatchAddString(), the batch file is automatically opened and closed for you.

Look in the IS help for details and/or examples.

Vicky
0
 
LVL 3

Accepted Solution

by:
V_Bapat earned 50 total points
ID: 2804730
Adi
For adding uninstall shortcut etc, I used the following method. It was a long time back and I don't remember the details. It may require some modification according to your project but I hope this will solve your problem.


function SetupFolders()
 NUMBER nResult;
 STRING szCommandLine, szProgramFolder, szUninstIcon, szUninstPath;
 begin

    szCommandLine = svDir ^ @PRODUCT_KEY;
    LongPathToQuote ( szCommandLine , TRUE );

    nResult = CreateProgramFolder ( @FOLDER_NAME );
    szProgramFolder = FOLDER_PROGRAMS ^ @FOLDER_NAME;
    nResult = AddFolderIcon (szProgramFolder, @PRODUCT_NAME, szCommandLine,
            TARGETDIR, "", 0, "", REPLACE|RUN_MAXIMIZED);

    nResult = AddFolderIcon ( FOLDER_DESKTOP, @FOLDER_NAME, szCommandLine,
            TARGETDIR, "", 0, "", REPLACE);

    szUninstPath = TARGETDIR ^ UNINST_LOGFILE_NAME;
    LongPathToQuote ( szUninstPath , TRUE );
    szCommandLine = WINDIR ^ "IsUninst.exe -f" + szUninstPath;

    nResult = AddFolderIcon ( szProgramFolder, "Uninstall NetPower", szCommandLine,
             WINDIR, "", 0, "", NULL );

  return 0;//nResult;
 end;


Add this line in the setup script in the "string defines" section generated by the IS Wizard.
#define UNINST_LOGFILE_NAME      "Uninst.isu"

Also, you have to define the constants.

Hope this helps.

Vicky
0
 

Author Comment

by:adinarayanak
ID: 2806797
Dear V_Bapat,

reply to the first question is excellent.

regarding the second question,

     After installing a product through the installscript I should be able to see the file            " Uninst.isu" in TARGETDIR.But it is not getting appeared in the target directory.

What could be the reason ?  and why that FOLDER_NAME is not getting appeared in the add/remove programs ? I Hope I stated the question clearly.If not I will send the code with the next comment.

Hope U will solve my poblem.

regards
Adi.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:V_Bapat
ID: 2809475
Hi Adi
Uninst.isu is present in windows directory. Since that dir is in the path, the file is picked up from there.

Vicky
0
 

Author Comment

by:adinarayanak
ID: 2810044
hi V_Bapat,
    I did the same as  you directed.The Shortcut is not getting created in the startup programs.

what could be the reason.

please let me know the solution as quick as possible.

regards,
Adi
0
 

Author Comment

by:adinarayanak
ID: 2810108
the short cut is getting appeared in Start menu.When u click on uninstall it is giving the message that unable to locate uninst.isu. Could not uninistall.

what could be the reason. ?

Adi
0
 

Author Comment

by:adinarayanak
ID: 2810222
the short cut is getting appeared in Start menu.When u click on uninstall it is giving the message that unable to locate uninst.isu. Could not uninistall.

what could be the reason. ?

Adi
0
 
LVL 3

Expert Comment

by:V_Bapat
ID: 2810763
If you post some code, I can understand what is happening better.

I would prefer to take the discussion to email. My email id is vicky@miel.mot.com.

Vicky
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 58
Importing Special Characters in Dynamics GP Through Integration Manager 3 69
either24  challenge 19 90
post4 challenge 28 93
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now