if the innosetup.exe run as without administrative privileges' its getting error message and abort the installation? - inno-setup

but here iam getting error message both sides {message -This installer requires administrative privileges. Please run the installer as an administrator and try again.} 1.Run as administrative privileges' 2.without Run as administrative privilege's i need only error message without Run as administrative privilege's and abort the installation. Please help me
if not IsAdmin then begin
Result := False;
end else begin
MsgBox(ExpandConstant('This installer requires administrative privileges. Please run the installer as an administrator and try again.'), mbError, MB_OK);
Result := True;
end;
end;

Related

Open Git with child_process.execFile as administrator

I want to execute Git programatically with node but with administrator privileges in windows 10.
I know how to start it without admin privileges:
const execFile = util.promisify(require('child_process').execFile);
async function _startGit() {
await execFile("C:\\Program Files\\Git\\git-bash.exe");
}
and then call the function _startGit()
But what I need to add to get a Git Console started with administrator privileges in Windows 10?
Thanks

cannot execute sh script with golang - permission denied

I'm trying to make my go program to execute a script file (.sh) that in my Linux (ubuntu) system and every time I'm getting the following error:
Got command status: fork/exec /home/myname/Code/MyProj/Server/src/: permission denied
the script that I'm trying to run is pretty simple:
temp.sh:
echo tempscript:$1
temp.sh permissions:
-rwxrwxrwx 1 myname myname 19 oct 13 13:33 temp.sh
the golang code I'm using to run the script :
output, err := exec.Command("/home/myname/MyProj/Server/src/", "temp.sh").CombinedOutput()
if err != nil {
fmt.Println("Error when running command. Output:")
fmt.Println(string(output))
fmt.Printf("Got command status: %s\n", err.Error())
}
fmt.Println(string(output))
I have no problem to run this script from the terminal, but when I'm trying to run it from my go problem I'm getting the permission problem, even when I tried to do go build and run my program with sudo permission I'm still getting that error.
Happy to hear what am I doing wrong and how to solve it.
Thanks a lot
Replace the code like this,
output, err := exec.Command("/bin/bash", "/home/myname/MyProj/Server/src/temp.sh").CombinedOutput()

Inno Setup installer has prompts in verysilent mode

