Discussion (SetupS Development Tools)

Discussion in 'SetupS Development Tools' started by The Freezer, Jul 23, 2016.

  1. The Freezer

    The Freezer Just this guy, you know Staff Member

    Open discussion(s) here.
     
  2. pacav69

    pacav69 Live long and prosper Staff Member

    How to run an application with admin privilages in a ssApp?
    like "run as admin" right click
     
  3. Ghost

    Ghost Forum Crapolator

    Most might get eat by Windblows Befeater, but who knows ...
     
  4. Ghost

    Ghost Forum Crapolator

    Gash darn it you done it again, 2016 date Bahh Humm Bugg
     
  5. bphlpt

    bphlpt A lowly staff member Staff Member

    If I understand what you are asking, you do it the same way. Right click the link for the ssapp and select the "run as administrator" option. Doesn't that work? AFAIK, it works for ppApps as well.
     
  6. pacav69

    pacav69 Live long and prosper Staff Member

    The app that i've uploaded to my directory found here
    is what i'm having trouble with if you run the the setup by itself it gives an error message as shown.
    upload_2023-7-15_14-18-33.png

    if you run it as administrator by right clicking on the setup.exe it installs correctly with no error message.
    Note: you need to have the Steam version of CNC Tiberiem wars game installed and have the reg tweek applied.
    My issue is how to run the setup as admin using it in a ssApp i tried using a cmd script but it fails to work.
     
  7. bphlpt

    bphlpt A lowly staff member Staff Member

    So I think what you are asking is not how to "run" an ssApp as an administrator, but rather how to force the ssApp's "install" procedure to be run as an administrator, correct? @Glenn, @Trouba, or @Ghost can probably advise you better than I can as to how to do that, as well as how to verify if necessary prerequisites have been installed.
     
  8. Trouba

    Trouba Administrator Staff Member

    @pacav69

    SetupS should run it as admin, but I noticed under "Assembly" in the ssApp.app file, you have:
    Code:
    "setup.exe -gm2 -! -y"
    This is not correct. Try and change this to:
    Code:
    "setup.exe" -gm2 -! -y
    
    or else just:
    
    setup.exe -gm2 -! -y
    You'll have to try this yourself, as I don't have that game installed and it gives me a message saying it couldn't find the game installed on my system.
     
  9. pacav69

    pacav69 Live long and prosper Staff Member

    @Trouba and @bphlpt thanks for the information but i think i have discovered the issue is that the installer for the worldbuilder is not a silent installer version, so i think i will examine what it installs and create a patch type of apz.
     
    Last edited: Jul 15, 2023
  10. pacav69

    pacav69 Live long and prosper Staff Member

    I've created 2 new apps and put in the repo
     
    bphlpt likes this.
  11. Glenn

    Glenn Administrator Staff Member

    Trouba is correct, SetupS ALWAYS runs as Administrator, it will not run at all if you don't elevate it and it defaults to it as best it can (meaning it will self elevate most times), ssWPI also defaults to self elevate, you have to change an option for it to be able to run without Admin (which I do for the games Launcer as you shouldn't need Admin to run 90% of games, if you do, you can hold shift to elevate the one game.

    By the way to set any exe to run as admin you use a cmd file that does it before it runs it, or you use 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers'

    https://community.flexera.com/t5/In...tibility-Flags-for-Your-Application/ta-p/4153

    There is a few games and apps that I do this with, Look at PlantsVsZombies:
    Code:
    @echo off
    reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%~dp0PlantsVsZombies.exe" /d "~ RUNASADMIN" /f
    Or if you want the cmd to self elevate:
    Code:
    :::::::::::::::::::::::::::::::::::::::::
    :: Automatically check & get admin rights
    :::::::::::::::::::::::::::::::::::::::::
    @echo off
    CLS
    ECHO.
    ECHO =============================
    ECHO Running Admin shell
    ECHO =============================
    :checkPrivileges
    NET FILE 1>NUL 2>NUL
    if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
    :getPrivileges
    if '%1'=='ELEV' (shift & goto gotPrivileges)
    ECHO.
    ECHO **************************************
    ECHO Invoking UAC for Privilege Escalation
    ECHO **************************************
    setlocal DisableDelayedExpansion
    set "batchPath=%~0"
    setlocal EnableDelayedExpansion
    ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
    ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
    "%temp%\OEgetPrivileges.vbs"
    exit /B
    :gotPrivileges
    ::::::::::::::::::::::::::::
    ::START
    ::::::::::::::::::::::::::::
    setlocal & pushd .
    REM put here code as you like
    
    
     
    pacav69 likes this.
  12. pacav69

    pacav69 Live long and prosper Staff Member

    thanks @Glenn that is very helpful
    I discovered that the app itself was not silent install friendly in that the setup had NO flags associated with the application so i created an apz that did the same thing and it works almost as good as the original.
     
  13. pacav69

    pacav69 Live long and prosper Staff Member

    With win10/11 there are some directories that require admin privilages and there maybe an app that i will need to know how to do it.
     
  14. pacav69

    pacav69 Live long and prosper Staff Member

    I've updated the help file with a few more examples and some minor tweeks.
    updated the version to v23.07.17.0

    I've stored the files on github for safety, security, version control, discussion and tracking of issues.
    When i work out where to store the files on lastos i'll do that later. As for vertek i'm not certain where it goes.

    Find itthere
     
  15. Glenn

    Glenn Administrator Staff Member

    I've updated my local copy so any future versions will contain the newer help file if I build it, keep me informed of any updates to the file so I can grab the newest ssTek.hnd to keep the updates included please.
     
    pacav69 likes this.
  16. Glenn

    Glenn Administrator Staff Member

    https://www.lastos.org/team/glenns/SetupS2023/23.05.15

    Here is my latest build, much newer than the v20 one you based the git repo on. I was waiting on Freezer to check over the changes I'd made, but now I am just using it as my own version anyway as I needed more speed and the fact the gates stopped the start menu sorting x86 apps (not x86 only apps) on x64 machines, means the older SetupS wasn't suitable for the changes Trouba and I want.
     
    Trouba likes this.
  17. pacav69

    pacav69 Live long and prosper Staff Member

    I've just altered the help file sstek.hnd and updated the version number i didn't touch the code apart from adding a link to the github repo. i noticed that the screen shots are of a older version so i will update them at a later time. I thought that storing the files on github (GH) would be a good place to store the files as it keeps track of the changes.You can fork the GH repo, make changes and submit a Pull Request (PR) allowing merging of changes or submit an issue and then the repo can be updated and resynced tracking any changes. The changelog.txt can describe the changes made.
     
  18. pacav69

    pacav69 Live long and prosper Staff Member

    Here is some info here about forking (not the other word that sounds similar :) ) found here
     
  19. Glenn

    Glenn Administrator Staff Member

    I've uploaded my fork and made you a pull request, but your website changes were not part of my source sorry, so if you can update that again I'll do a pull request and continue to edit using git in the future ;)
     
    pacav69 likes this.
  20. pacav69

    pacav69 Live long and prosper Staff Member

    no problem i keep a copy of my changes before pull the files down so there is no chance of hiccups
     
  21. pacav69

    pacav69 Live long and prosper Staff Member

    To paraphrase "may the fork be with you" :)
     
  22. Glenn

    Glenn Administrator Staff Member

    I have released a new ssWPI and games launcher to keep it all versioned the same and I'd not made time to share the changes to ssWPI, figured it's better to put it all out there and anybody who is interested can use the code/compiled versions.

    www.lastos.org/team/glenns/SetupS2023/23.07.18/
     
    bphlpt, pacav69 and Trouba like this.
  23. pacav69

    pacav69 Live long and prosper Staff Member

    good idea later after i've test the htm file i'll upload it to lastos where the old versions are located
     
  24. pacav69

    pacav69 Live long and prosper Staff Member

    I've updated the setups files to v23.07.18.1) found here and uploaded to another location here
     
    Glenn likes this.
  25. Glenn

    Glenn Administrator Staff Member

    Just make sure to use AutoIt v3.3.8.1 that is included in the development tools as if you use ANY other version it misbehaves and can cause issues.
     

Share This Page