NSIS, download using default proxy - nsis

I want to download the .NET Framework using the default proxy configuration vom IE.
I did something like this with a static proxy configuration:
${If} $downloadMethod == "proxy"
inetc::get /CAPTION "Downloading .NET Framework..." /PROXY "$proxyHostURL:$proxyPort" /USERNAME "$proxyUsername" /PASSWORD "$proxyPassword" "${DOWNLOADURLDOTNET}" "${OUTPUTPATH}\${FILENAMEDOTNET}" /end
${EndIf}
Now i want an additional option where the command "inetc::get" using the IE proxy configuration automatically. Maybe like this:
${If} $downloadMethod == "defaultProxy"
inetc::get /CAPTION "Downloading .NET Framework..." /PROXY "!THEDEFAULTSEETINGS!" "${DOWNLOADURLDOTNET}" "${OUTPUTPATH}\${FILENAMEDOTNET}" /end
${EndIf}
I also tried the "NSISdl" command without any proxy declaration, but it didn't work :
NSISdl::download "${DOWNLOADURLDOTNET}" "${OUTPUTPATH}\${FILENAMEDOTNET}"

INetC uses the WinINet API and will use the system/IE proxy setting unless you specify something else with the /PROXY parameter or use /NOPROXY...

Related

Conditional signing with Inno Setup

I'm using Inno Setup 6.0.3 and would like to control whether to sign the (un)installer via command-line. At the moment, my Setup.iss looks like this:
SignedUninstaller=true
SignTool=...
I would like to disable signing via a parameter/environment variable/whatever.
How can I do this?
The reason for this is that I'd like to disable signing on our developer workstations, whereas on our CI server the (un)installer should be signed.
InnoSetup compiler fully supports command line custom parameters, as exaplined in its Guide.
So you can define your own custom parameter within your Setup.iss file:
; CASE 1) "iscc.exe Setup.iss /DSIGN_UNINSTALLER=1" -> SIGN UNINSTALLER
; CASE 2) "iscc.exe Setup.iss -> SIGN UNINSTALLER
; CASE 3) "iscc.exe Setup.iss /DSIGN_UNINSTALLER=0" -> DOES NOT SIGN UNINSTALLER
; Enable by default (case 2)
#ifndef SIGN_UNINSTALLER
#define SIGN_UNINSTALLER "1"
#endif
...
#if SIGN_UNINSTALLER == "1"
SignedUninstaller=true
SignTool=...
#endif

Windows 10 NSIS uninstaller to also remove notification icon

I'm working on a windows 10 app but I've noticed that when I uninstall it it's icon remains in the notification & actions window. what would I need to do or add to my uninstaller to allow it to remove this icon. This is what what uninstaller look like in my .nsi script
Section "Uninstall"
Call un.XXXXXXXXX
ExecWait '"$INSTDIR\f2p_ping.exe" --f2p' $0
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyApp"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "MyApp"
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "MyApp"
DeleteRegKey HKLM "SOFTWARE\MyApp"
DeleteRegKey HKCU "Software\MyApp\Overlay\ExcludedProcesses"
DeleteRegKey HKCR "MyApp"
RMDir /r "$INSTDIR"
RMDir /r $PROGRAMFILES\MyApp
RMDir /r "$APPDATA\MyApp\*.*"
; Remove shortcuts, if any
SetShellVarContext current
Delete "$SMPROGRAMS\MyApp\*.*"
Delete "$SMPROGRAMS\Startup\MyApp.lnk"
SetShellVarContext all
Delete "$SMPROGRAMS\MyApp\*.*"
Delete "$SMPROGRAMS\Startup\MyApp.lnk"
Delete "$DESKTOP\MyApp.lnk"
; Remove directories used
SetShellVarContext current
RMDir "$SMPROGRAMS\MyApp"
SetShellVarContext all
RMDir "$SMPROGRAMS\MyApp"
RMDir "$INSTDIR"
SectionEnd
The best solution is probably to have your application hide the notifications since it already contains notification code. Run something like ExecWait '"$InstDir\MyApp.exe" /uninstall' at the start of your uninstaller.
It might be possible to use one of the IToast* interfaces with the System plugin but there is a lot of code needed and I don't know if Windows let's you pretend to be another application by using its Application Model Id. For example, MSDN has this to say about IToastNotificationHistory::Remove:
The app ID of the app that sent the specified toast notification. This app must be part of the same app package as the app making this remove request.
MSDN also has this to say about desktop apps:
Generally, sending a toast notification from a desktop app is the same as sending it from a Windows Store app. However, you should be aware of these differences and requirements:
For a desktop app to display a toast, the app must have a shortcut on the Start screen.
The shortcut must have an AppUserModelID.
Desktop apps cannot schedule a toast.

Nsis Error while installing Sql Express

