WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > IE doesn't load after install on Vista
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
amoneriot
Junior Member

Registered: Nov 2009
From:

IE doesn't load after install on Vista

Hello All,
I'm a relative newbie to NSIS but I love it already and have dabbled in it enough to fix all the UAC and signing issues I was having. But now, this one issue is eating up my time and I can't get any direction on what to look out for. The following code snippet works fine on XP and Win7 but doesn't work on Vista. It's supposed to load IE with a website but it doesn't work on Vista only. I went through the forum and it doesn't look like it's been discussed before. I tried using exec instead of execshell as well. What could I be doing wrong here ? Is there anything I can try ? Really appreciate some pointers at this point.

Function .onInstSuccess
Push $0
ReadRegStr $0 HKCR "InternetExplorer.Application\CLSID" ""
ReadRegStr $0 HKCR "CLSID\$0\LocalServer32" ""
ExecShell "open" "$0" "http://www.google.com/" SW_SHOWNORMAL
UAC::Unload
Pop $0
FunctionEnd

Thanks.

Quick Link | Report this post to a moderator | IP: Logged

amoneriot is offline Old Post 11-24-2009 07:14 PM
Click Here to See the Profile for amoneriot Click here to Send amoneriot a Private Message Find more posts by amoneriot Add amoneriot to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

Why is there a call to the UAC plugin there? If you are using that, ExecShell is not the correct ting to use. Also, you probably don't want to use the open verb, try a empty string

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 11-24-2009 07:26 PM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
amoneriot
Junior Member

Registered: Nov 2009
From:

The example tutorial on UAC talked about releasing the UAC plugin on successful installation, which is why there's a cleanup call there.
This same code works fine for XP and win7. why wouldn't it work for Vista ? Anyways, I took your suggestion and tried calling ExecShell with an empty string and that didn't make a difference. Previously, I had tried using exec as well but that didn't work as well. If execshell isn't the correct thing to work and exec doesn't work, what else should I be trying ?

Quick Link | Report this post to a moderator | IP: Logged

amoneriot is offline Old Post 11-24-2009 07:54 PM
Click Here to See the Profile for amoneriot Click here to Send amoneriot a Private Message Find more posts by amoneriot Add amoneriot to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

well, for one thing, if you are using the uac plugin, you should call the uac version of execshell. But why would you want to force IE on your users, just specify the url as the command, no need to hunt for the .exe

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 11-24-2009 08:53 PM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
amoneriot
Junior Member

Registered: Nov 2009
From:

I'm installing a toolbar for IE, which is why I need to have IE load up. I tried using UAC::exec as well as nsexec::exec but it didn't make any difference. Details in the new sample code below. I hope I got the arguments right. The worst part of all this is that the errorlevel isn't set, which tells me that the function should have worked. Could this be a real bug for which we need a bugfix ? I can't think of trying anything else. Does exec, execshell, etc. work with IE 7.0 on Vista ?

Function .onInstSuccess
Push $0
ReadRegStr $0 HKCR "InternetExplorer.Application\CLSID" ""
ReadRegStr $0 HKCR "CLSID\$0\LocalServer32" ""
;ExecShell "open" "$0" "http://www.msn.com/" SW_SHOWNORMAL
;UAC::Exec '' '"$0 URL submitted by user."' '' ''
nsExec::Exec '"$0" URL submitted by user.'
UAC::Unload
Pop $0
FunctionEnd

Quick Link | Report this post to a moderator | IP: Logged

amoneriot is offline Old Post 11-24-2009 10:04 PM
Click Here to See the Profile for amoneriot Click here to Send amoneriot a Private Message Find more posts by amoneriot Add amoneriot to your buddy list Edit/Delete Message Reply w/Quote
demiller9
Senior Member

Registered: Mar 2006
From: Dallas

On my system (Vista Home Premium x64) the reg value for LocalServer32 has "%ProgramFiles%\Internet Explorer\iexplore.exe". You probably need to ExpandEnvStrings before the nsExec::Exec call.

Quick Link | Report this post to a moderator | IP: Logged

demiller9 is offline Old Post 11-25-2009 01:02 AM
Click Here to See the Profile for demiller9 Click here to Send demiller9 a Private Message Find more posts by demiller9 Add demiller9 to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

well, if you want to force IE, you could use the supported COM interface for automating IE

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 11-25-2009 07:18 AM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
amoneriot
Junior Member

Registered: Nov 2009
From:

Thanks a lot for your suggestions. I made some progress finally. nsexec::exec seems to work, but with the side effect that when my installer doesn't quit until IE quits. Is there a way to fix that ? Also note the syntax with which nsexec worked. There are no double quotes around the variable.

