nsis

NSIS: Installing an Application to always Run as Administrator

笑着哭i 提交于 2019-11-30 07:11:26
I have a NSIS script that is working well for a large application. I have read many threads all over the web, but cannot get a clear answer to the following: is it possible to install an application using NSIS which, when launched (regardless of the type of user) automatically is run as administrator? If this is possible how can it be achieved? Note: I am already imposing that the NSIS package must be run as admin using RequestExecutionLevel admin I have tried writing the UAC requirement to the applications registry entry using this method but I could not get the RUNASADMIN command to compile

Check for .NET4.5+ with NSIS

你。 提交于 2019-11-30 05:02:42
All, I am aware of the following methods to check the framework version in NSIS. For .NET4.0+ I currently use Function IsDotNetInstalled StrCpy $0 "0" StrCpy $1 "SOFTWARE\Microsoft\.NETFramework" ; Registry entry to look in. StrCpy $2 0 StartEnum: ; Enumerate the versions installed. EnumRegKey $3 HKLM "$1\policy" $2 ; If we don't find any versions installed, it's not here. StrCmp $3 "" noDotNet notEmpty ; We found something. notEmpty: ; Find out if the RegKey starts with 'v'. ; If it doesn't, goto the next key. StrCpy $4 $3 1 0 StrCmp $4 "v" +1 goNext StrCpy $4 $3 1 1 ; It starts with 'v'. Now

NSIS installer that checks for .NET Framework

萝らか妹 提交于 2019-11-30 04:58:30
I want to create an NSIS installer that checks for the .NET Framework and installs it if it's not there. Can you point me to a script for this? I'm very new to NSIS. Try the DotNetVer script. It uses LogicLib and is quite easy to use. HasDotNet<version> checks if the specific version of .NET framework is installed. <version> can be replaced with the following values: 1.0, 1.1, 2.0, 3.0, 3.5, 4.0. AtLeastDotNetServicePack checks if the .NET framework has a service pack version at least as specified. IsDotNetServicePack checks if the .NET framework has a service pack version exactly as specified

writing current date & time as file name using NSIS

拟墨画扇 提交于 2019-11-30 04:56:40
问题 I developed an installer using NSIS. Every time I re-install the application, I want to create a backup of the existing database files. How can I rename these database files using the following format 'currentdatetime'(ex: 201003101140 means 2010-03-10 at 11:40 AM)? Thanks ! 回答1: There is a built-in function in NSIS for this called ${GetTime} !include "FileFunc.nsh" !insertmacro GetTime ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 DetailPrint "currentdatetime=$2$1$0$4$5$6" This will output

How do you set directory permissions in NSIS?

泪湿孤枕 提交于 2019-11-30 03:14:00
I'm trying to build a Windows installer using Nullsoft Install System that requires installation by an Administrator. The installer makes a "logs" directory. Since regular users can run this application, that directory needs to be writable by regular users. How do I specify that all users should have permission to have write access to that directory in the NSIS script language? I admit that this sounds a like a sort of bad idea, but the application is just an internal app used by only a few people on a private network. I just need the log files saved so that I can see why the app is broken if

How to create a batch file which work for both Program Files and Program Files(x86)?

你说的曾经没有我的故事 提交于 2019-11-30 01:29:38
问题 I have created a batch file which automatically copy a .sql file to the path of installed Jasper server(it could be any software installation directory). This is my batch script-- C:\PROGRA~2\JASPER~1.0\mysql\bin\mysql.exe -u root -proot < create_database.sql that is working when jasper is installed in Program Files(x86). How can i generalize it for both Program Files and Program Files(x86). 回答1: You want to use environment variables to look up things like this. On 32bit Windows,

NSIS学习笔记之脚本结构简介

房东的猫 提交于 2019-11-30 00:20:51
NSIS学习笔记之脚本结构简介 简介 NSIS (Nullsoft Scriptable InstallSystem) 是 Windows 下的一个工具,它允许程序员来创建安装程序,NSIS 创建的安装程序能够安装、卸载、设置系统设置、解压文件等等。它基于脚本文件工作,你可以完全的控制安装程序的每一部分:脚本语言支持变量、函数、字串等操作。 本文主要是介绍NSIS脚本相关的概念,给初学者一个快速入门的指导,对于详细的功能请阅读随机附带的帮助文档。 脚本结构 一个NSIS脚本一般包括:安装程序属性、页面、区段和函数。 属性 属性主要是设置安装程序的动作、外观和行为习惯等内容。大多数属性在运行时不能被修改。最常用属性的有:Name(设置安装程序名称)、OutFile(设置安装程序文件名)。 页面 一个非静默安装程序需要使用向导页面来指导用户安装,页面(page)就是用来设定这些页面。一个典型的安装程序脚本一般包含以下定义: Page license Page components Page directory Page instfiles UninstPage uninstConfirm UninstPage instfiles 更多高级设置也已使用 PageEx等命令。 NSIS提供了很多内置的页面,对于内置的页面,都有三个回调函数:预置函数、创建函数和离开函数。 对于自定义的页面

How to create an installer with CMake + CPack + NSIS on Windows?

对着背影说爱祢 提交于 2019-11-29 23:05:10
I'd like to create a cross-platform installer for a C++ based system I am building. I use CMake to build everything, and it would be great if I could use CPack to make the installer. I already have CPack working on OSX, but I cannot get it to work on Windows. To make things easier, I tried to get the example at http://www.cmake.org/Wiki/CMake:Packaging_With_CPack to work with the NSIS installer software. I cannot find the NSIS installer anywhere after configuring (with VS 2010 Win64 generator). Maybe I am confused, but I thought it would be possible to create the installation package with only

NSIS - put EXE version into name of installer

为君一笑 提交于 2019-11-29 22:30:30
NSIS has a Name variable that you define in the script: Name "MyApp" It defines the name of the installer, that gets displayed as the window title, etc. Is there a way to pull the .NET Version number out of my main EXE and append it to the Name? So that my installer name would automatically be 'MyApp V2.2.0.0" or whatever? There might be a very simple way to do this, but I don't know what it is. When I first started using NSIS, I developed this workaround to suit my needs and haven't revisited the problem since to see if there's anything more elegant. I wanted my installers to have the same

Exec vs ExecWait vs ExecShell vs nsExec::Exec vs nsExec::ExecToLog vs nsExec::ExecToStack vs ExecDos vs ExeCmd

那年仲夏 提交于 2019-11-29 19:59:05
Can I know what are the differences between each Exec , ExecWait , ExecShell , nsExec::Exec , nsExec::ExecToLog, nsExec::ExecToStack , ExecDos and ExecCmd , as in when to use which? I 've posted the various execute calls I know. I am trying to make a comprehensive list, so that it helps future visitors.. Exec : Plainly execute the called string, be it some application, console or file. ExecWait : Executes like Exec but waits till the process exits. ExecShell : What is it for? nsExec::Exec : Just like Exec or ExecWait but only for command prompt and that too without opening the console window.