Using following function to Sql Express using Nsis But getting error while running this function named InstallSQL the function is shown below
Function InstallSQL
File /oname=$TEMP\SQLEXPR32.exe Prerequisites\SQLEXPR32.exe
ExecWait '$TEMP\SQLEXPR32.exe /Q /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /ROLE=AllFeatures_WithDefaults /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /INSTANCENAME=STELLSQL /SecurityMode=SQL /SAPWD="neptune" /IndicateProgress'
FunctionEnd
below is the image of error
I know it's too late to answer, but it will be helpful who refer this page.
I have installed SQL Express 2014 SP1 with silent installation using nsis script which works successfully.
Function InstallSQL
ExecWait '"$temp\SQLEXPRADV_x64_ENU.EXE" /Q /ACTION=Install /SkipRules=RebootRequiredCheck /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQL,SSMS /INSTANCENAME="SQLEXPRESS2014" /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSVCStartupType=Automatic /AddCurrentUserAsSqlAdmin /ENABLERANU=1 /hideconsole /SECURITYMODE=SQL /SAPWD="Sql#1234" /AGTSVCSTARTUPTYPE=Manual /NPENABLED=1 /TCPENABLED=1'
FunctionEnd
Note: You can specify setup location instead of $temp

How to configure CGI on IIS 7?

I did this
http://reboltutorial.com/images/rebol-iis.png
as explained here but it was for IIS 6
http://rebolforum.com/index.cgi?f=printtopic&topicnumber=39&archiveflag=new
I also activated 32 bits for application pool as explained here
http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx
But when browsing to the test script it doesn't work, seems to take forever showing nothing, then in the end shows this message error:
502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
I used a dedicated server on windows 2008
Source code of the test script:
REBOL [Title: "Cgi Test in Rebol"]
print "HTTP/1.0 200 OK^/Content-type:text/html^/^/";
print []
print ["Date/time is:" now]
print []
Should I ask on serverfault rather as nobody seems to know here ?
Finally I got my answer, here are the steps:
Open Server Manager from Administrative Tools.
Add role "Web Server (IIS)"
Try http://localhost/ from your browser. You should see the IIS7 Welcome Page.
Copy core.exe to c:\ (or somewhere else), right click on core.exe and open Properties window, give Read & Execute access to IUSR_xxxx under Security tab. (If you've any problem, try to give Read & Execute for Everyone)
Open "Internet Information Services (IIS) Manager" from Administrator Tools.
Click on Default Web Sites, double click on Handler Mappings, click on Add Module Mapping from the right panel and type the followings:
Request Path: *.r
Module: c:\core.exe -cs %s %s
Name: Rebol
Select Yes when Add Script Map dialog box appears. It will add the c:\core.exe -cs "%s %s" as allowed under ISAPI and CGI Restrictions list.
Create a test.r file under wwwroot folder. My test.r file contains following script:
R E B O L [Title: "Server Time"]
print "content-type: text/html^/"
print [<HTML><BODY>]
print ["Date/time is:" now]
print [</pre></BODY></HTML>]
And type http://localhost/test.r on your browser.
If everything goes well then it should work.
If you are trying with View.exe then you may need to put --noinstall to command line, otherwise when View start with IUSR_xxx user account it will open desktop & installation window and it stays background (you can see it from Task Manager).
c:\view.exe -csi %s %s
You may also need to put double quotes around %s if your script is in a path with spaces. Use the following form:
c:\core.exe -cs "%s %s"
Instead of this:
c:\core.exe "-cs %s %s" (<-- this won't work!)
I hope this will help.
UPDATE: I've faced a problem on IIS6 (Windows 2003 Server), it gives 404 when I configure it as follow (it works on IIS7 as told above):
c:\core.exe -cs "%s %s"
But it runs as:
c:\core.exe" -cs "%s" %s
Here is the link for Perl installation.
http://www.howtogeek.com/50500/how-to-install-perl-on-iis-6-for-windows-server-2003/

NSIS: Problem reading installdir by InstallDirRegKey

I have a nsi script which starts as following:
Name "myprog"
OutFile "myprog.exe"
InstallDir $PROGRAMFILES32\xx
InstallDirRegKey HKLM "Software\yy\xx" "InstallDir"
RequestExecutionLevel admin
AutoCloseWindow true
BrandingText /TRIMCENTER "me"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\German.nlf"
Caption "Updateprogramm"
It works fine on my dev machine, but not on production (e.g. the user has only readonly permissions for the registry path). It is a Win 2003 server os. Even when the registry key exists, the program tries to install in $PROGRAMFILES32\xx.
InstallDirRegKey only needs read access.
The thing troubling thing for me is that you are talking about read only, but you have "RequestExecutionLevel admin" in your script. This says to me that you require admin rights and when you have "RequestExecutionLevel admin" you also need to use UserInfo::GetAccountType (To handle < NT6 systems and Vista+ when UAC is off)

Resources