I am running installer with /verysilent /suppressmessagebox /norestart for upgrading my application (Windows Service). In PrepareToInstall(), I have code in place to check and stop an already running instance of my service using net stop <ServiceName>. I do log the output generated by net stop and it shows that the service has indeed been stopped. However, at times, the installer prompts that :
Message box (Abort/Retry/Ignore):
Setup was unable to automatically close all applications. It is recommended that you close all applications using files that need to be updated by Setup before continuing.
Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation.
The logs show :
2017-05-10 23:47:38.851 Log opened. (Time zone: UTC-07:00)
2017-05-10 23:47:38.851 Setup version: Inno Setup version 5.5.9 (u)
2017-05-10 23:47:38.851 Original Setup EXE: C:\Windows\TEMP\installer.exe
2017-05-10 23:47:38.851 Setup command line: /SL5="$FD006E,3807712,131584,C:\Windows\TEMP\installer.exe" /verysilent /suppressmessagebox /norestart /log=C:\ProgramData\&ltServiceName&gt\installer_2026493391.txt
2017-05-10 23:47:38.851 Windows version: 6.1.7601 SP1 (NT platform: Yes)
2017-05-10 23:47:38.851 64-bit Windows: Yes
2017-05-10 23:47:38.851 Processor architecture: x64
2017-05-10 23:47:38.851 User privileges: Administrative
2017-05-10 23:47:38.867 64-bit install mode: Yes
2017-05-10 23:47:38.867 Created temporary directory: C:\Windows\TEMP\is-OO761.tmp
.....
..... Some logs irrelevant to the issue at hand
.....
2017-05-10 23:47:39.148 Stopping &ltServiceName&gt Service - begin
2017-05-10 23:47:39.148 Command : /S /C ""net" stop &ltServiceName&gt &gt "C:\Windows\TEMP\is-OO761.tmp\~execwithresult.txt" 2&gt&1"
2017-05-10 23:47:39.257 Stopping &ltServiceName&gt Service - done
2017-05-10 23:47:39.257 The &ltService Display Name&gt service is stopping.
The &ltService Display Name&gt service was stopped successfully.
2017-05-10 23:47:39.366 RestartManager found an application using one of our files: &ltService Display Name&gt
2017-05-10 23:47:39.366 Can use RestartManager to avoid reboot? Yes (0)
2017-05-10 23:47:39.366 Starting the installation process.
2017-05-10 23:47:39.366 Shutting down applications using our files.
2017-05-10 23:47:39.382 Some applications could not be shut down.
2017-05-10 23:47:39.382 Message box (Abort/Retry/Ignore):
Setup was unable to automatically close all applications. It is recommended that you close all applications using files that need to be updated by Setup before continuing.
Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation.
There are 2 issues :
Why is message box displayed in /verysilent mode ? As per this fix, it should not be displayed in silent mode. As per documentation, I do see that :
/SILENT, /VERYSILENT
Instructs Setup to be silent or very silent. When Setup is silent the wizard and the background window are not displayed but the installation progress window is. When a setup is very silent this installation progress window is not displayed. Everything else is normal so for example error messages during installation are displayed and the startup prompt is (if you haven't disabled it with DisableStartupPrompt or the '/SP-' command line option explained above).
Why does RestartManager seem to still believe that the exe is running when it has already been stopped ? Has anyone else seen similar issues and is there a recommended way ? (say, add a 5 second pause after the net stop command)
It's /SUPPRESSMSGBOXES, not /SUPPRESSMESSAGEBOX.
It can be an antivirus or similar, what blocks the file. If you try to move/delete the binary immediately after net stop, does it succeed?

Update registry on remote machine

I am writing an Inno Setup script and I need to add a registry key on remote machine. I am not able to achieve this using Inno setup.
I tried the following code but it does not work.
Exec('cmd.exe', 'reg add \\REMOTEPC\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v test /t REG_SZ /d C:\Support\Test.exe /f', '',SW_SHOW, ewWaitUntilTerminated, ResultCode);
I looked at RegWriteStringValue as well.

Install Shield limited edition setup (Rolling back)

I have just finished creating an installer using Install Shield Limited edition. My Install shield project compiles without any errors. However, when I run the setup file, after it has copied the program files into the target folder, the installer starts rolling back and deletes the installation folder.
I have not yet put any custom action or defined any pre-requsities.
Has anyone encountered such an issue?
All I am doing in the installer is following:
Creating directory structure under "Program files (x86)" directory using "Files" option of Install shield.
Creating a Website and a application underneath it using the "Internet Information Services" option.
I have attached the settings of web application and web site with this post.
Would appreciate any inputs.
InstallShield 17:29:09: SetAspversion: machine is 64-bit and IIS running in a bit mode other than the currently selected mode
InstallShield 17:29:09: Error with IISRT: -2172
CustomAction ISIISInstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 17:29:09: InstallFinalize. Return value 3.
MSI (s) (7C:E0) [17:29:09:312]: User policy value 'DisableRollback' is 0
MSI (s) (7C:E0) [17:29:09:312]: Machine policy value 'DisableRollback' is 0
MSI (s) (7C:E0) [17:29:09:319]: Executing op: Header(Signature=1397708873,Version=500,Timestamp=1113951137,LangId=1033,Platform=0,ScriptType=2,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=1)
MSI (s) (7C:E0) [17:29:09:319]: Executing op: DialogInfo(Type=0,Argument=1033)
MSI (s) (7C:E0) [17:29:09:319]: Executing op: DialogInfo(Type=1,Argument=MyApplication)
MSI (s) (7C:E0) [17:29:09:319]: Executing op: RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action:,RollbackTemplate=1,CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=File: 1)
Action 17:29:09: Rollback. Rolling back action:
Rollback: ISIISInstall
MSI (s) (7C:E0) [17:29:09:321]: Executing op: ActionStart(Name=ISIISInstall,,)
MSI (s) (7C:E0) [17:29:09:321]: Executing op: ProductInfo(ProductKey={95199403-696F-4BF6-A443-19866156E3BD},ProductName=My Application,PackageName=My Application.msi,Language=1033,Version=16777216,Assignment=1,ObsoleteArg=0,ProductIcon=ARPPRODUCTICON.exe,,PackageCode={F3B9DBEB-71D6-42C3-B18C-1C5CCBA647E0},,,InstanceType=0,LUASetting=0,RemoteURTInstalls=0,ProductDeploymentFlags=3)
Rollback: Copying new files
Finally found a solution to the a fore-mentioned problem.
The Error with IISRT: -2172 was caused because of the setting of Application pool (app pool) in IIS.
The property named "Enable 32-Bit Applications" was set to False. When I changed its value to True, the installer was able to successfully complete the installation without rolling back.
Problem solved :)

Resources