ExpandEnvStrings $1 "$0"
nsExec::Exec '$1 URL submitted by user.'

If I do the following, nsexec will not work.

ExpandEnvStrings $1 "$0"
nsExec::Exec '"$1" URL submitted by user.'

why is that so ? that's what the examples say I should be doing, but that doesn't work. Also, why did nsexec work on Vista, but not exec or uac::exec or execshell which worked just as I wanted on XP and win7 ? I could use some learning here.

Quick Link | Report this post to a moderator | IP: Logged

amoneriot is offline Old Post 11-25-2009 06:39 PM
Click Here to See the Profile for amoneriot Click here to Send amoneriot a Private Message Find more posts by amoneriot Add amoneriot to your buddy list Edit/Delete Message Reply w/Quote
demiller9
Senior Member

Registered: Mar 2006
From: Dallas

The Exec command fails with the quotes because the reg value already has quotes around it and you end up with two sets of quotes.

Quick Link | Report this post to a moderator | IP: Logged

demiller9 is offline Old Post 11-25-2009 07:37 PM
Click Here to See the Profile for demiller9 Click here to Send demiller9 a Private Message Find more posts by demiller9 Add demiller9 to your buddy list Edit/Delete Message Reply w/Quote
amoneriot
Junior Member

Registered: Nov 2009
From:

Thanks a lot for your help. I think all this time my real issue was that I didn't understand well how variables were supposed to be used. Not that I understand them fully now, but I'm learning a lot. Sorry for getting you thinking about something completely different than where the problem was. Maybe my execshell will now work as I had planned.

Quick Link | Report this post to a moderator | IP: Logged

amoneriot is offline Old Post 11-25-2009 07:40 PM
Click Here to See the Profile for amoneriot Click here to Send amoneriot a Private Message Find more posts by amoneriot Add amoneriot to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

I just created http://nsis.sourceforge.net/Open_UR..._COM_automation , you could try that for a non hacky solution

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 11-25-2009 08:38 PM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
amoneriot
Junior Member

Registered: Nov 2009
From:

I tried this on Win7 IE8 and it didn't work. I cut-pasted the code there as it is and then tried to call it using uac::execcodesegment but didn't work.

Quick Link | Report this post to a moderator | IP: Logged

amoneriot is offline Old Post 12-08-2009 08:21 PM
Click Here to See the Profile for amoneriot Click here to Send amoneriot a Private Message Find more posts by amoneriot Add amoneriot to your buddy list Edit/Delete Message Reply w/Quote
Anders
Major Dude

Registered: Jun 2002
From: N/A

code:
var ie = new ActiveXObject("InternetExplorer.Application"); ie.Navigate("http://www.msn.com"); ie.visible = true;

put that in a .js file and execute it with wscript.exe (code taken from http://msdn.microsoft.com/en-us/lib...28VS.85%29.aspx) If that does not work, blame MS

__________________
IntOp $PostCount $PostCount + 1

Quick Link | Report this post to a moderator | IP: Logged

Anders is offline Old Post 12-09-2009 03:09 PM
Click Here to See the Profile for Anders Click here to Send Anders a Private Message Visit Anders's homepage! Find more posts by Anders Add Anders to your buddy list Edit/Delete Message Reply w/Quote
podnuh
Junior Member

Registered: Dec 2009
From:

Presumably your installer is running with elevated privileges (because you are using the UAC plug-in). That means that when you start IE (using the methods you have been describing) it is also running with elevated privileges (because it inherits the privileges of the process that start it). This is something that you probably don't want to do, and which may be contributing to your problems with Vista.

Since you are using the UAC plug-in, you should use the UAC::Exec function to start IE with the same privileges as the user who originally invoked your installer. In order to satisfy yourself that the UAC::Exec function works, as a start I would suggest calling UAC::Exec with exactly the same syntax described in the instructions and with the path for IE hard coded as follows (Notice the use of both single and double quotes in the command):

UAC::Exec '' '" C:\Program Files\Internet Explorer\iexplore.exe "' '' ''

You are correct to dynamically look up the correct path for IE. But your first step should be to verify that the UAC:Exec function works (and it should). After that, you can add additional layers of complexity to find where the breakdown is occurring.

I hope this helps.

Quick Link | Report this post to a moderator | IP: Logged

podnuh is offline Old Post 12-10-2009 02:39 PM
Click Here to See the Profile for podnuh Click here to Send podnuh a Private Message Find more posts by podnuh Add podnuh to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 08:11 PM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > IE doesn't load after install on Vista
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON